2013-04-19
| 00:57 | nonuby | is there a function that returns true/false is item is either a list or vector or something iterable |
| 00:58 | nonuby | seq? return false on [] |
| 01:01 | technomancy | try coll? |
| 02:32 | tieTYT | I wrote a cond with a bunch of conditions and each test uses the same argument. Is there any way to write that in a more concise way? |
| 02:33 | ucb | tieTYT: perhaps condp? |
| 02:33 | ucb | ,(doc condp) |
| 02:33 | clojurebot | "([pred expr & clauses]); Takes a binary predicate, an expression, and a set of clauses. Each clause can take the form of either: test-expr result-expr test-expr :>> result-fn Note :>> is an ordinary keyword. For each clause, (pred test-expr expr) is evaluated. If it returns logical true, the clause is a match. If a binary clause matches, the result-expr is returned, if a ternary clause matches, i... |
| 02:35 | tieTYT | how could I do that? Each test is either: (.contains "some string" src) or a regex match like (.regex-matches #"some regex" src) |
| 02:35 | ucb | oh, I see |
| 02:35 | tieTYT | if all the tests were one or the other, condp seems like a fit, but not when it's a mixture |
| 02:35 | ucb | you're trying to get rid of all the instances of src, right? |
| 02:36 | tieTYT | yep |
| 02:36 | ucb | a side point, .regex-matches can be replaced by re-matches |
| 02:36 | ucb | (I believe) |
| 02:36 | tieTYT | yeah that's not a real method, i do use re-matches |
| 02:36 | ucb | oh, right :) |
| 02:37 | ucb | I'm thinking whether you could have a pred that used apply or ->> |
| 02:37 | ucb | so that you could write your conditions like (re-matches #"regex") |
| 02:37 | ucb | or (contains "string") |
| 02:38 | ucb | TO THE REPL! |
| 02:38 | tieTYT | the thing is, sometimes if the test passes I return true, sometimes I return false |
| 02:38 | tieTYT | hah |
| 02:38 | tieTYT | I could use a macro for this right? one without generated symbols |
| 02:39 | tieTYT | I believe that's called unhygenic, I'm not sure though |
| 02:39 | ucb | hum, perhaps |
| 02:40 | ucb | the alternative to cond is to have a list of these things and then drop-while falsey |
| 02:40 | ucb | I think that's some? |
| 02:40 | ucb | ,(doc some?) |
| 02:40 | clojurebot | Huh? |
| 02:40 | ucb | ,(doc some) |
| 02:40 | clojurebot | "([pred coll]); Returns the first logical true value of (pred x) for any x in coll, else nil. One common idiom is to use a set as pred, for example this will return :fred if :fred is in the sequence, otherwise nil: (some #{:fred} coll)" |
| 02:41 | tieTYT | hm maybe |
| 02:41 | ucb | something like: (some (fn [f] (f s)) [(partial re-matches #"regex") (partial str-contains "string")...]) |
| 02:41 | tieTYT | maybe I could and/or two condps together |
| 02:41 | ucb | thing is, you wouldn't know which one matched :/ |
| 02:42 | tieTYT | i don't need to know, it returns a bool |
| 02:42 | tieTYT | ok thanks for the help, ttyl |
| 02:42 | ucb | enjoy |
| 02:45 | rhg135 | Hi |
| 02:45 | deadlockx2 | why so many people here...? |
| 02:45 | rhg135 | Yup |
| 02:45 | deadlockx2 | noone cares about clojure |
| 02:45 | rhg135 | Get him! |
| 02:46 | deadlockx2 | and taht proves my point... ppl in this channel for no reason... |
| 02:46 | rhg135 | Poor deadlockx2 |
| 02:47 | deadlockx2 | ur alone in this matter rhg135 |
| 02:48 | rhg135 | I'll tell rich when I see him lol |
| 02:48 | deadlockx2 | tell everyone... obviously, your dare turned out to backfire :P |
| 02:48 | rhg135 | Know who he is? |
| 02:49 | deadlockx2 | nopz |
| 02:49 | mthvedt | don't feed the trolls |
| 02:49 | rhg135 | The creator |
| 02:49 | Raynes | I don't Rich would care about this at all. |
| 02:50 | rhg135 | I'm stuck with him anyway |
| 02:50 | deadlockx2 | lol |
| 02:50 | rhg135 | Ik |
| 02:51 | noprompt | he's joking right |
| 02:51 | noprompt | s/right/right? |
| 02:51 | rhg135 | No |
| 02:51 | noprompt | oh that's a roflcopter... |
| 02:51 | rhg135 | He's said it twice |
| 02:52 | deadlockx2 | the twiceys rule :o |
| 02:52 | deadlockx2 | anything you say twice.. you mean it |
| 02:53 | rhg135 | Yup |
| 02:53 | noprompt | works for me! |
| 02:53 | deadlockx2 | lol |
| 02:54 | Raynes | Ohai noprompt. |
| 02:54 | noprompt | wuzzup. |
| 02:55 | noprompt | boy lemme tell you about eating your own dog food... |
| 02:55 | Raynes | I don't have any dog food. |
| 02:55 | rhg135 | +deadlockx2> if (sleep musthappen) (do (skipit)) else (do(irc)) |
| 02:55 | rhg135 | <+deadlockx2> or some bs like that |
| 02:55 | rhg135 | <@rhg135> Bad |
| 02:55 | rhg135 | <+deadlockx2> yeah.. its cuz noone cares about clojure |
| 02:55 | rhg135 | <@rhg135> Go on #clojure and say that lol |
| 02:55 | rhg135 | <+deadlockx2> will do |
| 02:55 | Raynes | I don't have any food at all, in fact. |
| 02:55 | noprompt | yeah don't eat dog food. |
| 02:55 | Raynes | It's okay if you don't like Clojure, guys. |
| 02:56 | Raynes | We're all fine with it. |
| 02:56 | noprompt | yeah, like, i don't really care for ruby. |
| 02:56 | noprompt | but if you care for it, then, like, well that's ok with me. |
| 02:56 | rhg135 | The sad part is he likes java and oop |
| 02:56 | Raynes | You can, in fact, say you hate it without causing us any pain and suffering. We would however appreciate it if you don't bother us with it for the rest of the night. |
| 02:57 | Raynes | That's okay too. |
| 02:57 | Raynes | Not everybody likes our koolaid. |
| 02:57 | deadlockx2 | theres koolaid involved? |
| 02:57 | noprompt | indeed, that would be ammenable. |
| 02:57 | deadlockx2 | ok ok i retire my comments... i want some |
| 02:57 | Raynes | I have some koolaid right here. |
| 02:57 | deadlockx2 | is it purple koolaid? |
| 02:57 | Raynes | Cherry red. |
| 02:57 | Raynes | I don't like grape. |
| 02:58 | deadlockx2 | that works too :D |
| 02:58 | deadlockx2 | lol |
| 02:58 | noprompt | does this happen often? |
| 02:58 | Raynes | noprompt: I've been using Vim all day. |
| 02:58 | noprompt | Raynes: for realz? |
| 02:59 | Raynes | Yeah. I think I just get bored with editors. |
| 03:00 | noprompt | i dunno man. i mean i think there's really only two out there you could possibly use. |
| 03:00 | Raynes | noprompt: The cool thing is that by using evil-mode I can more or less switch between editors and not give any shits at all. |
| 03:01 | noprompt | Raynes: that's certainly true, but i have found it frustrating that i can emulate some things with evil. |
| 03:01 | noprompt | for instance, i can't have a normal-state binding like ,el and have it do something. |
| 03:01 | noprompt | it seems limited to only two key strokes at this point. |
| 03:02 | noprompt | in vim i have normal mode maps like ,rbt for ToggleRainbowParens. |
| 03:02 | noprompt | vim is really great for that sort of thing. |
| 03:04 | noprompt | but yeah i hear you. |
| 03:05 | noprompt | right now i'm trying to port my vim colorscheme to emacs. |
| 03:05 | Raynes | tomorrow night <3 |
| 03:05 | Raynes | Works everywhere. |
| 03:05 | Raynes | Even refheap. |
| 03:05 | noprompt | yeah, it's definitely a nice theme. |
| 03:06 | noprompt | a really cool colorscheme for Vim is Galaxy. |
| 03:06 | noprompt | https://github.com/Rykka/galaxy.vim |
| 03:06 | Raynes | MY EYES |
| 03:06 | Raynes | MY EYEEEEEES |
| 03:06 | noprompt | it's actually a weird scheme. in that it has it's own color theming tool built in. |
| 03:07 | noprompt | the defaults look pretty bad but it has a few different settings for some really nice dark themes. |
| 03:08 | Raynes | Holy shit. |
| 03:08 | Raynes | Today is Friday? |
| 03:08 | Raynes | Where did this week go? |
| 03:08 | Raynes | I need to stop taking sleeping pills. |
| 03:08 | Raynes | I thought maybe Wednesday. |
| 03:09 | jasonjckn | Raynes: melatonin? |
| 03:09 | Raynes | diphenhydramine |
| 03:09 | noprompt | Raynes: so were you doing clojure in vim? |
| 03:10 | Raynes | I'm doing it right now in fact. |
| 03:10 | noprompt | are you using fireplace or vimclojure? |
| 03:10 | Raynes | Fireplace. |
| 03:10 | Raynes | tpope is a boss. |
| 03:10 | noprompt | indeed. |
| 03:10 | Raynes | noprompt: https://www.refheap.com/paste/0eeb2ab595cdeb786ac91eefb You missed this while you disappeared. |
| 03:10 | jasonjckn | You know that emacs run vim right? |
| 03:11 | jasonjckn | it's called viper-mode :-P |
| 03:11 | Raynes | It's called evil-mode. |
| 03:11 | noprompt | jassonjckn: sike, it's called evil-mode |
| 03:11 | jasonjckn | lol |
| 03:11 | noprompt | boom! |
| 03:11 | jasonjckn | i tried it once, didn't like it either |
| 03:11 | noprompt | :) |
| 03:11 | Raynes | viper-mode is the completely ancient version. |
| 03:11 | Raynes | I use Emacs. |
| 03:11 | Raynes | But today I used Vim. |
| 03:11 | noprompt | yah, viper's the pits bro. |
| 03:11 | Raynes | I mean. |
| 03:11 | Raynes | I use both guys. |
| 03:11 | jasonjckn | me too |
| 03:11 | noprompt | me three. |
| 03:11 | Raynes | I'm ambieditorxious. |
| 03:11 | jasonjckn | my brain can switch easily between vim and emacs |
| 03:11 | jasonjckn | i'm that smart |
| 03:12 | noprompt | my brain cannot handle the default emacs keybindings. |
| 03:12 | noprompt | it's like when i tried to pick up dvorak. |
| 03:12 | noprompt | that was painful. |
| 03:12 | noprompt | and i went back to qwerty. |
| 03:12 | jasonjckn | have you tried default emacs AND dvorak, it's even more fun |
| 03:12 | noprompt | but i doubt there's an evil mode for dvorak. |
| 03:12 | noprompt | jasonjckn: so you're asking me to commit suicide? is that it? |
| 03:13 | noprompt | :P |
| 03:13 | Raynes | My boss uses a modified colemak on a kinesis advantage keyboard. |
| 03:13 | Raynes | Good luck beating that. |
| 03:13 | jasonjckn | I'm asking you to suck it up princess |
| 03:13 | jasonjckn | Crtl + X is painful, but then you realize you're alive |
| 03:13 | noprompt | i really want one of these http://www.datahand.com/ |
| 03:13 | noprompt | well i have capslock bound to both ctrl and esc. |
| 03:14 | noprompt | esc on tap and ctrl on hold. so it's not so bad. |
| 03:14 | jasonjckn | Raynes: if it didn't take so long to change keyboard layouts i'd do that |
| 03:14 | jasonjckn | Raynes: but i learned dvorak when I was a teen |
| 03:15 | noprompt | wow colemak. |
| 03:15 | Raynes | PUT ON YOUR WAR PAINT! |
| 03:15 | jasonjckn | noprompt: have you talked to anyone that uses datahand? |
| 03:15 | Zerker | As a teen, I'm trying to learn steno :P |
| 03:15 | jasonjckn | noprompt: looks interesting |
| 03:16 | Raynes | noprompt: You should go to the Fall Out Boy conference with me in September. |
| 03:16 | Raynes | conference? Wtf. |
| 03:16 | Raynes | Concert. |
| 03:16 | noprompt | LMFAO!!! |
| 03:16 | noprompt | fall out boy conference. |
| 03:16 | Raynes | That's for the hardcore fans. I just want the concert. |
| 03:16 | Raynes | Unfortunately it is in Anaheim and I don't have any way to get there. |
| 03:17 | jasonjckn | Zerker: that keyboard layout is just non-sense |
| 03:17 | noprompt | i dunno man, i think i'd have to have a few before i went. that's really out of my element. |
| 03:17 | Raynes | Baha |
| 03:17 | Raynes | noprompt: http://www.youtube.com/watch?v=5hDZbroaQDc |
| 03:18 | noprompt | i had a roomate back in the day who was really in to those guys. |
| 03:18 | Zerker | It's based on pressing several keys at once to get less frequent ones, and typing syllables at a time |
| 03:19 | noprompt | Zerker: which layou is that? |
| 03:19 | Raynes | I like this new album. I only liked a few of their older songs, noprompt. I like them mostly because they discovered Panic! At The Disco which is one of my favorite bands |
| 03:19 | Zerker | Stenotype xD |
| 03:19 | noprompt | s/(ou)/\1t |
| 03:19 | Zerker | S/\1/&/ |
| 03:20 | noprompt | it's funny you bring that up Zerker. i saw a commercial on television the other day about court room reporters and it got me thinking about that. |
| 03:21 | Raynes | noprompt: How do you feel about Imagine Dragons? |
| 03:21 | noprompt | so you can really hook a stenotype up and go for it? |
| 03:21 | Zerker | Yup, currently machines/software cost thousands of dollars, both are being open-sourced though |
| 03:22 | noprompt | Raynes: i have no idea. most of what i listen to is 60's/70's. occasionally i'll listen to some newer stuff though. |
| 03:22 | noprompt | Zerker: that it is - so - awesome. |
| 03:23 | Raynes | noprompt: http://www.youtube.com/watch?v=sENM2wA_FTg |
| 03:23 | noprompt | Zerker: so you have one of those machines? |
| 03:23 | noprompt | lol. there isn't a depeche mode for emacs? |
| 03:24 | Zerker | I have a gaming keyboard(nkro kinda necessary) with lasercut keys stuck on top of it, first iteration of "open-sourcing the hardware" ^-^ |
| 03:26 | noprompt | Raynes: hmm... not really my taste. most of the stuff now-a-days more or less sounds the same. but i wouldn't knock someome if they liked it. |
| 03:26 | Zerker | I'm at ~10WPM at the moment, but that's because I've been helping write code a lot more than actually drilling |
| 03:27 | gunface | hi guys, is there a pdf version of the whole clojure official documentation somewhere, I tried but couldn't find :( |
| 03:27 | caulagi | Is noir the recommended way to develop web applications in Clojure? |
| 03:28 | noprompt | gunface: the internet is your pdf version. |
| 03:28 | noprompt | :) |
| 03:28 | noprompt | lol but i do kinda like Dragon Force, Raynes. as cheesey as they are. |
| 03:29 | noprompt | something about wizards and fighthing for glory somehow connects me deeply to what i do as a programmer. :) |
| 03:29 | gunface | ahh ok, I thought i might find something to use offline |
| 03:29 | gunface | besides the doc function |
| 03:29 | gunface | ok |
| 03:29 | noprompt | gunface: why not pick up one of the good clojure books as a pdf? |
| 03:30 | noprompt | gunface: remember you also have clojure.repl/doc and clojure.repl/source at your disposal. |
| 03:30 | noprompt | ,(doc map) |
| 03:30 | clojurebot | "([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & ...]); Returns a lazy sequence consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments." |
| 03:30 | noprompt | ,(source clojure.string/join) |
| 03:30 | clojurebot | Source not found\n |
| 03:30 | gunface | no I have all of them but they don't go full fledged in the library functions |
| 03:31 | noprompt | gunface: you mean as far as examples? |
| 03:31 | gunface | yeah and full coverage of functions too |
| 03:31 | gunface | ok repl will work for me |
| 03:32 | noprompt | well you can also try clojure-doc.org or clojuredocs.org |
| 03:33 | gunface | yeah noprompt will do :) |
| 03:33 | antares_ | caulagi: look into Compojure or Luminus. Noir is no longer maintained. |
| 03:33 | noprompt | gunface: try not to pick everything up all at once. you can get a lot done with map, reduce, seq, into, etc. |
| 03:33 | noprompt | caulagi: there's also pedestal too. |
| 03:34 | noprompt | still not sure what the consensus is on that, however. |
| 03:34 | gunface | yeah getting a hang of map,reduce,filter stuff |
| 03:34 | noprompt | gunface: also it's good to recognize when fn's like comp and partial will suit you. |
| 03:35 | noprompt | for instance (partial apply some-fn) can be very concise and powerful. |
| 03:35 | tgoossens | i never actually used comp before i think |
| 03:35 | tgoossens | ,(doc comp) |
| 03:35 | clojurebot | "([] [f] [f g] [f g h] [f1 f2 f3 & fs]); Takes a set of functions and returns a fn that is the composition of those fns. The returned fn takes a variable number of args, applies the rightmost of fns to the args, the next fn (right-to-left) to the result, etc." |
| 03:35 | noprompt | f circl g FTW |
| 03:35 | noprompt | ;) |
| 03:36 | gunface | comp,partial,seq,into I haven't used looking them up |
| 03:36 | noprompt | comp is just function composition |
| 03:36 | gunface | as of now doing 4clojure questions :) |
| 03:37 | noprompt | ,(map (comp inc inc) (range 3)) |
| 03:37 | clojurebot | (2 3 4) |
| 03:37 | gunface | the small sokutions of others hurt like a bitch though :P |
| 03:38 | noprompt | i've never done any of those. |
| 03:39 | gunface | they seem good, the elementary ones are well, elementary but the later questions are good and have a code-golf thing in that so yeah a lot of map, reduce and functional stuff |
| 03:39 | caulagi | antares_:, noprompt: I will look at Luminus and pedestal, thanks |
| 03:39 | noprompt | btw Raynes, if you use the vim-clojure-static files it has awesome regexp highlighting ;) |
| 03:39 | Raynes | I do. |
| 03:40 | ejackson | Raynes got married ? |
| 03:40 | noprompt | Raynes: we didn't fuck around https://github.com/guns/vim-clojure-static/blob/master/syntax/clojure.vim#L78-L113 |
| 03:40 | Raynes | Don't link me to viml man. |
| 03:41 | noprompt | https://github.com/guns/vim-clojure-static/blob/master/clj/test/syntax_test.clj |
| 03:41 | noprompt | that guy guns was pretty cool though coming up with a way to test the syntax files though. |
| 03:41 | noprompt | pretty clever. |
| 03:41 | noprompt | viml is nasty though... |
| 03:43 | noprompt | my guess is that doing syntax highlighting in emacs is much better. |
| 03:44 | noprompt | *my guess* |
| 03:48 | Raynes | noprompt: https://github.com/tpope/vim-fireplace/commit/77444275fda8e20ac2b92541398543fdd0fa2614 This is sad. |
| 03:48 | Raynes | I had to manually revert that .format() change to get it working. |
| 03:48 | caulagi | noprompt: does pedestal have templating? I.e. HTML is separate from Clojure? |
| 03:50 | Raynes | I hope not. |
| 03:50 | Raynes | There are lots of good libraries for doing that. |
| 03:50 | Raynes | I'd hope that pedestal is flexible enough to let you use any of them. |
| 03:50 | noprompt | man that's a bummer. |
| 03:50 | Raynes | See: laser, enlive, hiccup, clabango |
| 03:50 | noprompt | you know i should give fireplace another chance. |
| 03:50 | Raynes | stencil |
| 03:51 | noprompt | caulagi: yeah i dunno about html templating. with what's available, as Raynes just mentioned, it seems like a step backward. |
| 03:52 | noprompt | caulagi: the consensus seems to be geared toward composing your application from the pieces you want to use. not an all inclusive monolithic framework. |
| 03:53 | noprompt | btw laser is an awesome name and uses zippers which are way out rad stuff. :) |
| 03:53 | caulagi | noprompt: sure. But I don't want my Clojure code to generate HTML. I am just starting Clojure but it is much easier for me when the HTML is separate |
| 03:54 | caulagi | so what should I use? |
| 03:54 | Ember- | enlive maybe |
| 03:54 | Ember- | or well, you're just starting clojure... |
| 03:54 | Ember- | could be kinda a big leap then |
| 03:54 | noprompt | caulagi: if you're just starting clojure then definitely do hiccup anyway. |
| 03:54 | Raynes | I prefer laser myself. |
| 03:54 | Raynes | <_< |
| 03:54 | Raynes | >_> |
| 03:54 | Ember- | it's purely functional, needs a bit of mind twisting to get around (enlive that is) |
| 03:54 | noprompt | :) |
| 03:54 | Ember- | Raynes: I wonder why ;) |
| 03:55 | noprompt | caulagi: you can put your hiccup templates in a separate namespace. |
| 03:55 | caulagi | noprompt: by template, I mean a HTML file |
| 03:56 | noprompt | yes i understand that. i'm suggesting this as a thought expirement. |
| 03:56 | Raynes | Clabango is probably most approachable option. I think the consensus is that laser and enlive are the coolest solutions. |
| 03:56 | caulagi | Raynes: Let me look at laser and enlive |
| 03:56 | Raynes | They're also coincidentally the hardest to understand solutions. |
| 03:57 | Ember- | for a guy coming from oop world |
| 03:57 | Raynes | I have a guide, but Enlive has jack squat to help you understand how it works. |
| 03:57 | Ember- | not for a guy coming from the functional world |
| 03:57 | Raynes | Not that I'm promising miracles with my guide. |
| 03:57 | Ember- | an yeah, enlive is indeed lacking in documentation |
| 03:57 | Ember- | +d |
| 03:57 | Raynes | Ember-: Really? I started programming with Haskell and I couldn't figure Enlive out for a very long time. |
| 03:57 | Glenjamin | are there guidelines for handling error states in laser/enlive world - wouldn't you have to display all the errors on the page, and then have clojure turn them off? |
| 03:57 | Ember- | Raynes: :) |
| 03:58 | Raynes | Glenjamin: Or just conditionally display them. |
| 03:58 | Glenjamin | but then where do you put them? |
| 03:58 | Raynes | You probably can't do that easily in Enlive, but you can in Laser. |
| 03:58 | Raynes | Look at refheap. |
| 03:58 | Glenjamin | isn't the idea that a pure frontend person could build the templates, and then laser magically makes them dynamic? |
| 03:58 | Raynes | Glenjamin: https://github.com/Raynes/refheap/blob/master/src/refheap/views/paste.clj#L31 |
| 03:59 | caulagi | Raynes: I still think Laser uses Clojure to generate HTML. Is that correct? |
| 03:59 | Raynes | caulagi: No. |
| 03:59 | Raynes | It takes HTML and then transforms that HTML and spits it back out. |
| 03:59 | Raynes | I mean, there is only so much you can do. |
| 03:59 | antares_ | Laser uses the power of unicorns. You can't expect less from Raynes. |
| 03:59 | Raynes | If you want a dynamic website, you have to let your code touch your html. |
| 03:59 | Raynes | Hi antares_ |
| 03:59 | Raynes | :D |
| 04:00 | Glenjamin | say for example i wanted to put inline errors next to form fields, i'd have to build my html as if everything had gone wrong, and then have laser hide them? |
| 04:00 | noprompt | Raynes: you know, after looking at enlive and laser i've wondered about CSS a bit more. |
| 04:01 | noprompt | of course CSS comes with a whole wonderful treasure trove of horse crap to deal with.... |
| 04:01 | noprompt | html is the only part of the front-end webstack that isn't totally fucked. |
| 04:02 | Glenjamin | actually https://github.com/Raynes/refheap/blob/master/src/refheap/views/paste.clj#L64 is a good example - this bit of content creation is hidden from the template author |
| 04:04 | Raynes | Glenjamin: There are really two options. You can either conditionally generate that HTML in your Clojure and put it in there, or you can put all of the cases in your HTML and then conditionally remove the pieces you don't need in the transformation. |
| 04:04 | noprompt | Raynes: are you guys hand authoring all the css? |
| 04:04 | Raynes | noprompt: Yes. |
| 04:05 | caulagi | Raynes: what are the other pieces needed with laser? |
| 04:05 | Glenjamin | mm, i suppose the question i'm really asking is: is the goal to allow pure-frontend people to write the templates |
| 04:05 | Glenjamin | noprompt: as opposed to with a pre-processor? |
| 04:05 | Raynes | Glenjamin: Yes. |
| 04:05 | noprompt | Glenjamin: yah |
| 04:05 | Raynes | caulagi: I mean remove the unnecessary pieces of HTML with the laser transformation. |
| 04:06 | caulagi | Raynes: I got that. I meant, what other libraries should I use? laser is only the html part, right? What about routing and stuff |
| 04:06 | Raynes | compojure is a good option |
| 04:07 | Raynes | You should look at luminus. It'd help you get up and running pretty quickly. |
| 04:07 | noprompt | compojure's the bomb. |
| 04:07 | Raynes | $google luminus web |
| 04:07 | lazybot | [Luminus - A Clojure Web Framework] http://www.luminusweb.net/ |
| 04:07 | Glenjamin | so you'd either have a bunch of stuff to conditionally remove, or some stuff frontend guys can't change - I wonder if something funky could be done with clojurescript to provide state previews |
| 04:07 | Raynes | Glenjamin: Yes. You'd have this problem in any templating solution though. |
| 04:08 | Raynes | Glenjamin: I mean, there is a third option. You can have it as a separate template. |
| 04:08 | Raynes | But template files with 1 line in them? |
| 04:08 | Raynes | BLEH |
| 04:08 | Glenjamin | yeah, but normally you'd throw logic into the template, so at least they can edit stuff - even if logic in templates is awful |
| 04:08 | Glenjamin | it's the balance between offline-preview and actually working online i guess |
| 04:09 | Glenjamin | anyway, i plan to have a proper go with laser once i've got my unstyled working beta deployed :) |
| 04:11 | noprompt | Raynes: would you be open to garden stylesheets once it's out of alpha? |
| 04:11 | Raynes | noprompt: I don't really like doing that sort of thing in Clojure. |
| 04:12 | Raynes | HOWEVER! |
| 04:12 | Raynes | Apparently my disdain for that is irrational. |
| 04:12 | Raynes | callen was complaining about duplication in my css file. |
| 04:12 | noprompt | well there's always sass + compass, but that can get slow. |
| 04:12 | Raynes | noprompt: I'd be open to it under the condition that it generate to a file and not just serve random magic. |
| 04:12 | Raynes | As in, generate to a file on startup. |
| 04:13 | Raynes | And that you add it in and not me. :P |
| 04:13 | Glenjamin | noprompt: do you have some notes for benefits over sass? |
| 04:13 | noprompt | Raynes: yeah that's how i do it now. |
| 04:13 | Glenjamin | or is it just speed? |
| 04:13 | Raynes | Glenjamin: Benefits? You do it in Clojure dude. |
| 04:13 | noprompt | Glenjamin: the benefits, imho, are not just speed. |
| 04:13 | Raynes | That's the benefit. |
| 04:14 | Glenjamin | all css pre-processors are basically functional/declarative |
| 04:14 | noprompt | the main benefit is consistency, which css lacks. |
| 04:14 | noprompt | and thus, sass lacks. |
| 04:14 | noprompt | or whatever preprocessor out there you use lacks. |
| 04:15 | Glenjamin | interesting, so you actually abstract away from raw CSS syntax? |
| 04:15 | Glenjamin | instead of being a superset |
| 04:15 | noprompt | to a degree yes. but i'm still working on it. |
| 04:15 | noprompt | it's got a decent base at the moment. |
| 04:15 | noprompt | and clear semantics. |
| 04:16 | Glenjamin | i suspect the issue will be, how well does it fit the existing mental model people have of how css works |
| 04:16 | noprompt | i've been working with CSS for almost 10 years now. |
| 04:16 | Glenjamin | the current generation of pre-processors all lightly wrap CSS, i suspect thats because people don't want to learn something completely different |
| 04:17 | noprompt | i'd say if you know it well enough, a mild shift in thinking is appropriate. |
| 04:17 | noprompt | as with lisp you have to slightly shift your thinking. |
| 04:17 | Glenjamin | my current stance is that CSS is excellent for text formatting, awful for layout - and I'm interested to see if a tool can somehow fix that :p |
| 04:18 | noprompt | it's actually not that bad. |
| 04:18 | noprompt | today i wrote a functional grid system. |
| 04:19 | Glenjamin | i'm certainly intrigued |
| 04:19 | noprompt | so you provide the grid settings and you get back a grid function (a map) for which you can use to do layou |
| 04:19 | noprompt | ie. [:section.main (grid :container)] |
| 04:20 | noprompt | [:.row (grid :row)] |
| 04:20 | Glenjamin | presumably you have to retain calling order, rather than being declarative? |
| 04:20 | noprompt | what do you mean? |
| 04:21 | noprompt | by calling order? (a little tired) |
| 04:21 | Glenjamin | one of the things that bugs me about sass is if i define media queries next to the elements they apply to, it's not smart enough to group them all together by breakpoint |
| 04:21 | noprompt | oh righ. |
| 04:21 | noprompt | *right |
| 04:21 | Glenjamin | so they get scattered across the generated file, duplicating the breakpoint definition |
| 04:21 | noprompt | well that's one of the thigns i'm thinking about. |
| 04:22 | noprompt | so my thinking is that when you compile the stylesheet it clearly separates "normal" rules and groups media queries as you would expect. |
| 04:22 | noprompt | normal rules take precedence of course. |
| 04:22 | Glenjamin | mm, seems sensible |
| 04:22 | noprompt | in the future i want to be able to mark rules like this. |
| 04:23 | noprompt | ^:screen [:div.row ...] |
| 04:23 | Glenjamin | referencing other element's properties might be cool, not sure if needing that is a good thing though |
| 04:23 | noprompt | and then compile @media screen { div.row { ... |
| 04:23 | noprompt | well why would you? |
| 04:23 | noprompt | you don't need to because you're using clojure. |
| 04:24 | noprompt | just call a function or use a def in some place |
| 04:24 | Glenjamin | [:div.main {:width (- 100 (ref :div.sidebar :width))}] |
| 04:24 | noprompt | ah i see. |
| 04:24 | noprompt | hmm... i need to think about that one. |
| 04:24 | Glenjamin | unsure if thats useful when you have grids |
| 04:24 | noprompt | because you could say (def sidebar-width (px whatever)) |
| 04:25 | noprompt | and then [:div.main {:width (px- sidebar-width 100)}] |
| 04:25 | noprompt | garden units automatically convert (when possible) |
| 04:26 | noprompt | but still i think that's an interesting thought. |
| 04:27 | noprompt | one thing i'm kinda debating right now, and Glenjamin_ let me know your thoughts here, is a lone :& selector. |
| 04:27 | noprompt | it'd basically be like a mixing but w/o bs defmixin etc. |
| 04:28 | noprompt | *mixin |
| 04:29 | noprompt | Raynes: lemme tell you about the worst thing that ever happened in my recent life. |
| 04:30 | Raynes | Exciting. |
| 04:30 | noprompt | the company i worked for blocked the IRC ports... |
| 04:30 | Raynes | Oh my goodness. |
| 04:30 | noprompt | yeah and what's worse is that i'd have to use some shitty irc client in the browser. |
| 04:31 | noprompt | needless to say i've vanished from irc during the day. |
| 04:31 | noprompt | and it's been oh so sad. |
| 04:31 | noprompt | oh and they blocked most of the chat protocols too. |
| 04:31 | Raynes | I could fix that for you if you wanted to break company rules. |
| 04:31 | Raynes | If they really just block IRC ports. |
| 04:31 | noprompt | i'm all ears. |
| 04:31 | Raynes | I have a bouncer that runs on port 7776. |
| 04:32 | Raynes | If they don't block that then I can give you an account on it and you can connect via it. |
| 04:32 | noprompt | they really did, and they blocked the ssl ports as well. |
| 04:32 | noprompt | yeah it's blocked... |
| 04:32 | Raynes | 7776? |
| 04:32 | Raynes | Wow. |
| 04:32 | noprompt | they've only left open the standard ports needed for existence like 22. |
| 04:32 | Raynes | Quit your job, man. |
| 04:33 | noprompt | if you know a place where i can go, please let me know. |
| 04:33 | noprompt | i had to write a huge letter asking for the port to be reopened AT MY DESK. |
| 04:33 | Raynes | If we blocked IRC ports at work I'd actually get work done. |
| 04:34 | noprompt | dude, i work for a newspaper company that can't get their shit together. |
| 04:34 | iamdrw | howdy everybody, quick question — what is the idiomatic way of converting json to clojure map from clojurescript? as I understand clojure.data.json doesn't work there |
| 04:34 | Raynes | This channel is publicly logged btw, noprompt. |
| 04:34 | noprompt | point being? |
| 04:35 | noprompt | ;) |
| 04:35 | Raynes | Your company hatred is now google searchable. :p |
| 04:35 | noprompt | that's ok. they don't understand the internets. :P |
| 04:35 | Raynes | Heh |
| 04:35 | noprompt | and for the record, i don't actually hate the company. |
| 04:36 | noprompt | i work with great people. it's just that they have some weird approaches to solving problems. |
| 04:37 | noprompt | iamdrw: not sure. i guess i'd do (.toJSON (clj->js map)) |
| 04:37 | noprompt | or whatever the method is in javascript to convert an object to json. |
| 04:43 | iamdrw | I want to convert json to hash map, there is a js->cli, but it's not actualy what I want |
| 04:44 | iamdrw | like (json/read-str "{\"a\":1,\"b\":2}" |
| 04:44 | iamdrw | :key-fn keyword) |
| 04:44 | iamdrw | from clojure.data.json |
| 04:45 | iamdrw | but I can't use it from clojure script :( |
| 04:46 | noprompt | right. hmm. but i thought javascript had a json parser. |
| 04:46 | noprompt | as in from a string. |
| 04:47 | noprompt | sorry it's been a little bit since i messed with cljs, or even js. |
| 04:47 | noprompt | https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/parse |
| 04:48 | iamdrw | no parsing json is not a problem, but that gives me a js object |
| 04:48 | iamdrw | and I want that js object to be converted to clojure map |
| 04:48 | mpenet | (js->clj x) |
| 04:48 | noprompt | and (js->clj obj) doesn't work? |
| 04:49 | iamdrw | it works, but I want to have keys be a keywords instead of strings |
| 04:49 | iamdrw | and I don't wan't to do conversion two times |
| 04:50 | noprompt | in that case you may have to. |
| 04:51 | noprompt | but it makes sense to have them be strings. since this is valid json {"first name": "bob"} |
| 04:51 | iamdrw | maybe I'll stick with that |
| 04:52 | iamdrw | because parsing whole object is a bit slow for big objects |
| 04:52 | abp | Hell-o |
| 04:52 | noprompt | yeah, but you'd still have the same issue in raw js to btw. |
| 04:52 | noprompt | obj["first name"] |
| 04:53 | noprompt | but most of the js engines are pretty fast. you'd have to have a really large js obj for it to be slow. |
| 04:54 | noprompt | have you tried to mimic clojure.data.json? |
| 04:54 | noprompt | with stuff like :key-fn? |
| 04:54 | iamdrw | the problem is that I don't have a clojure server, yet |
| 04:55 | iamdrw | it's a pure clojurescript app |
| 04:56 | noprompt | have you used vagrant before? |
| 04:56 | noprompt | you could try it out on a fake server and get a feel for it. |
| 04:57 | noprompt | sometimes you have to do things twice. if there's a performance bottleneck then you worry. |
| 04:58 | noprompt | just brainstorming here. |
| 04:58 | mpenet | iamdrw: you can have the keys as keywords if you use (js->clj x :keywordize-keys) |
| 04:59 | mpenet | iamdrw: (js->clj x :keywordize-keys true) |
| 05:01 | noprompt | ah, good to know. wasn't aware of that. |
| 05:01 | noprompt | mpenet: but what about when the keys contain spaces? |
| 05:01 | noprompt | or worse symbols like @ or % |
| 05:01 | mpenet | ,(keyword "foo bar") |
| 05:01 | iamdrw | the json doesn't contain spaces |
| 05:01 | clojurebot | :foo bar |
| 05:01 | mpenet | you need to be careful |
| 05:02 | noprompt | ,(keyword "e@mail") |
| 05:02 | clojurebot | :e@mail |
| 05:02 | noprompt | whoa. |
| 05:03 | noprompt | oh, i'm thinking of symbols as being problematic. |
| 05:03 | iamdrw | @mpenet — that's exactly what I want |
| 05:03 | mpenet | noprompt: they arent I think, you have an example in mind? |
| 05:04 | noprompt | well i'm not completely sure but i know having the % and @ characters and even the : character in symbols can cause the clojure reader to complain |
| 05:05 | iamdrw | @noprompt in general it's a problem, but in my case I have json of defined structure returned by api |
| 05:06 | noprompt | hmm... well maybe not. i think that was a 1.4.0 problem |
| 05:06 | noprompt | seems to work fine in 1.5.0+ |
| 05:06 | Zerker | ,(keyword ":::") |
| 05:06 | clojurebot | :::: |
| 05:07 | noprompt | ,::: |
| 05:07 | clojurebot | #<RuntimeException java.lang.RuntimeException: Invalid token: :::> |
| 05:07 | noprompt | ,::: |
| 05:07 | noprompt | ,::: |
| 05:07 | noprompt | ,::: |
| 05:07 | noprompt | ,::: |
| 05:07 | clojurebot | #<RuntimeException java.lang.RuntimeException: Invalid token: :::> |
| 05:07 | clojurebot | #<RuntimeException java.lang.RuntimeException: Invalid token: :::> |
| 05:07 | clojurebot | #<RuntimeException java.lang.RuntimeException: Invalid token: :::> |
| 05:07 | noprompt | ,::: |
| 05:07 | clojurebot | #<RuntimeException java.lang.RuntimeException: Invalid token: :::> |
| 05:07 | clojurebot | #<RuntimeException java.lang.RuntimeException: Invalid token: :::> |
| 05:07 | noprompt | ,::: |
| 05:07 | clojurebot | #<RuntimeException java.lang.RuntimeException: Invalid token: :::> |
| 05:07 | Zerker | ,(:::) |
| 05:07 | clojurebot | #<RuntimeException java.lang.RuntimeException: Invalid token: :::> |
| 05:07 | noprompt | ,::: |
| 05:07 | clojurebot | #<RuntimeException java.lang.RuntimeException: Invalid token: :::> |
| 05:08 | noprompt | ,::: |
| 05:08 | clojurebot | #<RuntimeException java.lang.RuntimeException: Invalid token: :::> |
| 05:08 | noprompt | sorry |
| 05:08 | Zerker | ,(::) |
| 05:08 | clojurebot | #<RuntimeException java.lang.RuntimeException: Invalid token: ::> |
| 05:08 | noprompt | holy crap, i'm really sorry |
| 05:08 | Zerker | ,'(::) |
| 05:08 | clojurebot | #<RuntimeException java.lang.RuntimeException: Invalid token: ::> |
| 05:08 | noprompt | evil-mode fail....... |
| 05:08 | Zerker | ,(list (keyword ":")) |
| 05:08 | clojurebot | (::) |
| 05:09 | noprompt | reminds me of ruby |
| 05:09 | noprompt | where you can do stuff like "::".to_symbol but not :: |
| 05:10 | Zerker | ,(eval '(list ::)) |
| 05:10 | clojurebot | #<RuntimeException java.lang.RuntimeException: Invalid token: ::> |
| 05:10 | noprompt | ok i think i'm gonna turn off evil-mode in erc |
| 05:10 | Zerker | ,(quote (keyword ":")) |
| 05:10 | clojurebot | (keyword ":") |
| 05:11 | Zerker | ,(eval (cons 'quote (keyword ":")) |
| 05:11 | clojurebot | #<RuntimeException java.lang.RuntimeException: EOF while reading> |
| 05:12 | Zerker | Zerker: (eval (cons 'quote (keyword ":")) |
| 05:12 | noprompt | well that one actually makes sense |
| 05:12 | Zerker | ,(eval (cons 'quote (keyword ":"))) |
| 05:12 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 05:12 | Zerker | '(eval 1) |
| 05:13 | Zerker | ,(eval 1) |
| 05:13 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 05:13 | noprompt | oh man, i think i broke it. |
| 05:13 | noprompt | (dec noprompt) |
| 05:13 | lazybot | You can't adjust your own karma. |
| 05:13 | Zerker | ,(cons (keyword ":") (keyword "::")) |
| 05:13 | clojurebot | #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword> |
| 05:14 | noprompt | when i tried (eval (cons 'quote (keyword ":"))) |
| 05:14 | noprompt | i got: IllegalArgumentException Don't know how to create ISeq from: clojure.lang.Keyword clojure.lang.RT.seqFrom (RT.java:505) |
| 05:14 | noprompt | |
| 05:14 | Zerker | ,(cons (keyword ":") '()) |
| 05:14 | clojurebot | (::) |
| 05:14 | noprompt | weird |
| 05:15 | Zerker | I think evals are just prohibited, same as defs |
| 05:18 | noprompt | makes sense. |
| 05:24 | noprompt | weavejester: why is html a macro in hiccup? |
| 05:24 | Raynes | noprompt: Optimization purposes mostly, IIRC. |
| 05:24 | Raynes | noprompt: It generates as much of your HTML at compile-time as possible. |
| 05:26 | noprompt | interesting. that makes sense. i switched garden.core/css to a function today because i wasn't sure if i needed ito be a macro at this point. |
| 05:26 | noprompt | i'm not that advanced yet. |
| 05:27 | noprompt | i'm still trying to comprehend much of the hiccup source. |
| 05:32 | noprompt | well i'm out for the night. |
| 05:32 | Raynes | Night |
| 05:32 | noprompt | :) |
| 05:32 | noprompt | laters. |
| 05:50 | ordnungswidrig | re |
| 05:52 | abp | Any suggestions on how to store a ring app's configuration? I've got different environments like dev, test, staging, live. So I'm leaning towards having dev as a map of the basic configuration, merging in specific settings per environment. What environment the app is started in would be determined via an environment variable. (No set variable raises an error) |
| 05:52 | weavejester | abp: I tend to use environ |
| 05:57 | abp | weavejester: Yea, already seen environ. That seems more basic than what I need. Probably combined with carica I could do everything I think off. |
| 05:57 | abp | weavejester: Also, your clojure-toolbox is missing a config section. ;) |
| 05:59 | Raynes | Oh, I guess... |
| 05:59 | Raynes | weavejester: https://github.com/Raynes/leasdt |
| 05:59 | Raynes | Er. |
| 05:59 | Raynes | weavejester: https://github.com/Raynes/least |
| 05:59 | Raynes | Highly doubt you have a category for that one. |
| 05:59 | Raynes | But there it is nonetheless. |
| 06:00 | abp | Raynes: Web API Clients, your tentacles are in there. :P |
| 06:00 | Raynes | orly |
| 06:00 | Raynes | Well, that works then. |
| 06:17 | Raynes | $lfmassoc RaynesFM |
| 06:17 | lazybot | Associated your username. |
| 06:17 | Raynes | $last |
| 06:17 | lazybot | RaynesFM is listening to: Fall Out Boy - The Phoenix [Save Rock And Roll] |
| 06:18 | Raynes | Welp, that was about 4 hours of work. |
| 06:18 | Raynes | It's 3:17AM. I can't believe I stayed up this late working on that. |
| 06:18 | Raynes | I have to go to work in the morning. |
| 06:18 | clgv | Raynes: that's called passion ;) |
| 06:18 | Raynes | It's called stupidity. |
| 06:18 | Raynes | I just traded my well being tomorrow for a moment of pleasure tonight. :P |
| 06:18 | clgv | Thats what the unpassionate say ;) |
| 06:19 | Raynes | Sad part is that at least 2 of those 4 hours was fighting with vim-fireplace (found a couple of bugs). |
| 06:19 | clgv | that sucks |
| 06:22 | Raynes | Well. I'm going to sleep. Hard. |
| 06:22 | Raynes | Goodnight #clojure. |
| 06:27 | filippobo | hi there |
| 06:27 | filippobo | I have a seq of sets like: (def in '(#{1 6} #{3 4} #{2 5})) |
| 06:28 | filippobo | how can I get something like (def out '(1 6 3 4 2 5)) ? |
| 06:29 | clgv | good night raynes |
| 06:29 | clgv | ,(reduce into [] '(#{1 6} #{3 4} #{2 5})) |
| 06:29 | clojurebot | [1 6 3 4 2 ...] |
| 06:30 | filippobo | into is the key! |
| 06:30 | clgv | no guarantees on order though |
| 06:30 | hyPiRion | yeah |
| 06:30 | filippobo | thanks clgv ;-) |
| 06:31 | filippobo | ok... the sets are actually ordered-set |
| 06:31 | hyPiRion | ,(= (set (range -20 20)) (set (range 19 -21 -1))) |
| 06:31 | clojurebot | true |
| 06:31 | clgv | well, then you have a guarantee ;) |
| 06:31 | filippobo | sorted-set |
| 06:31 | hyPiRion | ,(= (seq (set (range -20 20))) (seq (set (range 19 -21 -1)))) |
| 06:31 | clojurebot | false |
| 06:44 | clgv | ,(= (seq (sorted-set (range -20 20))) (seq (sorted-set (range 19 -21 -1)))) |
| 06:44 | clojurebot | false |
| 06:45 | hyPiRion | ,(= (sorted-set (range -20 20)) (sorted-set (range 19 -21 -1))) |
| 06:45 | clojurebot | #<ClassCastException java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to java.lang.Comparable> |
| 06:45 | hyPiRion | aha! |
| 06:46 | hyPiRion | ,(= (apply sorted-set (range -20 20)) (apply sorted-set (range 19 -21 -1))) |
| 06:46 | clojurebot | true |
| 06:48 | clgv | ah damn. there was an asymmetrie... |
| 06:49 | hyPiRion | well |
| 06:49 | hyPiRion | set != hash-set |
| 06:57 | ambrosebs | hyPiRion: whats the difference? |
| 07:01 | hyPiRion | ,(set (range 5)) |
| 07:01 | clojurebot | #{0 1 2 3 4} |
| 07:02 | hyPiRion | ,(hash-set (range 5)) |
| 07:02 | clojurebot | #{(0 1 2 3 4)} |
| 07:02 | hyPiRion | ambrosebs: I was talking about the functions, not the specific classes :) |
| 07:02 | ambrosebs | Got it :) |
| 07:15 | samrat | Raynes: I'm getting a "Invalid method signature supplied" error in least while trying the `write` example in the readme |
| 07:26 | naeg | what's the reader sugar behind #"regex"? |
| 07:27 | hyPiRion | naeg: what do you ask? |
| 07:28 | hyPiRion | ,#"\d+" |
| 07:28 | clojurebot | #"\d+" |
| 07:28 | naeg | hyPiRion: actually I want to make a regex out of a normal string |
| 07:28 | hyPiRion | ,(re-find "1234 12421" #"\d+") |
| 07:28 | clojurebot | #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.util.regex.Pattern> |
| 07:28 | hyPiRion | whoops. |
| 07:28 | hyPiRion | naeg: oh, in that case you should probably use Pattern. |
| 07:29 | naeg | hyPiRion: btw, I found out what was wrong with my alpha-beta algorithm |
| 07:30 | hyPiRion | ,(java.util.regex.Pattern/compile "\\d+") ;; from string |
| 07:30 | clojurebot | #"\d+" |
| 07:30 | hyPiRion | oh? |
| 07:30 | naeg | (take-while cond (reductions ...)) doesn't work since |
| 07:30 | naeg | ,(last (take-while #(< % 100) [20 40 100 30])) |
| 07:30 | clojurebot | 40 |
| 07:30 | naeg | won't return the 100, which I actually wanted |
| 07:30 | naeg | had to use reduce/reduced now |
| 07:31 | hyPiRion | oh |
| 07:32 | Zerker | ,(first (take-while #(>= % 100) [20 40 100 30])) |
| 07:32 | clojurebot | nil |
| 07:33 | Zerker | ,(doc take-until) |
| 07:33 | clojurebot | Cool story bro. |
| 07:33 | hyPiRion | heheh |
| 07:33 | hyPiRion | drop-while |
| 07:34 | hyPiRion | ,(drop-while #(< % 100) [20 40 100 30]) |
| 07:34 | clojurebot | (100 30) |
| 07:34 | Zerker | naeg: ^? |
| 07:34 | naeg | Zerker: but can't use drop-while either, since that will realize the calls returned by (reductions ...) |
| 07:35 | naeg | were I put numbers in that example, there are actually function calls which where not realized yet, and should not be realized more than needed |
| 07:35 | Zerker | drop-while isn't lazy? |
| 07:36 | naeg | it is, but still the 30 is realized when you do |
| 07:36 | naeg | ,(first (drop-while #(< % 100) [20 40 100 30])) |
| 07:36 | clojurebot | 100 |
| 07:36 | naeg | ...I think |
| 07:36 | naeg | checking... |
| 07:38 | hyPiRion | Zerker: it's the common issue |
| 07:38 | hyPiRion | ,(take 1 (map #(do (pr \.) 0) (range))) |
| 07:38 | clojurebot | #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval35$fn> |
| 07:38 | hyPiRion | ,(take 1 (map #(do (pr \.) %) (range))) |
| 07:38 | clojurebot | (\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.0) |
| 07:38 | hyPiRion | it's semilazy |
| 07:40 | naeg | ,(drop-while #(< % 100) (reductions #(do (println %) (inc %2)) [98 99 100 101])) |
| 07:40 | clojurebot | (98\n100\n100 101\n101 102) |
| 07:40 | naeg | see, the call with 101 as arg is realized too |
| 08:49 | gdev | good morning fellow clojurist for whom the hour is indeed morning, else good afternoon or evening |
| 08:56 | gdev | , ((comparator >) 1/3 0.3333333333333333) |
| 08:56 | clojurebot | 0 |
| 08:56 | gdev | , ((comparator >) 1/3 0.333333333333333) |
| 08:56 | clojurebot | -1 |
| 08:57 | namespace | (Please note, I have no way of evaluating the strength of this code, so I'm assuming it's bad.) |
| 08:57 | namespace | http://pastebin.com/WQPsDwJj |
| 08:58 | namespace | I'm trying to print every line that ends with a question mark, and then print every line before it until one starts with an upper case letter. |
| 08:59 | namespace | The error message I get is "ClassCastException java.lang.Long cannot be cast to clojure.lang.IFn " which I read means I can't cast a long to a function. |
| 09:00 | dnolen | namespace: it means you're trying to invoke a number as a function |
| 09:00 | dnolen | ,(1 'foo) |
| 09:00 | clojurebot | #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn> |
| 09:00 | namespace | Right. |
| 09:00 | namespace | I don't see where I'm doing that. |
| 09:05 | dnolen | namespace: might be easier to see what's going if you provided the inputs you're using |
| 09:06 | namespace | That's the problem. |
| 09:06 | namespace | They're probably under copyright. |
| 09:06 | namespace | -_- |
| 09:06 | dnolen | namespace: I'm sure you can come up w/ sample inputs that don't infringe |
| 09:06 | namespace | Okay. |
| 09:08 | clgv | namespace: you should definitely lean about "let" |
| 09:08 | clgv | *learn |
| 09:08 | namespace | clgv: Noted. |
| 09:09 | clgv | there are far too many repetitions in your code snippet |
| 09:09 | namespace | I know about it, but don't know how it would help here. |
| 09:09 | clgv | namespace: better code is easier to understand by other |
| 09:09 | namespace | I'm sure when you point it out I'll go "Oh, I see, I'm dumb.". |
| 09:10 | dnolen | namespace: you have a lot of code duplication, (first ln) (last ln) |
| 09:10 | dnolen | namespace: https://gist.github.com/swannodette/5420253 |
| 09:11 | namespace | So that's how I'm supposed to indent it. |
| 09:12 | dnolen | namespace: update to remove all repeated (get vec f). that's how I would indent it anyways. |
| 09:12 | clgv | (get vec f) should also be calculated only once ^^ |
| 09:12 | namespace | http://pastebin.com/5Bndgr0x Sample input |
| 09:13 | dnolen | namespace: but what parameter is that, your function takes two arguments |
| 09:14 | namespace | vec |
| 09:14 | dnolen | namespace: and what is the first argument? |
| 09:14 | dnolen | namespace: can't test your fn w/o know both |
| 09:14 | dnolen | knowing |
| 09:14 | namespace | Right. |
| 09:14 | namespace | (0 1) |
| 09:16 | dnolen | namespace: do you mean '(0 1) ? |
| 09:16 | namespace | So it should print everything except "And in other news..." |
| 09:16 | namespace | Maybe. |
| 09:17 | noncom | so i'm like trying to include a simple jar (not anywhere on clojars or sonatype but local) into a lein project |
| 09:17 | dnolen | namespace: yes or no? if you're inputing (0 1) that's the source of your error right there. |
| 09:17 | dnolen | ,(0 1) |
| 09:17 | clojurebot | #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn> |
| 09:17 | namespace | I don't know. |
| 09:18 | noncom | and in lein deps it says that it cannot get it since there is a typo in :dependencies or network issue |
| 09:18 | namespace | And thinking about it, yes. |
| 09:18 | dnolen | namespace: well I can't help you if you don't know :) |
| 09:18 | namespace | It's definitely the problem. |
| 09:18 | namespace | Thank you. |
| 09:18 | noncom | i followed this guide : http://www.pgrs.net/2011/10/30/using-local-jars-with-leiningen/ |
| 09:18 | dnolen | namespace: you're also going to get null pointer exceptions in your code |
| 09:18 | dnolen | namespace: ((print x) (questions (cons (inc l) l) vec)) |
| 09:19 | dnolen | print returns nil |
| 09:19 | namespace | Oh. |
| 09:19 | dnolen | and then you try to invoke it |
| 09:19 | dnolen | you probably want: |
| 09:19 | dnolen | (do (print x) (questions (cons (inc l) l) vec)) |
| 09:19 | namespace | Yes, yes I do. |
| 09:21 | namespace | Notes for the future: 1. Look up how to indent. 2. Use let to shorten things I do more than once. 3. Use do. 4. Provide input along with the function. Did I get everything? |
| 09:23 | dnolen | namespace: the purpose of the ln parameter seems a bit convoluted. I'd look into eliminating it |
| 09:23 | namespace | Oh right. |
| 09:23 | namespace | I took that as a given. |
| 09:25 | dnolen | namespace: also on large enough inputs your program will probably stackoverflow. it appears it will do that anyway as I don't see a terminal condition and every branch recursively calls questions again. |
| 09:26 | namespace | The terminal condition is "the program crashes". It's standalone. |
| 09:27 | noncom | so anyone knows how to link not maven-enabled jars to a lein project? |
| 09:27 | joegallo | noncom: mvn install them |
| 09:29 | joegallo | FAQ #4 https://github.com/technomancy/leiningen/blob/master/doc/FAQ.md |
| 09:32 | clgv | noncom:better do not - it is easy to add them to clojars. I have done that twice |
| 09:36 | noncom | mvn install or lein install gives errors... andidk how to push to clojars since it is a java lib |
| 09:37 | noncom | if you point to an instruction, i think it will help |
| 09:37 | clgv | noncom: just write a minimal pom and "scp" the jar with he pom to clojars |
| 09:37 | noncom | i did this: "mvn install:install-file -Dfile=jaad-0.8.3.jar -DartifactId=jaad -Dversion=0.8.3 -DgroupId=jaad -Dpackaging=jar -DlocalRepositoryPath=maven_repository" and maven created a pom |
| 09:38 | noncom | so there is one. does it have to be in the same folder as the jar? |
| 09:39 | joegallo | yes |
| 09:39 | joegallo | it's doesn't just know where random jar files are on your machine |
| 09:40 | clgv | noncom: just do "scp jaad.pom jaad-0.8.3.jar clojars@clojars.org" provided you have an account at clojars and your user accoutns public ssh key is registered there |
| 09:40 | noncom | well it created the folder structure itself so i presumed it knew where all things are |
| 09:40 | clgv | noncom: https://github.com/ato/clojars-web/wiki/Pushing#ssh |
| 09:41 | clgv | oops pom.xml it is ;) |
| 09:41 | noncom | joegallo: whatever i do, even putting both the jar and the pom into the same dir, now, mvn install yields this: [ERROR] The goal you specified requires a project to execute but there is no POM in this directory |
| 09:42 | noncom | clgv: i'll try that! first i have to register on clojars and get the ssh though ))) |
| 09:42 | noncom | i'm rather new to clojure so nothing is ready yet |
| 09:43 | clgv | noncom: are you on a linux machine? |
| 09:44 | noncom | clgv: nope) it'swin7 |
| 09:44 | noncom | here is the pom that it generated: http://pastebin.com/UJBvRTBn, the library is named minim-2.1.0.jar |
| 09:44 | noncom | theyre in the same folder... |
| 09:45 | noncom | ehh... intended to be simple, but still lots of convolute things |
| 09:45 | noncom | maybe there is some definite instruction on that.. there should be some standard way of deadling with this, no? |
| 09:47 | noncom | i'll also try the ssh way now, i know how to make it work on windows, i did it before |
| 09:48 | clgv | :) |
| 09:48 | noncom | but why so hard... |
| 09:48 | joegallo | because you're doing something out of the ordinary |
| 09:49 | noncom | sure, i trust you, but i can't believe that using arbitrary java jars in my project on java machine is not ordinary :D |
| 09:50 | joegallo | you're right, i tell lies to newbies on the internet just for fun |
| 09:50 | noncom | :DDD |
| 09:52 | joegallo | https://gist.github.com/anonymous/aa0556dd7dbacd1e0a7e/raw/76ed293ad6b658cff154878e813d7c2d763895d2/gistfile1.txt |
| 09:52 | joegallo | i dunno what to tell ya, buddy, it works fine here |
| 09:59 | noncom | joegallo: ok i did that the last time and it created the pom. now i did it again with your command (like removing .0 in the version which is like insignificant)... and the report is the same as yours - all success, but lein deps gives errors. here is the pastebin with the lein error and my project.clj file: http://pastebin.com/D7Jytnjx |
| 10:02 | namespace | Another stupid question: Is there a lib I need to load at runtime to get the clojure interop? |
| 10:02 | clgv | noncom: if you install it only locally I hope you have only one development machine and it's a private project ;) |
| 10:03 | borkdude | namespace interop from java or what? |
| 10:23 | noncom | TimMc: yeah, agree. just have to accustomize myself with the system. see i'm coming from a stone age when jars were plugged-in manually. hey i used sbt for scala but there are not problems like that.. |
| 10:23 | noncom | internet repository i consider a major good since it helps centralization and is a result of evolution |
| 10:25 | TimMc | More importantly, it helps with repeatability. |
| 10:25 | TimMc | ~repeatability |
| 10:25 | clojurebot | repeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability |
| 10:27 | noncom | ooh!) |
| 10:27 | mefesto | is there a definitive index of ClojureScript libraries? |
| 10:50 | mefesto | in clojurescript, is there a built-in function for converting a NodeList to a seq or vector? |
| 10:53 | gdev | is there a schedule for the google hangout sessions? I always see those posted after they're over. |
| 11:00 | dnolen | mefesto: no but you can easily extend NodeList to ISeq, ILookup etc yourself. |
| 11:00 | ppppaul | when would i use reverse over rseq? |
| 11:00 | mefesto | dnolen: ok thanks |
| 11:01 | noncom | what is the idiomatic way in clojure to name variables whose names collide with standard ones. like i have a fn argument named "name" |
| 11:02 | dnolen | ppppaul: reverse calls rseq |
| 11:02 | mpenet | noncom: in most case I wouldn't bother, unless you need clj.core/name in your fn |
| 11:08 | ppppaul | on clojuredocs the source says otherwise |
| 11:08 | ppppaul | maybe this has changed past 1.3 |
| 11:08 | noncom_ | mpenet: yeah, i mostly don't but this is the case.. so ok, i just make some prefix i think |
| 11:13 | tmciver | noncom_: the way to exclude a name is like this: http://clojuredocs.org/clojure_core/1.2.0/clojure.core/refer-clojure |
| 11:14 | noncom_ | yeah... |
| 11:20 | naeg | how to [0 1 2 3] => [[0 1] [2 3]]? |
| 11:20 | naeg | it's so simple, but can't remember... |
| 11:20 | ucb | ,(doc partition) |
| 11:20 | clojurebot | "([n coll] [n step coll] [n step pad coll]); Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection is supplied, use its elements as necessary to complete last partition upto n items. In case there are not enough padding elements, return a partition with less than n items." |
| 11:20 | ucb | naeg: ^^^ |
| 11:20 | naeg | ucb: thanks! I remember now... |
| 11:29 | AndChat718256 | ,(doc seq) |
| 11:29 | clojurebot | "([coll]); Returns a seq on the collection. If the collection is empty, returns nil. (seq nil) returns nil. seq also works on Strings, native Java arrays (of reference types) and any objects that implement Iterable." |
| 11:33 | joegallo | ucb: ##(seq (apply hash-map [0 1 2 3])) ; the subtle bugs this would result in would so amazingly devious |
| 11:33 | lazybot | ⇒ ([0 1] [2 3]) |
| 11:34 | ucb | heh - nice joegallo |
| 11:34 | joegallo | we really need an evil bot to answer questions with misleading code that happens to work for their simple answer |
| 11:34 | ucb | isn't there a findfn thing that'll do something like that already? |
| 11:34 | joegallo | well, it give non-evil answers, too |
| 11:35 | ucb | yeah |
| 11:38 | TimMc | joegallo: ##(trampoline + 2 3) |
| 11:38 | lazybot | ⇒ 5 |
| 12:04 | technomancy | joegallo: lazybot answers a bunch of questions in the negative; that could be considered evil |
| 12:11 | gunface | Is there anyway to connect privately to the clojurebot so that everyone doesn't see my error messages? :P |
| 12:11 | gdev | yeah, hit ctrl+alt + t, type lein repl, hit enter |
| 12:11 | hiredman | it's called "a repl" you can even run it on your computer |
| 12:13 | tpope | Raynes: pong (already rolled back the problematic commit) |
| 12:21 | TimMc | gunface: Private-message it. |
| 12:22 | TimMc | But yes, `lein repl` also works surprisingly well as a repl. :-P |
| 12:22 | technomancy | eh; it's all right I guess |
| 12:24 | rkh | Hehehe. |
| 12:24 | gunface | Yeah but I am on my android far away from lein :P |
| 12:24 | gdev | theres an android repl app |
| 12:25 | gunface | There is :O |
| 12:25 | gdev | https://play.google.com/store/apps/details?id=com.sattvik.clojure_repl&hl=en |
| 12:27 | gdev | Daniel Solano Gomez also did a talk about getting clojure on android which is on youtube |
| 12:29 | gunface | gdev you just made my commutes so much more fun :) |
| 12:29 | gunface | Thanks a lot |
| 12:29 | gunface | And yeah will check that talk |
| 12:31 | luxbock | I'm learning Clojure (and programming in general) by creating an application for analyzing poker hands |
| 12:32 | luxbock | atm I'm working on interpreting handranges (for example: AK, ATs would be a range that includes all combinations of Ace King, and Ace Ten suited) |
| 12:32 | luxbock | here are the full list of hand range macros I have in mind: https://www.refheap.com/paste/13773 |
| 12:33 | ToBeReplaced | i just did my first clojars release! https://github.com/ToBeReplaced/jdbc-format ... high-fives? |
| 12:33 | luxbock | so these are all strings that then get translated to the proper card data type representation (they are just vectors) |
| 12:34 | luxbock | I figured that before I jump to the task at hand, I should ask here about what's the best way to go about implementing it |
| 12:34 | luxbock | should I just use regex or are there alternatives to that? |
| 12:35 | nz | luxbock: last night I saw a presentation on how to do poker hand detection using core.logic https://github.com/PasiHeikkinen/poker |
| 12:35 | luxbock | oh cool |
| 12:35 | nz | luxbock: which is not the way to go if you need any kind of speed |
| 12:36 | TimMc | ToBeReplaced: Sweet! Did you sign it? |
| 12:37 | luxbock | yeah speed is definitely an issue further down the road |
| 12:38 | nz | luxbock: some links: http://spaz.ca/poker/ http://poker.cs.ualberta.ca/ |
| 12:39 | luxbock | yep, I've read their stuff before |
| 12:40 | luxbock | though now my focus is more on how to learn how to program and less on how to play poker :) |
| 12:40 | ToBeReplaced | TimMc: no i didn't; can you link me somewhere to learn about that? |
| 12:43 | rboyd | luxbock: so this is for classifying holdem starting hands/hole cards? |
| 12:43 | luxbock | yep |
| 12:43 | rboyd | luxbock: there's https://github.com/jamesmacaulay/poker-hands for ranking 5 card hands. also a pr in there from me on finding the best 5 of 7 |
| 12:43 | rboyd | not exactly what you're trying to do but maybe useful later |
| 12:45 | luxbock | thanks |
| 12:45 | TimMc | ToBeReplaced: `lein help gpg`, or https://github.com/technomancy/leiningen/blob/stable/doc/GPG.md |
| 12:45 | TimMc | Basically, create a GPG keypair and use lein deploy. (This is all lein 2.) |
| 12:46 | TimMc | Once everything is set up it is easy-peasy. |
| 12:47 | ToBeReplaced | i guess it auto-signs on lein deploy clojars? |
| 12:49 | ToBeReplaced | is there a way to sign a version already uploaded? |
| 12:49 | xeqi | ToBeReplaced: yep, trying to make it easy |
| 12:49 | xeqi | and no, but would you really want to sign a jar that was on the internet |
| 12:50 | ToBeReplaced | good point |
| 12:50 | xeqi | though atm you do have to assume we're not messing with the jars to use the ecosystem :p |
| 12:51 | TimMc | ToBeReplaced: The easiest thing to do is make another commit bumping the version number at the patch level ("bugfix: jar was not signed") and then lein deploy that. |
| 12:51 | ToBeReplaced | where can you see whether or not something was signed? i had filled out my ssh public key prior to deploy |
| 12:52 | TimMc | xeqi: I can see a potential problem here for people who are doing their first signing. |
| 12:52 | xeqi | there is a .asc file in the repo, I really should add some sorta flair to the artifact page for signed / releases repo stuff |
| 12:53 | TimMc | Try to deploy; signing fails; can't re-deploy over artifact; bump the version; try to deploy the new version; signing fails for another and exciting reason... |
| 12:54 | xeqi | TimMc: the signing happens before the push to the server |
| 12:54 | xeqi | all the server does is save the files, all the logic is client side |
| 12:54 | technomancy | TimMc: you don't have to bump the version number ATM |
| 12:54 | technomancy | we're just discussing making that change; hasn't happened yet |
| 12:55 | technomancy | you can just redeploy currently |
| 12:59 | ToBeReplaced | hm... so i definitely didn't add a gpg key before deploying... but it is showing up as signed with lein deps :verify; if i filled out ssh public key, does that count as a signature? |
| 13:00 | xeqi | ToBeReplaced: no, that just lets you deploy wit hssh, which used to be the normal way to do it |
| 13:00 | technomancy | ToBeReplaced: whether it's signed is different from whether clojars can verify the signature server-side |
| 13:00 | technomancy | ToBeReplaced: for Clojars to verify, it needs your gpg key to be added to your profile |
| 13:00 | technomancy | but it will happily serve a signature you deploy without verifying it |
| 13:00 | xeqi | it appears that you did sign it https://clojars.org/repo/jdbc-format/jdbc-format/0.1.0/ |
| 13:03 | ToBeReplaced | so i assume that since i already had a gpg pair, lein deploy clojars signed the jar... then when i added my pub key to my clojars profile, it was able to verify? |
| 13:04 | TimMc | technomancy: But once overwriting is prevented, this could become an issue. |
| 13:05 | technomancy | indeed |
| 13:05 | TimMc | I guess if you can prevent the deploy if signing fails, it's all good. |
| 13:07 | ToBeReplaced | is there a thread where i can read about the decision for clojars to use gpg? |
| 13:08 | augustl | anyone got some favorite clojure swag webshops? :) |
| 13:09 | technomancy | ToBeReplaced: all the infrastructure around Maven assumes GPG, and it has hands-down the best tooling for this kind of thing |
| 13:10 | technomancy | ToBeReplaced: do you mean GPG vs another signing mechanism, or do you mean the decision to encourage signing in general? |
| 13:10 | ToBeReplaced | both? i'm not sure what i'm asking... i don't know what factors come into play |
| 13:11 | ToBeReplaced | i'm just kinda surprised by me having signed something without knowing it |
| 13:14 | technomancy | it didn't prompt you for your passphrase? |
| 13:14 | technomancy | but yeah, I think the output could be clearer |
| 13:15 | TimMc | ToBeReplaced: I didn't like it using my regular GPG key for software signing, so I added a key selection patch. It was a bit startling. |
| 13:15 | ToBeReplaced | technomancy: it did, you're right |
| 13:16 | technomancy | it could definitely be clearer about why it's asking |
| 13:17 | ToBeReplaced | you know, i think i was just confused; it all seems to make sense now |
| 13:18 | technomancy | there's kind of a lot going on |
| 13:19 | technomancy | I wonder if we could de-emphasise the SSH pubkey section of the profile |
| 13:19 | billy_bodacious | im using lein ring uberjar but it throws a classnotfound exception regarding a require in a ns, where as lein uberjar works fine, anyone have a clue as to why |
| 13:19 | ToBeReplaced | i got confused because of the combination of ssh and gpg |
| 13:19 | technomancy | ToBeReplaced: SSH is legacy |
| 13:20 | weavejester | billy_bodacious: lein uberjar doesn't necessarily compile anything, but lein ring uberjar currently works using an AOT-compiled servlet class |
| 13:20 | ToBeReplaced | i probably glossed over the gpg thinking it was ssh -- is there any reason to keep an ssh pub key in my clojars profile now? |
| 13:20 | ToBeReplaced | since no scp etc. |
| 13:20 | weavejester | Really it should probably use a static java class that calls the Clojure code, but I haven't got around to writing that |
| 13:20 | TimMc | lein 1 |
| 13:20 | billy_bodacious | weavejester: so how do i start to fix this? |
| 13:22 | billy_bodacious | weavejester: i can run lein repl and require it.. it even works fine with lein ring server |
| 13:22 | tieTYT2 | hi weavejester: maybe you can help me with my issue: http://stackoverflow.com/questions/16094439/is-it-possible-to-build-a-ring-webapp-in-an-already-existing-javaee-project |
| 13:22 | technomancy | ToBeReplaced: we don't want to remove scp for people who are currently using it |
| 13:23 | weavejester | billy_bodacious: I'd have to see the full error |
| 13:23 | technomancy | ToBeReplaced: but we could move it to an "advanced" section or something |
| 13:24 | weavejester | tieTYT2: No idea I'm afraid. I know servlets pretty well, but little beyond that in the Java web development stack. |
| 13:24 | tieTYT2 | aw :( ok |
| 13:26 | tieTYT2 | since I can't use compojure at work, I'm thinking of cheating and making a library called clojersey that converts compojure-like code into jersey resources |
| 13:26 | billy_bodacious | weavejester: http://pastebin.com/NBees1gW |
| 13:28 | weavejester | billy_bodacious: Hm, doesn't really have much useful information there… Have you tried a "lein clean"? Perhaps there's some old servlet class file screwing things up. |
| 13:28 | xeqi | technomancy: agreed re: demphasizing ssh key. want to make an issue? |
| 13:28 | billy_bodacious | weavejester: yes i have |
| 13:30 | weavejester | billy_bodacious: Hum, no idea what the issue is. It's strange that the NPE is triggered by the compiler… What does your project file look like? |
| 13:32 | billy_bodacious | weavejester: http://pastebin.com/Lemfxzqv |
| 13:32 | weavejester | billy_bodacious: There's no lein-ring plugin in that project file... |
| 13:32 | billy_bodacious | its in my global profile |
| 13:33 | billy_bodacious | does it need to be in the project file? |
| 13:33 | weavejester | billy_bodacious: Well, it's possible to put it in the global profile, but it doesn't make much sense to do so |
| 13:34 | weavejester | billy_bodacious: Presumably you've also put the lein-ring configuration for your project in your global profile as well? |
| 13:34 | billy_bodacious | weavejester: no additional configuration in there |
| 13:35 | weavejester | billy_bodacious: So where's your :ring {:handler my.app.blah/handler} ? |
| 13:35 | billy_bodacious | oh the last line got cutoff in the past |
| 13:35 | billy_bodacious | it's: :ring {:handler overdue-invoices.core/handler}) |
| 13:36 | billy_bodacious | i added ring to the plugins but still got the same error |
| 13:37 | weavejester | billy_bodacious: You could try adding lein-ring to the project.clj file. I can't think why that would make a difference, but it's worth reducing the number of unusual elements. |
| 13:37 | weavejester | billy_bodacious: What version are you using? 0.8.3? |
| 13:38 | billy_bodacious | weavejester: yea |
| 13:38 | weavejester | Try removing it from your global profile and putting it in your project.clj. |
| 13:39 | billy_bodacious | just a second |
| 13:40 | billy_bodacious | same error |
| 13:41 | billy_bodacious | just doing lein compile overdue-invoices.core gives the same error, so i guess its not related to the ring plugin |
| 13:41 | weavejester | billy_bodacious: Ahh, that would explain things. |
| 13:42 | weavejester | Well, at least why lein-ring can't compile it |
| 13:52 | gdev | ToBeReplaced:) I'm working on a small clojure project that hits a relational database so I'll try out your jdbc-format library. |
| 14:00 | technomancy | xeqi: ah, you created it; thanks |
| 14:03 | ToBeReplaced | gdev: that would be cool! i'd appreciate the feedback |
| 14:03 | clojure-new | hello |
| 14:03 | clojure-new | ,(pmap (fn [_] (println "Downloading ")) (range 3)) |
| 14:03 | clojurebot | #<SecurityException java.lang.SecurityException: no threads please> |
| 14:03 | clojure-new | &(pmap (fn [_] (println "Downloading ")) (range 3)) |
| 14:03 | lazybot | java.lang.SecurityException: You tripped the alarm! pmap is bad! |
| 14:04 | billy_bodacious | weavejester: i think i have fixed it, but now uberwar just seems to hang forver, it almost looks like its running my project.. |
| 14:04 | rasmusto | lazybot: pmap isn't necessarily bad always |
| 14:04 | clojure-new | anyway, why does println in pman doesn't insert newlines like it does without pmap? |
| 14:04 | weavejester | billy_bodacious: One of your source files probably blocks when it's evaluated. |
| 14:05 | weavejester | billy_bodacious: When Clojure compiles things, it evaluates the whole namespace |
| 14:05 | clojure-new | it inserts it in random way. |
| 14:05 | clojure-new | for example |
| 14:05 | clojure-new | (pmap (fn [_] (println "a")) (range 3)) => aaa\n\n\n |
| 14:05 | clojure-new | or |
| 14:05 | clojure-new | (pmap (fn [_] (println "a")) (range 3)) => aa\na\n\n |
| 14:06 | clojure-new | how can i print something inside pmap? |
| 14:06 | Glenjamin | you probably need a thread-safe output stream of some sort |
| 14:06 | Glenjamin | why do you need to print in a pmap? |
| 14:07 | weavejester | clojure-new: pmap runs things from multiple threads. When multiple threads are writing to stdout, they can overlap. |
| 14:07 | clojure-new | weavejester: oh, i see, thanks. |
| 14:07 | clojure-new | Glenjamin: just info messages about how well my functions are doing their job. |
| 14:08 | jjido | trying to understand how it works maybe |
| 14:08 | clojure-new | is there any thread safe println in clojure? |
| 14:08 | weavejester | Not to my knowledge. Nor in Java. It's not something that people typically need. |
| 14:09 | Glenjamin | logging frameworks usually would be |
| 14:09 | jjido | logging |
| 14:09 | weavejester | Oh, that's true |
| 14:09 | Glenjamin | http://stackoverflow.com/questions/565893/best-practices-for-java-logging-from-multiple-threads |
| 14:10 | clojure-new | Glenjamin: thanks@ |
| 14:10 | clojure-new | ! |
| 14:11 | amalloy | haha guys, andy's tickets-needing-work email introduced me to a neat bug: |
| 14:11 | amalloy | &[do 1 2 3 4] |
| 14:11 | lazybot | ⇒ 4 |
| 14:11 | Glenjamin | i'm not very familiar with the clojure logging options, but that page describes the general idea |
| 14:12 | technomancy | whoa |
| 14:12 | Glenjamin | thats weird o.O |
| 14:12 | Glenjamin | i guess that's only with do? |
| 14:12 | technomancy | oh! |
| 14:12 | technomancy | because of the gilardi scenario workaround |
| 14:12 | technomancy | that's bonkers; I love it |
| 14:12 | amalloy | technomancy: what workaround? |
| 14:13 | technomancy | amalloy: the reason (do (require 'clojure.set) clojure.set/join) doesn't asplode |
| 14:13 | technomancy | do is special-cased by eval to split it apart and doseq over evaling each part individually |
| 14:17 | jjido | is this only in eval scenario ? |
| 14:17 | technomancy | jjido: yeah |
| 14:18 | technomancy | also only works with top-level do |
| 14:26 | TimMc | technomancy: But it doesn't need to work with sets and vectors, right? |
| 14:26 | technomancy | TimMc: yeah, looks like that's accidental |
| 14:27 | TimMc | &#{(println "of") do (do :z/h283r (println "order")) (do :b121 (println "out"))} ;; amalloy |
| 14:27 | lazybot | ⇒ out of order nil |
| 14:27 | TimMc | (keywords are there to make the hashes order properly) |
| 14:28 | technomancy | hah; nicely done |
| 14:33 | TimMc | &(let [_ :_] #{[-1] [[1]] do}) ;; and you're right, it's onlt at the top level |
| 14:33 | lazybot | java.lang.RuntimeException: Unable to resolve symbol: do in this context |
| 14:33 | TimMc | &'(let [_ :_] #{[-1] [[1]] do}) |
| 14:33 | lazybot | ⇒ (let [_ :_] #{do [-1] [[1]]}) |
| 14:34 | Raynes | tpope: Pingsies. |
| 14:36 | TimMc | Wow, the Conj is going to be in DC! |
| 14:36 | TimMc | Freaking finally. |
| 14:37 | Raynes | DC scares me. |
| 14:37 | Raynes | I don't like things that are both not a country and not a US state at the same time. |
| 14:37 | TimMc | Like Puerto Rico? |
| 14:37 | mynomoto | what's the best way to setup autotests in clojure? I'm using inotify with 'lein test' but it's slow. |
| 14:37 | TimMc | How about Antarctica? |
| 14:38 | mefesto | lol |
| 14:38 | mefesto | what a funny discussion to drop in on |
| 14:39 | technomancy | mynomoto: most people do it from within the editor/ide |
| 14:39 | technomancy | in emacs you can hook up an after-save-hook |
| 14:40 | mynomoto | technomancy: but the hook will call 'lein test'? |
| 14:41 | technomancy | mynomoto: no, you'd trigger it over nrepl |
| 14:41 | technomancy | so it doesn't have to start a new JVM |
| 14:41 | technomancy | mynomoto: the biggest problem is there's no way to reliably tell given a changed file which tests need to run |
| 14:42 | technomancy | (which is not in any way specific to clojure) |
| 14:42 | mynomoto | technomancy: but it reloads every file to rerun the tests? |
| 14:44 | technomancy | mynomoto: it's up to you; you can write the hook however you like |
| 14:45 | technomancy | typically you'd try to determine a test namespace; load it with :reload-all, and run its tests |
| 14:46 | wjlroe | If a library depends on an old clojure in its project.clj, and you depend on it - do you have to specify a exclusion for that dep in your project so as to use the version of clojure you want? |
| 14:47 | mynomoto | technomancy: thanks, I will try that. |
| 14:54 | technomancy | wjlroe: unless a dependency defines a version range you will be fine |
| 14:54 | technomancy | wjlroe: if you're having trouble figuring out what's going on, the lein-pedantic plugin is helpful there |
| 14:55 | wjlroe | technomancy: oh ok brilliant. It just so happens I'm using quickbeam in something |
| 14:55 | technomancy | wjlroe: oh dear... that was a rather hurried hack =) |
| 14:55 | technomancy | don't set your expectations too high |
| 14:56 | wjlroe | technomancy: it seems to be the only clojure lib for accessing git though - but it's simple enough to extend it to support more of JGit, my needs are modest anyway, just want listing branches/tags and reading files in different branches like that |
| 14:57 | technomancy | there's another one IIRC |
| 14:57 | technomancy | which has had more than 2 hours of work put into it =) |
| 14:57 | technomancy | but happy to take pull requests if you'd like to extend it further |
| 14:58 | wjlroe | the problem of googling for "clojure git" is that the results are utterly meaningless :) |
| 15:00 | wjlroe | oh ok just found https://github.com/clj-jgit/clj-jgit |
| 15:05 | jweiss | i have a forward declaration in my namespace. trying to compile it fails (as expected), but (require 'my-ns) works, even on a fresh repl |
| 15:05 | jweiss | oh wait, i get it |
| 15:05 | jweiss | it bails out of the forward decl the first time but the 2nd time it exists |
| 15:06 | jweiss | no.. wait, it still couldn't evaluate the thing that it is missing |
| 15:06 | SegFaultAX | This is way offtopic, but I have to share it: http://boingboing.net/2013/04/18/what-happens-when-you-wring-ou.html |
| 15:07 | jweiss | how is it nrepl-compiling fails but require works |
| 15:07 | jweiss | it partially loaded it the first time so require thinks nothing more needs to be done? |
| 15:11 | ppppaul | i love memoize |
| 15:14 | tpope | Raynes: sup |
| 15:16 | gdev | Raynes:) Reply from tpope: bytes=32 time=3 hours TTL=4ever |
| 15:18 | tpope | I am replying to his ping from less than an hour ago |
| 15:18 | tpope | but thanks peanut gallery |
| 15:25 | gdev | tpope:) it was just a joke, no need to go and insult the whole gallery like that |
| 15:35 | antares_ | Welle 1.5 is released: http://blog.clojurewerkz.org/blog/2013/04/19/welle-1-dot-5-0-is-released/ |
| 15:46 | mefesto | clojurescript is so cool :) |
| 15:47 | mefesto | do most people stick with the gclosure libs or use jquery and other things with cljs? |
| 15:48 | mefesto | obviously you could do either but im just wanted to get a feel for what the pros are doing |
| 15:48 | mpenet | mefesto: a bit of both, some use angular too, there is no rule really |
| 15:48 | mpenet | closure is easy to reach, there is that. |
| 15:48 | mefesto | mpenet: any best practices emerging yet that you know of? |
| 15:49 | mpenet | I don't think so. |
| 15:49 | mpenet | there are some "neutral" libs that are good in any context I think, such as hiccup like templating and stuff like that |
| 15:50 | mpenet | but this is very subjective, some prefer other ways |
| 15:59 | mynomoto | Someone know why this does't work? (clojure.java.shell/sh "inotifywait -qq -r -e modify,moved_to,create src test") |
| 15:59 | tgoossens | I don't know how rich hickey manages it but for a month now i've been experimenting with static methods all in my project (annoying a lot of people of my team). And by now i get the feeling that after all it is still a bad idea to use static methods frequently |
| 15:59 | asteve | (map symbol ["?value_id" "?value_ts" "?timestamp"]); I need the result to ?value_id ?value_ts ?timestamp |
| 15:59 | asteve | but map symbol … returns a list with the symbols |
| 16:01 | lynaghk | mynomoto: you need to pass each argument as a separate string: (clojure.java.shell/sh "inotifywait" "-qq" "-r" ...) |
| 16:02 | mynomoto | lynaghk: Ok, thank you. I will try. |
| 16:03 | weavejester | Does anyone happen to know if a "unchecked" macro exists that substitutes forms like (+ 1 1) for (unchecked-add 1 1)? |
| 16:04 | mynomoto | lynaghk: It works. Do you know why can't be just a string? |
| 16:05 | asteve | how can I, given a vector, return each element separated by a space but not in a list or vector? |
| 16:05 | asteve | ["a" "b" "c"] becomes a b c |
| 16:05 | lynaghk | mynomoto: because you are passing a bunch of different arguments to a command. Typically your shell (i.e., bash) will split everything up for you automatically, but in this case you're not going through bash so you need to split the args apart yourself |
| 16:06 | lynaghk | mynomoto: that's my understanding, anyway. I'm not a big unix hacker =) |
| 16:06 | joegallo | asteve: in a string? or in a code form? |
| 16:06 | asteve | code form |
| 16:06 | asteve | in this case a b c are symbols |
| 16:06 | joegallo | ~@ |
| 16:06 | clojurebot | @ is what |
| 16:06 | joegallo | heh |
| 16:07 | asteve | joegallo: that is only if they're quoted? |
| 16:07 | TimMc | clojurebot: forget what |is| @ |
| 16:07 | clojurebot | I forgot that what is @ |
| 16:07 | TimMc | ~@ |
| 16:07 | clojurebot | @ is like the macro version of apply |
| 16:07 | joegallo | neat |
| 16:07 | joegallo | asteve: i don't understand the question |
| 16:08 | joegallo | you can magic up a list of things, manipulate the crap out of them, and then ~@ them in |
| 16:08 | joegallo | if you're not in a quoted context, then i'm afraid i don't understand what you're doing at all -- perhaps a gist or something might help |
| 16:08 | asteve | joegallo: are you familiar with cascalog? |
| 16:09 | joegallo | no, i'm not |
| 16:09 | weavejester | Hm, actually unchecked math doesn't seem to have a huge speedup. I won't bother with it until I really need it. |
| 16:09 | mynomoto | lynaghk: I'm not either, just curious. Thanks. |
| 16:10 | TimMc | asteve: Are you writing a macro? |
| 16:10 | asteve | I have a vector containing strings that I need to convert to symbols and then splice them into a function; (func-name [] (call-other-func "something here") (mapv symbol ["?a" "?b" "?c"])) |
| 16:10 | asteve | TimMc: I know of it but not well enough to use it |
| 16:11 | TimMc | "splice them into a function" sounds like syntax generation (macros) |
| 16:13 | llasram | asteve: I use Cascalog frequently. What's your goal in Cascalog terms? |
| 16:13 | joegallo | ,(apply + [1 2 3]) |
| 16:13 | clojurebot | 6 |
| 16:13 | joegallo | (+ 1 2 3) |
| 16:13 | clojurebot | *suffusion of yellow* |
| 16:13 | joegallo | ,(+ 1 2 3) |
| 16:13 | clojurebot | 6 |
| 16:13 | joegallo | if it's just a function, then why can't you use apply? |
| 16:14 | llasram | asteve: There's also #cascalog, although in my experience it is infrequently populated |
| 16:14 | asteve | llasram: heh, to understand how a project that is written in a very poor manner is currently working; it's very simple, I want to read in 3 fields from a file and spit them out into another file but use the proper aggr queries |
| 16:14 | llasram | Speaking of... |
| 16:14 | asteve | llasram: I've been asking in there and that brought me here to solve the vector -> splice problem |
| 16:14 | asteve | which may be the completely wrong way to do everything |
| 16:16 | lynaghk | mynomoto: no worries |
| 16:16 | llasram | asteve: Yeah, I'm afraid I'm not quite following. You have a text file input, and you want to parse three fields out of it, to then deal with as their query variables w/in a query? |
| 16:16 | asteve | llasram: here's the pastie http://pastie.org/7665272 |
| 16:17 | asteve | I believe the reason it does not work is because (map symbol ["?blah..) is returning (?value_id ?value_ts…) not ?value_id ?value_ts |
| 16:18 | llasram | Well, no |
| 16:18 | llasram | So, there's two things going on |
| 16:19 | llasram | It's kind of confusing, but in places where you need to use generated field names, you use strings, not Clojure symbols |
| 16:19 | llasram | So you could do e.g.: (let [outfields ["?a" "?b"]] (<- outfields <rest of query>)) |
| 16:20 | llasram | The bigger issue: why do you need generated field names? |
| 16:20 | SegFaultAX | What does <- do? |
| 16:20 | asteve | create a cascalog query |
| 16:20 | llasram | SegFaultAX: It's part of the Cascalog API. It generates a query |
| 16:20 | SegFaultAX | Ah. |
| 16:21 | asteve | llasram: I need generated field names because the actual code builds these dynamically and mk-values-view is a macro |
| 16:23 | llasram | asteve: Well. Two approaches. (a) You don't actually need a macro, because you can programatically construct almost any query just using what Cascalog provides. For this approach, You solve your "I need `?a ?b`, not `(?a ?b)`" problem by using a sequence of strings to *replace* the field list, not *inside* the field list |
| 16:24 | llasram | asteve: (b) If you really need a macro, it sounds like you want quote-splice: ~@ |
| 16:24 | TimMc | splicing-unquote |
| 16:24 | llasram | ,(let [x '[a b c]] `(example ~@x)) |
| 16:25 | clojurebot | (sandbox/example a b c) |
| 16:25 | llasram | TimMc: Right |
| 16:25 | llasram | What he said, name-wise |
| 16:25 | gfredericks | ,'~@foo |
| 16:25 | clojurebot | (clojure.core/unquote-splicing foo) |
| 16:25 | TimMc | ,'~@_ |
| 16:25 | clojurebot | (clojure.core/unquote-splicing _) |
| 16:25 | asteve | well the good news is ~@ does not fix the source tap error |
| 16:25 | TimMc | :-( |
| 16:25 | asteve | so that means the problem is somewhere else |
| 16:25 | llasram | asteve: Wait |
| 16:26 | llasram | asteve: So, you're trying to pass `mk-values-view` directly to `?-`, but in your pastie, that's a function, not a query |
| 16:32 | jweiss | i am getting 'cant recur from non tail position' on line 15, but i can't figure out how it is NOT in the tail position. https://www.refheap.com/paste/13778 |
| 16:33 | dnolen__ | jweiss: you put a recur in a doseq |
| 16:33 | llasram | jweiss: Check what `doseq` expands to. Probably wouldn't do what you wanted, even if it complied |
| 16:34 | jweiss | ah yes, the doseq still has to be evaluated even though it returns nil |
| 16:34 | asteve | llasram: http://pastie.org/7666703 am I doing something stupid here? |
| 16:35 | jweiss | ok... so what am i missing here, i want to do tail recursion and i am keeping track of the stack myself so that should be possible |
| 16:37 | llasram | asteve: Your macro is splicing the `outargs` symbols into the body of the query, where the Cascalog `<-` macro expects sequences |
| 16:37 | llasram | asteve: Sorry, not the `outargs` splicing -- the second use |
| 16:37 | asteve | llasram: the strange thing is that `(<- [~@outargs] was taken directly from the working code |
| 16:38 | llasram | Yeah, that part is "fine" |
| 16:38 | asteve | right, ok :) |
| 16:38 | llasram | But I will reiterate -- there's probably no reason to use a macro here |
| 16:39 | asteve | you are most certainly right, I really need to understand the running code before I recreate it |
| 16:39 | llasram | gotcha |
| 16:39 | amalloy | jweiss: not related to your question, but the if on line 13 will always be truthy |
| 16:39 | Raynes | tpope: Ohai. |
| 16:40 | Raynes | tpope: I was going to ask if there is a way to change how fireplace invokes lein but then I realized I was dumb and that it doesn't. |
| 16:40 | jweiss | amalloy: yeah i noticed that, should be (seq fields-to-create) right |
| 16:41 | jweiss | let's see i guess i have to pass a list of entites to create instead of just one |
| 16:41 | Raynes | tpope: Other thing was I just wanted to say grrrrr about https://github.com/tpope/vim-fireplace/issues/48#issuecomment-16643219, though I'm sure you've already seen it and are entirely baffled. |
| 16:43 | tpope | Raynes: vim can be ... unpredictable when it comes to redrawing the screen |
| 16:43 | Raynes | Heh |
| 16:43 | tpope | Raynes: but the location list shouldn't be auto-opening anymore |
| 16:43 | Raynes | As of when? I have the latest. |
| 16:44 | asteve | llasram: ok, this is enough for the week; thank you for your help |
| 16:44 | llasram | asteve: np. good luck sorting it out |
| 16:44 | tpope | well I'll be |
| 16:45 | tpope | maybe I forgot to push or something |
| 16:46 | tpope | but that was well before the rename |
| 17:03 | stuartsierra | Is Nicolo Mometto here? |
| 17:03 | stuartsierra | * Nicola Mometto |
| 17:07 | stuartsierra | Bronsa: hello? |
| 17:08 | Bronsa | stuartsierra: yes? |
| 17:08 | stuartsierra | Hi |
| 17:08 | Bronsa | hi =) |
| 17:09 | stuartsierra | Bronsa: I'm working on Clojure Hudson releases. |
| 17:09 | Bronsa | yeah, I saw that on github |
| 17:09 | stuartsierra | You were trying to release tools.reader 0.7.4 earlier right? |
| 17:10 | Bronsa | last I tried was a few days |
| 17:10 | Bronsa | ago* |
| 17:10 | Bronsa | but yeah |
| 17:10 | stuartsierra | I've nearly got Hudson reconfigured. With your permission, I'd like to use tools.reader as my test case. |
| 17:10 | Bronsa | sure. |
| 17:10 | stuartsierra | OK. |
| 17:11 | stuartsierra | I'll push some minor updates to the pom.xml file, then edit the Hudson config & try to release it. |
| 17:11 | Bronsa | right, do whatever you need |
| 17:11 | Raynes | tpope: Looks like it fixed my issue as well. |
| 17:11 | tpope | perfect |
| 17:12 | Raynes | tpope: Is there a leader command or something for :%Eval? |
| 17:12 | Raynes | I hate having to define those things. I never know what to use. Always stepping on something's toes. :p |
| 17:12 | tpope | Raynes: no, but cpr does (require ... :reload) |
| 17:12 | Raynes | Oh, I see. |
| 17:14 | Raynes | tpope: Is the namespace the same as the file I'm in? |
| 17:14 | tpope | Raynes: it looks for a ns declaration |
| 17:14 | Raynes | Man, that's a terrible nickname, namespace. You're going to get soooooooooooo many spurious pings. |
| 17:15 | stuartsierra | Bronsa: Here it goes... |
| 17:15 | Raynes | tpope: This is all very amazing, what you've done here. It's like you have a perversely vast knowledge of viml that borders on mental illness or something. |
| 17:15 | TimMc | (Raynes org.timmc.thing (:require [clojure.string :as str])) |
| 17:15 | TimMc | oh, sorry about that |
| 17:15 | TimMc | It's my new Clojure variant. |
| 17:16 | tpope | no bordering about it |
| 17:17 | hyPiRion | TimMc: What kind of class is Raynes? |
| 17:17 | Bronsa | stuartsierra: damn :/ |
| 17:17 | hyPiRion | Or was the outher paren a non-language paren? |
| 17:18 | stuartsierra | Bronsa: The weird part is, it worked. |
| 17:18 | Bronsa | mh. |
| 17:18 | stuartsierra | There's just some failure in parsing the response from Nexus. |
| 17:18 | Bronsa | oh. |
| 17:19 | stuartsierra | I'm going to try upgrading the plugin. |
| 17:19 | Bronsa | stuartsierra: that might be a problem though, since clojure-build didn't bump pom.xml & git tag'ed |
| 17:19 | stuartsierra | yeah |
| 17:20 | stuartsierra | So now we have a release of tools.reader 0.7.4 in a repository but no tag in Git. |
| 17:20 | stuartsierra | I can log in to the Hudson server and fix this manually. |
| 17:22 | Raynes | tpope: God, Tim. "I wish I had Clojure interaction in Vim. Oh, there's something by Tim Pope. Hmm, sure wish I had git integ… oh, Tim. Well, I could use some markdown highl OH COME ON." |
| 17:23 | technomancy | Raynes: that's why they let him wear the big hat |
| 17:23 | amalloy | quick, Raynes, ask for a pony |
| 17:23 | Raynes | That sure is a good looking hat. |
| 17:25 | tpope | Raynes: that's not entirely unlike my interior monologue |
| 17:26 | Raynes | Staging individual hunks confuses me though. |
| 17:26 | tpope | it's a bit awkward |
| 17:26 | tpope | I still do git add -p a lot |
| 17:26 | Raynes | tpope: In Emacs's magit, I can stage a specific region (highlighted with my mouse). |
| 17:27 | Raynes | With this I can only stage the entire hunks. |
| 17:27 | Raynes | As far as I can discern anyways. |
| 17:27 | tpope | Raynes: after highlighting you can do :diffput |
| 17:27 | technomancy | Raynes: there's a darcs mode that lets you edit in the status buffer so you can stage stuff that's never actually existed on disk |
| 17:27 | technomancy | it's kinda bonkers |
| 17:27 | Raynes | tpope: Really? I thought I tried that. |
| 17:27 | technomancy | actually I think gitsum does that too |
| 17:27 | tpope | you can do that with fugitive too |
| 17:27 | tpope | edit the stage directly |
| 17:27 | Raynes | I can edit the stage? |
| 17:27 | Raynes | See, it'd help if I understood how git works. |
| 17:27 | Bronsa | stuartsierra: thanks |
| 17:27 | stuartsierra | Bronsa: OK, I've manually pushed the tags and master branch to tools.reader. |
| 17:28 | Bronsa | heh. |
| 17:28 | tpope | Raynes: yeah, if you switch to the diff buffer, you can edit it |
| 17:28 | tpope | and writing it writes to the index |
| 17:28 | stuartsierra | Now back to work on making this work. |
| 17:28 | technomancy | brings me back: http://chneukirchen.org/blog/archive/2008/02/introducing-gitsum.html |
| 17:29 | Raynes | tpope: So :Gdiff and then edit the one on the left? |
| 17:29 | tpope | yep |
| 17:29 | Raynes | Nice. |
| 17:29 | tpope | or just :Gsplit or whatever if you don't want that painful diff highlighting |
| 17:31 | amalloy | technomancy: bonkers? it's not terribly hard to stage stuff that never existed on disk, using just the git command-line |
| 17:32 | technomancy | amalloy: bonkers that the tool goes out of its way to support it |
| 17:32 | amalloy | it's useful! manually editing hunks is handy |
| 17:42 | Raynes | technomancy: amalloy has taken git commit trees and turned them into art. He has broken it down to a science. We sometimes print his network graphs and display them on the wall. |
| 17:42 | amalloy | cool, another item for my collection of Things That Never Happened |
| 17:44 | weavejester | Are we talking more sophisticated than "git add -p"? |
| 17:45 | weavejester | Because that's about as magical as I get :) |
| 17:46 | amalloy | weavejester: well, i was talking about selecting the 'e' option for a hunk with git-add -p |
| 17:46 | Raynes | weavejester: He can rebase a tree onto mars without killing it. |
| 17:46 | Raynes | They're planning to let him terraform it with this method. |
| 17:46 | amalloy | hahaha |
| 17:47 | technomancy | rebase onto the two trees of valinor |
| 17:48 | Raynes | Whoosh. |
| 17:49 | Raynes | I can't talk to technomancy for longer than 3 references or I start to feel inadequate. |
| 17:49 | amalloy | but Raynes, with http://xkcd.com/903/ you can sound just as smart as he does |
| 17:49 | technomancy | onto the white tree of Gondor? |
| 17:50 | Glenjamin | 'e' in git-add -p is mental |
| 17:50 | Raynes | Well, I've seen the Lord of the Rings movies. |
| 17:50 | Raynes | I couldn't get past the first chapter of the first book in that series. |
| 17:50 | Raynes | Felt like reading the bible. |
| 17:50 | Derander_ | rebase on to the world tree. |
| 17:50 | technomancy | did you start with the Silmarillion? |
| 17:51 | Raynes | Lord of the Rings novels. |
| 17:51 | amalloy | Raynes: i found the hobbit a lot more approachable than the LotR series proper |
| 17:51 | Derander_ | the Silmarillion is literally the bible |
| 17:51 | Raynes | I was thinking of reading that at some point. |
| 17:51 | technomancy | Raynes: you can cheat with https://en.wikipedia.org/wiki/Nightfall_in_Middle-Earth |
| 17:51 | technomancy | (which is absolutely amazing btw) |
| 17:51 | hyPiRion | Raynes: Silmarillion is the only book I've stopped reading because it was too dense |
| 17:51 | callen | Raynes: the LOTR books are boring. |
| 17:51 | callen | Raynes: the Hobbit is okay. |
| 17:51 | Raynes | callen: That's what I gathered from the first LOTR book. |
| 17:52 | Raynes | I *wanted* to like it because I liked the movie. |
| 17:52 | Glenjamin | there was a really interesting article on Christopher Tolkien recently |
| 17:52 | Raynes | But I would fall asleep if I tried to read it. |
| 17:52 | hyPiRion | Raynes: Great, now you know what to do when you can't get to sleep |
| 17:52 | technomancy | Nightfall on Middle Earth is like a tl;dr for people who couldn't even sit through the films. |
| 17:52 | Glenjamin | http://badassdigest.com/2013/01/09/why-jrr-tolkiens-son-hates-what-peter-jackson-has-done/ |
| 17:53 | Glenjamin | Tolkien's son has spent his life trying to guess what his dad would have written, and then writing that |
| 17:54 | callen | Glenjamin: Christopher is just mad that he's not a real writer like his father or someone capable of propagating his father's work to millions like Jackson :P |
| 17:54 | technomancy | callen: wait, isn't that Brian Herbert? |
| 17:54 | callen | technomancy: no that's the case there too, but it wasn't really his writing. |
| 17:55 | callen | technomancy: Herbert was working with KA I thought. |
| 17:55 | tieTYT2 | has anyone ever used the clojure-maven plugin? I'm getting this error: Exception in thread "main" java.io.FileNotFoundException: Could not locate foo/poc__init.class or foo/poc.clj on classpath: What is causing this? It's obviously finding something or else it wouldn't have reported this path in the exception |
| 17:55 | callen | technomancy: also the writing in the Brian novels was killing me, but I wanted to know more so badly I stomached it. |
| 17:55 | noprompt | john lennon's son has the same problem. |
| 17:55 | Glenjamin | bah, just read the FAQ and discovered i've been pronoucing leiningen all wrong |
| 17:55 | Raynes | No, nobody in the history of Clojure has ever used the clojure-maven plugin. |
| 17:55 | technomancy | callen: I had to take a break from Dune for like seven years before I could go back to the original and actually enjoy it |
| 17:56 | tieTYT2 | Raynes: :P Do you know what i'm getting that exception? |
| 17:56 | Glenjamin | you have a require, but not a file |
| 17:56 | tieTYT2 | i don't have a require |
| 17:56 | tieTYT2 | i only have one file called poc.clj |
| 17:57 | tieTYT2 | here are its contents: (ns foo.poc) (defn f [x] (println fn)) |
| 17:57 | Glenjamin | well something is trying to require foo.poc |
| 17:57 | callen | technomancy: I've been thinking about rereading the original but after like 10,000 pages of Dune I don't think my soul can take it. |
| 17:57 | Glenjamin | is it in a folder called foo? |
| 17:57 | tieTYT2 | yes |
| 17:57 | callen | technomancy: also have you seen clojure-control? |
| 17:57 | Glenjamin | then i've reached my limit of helpfullness in this case i'm afraid |
| 17:57 | callen | technomancy: I've been tinkering with it. Neat stuff. Handy for provisioning machines. |
| 17:57 | technomancy | callen: I don't believe I have |
| 17:58 | tieTYT2 | :T thanks anyway |
| 17:58 | Glenjamin | tieTYT2: try lein classpath |
| 17:58 | Glenjamin | and see if foo/poc.clj is valid in any of the paths listed |
| 17:58 | Glenjamin | if not, thats the problem |
| 17:58 | callen | technomancy: well. take a look. I'd love to hear what somebody else that does dev-ops has to say. |
| 17:59 | tieTYT2 | ohh there's a compile error |
| 17:59 | tieTYT2 | i should have said: (defn f [x] (println f)) |
| 17:59 | tieTYT2 | but I said (defn f [x] (println fn)) |
| 17:59 | technomancy | callen: I don't really do dev-ops actually |
| 17:59 | callen | technomancy: really? |
| 17:59 | callen | technomancy: well take a look anyway. '(please) |
| 17:59 | technomancy | callen: syme is about the extent of how I provision machines |
| 18:00 | Glenjamin | is the current leiningen profile available to the running process? |
| 18:01 | Glenjamin | eg. when I do with-profile production, how do I check that in my app? |
| 18:01 | amalloy | Glenjamin: no |
| 18:03 | TimMc | hyPiRion: No, he's a compiler special. |
| 18:04 | technomancy | Glenjamin: typically you'd place a key in the environment or on the classpath |
| 18:04 | technomancy | using environ or carica |
| 18:04 | Glenjamin | ah ok, so PROD=1 lein with-profile production ... |
| 18:04 | technomancy | Glenjamin: no, environ lets you put env vars in your profile |
| 18:05 | Glenjamin | aha, i see |
| 18:05 | Glenjamin | right, makes sense now |
| 18:05 | Glenjamin | cheers |
| 18:06 | hyPiRion | TimMc: ah I see |
| 18:18 | papachan | is there a library in clojure to parse json files? |
| 18:19 | dakrone | papachan: there are two, https://github.com/dakrone/cheshire and https://github.com/clojure/data.json |
| 18:20 | papachan | dakrone: oh thank you. |
| 18:23 | amalloy | just two!? |
| 18:24 | amalloy | there are like ninety |
| 18:24 | amalloy | but i don't think anyone uses clj-json anymore |
| 18:38 | tieTYT2 | is there a way to define annotations on a gen-class? |
| 18:39 | tieTYT2 | this says no, but it was answered in 2011: http://stackoverflow.com/questions/7703467/attaching-metadata-to-a-clojure-gen-class |
| 18:39 | hiredman | the one answer is really horrible |
| 18:40 | hiredman | like "I don't know clojure and I will cobble together something by cutting and pasting in to the browser's input box" bad |
| 18:41 | hiredman | (ns genclass.example (:gen-class ^{:doc "example class"})) is just not valid in anyway |
| 18:41 | tieTYT2 | ok well can you help me? |
| 18:41 | hiredman | so certainly not a test case for gen-class supporting annotations |
| 18:41 | tieTYT2 | i might ask the question again just so the answer is more up to date |
| 18:42 | hiredman | that answer is not out of date |
| 18:42 | hiredman | it is just flat out complete nonsense |
| 18:42 | hiredman | "not even wrong" |
| 18:43 | hiredman | https://groups.google.com/forum/?fromgroups=#!topic/clojure/3q17KuyGsic has some example code annotating a gen-classed class |
| 18:44 | tieTYT2 | thank you |
| 18:44 | hiredman | but that mailing list post is out of date, you can now also annotate constructors |
| 18:44 | amalloy | aw, hiredman, that answer isn't *wrong*. he says a number of true things, of the form: "i don't know how to answer your question, but here is some code that doesn't compile" |
| 18:45 | hiredman | (I think I wrote that patch) |
| 18:45 | hiredman | amalloy: right, not even wrong |
| 18:46 | tieTYT2 | oh waht I was asking about is annotations on the class it generates, not the methods |
| 18:46 | tieTYT2 | is that possible? |
| 18:47 | cemerick | are people using .edn for explicit data files these days? |
| 18:48 | hiredman | tieTYT2: doesn't look like it |
| 18:48 | tieTYT2 | hiredman: what about this: https://github.com/clojure/clojure/blob/master/test/clojure/test_clojure/genclass/examples.clj |
| 18:48 | tieTYT2 | is that what the clojure.test_clojure.genclass.examples.ExampleAnnotationClass is doing? |
| 18:48 | hiredman | cemerick: I recently changed a data file in our codebase to .edn because we have a test that complains .clj files have lines over 80 characters |
| 18:49 | cemerick | hiredman: yeah, similar reason for my asking |
| 18:49 | Raynes | cemerick: You can use .titties. Clojure doesn't care. |
| 18:50 | cemerick | I know, just wondering if it's breached into "common practice" for some definition. |
| 18:50 | hiredman | tieTYT2: that does look like it, I dunno, try it, I was skimming the gen-class source so maybe I missed it |
| 18:50 | cemerick | Raynes: .titties?! |
| 18:50 | cemerick | Man, a few weeks in LA, and it's all downhill :-P |
| 18:51 | Raynes | Two and a half months, man. |
| 18:51 | gdev | some guy is going to be googling for titties in a week and this log is going to show up in his search results and blow his mind |
| 18:51 | amalloy | we haven't seen him for days, cemerick. he's just been "working" on his laptop from a strip club |
| 18:52 | tieTYT2 | hiredman: eyah it works, nice |
| 18:54 | cemerick | amalloy: that's what I figure |
| 18:54 | cemerick | Raynes: Sorry, wasn't tracking your calendar closely |
| 18:55 | Raynes | cemerick, amalloy: The twist is that the strip club is the office and amalloy is the one stripping. |
| 18:55 | amalloy | wat |
| 18:55 | cemerick | whoa |
| 18:55 | cemerick | Now I need to drink. |
| 18:56 | filippobo | Hey guys, s it possible to create a "assoc-in!" |
| 18:56 | namespace | How do I print a range of characters from a string? |
| 18:56 | filippobo | ? |
| 18:56 | namespace | Like say I had the string "Hello" being able to print characters 1 through 3 |
| 18:57 | filippobo | range by index? |
| 18:57 | namespace | (Keeping in mind that strings are zero indexed.) |
| 18:57 | Bronsa | use subs and then println |
| 18:58 | namespace | Sub? |
| 18:58 | callen | filippobo: sure why not |
| 18:58 | Bronsa | ,(subs "hello" 1 4) |
| 18:58 | clojurebot | "ell" |
| 18:58 | namespace | callen: Thank you. |
| 18:59 | SexyTattoos96 | im looking for someone to help me with my website |
| 18:59 | gdev | ,(.substrnig "hello" 0 4) |
| 18:59 | clojurebot | #<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: substrnig for class java.lang.String> |
| 19:00 | gdev | ,(.substring "hello" 0 4) |
| 19:00 | clojurebot | "hell" |
| 19:01 | filippobo | callen: I tried adapting the implementation of assoc-in using assoc! https://github.com/clojure/clojure/blob/c6756a8bab137128c8119add29a25b0a88509900/src/clj/clojure/core.clj#L5565 |
| 19:01 | callen | filippobo: why? |
| 19:01 | filippobo | but I get Exception in thread "main" java.lang.ClassCastException: clojure.lang.PersistentVector$TransientVector cannot be cast to clojure.lang.IPersistentCollection |
| 19:01 | filippobo | because there is no assoc-in! :-) |
| 19:17 | Foxboron | Helluw. So i am messing with lein-daemon, it dosnt start and i get a Nullpointer exception in the log file. Anyone able to help? |
| 19:30 | amalloy | ~helpme |
| 19:30 | clojurebot | A bug report (or other request for help) has three parts: What you did; what you expected to happen; what happened instead. If any of those three are missing, it's awfully hard to help you. |
| 20:07 | tieTYT2 | oh i figured out that filenotfound issue I had before |
| 20:07 | tieTYT2 | stupid intellij creates dashes as dashes in filenames |
| 20:17 | tieTYT2 | is there a way to define a gen-class' methods step by step or outside of the gen-class call? |
| 20:17 | tieTYT2 | i can't figure out a way to do that |
| 20:19 | tieTYT2 | what I want to do is have a compojure-like api that generates a java jersey class. But I can't figure out how to make (GET "mypath") create a method named -mypath and a method signature named "mypath" inside the gen-class from one call |
| 20:20 | namespace | Okay, I get an unbounded function error with this code for fpunct. |
| 20:20 | namespace | http://pastebin.com/Wfk6wWcM |
| 20:21 | namespace | Sample input: |
| 20:21 | namespace | http://pastebin.com/gTbm49yj |
| 21:05 | mynomoto | namespace: what's the error message? |
| 21:14 | namespace | mynomoto: IllegalStateException Attempting to call unbound fn: #'user/fpunct |
| 21:19 | mynomoto | namespace: is that when you try to call the funcion? |
| 21:19 | namespace | Yes. |
| 21:19 | namespace | In any context. |
| 21:22 | mynomoto | namespace: example of call please. |
| 21:39 | n_b | How bad would having a git submodule in your lein checkouts folder be on a scale of "really" to "not even once"? |
| 21:41 | namespace | mynomoto: (fpunct "Hello my name is bob, how are you? In other news I finished the program. This is a filler statement between the next question! I'm the next question?" 0 1) |
| 21:42 | namespace | It's really not a big deal anymore, I ended up doing it in python. |
| 22:08 | technomancy | n_b: if you adjust your expectations it could be somewhat reasonable |
| 22:20 | rasmusto | tpope: There are probably all sorts of problems with this: https://gist.github.com/rasmusto/5424432 but it seems to let me :Gedit some old rev and cpp functions. It probably breaks on windows and if filenames change around in git history |
| 22:58 | amalloy | namespace: i think the only time you can get that exception is some kind of java-interop scenario, where you're using a java "main" program to call into your clojure function without first require'ing the file it's defined in |
| 23:41 | robear1 | i have a clojurescript question. it relates to the js->clj function. if i don't pass :keywordize-keys true as an option, the function works fine. if i add that option, i get an error - clojure.lang is undefined - var map__10179__10181 = cljs.core.seq_QMARK_.call(null, map__10179__10180) ? clojure.lang.PersistentHashMap.create.call(null, cljs.core.seq.call(null, map__10179__10180)) : map__10179__10180; |
| 23:41 | robear1 | any idea where i should look to figure out what is going on? |
| 23:48 | tieTYT | in a precondition, what's the most concise way to check that an argument is not null? |
| 23:50 | tieTYT | i think this works: {:pre [(x)]} |
| 23:51 | capcrunch | tieTYT what that does means ? |
| 23:51 | tieTYT | oops, I mean this: {:pre [x]} |