2012-12-11
| 00:00 | Raynes | It isn't my fault cemerick is dumb. |
| 00:00 | rbxbx | bbloom that's why I like y'all. Weirdies from all walks of life, coming together to talk about important things. Like how everything sucks. |
| 00:00 | bbloom | but luckily, we're armed with the word "decomplect" let's decomplect the shit out of all those fancy live compiler support features and move that shit into libraries that nrepl and friends can expose to any damn editor you choose |
| 00:00 | technomancy | tpope: sure, because the first one wasn't that good |
| 00:01 | cemerick | Raynes: You cut me deep, man. |
| 00:01 | technomancy | cemerick: my point is that getting a Dr. Racket-alike for editing Clojure only covers a tiny sliver of why people use Emacs |
| 00:01 | rbxbx | tpope: to hop back to that article you linked ages ago I totally agree. I do think a deadline without distraction is probably better though... ie: false dichotomy? |
| 00:02 | tpope | rbxbx: if I'm reading twitter at work, the problem isn't that twitter is too easy to read at work |
| 00:02 | bbloom | and now with fressian and datomic and distributed systems and all that stuff on rich's radar, simpler service oriented stuff is going to come into the vernacular. that can only be a good thing for editors :-P |
| 00:02 | Scriptor | if anything, Dr. Racket for clojure *might* get a lot of eclipse/other ide users |
| 00:02 | Scriptor | maybe even a few vim users, though I have no idea how key bindings work on it |
| 00:02 | rbxbx | tpope: okay. I'm sold. When I'm in my flow I could give a fuck about the latest cat gifs on twitter. |
| 00:02 | Scriptor | but one tool/one job doesn't seem like it's prevalent in Dr. |
| 00:02 | cemerick | technomancy: Right, whole-system hackability. I get it. |
| 00:02 | n_b | (speaking_from_ignorance "I thought Dr.Racket was just a customised emacs install with the equivalent of vimtutor") |
| 00:02 | rbxbx | or could not, rather. |
| 00:03 | rbxbx | n_b: are you not confusing it with mozart/oz ? |
| 00:04 | n_b | rbxbx: 've been up so long at this point I've honestly no idea. Shouldn't be commenting at all |
| 00:04 | technomancy | not that I'd mind using an OS written in Clojure; I just think it's at least half a decade from being usable by the adventurous |
| 00:04 | cemerick | My problem is I'm an unprincipled, disloyal type. I'll switch tools at the drop of a hat, if something better comes along. Hackability is actually a downside for me in that scenario, insofar as I don't want to lock myself into anything in particular. |
| 00:05 | cemerick | n_b: most certainly not an emacs install |
| 00:05 | tpope | tell me about it |
| 00:05 | Scriptor | might it not be more efficient to change the tool itself to fit you better rather than a whole new environment? |
| 00:05 | tpope | try locking your very identity to it too! |
| 00:06 | cemerick | tpope: The first step is to stop digging. But, finish foreplay, first, thanks. ;-) |
| 00:06 | bbloom | cemerick: yeah, too much customization can kinda lock you in |
| 00:06 | bbloom | but dammit man, vim bindings are deep in my brain |
| 00:06 | rbxbx | cemerick pros and cons, pros and cons. The fact that an individual like Tim can come along and have his first Clojure project make a significant splash would not be so had he not so deeply locked himself into Vim (along with others!) |
| 00:06 | bbloom | and my fingers |
| 00:07 | rbxbx | but go on, lording your freedom over us. |
| 00:07 | rbxbx | :p |
| 00:07 | bbloom | i'm a total prisoner |
| 00:07 | bbloom | :q! |
| 00:07 | Scriptor | bbloom: same, it's a little unwieldy since clojure and other lisps really lend themselves better to sexpr-based editing |
| 00:07 | Scriptor | while vim is just more line-oriented |
| 00:07 | cemerick | rbxbx: was definitely not evangelizing anything there :-) |
| 00:08 | bbloom | Scriptor: text objects make it quite a bit better… i don't use paraedit or anything |
| 00:08 | Raynes | I love ALL the editors. |
| 00:08 | technomancy | Raynes: even sublime? |
| 00:08 | Raynes | I use two editors at the same time all the time. |
| 00:08 | rbxbx | Scriptor bbloom not to mention surround.vim |
| 00:08 | n_b | ++Raynes |
| 00:08 | bbloom | i use that too |
| 00:08 | Raynes | technomancy: Yes, actually. I think it is a great editor with horrible Clojure support. |
| 00:08 | Raynes | technomancy: All it needs is to be open source so more than one person can work on it at a time. |
| 00:08 | technomancy | n_b: it's pronounced inc |
| 00:09 | Scriptor | Raynes: I made a php ide in vb once, I should dig it up for you |
| 00:09 | cemerick | I actually wrote the whole book in sublime :-P |
| 00:09 | technomancy | Raynes: yeah that kind of seems like a big problem |
| 00:09 | n_b | When working on Java stuff Ill often use Eclipse for finding things and generating stubs and then vim for the bulk of editing |
| 00:09 | Raynes | technomancy: That one person does great things with it. He just doesn't focus on what I want him to, which is my only problem. |
| 00:09 | cemerick | Or, I did all of *my* writing in sublime, I should say |
| 00:10 | technomancy | Raynes: your problem is that you and people who think like you aren't allowed to do what you want with it |
| 00:10 | Raynes | technomancy: If it was open source I still wouldn't fix my problem with it. In fact, I could do my own bundle for Clojure for it right now but I wont. |
| 00:12 | benedikt | In the Noir framework, i'm trying to use clojure.string/join on a vector of (link-to): http://codepad.org/nrEEvwjz |
| 00:12 | technomancy | why spend time hacking on something you are only allowed to use by virtue of someone else's good will? |
| 00:13 | Raynes | technomancy: Because it's nice and I'm not a FOSStard? |
| 00:13 | technomancy | "your help isn't welcome here" offends me, regardless of license |
| 00:13 | technomancy | Raynes: FOSStard is not the preferred nomenclature, dude. |
| 00:13 | technomancy | (it's freetard.) |
| 00:15 | Raynes | technomancy: I once bought oil for my mom's car. |
| 00:15 | Raynes | I'm pretty crazy. |
| 00:17 | benedikt | Raynes: cool story bro |
| 00:17 | Raynes | I guess you noticed my ignoring your noir question. |
| 00:18 | Raynes | Foiled! |
| 00:18 | cemerick | Yeah, why would anyone think that this is where people talk about Clojure? o.O |
| 00:19 | Scriptor | wasn't there a clojure-lounge or something once? |
| 00:20 | rbxbx | benedikt to be fair, it was a statement |
| 00:20 | rbxbx | ;) |
| 00:20 | rbxbx | "I mapped over an set today" /me waits for a response |
| 00:21 | rbxbx | an set. ugh. |
| 00:21 | Raynes | I answered his question in #noir. Just so nobody things I'm an ass. |
| 00:21 | rbxbx | Raynes good man :) |
| 00:25 | seangrove | Why do I get "namespace not found" when trying to C-x C-e a cljs form while having a cljs nrepl session open? |
| 00:26 | seangrove | Only seems to happen on one namespace so far |
| 00:34 | Raynes | dsantiago: How do you go from hickory zip -> hickory? |
| 00:49 | benedikt | How would it make sense to represent a bunch of objects (papers in my case) in clojure. I represent each paper with a hashmap (:name, :abstract, etc, etc.), but i have more than one paper. |
| 00:49 | n_b | What do you mean represent? |
| 00:49 | n_b | IOW, what's your end goal? |
| 00:50 | ToxicFrog | As in, what collection type you want to store them in? Depends on what you're doing with them. |
| 00:50 | benedikt | n_b: oh, the XY problem. Printing out a list of papers |
| 00:50 | seangrove | benedikt: first pass, sounds like a vector of hashmaps |
| 00:50 | ToxicFrog | Is order significant? |
| 00:50 | benedikt | seangrove: thats what i thought. |
| 00:50 | benedikt | ToxicFrog: no, but i need to be able to select paper by e.g. name |
| 00:50 | ToxicFrog | A map (name => paper hash), then? |
| 00:50 | benedikt | building a website with noir. i thinking of a /paper/name thing |
| 00:51 | n_b | ah |
| 00:51 | benedikt | ToxicFrog: How would that look in clojure pseudocode? |
| 00:51 | n_b | You might look at sets benedikt |
| 00:52 | n_b | Programming Clojure had a good section on building a little in-memory database using the basic clojure datatypes |
| 00:52 | n_b | To recommend anything more than that I'll defer to someone with more experience :) |
| 00:52 | ToxicFrog | sets don't get you the name->paper mapping, though, you'd need to filter it |
| 00:53 | benedikt | ToxicFrog: how would your idea look? |
| 00:54 | n_b | ToxicFrog: You can use something like (select pred col) though can't you? |
| 00:55 | ToxicFrog | benedikt: you're already using hashmaps for the papers themselves, you'd just store those in another hashmap - (hash-map "Performance Evaluation of a ..." { :name ... :abstract ... } "An Integrated ..." { :name ... :abstract ... }) |
| 00:55 | zackzackzack | I just ran `lein check` for the first time ever on a project. I'm scared. What's going on? |
| 00:55 | ToxicFrog | This does assume you only ever want to lookup by name, though |
| 00:55 | n_b | benedikt: Why not stuff them into a proper DB? |
| 00:56 | n_b | at least something like BerkeleyDB or SQLite? |
| 00:56 | benedikt | n_b: i just want to keep it simple with as few layers as possible. its update at most twice a year |
| 00:56 | n_b | So how is it getting loaded as is? |
| 00:57 | n_b | Just something like (def papers [paper1, paper 2]) |
| 00:57 | benedikt | static html :)( |
| 00:57 | n_b | and you're parsing it out with enlive or something? |
| 00:57 | benedikt | i just have some spare time and i want to familiarize myself with clojure |
| 00:57 | benedikt | so i'm rewriting this simple webpage with clojure |
| 00:58 | benedikt | ToxicFrog: that makes perfect sense for what i want to do. |
| 01:02 | benedikt | n_b: where were you going with (def papers [paper1 paper2]) ? |
| 01:07 | n_b | benedikt: using sets and relations with predicates to query it like an in-mem db |
| 01:09 | benedikt | n_b: nice. did you find that link? |
| 01:10 | n_b | http://clojuredocs.org/clojure_core/1.3.0/clojure.set |
| 01:10 | benedikt | that hardly explains how to do that |
| 01:11 | n_b | slam all your hashes into a set, then query that like any filter statement would |
| 01:12 | bbloom | benedikt: what types of queries do you need to support? |
| 01:12 | bbloom | if you need precise lookups, simply store your data in a map keyed by the lookup value |
| 01:13 | bbloom | if you need range lookups, you can use a sorted-set or a sorted-map in conjunction with subseq |
| 01:13 | bbloom | (doc subseq) |
| 01:13 | clojurebot | "([sc test key] [sc start-test start-key end-test end-key]); sc must be a sorted collection, test(s) one of <, <=, > or >=. Returns a seq of those entries with keys ek for which (test (.. sc comparator (compare ek key)) 0) is true" |
| 01:13 | bbloom | subseq enables you to treat a sorted collection as an index |
| 01:13 | n_b | whoa, did not know about that |
| 01:13 | n_b | nifty |
| 01:13 | n_b | stdlib just keeps getting better and better the more I learn. |
| 01:14 | benedikt | bbloom: only by name. but i'm all for doin unessecarly cool stuff. |
| 01:14 | bbloom | direct access by name? any kind of substring matching? |
| 01:14 | benedikt | direct |
| 01:14 | bbloom | yeah, then don't get fancy: use a map |
| 01:15 | bbloom | if your data set fits in memory, and all you care about is direct lookup by name, then the simplest thing to do is to store your entire database in a single top level atom |
| 01:16 | bbloom | write a few functions to use with swap! on that atom that insert, remove, or "modify" items in your database |
| 01:16 | bbloom | if your change rate is small enough and you don't need transactional storage, you can slurp up that database from a file on startup, and write it out on save |
| 01:17 | benedikt | its actually that simple |
| 01:17 | bbloom | if you need fancier querying or better transaction guarentees or higher throughput, use a real database |
| 01:17 | bbloom | i'm all for simple single atom slurp/spit databases in apps |
| 01:17 | bbloom | anytime you can reasonably get away with that, do it! |
| 01:17 | benedikt | i like your thinking. |
| 01:17 | bbloom | well then we have that in common :-P |
| 01:30 | benedikt | Seems like that if i try to pass it a value that isn't in the hashmap, i'm getting served an empty page |
| 01:30 | benedikt | seems like a sensible approach. |
| 01:31 | n_b | just return a different result if you get back nil |
| 01:32 | benedikt | aye |
| 01:37 | rbxbx | bbloom I like that approach as well :) |
| 01:38 | rbxbx | May have to give it a go with the next app I undertake with trivial persistence requirements |
| 02:08 | dsantiago | Raynes: zip/root doesn't work? |
| 02:08 | Raynes | Good question. I didn't try it. Note that I'm very new to zippers and pretty dumb in general too. |
| 02:12 | Raynes | dsantiago: Yeah, that works. |
| 02:12 | dsantiago | Phew. |
| 02:12 | Raynes | dsantiago: Hickory is suck good stuff. |
| 02:12 | dsantiago | Thanks, I thikn. |
| 02:12 | Raynes | such |
| 04:43 | hcumberdale | Hi there ;) |
| 04:52 | andrewmcveigh|wo | Morning. |
| 05:03 | kral | morning |
| 05:18 | thorwil | morning |
| 05:19 | thorwil | so i can test private fns just fine using #' |
| 05:19 | thorwil | but that does not work for macros. is there a way around that? |
| 05:20 | thorwil | (though just not making the macros private has no real cost to it) |
| 05:21 | Raynes | Making nothing private has no real cost to it. |
| 05:22 | Raynes | It'd be better if there was some other flag to tell whatever documentation generator one is using to ignore it. |
| 05:22 | bbloom | Raynes: I think that flag is :private :-) |
| 05:22 | Raynes | I should send weavejester a pull request to make it ignore vars with :nodox metadata. |
| 05:22 | thorwil | sure. i just use it to mark stuff that is used inside a ns, when it's not worth it to spin off a new ns for it |
| 05:22 | bbloom | it's just bugged: the flag also makes things private |
| 05:23 | Raynes | lol |
| 05:23 | bbloom | although, to be fair, there is an orthoginal concern: automatic import on :use |
| 05:23 | clgv | Raynes: why not :public to mark the intended public api without any restrictions |
| 05:23 | Raynes | Because ew. |
| 05:24 | Raynes | I don't want to have to attach metadata to *everything* |
| 05:24 | Raynes | :P |
| 05:24 | bbloom | if i author a namespace that i expect to :use-d, then i use :private |
| 05:24 | bbloom | otherwise, i just don't write doc strings for private stuff |
| 05:25 | Raynes | I wish I could write namespaces that break when use'd. |
| 05:25 | bbloom | eh, add a rule to kibit :-P |
| 05:26 | bbloom | use is perfectly acceptable for interactive work and for my "shit that i wish was in core" utilities |
| 06:47 | rasputnik | is this the right place to ask ring questions? |
| 06:48 | thorwil | rasputnik: it is probably one right place |
| 06:49 | rasputnik | ok, well just writing a dead simple ring app and trying to add some middleware. things are not going so good. |
| 06:49 | rasputnik | Parameter declaration wrap-json-response should be a vector |
| 06:49 | rasputnik | hang on, i'll pastie the code somewhere |
| 06:51 | Raynes | https://www.refheap.com is a popular choice. |
| 06:51 | rasputnik | here's the problem code, can't see what's wrong with it |
| 06:51 | rasputnik | https://gist.github.com/4257968 |
| 06:51 | Raynes | Foiled! |
| 06:51 | rasputnik | :) |
| 06:52 | rasputnik | i'm too rusty on the basics here to be sure whether the (ns …) form is correct |
| 06:52 | thorwil | rasputnik: defn is for defining functions and ths must have an arg list |
| 06:53 | thorwil | line 10/11 |
| 06:54 | Sgeo|web | Well, my simplistic attempt to replace the clojail macroexpander failed and crashed |
| 06:55 | rasputnik | thorwil: bloody hell. Why do i bother coding before coffee, it's always a waste of time. |
| 06:55 | thorwil | heh |
| 07:03 | Sgeo|web | Even blindly throwing mexpand-all in there it fails some tests |
| 07:04 | Sgeo|web | I'll need to look at this more closely later, I think. I should be sleeping. |
| 07:13 | tgoossens | i'm making a little game. to paint all the players i do |
| 07:13 | tgoossens | (map #(paint g (deref %)) players)) |
| 07:13 | tgoossens | but that doesn't work? |
| 07:13 | tgoossens | but (paint g @(first players)) works |
| 07:13 | tgoossens | i don't get it |
| 07:14 | ucb | tgoossens: map is lazy, maybe that's it? |
| 07:14 | tgoossens | hmmm |
| 07:14 | tgoossens | yes of course |
| 07:15 | tgoossens | is there a better way |
| 07:15 | tgoossens | or should i just |
| 07:15 | tgoossens | do |
| 07:15 | tgoossens | (seq ..) |
| 07:15 | weavejester | rasputnik: It can be |
| 07:15 | ucb | tgoossens: you could try with doseq |
| 07:15 | tgoossens | let my try this |
| 07:15 | tgoossens | *me |
| 07:19 | tgoossens | that seems to work |
| 07:19 | tgoossens | now i ran into a classical problem |
| 07:19 | tgoossens | on linux holding a pressed button gives you , pressed, released, pressed, released |
| 07:20 | ucb | heh |
| 07:21 | clgv | tgoossens: I doubt that general happens on linux. what GUI framework do you use? |
| 07:21 | tgoossens | swing. based on the snake example in "programming clojure" |
| 07:22 | wilfredh | I'm trying to add prettytime (http://ocpsoft.org/prettytime/ ) to a Clojure project, but adding [org.ocpsoft.prettytime/prettytime "2.0.0.Final"] to my project.clj dependencies can't find it any repository. |
| 07:22 | wilfredh | Any suggestions as to what I'm doing wrong? |
| 07:24 | wilfredh | http://ocpsoft.org/prettytime/ says "To use snapshots, you must also use the Sonatype Snapshots repository" but AFAICT I'm not using a snapshot, just a stable release |
| 07:27 | wilfredh | ah, got it. Looks like 1.0.8.Final is the most recent version of maven.org |
| 07:40 | rasputnik | weavejester: wrapping the app in wrap-json-repsonse is still giving me troubles, fell back to just ring.util.json-response for now. |
| 07:40 | rasputnik | (PEBKAC no doubt, but don't need the entire app to generate JSON anyhow) |
| 08:31 | Sgeo|web | Why would someone need to make a new object just to use what is essentially a function that has nothing to do with the object it's on? |
| 08:31 | Sgeo|web | (Looking at that PrettyTime thing) |
| 08:31 | Sgeo|web | I blame Java |
| 08:36 | clgv | I get a java.lang.NoClassDefFoundError for an interface of a protocol in a namespace where the deining namespace of the protocol is "require"d |
| 08:37 | clgv | I only get that when running the uberjar |
| 08:38 | clgv | so what is the reason for that? |
| 08:41 | firesofmay | What would be the best way to get and generate sentences for testing in various languages? |
| 08:42 | maleghast | Hey there y'all |
| 08:44 | Chousuke | firesofmay: "best" is a difficult question, but I would start by defining word classes, then some words in each class, and some data structure which describes how each kind of word can be used to form complete sentences. that's enough for at least simple languages if you don't require semantically correct sentences :P |
| 08:45 | maleghast | I was wondering… I was Clojure eXchange in London last week (awesome 1 day conference set up by Skills Matter and London Clojurians, esp otfrom) and Rich Hickey's talk made me think about a bunch of (sadly non-Clojure) things that I am working on at my day-job at the moment, particularly interchange between systems… So here' s the thing, and don't throw stuff at me, does anyone know of an implementation of edn in PHP..? |
| 08:45 | Chousuke | firesofmay: but in general that problem is extremely difficult |
| 08:46 | firesofmay | Chousuke, I just want random text. Semantics are not important. I just want to generate sentences (meaning is not important). Criteria is to able to generate sentences from various languages. |
| 08:47 | firesofmay | Chousuke, One way is I copy general words of various langauges. And put them in a list. I was wondering if I can do this in some better way then copy pasting myself. |
| 08:47 | Chousuke | put the words in a file, read the file, and parse it into a list? |
| 08:48 | ro_st | firesofmay: seen brian marick's talk? there's a topic on the group now that might interest you: https://groups.google.com/forum/#!topic/clojure/Q53aRaiwDCQ |
| 08:48 | firesofmay | ro_st, checking. |
| 08:48 | Chousuke | using a pure dictionary-based approach will only work for reasonably simple languages though |
| 08:48 | Chousuke | like, say, english :ÖP |
| 08:48 | Chousuke | :P |
| 08:49 | firesofmay | Chousuke, Hmm. What about languages like manderin? |
| 08:49 | Chousuke | mandarin might work too |
| 08:49 | Chousuke | since words are mostly immutable |
| 08:49 | ro_st | maleghast: if there is, it hasn't been shared with the maintainers yet: https://github.com/edn-format/edn/wiki/Implementations |
| 08:49 | Chousuke | but eg. in Finnish you'd be very limited with a dictionary-only approach |
| 08:50 | maleghast | ro_st: Yeah, I looked there first - wanted to see if there was anyone in here prepared to put their hand up and admit to one... |
| 08:50 | Chousuke | since you need to actually modify words depending on their grammatical role in a sentence and relation to other words. |
| 08:50 | maleghast | ro_st: Thanks though :-) |
| 08:51 | ro_st | maleghast: condolences that you need it. |
| 08:52 | ro_st | we're just over a month away from switching to our pure clojure v2 stack. v1 stack has php AND flash in it. |
| 08:52 | maleghast | ro_st: Thanks :-S Truth is I might not - I might (at least) be able to use this issue as one of the reasons for moving even our top layer up out of PHP and into Ruby (well jRuby) and there is a Ruby implementation of edn. |
| 08:52 | ro_st | by pure, i mean: datomic, clojure, clojurescript, and pallet for aws ec2 configuration. even the campfire bot is in clojure. |
| 08:52 | maleghast | ro_st: Sounds like you are properly moving up in the world - nice stuff |
| 08:52 | maleghast | :-) |
| 08:52 | Chousuke | firesofmay: for example if you consider the two sentences "I bought a red car" and "That is a red car you bought", "red", "car" and "bought" would not map to the same words when translated into Finnish |
| 08:53 | maleghast | ro_st: Who is "we" if I may ask..? |
| 08:53 | ro_st | <spam>www.cognician.com</spam> |
| 08:53 | firesofmay | Chousuke, As long as I can generate some finish looking sentence I am good :) (for now at least) |
| 08:53 | maleghast | ro_st: Thx - *looking* |
| 08:53 | Chousuke | firesofmay: that's probably possible |
| 08:54 | firesofmay | Chousuke, this is just to populate and see if its working fine. What it means is of no importance to my testing. |
| 08:54 | ro_st | firesofmay: what about grabbing some version of finnish lipsum and using chunks of that? |
| 08:54 | firesofmay | ro_st, I could, what I am asking is should I grab them manually and save them, or do you know any one place I can get standard words for all languages? |
| 08:55 | firesofmay | ro_st, Chousuke Then I can just write functions which would take them and genreate random sentences for given language. |
| 08:55 | ro_st | i have no idea |
| 08:55 | firesofmay | ro_st, Okay no problem :) |
| 08:56 | ro_st | http://generator.lorem-ipsum.info/ |
| 08:56 | ro_st | "Other languages/charsets" |
| 08:56 | ro_st | boom |
| 08:57 | ro_st | i googled for "lipsum for other languages". this ws the first hit |
| 08:58 | firesofmay | ro_st, checking |
| 08:59 | rcg-work | there is only one lorem ipsum generator: http://slipsum.com/ |
| 08:59 | rcg-work | ;) |
| 09:01 | firesofmay | rcg-work, lmao :) |
| 09:01 | si14_ | is there anything for parsine Erlang datastructures out there? |
| 09:01 | firesofmay | ro_st, that links great for now :) |
| 09:01 | si14_ | or should I write something for this by myself? |
| 09:01 | firesofmay | rcg-work, I wish it had more languages ;) |
| 09:08 | ro_st | si14_: you could use erlang |
| 09:08 | rcg-work | firesofmay, ;) |
| 09:10 | PudgePacket | Hey, I've just been going through the koans, and I was wondering what the differente between (peek '(1 2)) and (first '(1 2)) was |
| 09:10 | si14_ | ro_st: what do you mean? |
| 09:11 | noidi | PudgePacket, http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/peek |
| 09:11 | noidi | ,(doc peek) |
| 09:11 | clojurebot | "([coll]); For a list or queue, same as first, for a vector, same as, but much more efficient than, last. If the collection is empty, returns nil." |
| 09:12 | HolyJak | PudgePacket: You'd use peek when you use the collection as a queue to indicate it is a queue |
| 09:14 | firesofmay | ro_st, Chousuke this is also good enough alternative : http://www.adhesiontext.com/ & http://randomtextgenerator.com/ |
| 09:14 | firesofmay | these are* |
| 09:14 | ro_st | si14_: you want to parse Erlang data structures. isn't Erlang a good fit for that? |
| 09:15 | si14_ | ro_st: I need to parse Erlang's config. I can parse it in Erlang, emit some JSON and use it in Clojure, but it would be easier to use config files themself |
| 09:16 | PudgePacket | Thanks |
| 09:16 | ro_st | si14_: you might find that's actually not easier. a cursory google doesn't reveal anything |
| 09:17 | cemerick | Having an erlang reader implemented in Clojure wouldn't be the worst thing in the world... |
| 09:19 | pbw | Hi folks. N00n00b question follows: |
| 09:21 | pbw | If I do this in the repl, it woks. (filter #(java.lang.Character/isUpperCase %) "AbcDef") gives (\A \D) |
| 09:21 | ro_st | isn't the erlang vm so small that you can just embed the whole vm in a source file somewhere? -disclaimer, i know *nothing* about erlang- |
| 09:22 | si14_ | ro_st: nope :) |
| 09:23 | Hodapp | Erlang is a lot of things, but I don't know that I've ever heard it called "light" |
| 09:23 | pbw | But I can't seem to apply 'str' to this in a 'comp' in order to string the function processes together. |
| 09:23 | cemerick | Oh, I totally forgot about http://erjang.org/ |
| 09:24 | cemerick | si14_: might want to look in there for a reader ^^ |
| 09:25 | si14_ | cemerick: yeah, nice idea! thanks, I'll look there |
| 09:26 | cemerick | si14_: A super-quick browse of the javadoc doesn't turn up anything obvious; ping back if you find a reader in there :-) |
| 09:27 | p_l | Hodapp: someone got Erlang to start fast enough that a fresh request time outs slower than the VM boots |
| 09:28 | Bahman | p_l: That's nothing compared to JVM :-P |
| 09:28 | Hodapp | p_l: I have no doubts it can be made quick, I'm just saying it's rarely called "light" :P |
| 09:29 | p_l | Bahman: hmm? |
| 09:29 | Bahman | p_l: Use your imagination! |
| 09:29 | p_l | Hodapp: well, it doesn't need to be complete VM from start to boot |
| 09:30 | Bahman | p_l: "False" imagination of course :-) |
| 09:30 | tbaldridge | p_l: let's not forget that the Erlang VM is miles simpler than the JVM |
| 09:30 | Hodapp | p_l: so it loads only what's needed? |
| 09:30 | tbaldridge | no classes, no string, just ints, lists, and dictionaries. |
| 09:30 | tbaldridge | *no strings |
| 09:31 | Hodapp | tbaldridge: No strings? Didn't know that. |
| 09:31 | si14_ | cemerick: found this: https://github.com/trifork/erjang/blob/master/src/main/java/erjang/jbeam/beam.g |
| 09:31 | tbaldridge | in Erlang strings are arrays of 32 bit integers |
| 09:31 | si14_ | cemerick: not sure if I know how to use it standalone |
| 09:35 | cemerick | si14_: it's an antlr grammar; presumably the build process or some script in the repo uses it to generate the lexer and parser |
| 09:48 | tbaldridge | anyone with emacs skills know a shortcut to "go to start/end of sexpr"? |
| 09:48 | zerokarmaleft | C-M-b and C-M-f |
| 09:49 | noidi | or C-M-u for "go up" |
| 09:50 | tbaldridge | cool. Is there one for "go to start of top level form"? Or should I just hit C-M-u a bunch of times? |
| 09:50 | si14_ | cemerick: yeah, thanks. |
| 09:50 | ro_st | the latter |
| 09:50 | daimrod | tbaldridge: C-M-a |
| 09:51 | tbaldridge | awesome! thanks guys. |
| 09:51 | ro_st | awesome. didn't know that! |
| 09:51 | daimrod | and C-M-e to go to the end |
| 09:51 | tbaldridge | C-M-a C-space C-M-e C-w the combination I've wanted for a long time. :-) |
| 09:52 | noidi | for any lurking eclipse users, you can do all this in Counterclokwise as well :) http://code.google.com/p/counterclockwise/wiki/EditorKeyBindingsFeatures |
| 09:52 | zerokarmaleft | tbaldridge: C-M-a and C-M-e already set marks |
| 09:53 | zerokarmaleft | so you just need C-M-a C-M-e C-w |
| 09:53 | ro_st | C-M-space |
| 09:53 | tbaldridge | cool, didn't know that since it wasn't highlighted. |
| 09:53 | ro_st | or C-M-k |
| 09:54 | si14_ | and finally I decided to generate my configs from YAML instead of parsing them :) |
| 09:55 | ro_st | C-M-a C-M-k |
| 09:56 | ro_st | go to begin of top form and cut the whole form |
| 09:56 | ro_st | s/cut/kill |
| 09:56 | zerokarmaleft | ro_st: nice, didn't know about that one |
| 10:04 | yedi | test |
| 10:05 | yedi | is there a #clojure log? |
| 10:05 | vijaykiran | ,log |
| 10:05 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: log in this context, compiling:(NO_SOURCE_PATH:0)> |
| 10:05 | vijaykiran | http://clojure-log.n01se.net/ |
| 10:06 | vijaykiran | yedi: ^^ |
| 10:06 | yedi | ty |
| 10:06 | clgv | $log |
| 10:07 | cemerick | huh, it used to be in there |
| 10:07 | cemerick | log? |
| 10:07 | clojurebot | see logs |
| 10:07 | cemerick | logs? |
| 10:07 | clojurebot | logs is http://clojure-log.n01se.net/ |
| 10:15 | vijaykiran | cemerick: ah, thx! |
| 10:15 | ppppaul | hey guys |
| 10:15 | ppppaul | what's a good lib for builing REST apis? |
| 10:16 | ppppaul | noir/compojure/ring/other? |
| 10:16 | weavejester | You might want to look at compojure + liberator |
| 10:17 | ohpauleez | previously I really enjoyed ring+moustache, but if you google around, you'll find something called liberator |
| 10:17 | ohpauleez | gah, late to the party |
| 10:17 | ohpauleez | :) |
| 10:17 | ppppaul | moustache? |
| 10:17 | clojurebot | moustache is http://github.com/cgrand/moustache |
| 10:17 | ro_st | noir, plain old compojure, liberator, bishop |
| 10:17 | ro_st | take your pick |
| 10:18 | ohpauleez | ohh bishop |
| 10:18 | ohpauleez | good call |
| 10:18 | ohpauleez | ro_st: I just saw your tweet |
| 10:18 | ro_st | ohpauleez: :) i ended up not using your fine efforts |
| 10:18 | ppppaul | i'm wondering what would be most productive, also i haven't used clojure in a while, so i'm almost a noob again |
| 10:18 | ro_st | which one? |
| 10:19 | ro_st | ppppaul: i believe liberator is the thing, now |
| 10:19 | ohpauleez | two things - a freshening up of Shoreleave (now that a chunk is in CLJS proper) |
| 10:19 | ohpauleez | and I have a bunch of notes on reactive stuff |
| 10:19 | ro_st | we're using noir and shoreleave-remote but that's because our consumer is cljs |
| 10:19 | ro_st | oh, that tweet :-) |
| 10:19 | ppppaul | people's thoughts on bishop? |
| 10:19 | clj_newb_2345 | is there a gallery of websites done in clojurescript? |
| 10:20 | ro_st | ppppaul: cmiles74 is bishop's author |
| 10:20 | ohpauleez | ro_st: But Shoreleave needs to be touched up and unified across the board, and I'm about to get some more time to work on it soon-ish |
| 10:20 | ro_st | clj_newb_2345: not that i know of, but i think it'd be awesom if there is |
| 10:21 | ro_st | ohpauleez: reactive looks very interesting. it's in the direction i want to go - real-time websockets stuff |
| 10:22 | ohpauleez | Definitely |
| 10:22 | ro_st | ohpauleez: i just put this out a couple days back http://github.com/cognician/fusebox |
| 10:23 | ohpauleez | YS! |
| 10:23 | ohpauleez | YES*** |
| 10:23 | ciphergoth | When I google for async support in Ring/Compojure, I find posts from a couple of years ago setting out how it might work. Is there a working mechanism now? |
| 10:23 | ro_st | it's ridiculously simple. i'm releasing a composition of this and datomic soon |
| 10:23 | ohpauleez | that's pretty solid |
| 10:24 | weavejester | ciphergoth: Try looking into Aleph |
| 10:24 | ivaraasen | ciphergoth: looked at Compojure + Aleph sample applications? |
| 10:24 | ohpauleez | ro_st: You should submit a cognician ClojureWest talk |
| 10:24 | weavejester | ciphergoth: After some experimentation with Ring, we found that adding async support direct to Ring didn't really work |
| 10:25 | ivaraasen | like this: https://github.com/alexkehayias/clojure-aleph-chat |
| 10:25 | ciphergoth | weavejester, ivaraasen: thanks |
| 10:25 | weavejester | ciphergoth: It really needs a separate protocol, as Aleph has |
| 10:25 | ciphergoth | OK |
| 10:25 | ro_st | ohpauleez: the implementation is almost non existant. but i think the value is in having the abstraction in place. was such a pleasure to write it up, wire it in to the backend, write a remote, and wire it into the frontend, all in a matter of hours. cljsbuild's crossovers rock. |
| 10:26 | ohpauleez | ro_st: Yes, I totally agree - there's definitely real power there |
| 10:26 | ro_st | ohpauleez: i totally want to get to the USA next year to attend the conj |
| 10:26 | ppppaul | weavejester, what do you mean by async support? do you mean realtime web stuff? |
| 10:27 | weavejester | ppppaul: Yeah |
| 10:27 | ppppaul | erlang chloe |
| 10:27 | ro_st | this is going to play nicely with a/b testing, too. i just got the datomic stuff done in our server code today. fuses are datomic schema attributes, and i can tag either the whole system, a user, a user role, or a user group with a fuse |
| 10:28 | ro_st | and query out a flat list of enabled fuses for the ring middleware |
| 10:28 | ppppaul | realtime web means state... state on a web server = bad |
| 10:28 | ro_st | just have to build a simple ui for setting fuse state now |
| 10:28 | weavejester | ppppaul: You mean threading state between requests |
| 10:28 | ciphergoth | is Aleph a web server, or something that runs within a servlet container |
| 10:29 | weavejester | But yes, websockets and HTTP are fundementally two different protocols that happen to share a common handshake |
| 10:29 | weavejester | ciphergoth: It's a async server that covers several protocols, including long-polling HTTP and websockets. |
| 10:29 | ro_st | i remember reading that, in production, you should put your websocket server far away from your webserver |
| 10:30 | ro_st | as they have totally different scaling semantics |
| 10:30 | ciphergoth | weavejester: I was hoping to use long polling within Jetty on Heroku |
| 10:30 | ohpauleez | ro_st: Yes |
| 10:30 | ppppaul | weavejester, not just websockets, even long polling counts in this case... updating clients in real time means lots of state management... it's not good for the webserver that is used to having all it's state in a db |
| 10:30 | ohpauleez | that is VERY true |
| 10:30 | weavejester | ro_st: That tends to be my approach. I don't think there are many advantages to having them on the same server. |
| 10:30 | ppppaul | also i can't imagine having an easy time scaling realtime stuff |
| 10:30 | ppppaul | it should really be on it's own server |
| 10:31 | clgv | What do I do wrong if a defprotocol is compiled correctly in REPL and when building the uberjar but I get a ClassNotFoundException for the interface of that protocol when I start the uberjar? |
| 10:32 | ppppaul | does ring handle sessions/cookies? |
| 10:32 | ro_st | ppppaul: yup |
| 10:33 | ppppaul | by default, or do i have to enable it? |
| 10:33 | ro_st | ohpauleez: i'd love it if you'd check fusebox out and holler if you see any weaknesses. |
| 10:33 | ro_st | you can enable/disable them as you wish |
| 10:33 | ppppaul | ^_^ |
| 10:33 | ro_st | they're implemented as middleware |
| 10:33 | ppppaul | hope it's easy to deal with |
| 10:34 | ro_st | you can start with a bare http server or a full featured cookies sessions param parsing much-ado |
| 10:34 | weavejester | ppppaul: Yep, but as middleware |
| 10:34 | ro_st | dead easy. |
| 10:34 | ppppaul | no cookie sessions for me, but i want mappings from cookies to sessions (i'm planning to put the session data in datomic, if this is easy) |
| 10:35 | ro_st | cemerick: 100 tabs? you trying to set a record? |
| 10:35 | ohpauleez | ro_st: I'll definitely add it to my day |
| 10:35 | cemerick | ro_st: Just SOP for me for years now :-P |
| 10:35 | cemerick | Tree-style tabs + firefox's tab spaces makes it all quite manageable |
| 10:35 | nDuff | ...though my browser tends to bog down if I try to go above 175 or so. |
| 10:36 | ro_st | thanks :-) |
| 10:36 | ro_st | ppppaul: we use memcached for sessions, but we do put a session id into datomic |
| 10:36 | cemerick | Ever since FF14 or so, it hasn't flinched |
| 10:37 | ro_st | ppppaul: you don't want to persist-for-eternity session flash messages, for example, or session redirect-after-login urls |
| 10:37 | ppppaul | think that putting the whole session in datomic is too much? |
| 10:37 | ro_st | we tried it. it's good for the stuff you want to keep for ever (session info like user-agent and ip) but not for transitory stuff like redirects and flashes |
| 10:38 | ppppaul | i'm under a lot of time pressure now, so i want to do what ever is simplest to get the product out... using multiple stores seems like an optimization |
| 10:38 | ro_st | because datomic doesn't forget anything, ever. that's its design |
| 10:38 | ppppaul | i don't know what flashes are, and i wont have redirects |
| 10:38 | ppppaul | i'll just have some tiny meta data for the user |
| 10:40 | ro_st | if you have total control over the keys written to session storage (which you can totally have), and you want to retain 100% of that session data, then datomic is totally fine |
| 10:40 | ciphergoth | So from what people have said here, and some negative results from Googling, it looks like the situation is the following: |
| 10:40 | ciphergoth | if you want to use eg async long polling, and your entire stack is Clojure, you're golden: you can use aleph and laminar. |
| 10:41 | ro_st | why the control over keys? each key, or attribute, has to be preconfigured as schema for datomic |
| 10:41 | ciphergoth | However, the Clojure net frameworks do *not* currently allow you to use the support for long polling in servlet-3.0 or Jetty. |
| 10:41 | ciphergoth | does that sound right? |
| 10:41 | ro_st | we use noir, which likes to put all sorts of its own stuff into session. which caused datomic to cry about unknown attribs |
| 10:44 | ppppaul | oh |
| 10:44 | ppppaul | well, i really only want one field in the session store |
| 10:45 | ppppaul | does noir use memory for sessions by default? |
| 10:45 | ro_st | it does |
| 10:45 | ppppaul | i'm not sure i'm using noir yet, though. looking at a lot of libs for api building right now |
| 10:45 | ppppaul | bishop seems pretty nice |
| 10:46 | ro_st | gotta go. good luck :-)_ |
| 10:46 | ppppaul | thanks |
| 10:46 | weavejester | ciphergoth: I don't know of any libraries for using the long polling in servlet 3.0 |
| 10:47 | weavejester | Servlets are pretty poorly designed |
| 10:47 | ciphergoth | weavejester: agreed |
| 10:47 | ciphergoth | weavejester: However a colleague points out that Heroku allows us to use Netty, which has much more direct control |
| 10:48 | weavejester | ciphergoth: Heroku allows you to use almost anything |
| 10:48 | ciphergoth | weavejester: ah, really? We could use aleph in Heroku? |
| 10:48 | weavejester | It's limited only by what is supported for compilation |
| 10:48 | weavejester | And what their proxy servers support |
| 10:49 | ppppaul | heroku doesn't like the erlang or haskell |
| 10:49 | weavejester | ciphergoth: Yep |
| 10:49 | weavejester | ppppaul: Isn't that just a question of compiling it, though? |
| 10:49 | ciphergoth | Aha, that's much more appealing |
| 10:49 | ciphergoth | thank you! |
| 10:50 | borkdude | why not use a VPS, they're not that expensive anymore and full control |
| 10:50 | weavejester | Heroku and other similar service have advantages in terms of managing server nodes |
| 10:50 | ciphergoth | and it sounds like it offers the control we need |
| 10:50 | weavejester | i.e. with a VPS you have to setup your own cluster |
| 10:51 | borkdude | ah yes |
| 10:51 | ciphergoth | yeah we are keen to avoid system adminsitration |
| 10:53 | ppppaul | are noir's session and cookie apis a big improvement ontop of what ring offers? |
| 10:54 | borkdude | there was an idea of a linux distro / VM image geared towards Everthing Clojure last year, I wonder if that became something? |
| 10:54 | borkdude | Everything |
| 10:54 | ppppaul | seems odd |
| 10:54 | weavejester | ppppaul: They use Ring's middleware underneath, but Noir is more stateful |
| 10:54 | ppppaul | just make a vagrant box |
| 10:54 | ppppaul | weavejester, for better or worse?? |
| 10:54 | lazybot | ppppaul: Uh, no. Why would you even ask? |
| 10:55 | weavejester | ppppaul: It kinda depends. I'd say that Ring's approach is better for middleware. Noir's approach is maybe more convenient for direct use. |
| 10:59 | ppppaul | can you elaborate (i haven't seen how ring does it yet) |
| 11:05 | weavejester | ppppaul: Ring sets session and cookies via keys on the response. Noir sets them via side-effectful functions. |
| 11:11 | clgv | when exactly do I need to AOT a namespace containing a defprotocol? |
| 11:11 | ohpauleez | clgv: Only when you're going to expose that code to a Java system (where you want to program Java against Clojure) |
| 11:12 | clgv | ok that's what I thought. but I still get a weird ClassNotFoundException for the protocol interface... |
| 11:12 | ohpauleez | yeah I saw the message earlier, no idea where that's coming from |
| 11:13 | ohpauleez | have you confirmed, via test or REPL that everything is named correctly, everything works |
| 11:14 | clgv | yeah from REPL it works |
| 11:14 | ohpauleez | does the name have dashes in it? |
| 11:14 | ohpauleez | or the ns |
| 11:14 | clgv | no |
| 11:14 | ohpauleez | well, I'm out of ideas :( |
| 11:14 | mthvedt | you're running things in a fresh JVM? |
| 11:15 | clgv | I added printlns to the two namespaces which are printed just before the exception. so the namespace with the protocol gets loaded |
| 11:15 | clgv | yeah several fresh repls and a lot of rebuilt uberjars |
| 11:16 | mthvedt | does it work if you use a non-uber jar? |
| 11:18 | clgv | oh, lein's "run" fails as well |
| 11:20 | clgv | so the non-uber jar probably fails as well |
| 11:21 | mthvedt | i actually don''t have any ideas… just fishing |
| 11:21 | technomancy | ppppaul: FWIW heroku supports erlang |
| 11:21 | technomancy | we have a harder time with haskell since the build chain is enormous |
| 11:22 | mthvedt | you could check if the class is present in the jar |
| 11:23 | clgv | mthvedt: no the class is not in the jar. but that shouldnt be a problem since the namespace is required |
| 11:24 | mthvedt | oh right |
| 11:25 | clgv | but maybe that is the problem - the class should be there if it is called from the compiled -main method |
| 11:28 | mthvedt | i'm no expert, but iirc java isn't supposed to load a class until it hits the code that actually uses the class |
| 11:28 | mthvedt | so if the RT loads it before main hits it, it seems you should be good... |
| 11:28 | mthvedt | on the other hand, class loader stuff like this is very easy to break... |
| 11:28 | gfredericks | okay I think korma's (select foo (with bars)) returns a lazy seq that has remaining queries to make |
| 11:29 | clgv | I think the interface is needed for the inline implementation in a deftype |
| 11:30 | mthvedt | it would be odd if loading the deftype didn't load the interface |
| 11:30 | technomancy | gfredericks: so it's a leak if not fully consumed? |
| 11:30 | gfredericks | technomancy: well I think what hiredman was saying yesterday about there being no with-connection macro means that korma is at liberty to assume that the connection is always available |
| 11:30 | gfredericks | I don't think it leaves queries open |
| 11:31 | gfredericks | I think as you consume each foo, it makes an individual query for all the bars of that foo |
| 11:31 | gfredericks | so each query is self-contained; but when the select returns there are more queries to make to realize the thing |
| 11:32 | gfredericks | in my case this means it makes way more queries than I'd like |
| 11:37 | ppppaul | is it possible, in emacs jacked in to lein/swank, to get lein to get lein to download new deps without me calling lein deps on the command line? |
| 11:38 | ppppaul | actually calling lein deps from the command line while my program is running is ok |
| 11:38 | ppppaul | is there an easy way for my program to use those deps without starting lein again? |
| 11:38 | ppppaul | would C-c C-l do what i want? |
| 11:39 | clgv | ppppaul: pomegranate |
| 11:39 | gfredericks | I expect you'd have to restart processes to get new deps in? So the classpath could be updated? |
| 11:40 | clj_newb_2345 | is it possible to have both horizontal and verticlal wheel scrolling to work in java? (In particular, I'm using a trackpad on ubuntu 12.10) |
| 11:40 | clj_newb_2345 | soI'm reading around, and it appears getting this to work requires recomioing the JDK or something |
| 11:41 | clj_newb_2345 | is it possible to get both horizontal and vertical mouse wheel scrolling to work in swing/awt? |
| 11:41 | clj_newb_2345 | i'm reading around, and it appears this requires recompiling the jdk |
| 11:42 | clgv | clj_newb_2345: you have more chances to get an answer in ##java I guess |
| 11:43 | borkdude | why does ##java have two #'s? |
| 11:44 | clgv | borkdude: there is some naming convention I forgot ;) |
| 11:45 | gtrak | borkdude: #java is more official, and invite-only |
| 11:48 | gtrak | borkdude: one time, during a netsplit, I successfully joined #java, but got kicked when it reattached :-) |
| 11:54 | clj_newb_2345 | how does one join #java ? |
| 11:54 | clj_newb_2345 | who sends out the invites? |
| 11:54 | acron^ | Hi guys |
| 11:54 | gtrak | how does one know if he's in the illuminati? |
| 11:54 | acron^ | Cheshire is giving me "java.lang.ClassNotFoundException: org.joda.time.DateTime" |
| 11:55 | clgv | clj_newb_2345: join ##java instead |
| 11:55 | dakrone | acron^: cheshire doesn't use joda at all, can you paste a code example? |
| 11:55 | devn | what's that fancy pants lib that you add to your project.clj that will automatically pull in new deps to your repl session when you change project.clj? |
| 11:55 | acron^ | It's stumping me a bit |
| 11:55 | hiredman | acron^: that exception is cheshires weird way of telling you it does not know how to encode a joda time object as a json |
| 11:56 | acron^ | http://pastebin.com/WxG81VUm |
| 11:56 | acron^ | ^ code |
| 11:56 | TimMc | devn: pomegranate? |
| 11:56 | dakrone | hiredman: cheshire *should* be throwing a JsonGenerationException if it can't encode it |
| 11:56 | dakrone | not a ClassNotFoundException |
| 11:56 | hiredman | dakrone: well I've seen it do that |
| 11:57 | dakrone | hence the *should* :) |
| 11:57 | dakrone | acron^: and what does find-maps return? |
| 11:57 | acron^ | A clojure map |
| 11:57 | acron^ | from MongoDB |
| 11:57 | dakrone | acron^: cheshire has no encoder for joda dates, you'll need to add one yourself if you want to be able to encode them |
| 11:57 | acron^ | (http://pastebin.com/KNQXhzxb < deps) |
| 11:58 | dakrone | I am guessing that is the issue |
| 11:58 | acron^ | What's joda on clojars? "clj-time" ? |
| 11:59 | dakrone | I have no idea, I assume it's something monger is bringing in and using |
| 11:59 | gtrak | clj-time is a wrapper over joda |
| 11:59 | dakrone | could be noir also |
| 11:59 | dakrone | if you do a lein deps :tree you can see who's bringing it in |
| 12:01 | ppppaul | could someone help me debug this simple error i'm getting related to package management https://gist.github.com/4260243 |
| 12:03 | ppppaul | i'm having a problem loading fs.core |
| 12:03 | gfredericks | huh. I'd expect that to work. |
| 12:03 | TimMc | ppppaul: The problem is likely with fs.core's ns header. |
| 12:03 | gfredericks | o_O |
| 12:04 | gfredericks | Raynes would never release a bug. |
| 12:04 | TimMc | Oh, fs is something external? |
| 12:04 | cmiles74 | ppppaul: I have more work to do on Bishop, but I used it on a couple real projects and it worked well. |
| 12:05 | TimMc | fs.core is a bad package name -- just waiting for a collision. |
| 12:05 | ppppaul | awesome |
| 12:05 | ppppaul | the dsl looks very nice cmiles74 |
| 12:06 | cmiles74 | ppppaul: thank you! There's some cleanup that could still be done, I think. But that's always the way. :-P |
| 12:06 | ppppaul | TimMc, i removed the require, and i'm still running into compile errors (looks like my project still thinks that i'm requiring it, even after saving and recompiling) |
| 12:06 | ppppaul | cmiles74, how easy is it to use session store (ring or whatever) with bishop? |
| 12:07 | TimMc | gfredericks: I guess it's not Raynes' fault... in this case. |
| 12:08 | ppppaul | maybe i need to re initalize the namespace |
| 12:08 | gfredericks | TimMc: that statement is always true |
| 12:08 | cmiles74 | ppppaul: All of the work I've done so far has been geared toward web-services... Working with other Ring middleware is straightforward, but I haven't done any work using sessions. I don't think it'd be a big deal. |
| 12:09 | ppppaul | cmiles74, sessions are very important for me, is there an easy way to put ring middleware in bishop? |
| 12:10 | cmiles74 | Session data comes through the request map under the :session key, I don't think you'll have to do anything. |
| 12:10 | ppppaul | woot! |
| 12:12 | cmiles74 | ppppaul: Looking at the pieces, IMHO it should all just work. :-D |
| 12:12 | ppppaul | TimMc, i had to use (remove-ns) |
| 12:14 | cemerick | pjstadig: Did you ever get your invokedynamic fork cooking? It'd be interesting to see how the cons/conj example fares under that. |
| 12:16 | alexnixon | TimMc: (thanks for pointing me at "locals clearing" at around this time yesterday - I had to go afk but didn't miss your message) |
| 12:21 | ppppaul | hey, i want to slurp a file that may not exist, and i don't want my program to break, but getting a nil back or something is ok. how would i go about doing this? |
| 12:22 | thorwil | ppppaul: wrap it in a try? |
| 12:23 | technomancy | (if (.exists f) (slurp f)) |
| 12:23 | ppppaul | great! |
| 12:23 | ppppaul | thanks technomancy |
| 12:23 | gfredericks | technomancy: ugh, so much code |
| 12:23 | technomancy | actually use and instead |
| 12:23 | gfredericks | wat. |
| 12:23 | gfredericks | for unreadability? |
| 12:23 | technomancy | gfredericks: you mean it could be 3x shorter with monads? |
| 12:24 | gfredericks | (-> f .exists (if (slurp f))) is clearly the most readable |
| 12:24 | ppppaul | hmm |
| 12:24 | technomancy | gfredericks: logically you're looking for the existence of the file and the contents of the file |
| 12:24 | ppppaul | i am mapping over a list of files |
| 12:24 | cemerick | I was going to wat at the binary if, but... #deadhorse |
| 12:24 | ppppaul | i don't want to keep the nils in my array, would i use keep for this? |
| 12:25 | gfredericks | cemerick: what's a binary if? |
| 12:25 | technomancy | gfredericks: the best kind of if |
| 12:25 | cemerick | vs. ternary |
| 12:25 | cemerick | i.e. using if instead of when when there's no 'else' branch |
| 12:25 | technomancy | ppppaul: if you're going to have to run a filter over it anyway you might as well check for existence before slurping |
| 12:25 | ppppaul | ok |
| 12:25 | cemerick | technomancy and I have been arguing about this for far too long :-P |
| 12:25 | ivaraasen | gfredericks: the best solution is obviously to make the reader bind the symbol æ to (-> f .exists (if (slurp f))) and just use æ instead. |
| 12:26 | gfredericks | is technomancy's position that when indicate's side effects? I've always liked that interpretation. |
| 12:26 | technomancy | another ally! |
| 12:27 | gfredericks | when is in the same pile with do |
| 12:27 | ppppaul | ok, i have a (-> files (filter .exists) (map slurp)) |
| 12:27 | technomancy | gfredericks: as has been the lisp tradition since the dawn of time |
| 12:27 | gfredericks | I didn't know that. |
| 12:27 | technomancy | ppppaul: .exists isn't a function; it's a method |
| 12:27 | cemerick | gfredericks: I guess you put let in that bunch too? :-P |
| 12:27 | ppppaul | hnmm |
| 12:27 | cemerick | symbol-macrolet, and we could all be writing APL by now |
| 12:28 | gfredericks | cemerick: I wouldn't mind there being a separate let for side effects. But that's probably being unnecessarily strict about it |
| 12:29 | ppppaul | technomancy, i changed from using the method to using fs.core/exists? |
| 12:29 | ppppaul | :D |
| 12:29 | gfredericks | but to the extent that the built-ins encourage you to make side-effects explicit, I think that's a good thing. Too far down that road lies haskell, and apparently we hate that. But maybe a little bit is okay? |
| 12:29 | ohpauleez | cemerick: Are you starting fires in here again? :) |
| 12:29 | cemerick | ohpauleez: again? I thought that was my only job? |
| 12:29 | ohpauleez | haha |
| 12:30 | cemerick | gfredericks: of course, nothing about these forms actually has anything to do with side-effecting or not |
| 12:30 | cemerick | in contrast to e.g. io! |
| 12:30 | gfredericks | well, the only thing when gives you over binary if is the ability to add side-effect statements |
| 12:31 | gfredericks | so if you only use it when you need that, then you've got a side-effect flag. in a loosy sense. |
| 12:31 | cemerick | actually, it allows you to avoid the impression that perhaps you've accidentally left out a branch. |
| 12:31 | cemerick | Which is what I think when I see (if x y) ;... where's z?! |
| 12:31 | gfredericks | right. So there's two reasons to distinguish between if and when. I guess the question is whether it's more useful to flag side effects or binary intentions |
| 12:31 | technomancy | accidentally used a "dirty" arity of the macro? |
| 12:32 | gfredericks | we could fix all this by (defmacro bif [x y] (list 'if x y)) |
| 12:32 | cemerick | We'd all need blotters under our keyboards if we wanted to mark side effects generally |
| 12:32 | gfredericks | and that would be more like back-to-the-future so I think that's always the way to go |
| 12:33 | technomancy | or a jira issue to fix the bug that if has multiple bodies |
| 12:33 | seangrove | What happened with recet versions of magit, everything takes way more key strokes now |
| 12:33 | gfredericks | technomancy: you'd prefer it ternary-only? |
| 12:33 | technomancy | gfredericks: no; I'm pointing out how silly it is to claim that `if` is broken out of the box |
| 12:34 | gfredericks | technomancy: phew. I thought for a second you had said something that I didn't quite agree with initially. |
| 12:34 | gfredericks | CRISIS AVOIDED |
| 12:34 | ohpauleez | CARRY ON |
| 12:34 | ohpauleez | technomancy: No, I haven't the option to toggle things off and on |
| 12:35 | ohpauleez | but the output isn't that verbose |
| 12:35 | ohpauleez | so I don't think it'll make it unusable |
| 12:35 | ohpauleez | you just ignore whatever you think is nonsense |
| 12:35 | technomancy | I'll just wait till it's fixed |
| 12:40 | seangrove | Is kibit the standard clojure linter? I haven't used any yet, and would like to run some over my cljs |
| 12:42 | ohpauleez | It's form-based static analysis - looking for common patterns of text to substitute, but there is no program or whole-function analysis |
| 12:42 | ohpauleez | it makes suggestions, for example, instead of using interpose on a string, you should use clojure.string/join |
| 12:42 | seangrove | Yeah, just saw it referenced yesterday in dnolen's talk |
| 12:43 | seangrove | Any recommendations for a similar tool? Not urgent, just thought it'd be nice |
| 12:43 | ohpauleez | Kibit is pretty good |
| 12:43 | ohpauleez | and it's as good as you're willing to make it |
| 12:48 | SegFaultAX | seangrove: Do you have a link for that talk? I meant to watch it but wasn't able to find the time yesterday. |
| 12:49 | seangrove | Sure, one second |
| 12:49 | seangrove | SegFaultAX: http://skillsmatter.com/podcast/scala/the-refined-clojurist |
| 12:49 | SegFaultAX | seangrove: Danke! |
| 12:50 | seangrove | De rien |
| 12:52 | devn | (print-table (:members (reflect Math))) |
| 12:52 | devn | (use 'clojure.pprint) |
| 12:52 | devn | ,(use 'clojure.pprint) |
| 12:52 | devn | ,(print-table (:members (reflect Math))) |
| 12:52 | clojurebot | nil |
| 12:52 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: reflect in this context, compiling:(NO_SOURCE_PATH:0)> |
| 13:03 | SegFaultAX | What is the best paraedit plugin for vim? |
| 13:04 | ohpauleez | SegFaultAX: paredit.vim |
| 13:05 | ohpauleez | https://github.com/vim-scripts/paredit.vim |
| 13:05 | ohpauleez | I believe this is the new home |
| 13:11 | ppppaul | where does lein keep it's deps? |
| 13:11 | gfredericks | in ~/.m2 |
| 13:11 | ohpauleez | ppppaul: in the .m2 // it uses maven |
| 13:20 | rbxbx | Is there a builtin fn that acts as a composition of map && dissoc ? |
| 13:20 | rbxbx | so given a collection of maps remove a key from all of them |
| 13:21 | gfredericks | I don't think so |
| 13:21 | rbxbx | (map #(dissoc % :key) coll) |
| 13:21 | rbxbx | gfredericks okay, thanks :) |
| 13:21 | TimMc | If there were, I would wonder why someone wouldn't just use map and dissoc. |
| 13:22 | gfredericks | TimMc: well there are _some_ functions that are trivial compositions of others |
| 13:22 | rbxbx | gfredericks I dare say many ;) |
| 13:22 | gfredericks | but I agree that one sounds a little too specialized given how often I haven't needed it |
| 13:22 | gfredericks | like for example just today I didn't need it |
| 13:22 | SegFaultAX | ohpauleez: Thanks, I've looked at that one a number of times but I wasn't clear if I should be using slimv with it. |
| 13:22 | rbxbx | haha |
| 13:23 | SegFaultAX | ohpauleez: If I would have just read the documentation I would have seen that it's part of slimv, but also it's own standalone plugin. ;) |
| 13:23 | rbxbx | also, perhaps on the same subject, is there a prefered way to compose when the argument order is reversed? |
| 13:23 | ohpauleez | SegFaultAX: Nope, it was just pulled out of Slimv. There's even hooks for other systems in it (vimclojure, for example) |
| 13:23 | rbxbx | Or should one just use a single argument anon fn |
| 13:23 | gfredericks | rbxbx: I expect that's how most people do it |
| 13:23 | ohpauleez | rbxbx: Check out clojerks |
| 13:24 | rbxbx | ohpauleez I moved, too late :) |
| 13:24 | ohpauleez | NOOOOOOOO |
| 13:24 | ohpauleez | rbxbx: back to NYC? |
| 13:24 | rbxbx | Yeah. It's a net neutral move. |
| 13:24 | rbxbx | Portland and Brooklyn will have both lost and gained a clojurian |
| 13:24 | rbxbx | ;) |
| 13:24 | ohpauleez | :) |
| 13:24 | rbxbx | ohpauleez I do regret that we weren't able to hang out more though |
| 13:25 | ohpauleez | rbxbx: same |
| 13:25 | SegFaultAX | ohpauleez: I'm seeing that now! By the way, do you use nrepl? |
| 13:25 | ohpauleez | SegFaultAX: vim+foreplay+paredit+surround |
| 13:25 | ohpauleez | +VimClojure (static) |
| 13:26 | ohpauleez | I've definitely been enjoying the nREPL life |
| 13:26 | rbxbx | ohpauleez do you find paredit necessary with surround? |
| 13:26 | rbxbx | I mean, I'm guessing so, since you listed it. |
| 13:26 | ohpauleez | haha, good guess! |
| 13:27 | rbxbx | ;_; |
| 13:27 | rbxbx | Perhaps I'll give it another whirl. |
| 13:27 | devth | I find paredit annoying with surround - but that's because I've used surround forever and haven't taken the time to learn paredit |
| 13:27 | rbxbx | devth ditto |
| 13:27 | ohpauleez | moving parens, splicing, joining, navidating across parens and defns/top-levels, etc |
| 13:27 | ohpauleez | surround is great for…. the surrounding things, but that's about it |
| 13:28 | ohpauleez | paredit, takes over from there |
| 13:28 | ohpauleez | keeps things balanced, keeps the cursor where it needs to be, makes clearing up full forms easy |
| 13:29 | duck1123 | I've never heard of surround, but how is it better than just M-( |
| 13:29 | ohpauleez | duck1123: cs'" |
| 13:29 | ohpauleez | change surrounding ' to " |
| 13:29 | ohpauleez | ds" |
| 13:29 | ohpauleez | delete surrounding " |
| 13:29 | devth | ysiWb |
| 13:29 | TimMc | rbxbx: You haven't lived until you've M-x paredit-convolute-sexp |
| 13:30 | ohpauleez | once you learn it, paredit makes you far faster, saves keystrokes, and adds to the fun |
| 13:30 | rbxbx | I'll probably revisit. I can only learn so much at once :) |
| 13:30 | TimMc | Indeed. |
| 13:30 | ohpauleez | :) |
| 13:31 | rbxbx | TimMc just think how many people have died without ever really having lived |
| 13:31 | rbxbx | ;P |
| 13:31 | TimMc | It fills me with sorrow. |
| 13:31 | rbxbx | ohpauleez did you find a clojure gig in pdx or are you still with ... tutor.... tutor... something? |
| 13:32 | hiredman | paredit: harder better faster stronger |
| 13:32 | ohpauleez | still with tutorspree and running my own R&D lab - NDensity |
| 13:33 | rbxbx | ohpauleez neat :) |
| 13:38 | hyPiRion | So, except for (not (nil? ...)), what other succinct ways are there to map a truthy value to true, and a falsey to false? |
| 13:38 | hyPiRion | /s/falsey/nil/ |
| 13:39 | technomancy | there's `boolean` |
| 13:40 | TimMc | (comp not nil?) won't do that |
| 13:41 | metellus | ,(boolean :x) |
| 13:41 | clojurebot | true |
| 13:41 | hyPiRion | technomancy: well, that should fit my needs. Thanks. |
| 13:41 | metellus | ,(boolean nil) |
| 13:41 | clojurebot | false |
| 13:41 | hyPiRion | TimMc: Well, strictly speak I only need to return non-falsey objects as true. |
| 13:41 | hyPiRion | /s/speak/speaking/ |
| 13:42 | metellus | oh, technomancy beat me to it |
| 13:42 | TimMc | ,(->> [1 true false nil] (map (juxt (comp not not) boolean)) (every? (partial apply =))) |
| 13:42 | clojurebot | true |
| 13:44 | TimMc | (-> identity complement complement) |
| 13:46 | hyPiRion | (mapv #({false false, nil false} % true) [1 true false nil [] {}]) |
| 13:46 | hyPiRion | ,(mapv #({false false, nil false} % true) [1 true false nil [] {}]) |
| 13:46 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: in this context, compiling:(NO_SOURCE_PATH:0)> |
| 13:47 | hyPiRion | ,(mapv #({false false, nil false} % true) [1 true false nil []]) |
| 13:47 | clojurebot | [true true false false true] |
| 13:53 | TimMc | ,(->> [1 true false nil (Boolean. false)] (map (juxt (comp not not) boolean)) (map (partial apply =))) |
| 13:53 | clojurebot | (true true true true false) |
| 13:55 | TimMc | (Boolean. false) strikes again! |
| 13:55 | SegFaultAX | ohpauleez: When you say static vimclojure, do you just mean sand nailgun? |
| 13:59 | ohpauleez | SegFaultAX: Yeah, sans nailgun - I'm using foreplay/nREPL now |
| 13:59 | ohpauleez | VimClojure is just doing the syntax highlighting, indenting, etc |
| 14:00 | ohpauleez | but with that setup you can `cpw` to eval the symbol your on, `cpp` for the paragraph, cqq to take the current form and put it in the "REPL" and I aliased cpr to require the file |
| 14:01 | ohpauleez | [d for source lookup, K for doc lookup |
| 14:01 | rking | I wonder how I'd get 'lein' on Gentoo. dev-lang/clojure provided clojure-1.{1,4}, and dev-lang/clojure-contrib added a clojure-contrib.jar. Not seeing lein anywhere though |
| 14:02 | technomancy | rking: there was a package a while ago but it was pretty buggy. best to install 2.0.0-preview10 by hand. |
| 14:02 | rking | technomancy: OK, thanks. |
| 14:02 | rking | technomancy: Do you advise against installing from VCS? |
| 14:04 | technomancy | rking: you can run from git if you're interested in contributing to Leiningen. otherwise it doesn't make sense |
| 14:05 | llasram | Huh: ##[(compare [0 0] [1]) (compare [0 0] [1 :whatever])] |
| 14:05 | lazybot | ⇒ [1 -1] |
| 14:05 | technomancy | rking: bootstrapping a self-hosted program is always a bit tricky |
| 14:06 | rking | technomancy: OK, thanks. |
| 14:08 | SegFaultAX | ohpauleez: That sounds awesome. I don't really like using nailgun. It feels a lot more painful than it should be to setup. |
| 14:14 | hyPiRion | ,(let [b (Boolean. false)] (= b (not b))) |
| 14:14 | clojurebot | true |
| 14:15 | SegFaultAX | hyPiRion: Huh? |
| 14:15 | SegFaultAX | How? |
| 14:15 | clojurebot | with style and grace |
| 14:16 | hyPiRion | It's all in the details, isn't it. |
| 14:17 | rbxbx | Does anyone have examples of some alternate credential-fn's for usage with friend? /cc cemerick |
| 14:17 | marcello | what's the best way to begin to go about splitting a large text into chunks that each have no more than 10k characters and no more than 250 lines |
| 14:18 | rbxbx | Trying to suss out the contract that function must uphold from the readme and builtin bcrypt-credential-fn and having a hard time |
| 14:18 | marcello | is a recursive loop my best bet? |
| 14:18 | hyPiRion | ,(let [conj (memoize conj)] (map #(conj % 2) [[1] '(1) (ArrayList. [1])])) |
| 14:18 | clojurebot | ([1 2] [1 2] [1 2]) |
| 14:19 | hyPiRion | hurray. |
| 14:19 | rking | Hrm. Trying to install Datomic codeq (with little JVM / clojure) knowledge. java.lang.NoClassDefFoundError: clojure/lang/IFn means I should… |
| 14:20 | hyPiRion | marcello: You're splitting a string either on 10k elements or 250 lines, whichever comes first? |
| 14:20 | andrewmcveigh | rbxbx: from memory, the function needs to return a map containing {:username "foo" :password "bcrypted pass"} |
| 14:20 | rking | FWIW 'lein repl' is working. |
| 14:20 | marcello | hyPiRion: exactly |
| 14:20 | rking | (And the above exception came from: java -server -Xmx1g -jar /home/rking/pkg/codeq/target/codeq-0.1.0-SNAPSHOT.jar datomic:free://localhost:4334/git ) |
| 14:21 | hiredman | rking: you need to build an uberjar |
| 14:21 | hiredman | rking: read the datomic docs, do what they say |
| 14:21 | hiredman | errr |
| 14:21 | hiredman | the codeq docs |
| 14:21 | rbxbx | andrewmcveigh: hmm.. Thanks :) |
| 14:21 | hyPiRion | Well, you're accumulating over two things, so I'd use loop, yes. |
| 14:21 | rking | hiredman: I did do that. That's what that codeq-0.1.0-SNAPSHOT.jar is |
| 14:22 | hyPiRion | Write it in Java if performance is an issue. |
| 14:22 | rbxbx | andrewmcveigh I guess I could just throw a prn in there and see what the default is doing. |
| 14:22 | hiredman | rking: you didn't |
| 14:22 | hiredman | "lein uberjar" |
| 14:22 | andrewmcveigh | rbxbx: It's not working for you? |
| 14:23 | rbxbx | andrewmcveigh the default is, I'm trying to write my own though |
| 14:23 | rking | hiredman: From a few minutes ago: https://gist.github.com/d7b2ce2eb68e5e1df8f2 |
| 14:23 | rbxbx | andrewmcveigh dealing with legacy data that has been hashed differently |
| 14:24 | hiredman | rking: ok, compare the jar name you are using with the jar name in the readme |
| 14:25 | rking | hiredman: Theirs says -standalone.jar |
| 14:25 | andrewmcveigh | rbxbx: ah, afaik thats what the bcrypt-credential-fn expects. |
| 14:25 | rking | hiredman: Thanks. |
| 14:26 | rbxbx | andrewmcveigh this is a bit clearer than bcrypt-credential-fn to me, perhaps I'll use it as a reference – https://github.com/cemerick/friend/blob/master/test/test_friend/mock_app.clj#L109 |
| 14:26 | andrewmcveigh | rbxbx: Oh, and it returns the "user" map, without the password key. |
| 14:27 | rbxbx | andrewmcveigh: I think associng on the identity was throwing me |
| 14:28 | cemerick | rbxbx: if the hashing is the only thing that differs, then you should be able to follow the pattern set by bcrypt-credential-fn |
| 14:29 | rbxbx | cemerick that and hitting the database to return the user vs looking up in a map |
| 14:29 | technomancy | who was in here yesterday saying that git doesn't suck? |
| 14:29 | cemerick | rbxbx: That's entirely separate from the hashing verification |
| 14:30 | cemerick | i.e. if you keep them separate, then you can mix and match easily with partial |
| 14:30 | Mr_Bond | technomancy: I imagine that could have been a number of people :) |
| 14:30 | rbxbx | cemerick that was my next question. Indeed it is. |
| 14:31 | rbxbx | cemerick: https://github.com/cemerick/friend/blob/master/test/test_friend/mock_app.clj#L109 was throwing me a bit since it combines the two |
| 14:31 | rbxbx | ...also, if I'm not mistaken, that function doesn't actually seem to get used in the example app |
| 14:31 | technomancy | well I just wasted a day working around the fact that git appears to have two different implementations of .gitignore parsing |
| 14:32 | rbxbx | cemerick cheers, thanks for the guidance :) |
| 14:32 | cemerick | rbxbx: you mean bcrypt-credential-fn? |
| 14:32 | llasram | technomancy: Huh. For what differing contexts? |
| 14:32 | technomancy | llasram: git ls-files claims to use the same logic as .gitignore, but actually completely ignores directory entries |
| 14:32 | rbxbx | cemerick I mean the private fn credential-fn defined on line 109 of that mock_app |
| 14:32 | rbxbx | https://github.com/cemerick/friend/blob/master/test/test_friend/mock_app.clj#L109 |
| 14:33 | rbxbx | cemerick ^^ |
| 14:33 | technomancy | you have to use a glob if you want to ignore anything inside a dir |
| 14:33 | technomancy | a triple-glob |
| 14:33 | cemerick | rbxbx: oh, indeed it does not |
| 14:33 | amalloy | technomancy: triple-glob? |
| 14:33 | technomancy | amalloy: /dir/**/* |
| 14:33 | llasram | technomancy: Even with --exclude-standard ? |
| 14:33 | technomancy | llasram: ayup |
| 14:33 | llasram | huh |
| 14:34 | technomancy | bloody nonsense |
| 14:35 | rbxbx | cemerick I'd considered submitting a pull request removing it, but wasn't sure your original intent. |
| 14:36 | cemerick | It's probably just cruft. |
| 14:36 | llasram | That's weird... I'm not sure I'm seeing that behavior. I ask and am curious because I recently switched from `find-file-in-project` to a `find-file-in-repository` extension, and hacked in new-file-unless-.gitignore'd feature using those flags to git-ls-files |
| 14:36 | cemerick | rbxbx: submit away :-) |
| 14:36 | rbxbx | cemerick also I'm not comfortable enough with the clojures at this point to go submitting pull requests willy nilly and risking public shaming :p |
| 14:37 | technomancy | llasram: mkdir ignore; cd ignore; git init; mkdir hello; touch hello/world; echo "/hello/" > .gitignore; git ls-files -i -o -X .gitignore | wc -l |
| 14:37 | technomancy | zero here |
| 14:41 | llasram | Oh! Weird. And yet with --directory, it will then show you the ignored directory |
| 14:42 | llasram | Good old git |
| 14:42 | technomancy | yeah, great behaviour for a command called ls-files =\ |
| 14:45 | Mr_Bond | technomancy: ahh, that sucks (the git-ls parsing) are you using a recent version? |
| 14:46 | cemerick | is there a git incantation that will apply a patch without mucking with the of the tip of the patch? It seems github pull requests aren't closed when the patch is applied with e.g. `curl patch-url | git am --` |
| 14:46 | technomancy | Mr_Bond: I have to make it work in production where we're running 1.7.0 |
| 14:46 | cemerick | with the SHA* |
| 14:46 | Mr_Bond | technomancy: I see, that's not to old anyway |
| 14:47 | Mr_Bond | thought maybe it was a difference in c/perl apps, and that if one of the tools where perl maybe it had been re-implemented in C |
| 14:49 | tpope | cemerick: git apply applies a single patch to your work tree without committing |
| 14:50 | ppppaul | taking advice from some of you guys from earlier today, i'm going to use liberator for my web api... however it actually has a symbol/dep bug in it. can someone point me to a resource that will help me learn how to use a patched version of the lib in my project. thanks |
| 14:53 | rbxbx | ppppaul you can fork it and upload a version under your own org to clojars |
| 14:54 | rbxbx | (while submitting a pull request with the bugfix, of course ;) ) |
| 14:55 | rbxbx | ppppaul https://github.com/ato/clojars-web/wiki/tutorial explains that process |
| 14:55 | rbxbx | You can probably also link against a local version, but I'm not sure how to do that. |
| 14:57 | ppppaul | thanks |
| 14:58 | rbxbx | np |
| 14:58 | cemerick | tpope: sorry, I botched my question. I was hoping to find a way to git am, but as if I were merging with --ff-only, say. |
| 14:58 | cemerick | But, nm; it's inconsequential. |
| 14:59 | cemerick | Github's change some time ago to merge pull requests with --no-ff still bums me out. |
| 15:03 | rking | cemerick: What does that affect? |
| 15:03 | cemerick | rking: you get merge commits even when they're unnecessary |
| 15:04 | rking | Oh, OK |
| 15:05 | tpope | yeah I hate that |
| 15:05 | tpope | but it's consistent with "commit message closes the issue" |
| 15:05 | pbuckley_ | I have two lists of maps with some overlap between them (both ways) and I want to merge them into a single list of merged maps - any pointers at what to look at? I'm banging my head on the cheatsheet and not finding anything suitable on my own. |
| 15:05 | tpope | I cherry-pick and close the issue by hand :/ |
| 15:05 | ppppaul | rbxbx, http://blog.cymen.org/2012/03/12/leiningen-and-lein-localrepo-how-to-create-local-maven-repository-for-jar-files/ |
| 15:05 | technomancy | llasram: also apparently --directory only works with top-level directories, not nested ones woooooooo |
| 15:06 | llasram | I guess Linus wants you to do something like ( git ls-files -o -X .gitignore ; git ls-files -o ) | sort | uniq -u ? |
| 15:06 | llasram | It's already 90% shell scripts, so one more layer can't hurt |
| 15:06 | rbxbx | ppppaul good to know, bookmarked should the need arise again. Thanks :) |
| 15:07 | tpope | llasram: what's the goal? |
| 15:07 | technomancy | llasram: nope; still doesn't work |
| 15:07 | raek | pbuckley_: something like this? (let [x [{:a 1} {:b 2}], y [{:x 1} {:y 2}]] (map merge x y) ) |
| 15:08 | cemerick | tpope: you can still ff merge locally and push, but it's a PITA |
| 15:08 | technomancy | git: it mostly works, if you don't look too closely |
| 15:08 | tpope | yep |
| 15:08 | cemerick | I still do it, just because merge commits bother me, unreasonably so |
| 15:09 | hyPiRion | curl http://link.to.pull/request.patch | git am ? Not too hard |
| 15:09 | tpope | I am so anal about my git history it probably qualifies as a disorder |
| 15:10 | rking | tpope: It does. |
| 15:10 | rking | But at least it elevates the rest of us. ☺ |
| 15:10 | tpope | I rejected rking's commit because it had a unicode arrow in it |
| 15:10 | hyPiRion | Just a pity you can't configure whether merging or applying directly on top. |
| 15:10 | cemerick | hyPiRion: that produces a separate commit that isn't recognized by github as closing the pull req |
| 15:11 | tpope | cemerick: does a ff merge close it? |
| 15:11 | pbuckley_ | raek - that seems to work, but discards maps that aren't in both lists |
| 15:11 | cemerick | tpope: yeah, but you have to pull from the other remote and push |
| 15:11 | raek | ,(map merge [{:a 1} {:b 2}] [{:x 1} {:y 2}]) |
| 15:11 | clojurebot | ({:x 1, :a 1} {:y 2, :b 2}) |
| 15:11 | cemerick | I was hoping to be lazy and just copy/paste the .patch file URL from the pull req email, etc. |
| 15:12 | hyPiRion | cemerick: Oh, I thought it would close it. Well then, that sucks. |
| 15:12 | raek | pbuckley_: so you didn't want to merge the two sequences element wise? |
| 15:12 | pbuckley_ | raek: they're not balanced - one list is two elems long, the other is three |
| 15:12 | tpope | I have been being lazy, but it means I have to close my hand |
| 15:12 | cemerick | hyPiRion: nope, does one of those X authored, Y committed commits |
| 15:13 | tpope | hub is pretty good about encapsulating some of these workflows |
| 15:13 | cemerick | their pull req UI used to be *perfect* in this way |
| 15:13 | tpope | e.g hub remote add cemerick to git remote add cemerick git://github.com/cemerick/reponame.git |
| 15:15 | cemerick | tpope: hah, I thought you were just referring to github as 'hub' :-P |
| 15:15 | tpope | the idea is alias git=hub |
| 15:16 | tpope | https://github.com/defunkt/hub |
| 15:16 | cemerick | oh, that's cute |
| 15:16 | tpope | let's you cherry-pick github urls |
| 15:16 | tpope | little niceties like that |
| 15:16 | cemerick | and here I had just started using bitbucket more often |
| 15:18 | tpope | git merge https://github.com/defunkt/hub/pull/73 |
| 15:18 | tpope | cemerick: ^ probably does exactly what you want |
| 15:18 | bbloom | last i tried hub, it had a 3 second startup time thanks to rubygems |
| 15:18 | tpope | err no, it passes --no-ff :( |
| 15:19 | tpope | bbloom: you probably installed it wrong |
| 15:19 | rbxbx | cemerick following the pattern laid forth by bcrypt worked. I still don't quite understand the cred-fn's contract though. |
| 15:19 | tpope | or installed it before there was a right way |
| 15:19 | bbloom | i think the latter |
| 15:19 | bbloom | i'm usually pretty good with readmes :-) |
| 15:19 | sshack | (map fund :key (my-records)) maps over a key in a list of records, right? |
| 15:19 | rking | I wish they wouldn't recommend 'alias git=hub'. That's really dumb. |
| 15:20 | amalloy | pbuckley_, raek: if you want map to walk along the longest seq, rather than the shortest, your best bet is probably to pad the shorter ones with some placeholder element. for example, if you had https://github.com/flatland/useful/blob/develop/src/flatland/useful/seq.clj#L39 then you could (map (partial apply merge) (zip xs ys)) |
| 15:20 | cemerick | tpope: I get "fatal: http://.... —not something we can merge" |
| 15:20 | cemerick | anyway |
| 15:20 | tpope | cemerick: that's with alias git=hub |
| 15:20 | amalloy | sshack: no |
| 15:20 | cemerick | oh, oh, right |
| 15:21 | sshack | amalloy: What did I get wrong? |
| 15:21 | amalloy | are you looking for (map (comp fund :key) records)? |
| 15:21 | tpope | cemerick: but it does --no-ff, so don't bother |
| 15:21 | cemerick | wait, I'm gonna get ruby all over me using hub? :-P |
| 15:21 | cemerick | heh, oh well |
| 15:21 | sshack | Possibly. I'd like a list of all the :key from values from each record. |
| 15:21 | sshack | Say, bank balances. |
| 15:21 | amalloy | that's just (map :key records) |
| 15:22 | amalloy | it's unclear what 'fund is doing there |
| 15:22 | tpope | command line scripts are one area where you clojure guys have no right to be snobbish :) |
| 15:22 | sshack | Ahh. Perfect. |
| 15:22 | amalloy | (inc tpope) |
| 15:22 | lazybot | ⇒ 1 |
| 15:22 | tbaldridge | (inc lazybot) |
| 15:22 | lazybot | ⇒ 10 |
| 15:23 | cemerick | tpope: I fix that by being snobbish w.r.t. scripts in general. ;-) |
| 15:23 | seangrove | Damn, it's basically impossible to get away from js' callback passing |
| 15:23 | seangrove | if it infects one method, it infects every method that needs to call it... |
| 15:23 | bbloom | seangrove: *sigh* i really really need to finish my CPS transform :-P |
| 15:25 | seangrove | bbloom: I'd love to see something like that... I have a sense I'm about to build a massive-ish event-coordinating service in cljs and going to have to re-write most of our things to work with it |
| 15:25 | TimMc | I don't mind the callback passing so much until there's a loop. |
| 15:26 | bbloom | TimMc: the operators in https://github.com/caolan/async are super useful |
| 15:26 | bbloom | (and trivially ported-to/used-by cljs) |
| 15:26 | seangrove | TimMc: the problem I have is that something written in callback style can't be used by non callback-oriented code |
| 15:26 | seangrove | I think that's my main problem... or at least one of them |
| 15:27 | bbloom | dammit, i have too many projects to choose from, but i think the CPS would have the largest impact on the community... |
| 15:27 | bbloom | maybe i'll just knuckle down and finish that this week |
| 15:28 | seangrove | Please do ;) |
| 15:28 | tbaldridge | +1 bbloom |
| 15:28 | seangrove | It's over my head to make it, but I'd love to use it |
| 15:28 | amalloy | bbloom: have you looked into what, uh, whatshisname did on that topic a couple months ago? |
| 15:28 | bbloom | amalloy: the tail call recursion thing? |
| 15:28 | amalloy | yeah |
| 15:28 | bbloom | yes |
| 15:28 | bbloom | i'm following the same research papers he was |
| 15:28 | tbaldridge | I really want to see Rx in Clojure. And I think it's not going to happen until someone just does it as a library. |
| 15:28 | bbloom | basically, it's a *selective* transform |
| 15:29 | bbloom | ie doesn't transform expressions into CPS if they are *definitely not* going to execute any control forms |
| 15:29 | bbloom | his project, however, used a totally custom form parser, analyzer, and AST representation. plus did some weird decidedly unclojurety things |
| 15:30 | tbaldridge | I gathered that from his talk at the Conj. A few times I thought "this is awesome...but yeah...he doesn't use Clojure much". |
| 15:30 | bbloom | also TCO doesn't require reifying continuations in any meaningful way |
| 15:31 | pbuckley_ | amalloy, thanks that flatland.useful stuff was just what I needed |
| 15:31 | bbloom | ok, fine, i'll try to finish that damn transform this week :-) |
| 15:32 | seangrove | bbloom: Have it on my desk by tomorrow morning, along with the tps report |
| 15:32 | tbaldridge | rofl! |
| 15:33 | tbaldridge | sorry, I saw that movie for the first time ever, this year. So it's still funny at times. |
| 15:33 | bbloom | heh, on that note: lunch time |
| 15:35 | rbxbx | tbaldridge I think the comparison of cps and tps is pretty funny even not having just seen it :) |
| 15:39 | solussd | any suggestions for a analog to Objective-C "Notifications" in clojure? E.g. "post"ing events (with some data) that are sent to anyone listening for them? Agents + watchers aren't a good fit, since agents really just guard state (agents could be used to approximate KVO in Objective-C) |
| 15:39 | seangrove | solussd: Sounds like you want an internal pubsub mechanism? |
| 15:41 | solussd | maybe (did soe quick googling) |
| 15:41 | solussd | *some |
| 15:41 | seangrove | I'm using shoreleave, which is just a wrapper around atoms (via add-watcher) and closure's javascript bus |
| 15:42 | aphyr | solussd: could use the Observer interface... |
| 15:42 | seangrove | Bound to be something similar for clojure |
| 15:42 | ohpauleez | aphyr: Shoreleave's pubsub is the Observer interface |
| 15:42 | solussd | aphyr: ah, I had forgotten about java. :) |
| 15:42 | solussd | maybe I'll write something.. |
| 15:43 | ohpauleez | ohhh he wants it in Java |
| 15:43 | solussd | no i dont!!! |
| 15:43 | solussd | I had forgotten about Observer from Java |
| 15:43 | ohpauleez | solussd: you want it in Clojure proper, on the JVM, right? or you want it on CLJS? |
| 15:43 | solussd | yes, clojure proper |
| 15:44 | ohpauleez | oh yeah, that's what I mean, Java ~ JVM |
| 15:44 | solussd | so, I *can* use java.. btut it doesnt need to be consumable from java |
| 15:44 | solussd | gotcha |
| 15:44 | aphyr | solussd: https://github.com/aphyr/riemann/blob/master/src/riemann/pubsub.clj |
| 15:44 | aphyr | you can roll your own |
| 15:44 | solussd | thanks |
| 15:44 | ohpauleez | solussd: Also take a look at the protocols used in Shoreleave's pubsub. You can copy them over direct to Clojure, drop in a bus, and you'll be good to go |
| 15:45 | solussd | interesting. I'll investigate |
| 15:47 | rbxbx | Is there a cli friendly variant of javadoc? |
| 15:48 | nDuff | javadoc proper isn't? |
| 15:48 | rbxbx | or would I just define my default browser as w3m/lynx/etc |
| 15:48 | nDuff | ...oh, for the viewing end. |
| 15:48 | rbxbx | nDuff yeah :) |
| 15:51 | bmaddy | So is Noir still the general web framework to use these days? |
| 15:52 | ohpauleez | bmaddy: Ring+Compojure+lib-noir is pretty popular |
| 15:53 | brehaut | bmaddy: eschew frameworks, go with just libs as ohpauleez suggests |
| 15:53 | dr1 | Hello. I am new to functional programming. I'm working with a project that normally gets built using "lein uberjar", which creates a jar that I can then run from the command line. I am now trying to run it from the repl. I open a repl and go to the project's namespace using (in-ns …). But I don't see a main function that starts the project and nothing else shows the GUI. How can I find the "main" function that will launch it? |
| 15:53 | ohpauleez | I've dropped noir these days for that combo - mostly just to get around all the embedded statefulness in noir |
| 15:53 | hiredman | dr1: in-ns doesn't load code |
| 15:53 | dr1 | well, after I switch to the namespace, I can see the related functions and can run them |
| 15:53 | hiredman | it just creates an empty namespace with the given name |
| 15:54 | hiredman | so you have loaded it some other way |
| 15:54 | bmaddy | ohpauleez: Sweet, thanks for the advice. |
| 15:54 | ohpauleez | bmaddy: totally welcome, more than happy to help |
| 15:54 | Raynes | bmaddy: I maintain noir these days, but even I'd recommend ring + compojure + lib-noir. |
| 15:54 | dr1 | I started the repl in the project's directory and ran (in-ns project-name.core) |
| 15:54 | hiredman | dr1: most of the time when a clojure project is uberjared and runnable that way the main function will be something like -main |
| 15:54 | hiredman | dr1: you did not |
| 15:54 | dr1 | I do see that |
| 15:54 | dr1 | how can I run it? |
| 15:54 | hiredman | that would throw an exception |
| 15:55 | dr1 | I tried doing (project-name.core/-main) but that doesn't work |
| 15:55 | hiredman | at the very least is would be (in-ns 'project-name.core) |
| 15:55 | dr1 | right, sorry.. that's what it was |
| 15:55 | dr1 | I'm very new to Clojure :) |
| 15:55 | dr1 | so then, I see the -main, but I can't run it |
| 15:56 | dr1 | ahh, actually…. I just started a fresh repl and am seeing a different error (that I recognize) |
| 15:58 | dr1 | uhh… well now it works! not sure what I messed up before, but thanks! |
| 16:01 | solussd | aphyr: so, your code is licensed under the EPL and I want to use the pubsub namespace, in its entirety, in my project. Do I add attribution to the top of it even though you have not? Not sure what's appropriate. |
| 16:02 | aphyr | Oh, hah, go right ahead and use it wholesale. |
| 16:02 | aphyr | Drop a comment in the top mentioning "adapted from riemann (https://github.com/aphyr/riemann) |
| 16:02 | solussd | thanks, but more just wondering what's the right thing to do (since I doubt your code will be the last epl licensed code I use) |
| 16:02 | solussd | excellent- i'll do that. |
| 16:02 | solussd | thanks |
| 16:02 | aphyr | Yeah I chose EPL just cuz it's what most of clojure seems to do |
| 16:03 | seangrove | Alright, I should just ask this to get it over with instead of trying different contortions: Is it possible (in cljs) to make async callback functions look like sync functions that can be called synchronously, if I write a wrapper function around each target async function that uses promises/dirty-black-magic? |
| 16:03 | aphyr | solussd: not sure what the correct thing to do re epl code is, but as far as my stuff I'd just like some attribution. :) |
| 16:04 | seangrove | Something like: my-happy-normal-function -(sync-looking call)-> my-individualwrapper-function -(call via promises/setInterval/something)-> original-js-callback-oriented-fn |
| 16:04 | solussd | aphyr: EPL says to leave "intact" contributor information, but given none I think it's appropriate to add it. :) |
| 16:05 | seangrove | I can see ways of doing it if I wrap the outside of it all in a kind of queue-manager, but ideally I could wrap the functions |
| 16:10 | azhim | I have an atom (def foo (atom #{})) -- I have a function that returns '("a" "b" "c"), how do I put "a" "b" and "c" directly into #{}, instead of conjing '("a" "b" "c") and getting #{("a" "b" "c")}? |
| 16:11 | AimHere | ,(into #{} '("a" "b" "c")) |
| 16:11 | clojurebot | #{"a" "b" "c"} |
| 16:11 | azhim | AimHere: but in the context of a (swap! foo ...) |
| 16:12 | azhim | i wouldn't say (swap! foo into #{} '("some" "stuff")) |
| 16:12 | azhim | oh, duh, nevermind |
| 16:12 | azhim | (swap! foo into '("some" "stuff")) |
| 16:12 | seangrove | I suppose it's not possible without some pre-processor or compiler support |
| 16:13 | seangrove | Even macros can't really get around this, needs to be in the compiler I think |
| 16:15 | bbloom | huh? just use a function... |
| 16:15 | tnbd | Hello, concurrency question. I am trying to run two always running threads in parallel. |
| 16:15 | tnbd | One is the noir webserver, the other is a web-scraper. The scraper writes to an atom periodically, the webserver reads from it. I tried pcalls, but the scraper gets almost no scheduling time. Any help would be appreciated. |
| 16:15 | AimHere | Wouldn't you just wrap the function? (swap! atom #(into {} (foo %))) ? |
| 16:15 | bbloom | (swap! foo #(into % '("some" "stuff"))) |
| 16:15 | bbloom | er yeah what aimhere said |
| 16:15 | mpenet | seangrove: you can use some sort of monad for that |
| 16:16 | mpenet | jayq has something like this for ajax & deferreds |
| 16:16 | bbloom | also, if azhim if you want to wholesale replace the value in foo, you can use reset! |
| 16:16 | mpenet | seangrove: its looks like a let form, but it's all async underneath |
| 16:17 | mpenet | seangrove: so yeah, macros |
| 16:17 | seangrove | mpenet: Yeah, I've seen it, but let me take another look |
| 16:17 | mpenet | seangrove: the do-> macro is the starting point, you could build what you want on top of it |
| 16:18 | seangrove | mpenet: Yeah, I'll play around with this and see if I can wrap my head around it |
| 16:19 | mpenet | seangrove: look at the generated code maybe, it's quite straightforward |
| 16:20 | bbloom | tpope: did you say foreplay was supposed to auto-connect when you have target/repl-port ? |
| 16:20 | seangrove | mpenet: is *-m supposed to signify it's a monad? |
| 16:21 | rbxbx | bbloom that's correct |
| 16:21 | bbloom | hm, not working for me |
| 16:21 | mpenet | seangrove: yes, but there is no convention for this I think, it's just to indicate it's supposed to be used with do-> since it's in a file where most of the fns are public |
| 16:22 | mpenet | seangrove: it's more or less a direct port of http://roy.brianmckenna.org/ stuff on this |
| 16:22 | seangrove | And is there any quick example of using do->? |
| 16:22 | mpenet | on the readme |
| 16:23 | rbxbx | bbloom if you explicitly connect does it work? |
| 16:23 | mpenet | seangrove: let-ajax and let-defered are just thin wrappers around do-> and bind/return definitions |
| 16:23 | rbxbx | via :Connect and walking through the 'wizard' |
| 16:23 | bbloom | rbxbx: yes |
| 16:24 | bbloom | i've been using :Connect |
| 16:24 | seangrove | mpenet: Got it, thanks for humoring me |
| 16:24 | bbloom | i'm trying to debug it now |
| 16:24 | rbxbx | if you :set verbose=1 and try to eval something without connecting what does it say? |
| 16:25 | bbloom | oh weird, it seems to be workign now |
| 16:25 | bbloom | hmmm |
| 16:25 | bbloom | *scratches head* |
| 16:25 | bbloom | oh |
| 16:26 | mpenet | seangrove: if you have a look at roy's example, specificaly the generated js, it might help understand |
| 16:26 | bbloom | weird. i guess it works, nevermind :-P |
| 16:26 | tpope | thought so |
| 16:26 | bbloom | my apologies for ever doubting :-P |
| 16:27 | bbloom | ok, seangrove i need to push the CPS transform down 1 on the stack… gotta get foreplay working with cljs, i miss it already |
| 16:27 | seangrove | bbloom: Yaks to be shaved, I understand |
| 16:28 | seangrove | Took a day out last week and that's why I have piggieback and friends working, it's helped out *hugely* |
| 16:28 | bbloom | seangrove: i'm gonna investigate getting piggieback incorporated into cljs proper |
| 16:28 | bbloom | where's dnolen when you need him? :-) |
| 16:28 | mattmoss | say his name three times? |
| 16:29 | seangrove | Heh, once in irc, once on hn, and then once on twitter? |
| 16:29 | bbloom | heh, i'll avoid beattlejuicing him until i really need him |
| 16:35 | bbloom | cemerick: piggieback question |
| 16:35 | bbloom | what's the incantation to connect to a cljs session? |
| 16:36 | bbloom | (cemerick.piggieback/cljs-repl) works nicely |
| 16:36 | cemerick | bbloom: well, that was the answer I was going to give you :-P |
| 16:36 | bbloom | heh, i mean to ask about connecting sessions |
| 16:36 | cemerick | "connecting sessions"? |
| 16:37 | bbloom | is there some kind of "run this only if this is a new session" |
| 16:37 | bbloom | ie when there is no terminal, if i evaluate (cemerick.piggieback/cljs-repl) it won't terminate, right? |
| 16:38 | cemerick | bbloom: no, it'll start a Rhino env if you don't override its defaults |
| 16:38 | cemerick | I'm not grokking your Q, I think. |
| 16:38 | bbloom | the cljs-repl function is a blocking loop, right? |
| 16:39 | cemerick | no |
| 16:39 | bbloom | oh |
| 16:39 | bbloom | ok, then i guess i don't understand anything about nrepl and probably should study it before i continue :-) |
| 16:40 | cemerick | it "installs" a cljs environment in your *Clojure* dynamic environment, which the piggieback middleware then uses to drive evals, load-file, etc. |
| 16:40 | bbloom | ah, ok, looking at it now |
| 16:40 | cemerick | nREPL doesn't use stdin/out at all |
| 16:40 | bbloom | ok cool |
| 16:42 | cemerick | bbloom: if you really want to screw with your head: the same pattern could be used to hoist a JRuby/Groovy/Scala/Scheme/whatever REPL on top of nREPL |
| 16:43 | bbloom | +1 for generality :-) |
| 16:43 | cemerick | or something :-) |
| 16:43 | scriptor | wait, nrepl for other languages? |
| 16:44 | cemerick | purely theoretical at the moment, but quite doable |
| 16:44 | technomancy | cemerick: someone in #emacs was wondering whether nrepl could be useful for elisp-to-elisp communication. |
| 16:46 | cemerick | hrm |
| 16:47 | cemerick | people there generally don't like jvm startup, etc |
| 16:47 | bbloom | my VimL skills are hopeless |
| 16:47 | technomancy | cemerick: yeah, I told him the idea was bonkers =) |
| 16:48 | Raynes | Oh look, github rewrote gist. |
| 16:49 | technomancy | huh; they stopped using the word "private" |
| 16:49 | technomancy | probably wise |
| 16:50 | Raynes | The paste creation screen looks to be on par with refheap for simplicity, but it uses ace instead of codemirror for paste authoring so that's a lot worse. The actual paste pages are pretty bad imo, especially with comments. I thing I still win on actual paste pages because I make a point of making code the most important thing there. |
| 16:50 | Raynes | I don't make it smaller by putting menus on the sides and stuff. |
| 16:51 | Raynes | The actual features are perfectly doable in refheap, I just haven't gotten to them yet. |
| 16:51 | technomancy | refheap has the advantage that when I want to change the language, I can click on the drop down and do so |
| 16:51 | Raynes | Except for the git repository crap which I still thing is pointless. |
| 16:51 | technomancy | for some reason gist is stuck on "text" |
| 16:52 | Raynes | I've never once wanted to download a git repository of a paste. I guess maybe some people do. I'm just not one of them. |
| 16:52 | technomancy | Raynes: it's just solving a different problem from refheap |
| 16:52 | bbloom | Raynes: I've forked a gist before…. but it's because some weirdo made like a 5 file gist project |
| 16:52 | technomancy | I've forked one to give feedback on a draft blog post |
| 16:52 | amalloy | technomancy: my experience has been that if your gist "filename" is weird, eg *scratch*, their web ui loses the ability to change language |
| 16:52 | Raynes | bbloom: Refheap has forking, but it isn't that useful until I add paste history and history diffing. |
| 16:53 | Raynes | This is why I don't do a 'file' thing. |
| 16:53 | technomancy | amalloy: this is on a fresh visit to gisthub.com; nothing created yet |
| 16:53 | amalloy | i fork gists all the time. only a few times have i cloned the git repo though |
| 16:53 | Raynes | I'll add multi-paste support, but each paste on the page will be a new refheap paste. |
| 16:53 | bbloom | yeah clone is what i mean |
| 16:53 | Raynes | It makes it tons easier to work with the API, for example, because of no confusing nested json. |
| 16:55 | Raynes | amalloy: Is Justin using refheap yet? |
| 16:55 | Raynes | Seems like I've seen him throw you or Lance one here or there. |
| 16:56 | amalloy | sometimes |
| 16:56 | Raynes | "I managed to drag gist users half way to refheap." |
| 16:58 | Raynes | I'd have markdown support finished on refheap right now had I not got side tracked into writing an enlivealike. |
| 16:59 | Raynes | I got to a point where it was like "Well, I have this html, and I'd like to change this node here. Enlive would work." so the obvious conclusion was to write my own library. |
| 16:59 | nDuff | ...I already _have_ a unified identity, damnit. :) |
| 16:59 | ivan | may you crush hastebin and vaporize its ashes |
| 16:59 | Raynes | nDuff: Just log into google and pretend it worked. |
| 16:59 | Raynes | I haven't seen anybody use that thing in 100 years. |
| 17:00 | Raynes | Hastebin has a nice UI, but it doesn't *do* a whole lot. |
| 17:00 | Raynes | Which is great for some people, but not really for me. |
| 17:00 | nDuff | Raynes: Sorry? I _am_ logged into Google, but refheap's Persona setup doesn't appear to be able to take advantage of that. |
| 17:00 | Raynes | I want markdown, forking, history, diffing, etc. |
| 17:00 | Raynes | nDuff: It was a joke. |
| 17:00 | Raynes | Sorry. |
| 17:00 | Raynes | I'd add alternative ways to sign up, but I'd almost rather kill myself than add a "Or sign up with…" link up there. |
| 17:01 | bbloom | cemerick: how do i opt into the nrepl with the sessions fix? |
| 17:01 | bbloom | presumably just a dependency in my project file? |
| 17:02 | cemerick | bbloom: use "0.2.0-SNAPSHOT" and add the sonatype OSS repository to your project.clj |
| 17:02 | Raynes | amalloy: I could understand him not wanting to use it without good history. Seems like it's the thing you guys use/like the most about gist. |
| 17:02 | ivaraasen | Raynes: better add support for img links to meme pictures as well. the gist users will go wild. |
| 17:02 | nDuff | err, "#### users!" count |
| 17:02 | bbloom | cemerick: use just means dependency, no fancy repl-options or anything, right? |
| 17:02 | Raynes | But it's at the top of my todo list after markdown support. |
| 17:02 | Raynes | ivaraasen: Hah. |
| 17:02 | cemerick | bbloom: right, no special config required |
| 17:02 | Raynes | ivaraasen: Well, you can embed a link to an image in markdown files when markdown support is done. ;) |
| 17:03 | bmaddy | nDuff: I have a friend who works on Persona, want me to share some of your complaints with him? (or are most of them inherent in their system?) |
| 17:03 | ivaraasen | Raynes: you should offer some premade ones as well |
| 17:03 | Raynes | bmaddy: Oh yeah, didn't I tell you a long time ago that I'd delegate all bitching to you? :p |
| 17:03 | technomancy | bmaddy: doesn't work with my browser (Conkeror) |
| 17:03 | nDuff | bmaddy: the core thing is lack of interop. If I have an OpenID provider with physical token authentication, I absolutely, positively don't want any new identity which I can't sign into with that token. |
| 17:04 | ivaraasen | Raynes: like this http://www.quickmeme.com/meme/3s5fro/ |
| 17:04 | bmaddy | Well, fire away everyone. I'll just point him to this chat. :) He'll be happy to see feedback from a smart community. |
| 17:06 | aphyr | ivaraasen: dead |
| 17:10 | bbloom | cemerick: ok got it, but this might be a lot of work, since cljs doens't support (require ...) |
| 17:12 | cemerick | bbloom: what might be a lot of work? |
| 17:12 | bbloom | getting foreplay and cljs to (fore)play nice together |
| 17:13 | bbloom | mainly cljs' fault for having an insufficient module system |
| 17:14 | cemerick | piggieback works like a charm with lein and ccw; why not foreplay? |
| 17:15 | bbloom | piggieback is working |
| 17:15 | bbloom | it's just all the require and namespace switching and stuff |
| 17:15 | bbloom | im looking into it |
| 17:16 | cemerick | hrm |
| 17:16 | cemerick | I mean, once you start a cljs-repl, you can't send clojure code on the same session |
| 17:17 | cemerick | I generally have two sessions going when I'm going cljs stuff; one for piggieback/cljs, one for Clojure and the backend. |
| 17:17 | bbloom | yeah, i'm not even to that stage yet :-) |
| 17:19 | cemerick | bbloom: FWIW, I've been sitting on a cljx nREPL middleware that helps tremendously |
| 17:19 | cemerick | one of these days... |
| 17:19 | tomoj | when I (in-ns 'foo) with piggieback, my require(-macros) :as aren't visible |
| 17:22 | amalloy | i remember one of the things rich said at some point is that clojure provides a la carte the features that OO gloms all together into the single "Objects" feature. polymorphism, namespacing, whatever. does anyone know where he said that? i'd like to find the full list of features he mentions, if possible |
| 17:23 | cemerick | tomoj: there is no in-ns in cljs |
| 17:23 | cemerick | amalloy: sounds like the strange loop talk |
| 17:23 | tomoj | strange |
| 17:23 | tomoj | it definitely seems to work in a limited way |
| 17:23 | amalloy | cemerick: simple made easy, from last october? thanks, i'll give it a look |
| 17:24 | bbloom | cemerick: eh, there sorta is |
| 17:24 | cemerick | amalloy: don't remember the name; it was the guardrails talk IIRC |
| 17:24 | tomoj | the prompt changes and I can use the defs in that namespace without qualification |
| 17:24 | bbloom | in-ns is special cased in the repl code |
| 17:24 | cemerick | heh |
| 17:24 | tomoj | I see, but because no in-ns in cljs, require :as doesn't work? |
| 17:24 | bbloom | (in-ns 'foo) ; works |
| 17:24 | bbloom | (do (in-ns 'foo)) ; doesn't work |
| 17:25 | tomoj | strange :refer does work |
| 17:25 | tomoj | maybe not that strange |
| 17:26 | cemerick | I'll just carry on thinking that there's no in-ns in cljs ;-) |
| 17:27 | bbloom | i kinda wish core was split into core.compiletime and core.runtime |
| 17:27 | bbloom | because core.compiletime isn't available at all in cljs ... |
| 17:28 | seangrove | Any reason (js->cljs obj) would just be returning a normal js-obj? |
| 17:30 | tomoj | it doesn't implement IEncodeClojure and the default case doesn't cover it |
| 17:31 | seangrove | Ah, something inside it maybe? |
| 17:31 | seangrove | Interesting |
| 17:31 | tomoj | ..interesting that IEncodeClojure has the unary arity in the protocol |
| 17:31 | seangrove | I wished it failed or mentioned something though |
| 17:32 | seangrove | Suppose it's easy enough to get around it though |
| 17:37 | bbloom | ok i don't think i know enough about vim or nrepl to tackle this :-/ |
| 17:37 | bbloom | but i do know enough about cljs to know it's not gonna make this easy |
| 17:37 | bbloom | so maybe my time is better spent fixing up cljs and then leaving the vim and the repl to the experts.... |
| 17:37 | bbloom | :-P |
| 17:37 | bbloom | meanwhile, that means i have to live without foreplay for cljs... |
| 17:38 | tpope | don't look at me, I don't even know where to start |
| 17:39 | cemerick | bbloom: maybe send a message to clojure-tools for me to look at later? I'm not following much at the moment. |
| 17:39 | bbloom | cemerick: ok |
| 17:39 | bbloom | tpope: my hope is that we can improve cljs until it's practically zero work for you |
| 17:39 | seangrove | heh, the yak-stack gets deeper |
| 17:39 | bbloom | cljs and clj should work nearly identically |
| 17:39 | cemerick | FWIW, I didn't need to make any changes to lein or ccw to use them with piggieback/cljs |
| 17:40 | bbloom | but there are *a lot* of differences for tooling currently b/c cljs doesn't provide a lot of core features…. like the require function.... |
| 17:40 | cemerick | So, whatever's wrong, it shouldn't be *too* tough to fix. :-) |
| 17:40 | cemerick | bbloom: that's a cljx/feature expression problem |
| 17:40 | tpope | bbloom: first step is getting it to where I can talk to it from the command line |
| 17:40 | tpope | if framing things that way makes it easier for you |
| 17:41 | bbloom | cemerick: maybe the fact that ccw works implies that foreplay is doing stuff that it should be |
| 17:41 | bbloom | tpope: i have cljs running in a terminal under nrepl just fine |
| 17:42 | bbloom | and i can send it expressions to evaluate, but foreplay does some conveninence things like calling 'require for you |
| 17:42 | tpope | I mean I need to be able to run a command that evals and returns the result |
| 17:42 | tpope | yeah step 2 is the tricky stuff like the require |
| 17:43 | bbloom | tpope: oh, step 1 is easy. i'll post my project for you |
| 17:44 | tpope | so would something like changing eval to in-ns work? |
| 17:44 | tpope | err require to in-ins |
| 17:44 | tpope | err require to in-ns |
| 17:44 | bbloom | tpope: i think what you actually want is require to (ns ...) |
| 17:44 | bbloom | i think you need to evaluate the top form in the file |
| 17:45 | seangrove | Why would the first object (pulled from another object) not encode into cljs, and the second one (made fresh) will: http://dl.dropbox.com/u/412963/Screenshots/ar.png |
| 17:45 | bbloom | but i might be wrong |
| 17:45 | tpope | implicitly evaluating *part* of the file sounds like trouble waiting to happen |
| 17:45 | bbloom | agreed... |
| 17:46 | bbloom | anyway, see this gist and comment: https://gist.github.com/4262975 |
| 17:46 | bbloom | tpope: that will get your a working cljs nrepl in zero time |
| 17:46 | tomoj | seangrove: hmm, cljs.core.type(r) is Object ? |
| 17:46 | tomoj | looks like it |
| 17:46 | tpope | bbloom: what happens if I talk to that repl over the network? |
| 17:46 | seangrove | tomoj: Yeah |
| 17:46 | seangrove | But so is cljs.core.type(t) |
| 17:47 | seangrove | Ah, interesting... |
| 17:47 | bbloom | tpope: it responds reasonably, it's just that you get errors for trying to use 'require etc |
| 17:47 | seangrove | cljs.core.type(t) == Object |
| 17:47 | seangrove | That's true, but with r it's false |
| 17:47 | seangrove | Maybe r's prototype has been altered... |
| 17:48 | seangrove | http://dl.dropbox.com/u/412963/Screenshots/as.png |
| 17:48 | tomoj | hmm.. wat ? |
| 17:48 | bbloom | tpope: i'll write up some notes and put them an in an issue |
| 17:49 | tpope | bbloom: yeah that's good, can't really get into it this very second anyways |
| 17:49 | tomoj | Object is not cloneable, so what the hell else could that be? |
| 17:49 | bbloom | tpope: no worries |
| 17:49 | seangrove | Maybe I'm missing some js runtime detail... |
| 17:53 | seangrove | No, no idea |
| 17:53 | seangrove | Time for a nap |
| 17:58 | tomoj | do you have multiple js files? |
| 17:58 | tomoj | shouldn't matter I guess |
| 17:59 | tpope | bbloom: the nrepl eval call lets me send along an ns. maybe the solution is to drop the require entirely? |
| 18:00 | bbloom | tpope: that'd be nice |
| 18:00 | technomancy | something to watch for when sending require across the wire: http://technomancy.us/143 |
| 18:01 | gfredericks | technomancy: please rewrite that sentence so that it rhymes more |
| 18:02 | zodiak | strange question perhaps but.. is there anything like lisa (the expert system) for clojure ? |
| 18:02 | technomancy | how about iambic pentameter? "A caveat to watch for with require" |
| 18:02 | gfredericks | (inc technomancy) |
| 18:02 | lazybot | ⇒ 41 |
| 18:02 | gfredericks | woah man he's on the brink |
| 18:03 | gfredericks | technomancy: you get to do one more good deed and then you have to stop |
| 18:03 | ssideris | hello, I do a lein push and I get no error, but the jar is not showing up in clojars... any ideas? |
| 18:03 | technomancy | gfredericks: still got 87 to go assuming an unsigned int |
| 18:03 | tomoj | seangrove: where's that r come from? I think you'll have to extend IEncodeClojure to the other Object. which is.. weird |
| 18:03 | technomancy | ssideris: try `lein deploy clojars`? |
| 18:03 | ssideris | thanks |
| 18:03 | technomancy | unsigned byte rather |
| 18:05 | tomoj | (identical? (type x) js/Object) (from the default IEncodeClojure) only works if x was creating in the same js context |
| 18:05 | tpope | technomancy: ran into a similar issue with in-ns, and solved it with eval \o/ |
| 18:05 | tomoj | I wonder if protocols have a similar problem? |
| 18:06 | Sgeo|web_ | What problem? |
| 18:06 | Sgeo|web_ | Oh, that thing I don't quite understand |
| 18:11 | ssideris | technomancy: lein deploy clojars asks me for my username and after I enter it, it stops |
| 18:17 | technomancy | ssideris: some kind of networking issue maybe? proxy? |
| 18:17 | ssideris | technomancy: nope, i'm at my straightfoward home network :-) |
| 18:17 | ssideris | Leiningen 2.0.0-preview8 on Java 1.6.0_26 Java HotSpot(TM) Client VM |
| 18:18 | ssideris | on windows |
| 18:18 | ssideris | in cygwin |
| 18:18 | ssideris | scp is installed |
| 18:18 | ssideris | (if that's relevent) |
| 18:19 | technomancy | hrm; scp shouldn't be necessary |
| 18:19 | technomancy | maybe try preview10? can't remember if we fixed any deploy bugs. |
| 18:19 | ssideris | ok, let me see... |
| 18:19 | S11001001 | ssideris: what kind of terminal? |
| 18:19 | ssideris | mintty |
| 18:20 | ssideris | let me try from vanilla cmd |
| 18:20 | S11001001 | oh windows huh |
| 18:20 | ssideris | yes |
| 18:21 | ssideris | hm, with cmd it goes a bit further, but then it complains about the lack of gpg |
| 18:21 | ssideris | so I take it needs to be in the path |
| 18:21 | technomancy | ssideris: you can disable the signing of releases if you just want to get it out to the clojars classic repo |
| 18:22 | ssideris | oh sure |
| 18:22 | ssideris | is it easy? |
| 18:22 | technomancy | crap; it looks like that might not be documented |
| 18:22 | technomancy | :deploy-repositories {"clojars" {:url "https://clojars.org/repo" :sign-releases false}} ; IIRC |
| 18:23 | ssideris | in profiles.clj? |
| 18:23 | technomancy | yeah, in the :user profile |
| 18:23 | ssideris | ok, thanks, let's see... |
| 18:23 | technomancy | that means your jar won't get promoted to the releases repository though |
| 18:23 | technomancy | so in the long run it's best to get GPG installed so you can sign your deployment |
| 18:24 | brehaut | having just done the GPG thing for lein / clojars recently: its such a simple process if you follow the instructions that its totally worth taking ten minutes to do it |
| 18:25 | technomancy | brehaut: well, on unix anyway =( |
| 18:25 | technomancy | thanks for the vote of confidence though =) |
| 18:25 | brehaut | technomancy: oh. yeah windows. balls |
| 18:25 | technomancy | it's really worth learning how to use public-key encryption anyway though because it's an invaluable tool every professional developer should be comfortable with |
| 18:26 | ssideris | technomancy: thanks, it worked! i'll set it up properly at some point... |
| 18:27 | technomancy | cool |
| 18:27 | technomancy | ssideris: so it worked from lein.bat but not mingw? |
| 18:27 | ssideris | it seemed to be an input problem |
| 18:28 | technomancy | oh, like it was unable to prompt for credentials? |
| 18:28 | ssideris | mitty (the cygwin terminal) would exit after pressing enter after the username |
| 18:28 | ssideris | yes |
| 18:28 | technomancy | you can use gpg to encrypt your credentials so you don't have to re-enter them every time |
| 18:28 | technomancy | useful thing to have! =) |
| 18:28 | ssideris | sure, I'll do it soon, it's my first time through the process, so I'm still setting up |
| 18:28 | technomancy | yeah, one step at a time |
| 18:29 | ssideris | so, there is a "more official" repo that contains signed jars and the old clojars repo is being decommissioned soon? |
| 18:30 | technomancy | ssideris: it's not being decommissioned; it's just not going to be checked by default in lein 2.0.0 final |
| 18:30 | technomancy | you still use the classic repo to deploy to the releases repo |
| 18:30 | technomancy | I really need to get better docs around that |
| 18:32 | ssideris | oh so the old one is like a staging repo for snapshots etc? |
| 18:33 | technomancy | yeah, it's the "anything goes" repo |
| 18:33 | technomancy | and qualifying non-snapshot jars may be promoted into the releases repository, which is backed by S3 and only accepts jars with signatures and proper metadata (:url, :license, etc) |
| 18:34 | ssideris | sounds like a good plan |
| 18:34 | technomancy | in theory anyway |
| 18:35 | ssideris | I'm trying to make the new C2 :-) |
| 18:35 | ssideris | promoting fragmentation in the community |
| 18:35 | tomoj | I wonder if delay was left out of cljs on accident |
| 18:36 | ssideris | making sure that newcomers are overwhelmed by too many libs :-D (joking) |
| 18:37 | egghead | i missed the LA data viz talk last week :( |
| 18:37 | egghead | been reading cljs up and running, good stuff |
| 18:59 | tomoj | s/I wonder if delay was left out of cljs on accident// |
| 18:59 | tomoj | ..duh |
| 18:59 | tomoj | it's just in the macros file |
| 19:28 | kirindave | Got an odd problem. |
| 19:28 | kirindave | ~/.m2 has clj-json installed |
| 19:28 | clojurebot | Gabh mo leithscéal? |
| 19:28 | kirindave | It's in my project.clj |
| 19:28 | kirindave | lein deps runs cleanly. |
| 19:28 | clojurebot | Leiningen 2 is still in a preview release, but see the upgrade guide: https://github.com/technomancy/leiningen/wiki/Upgrading |
| 19:28 | kirindave | But (:require [clj-json [core :as json]]) fails |
| 19:29 | kirindave | Anyone seen anything like that beofre? |
| 19:30 | seancorfield | how does it fail kirindave ? |
| 19:30 | kirindave | Caused by: java.io.FileNotFoundException: Could not locate clj_json/core__init.class or clj_json/core.clj on classpath: |
| 19:30 | technomancy | kirindave: any reason you haven't upgraded to cheshire? clj-json is pretty outdated. |
| 19:30 | nDuff | Hrm. |
| 19:30 | seancorfield | what does lein classpath show? (to make sure it picks it up) |
| 19:31 | kirindave | It certainly does |
| 19:31 | kirindave | technomancy: This is not new code. |
| 19:31 | kirindave | Just trying to recompile. |
| 19:32 | kirindave | technomancy: Also 90% of what chesire adds does not interest me whatsoever. clj-json's austerity was liberating. |
| 19:32 | kirindave | seancorfield: Lein classpath does indeed have the right path to the jar. |
| 19:33 | kirindave | And I've already checked (and re-downlaoded). It's a valid zip file that contains the files I'd expect. |
| 19:34 | kirindave | I've been off in haskell land for awhile so I haven't touched this build for 2 months. Kinda confused where it'd go wrong over that short a span. |
| 19:34 | technomancy | kirindave: you're just more likely to end up with version conflicts the more libs you add since clj-json brings in a really old jackson |
| 19:35 | kirindave | technomancy: Interesting. Could that manifest as a failure to find clj-json.core? |
| 19:36 | kirindave | It's trivial for me to just rip it out. I guess I'll try that. |
| 19:38 | technomancy | kirindave: no, it'd be classnotfound in jacksonland |
| 19:39 | jonasac | anyone got some recommendations for database-migrations/dsl to query a defined connection and also maybe something to mock db calls |
| 19:39 | technomancy | kirindave: maybe check `lein classpath` matches (System/getProperty "java.class.path") from inside the repl? |
| 19:39 | kirindave | technomancy: It does. |
| 19:39 | technomancy | jonasac: I use this for migrations: https://github.com/heroku/buildkits/blob/master/src/buildkits/db/migrate.clj |
| 19:40 | kirindave | technomancy: Cheshire seems to work fine. |
| 19:40 | technomancy | kirindave: how about (clojure.java.io/resource "clj_json/core.clj")? |
| 19:40 | kirindave | So, uh, I'm going to pretend I didn't see this. |
| 19:40 | kirindave | technomancy: Unless this is valuable feedback for you to chase a bug. |
| 19:40 | technomancy | kirindave: heh probably not? |
| 19:41 | kirindave | technomancy: One thing you learn doing fulltime scala: stop pretending java deps are anything but sane and as a result your sanity is retained. :) |
| 19:41 | kirindave | Err, but insane. |
| 19:41 | seangrove | tomoj: What do you mean created in the same js context? |
| 19:41 | technomancy | yeah; at least with clojure there are only a few layers and it's pretty transparent to peer around them |
| 19:41 | kirindave | Can't spend time caring about maven or ivy anymore. Got too many stress lines already. :D |
| 19:42 | kirindave | technomancy: Btw what I was talking about in that tweet is that like… if you have an emacs paredit error in the NS macro it still fails to really tell you what happened. :) |
| 19:42 | tomoj | seangrove: like if the object was created in another frame |
| 19:43 | kirindave | Probably because everyone uses raw macros and not MBE so error reporting is something of a pain. |
| 19:43 | seangrove | Ah, ok, makes sense |
| 19:43 | technomancy | kirindave: oh man that's like a confluence of badness |
| 19:43 | technomancy | the ns macro and error messages |
| 19:43 | kirindave | technomancy: Every macro, really. |
| 19:43 | kirindave | technomancy: I love chas's bandalore library, for example. But argument errors propagate a lot of weirdness that is not always obvious. :) |
| 19:43 | seangrove | I suppose I could deep-copy the object into a new one in the local context |
| 19:44 | kirindave | technomancy: At least we get more error messages now. Remember when it was just silent fail? :D |
| 19:44 | kirindave | technomancy: Those were the kinda errors you huddle around the campfire at night scaring your friends with tales of. |
| 19:44 | tomoj | I wonder if extending IEncodeClojure to object would work |
| 19:45 | tomoj | I don't really know what 'object' means |
| 19:46 | chillenious | hi folks. quick n00b question.... I'm trying to call a static method of a class without any parameters, but that seems to confuse Clojure into thinking it should be looking for a field |
| 19:47 | chillenious | in Java, I'd do CsvSchema.emptySchema(), so I thought I'd do (CsvMapper/emptySchema) in clojure |
| 19:47 | chillenious | any hints? |
| 19:49 | jonasac | technomancy: thanks |
| 19:49 | seangrove | tomoj: seems like that was the issue, yes: (js->clj (json/parse (json/serialize obj)) worked |
| 19:49 | nDuff | chillenious: Generally, what you're doing now is the right thing. |
| 19:49 | seangrove | Unfortunately I think it might be in one of the more performance-critical paths, we'll see if there's too much overhead |
| 19:50 | nDuff | chillenious: ...of course, it'd be (CsvSchema/emptySchema), to make the class names match up. |
| 19:51 | tomoj | seangrove: maybe try this: https://www.refheap.com/paste/74e81f0e917f54c4f7bdba415 (untested) |
| 19:51 | tomoj | er |
| 19:52 | tomoj | that won't work ofc |
| 19:52 | chillenious | gives me java.lang.NoSuchFieldException: emptySchema, compiling:(com/teachscape/libview/views.clj:90) |
| 19:52 | seangrove | S'alright, you already helped me figure out the problem for now |
| 19:52 | tomoj | I left out the thisfn from the default IEncodeClojure impl |
| 19:52 | tomoj | but that won't really work since that's the problem |
| 19:52 | seangrove | I can at least make some progress now |
| 19:53 | tomoj | and recurring on -js->clj incurs option parsing too many times |
| 19:53 | chillenious | oh, duh good point nDuff |
| 19:54 | chillenious | yeah, that was the problem |
| 19:54 | chillenious | thanks |
| 19:56 | technomancy | Raynes: the great thing about the new gist is that *all* existing tooling/clients for gist are broken |
| 19:56 | technomancy | consider it an opportunity =) |
| 19:57 | tpope | technomancy: whoa, they broke the api? |
| 19:57 | technomancy | apparently |
| 19:58 | technomancy | I just use scpaste, so I don't particularly care. |
| 19:58 | tpope | curl https://api.github.com/gists |
| 19:58 | tpope | works for me |
| 19:59 | sshack | This is a bit left field. There are no clojure libraries for dealing with /bad/ date/times are there? |
| 19:59 | technomancy | s/all existing tooling/all nontrivial tooling/ |
| 20:00 | sshack | Things like parsing 61/19/1983, into something incorrect, but at least a correct date. |
| 20:00 | technomancy | sshack: I couldn't find anything when I looked |
| 20:00 | technomancy | that was like 2 years ago though |
| 20:00 | tpope | *shrug* |
| 20:00 | sshack | I have a feeling there's a million of them, all baked into insurance applications on ibm mainframes. |
| 20:00 | tomoj | seangrove: http://dev.clojure.org/jira/browse/CLJS-439 |
| 20:00 | sshack | Written in cobol of course. |
| 20:01 | technomancy | sshack: there's at least one in clojure baked into a document processing pipeline =) |
| 20:01 | seangrove | tomoj: Thank you |
| 20:01 | technomancy | my favourite was one where the timezone was "X-User-Defined" |
| 20:06 | tomoj | I wonder what the options for IEncodeClojure are supposed to be for, other than keywordize-keys |
| 20:07 | tomoj | see a possible path to a fix if it were changed to a boolean or keyfn, cheshire style |
| 20:07 | sshack | technomancy: Sigh. See that's my trouble. |
| 20:08 | sshack | You'd think that handling malformed dates would be built into time/date libraries. But no, authors seem to think the real world is some pristine beautiful place. |
| 20:08 | sshack | Full of unicorns, and pixie dust. |
| 20:08 | technomancy | you'd think people who have studied the history of the Gregorian calendar wouldn't be capable of that fallacy |
| 20:09 | technomancy | on the other hand: do one thing and do it well |
| 20:09 | technomancy | they are certainly orthogonal concerns, and I'd much rather have a solid foundation than a library that tried to do everything and didn't get it right |
| 20:10 | sshack | I think that leads us to where we are now. |
| 20:10 | sshack | Lots of individual programmers making kludges "just so I can get this done and move on" |
| 20:11 | technomancy | right; but Joda as a foundation is pretty solid |
| 20:11 | technomancy | whereas Ruby's has parsing built in, but isn't immutable |
| 20:11 | brehaut | i frequently wish i had joda in python |
| 20:11 | technomancy | I guess Ruby did get interval calculations though at least |
| 20:12 | sshack | Can joda guess an invalid date? |
| 20:12 | hiredman | nlp is not a solved problem, dates are a large subset of nlp |
| 20:12 | technomancy | sshack: no |
| 20:13 | brehaut | even humans cant guess invalid dates correctly |
| 20:13 | technomancy | yeah, and then you have issues with the stupid american month order introducing ambiguity too |
| 20:13 | brehaut | yeah |
| 20:13 | brehaut | first step is to ban ##/##/year date formats all together |
| 20:14 | sshack | brehaut: Correct. |
| 20:14 | sshack | YYYYMMDD only |
| 20:14 | sshack | no two digit years. |
| 20:14 | brehaut | yup. dots optional |
| 20:14 | technomancy | nah just switch to metric time |
| 20:14 | brehaut | technomancy: are you sure you are an american? |
| 20:15 | hiredman | kiloseconds! |
| 20:15 | technomancy | brehaut: difficult to self-identify as such |
| 20:17 | brehaut | in america do you get to use the really wacky imperial units like hogsheads etc? |
| 20:17 | brehaut | or just the boring ones |
| 20:17 | technomancy | furlongs and fortnights |
| 20:17 | hiredman | depends how committed to the bit you are |
| 20:18 | technomancy | at least our money is base-100 though |
| 20:20 | seangrove | Think it might be time to add edn as an output format in the rails format |
| 20:21 | seangrove | err, rails app |
| 20:21 | amalloy | fathoms, probably |
| 20:24 | seangrove | Has anyone used edn much in javascript-land? We have an rpc-bridge that has to speak json over Chrome's postMessage method, and slightly worried about the overhead of parsing/serializing edn in hotpaths |
| 20:25 | brehaut | seangrove: have you looked at https://github.com/shaunxcode/jsedn ? |
| 20:25 | seangrove | brehaut: on second thought, I may be able to use the cljs reader, no? |
| 20:26 | brehaut | seangrove: if you are clojurescript, definately |
| 20:26 | seangrove | Yeah, I'm in cljs-land, but they have to communicate over a js-pip that'll convert everything to json |
| 20:26 | tomoj | chrome extension? |
| 20:26 | seangrove | Yeah |
| 20:27 | brehaut | seangrove: i cant speak for the clojurescript reader or jsedn, but theres no reason that the deserializer cant be screaming fast |
| 20:27 | tomoj | could both sides share the same exact compiled cljs? |
| 20:27 | seangrove | I believe so, though there might be some problems |
| 20:27 | seangrove | Why? |
| 20:27 | clojurebot | why not? |
| 20:27 | tomoj | if so maybe you could just send cljs objects over directly |
| 20:27 | brehaut | seangrove: i implemented a sort of lossless clojure reader for a SyntaxHighlighter mode and was able to get it to be quite snappy |
| 20:28 | tomoj | not sure about that.. |
| 20:28 | seangrove | tomoj: Well, they're not allowed to share objects, they just have methods to post messages to one-another |
| 20:28 | seangrove | The messages have to be json-serializable without circular references |
| 20:29 | seangrove | But I could presumably have a kludge of {"payload": "{:a 5 [1 2] {:name :mike :age 40}}"} and have the cljs reader read it in on every message |
| 20:29 | tomoj | huh, do the cljs data structures have circular references? |
| 20:29 | seangrove | Oh, no |
| 20:29 | seangrove | Just mentioning the full set of restrictions |
| 20:32 | tomoj | I think hashes will make that not work anyway |
| 20:36 | brehaut | im curious how edn → js works wrt to objects being shitty maps |
| 20:37 | hiredman | alists! |
| 20:39 | brehaut | aha |
| 21:02 | arohner | are there any examples of active/recent clojure projects using native deps? |
| 21:11 | mpan | I'm wondering if the following would be a good example of a program to try to solve while learning core.logic or not. It asks to find all solutions to a constraint satisfaction problem. I think they expect "normal" solutions to use explicit search, backtracking, and subproblem memoization, and they're very clear that you need an efficient solution to be able to run in a reasonable time. |
| 21:12 | mpan | I guess the problem is essentially isomorphic to finding all strings of given length satisfying given constraints about some of their characters in some positions with regard to each other. |
| 21:13 | mpan | A difficulty is that they expect you to count the number of solutions, and that number is exponential in problem size. |
| 21:14 | mpan | I suppose in that regard it shares some features with Sudoku, but all the core.logic examples I've seen for Sudoku essentially hardcode the board size with a logic var per position, so I'm not sure if this is an appropriate approach or where to begin. |
| 21:19 | tomoj | they ask you to find all solutions or just count them? |
| 21:19 | mpan | They say to count them, but as far as I can tell, that does involve actually finding them. |
| 21:20 | tomoj | ..so exponential is efficient enough? |
| 21:20 | mpan | Or, rather, the "normal" solution is expected to traverse the answer space modulo subproblem memoization, even if it doesn't explicitly keep track of all the valid solutions. |
| 21:20 | tomoj | ah |
| 21:20 | mpan | Exponential with really good subproblem memoization is supposedly good enough, but that's just hearsay. |
| 21:22 | mpan | The only thing preventing the "normal" solution from recording all valid solutions is memory issues, I think. |
| 21:22 | mpan | In the sense of, if you were to record them all to RAM, you might start swapping. |
| 22:19 | mthvedt | what do clojurians use for continuous testing on a local machine |
| 22:22 | amalloy | mthvedt: `watch lein test` is about as advanced as it gets |
| 22:23 | mthvedt | that is not very advanced |
| 22:24 | mabes | mthvedt: lazytest has an autotest feature. I use it with midje and it fits my needs |
| 22:29 | mthvedt | mabes: neat, having a look |
| 23:03 | technomancy | mthvedt: most people use in-editor auto-tests rather than watching the filesystem |
| 23:03 | jaimef_ | technomancy: ! |
| 23:03 | technomancy | there's an emacs after-save hook, etc |
| 23:03 | mthvedt | technomancy: anything for vim? |
| 23:03 | technomancy | well maybe not "most people" but most people who do auto-testing |
| 23:03 | technomancy | mthvedt: asking the wrong person =) |
| 23:03 | jaimef_ | technomancy: what's the way to fix the 'jack-in is not a task' issue with emacs/swank? |
| 23:04 | technomancy | jaimef_: nrepl? =) |
| 23:04 | technomancy | jaimef_: just need to make sure lein-swank is installed as a plugin |
| 23:05 | jaimef_ | code for M-x package-install nrepl :P |
| 23:05 | jaimef_ | seems to be a lot of movement in the syntax for lein |
| 23:05 | jaimef_ | will use nrepl thanks |
| 23:09 | tpope | would in editor testing delegate to a repl, or would it spawn something like lein test? |
| 23:17 | technomancy | tpope: lein test is way too slow |
| 23:17 | technomancy | clojure-test-mode builds on slime (originally) and now nrepl.el |
| 23:17 | technomancy | highlighting which lines had failures |
| 23:18 | tpope | yeah that was going to be my next question |
| 23:18 | tpope | most of this stuff shouldn't be that hard now that we have a vim nrepl interface |
| 23:21 | amalloy | technomancy is telling tpope lein test is too slow! today must be backwards feature-request day |
| 23:21 | tpope | ha! |
| 23:22 | technomancy | oh snap |
| 23:22 | technomancy | yeah tpope can you make lein test faster while you're at it? |
| 23:22 | xeqi | +1 |
| 23:22 | technomancy | xeqi: hey good to see you |
| 23:23 | technomancy | been offline traveling? |
| 23:23 | xeqi | technomancy: a little, more trying to compartmentalize irc usage to evenings, when it gets quiet |
| 23:23 | technomancy | I hear ya |
| 23:25 | technomancy | just been realizing lein progress has stalled out a bit; hope to spend some time on docs for the new repo this week |
| 23:25 | lynaghk | Any iPhone owners interested in testing out a ClojureScript-powered iOS weather application? |
| 23:25 | xeqi | haha, yeah, my hopes for more time have been dashed by holidays/family |
| 23:26 | technomancy | xeqi: well, priorities |
| 23:27 | xeqi | technomancy: I remember a issue for lein search indexes and using some library for searching, did that get implemented? |
| 23:28 | technomancy | xeqi: sorta |
| 23:28 | technomancy | we switched to the maven implementation, and it's faster, but it has a different set of problems |
| 23:29 | xeqi | ah, was hoping for seomthing easy to replace the sqlite3 text search for clojars :p |
| 23:29 | dr1 | Hello, how do I load project files so I can run them? When I do (in-ns 'project.core) followed by (project.core/-main), I get this output: IllegalStateException Attempting to call unbound fn: #'project.core/-main clojure.lang.Var$Unbound.throwArity (Var.java:43) |
| 23:29 | technomancy | xeqi: the analyzer is a bit of a mess. we have a lot less control. |
| 23:31 | xeqi | dr1: hmm, I haven't used a plain repl for awhile.. maybe (load "project/core.clj") ? |
| 23:32 | dr1 | this project has a number of files, so hopefully there's a way to load them all. but when I try that, I get back FileNotFoundException Could not locate project/project.core__init.class or project/project.core.clj on classpath: clojure.lang.RT.load (RT.java:432) |
| 23:34 | xeqi | loading that file will also load any it requires |
| 23:36 | technomancy | dr1: most libraries don't have a -main function |
| 23:36 | dr1 | it's not a library |
| 23:37 | technomancy | typically "unbound fn" means -main has been created but not given a value |
| 23:37 | dr1 | it's an application (built by someone else). I'm very new to clojure so I'm sure this is simple. I actually had it running earlier after executing a bunch of the project's functions. |
| 23:37 | technomancy | (declare -main) or some such |
| 23:38 | dr1 | it definitely exists… I just seem to not be loading the files properly |
| 23:38 | dr1 | though I am in the namespace and can call functions from it |
| 23:44 | dr1 | hmm… I think I may have made some bad modification to the code… I got a fresh copy and it seems to load using the steps above :/ |
| 23:54 | amalloy | dr1: in-ns doesn't load anything from the filesystem |
| 23:54 | amalloy | you need to (require 'the-project) first |
| 23:55 | dr1 | amalloy: I realized what I was doing… I ran lein repl from the project directory so it was automatically loading the project files |
| 23:55 | dr1 | in-ns wasn't doing anything |
| 23:55 | dr1 | I'm used to OOP… this is reeeeeeally confusing :) |
| 23:57 | amalloy | nah, you haven't even gotten to the paradigm shifts yet; this is just the usual confusion that happens with any new language |
| 23:57 | Sgeo|web | Oh hey apparently Raynes has ... talked in a Reddit thread about Factor -- mostly complaining about lack of docs |
| 23:57 | Sgeo|web | (I seem to be interested in Factor again for some reason) |
| 23:58 | dr1 | haha yea, I got a brief overview… it was impressive and a bit overwhelming |
| 23:59 | dr1 | I'm definitely going to be doing a good amount of googling and asking stupid questions for a while |