2014-07-30
| 00:00 | Balveda | no clojurebot? |
| 00:01 | Balveda | this if tells me that it has too few arguments |
| 00:01 | jeremyheiler | need a comman before the sexp |
| 00:01 | jeremyheiler | ,(inc 1) |
| 00:01 | clojurebot | 2 |
| 00:01 | jeremyheiler | Balveda: count your parens ;-) |
| 00:02 | jeremyheiler | Balveda: balance them correctly, rather. |
| 00:03 | Balveda | thanks |
| 00:04 | jeremyheiler | np |
| 00:05 | Balveda | oh |
| 00:05 | Balveda | nm |
| 00:06 | Balveda | 'cause the main issue is I was having some issues with this func |
| 00:06 | Balveda | (if (< 3 (count data)) ((doall (take 3 data)) ((doall (drop 3 data))))) where data is a vector of vectors |
| 00:07 | Balveda | i'm putting the doalls (not to well admittedly) because it's giving me that a LazySeq can't be casted to IFn |
| 00:07 | amalloy | that is way too many parens, Balveda |
| 00:07 | jeremyheiler | yeah |
| 00:08 | Balveda | agreed |
| 00:08 | gws | it's not like other languages where they're just used for grouping - you're actually changing the semantics of your program by adding parens |
| 00:10 | Balveda | How should I deal with the LazySeq issue? |
| 00:10 | jeremyheiler | Balveda: the problem is different than you thinking |
| 00:11 | jeremyheiler | LazySeq cannot be cast to an IFn because you're trying to invoke the lazy sequenece as a function because you have too many parens. |
| 00:11 | Balveda | Mind you that these doalls are me trying to fix thsi |
| 00:11 | Balveda | this* |
| 00:12 | jeremyheiler | why did you do that? |
| 00:12 | Balveda | As I understand it, the doall evaluates the stuff I'd be passing, so it's not a LazySeq |
| 00:13 | jeremyheiler | so, what is it after you doall it? |
| 00:13 | jeremyheiler | ,(type (doall (map inc [1 2 3]))) |
| 00:13 | clojurebot | clojure.lang.LazySeq |
| 00:14 | Balveda | hm. |
| 00:14 | Balveda | What would be a good way to deal with this issue? |
| 00:14 | jeremyheiler | lets back track and look at the original error |
| 00:15 | TEttinger | ,(def data [1 2 3 4 5]) |
| 00:15 | clojurebot | #'sandbox/data |
| 00:15 | TEttinger | ,(if (< 3 (count data)) (doall (take 3 data)) (doall (drop 3 data))) |
| 00:15 | clojurebot | (1 2 3) |
| 00:15 | TEttinger | ,(if (> 3 (count data)) (doall (take 3 data)) (doall (drop 3 data))) |
| 00:15 | jeremyheiler | when you see "LazySeq can't be casted to IFn", it's saying that whatever you're trying to use (LazySeq in this case) is being used as a function. |
| 00:15 | clojurebot | (4 5) |
| 00:16 | jeremyheiler | and... that it's wrong to do so |
| 00:16 | TEttinger | I suspect you may have meant > instead of < |
| 00:16 | Balveda | True |
| 00:16 | jeremyheiler | why do you think it's trying to call a lazyseq as a function? |
| 00:16 | Balveda | ,(doc take) |
| 00:16 | clojurebot | "([n coll]); Returns a lazy sequence of the first n items in coll, or all items if there are fewer than n." |
| 00:16 | Balveda | ,(doc drop) |
| 00:16 | clojurebot | "([n coll]); Returns a lazy sequence of all but the first n items in coll." |
| 00:17 | TEttinger | no, that's not it at all |
| 00:17 | jeremyheiler | yes, those fns returns lazy seqs |
| 00:17 | jeremyheiler | look at your code. why is it trying to invoke those lazy seqs as functions? |
| 00:17 | TEttinger | ,(+ 1 2 3) |
| 00:17 | clojurebot | 6 |
| 00:17 | TEttinger | ,((+ 1 2 3)) |
| 00:17 | clojurebot | #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn> |
| 00:18 | Balveda | I'm not too sure.. if you're saying it's a parens issue I imagine I mucked it up somewhere but I can't quite see it |
| 00:18 | jeremyheiler | look at TEttinger's example carefully. |
| 00:18 | jeremyheiler | what's different between teh two expressions? |
| 00:19 | Balveda | ah |
| 00:20 | Balveda | god it |
| 00:20 | Balveda | got it* |
| 00:20 | Balveda | thanks! |
| 00:20 | jeremyheiler | :-) |
| 00:20 | Balveda | ,(inc jeremyheiler) |
| 00:20 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: jeremyheiler in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 00:20 | Balveda | heh |
| 00:20 | jeremyheiler | i don't actually exist |
| 00:20 | Balveda | Spooky |
| 00:21 | jeremyheiler | (inc Balveda) |
| 00:21 | lazybot | ⇒ 1 |
| 00:21 | TEttinger | (inv jeremyheiler) |
| 00:21 | TEttinger | (inc jeremyheiler) |
| 00:21 | lazybot | ⇒ 1 |
| 00:22 | TEttinger | the (inc) thing isn't actually evaluating code, I think it actually allows spaces in names |
| 00:22 | TEttinger | (inc #()) |
| 00:22 | lazybot | ⇒ 1 |
| 00:22 | Balveda | oh, the , is for evaluatinc code? |
| 00:22 | TEttinger | (dec #()) |
| 00:22 | lazybot | ⇒ 0 |
| 00:22 | Balveda | jeez i'm typing bad |
| 00:22 | TEttinger | yep |
| 00:22 | jeremyheiler | the inc thing is just a custom lazybot plugin |
| 00:22 | Balveda | I just hooked up this usb keyboard to my laptop and I'm readapting |
| 00:22 | Balveda | (inc jeremyheiler) |
| 00:22 | lazybot | ⇒ 2 |
| 00:23 | Balveda | all these parens and brackets were killing my right hand, heh |
| 00:23 | TEttinger | and #() is not a valid clojure identifier, which is why I picked it to check if the thing was doing any code stuff |
| 00:23 | kelseygi | CookedGryphon i'm totally creeping on the logs right now but did you ever get your emojis encoded right? |
| 00:23 | TEttinger | are the logs up again? |
| 00:23 | Balveda | Is the take/drop method proper, though? |
| 00:23 | TEttinger | what are you trying to do though? |
| 00:23 | Balveda | It seems a little brute force imo knowing that things like reduce exist, but I'm not too acquainted yet |
| 00:24 | kelseygi | i was looking at this http://clojure-log.n01se.net/date/2014-03-07.html |
| 00:24 | TEttinger | woah, march |
| 00:24 | Balveda | As a whole, I'm taking an excel and making pdf tables so as to make cards, right? I have a 3x3 grid per page, so I need to split the data I'm recieving |
| 00:24 | kelseygi | yeah i'm tryna do exactly what they were doing there |
| 00:24 | TEttinger | (doc partition-all) |
| 00:24 | clojurebot | "([n coll] [n step coll]); Returns a lazy sequence of lists like partition, but may include partitions with fewer than n items at the end." |
| 00:25 | TEttinger | (doc partition) |
| 00:25 | clojurebot | "([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." |
| 00:25 | TEttinger | ##(partition-all (range 50)) ; the ## is to eval with lazybot, which prints full sequences |
| 00:25 | lazybot | clojure.lang.ArityException: Wrong number of args (1) passed to: core$partition-all |
| 00:25 | TEttinger | ##(partition-all 3 (range 50)) ; the ## is to eval with lazybot, which prints full sequences |
| 00:25 | lazybot | ⇒ ((0 1 2) (3 4 5) (6 7 8) (9 10 11) (12 13 14) (15 16 17) (18 19 20) (21 22 23) (24 25 26) (27 28 29) (30 31 32) (33 34 35) (36 37 38) (39 40 41) (42 43 44) (45 46 47) (48 49)) |
| 00:26 | TEttinger | Balveda, does that look like the kind of output that you want? |
| 00:26 | Balveda | Yes, it's perfect |
| 00:27 | Balveda | Or, hang on; |
| 00:27 | TEttinger | ha, I'm notostraca, kelseygi |
| 00:27 | Balveda | I suppose I could have the whole set of data partitioned into threes and iterate over it with the row generator |
| 00:27 | TEttinger | indeed |
| 00:28 | Balveda | Rather than feed a list into the function and have it exhaust the initial coll |
| 00:28 | Balveda | List, vector, same thing |
| 00:28 | kelseygi | heh TEttinger, i was secretly hoping someone had been inspired to create an emoji-handling library in the time since that convo happened |
| 00:28 | TEttinger | partition guarantees items of 3, partition-all will give items of 1, 2 or 3 as the last thing just to use up the whole collection |
| 00:29 | Balveda | Partition would return nils though for the empty items in the list? |
| 00:29 | TEttinger | ##(print (partition-all 3 (range 8))" " (partition-all 3 (range 8))) |
| 00:29 | lazybot | ⇒ ((0 1 2) (3 4 5) (6 7)) ((0 1 2) (3 4 5) (6 7))nil |
| 00:29 | TEttinger | err |
| 00:29 | TEttinger | ##(print (partition3 (range 8))" " (partition-all 3 (range 8))) |
| 00:29 | lazybot | java.lang.RuntimeException: Unable to resolve symbol: partition3 in this context |
| 00:29 | TEttinger | ##(print (partition 3 (range 8))" " (partition-all 3 (range 8))) |
| 00:29 | lazybot | ⇒ ((0 1 2) (3 4 5)) ((0 1 2) (3 4 5) (6 7))nil |
| 00:29 | TEttinger | I'm not typing well either |
| 00:29 | Balveda | What's your timezone? |
| 00:30 | TEttinger | pacific standard, GMT - 8 or so |
| 00:30 | Balveda | Ah, alright; I'm GMT -3, so it's getting late |
| 00:30 | Balveda | not like I have a schedule anyways |
| 00:30 | TEttinger | partition will just not use elements if they wouldn't fill up 3, partition-all will use them up and make less-than-3-many colls |
| 00:31 | TEttinger | which you want depends a lot on whether you're expecting exactly 3 (or any number) or 3 or less |
| 00:31 | Balveda | It's the same thing either way, I'd still be making empty cards |
| 00:31 | Balveda | It's not a guarantee I'll have a multiple of 3 |
| 00:31 | TEttinger | partition-all then, I'd say |
| 00:32 | TEttinger | you can trim unneeded ones later |
| 00:32 | Balveda | Yeah, either way it's if count is < 3 or if item is nil, make an empty card |
| 00:32 | TEttinger | cool |
| 00:34 | Balveda | thanks for all the help! |
| 00:34 | Balveda | I'll be sure to pester you soon enough |
| 00:34 | Balveda | I like how clojure has these functions for handling things rather than just having to iterate al ot |
| 00:35 | TEttinger | oh yeah, you should see the stuff I can pull off in one IRC message using "clever" partition and other seq stuf |
| 00:36 | Balveda | coming from enterprise java it's a breath of fresh air |
| 00:36 | Balveda | the less I can touch that stuff the better, the things i've seen.. ugh |
| 00:36 | TEttinger | ##(clojure.string/join " "(repeatedly 2000(fn [](apply str(concat[(rand-nth ["rh""s""z""t""k""ch""n""th""m""p""b""l""g""phth"])](take(+ 2(* 2(rand-int 2)))(interleave(repeatedly #(rand-nth ["a""a""o""e""i""o""au""oi""ou""eo"]))(repeatedly #(rand-nth ["s""p""t""ch""n""m""b""g""st""rst""rt""sp""rk""f""x""sh""ng"]))))[(rand-nth ["os""is""us""um""eum""ium""iam""us""um""es""anes""eros""or""ophon""on""otron"])]))))) |
| 00:36 | lazybot | ⇒ "zeoxitum thaurkum gausteochus phthaustachium kourkofon neopaunor moganium thomon geortoutus koneosis paspanes zaumus zemouxophon rhastenis chagaufophon chourtor rhoges gamiam phthesaspus leochortus zoupeobor somanes somiam rhangiam tachertos poirkasophon soibum logi... https://www.refheap.com/88708 |
| 00:36 | TEttinger | forgive the ugliness, but lazybot only takes single lines |
| 00:37 | Balveda | nice |
| 00:37 | TEttinger | that's within about 30 chars of the limit for Freenode messages IIRC |
| 00:38 | Balveda | I'm getting on a project where I can choose what I want to dev in and despite me not having much experience with Clojure I'd rather use it than anything else |
| 00:39 | aeikenberry | can i ask a few more? |
| 00:39 | aeikenberry | i've changed my macro to accept any number of argument |
| 00:39 | aeikenberry | and i want to do something like this: |
| 00:40 | aeikenberry | (list 'cond test (list 'map 'do (:then chunkmap)) |
| 00:40 | TEttinger | Balveda, it's an awesome language |
| 00:40 | aeikenberry | but i guess you can no map do |
| 00:40 | aeikenberry | do i need to do a for? |
| 00:40 | TEttinger | that looks like a loop/recur or reduce problem; how did you solve the first, aeikenberry? |
| 00:41 | jeremyheiler | aeikenberry: mapping do doesn't make much sense |
| 00:41 | aeikenberry | yeah, i'm not making a new coll |
| 00:41 | aeikenberry | i just want to iterate over and do that stuff |
| 00:42 | jeremyheiler | aeikenberry: remember, macros jobs are to spit out code. |
| 00:42 | jeremyheiler | do you really need to "iterate" over anything? |
| 00:44 | jeremyheiler | (cons 'do (:then chunkmap)) |
| 00:45 | jeremyheiler | if the value of :then in the map is a list of expresions, you can just cons do to the front |
| 00:45 | jeremyheiler | (you could also dive into using syntax-quote and unquote-splicing to create a more literal macro) |
| 00:45 | aeikenberry | https://dpaste.de/cKOb |
| 00:46 | jeremyheiler | so, |
| 00:46 | jeremyheiler | ,(list 'do '(1 2 3)) |
| 00:46 | clojurebot | (do (1 2 3)) |
| 00:46 | jeremyheiler | vs |
| 00:46 | jeremyheiler | ,(cons 'do '(1 2 3)) |
| 00:46 | clojurebot | (do 1 2 3) |
| 00:47 | aeikenberry | ah |
| 00:47 | aeikenberry | thanks jeremyheiler |
| 00:47 | jeremyheiler | np! |
| 00:49 | aeikenberry | if you are stuck in repl |
| 00:50 | TEttinger | ctrl-d to exit |
| 00:50 | aeikenberry | thanks |
| 00:50 | TEttinger | might be z or c |
| 00:50 | jeremyheiler | burn your computer and buy a new one |
| 00:51 | aeikenberry | my exp isn't terminating |
| 00:51 | aeikenberry | no number of ))'s or "'s |
| 00:51 | aeikenberry | will let me finish |
| 00:51 | aeikenberry | how do i scrap that but not leave repl? |
| 00:52 | jeremyheiler | ctrl+c if you're just in a lein repl |
| 00:53 | aeikenberry | doesn't seem to work for me |
| 00:56 | aeikenberry | thanks for all the help |
| 00:58 | aeikenberry | https://dpaste.de/srFZ |
| 00:58 | aeikenberry | last one |
| 01:00 | aeikenberry | ,(do (quote ok) (quote cool)) |
| 01:00 | clojurebot | cool |
| 01:02 | aeikenberry | ,(do (println 'ok) (println 'cool)) |
| 01:02 | clojurebot | ok\ncool\n |
| 01:02 | aeikenberry | what's going on there? |
| 01:02 | TEttinger | aeikenberry, there's no way to do an early terminate and stay in repl |
| 01:03 | aeikenberry | TEttinger, oh ok. thanks |
| 01:03 | TEttinger | like if you try to assign a variable to the evaluation of an infinite sequence, terminating and staying in repl would be bad |
| 01:03 | TEttinger | (unless you have infinite ram) |
| 01:03 | aeikenberry | that makes sense |
| 01:03 | jeremyheiler | ,(println "hi") |
| 01:03 | clojurebot | hi\n |
| 01:03 | jeremyheiler | aeikenberry: so, clojurebot is hiding it, but println returns nil |
| 01:03 | TEttinger | aeikenberry, also, do returns the last element |
| 01:04 | TEttinger | but it evals the others, it doesn't print them unless you tell it to print |
| 01:04 | aeikenberry | ah |
| 01:08 | aeikenberry | off to bed. you guys rock. great first day of clojure |
| 01:08 | aeikenberry | thanks again |
| 01:08 | TEttinger | no prob, glad to help |
| 01:08 | jeremyheiler | good night! |
| 02:48 | swgillespie | hi all, is there a way to read a single character from stdin without calling into java? |
| 02:48 | TEttinger | well seeing as... #(class *in*) |
| 02:48 | TEttinger | well seeing as... ##(class *in*) |
| 02:48 | lazybot | ⇒ clojure.lang.LineNumberingPushbackReader |
| 02:49 | TEttinger | interesting |
| 02:49 | TEttinger | it's different here than at a command line repl |
| 02:49 | TEttinger | ,(class *in*) |
| 02:49 | clojurebot | clojure.lang.LineNumberingPushbackReader |
| 02:49 | TEttinger | maybe not |
| 02:50 | TEttinger | swgillespie, is this at the repl or in a running application like a jar? |
| 02:50 | swgillespie | Shouldn't it be the same in both scenarios? |
| 02:50 | swgillespie | I'm writing a brainfuck interpreter as an intro to clojure |
| 02:50 | TEttinger | repl I think uses a different class for *in*, likely has the same API |
| 02:52 | TEttinger | ,(.read *in*) |
| 02:53 | TEttinger | n |
| 02:53 | swgillespie | TEttinger: (read *in*) reads until a newline for me |
| 02:53 | clojurebot | eval service is offline |
| 02:53 | TEttinger | oh whaaaaat |
| 02:53 | TEttinger | no, .read |
| 02:53 | TEttinger | read is ##(doc read) |
| 02:53 | lazybot | ⇒ "([] [stream] [stream eof-error? eof-value] [stream eof-error? eof-value recursive?]); Reads the next object from stream, which must be an instance of java.io.PushbackReader or some derivee. stream defaults to the current value of *in* ." |
| 02:53 | TEttinger | an object |
| 02:53 | swgillespie | oh jeez |
| 02:53 | TEttinger | but .read is a method on Reader, which is what *in* implements |
| 02:54 | swgillespie | gotcha |
| 02:54 | TEttinger | it is java, but the only clue is that there's a . |
| 02:54 | swgillespie | I see, I didn't catch the dot |
| 02:58 | swgillespie | oh, I see - even if you put in multiple characters to the terminal, (.read *in*) pops them off one at a time |
| 02:58 | swgillespie | thanks TEttinger |
| 03:01 | TEttinger | no prob, swgillespie |
| 03:28 | blunte | Q: is it possible to do something like this? (defrecord RecBar [a b]) (defn foo [rectype a b] (->rectype a b)) ? |
| 03:29 | blunte | it's not able to compile the function (because it has no idea what a "rectype" is) |
| 03:32 | blunte | I'm trying to make a function that can accept any type of defined record, read a file, and populate records from the file. But I can't figure out how to define that function (how to tell the compiler that it should expect some generic "class") |
| 03:32 | pyrtsa | blunte: If it helps, you could construct a RecBar instance with assoc, like this: (assoc (map->RecBar {}) :a 1 :b 2), or just use map->RecBar. |
| 03:33 | pyrtsa | Does the returned type of record depend on the contents of the file somehow? Or only the contents? |
| 03:33 | blunte | yes, I'm making a file reader that should populate and return a set of the appropriate type of record |
| 03:33 | blunte | so I want to call load-file with the RecBar or RecBoo or whatever the appropriate record type is for the associated file |
| 03:34 | pyrtsa | So the caller tells that "read this file, it should return a RecBar", right? |
| 03:34 | blunte | I need some way of saying (defn foo [this-is-a-class-that-has-arrow-operator filename] ...) |
| 03:34 | blunte | yes |
| 03:35 | pyrtsa | Then assoc could just work. |
| 03:35 | blunte | I'll read about assoc. I'm quite new, so it doesn't mean much to me yet. Thanks! |
| 04:38 | engblom | What free and open-source data storage library would you use if you do not want a separate database server (like mysql, postgresql)? I would even prefer something not being SQL at all as that requires a lot of mapping between clojure data-structures and SQL. |
| 04:39 | ssideris | engblom: I happily use honeysql, but that might be too close to SQL for your liking |
| 04:40 | ssideris | but I don't end up doing many conversions really |
| 04:40 | hyPiRion | engblom: So what's the use case? That's seems pretty important when deciding on DB. |
| 04:40 | hyPiRion | I mean, do you have structural data? Or is it not that important with schemas etcs? |
| 04:40 | Glenjamin | what sort of load, do you need to access from multiple processes |
| 04:40 | ssideris | engblom: sorry, I mis-read your question, ignore me |
| 04:44 | TEttinger | engblom, I have seen an article that mentioned how easy it is to use clojure's built-in transactional memory to make in-memory DBs |
| 04:45 | TEttinger | http://blog.malcolmsparks.com/?p=67 |
| 04:47 | engblom | The typical projects would be in size of a personal project manager keeping track of how many hours I have been working on different projects and a short description. |
| 04:47 | TEttinger | oh wow, hat one isn't in-memory |
| 04:48 | TEttinger | heh, engblom: 30 lines enough? I'm curious if anyone has improved on that example |
| 04:48 | engblom | In memory DB would be great if it had some durability by writing in the background to disk. |
| 04:49 | engblom | TEttinger: That one I found earlier today when I googled for this question |
| 04:50 | TEttinger | yeah, it's number one on my search, but it is good. I will check github for improvements other people made |
| 04:50 | Glenjamin | spit on change / slurp on boot might be enough for that case |
| 04:52 | Glenjamin | oh right, thats what this does |
| 04:52 | hyPiRion | engblom: You could probably use Monger, which has this automatic conversion to and from Clojure data structures if I read it right |
| 04:53 | TEttinger | there's also https://github.com/ibdknox/simpledb/blob/master/src/simpledb/core.clj |
| 04:53 | hyPiRion | I've never used MongoDB though, so take that with a grain of salt. |
| 04:53 | TEttinger | I have, it does need a server |
| 04:54 | hyPiRion | Oh, so we're talking bundling everything up in the same application? |
| 04:54 | Glenjamin | there are few, if any, good reasons to use mongo in my experience |
| 04:55 | Glenjamin | either your app is too small to get any benefits over a normal DB, or its too big and scaling is a pain |
| 04:55 | TEttinger | Glenjamin, yeah I'm curious what the better alternatives are? |
| 04:55 | Glenjamin | me too |
| 04:55 | Glenjamin | we use it quite a bit here, and we all hate it now |
| 04:56 | engblom | I wonder if MongoDB is a server-client database or just a library storing to a local file? |
| 04:56 | hyPiRion | It is a "proper" database. |
| 04:57 | engblom | OK, thanks! |
| 04:57 | engblom | I might still look into it as monger seem to do what I wish to do, from the short description. |
| 05:00 | TEttinger | but yeah mongodb does have a server (daemon) running |
| 05:00 | engblom | The reason I wish it would not be a server-client database is because I would want to be able to upload whatever I make to any java-server and know it will run regardless of if they provide mysql-, postgresql-, whatever-server |
| 05:00 | TEttinger | mongod |
| 05:01 | TEttinger | it might be the most flexible to use something like what ibdknox provides in that sample |
| 05:01 | TEttinger | slurp and spit can serialize non-binary data |
| 05:01 | TEttinger | or rather with the right toString things for the types you use |
| 05:11 | engblom | What do you think about this one: https://github.com/gcv/cupboard ? |
| 05:11 | TEttinger | that looks excellent |
| 05:12 | TEttinger | but I know nothing about Berkeley DB |
| 05:12 | engblom | Sadly it seem to not be actively developed anymore |
| 05:13 | TEttinger | ah, AGPL |
| 05:24 | teemu_f | ClojureScript q: I'd like to filter data based on search term (basic search box). How do I use js/RegExp properly? Basic (filter #(term (:name %)) data-chunk) works but accepts only direct matches. |
| 05:34 | ebaxt | I'm looking for a light-weight solution for scheduling jobs across multiple clojure apps. I need to make sure only one application runs the job for each trigger. I've looked at Quartzite, but it only supports this via JDBC-JobStore, and were not using any RDMS. Does anyone here use any other solution for this type of scenario? |
| 05:47 | gws | maybe it wouldnt' be too hard to plug yours in, or maybe a library already exists |
| 05:51 | ebaxt | gws: I noticed that as well. Currently the mongodb adapter doesn't support clustering (https://github.com/michaelklishin/quartz-mongodb/issues/66), so I'm trying to figure out if there are other options that already support this before adding the feature myself |
| 05:59 | gws | ah, i see - yeah given your requirements either etcd/zookeeper for coordination or adding that feature to the existing mongodb adapter seem like the paths of least resistance |
| 06:00 | gws | there are some lighter weight schedulers but none attempt to run "singleton" jobs across a cluster, at least not that i'm aware of |
| 06:04 | ebaxt | gws: ok, I'm currently using chime, but this is the first time I need synchronization across multiple servers. We also use redis so I guess I could use a global lock as well. Anyways, I was hoping there was a small idiomatic clojure lib that I didn't know about that solved it for me :) |
| 06:06 | schmir | ebaxt: RabbitMQ may be an option. but that's not really light-weight |
| 06:11 | ebaxt | schmir: Thanks, but I would prefer not to add another pice of infrastructure :) |
| 06:17 | sveri | Hi, I am using http-kit and lein cljsbuild on windows 7. Now, when I run the cljsbuild in advanced|whitespaced mode and start up my server the rebuild of the cljs file fails because the server or leiningen or whatever still has a handle on it, causing that the cljsbuild cannot write the js file. Did someone experience the same? Any Ideas how to solve it (switching to linux is not rly a valid proposal in my case ;-)) |
| 06:30 | engblom | In *nix you have dot-folders in $HOME for storing data. In Windows you have AppData under your profile. Other OS might have other places... How do you best store data belonging to the user? Do I need manually to detect OS and take different actions depending on OS? |
| 06:31 | engblom | Is there a ready library for this? |
| 06:32 | imperman | engblom: OS checking is the safest way, I think. Check this also - https://github.com/derekchiang/Clojure-Watch |
| 06:34 | katratxo | sveri: i guess that is a common windows issue and not a lein cljsbuild specific problem, right? https://en.wikipedia.org/wiki/File_locking#In_Microsoft_Windows |
| 06:35 | imperman | engblom: here is also some platform-neutral examples - http://stackoverflow.com/questions/21198361/clojure-file-system-portability |
| 06:38 | sveri | katratxo: Yea, that's my guess too, I was just wondering if anyone knows a workarund, besides that, It works if I compile the cljsbuild without any optimization |
| 06:49 | teemu_f | Okay, having lunch helped with my regex problem.. |
| 06:49 | teemu_f | (filter #(not (nil? (re-matches (re-pattern search-term) (:name %)))) (:persons app)) |
| 06:52 | nobodyzzz | (not (nil? ...)) is not nesseccary i suppose |
| 06:53 | teemu_f | yup, I just removed them |
| 06:54 | teemu_f | first you make it work, then clean up afterwards :) |
| 06:54 | ro_st | you can just use re-find, btw |
| 06:55 | ro_st | (->> app :persons (filter (comp (partial re-find (re-pattern search-term) :name)))) |
| 06:56 | ro_st | erk |
| 06:56 | ro_st | (->> app :persons (filter (comp (partial re-find (re-pattern search-term)) :name))) |
| 06:57 | blunte | Is it possible to pass in a class (such as a defined record) to a function, and then within the function use operations from that class? |
| 06:58 | blunte | (defrecord R [a b]) (defn foo [a-rec-class val1 val2] (->a-rec-class val1 val2)) |
| 07:01 | teemu_f | ro_st: thanks for alternative solution. I'm not that familiar with comp function yet, have to try it |
| 07:04 | scape_ | why do I get a "no matching field for class" error? https://www.refheap.com/88710 |
| 07:05 | ro_st | init is a static method |
| 07:05 | ro_st | Bullet/init |
| 07:05 | scape_ | public static |
| 07:05 | scape_ | yes |
| 07:05 | scape_ | oh ok |
| 07:07 | scape_ | thanks |
| 07:14 | clgv | blunt: just pass in the appropriate function |
| 07:14 | blunte | clgv: I'm not sure I understand? |
| 07:15 | clgv | blunte: you can pass any function as parameter to any other function in clojure |
| 07:16 | blunte | clgv: so I pass ->R instead of R ? |
| 07:16 | clgv | blunte: yes |
| 07:17 | clgv | ,(do (defrecord R [a b]) (defn foo [f a b] (f a b)) (f 1 2)) |
| 07:17 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: f in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 07:18 | clgv | ,(do (defrecord R [a b]) (defn foo [f a b] (f a b)) (foo ->R 1 2)) |
| 07:18 | clojurebot | #sandbox.R{:a 1, :b 2} |
| 07:18 | blunte | clgv: that's great, and simple |
| 07:18 | clgv | blunte: but that minimal function is actually pretty useless^^ |
| 07:19 | blunte | clgv: yes, there's actually more going on in my foo. data will be read from a file, and records will be generated. the details come down to the filename (what's in the file) and the type of record I'm stuffing it into |
| 07:19 | blunte | clgv: much thanks :) |
| 07:19 | clgv | np# |
| 07:59 | razum2um | how to load a jar with -javaagent options with lein ? |
| 08:01 | clgv | razum2um: https://github.com/technomancy/leiningen/blob/stable/sample.project.clj#L252 |
| 08:01 | razum2um | clgv: thanks |
| 08:21 | mbac | http://dev.clojure.org/display/community/Clojure+Success+Stories |
| 08:21 | mpenet | how do you even put stuff in a c.core.async/sliding-buffer? |
| 08:21 | mpenet | >!! >! put! seems all to fail |
| 08:22 | mbac | that success stories link is a bit hand wavey. e.g. i believe citigroup usees clojure *somewhere* but it doesn't say what for |
| 08:22 | ro_st | mpenet: don't you pass the sliding buffer as an arg to chan, and write to the chan? |
| 08:23 | mpenet | ah, might be! |
| 08:23 | mpenet | right, chan!=buffer |
| 08:26 | AeroNotix | gfredericks: can I depend on this code for production uses? https://github.com/gfredericks/vcr-clj |
| 08:26 | AeroNotix | looks like it would be useful for some stuff we're doing here |
| 08:27 | teemu_f | Hooray, there's a new euroclojure 2014 video on vimeo! Hope the rest will be there soon.. |
| 08:28 | ro_st | link teemu_f? |
| 08:28 | teemu_f | http://vimeo.com/euroclojure |
| 08:29 | mbac | is there a macro like defn, but where if you call the function with too few arguments it returns a function that takes the remaining arguments? |
| 08:30 | mbac | that is, it auto partially applies the function? |
| 08:30 | ro_st | no. not even slightly. |
| 08:30 | mbac | it seems like it should be doable |
| 08:30 | ro_st | oh, wait. i read that as 'is macro like defn, but' |
| 08:30 | ro_st | isn't that like fnil? |
| 08:31 | ro_st | http://grimoire.arrdem.com/1.6.0/clojure.core/fnil |
| 08:31 | ro_st | it's kinda similar |
| 08:32 | clgv | mbac: https://github.com/gfredericks/currj ? |
| 08:32 | ohpauleez | mbac: You want to curry |
| 08:33 | mbac | right |
| 08:33 | ohpauleez | there are a few curry macros out there, including one in definition of reducers (called defcurry) |
| 08:33 | pyrtsa | I think #'clojure.core.reducers/defcurried does it but it's unfortunately declared private. |
| 08:34 | ohpauleez | It's also fun to write that macro, so as a thought exercise, you can take a stab at writing it before looking at others ( mbac ) |
| 08:34 | mbac | basically i have a form like this: |
| 08:34 | mbac | (defn date-to-string [date] (time-format/unparse (time-format/formatters :year-month-day) date)) |
| 08:34 | mbac | and i want to be able to factor out the date |
| 08:34 | mbac | (def date-to-string (time-format/unparse (time-format/formatters) :year-month-day)) |
| 08:35 | mbac | and i can, by using partial, but that's almost as long as the original |
| 08:36 | gfredericks | AeroNotix: by "production" do you mean "testing code used in production"? |
| 08:37 | AeroNotix | gfredericks: yeah |
| 08:37 | AeroNotix | same diff :) |
| 08:37 | gfredericks | clgv: mbac: currj is like three things at once, and currying is one of them; it's not complete though |
| 08:38 | gfredericks | AeroNotix: I've been using it for that for over a year now |
| 08:38 | AeroNotix | gfredericks: ok, I'll take 'er for a spin |
| 08:38 | AeroNotix | thanks :) |
| 08:38 | gfredericks | np |
| 08:41 | gfredericks | AeroNotix: I'm reminded now of the "library extensibly serializing" problem that I didn't know how to solve; now I'm wondering if transit could do it, but of course we're not supposed to persist transit... |
| 08:42 | gfredericks | AeroNotix: be aware of issue #2; there's a separate release described there with a haxy fix |
| 08:43 | gfredericks | might have to write my own damn edn printer to fix it properly |
| 08:45 | mbac | http://stackoverflow.com/questions/5329079/higher-order-functions-in-clojure |
| 08:45 | mbac | the answer below the accepted answer, defn-ho, seems like the business |
| 08:49 | mbac | oh currj. hmm. |
| 08:49 | H4ns | so i have this clojure application packed in an uberjar and now i wonder where i would put a suitable log4j.properties file so that it is seen when i run the application. can anyone help? |
| 08:50 | gfredericks | ,(defn curry [f arg-num] (if (pos? arg-num) (fn [& args] (curry (apply partial f args) (- arg-num (count args)))) f)) |
| 08:50 | clojurebot | #'sandbox/curry |
| 08:50 | gfredericks | ,(defn plus (curry + 3)) |
| 08:50 | clojurebot | #<IllegalArgumentException java.lang.IllegalArgumentException: Parameter declaration curry should be a vector> |
| 08:50 | gfredericks | ,(def plus (curry + 3)) |
| 08:50 | clojurebot | #'sandbox/plus |
| 08:50 | gfredericks | ,(plus 8) |
| 08:50 | clojurebot | #<sandbox$curry$fn__25 sandbox$curry$fn__25@c5a44e> |
| 08:50 | gfredericks | ,(plus 8 9 10) |
| 08:50 | clojurebot | #<core$partial$fn__4232 clojure.core$partial$fn__4232@1b66659> |
| 08:51 | gfredericks | ,(plus 8 9 10 11) |
| 08:51 | clojurebot | #<core$partial$fn__4234 clojure.core$partial$fn__4234@1ccad9c> |
| 08:51 | gfredericks | oops |
| 08:51 | ohpauleez | close |
| 08:52 | gfredericks | I guess if you call curry with a non positive number it should just call your function :D |
| 08:52 | gfredericks | ,(defn curry [f arg-num] (if (pos? arg-num) (fn [& args] (curry (apply partial f args) (- arg-num (count args)))) (f))) |
| 08:52 | clojurebot | #'sandbox/curry |
| 08:52 | gfredericks | ,(def plus (curry + 3)) |
| 08:52 | clojurebot | #'sandbox/plus |
| 08:52 | gfredericks | ,(curry 8 9 10) |
| 08:52 | clojurebot | #<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: sandbox/curry> |
| 08:52 | gfredericks | ,(plus 8 9 10) |
| 08:52 | clojurebot | 27 |
| 08:52 | gfredericks | ,(plus 8 9) |
| 08:52 | clojurebot | #<sandbox$curry$fn__166 sandbox$curry$fn__166@1d57c7> |
| 08:52 | gfredericks | ,((plus 8 9) 10) |
| 08:52 | clojurebot | 27 |
| 08:52 | gfredericks | ,(((plus 8) 9) 10) |
| 08:52 | clojurebot | 27 |
| 08:52 | gfredericks | ,((plus 8) 9 10) |
| 08:52 | clojurebot | 27 |
| 08:52 | gfredericks | ,(curry + 0) |
| 08:52 | clojurebot | 0 |
| 08:53 | gfredericks | could also get it to support extra args getting called on the return value |
| 08:53 | drbobbeaty | H4ns: I put mine in the resources/ directory at the top-level of the leiningen project, and it is (by definition) in the classpath, and will get picked up. |
| 08:53 | H4ns | drbobbeaty: ah, thanks, i'll try that! |
| 08:54 | drbobbeaty | H4ns: let me know if it fails for you - but it shouldn't. |
| 08:57 | H4ns | drbobbeaty: it appears not to be picked up. i probably make a very basic mistake. maybe i'm not even using log4j, but java.utils.logger. i'll have a look. |
| 09:00 | Mandar | hello |
| 09:00 | Mandar | quick leiningen question |
| 09:00 | Mandar | i've just started a new project with 'lein new sg |
| 09:00 | drbobbeaty | H4ns: when I `lein uberjar` it places my log4j.properties file from my resources/ directory at the top-level of the generated jar in the target/ directory - both the stand-alone jar, and the non-standalone version. |
| 09:01 | Mandar | added [org.clojure/math.combinatorics "0.0.8"] to my project.clj file |
| 09:01 | Mandar | and ran lein deps |
| 09:01 | Mandar | but looks like nothing got downloaded |
| 09:01 | H4ns | drbobbeaty: yeah, i think what i was missing was log4j itself. trying that right now. |
| 09:01 | H4ns | tada! |
| 09:02 | H4ns | drbobbeaty: thanks! i've added it to my project.clj and the props from the resources directory are picked up. |
| 09:02 | Mandar | and when adding (:require [clojure.math.combinatorics :as combo]) to my core.clj file, I only get an exception (java.io.FileNotFoundException) |
| 09:02 | hyPiRion | Mandar: does project.clj look like this? https://www.refheap.com/88713 |
| 09:03 | drbobbeaty | H4ns: Great! :) |
| 09:03 | Mandar | hyPiRion, yes it does |
| 09:03 | hyPiRion | Mandar: well, that's strange, because it works fine over here. |
| 09:04 | Mandar | hmm |
| 09:04 | Glenjamin | anyone know where i can find a decent levenstein distance function? |
| 09:05 | Mandar | hyPiRion, lein deps :tree shows the dependency as well |
| 09:05 | hyPiRion | Glenjamin: there's one in Lein main. It's levensthein-damerau though, and not particularly performance tuned |
| 09:06 | hyPiRion | Mandar: ohh |
| 09:06 | hyPiRion | Mandar: wait no, I thought I understood why, but I don't. |
| 09:07 | hyPiRion | Mandar: this happens when you do `lein repl`, right? |
| 09:08 | Mandar | it happens when I eval the require line in Lighttable |
| 09:08 | hyPiRion | Hm. I'm not sure how Lighttable and Lein works together, so I'm not sure how I could help you there |
| 09:09 | hyPiRion | Other than just restart Lighttable and/or ensure that the :require call is within a file in the project. |
| 09:09 | Mandar | I'll try with the repl first, you're right |
| 09:10 | hyPiRion | At least we can trace it down to some specific software |
| 09:11 | Mandar | heh, restarting LightTable worked |
| 09:11 | Mandar | thank you hyPiRion |
| 09:12 | hyPiRion | You're welcome. I guess LT has to reload the dependencies somehow – I wouldn't be surprised if there is some feature which makes you able to do so without restarting it |
| 09:12 | hyPiRion | But I'm no LT person, so that's just a guess |
| 09:23 | teslanick | If you disconnect from the connected client and then reconnect, it will re-retrieve dependencies. |
| 09:23 | teslanick | (usually) |
| 09:24 | teslanick | (with relevant caveats about disconnecting from running state possibly screwing up your development process) |
| 09:31 | Mandar | teslanick, thanks |
| 09:31 | razum2um | I wonder why do all lein plugins exist if putting a lib into ~/.lein/profiles.clj under :dependencies is way better than that. why should i start another jvm and force my clojure to be scripty-like when i can require lib (not plugin!) in my repl an feed it with any clojure structure as argument |
| 09:35 | TimMc | razum2um: Well, for one thing, that would require having a buildable project. |
| 09:36 | TimMc | For another, some tasks require varying the dependencies, so you wouldn't want the plugin in that same dependency space. |
| 09:36 | razum2um | TimMc: plugins like expectations or midje (for continous testing) don't do any good if project isn't buildable anyway |
| 09:37 | TimMc | I mean, I agree that if your plugin *could* just be a library, maybe it *should* be, but that's just not always the case. |
| 09:37 | clgv | razum2um: if you want to customize build related stuff, then you'll probably need a leiningen plugin |
| 10:58 | tvanhens | x |
| 11:11 | technomancy | hm; he left. I was going to tell him that he's right, and most plugins being created nowadays should just be libs. |
| 11:34 | raj91 | Is there any rationale for why `for` doesn't wrap body-expr in an implicit do? |
| 11:34 | jcromartie | raj91: because `for` is a sequence comprehension and not for side effects |
| 11:35 | jcromartie | also, it basically does |
| 11:35 | jcromartie | it uses let |
| 11:35 | jcromartie | and do |
| 11:35 | jcromartie | so |
| 11:36 | jcromartie | ,(first (for [i (range 100000)] (println "i =" i) i)) |
| 11:36 | clojurebot | #<CompilerException clojure.lang.ArityException: Wrong number of args (3) passed to: core/for, compiling:(NO_SOURCE_PATH:0:0)> |
| 11:37 | jcromartie | ,(first (for [i (range 100000)] i)) |
| 11:37 | clojurebot | 0 |
| 11:37 | clgv | the ultimative laziness check is with (range) ;) |
| 11:39 | AWizzArd | clgv: as soon you want to produce the full range the jvm can be everything, but lazy ;) |
| 11:41 | raj91 | jcromartie: thanks your explanation makes sense -- but as you showed, only one body-expr is allowed |
| 11:42 | clgv | AWizzArd: I always do that to heat my office ;) |
| 11:42 | jcromartie | clgv: oh neat, I didn't know there was a 0-arity version |
| 11:58 | elben | when running (clojure.core.typed/check-ns), I get the message below, even though (meta *ns*) is nil: |
| 11:58 | elben | Finished collecting myapp.core |
| 11:58 | elben | Collected 1 namespaces in 1021.73551 msecs |
| 11:58 | elben | Not checking myapp.core (tagged :collect-only in ns metadata) |
| 11:58 | elben | sorry for the multi-line. any ideas why it would say “not checking myapp.core”? |
| 12:04 | ambrosebs | elben: can you share the ns form? |
| 12:04 | elben | ambrosebs: (ns myapp.core (require [clojure.core.typed :refer [check-ns ann] :as t])) |
| 12:05 | ambrosebs | elben: should be :require instead of require |
| 12:05 | ambrosebs | elben: core.typed uses tools.namespace, which is (correctly) rather picky about the ns form |
| 12:06 | ambrosebs | elben: what happened here is core.typed doesn't pick up the ns dependncy of clojure.core.typed, which means the namespace isn't type checked. |
| 12:06 | elben | interesting—so some other module is the one that is “non-picky” and allows ‘require? |
| 12:06 | stuartsierra | The `ns` macro is notoriously lax about what it accepts. |
| 12:12 | edw | In CIDER, is there a(n easy) way to get C-u C-x C-e to automagically put some text (e.g. ";; => ") in between point and the inserted result? |
| 12:19 | TimMc | ,(ns sandbox (:+ 1 2)) |
| 12:20 | clojurebot | nil |
| 12:20 | TimMc | ,(ns sandbox (:println hello)) |
| 12:20 | clojurebot | hello\n |
| 12:21 | technomancy | ~egalitarian-ns |
| 12:21 | clojurebot | Gabh mo leithscéal? |
| 12:21 | technomancy | dang it clojurebot |
| 12:21 | technomancy | http://p.hagelb.org/egalitarian-ns.html |
| 12:22 | Raynes | technomancy: We should storm into Rich Hickey's home playing Nirvana with that patch in hand. |
| 12:22 | technomancy | clojurebot: egalitarian-ns is seizing power from those who have held it exclusively for too long: http://p.hagelb.org/egalitarian-ns.html rise up, workers |
| 12:22 | clojurebot | Ok. |
| 12:23 | Raynes | Phil and I have grand plans for if that damned thing is ever accepted. |
| 12:23 | Raynes | Grand plans, I say. |
| 12:23 | technomancy | well it would have to be submitted before it could be accepted |
| 12:23 | Raynes | Conch, for starters, would become orders of magnitudes more often. |
| 12:23 | stuartsierra | Making tools.namespace even harder to maintain? :P |
| 12:23 | Raynes | technomancy: It says something that neither of us is brave enough to do it :( |
| 12:24 | Raynes | stuartsierra: I also maintain a similar library. I'm cool with it :p |
| 12:24 | Raynes | s/often/awesome/ |
| 12:24 | Raynes | not enough coffee, can't brain |
| 12:24 | stuartsierra | I guess it wouldn't be too bad, but why do you want arbitrary code in the ns declaration? |
| 12:24 | technomancy | Raynes: I read that as "conch would come into being orders of magnitude more often" and started wondering if you have some paranormal ability to cross into multiple time streams |
| 12:25 | Raynes | Well, yeah, but not relevant. |
| 12:25 | technomancy | stuartsierra: because clojure.core/require is not the be all and end all of code loading? |
| 12:25 | technomancy | https://code.google.com/p/clj-nstools/ for one |
| 12:25 | technomancy | the :like clause is really nice |
| 12:25 | stuartsierra | technomancy: I don't claim it is, but why does the alternative have to be *inside* the ns form? |
| 12:25 | technomancy | plus it's a requirement for experimenting with nix-like namespaces |
| 12:26 | technomancy | stuartsierra: it just looks gross otherwise |
| 12:26 | Raynes | stuartsierra: Yes. |
| 12:26 | Raynes | :p |
| 12:26 | technomancy | nstools has existed for years, and no one uses it because it's so hideous to hack around not having it in proper ns |
| 12:26 | Raynes | I think conch is a pretty great example of why this would be awesome. It'd make it darn near as seamless as amoffat's Python lib. |
| 12:27 | Raynes | Without silly metahax |
| 12:27 | gfredericks | Raynes: referring shellout commands? |
| 12:27 | Raynes | gfredericks: ? |
| 12:27 | gfredericks | (:me.raynes.conch/require-commands [ls]) |
| 12:27 | Raynes | Sure |
| 12:28 | gfredericks | wasn't sure if that's what you meant by "it" |
| 12:28 | stuartsierra | What's wrong with just putting stuff at the top-level after `ns`? It's all side-effects anyway, even `ns`. |
| 12:28 | Raynes | What's wrong with just having this three line change? |
| 12:28 | Raynes | :p |
| 12:29 | Raynes | I mean, we could do without (ns ..) entirely. |
| 12:29 | technomancy | stuartsierra: it's ugly |
| 12:29 | technomancy | there's value in maintaining the illusion of declarativity |
| 12:29 | Raynes | If this wasn't so trivial, I'd be more opposed. |
| 12:30 | technomancy | literally all of functional programming is just making changes to bits in memory somewhere |
| 12:30 | technomancy | but we like to be able to pretend it's clean and pure and purty |
| 12:31 | tbaldridge | My favorite comeback to those who claim functional purity "yeah, but you malloc call has side effects...." |
| 12:31 | technomancy | anyway I've come to grips that it's never going to happen, but it's an interesting thought experiment |
| 12:32 | stuartsierra | I'll be the first to line up and say I don't like the syntax of `ns`, but I'm not convinced that adding arbitrary code execution would make it better. :) |
| 12:32 | Raynes | stuartsierra: I'll fight you. |
| 12:32 | technomancy | allowing experimentation in userspace is always preferable to requiring patches to get applied to clojure itself |
| 12:32 | gfredericks | it already has mostly arbitrary code execution |
| 12:32 | gfredericks | it's just ugly |
| 12:33 | technomancy | gfredericks: (ns my.thingy (:eval (my.other.ns with-args))) |
| 12:33 | technomancy | wooo |
| 12:33 | gfredericks | right |
| 12:33 | stuartsierra | heh |
| 12:34 | Raynes | I need a new editor color scheme |
| 12:35 | technomancy | actually kinda wish I had somewhere I could sneak this :eval ns thing in |
| 12:35 | technomancy | somewhere that isn't leiningen I mean |
| 12:38 | gfredericks | technomancy: huh? |
| 12:39 | gfredericks | technomancy: oh like you just want to use :eval so that people can see you using it? |
| 12:40 | technomancy | "We've secretly replaced these clojure programmers' reasonable ns forms with something containing :eval. Let's see if they notice." |
| 13:06 | mirf | hi jimmybot |
| 13:07 | mirf | I'm pleased to meet you |
| 13:28 | daGrevis | yelp! https://gist.github.com/876ad28c7d70d70bbefa |
| 13:30 | stuartsierra | daGrevis: something called `concat` in a loop. |
| 13:30 | daGrevis | hmm |
| 13:31 | daGrevis | https://gist.github.com/10dc0db756867c4662bf |
| 13:31 | daGrevis | only place I'm using concat is build-chain and it always should get the same input |
| 13:31 | daGrevis | so why is it failing randomly |
| 13:32 | jcromartie | daGrevis: inside build-words you have your loop binding backwards |
| 13:32 | jcromartie | I think |
| 13:32 | daGrevis | what does it mean? |
| 13:33 | jcromartie | sorry, I misinterpreted the loop binding |
| 13:34 | stuartsierra | It's `merge-with concat` that's the problem. `concat` is lazy, so each time you call it you build a deeper "stack" of lazy sequences. |
| 13:35 | daGrevis | <daGrevis> only place I'm using concat is build-chain and it always should get the same input |
| 13:35 | daGrevis | <daGrevis> so why is it failing randomly |
| 13:35 | stuartsierra | When one of those lazy sequence nestings is deeper than the max Java stack size, you get a stack overflow. |
| 13:36 | daGrevis | ok I guess I understand |
| 13:36 | daGrevis | how could I fix it? |
| 13:36 | stuartsierra | Replace the sequences with vectors, and use `into` instead of `concat`. |
| 13:37 | daGrevis | great! you're awesome :) |
| 13:39 | stuartsierra | daGrevis: Thanks! Good luck. |
| 13:59 | seangrove | dnolen_: What do you think about a cljs patch that lets users supply a munging function? Then when exporting a js-oriented library, you could export updateIn and swapDanger instead of update_in and swap_BANG_? |
| 14:01 | dnolen_ | seangrove: I don't see how this isn't already solved by existing export support in Closure and thus ClojureScript |
| 14:01 | gfredericks | clojurebot: swapDanger |would be| a decent name for a character in an adventure story |
| 14:01 | clojurebot | c'est bon! |
| 14:01 | dnolen_ | this types of things inline well |
| 14:02 | seangrove | dnolen_: Thinking specifically about Mori and the complaints about the naming |
| 14:03 | seangrove | dnolen_: What's the existing option that closure supports? |
| 14:03 | dnolen_ | ^:export works |
| 14:03 | seangrove | dnolen_: Ah, you mean one-by-one, rather than a systemic approach |
| 14:04 | dnolen_ | for methods you can use externs. |
| 14:04 | dnolen_ | seangrove: something like that is super low priority |
| 14:04 | Fare | hi |
| 14:04 | seangrove | Yeah, I'm not saying it's on the critical path for cljs support |
| 14:05 | dnolen_ | seangrove: feel free to make a ticket and low priority ticket + patch - I'll take a look if you do |
| 14:05 | dnolen_ | er, you know what I mean |
| 14:05 | seangrove | Heh, sure |
| 14:05 | Fare | is it possible to have resources that are only available during testing? |
| 14:05 | mdrogalis | dnolen_: Saw the Facebook immutable JS library you tweeted about. Pretty neat that it came out of there. |
| 14:05 | Fare | i.e. test files for my compiler to execute? |
| 14:05 | dnolen_ | mdrogalis: very neat, React may very well bring immutability to masses |
| 14:05 | mdrogalis | Fare: Check out Leiningen profiles. You can change the resource path. |
| 14:06 | mdrogalis | dnolen_: For sure. :) |
| 14:06 | ro_st | dnolen_: you must be stoked :-) |
| 14:07 | dnolen_ | ro_st: exciting times |
| 14:07 | Fare | (inc mdrogalis) |
| 14:07 | lazybot | ⇒ 5 |
| 14:08 | Fare | ls test_resources a good name for such a resources directory? |
| 14:08 | lazybot | home mnt proc sbin srv usr var |
| 14:09 | Fare | is, not ls |
| 14:09 | arrdem | as good a name as any.. |
| 14:09 | arrdem | /resources/{test,production} could work too.. |
| 14:09 | ro_st | o/ arrdem. round two begins |
| 14:10 | arrdem | ro_st: o/ |
| 14:11 | arrdem | ro_st: I'm gonna grab some food and get started on Oxcart for the day, hit me up if I can help |
| 14:13 | ro_st | for sure |
| 14:49 | ben_vulpes | i'd like to do (clojure.java.shell/sh "cp" "place/dir/*"), but the wildcard isn't hitting bash correctly. how should i use a wildcard with c.j.s/sh? |
| 14:49 | amalloy | ben_vulpes: sh does not go through your shell at all |
| 14:49 | amalloy | if you want to call bash instead of calling cp, then shell out to bash instead of to cp |
| 14:50 | ben_vulpes | gotcha. |
| 14:50 | amalloy | (eg, with bash -c) |
| 14:50 | ben_vulpes | (sh "bash" "-c" "cp") |
| 14:50 | amalloy | yep |
| 14:50 | ben_vulpes | thanks, amalloy ! |
| 14:50 | ben_vulpes | derp dorp o'clock |
| 14:51 | amalloy | guys you know what would be amazing? a bash history file that's context-sensitive, so i can see what i did last time i was in this stupid directory a month ago |
| 14:51 | technomancy | oh man |
| 14:51 | technomancy | I bet that would be pretty easy to write in eshell |
| 14:52 | technomancy | as horrible as hash tables are in elisp, it'd be a lot nicer than bash |
| 14:53 | hiredman | https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/per-directory-history |
| 14:53 | hiredman | links to some bash versions I guess |
| 14:58 | justin_smith | you'd think someone would have made a shell with a decent simple language underlying it (something like sh with extensions using scheme or lua) ... then again I bet it exists and nobody uses it. Hell, it's probably been done a few hundred times by now. |
| 15:02 | technomancy | justin_smith: that's kind of exactly what eshell is? |
| 15:02 | technomancy | also scsh, but that seems to have stalled out |
| 15:03 | xeqi | sounds like a repl |
| 15:03 | justin_smith | did scsh ever have proper sh syntax reading though? |
| 15:03 | tuft | amalloy: maybe this? http://www.compbiome.com/2010/07/bash-per-directory-bash-history.html |
| 15:03 | justin_smith | xeqi: repl with convenient process invocation / chaining, yeah |
| 15:06 | arrdem | justin_smith: seems like you just need a faster starting interpreter with a | operator defined... |
| 15:06 | llasram | There's some interesting ideas in the Python `sh` library: http://amoffat.github.io/sh/ |
| 15:07 | llasram | Aside from the fact that Python's syntax makes REPL usage kind of awkward |
| 15:08 | justin_smith | llasram: yeah, there are a bunch of languages that can almost do it, but they make normal shell usage awkward / don't fully support | > >> & etc. functionality |
| 15:09 | justin_smith | even eshell doesn't have all the redirects |
| 15:10 | llasram | justin_smith: One of the interesting thing about the Python `sh` library is that it instead has pretty Pythonic equivalents |
| 15:11 | llasram | e.g. instead of having a literal "|" pipe syntax, the return values of subprocess functions are objects which cause the `sh` library to setup process pipelines when passed as input to other subprocess functions |
| 15:13 | jinks_ | I guess what people are really looking for is not "a shell implemented in $language and leveraging those features" but more of a "bash linked against $language" so they can carry 100% of their bash-isms across |
| 15:13 | llasram | Yeah, maybe so |
| 15:14 | justin_smith | jinks_: yeah, maybe an escape syntax to embed the extension language, and then define extensions as standard compatible bash functions |
| 15:14 | jinks_ | shells like bash and zsh have decades of accumulated features and use-cases, so every "new" player on the field has to deal with a torrent of "that's nice, but can it do X like in bash" |
| 15:15 | justin_smith | because of course eshell can take input from a file or put output in a file in many elaborate ways (elisp is an editor extension language after all), it just isn't ready for some of my first attempt command line building syntaxes |
| 15:25 | amalloy | gfredericks: i need your damn system-exit library, so i can hook it to fire whoever is calling System/exit without even logging a warning saying where or why |
| 15:25 | gfredericks | system-slash-exti |
| 15:25 | gfredericks | s/exti/exit/ |
| 15:26 | Raynes | amalloy: grep . -R 'System/exit' |
| 15:26 | Raynes | stfu gtfo |
| 15:26 | amalloy | Raynes: sure, bro. let me know when you've got that searching all the libraries in my project |
| 15:26 | justin_smith | Raynes: I bet there is some git command that will search commits for a string, and report the usernames of people who have checked in said commits |
| 15:27 | arrdem | Bronsa: how did you get GitHub to email you diffs on commits? |
| 15:27 | arrdem | Bronsa: I can't find that option |
| 15:29 | alandipert | amalloy, lein cp | tr : '\n' | grep 'jar$' | xargs grep -R 'System/exit' |
| 15:30 | arrdem | Ah. email service. got it. |
| 15:31 | amalloy | justin_smith: git log -SSystem/exit --pretty=%an |
| 15:35 | amalloy | git log -p -SSystem/exit '--pretty=format:%h %an' is a little better so you can tell why they touched System/exit |
| 15:37 | justin_smith | cool, I figured it was possible |
| 15:37 | amalloy | today i learned about -S |
| 15:42 | Bronsa | arrdem: AFAIK github doesn't offer a way to email all the commits, I just use the dashboard rss feed + rss2email |
| 15:42 | arrdem | Bronsa: that works. there's also an email service you can enable per-repo that sends an email with the message and link on commits pushed |
| 15:42 | Bronsa | rly |
| 15:52 | ro_st | my kingdom for a way to add deps to a lein project without restarting my jvm |
| 15:52 | ro_st | ok, maybe not my kingdom. this cookie, perhaps? |
| 15:52 | arrdem | have karma need libs |
| 15:54 | llasram | ro_st: alembic? https://github.com/pallet/alembic |
| 15:55 | llasram | ro_st: And... you mentioned something about a cookie? |
| 15:55 | ro_st | :cookie: |
| 15:55 | arrdem | (inc llasram) |
| 15:55 | lazybot | ⇒ 30 |
| 15:55 | ro_st | if your client supports emoji, eat up :-) |
| 15:55 | ro_st | thanks llasram i'll try that! |
| 15:55 | arrdem | I need to post my erc-emoji mode.. |
| 15:55 | ro_st | -adds yak to queue- |
| 15:56 | justin_smith | 🍪 |
| 16:04 | mi6x3m | evening, can someone tell me of a project using expectations? |
| 16:06 | schmee | mi6x3m: using what? |
| 16:06 | mi6x3m | schmee: the library expectactions... |
| 16:06 | schmee | ahh, didn |
| 16:06 | schmee | 't know about that, looks cool |
| 16:07 | mi6x3m | schmee: popular and nice testing library :) |
| 16:07 | mi6x3m | but cant figure out the naming scheme for test files |
| 16:09 | justin_smith | mi6x3m: what kind of content? |
| 16:11 | mi6x3m | justin_smith: well give a namespace x.y.z how would you name the test file? |
| 16:11 | mi6x3m | x.y.z-expectations? |
| 16:13 | justin_smith | x.y.test.z |
| 16:13 | justin_smith | under a parallel source tre under test/ rather than src/ |
| 16:13 | justin_smith | *tree |
| 16:14 | mi6x3m | justin_smith: yeah that one's clear :) |
| 16:15 | mi6x3m | justin_smith: I would rather use the same tree just append "-test" to every leaf |
| 16:16 | justin_smith | sure, that's another option |
| 16:25 | mi6x3m | justin_smith: what is the difference between use :only and require :refer ? |
| 16:27 | justin_smith | mi6x3m: off the top of my head, I forget, I do know that require :refer is preferred though - it may have something to do with the namespace mappings that are generated |
| 16:28 | mi6x3m | justin_smith: seems to be equivalent http://stackoverflow.com/questions/10358149/in-clojure-1-4-what-is-the-use-of-refer-within-require |
| 16:28 | arrdem | gfredericks: how is lein lein possibly useful |
| 16:28 | justin_smith | mi6x3m: yeah, I just experimented, and they led to identical ns mappings it seems |
| 16:28 | technomancy | arrdem: 無 |
| 16:28 | gfredericks | arrdem: so say you needed to run a leiningen task |
| 16:29 | gfredericks | but for some reason you were using leiningen |
| 16:29 | gfredericks | lein-lein lets you tie those two together |
| 16:29 | gfredericks | we all love using leiningen, but sometimes you just need to run a leiningen task |
| 16:29 | technomancy | "It's synergy" |
| 16:29 | gfredericks | clojurebot: lein-lein is https://github.com/gfredericks/lein-lein |
| 16:29 | clojurebot | Ok. |
| 16:29 | arrdem | http://www.arrdem.com/i/upset.gif |
| 16:31 | technomancy | gfredericks: what the heck did you do to your readme |
| 16:31 | justin_smith | technomancy: it bothers me that emacs tells me that is "CJK IDEOGRAPH-7121" rather than anything mentioning "mu" |
| 16:31 | gfredericks | technomancy: huh? |
| 16:32 | ro_st | technomancy: where can i find intel on getting a list of all the jars that will load in a lein project? |
| 16:32 | technomancy | gfredericks: the copyright sign |
| 16:32 | Raynes | what |
| 16:32 | technomancy | justin_smith: oh, that is regrettable |
| 16:32 | Raynes | I stop in here for 5 minutes |
| 16:32 | Raynes | And I get lein-lein |
| 16:32 | technomancy | gfredericks: it copies as :copyright: instead of © |
| 16:32 | gfredericks | technomancy: the plugin profile does that |
| 16:33 | justin_smith | RaynesRaynes: that's what you get for joining #clojureclojure |
| 16:33 | technomancy | huh... maybe github screwed up their rendering |
| 16:33 | technomancy | the raw version is fine |
| 16:33 | mikerod | gfredericks: is lein-lein a serious thing? |
| 16:33 | technomancy | they always seemed a bit loopy for emoji |
| 16:33 | mikerod | I'm debating if it is a joke |
| 16:33 | technomancy | ro_st: I'm not sure what you mean |
| 16:34 | gfredericks | mikerod: I'm interested to see how people use it. |
| 16:34 | justin_smith | ro_st: perhaps you want "lein deps :tree" |
| 16:34 | amalloy | gfredericks: yes lein | xargs lein |
| 16:35 | mikerod | hmmm |
| 16:35 | mdrogalis | gfredericks: Gonna fork it to lein-lein-lein. An improvement. One more, you see. |
| 16:35 | mikerod | `lein lein lein lein lein lein lein with-profile -user repl` hmmm |
| 16:35 | mikerod | I can see that being useful! |
| 16:35 | technomancy | mdrogalis: careful... it's a slippery slope |
| 16:35 | mikerod | :P |
| 16:35 | arrdem | just in case you type lein a bunch of times thoughtfully before you select a command.. |
| 16:36 | mdrogalis | technomancy: I don't have a problem! Just one more!! |
| 16:36 | amalloy | i could stand to have git-git |
| 16:36 | mikerod | arrdem: yes I was thinking if you accidentally forget how many times you've typed lein |
| 16:36 | mdrogalis | For hesitation? |
| 16:36 | mdrogalis | `git`... "Ah, what did I want to type?.." `-git`.... |
| 16:36 | arrdem | amalloy: if you build a git-git lemme know.. |
| 16:36 | arrdem | or I may later today |
| 16:36 | amalloy | arrdem: it's easy to build; the trouble is i don't know how to make the tab-completion work for it |
| 16:36 | ro_st | technomancy: so i have a project.clj in a lein project. i want to load that project with lein.core, and generate a list of the jars on disk that would result from the dependencies in that project |
| 16:37 | technomancy | arrdem: https://twitter.com/technomancy/status/327234371813781505 |
| 16:37 | amalloy | without which it's pretty pointless |
| 16:37 | ro_st | so that i can walk through them doing… things |
| 16:37 | arrdem | technomancy: my god |
| 16:37 | mdrogalis | Soo good |
| 16:38 | justin_smith | (inc technomancy) |
| 16:38 | lazybot | ⇒ 127 |
| 16:38 | justin_smith | that command line was fucking amazing |
| 16:39 | justin_smith | and congrats, you are almost too big for a byte now |
| 16:40 | aeikenberry | hello again! |
| 16:40 | aeikenberry | I have my macro working for the most part |
| 16:40 | aeikenberry | https://dpaste.de/Ou0T |
| 16:40 | aeikenberry | but getting an exception afterwards that I can't seem to shake |
| 16:40 | aeikenberry | any ideas? |
| 16:41 | aeikenberry | (noob) |
| 16:42 | technomancy | ro_st: sounds like `lein classpath` with the directory entries filtered out |
| 16:42 | TimMc | justin_smith: Nah man, he's unsigned. |
| 16:42 | technomancy | not on the JVM! |
| 16:43 | TimMc | :-) |
| 16:43 | TimMc | I wish Java allowed you to use char as an unsigned int or whatever. |
| 16:44 | justin_smith | aeikenberry: have you tried macroexpanding your call? |
| 16:44 | aeikenberry | yeah |
| 16:45 | aeikenberry | (if (= 1 8) ((println (quote ok)) (println (quote cool))) ((println (quote nooooo)) (println (quote noooo)) (println (println (quote wellok))))) |
| 16:45 | justin_smith | ,((println "OK")) aeikenberry: |
| 16:45 | clojurebot | OK\n#<NullPointerException java.lang.NullPointerException> |
| 16:45 | justin_smith | it prints, that returns nil, then it tries to call nil as a function |
| 16:45 | justin_smith | you want do |
| 16:46 | justin_smith | (cons 'do (for ...)) |
| 16:46 | justin_smith | on each branch |
| 16:46 | justin_smith | and after that, if you use macros again, learn ` / ~ / ~@ |
| 16:46 | aeikenberry | that's what i had before, but it would only print the last quote |
| 16:46 | aeikenberry | i need a way to ensure they all get printed |
| 16:47 | justin_smith | do will not prevent that |
| 16:47 | aeikenberry | i still plan on using the those symbols once it's 100% |
| 16:48 | aeikenberry | need to learn more about them though |
| 16:48 | aeikenberry | like the difference between ~ and ~@ |
| 16:48 | justin_smith | ,(do (defn first-if-key [coll] (if (or (= (first coll) :then) (= (first coll) :else)) (first coll) coll)) (defmacro multi-if [test & args] (let [chunks (partition-by #{:then :else} args)] (let [chunkmap (apply hash-map (map first-if-key chunks))] (list 'if test (cons 'do (for [x (:then chunkmap)] (list 'println x))) (cons 'do (for [x (:else chunkmap)] (list 'println x))))))) (multi-if (= 1 8) :then 'ok 'cool :else 'nooooo 'noooo |
| 16:48 | justin_smith | (println 'wellok))) |
| 16:48 | clojurebot | #<RuntimeException java.lang.RuntimeException: EOF while reading> |
| 16:48 | justin_smith | too big :( |
| 16:49 | justin_smith | anyway, that version (which should be reformatted of course) does work |
| 16:49 | aeikenberry | ah! i see what you mean now |
| 16:52 | aeikenberry | thanks man |
| 16:52 | justin_smith | also, you could simplify first-if-key: (if (or (= coll [:then]) (= coll [:else])) ...) |
| 16:52 | justin_smith | np |
| 16:52 | justin_smith | at least I find the above simpler, that's a style thing I guess |
| 16:57 | dagda1 | anybody here familiar with the devcards source? |
| 17:01 | justin_smith | bhauman is sometimes on this channel (isn't here now it seems) |
| 17:01 | justin_smith | $seen bhauman |
| 17:01 | lazybot | bhauman was last seen quitting 3 weeks and 4 days ago. |
| 17:10 | gfredericks | $ lein do lein do lein do lein do lein do version |
| 17:10 | gfredericks | Leiningen 2.4.2 on Java 1.7.0-release OpenJDK Client VM |
| 17:10 | gfredericks | ^ protip |
| 17:10 | aperiodic | gfredericks: time that |
| 17:12 | gfredericks | okay |
| 17:12 | gfredericks | sys 0m0.190s |
| 17:12 | gfredericks | real 0m1.729s |
| 17:13 | gfredericks | is there a lein-time |
| 17:13 | aperiodic | that's not too bad! |
| 17:14 | mdrogalis | Are we still going on about lein-*? D: |
| 17:14 | mdrogalis | The revenge of lein-lein-lein. |
| 17:14 | gfredericks | aperiodic: it's all just one jvm |
| 17:16 | aperiodic | huh, is `do` implemented in the shell wrapper? |
| 17:17 | gfredericks | no...that's why it's one jvm |
| 17:19 | aperiodic | well, if it were in the shell bit, then wouldn't the only jvm it would need to launch be the one needed for the version task? |
| 17:20 | gfredericks | leiningen tasks can run other leiningen tasks without needing another jvm |
| 17:20 | gfredericks | like so: https://github.com/technomancy/leiningen/blob/master/src/leiningen/do.clj#L39-40 |
| 17:21 | aperiodic | and so lein-lein treats the `lein` task as a no-op since there's already a lein running? |
| 17:23 | gfredericks | well it's not a noop |
| 17:23 | gfredericks | it's the exact same thing that happens when you use `lein do` without any commas |
| 17:25 | aperiodic | ah, that makes sense |
| 17:27 | hyPiRion | but guess what happens when you do `lein do repl, trampoline repl, repl, trampoline repl` |
| 17:27 | gfredericks | O_O |
| 17:28 | technomancy | it tears a hole in the fabric of spacetime |
| 17:29 | amalloy | i bet lein doesn't like to have some tasks trampolined and others not |
| 17:30 | adamt | Hi. Does anybody know when clojars.org will be back up again? |
| 17:30 | hyPiRion | amalloy: that's the "tears a hole in the fabric of spacetime" part, along with some repl bugs during shutdown |
| 17:30 | technomancy | adamt: it's just the splash page that's down |
| 17:30 | aperiodic | heh, `lein trampoline trampoline repl` works |
| 17:30 | technomancy | https://clojars.org/cheshire |
| 17:31 | amalloy | do you hear that, adamt? that's the sound of hundreds of programmers frantically checking that their builds still work |
| 17:31 | aperiodic | for certain definitions of "works" |
| 17:31 | adamt | amalloy: most of all i just hear the noise of the fan, trying to keep this room calm.. |
| 17:32 | adamt | technomancy: thanks :-) |
| 17:32 | technomancy | https://github.com/ato/clojars-web/issues/235 |
| 17:32 | adamt | technomancy: and thanks for all the work you've put into various projects i depend on. |
| 17:33 | technomancy | wish I had the time to actually fix it |
| 17:34 | gfredericks | (inc technomancy) |
| 17:34 | lazybot | ⇒ 128 |
| 17:36 | technomancy | sweet; I made it. |
| 17:36 | technomancy | well, it's been fun. catch you cats and dogs later. |
| 17:37 | gfredericks | wait wait but what about unicode |
| 17:37 | amalloy | technomancy has ascended to join me in #two-byte-clojure |
| 17:38 | justin_smith | amalloy: I prefer to call it #short-clojure |
| 17:38 | amalloy | justin_smith: i like that better too, but i decided it wasn't quite as obvious, and misses the nice pun on two-bit |
| 17:38 | justin_smith | oh, I missed the two-bit pun |
| 17:38 | technomancy | also I'm tall |
| 17:39 | amalloy | hah |
| 17:39 | technomancy | then again, tall is what they call the smallest drinks at starbucks |
| 17:39 | amalloy | justin_smith: insensitive clod |
| 17:42 | ro_st | Raynes: does refheap expect pygmentize to be executable at the project root? |
| 17:42 | ro_st | i'm grabbing your highlight code for grimoire |
| 17:43 | Raynes | https://github.com/Raynes/refheap#usage |
| 17:43 | ro_st | oh, nm. i see :dir says where to do things |
| 17:43 | Raynes | bootstrap snatches pygments |
| 17:43 | Raynes | Puts it in the correct place |
| 17:43 | ro_st | cool, tx |
| 17:44 | Raynes | ro_st: All you really need is pygmentize though |
| 17:44 | gfredericks | technomancy: they have short drinks too it's just a secret |
| 17:44 | Raynes | ro_st: So if you can just pip install a recent version of pygments, you should be fine. |
| 17:44 | ro_st | ok, cool, ta |
| 17:44 | technomancy | gfredericks: inconceivable. |
| 17:44 | Raynes | ro_st: The reason I'm fetching from bitbucket is because I needed to make patches frequently at first. |
| 17:45 | technomancy | gfredericks: some places will even make a cup of french press for you if you ask nicely |
| 17:45 | technomancy | what's weird is going to a place where you ask that and they're like "what's a french press?" |
| 17:45 | justin_smith | technomancy: I wonder if they will do pour-overs |
| 17:45 | technomancy | justin_smith: a bridge too far |
| 17:46 | technomancy | french presses are pretty hard to screw up, even if you're not trained. but it's too easy to make a bad pour over. |
| 17:47 | technomancy | I had an indie place near where I live stop doing pour overs since there wasn't demand for it... I have to do puppy-dog eyes to get it now, and even then it only sometimes works. |
| 17:47 | gfredericks | they've been doing pour-over every time I ask for a decaf for years |
| 17:48 | technomancy | no kidding? |
| 17:48 | technomancy | like on one of those ceramic cone things? |
| 17:49 | hyPiRion | technomancy: what? I think French presses are really easy to work with |
| 17:49 | gfredericks | technomancy: eeh, it mighta been plastic |
| 17:49 | gfredericks | no guarantees |
| 17:49 | amalloy | hyPiRion: that's what he said |
| 17:49 | technomancy | hyPiRion: yeah, hard to screw up -> easy to work iwth |
| 17:50 | technomancy | gfredericks: still... hum. I will check next time I am forced to fall back on starbucks |
| 17:50 | ro_st | thanks Raynes i'm sorted |
| 17:50 | amalloy | i figured every building in seattle was a starbucks |
| 17:50 | technomancy | amalloy: that's what makes avoiding them such a challenge! |
| 17:50 | hyPiRion | oh. I have no idea why I thought you meant they were hard to work with. hrm |
| 17:51 | gfredericks | Starbucks: Fall back on us. |
| 17:51 | technomancy | gfredericks: it's an acceptable plan B |
| 17:51 | Chousuke | I've only drunk coffee at starbucks once. In Japan :P |
| 17:52 | technomancy | actually they've started rolling out the clover brewer now supposedly, which might make things more interesting |
| 17:52 | Chousuke | they pretty much don't exist in Finland |
| 17:52 | technomancy | I guess it all depends on whether they're featuring any blends that aren't dark-roasted to hell on that particular week |
| 17:52 | hyPiRion | Chousuke: It's the same over all of Fennoscandia |
| 17:52 | gfredericks | technomancy: I use starbucks when I get out of the city |
| 17:52 | hyPiRion | No Starbucks here either |
| 17:53 | gfredericks | Starbucks: Let us be your lower bound |
| 17:53 | technomancy | Chousuke: are there strong existing chains that have filled the gap? |
| 17:53 | gfredericks | maybe they don't have the gap |
| 17:54 | Chousuke | Also the best coffee ever I had in Japan too. some random old (like, 70-90 years old) guy kept a cafe on the Hachijoujima island. best coffee ever. |
| 17:54 | technomancy | Chousuke: from what I can tell the pour-over renaissance in the US is largely fueled by imports from japan |
| 17:54 | Chousuke | technomancy: I don't think we have a single chain so much as random coffee shops everywhere. |
| 17:54 | hyPiRion | There are incredibly many small ones over here, but no big one. |
| 17:55 | technomancy | kind of like how the west lost access to aristotle and only rediscovered his works through arabic translations |
| 17:55 | technomancy | huh |
| 17:55 | technomancy | but yeah, all the pour over gear is Hario this, Yama that. |
| 17:56 | gfredericks | chemex |
| 17:56 | technomancy | hyPiRion: is there a general preference for supporting independent shops vs megacorps? |
| 17:56 | Chousuke | I make my own coffee with an aeropress mostly because it's decent and very easy. |
| 17:56 | Chousuke | it's also trivial to clean, which is really nice. |
| 17:57 | technomancy | yeah, taste:effort ratio of aeropress can't be beat =) |
| 17:57 | hyPiRion | technomancy: No, I don't think it is intentional. |
| 17:57 | technomancy | curious |
| 17:58 | Chousuke | there might not be enough people to support massive chain franchises |
| 17:58 | Chousuke | every place needs a coffee shop in finland anyway |
| 17:59 | hyPiRion | technomancy: I think it's just that Norwegians drink insanely much coffee, and that small companies can actually live fine after bootstrapping |
| 17:59 | hyPiRion | I think every person over 15 year old drink 4 cups a day on average. |
| 18:00 | technomancy | yeah my grandmother is swedish and she guzzles it like water |
| 18:00 | Chousuke | Finns held the world record at some point. don't know if we still do |
| 18:01 | amalloy | http://en.wikipedia.org/wiki/List_of_countries_by_coffee_consumption_per_capita |
| 18:01 | nathan7 | so have y'all built a Clojure-powered coffee maker yet |
| 18:01 | hyPiRion | Chousuke: you still do by a large margin |
| 18:02 | Chousuke | seems so |
| 18:02 | technomancy | sweden's gotta step up their game |
| 18:02 | amalloy | nathan7: we can make a mean cup of java |
| 18:02 | technomancy | make for an all-scandanavian top-10 |
| 18:02 | nathan7 | amalloy: <3 |
| 18:02 | Chousuke | I wonder why coffee is so popular in the nordic countries |
| 18:03 | technomancy | I'd be interested in seeing it by percentage of adult population that drinks coffee |
| 18:03 | technomancy | rather than by kg |
| 18:03 | hyPiRion | Chousuke: yeah, it's strange that it's such a dramatic difference |
| 18:04 | hoverbear | Hey folks, I'm getting a cljs error (I think?) https://gist.github.com/Hoverbear/3bd455c73786c7ffb70f#file-gistfile1-txt-L66 any suggestions on how to dig into this? My project.clj is at the bottom in comment |
| 18:06 | Guest58805 | Hi, I have a question about def: https://gist.github.com/kurtenbachkyle/866136fba285385badc9 |
| 18:06 | Guest58805 | Am I missing something about how def works? |
| 18:07 | gfredericks | nope |
| 18:07 | gfredericks | you're missing something about how quote works |
| 18:07 | gfredericks | ,(def foo-1 {:a 1}) |
| 18:07 | clojurebot | #'sandbox/foo-1 |
| 18:07 | gfredericks | ,(def foo-2 {:a 2}) |
| 18:07 | clojurebot | #'sandbox/foo-2 |
| 18:07 | gfredericks | ,(def foos '(foo-1 foo-2)) |
| 18:07 | clojurebot | #'sandbox/foos |
| 18:07 | gfredericks | ,foos |
| 18:07 | clojurebot | (foo-1 foo-2) |
| 18:07 | catern | foos is a list of the symbol "foo-1" and the symbol "foo-2" |
| 18:08 | gfredericks | ,(str foo-1) |
| 18:08 | clojurebot | "{:a 1}" |
| 18:08 | gfredericks | ,(str (first foos)) |
| 18:08 | clojurebot | "foo-1" |
| 18:09 | catern | if you want instead to make foos be a list of the values of those variables, use ` and ~ |
| 18:10 | catern | ,`(~foo-1 ~foo-2) |
| 18:10 | clojurebot | ({:a 1} {:a 2}) |
| 18:10 | justin_smith | or you could call list |
| 18:10 | justin_smith | or use a vector literal |
| 18:10 | catern | but preferably call list, yeah |
| 18:10 | Guest58805 | ok. That makes sense. |
| 18:10 | mdrogalis | technomancy: Your cousin, I presume? https://github.com/technoweenie |
| 18:10 | gfredericks | ,(def other-foos [foo-1 foo-2]) |
| 18:10 | clojurebot | #'sandbox/other-foos |
| 18:10 | gfredericks | ,other-foos |
| 18:10 | clojurebot | [{:a 1} {:a 2}] |
| 18:10 | technomancy | mdrogalis: yeah, we used to get confused for each other all the time |
| 18:10 | technomancy | back when I did ruby all the time |
| 18:11 | mdrogalis | technomancy: I can't tell if that's serious or not. |
| 18:11 | technomancy | no, for reals |
| 18:11 | amalloy | technomancy: "get confused for each other" sounds vaguely flirtatious |
| 18:11 | mdrogalis | Oh man, haha. |
| 18:11 | gfredericks | (inc amalloy) |
| 18:11 | lazybot | ⇒ 152 |
| 18:11 | Guest58805 | thanks for the help. |
| 18:11 | mdrogalis | Pretty good way to hint at someone that you've had an affair. |
| 18:12 | mdrogalis | "We were uh.. Confused for each other. Or something." |
| 18:12 | amalloy | like, not that people confuse you with him, but that you two run into each other and are like...whoa. hey. sorry if i'm uh. not very articulate. you just confuse me |
| 18:12 | technomancy | I blame cycling tab completion |
| 18:12 | technomancy | haha |
| 18:12 | amalloy | technomancy: i wish my bike had tab completion |
| 18:12 | mdrogalis | Heh |
| 18:13 | technomancy | for changing gears? |
| 18:13 | amalloy | just because technology is fun |
| 18:13 | amalloy | i'd be riding along, hit tab, and be content to know that my bike is thinking of a file, or a user in #clojure or something, even if i don't know who |
| 18:13 | gfredericks | yeah like when I get on the lake front trail I would hit tab and I'd be at the end |
| 18:14 | hyPiRion | nothing like good old M-x bicycle-mode |
| 18:14 | amalloy | hyPiRion: i don't think it's possible to resist seeing if that exists |
| 18:14 | justin_smith | I tried it, but got pushed off the road by eclipse |
| 18:14 | amalloy | but even M-x bic<tab> doesn't work. you'd think there'd be a bic-lighter-mode at least |
| 18:15 | technomancy | if there's not a guy out there with a raspberry pi duct-taped to his water bottle holder then I don't even know what the point is |
| 18:15 | amalloy | there are probably enough such people to form a small city |
| 18:17 | justin_smith | https://sites.google.com/site/unipiper/ speaking of cities with weirdoes and foot powered wheeled vehicles |
| 18:18 | justin_smith | https://sites.google.com/site/unipiper/_/rsrc/1402983008858/home/gandalf_banner.jpg |
| 18:23 | technomancy | classic |
| 18:33 | arohner | tab completion is magical though. I started getting into the habit of hitting tab for things that couldn't possibly be completed, like this text box |
| 18:33 | arohner | "tab completion is mag<tab>" |
| 18:34 | technomancy | hehe |
| 18:34 | justin_smith | arohner: the "it's on the tip of my tongue" button |
| 18:35 | hiredman | I had an irssi plugin that would tab complete based on the system dictionary |
| 18:35 | catern | tab completion for the english language. driven by a markov chain generator that analyzes all your emails |
| 18:35 | catern | good thought |
| 18:41 | arrdem | every android keyboard ever tho |
| 18:43 | catern | yes |
| 18:45 | TimMc | arohner: That's completeable. |
| 18:45 | danielcompton | arrdem: and iOS8 keyboards soon |
| 18:45 | arohner | TimMc: that specific example was |
| 18:45 | arohner | but what about "TimcMc: <tab>"? |
| 18:45 | TimMc | wasn't there an XKCD about this... |
| 18:45 | arohner | probably |
| 18:45 | amalloy | TimMc: tab completion is magenta |
| 18:45 | arohner | <tab> |
| 18:47 | justin_smith | ,(partial \tab) |
| 18:47 | clojurebot | \tab |
| 18:47 | justin_smith | lol |
| 18:47 | TimMc | arohner: http://xkcd.com/1068/ |
| 18:48 | hoverbear | Are NREPLs TCP or UDP based? |
| 18:49 | hiredman | I believe the bencoded nrepl transport is tcp based |
| 18:50 | hiredman | but nrepl sits on top of a transport, so there are http transports, message queue transports, etc |
| 18:50 | hiredman | the bencoded nrepl transport is what lein uses I think |
| 18:50 | technomancy | UDP nrepl transport sounds super sketch |
| 18:50 | hoverbear | Yeahh.... |
| 18:51 | justin_smith | well, localhost only would be fine |
| 18:51 | hoverbear | Having a hell of a time connecting to an nrepl in a docker container :S |
| 18:51 | justin_smith | hoverbear: by default it is localhost only |
| 18:51 | justin_smith | it probably thinks your host container is not "local" |
| 18:51 | hoverbear | justin_smith: That'd be a problem. |
| 18:51 | justin_smith | hoverbear: you could use ssh -X to make a forwarded port |
| 18:52 | justin_smith | or maybe there is a config hiding somewhere to open it to outside hosts (with the scary implications that come with that...) |
| 18:52 | hoverbear | justin_smith: I can probably bind it to 0.0.0.0 |
| 18:52 | rlb | does anyone know to what extent the EPL and LGPL are (in)compatible? i.e. could I use EPLed code to create a guile module, for example? |
| 18:52 | hiredman | hoverbear: how are you starting the nrepl server? |
| 18:53 | justin_smith | hoverbear: since the idea of opening nrepl to other boxes seems terrifying to me, I always just make an ssh tunnel, but when connecting to a vm, you may want to do things differently, dunno |
| 18:53 | hoverbear | hiredman: Via immutant |
| 18:53 | hoverbear | https://gist.github.com/tobias/24770e9514cf60752f7c |
| 18:53 | hoverbear | justin_smith: For sure, thankfully it's a private link to my host behind a firewall |
| 18:54 | amalloy | justin_smith: -X? why would you want to forward the X server? |
| 18:54 | amalloy | i think you mean -L or -R, but if i'm wrong i'd be curious to hear why |
| 18:54 | hoverbear | justin_smith: You were right, +1! |
| 18:54 | sritchie | does anyone know how to do a nested validation with validateur? |
| 18:55 | justin_smith | amalloy: yeah, sorry, brain-fart, I meant -L |
| 18:58 | danielcompton | justin_smith: https://github.com/mtnygard/ssh-repl |
| 18:58 | justin_smith | danielcompton: nice! |
| 18:59 | danielcompton | hoverbear: you could use https://github.com/mtnygard/ssh-repl but don't deploy to prod |
| 18:59 | rksm | hoverbear: with vagrant I usually have vbox setup a private network and start repl on 0.0.0.0 (config.vm.network :private_network, ip: "192.168.50.4") |
| 18:59 | danielcompton | hoverbear: just thinking about it makes me cringe a little |
| 19:03 | rlb | After some advice from technomancy I started working on an authenticated repl (shared random token for now), but only got to the server-side before being side-tracked. With any luck I'll get back to it soon. |
| 19:03 | rlb | But you'd still need an ssh tunnel (or similar) for remote use. |
| 19:03 | hoverbear | danielcompton: Hey, I understand. It's behind a firewall though and the docker link is 127.0.0.1 so it can't be touched outside. |
| 19:04 | rlb | This would mostly be to keep from opening up your account to everyone else on the machine when you run the repl. |
| 19:06 | amalloy | i look forward to seeing 'privilege escalation via nrepl' hit the front page of hacker news. that's when we'll know we've made it big |
| 19:07 | arrdem | lol |
| 19:08 | danielcompton | amalloy: "How to take control of any Clojure programmer's computer" |
| 19:09 | amalloy | danielcompton: tell him about this new shell that's purely functional. he downloads and runs it. remote code execution |
| 19:09 | danielcompton | hahaha |
| 19:10 | mthvedt | purely functional shell? |
| 19:10 | mthvedt | don’t give haskell programmers ideas |
| 19:10 | hoverbear | amalloy: It's not purely functional then |
| 19:11 | hoverbear | Pure programs are useless, theres no side effects, like output. |
| 19:11 | hoverbear | (Snicker) |
| 19:11 | amalloy | mthvedt: to install it, run `echo 'rm -rf --no-preserve-root /' > funshell`; then `sudo funshell` to start it up and you'll be a cool kid in no time! |
| 19:12 | mthvedt | amalloy: can’t infer instance of monad |
| 19:12 | amalloy | (for the safety of those following at home by just typing in random crap they see, this command will not actually work) |
| 19:12 | danielcompton | amalloy: that looks like it would work? |
| 19:13 | amalloy | danielcompton: there's no chmod +x |
| 19:13 | amalloy | plus . shouldn't be in your PATH for sudo to find |
| 19:13 | danielcompton | amalloy: don't worry, I chmod -r +x / in the background on every shell exeution |
| 19:14 | mthvedt | amalloy: i automatically set everything to +x for convenience |
| 19:14 | amalloy | danielcompton: -R; -r is different |
| 19:14 | mthvedt | that way i never have annoying chmod messages |
| 19:14 | danielcompton | mthvedt: I know right? |
| 19:16 | danielcompton | you know what they say, everything's a hoot when you're root |
| 19:27 | DomKM | Design/performance question: If you have a function that returns an object that implements a protocol using the function's arguments, would you use reify within that function or create a type with deftype that implements the protocol? I realize that you can do either, and I'd personally prefer reify if the type isn't used otherwise, but I don't fully |
| 19:27 | DomKM | understand the performance implications of reify. Here's an example: https://www.refheap.com/88733 |
| 19:28 | amalloy | DomKM: reify |
| 19:28 | amalloy | the performance difference is basically zero: reify is much like an anonymous deftype |
| 19:29 | DomKM | Great, reify it is. Thanks amalloy |
| 19:29 | mlb- | How might I find the directory my uberjar is running from? |
| 19:29 | technomancy | mlb-: (System/getProperty "user.dir") iirc |
| 19:30 | mlb- | err, I mean to say, the directory the uberjar is in, not the working directory where the java -jar incantation takes place |
| 19:30 | justin_smith | ,(.getCanonicalPath (java.io.File. ".")) here's a fun one |
| 19:30 | clojurebot | #<SecurityException java.lang.SecurityException: denied> |
| 19:30 | justin_smith | clojurebot: you're no fun |
| 19:30 | clojurebot | Gabh mo leithscéal? |
| 19:32 | mlb- | technomancy: but thanks, I might be able to make some headway with that =] |
| 19:33 | justin_smith | mlb-: well, that gets neither, it gets the directory the user who ran the jar is currently in (the working directory) |
| 19:34 | justin_smith | (as does my example) |
| 19:36 | mlb- | I'm aware. At $DAYJOB, I'm shipping Clojure code to Windows machines, but the "java -jar" command will be issued by a batch file. Provided the batch file sets the working directory to where the uberjar lives, it should provide the path I'm looking for. |
| 19:40 | justin_smith | as for the location of the jar itself... (-> #'myns.core/init meta :file java.io.File. .getCanonicalPath) is one hack |
| 19:40 | justin_smith | or wait, that won't get the path to a jar containing myns.core... |
| 19:41 | justin_smith | mlb-: bigger picture, an invocation of java could have multiple jars, in multiple directories, all in classpath |
| 19:41 | amalloy | i'm not really sure you're entitled to know what jar you're running from |
| 19:41 | amalloy | you might not be running from a jar at all |
| 19:43 | mlb- | Sorry to be asking an XY Problem. What I've got is my uberjar and a separate jar containing resources I want to access. When deployed upon the end user's machine, they'll reside in the same directory. |
| 19:44 | hiredman | is there a reason not to just put the second jar on the classpath? |
| 19:44 | amalloy | or indeed include it in the uberjar |
| 19:46 | mlb- | hiredman: unless I'm reading wrong, the -jar option clears both the -cp and -classpath options, and the CLASSPATH env var. |
| 19:46 | hiredman | mlb-: sure, just don't use the -jar option |
| 19:46 | hiredman | java -cp uberjar.jar:other.jar mainclass |
| 19:46 | mlb- | amalloy: It's intentionally decided to be kept out of the uberjar to allow a 3rd party service to replace the secondary jar |
| 19:47 | mlb- | hiredman: oh? I'll have to try that! |
| 19:47 | hiredman | 'java -cp uberjar.jar:other.jar clojure.main -m main.namespace' is good too |
| 19:52 | mlb- | hiredman: okay, so I certainly see the other jar in the classpath, but how do I access the resources in it? I've tried (clojure.java.io/resource "other.jar"), but no luck :( |
| 19:53 | amalloy | (resource "whatever.txt"). you don't need to know what jar it's in |
| 19:53 | justin_smith | mlb-: if other.jar is in the classpath, you can access its contents relative to its top level |
| 19:55 | mlb- | that's useful! |
| 19:56 | mlb- | wait, what if there are resources by the same name in different jars in the classpath? |
| 19:57 | hiredman | resources will return a list |
| 19:57 | technomancy | huh, I didn't know that was built-in |
| 19:57 | amalloy | i didn't either |
| 19:58 | hiredman | *tada* |
| 19:59 | amalloy | hiredman: where is resources? |
| 19:59 | technomancy | um ... yeah |
| 19:59 | technomancy | about that |
| 20:00 | hiredman | damn |
| 20:00 | hiredman | really? |
| 20:00 | hiredman | sorry, I could have sworn that existed |
| 20:00 | technomancy | it should exist |
| 20:01 | hiredman | https://gist.github.com/hiredman/aeb55c7b54c4a6b48ca1 |
| 20:01 | hiredman | err |
| 20:01 | justin_smith | hiredman: man, I was gonna say, mind=blown because I assumed first resource matching a path hid all else... |
| 20:01 | amalloy | justin_smith: i think it does, really |
| 20:01 | technomancy | justin_smith: turns out I implement resources twice in Leiningen |
| 20:02 | hiredman | yeah, just not in clojure.java.io |
| 20:02 | technomancy | justin_smith: you can "see through" the first thing if you learn the secret |
| 20:02 | hiredman | but you can call getResources on a classloader |
| 20:02 | hiredman | I could have sworn that existed |
| 20:02 | hiredman | heh |
| 20:03 | hiredman | it does, in the utils namespace at work |
| 20:03 | hiredman | and getResources returns an enumeration yetch |
| 20:03 | amalloy | hiredman: at least there's enumeration-seq |
| 20:03 | hiredman | yep |
| 20:03 | technomancy | avert your eyes because this is terrible, but https://github.com/technomancy/leiningen/blob/master/src/leiningen/release.clj#L106 |
| 20:04 | hiredman | http://stackoverflow.com/questions/948194/difference-between-java-enumeration-and-iterator |
| 20:04 | hiredman | so it sounds like enumerations are 100% better than iterators |
| 20:05 | amalloy | hah |
| 20:05 | mlb- | so.. the actual answer is that clojure.java.io/resource will return the file belonging to the *last* .jar in the classpath? |
| 20:07 | hiredman | mlb-: it is slightly more complicated than that, because in reality resources are loaded from classloaders, the most basic of uses this thing called a classpath, but there are many others that don't |
| 20:07 | mlb- | ah, okay. Good to know |
| 20:08 | hiredman | I could point a a url classloader to a jar on a webserver somewhere, set that as the context classloader, then io/resource would load from the jar file on the webserver |
| 20:10 | gfredericks | hiredman: ha re SO |
| 20:12 | amalloy | gfredericks: 'ha' is not a musical note |
| 20:12 | mlb- | hiredman: so then... I should do my own conflict resolution bit? |
| 20:13 | amalloy | why is there a conflict? this resource is supposed to be in other.jar; are you expecting it to be somewhere else as well? |
| 20:13 | mlb- | amalloy: Yes. I make mistakes and I've got coworkers. |
| 20:15 | amalloy | but you think you can write code that will automatically and correctly handle that conflict? i think you're better off just saying "don't have two of these" |
| 20:18 | mlb- | amalloy: Were I not working on a team, such a simple soltuion would suffice. |
| 20:19 | mlb- | instead, I'll just write code to compare the name of the jar that contains a resource. |
| 20:27 | technomancy | who was asking about names yesterday? http://random-name-generator.info/ |
| 20:27 | technomancy | I still prefer gfredericks' approach if you need something in a jiffy, but there you have it |
| 20:28 | technomancy | [dakota/lightfoot "0.1.0"] ; works for me |
| 20:29 | justin_smith | (mana/quarles "0.0.1-SNAPSHOT") |
| 20:29 | technomancy | needs an api and a lazybot plugin |
| 20:39 | mlb- | technomancy: Now I want to know, what's the gfredericks' approach? |
| 20:40 | technomancy | mlb-: hit wikipedia's "random article" till you find a person; use their name |
| 20:40 | technomancy | or maybe it's just till you find a proper noun? |
| 20:40 | gfredericks | personal name |
| 20:40 | technomancy | there we go |
| 20:41 | gfredericks | I am known primarily for my library naming strategies |
| 20:41 | TEttinger | ##(clojure.string/join " "(repeatedly 998(fn[](apply str(concat(rand-nth[[(rand-nth["B""D""G""C""F""T""K"])(rand-nth["r"""""""""])][(rand-nth["S""L""Th""Ch""Sh""L""Y""W""Z""V""M""N""T"])]])(take(+ 2 (rand-int 3))(interleave(repeatedly #(rand-nth ["a""o""e""i""u""a""o""e""i""au""oi""ou""oo""ai""ee"]))(repeatedly #(rand-nth ["s""p""t""n""m""b""mb""rd""g""st""f""rt""sp""ch""rl""x""sh""y""ng"]))))))))) |
| 20:41 | lazybot | ⇒ "Kourt Wey Frespo Gosh Tog Baifaust Dorda Chombi Diy Nost Thetosh Yoonasp Toirdord Leng Yoyi Mang Lerla Tispemb Soorlerd Bairtoy Cuchoo Ceebo Vespa Zarl Noim Mooti Lap Tusoof Gigort Wogit Yaub Moospu Wapamb Taum Bartoost Meeng Faufe Daitu Fif Moonging Chaub Goox Vegu... https://www.refheap.com/88735 |
| 20:42 | TEttinger | star wars names! |
| 20:42 | technomancy | that's eerily good for something that looks like a swearjure program gone wrong |
| 20:42 | TEttinger | haha it really hits the limits of an IRC message |
| 20:44 | gfredericks | what's a swearjure program gone right look like? |
| 20:44 | TEttinger | (imv gfredericks) |
| 20:44 | TEttinger | (inc gfredericks) |
| 20:44 | lazybot | ⇒ 78 |
| 21:05 | technomancy | gfredericks: well, it has fewer alphanumerics than the above =) |
| 21:13 | gfredericks | technomancy: alphanumerics in a swearjure project are technical debt |
| 21:15 | gfredericks | omg guys these toy train sets are so topological |
| 21:16 | gfredericks | I just accidentally discovered a sort of semi-orientable track layout |
| 22:17 | TimMc | gfredericks: C-loop? |
| 22:20 | gfredericks | eh? |
| 22:20 | TimMc | Maybe that's not the name for it. |
| 22:20 | gfredericks | I'm thinking a track is orientable if a train, by only moving forward, cannot flip itself around |
| 22:20 | TimMc | yeah |
| 22:21 | TimMc | A C-loop allows a train to turn around. |
| 22:21 | gfredericks | and this track allows the train to flip one way but not back |
| 22:21 | TimMc | Maybe it's just called a reverse loop. |
| 22:21 | TimMc | heh, nice |
| 22:22 | TimMc | gfredericks: I had a moment the other day while trying to maneuver a large desk up a flight of stairs where I was thinking "OK, we have to make sure to turn it the right number of times so that it doesn't end up inverted front to back" and then I remembered that my house is at least locally an orientable space. |
| 22:23 | gfredericks | ha |
| 22:23 | gfredericks | here's the simplest version of the semi-orientable track: http://upload.gfredericks.com/butt.png |
| 22:23 | gfredericks | (it kinda looks like a butt) |
| 22:23 | TimMc | A housemate pointed out that this would have been OK with them (just turn it around), but I think it would have made any future disassembly with a screwdriver rather surprising. |
| 22:24 | gfredericks | if you're heading north up the middle you can't ever switch to heading south down the middle |
| 22:24 | gfredericks | but the opposite is the opposite |
| 22:25 | TimMc | gfredericks: And you can only traverse the top bar once. |
| 22:26 | gfredericks | true |
| 22:26 | gfredericks | I realized you can formalize it as a directed graph, where the track pieces between the intersections correspond to two vertices |
| 22:26 | gfredericks | one for heading one way and another for heading the opposite way |
| 22:26 | gfredericks | and the intersection specifies what points to what |
| 22:28 | gfredericks | so in this case the graph would have two connected components, where one has two edges into the other, both of which are the top bar |
| 22:30 | TimMc | gfredericks: So what is the simplest track such that for all points there is a direction a train may be placed on that point such that it has the possibility to traverse the entire track and also may make a decision that will restrict it from ever reaching certain portions of the track but will still ahve the opportunity for indefinite forward motion. |
| 22:31 | TimMc | I believe it is this: https://i.imgur.com/9LaZFDg.png |
| 22:32 | TimMc | Hmm, no. That violates the "any point" rule. |
| 22:32 | TimMc | How about "there exists a point and direction". |
| 22:33 | gfredericks | we need a word for point + orientation |
| 22:34 | TimMc | Let us definte point to include orientation. :-P |
| 22:35 | TimMc | "directed point" |
| 22:36 | mthvedt | i studied the topology of paths over topological spaces in colleg |
| 22:36 | mthvedt | e |
| 22:36 | mthvedt | but i can’t help because i forgot all of it |
| 22:37 | Jabberz | so question on functions that call databases... would it be better to pass in the db-spec/connection pool as a parameter, or retrieve it within the function via a var or calling another function |
| 22:38 | Jabberz | ie should something like (defn lookup-user..) be more pure, by taking a db-spec as a param |
| 22:39 | sritchie | dnolen_: for a case where a parent component needs to distribute some async state to a bunch of subcomponents, |
| 22:39 | sritchie | dnolen_: (thinking data for autocomplete fields), |
| 22:39 | sritchie | dnolen_: would you recommend a core.async mult, or just sticking a future in init-state? |
| 22:40 | sritchie | oh, I guess there’s no future in cljs |
| 22:40 | TimMc | gfredericks: Here's the graph of the "g" track: https://i.imgur.com/YrzZzZw.png Three pairs of points for the three intersection-divided segments. |
| 22:41 | jeremyheiler | Jabberz: pass the db in. |
| 22:41 | sritchie | dnolen_: I can jam it into the global state so everyone can just share |
| 22:42 | Jabberz | jeremyheiler: that's what I was leaning to, eliminate those internal dependencies within the functions |
| 22:43 | jeremyheiler | yep. if you really need to, you could close over the db with an anonymous fn and pass that somewhere that doesn't have access to it. |
| 22:43 | jeremyheiler | Jabberz: ^ |
| 22:49 | Jabberz | jeremyheiler: does this naturally lead you towards something like component or trapperkeeper? I feel like as soon as you start managing abstractions with closures or partials, might as well formalize the dependency relationships between, for lack of a better term, modules or groups of functions |
| 22:55 | TimMc | sritchie: You heard it here, folks, "there’s no future in cljs". |
| 22:55 | sritchie | :) |
| 23:02 | jeremyheiler | Jabberz: at a system level, yes. internally, not really. |
| 23:22 | justin_smith | TEttinger: silly 80 column restriction of your star wars name generator https://www.refheap.com/88737 |
| 23:22 | TEttinger | ha, 16 lines in a single message |
| 23:23 | justin_smith | well, 16 is one way to break it up |
| 23:23 | justin_smith | did you make it as a one liner, or do you have a more normal breakup of the original? |
| 23:25 | TEttinger | I made it as a one liner submitted to lazybot |
| 23:25 | TEttinger | lazybot is not here? |
| 23:26 | timsg | Hey, has anyone here used Clojure-CLR, or, better, have a Clojure-CLR project set up that they can run a repl against? I’m mutating records with set! and need a sanity check, maybe I messed up the build or something |
| 23:28 | justin_smith | timsg: how do I run it? |
| 23:28 | justin_smith | (I installed it ages ago, and I forget) |
| 23:28 | justin_smith | never mind, I have it |
| 23:29 | justin_smith | timsg: got a repl log I can follow along? |
| 23:29 | timsg | justin_smith: great, I’ll send you a refheap thing in a minit |
| 23:30 | timsg | justin_smith: https://www.refheap.com/88738 |
| 23:30 | timsg | justin_smith: oops, typed too fast, that won’t work |
| 23:30 | timsg | justin_smith: https://www.refheap.com/88739 |
| 23:32 | danielcompton | In Cider, is there a way to set the point back onto the repl entry point? So if I've scrolled up three pages and want to get back to the 'REPL' input line, what would I press? |
| 23:34 | jeremyheiler | danielcompton: M-> wil jump to the end of the buffer |
| 23:34 | danielcompton | jeremyheiler: thanks! That's just what I needed |
| 23:34 | jeremyheiler | danielcompton: that's a general emacs trick. not cider specific |
| 23:35 | justin_smith | timsg: I got identical results |
| 23:35 | timsg | justin_smith: o god that’s terrible |
| 23:35 | danielcompton | jeremyheiler: yeah, I was trying it on other buffers and noticed that. |
| 23:35 | timsg | justin_smith: I think this means all user-defined types in Clojure-CLR are mutable |
| 23:37 | timsg | justin_smith: what version of Clojure-CLR are you using, and what are you running it against (Mono or something else?) I’m using 1.5.0 and running it against Mono on OSX. I hope this is some undiscovered bug endemic to that configuration |
| 23:39 | timsg | mono 3.4.0 |
| 23:40 | justin_smith | I have an old one, 1.4.1 |
| 23:40 | timsg | bbloom: if you’re there, might need some clr insight |
| 23:43 | swgillespie | i've got clr insight but not clojure insight :p |
| 23:45 | mindbender1 | How can I resolve the following clojure compilation errors: https://gist.github.com/johnbendi/9b4f5f1f46c270f63b51#file-clojure-compilation-failure ? |
| 23:46 | sritchie | can anyone help me figure out how to call this .typeahead function via cljs? https://github.com/twitter/typeahead.js/blob/master/doc/jquery_typeahead.md |
| 23:46 | sritchie | it looks like the jquery plugin has added the function to any object |
| 23:47 | sritchie | BUT I can’t just call .typeahead, that seems to fail |
| 23:51 | amalloy | it doesn't put .typeahead on every object (it can't); it just puts it on all jquery elements |
| 23:51 | DomKM | sritchie: Can you call it on any object from plain js instead of cljs? The readme leads me to believe it's available on jquery objects, not any object. |
| 23:51 | trptcolin | gfredericks: good job on lein-lein. you’re truly doing the Lord’s work |
| 23:51 | sritchie | looks like I had to wrap it in $, yeah, my bad |
| 23:51 | sritchie | okay, getting closer, thanks |