2013-03-01
| 01:51 | RazLaptop | How would I form client.Network.Login("data") in clojure? |
| 01:52 | RazLaptop | Most examples I find only go one object deep |
| 01:54 | rplaca | (.Login (.Network client) "data) ought to do it |
| 01:54 | RazLaptop | thanks, I'll give it a shot :) |
| 01:54 | rplaca | np |
| 01:55 | RazLaptop | Phew it worked! That stumped me for ages- do you know where I can find more relevant info in the doc's? |
| 01:56 | rplaca | not really, just think about it as functions on objects rather than method invocations and it should be pretty clear |
| 01:56 | RazLaptop | rplaca, ok, at least with this I have a footing now, thanks :) |
| 01:57 | rplaca | that is, client.Network returns something (yeah, it's actually a field, but that doesn't matter) and you want to call .Login with that thing and "data" |
| 01:57 | rplaca | similar logic all the way through |
| 03:03 | ChongLi | hmm |
| 03:06 | ChongLi | lighttable has a bunch of hotkeys using the Cmd key |
| 03:06 | ChongLi | but I don't have that key (on linux) |
| 03:07 | Apage43 | ChongLi, most of those are also bound to Ctrl |
| 03:07 | mytrile | Try Alt instea |
| 03:07 | Apage43 | or Alt |
| 03:07 | mytrile | instea* |
| 03:07 | ChongLi | yeah I see that |
| 03:07 | ChongLi | how do remove/change keybindings? |
| 03:07 | supersym | Ctrl+Space search for "key" |
| 03:08 | Apage43 | command -> Change key bindings/shortcuts |
| 03:08 | ChongLi | yeah I'm on that screen |
| 03:08 | ChongLi | I only see options to add bindings |
| 03:08 | Apage43 | ag |
| 03:08 | Apage43 | yeah, not sure how to remove them |
| 03:09 | ChongLi | this is so damn slick |
| 03:11 | supersym | yeah I dunno either.. doing some reflection stuff trying to look a bit more inside |
| 03:11 | supersym | I'd like to change some css properties from the repl on the running client :) |
| 03:12 | supersym | I do miss some stuff that was in 0.2 tho - like connect to repo etc? Really would have loved some documentation/source |
| 03:13 | supersym | also we have editor search but no replace |
| 03:13 | supersym | also large workspace directory = slugishness |
| 03:14 | supersym | oh well.... o |
| 03:14 | supersym | still great, sweet and more awesomeness |
| 03:16 | ChongLi | the "vim mode" really ought to be called "vi mode" |
| 03:16 | ChongLi | though it's not even a complete vi mode at that! |
| 03:16 | supersym | yeah |
| 03:17 | supersym | shouldnt be too hard to get some more ... dunno if this is native codemirror or.. |
| 03:17 | ChongLi | the key features for me with vi are @ and ! |
| 03:18 | ChongLi | @ being the macro key and ! being the "pipe to external command" |
| 03:19 | supersym | yeah i was wondering @? ... q/@ and ! yeah :) I love being able to do :!. % |
| 03:20 | supersym | but it always seemed a bit silly to have like a seperate 'bash' implement like vim does... dunno whats about that |
| 03:20 | ChongLi | separate bash? |
| 03:20 | supersym | wouldn't it just have been easier to tie it to the running shell (e.g. I use zsh but vim is still bash) |
| 03:21 | ChongLi | I used zsh for a while but I'm back to bash |
| 03:21 | supersym | or did i miss an option somewhere all those months |
| 03:21 | ChongLi | since I installed on my new ssd I've been avoiding reinstalling stuff like emacs, vim etc. |
| 03:21 | ChongLi | it's really enlightening to use vi and bash in their default states |
| 03:21 | supersym | I love zsh but stopped scripting in it... node.js cli apps way easier to do :P |
| 03:22 | ChongLi | and leverage the full power of unix! |
| 03:22 | supersym | well with some tweaks vi can be made 'ok' |
| 03:22 | ChongLi | what's wrong with it? |
| 03:22 | supersym | default key behaviour for me anyway |
| 03:22 | supersym | arrows, home key, maps |
| 03:22 | ChongLi | what?! |
| 03:22 | ChongLi | I don't use any of those keys! |
| 03:22 | ChongLi | they're too far away! |
| 03:22 | ChongLi | :) |
| 03:23 | supersym | :P |
| 03:23 | supersym | good point,... I try to force myself learning to get used to hjkl but it takes tiiime |
| 03:23 | ChongLi | ah |
| 03:23 | supersym | did remap the Caps to esc tho |
| 03:23 | ChongLi | I learned hjkl easily back when I got this keyboard |
| 03:24 | supersym | a lot better |
| 03:24 | ChongLi | it has no numeric keypad |
| 03:24 | ChongLi | so I was forced to learn hjkl to play nethack |
| 03:24 | supersym | ^^ nethack |
| 03:24 | ChongLi | now I can't live without it! |
| 03:24 | supersym | from that perspective, vi does have great keymap convention by itself, yeah |
| 03:25 | supersym | it actually tries to unlearn your bad-MS-based habit |
| 03:26 | supersym | trade-off, many ppl got scared away at first tries tho |
| 03:26 | ChongLi | haha, amazing that it can do that from 1976! |
| 03:26 | supersym | I like my vim a lot better with https://github.com/spf13/spf13-vim also |
| 03:26 | ChongLi | yeah I have a vim that's all tricked out too |
| 03:27 | ChongLi | I'm reluctant to go back to it though |
| 03:27 | ChongLi | just too much mental baggage |
| 03:27 | supersym | yeah for me its about the right balance of tweakability and relative ease... some stuff I have to work too hard in Bash, and while Arch is great for me now, I doubt I'll like Unix much later |
| 03:28 | ChongLi | supersym: why not? |
| 03:29 | supersym | well I dunno, I never got it the 3,4 times I tried, but so didn't get Arch untill I learned everything in the book (wiki) |
| 03:29 | supersym | but I dunno, I have the idea I'll have to rely on sed and awk like stuff to get around :P |
| 03:29 | ChongLi | I think the key to "getting" unix is to understand the gnu coreutils |
| 03:30 | supersym | well I get the ideas behind a few I guess but automake nor c/c++ seem like my cup of tea |
| 03:31 | ChongLi | http://www.gnu.org/software/coreutils/manual/coreutils.html |
| 03:31 | ChongLi | here's the giant combined man page of all the coreutils! |
| 03:31 | supersym | sweet |
| 03:32 | ChongLi | my fave commands are column, cut and grep |
| 03:32 | ChongLi | you can do a lot with those |
| 03:32 | ChongLi | sort as well |
| 03:32 | supersym | yeah they are sweet :) |
| 03:32 | supersym | the best tools are 30 years old or more :P |
| 03:33 | ChongLi | and integrating them with vi is fantastic |
| 03:33 | ChongLi | the other thing I really appreciate about vi is the low latency |
| 03:33 | ChongLi | on basically everything |
| 03:34 | supersym | oi.. well u said since 1976.. i was born in 80 and got raised with DOS... go figure |
| 03:34 | ChongLi | vim and emacs just seem to feel "heavy" |
| 03:34 | ChongLi | there's a lot going on with every keystroke |
| 03:34 | ChongLi | and a lot of the time it's blocking the UI |
| 03:35 | supersym | yes .. F1 being the most famous :P |
| 03:36 | supersym | well whats your alternative tho |
| 03:36 | ChongLi | alternative to what? |
| 03:36 | supersym | sublime is pretty cool but closed source |
| 03:36 | supersym | vim and emacs being relatively heavy |
| 03:37 | ChongLi | the alternative is to use something light like vi :) |
| 03:37 | Arafangion | Another editor-discussion? |
| 03:37 | supersym | seems like lighttable might become open-source (mixed model of perhaps free/paid plugin ideas) |
| 03:37 | supersym | Arafangion: sorry >< |
| 03:37 | ChongLi | lighttable will be open source |
| 03:37 | supersym | ok kool |
| 03:37 | ChongLi | I've heard it from ibdknox himself! |
| 03:38 | Arafangion | ChongLi: Sadly, you have to hack the sources to get vi to display on today's monitors - the maximum lines and columns are hard-coded constants. (Referring to the *real* VI, of course) |
| 03:38 | Apage43 | most of the .cljs source is pretty easy to find already ;) |
| 03:38 | supersym | yeah |
| 03:38 | Apage43 | last I looked anyway |
| 03:38 | ChongLi | Arafangion: hmm? I'm not having any problems |
| 03:38 | supersym | line-height is a bitch but so is xft in my urxvt unicode and anti-aliasing with vim |
| 03:39 | Arafangion | ChongLi: Where did you get your vi from, then? |
| 03:39 | ChongLi | Arafangion: it came installed in the base system |
| 03:39 | ChongLi | running arch |
| 03:39 | Apage43 | ah, perhaps not. The stuff it downloaded used to include the cljs |
| 03:39 | Arafangion | ChongLi: Then it's probably linked to vim, running in vi-emulation mode. |
| 03:40 | ChongLi | Arafangion: no... |
| 03:40 | ChongLi | which vi returns /usr/bin/vi |
| 03:40 | supersym | ownm |
| 03:40 | Arafangion | ChongLi: Yes, which is likely either a hard or a soft link to /usr/bin/vim, or else they've compiled their own vi from vim code. |
| 03:41 | Arafangion | ChongLi: Very few systems provide the original vi. |
| 03:41 | ChongLi | Arafangion: no, it's linked to ex |
| 03:41 | Arafangion | ChongLi: Interesting! Then it might be the original vi, after all! |
| 03:42 | ChongLi | yeah it has all the limitations of vi |
| 03:42 | ChongLi | single undo, no command history or anything like that |
| 03:42 | ChongLi | but it's still just as powerful, you just have to work a bit at it |
| 03:42 | ChongLi | a lot like lisp |
| 03:43 | Arafangion | ChongLi: This bug refers to the line and column width limitation I mentioned: https://bugs.archlinux.org/task/15844 :) |
| 03:44 | ChongLi | Arafangion: ah that's weird |
| 03:44 | Arafangion | ChongLi: But sensible, it means you don't have to dynamically allocate the buffer, it's static. |
| 03:44 | ChongLi | when I first installed (before even installing X) I was editing stuff with vi fullscreen on my 2560x1600 monitor |
| 03:44 | Arafangion | ChongLi: And therefore faster. :) |
| 03:44 | Arafangion | ChongLi: That bug there seems to have been fixed in 2010. :) |
| 03:44 | ChongLi | I have no idea how many columns it was but it was a lot |
| 03:45 | ChongLi | Apage43: paranoia? |
| 03:45 | Apage43 | like you'll learn it too much and be helpless on a machine without your config |
| 03:45 | ChongLi | I've heard that argument before and it makes sense |
| 03:45 | ChongLi | but that's not the one I'm using |
| 03:47 | Arafangion | ChongLi: Why do you like ex-vi, anyway? |
| 03:47 | supersym | Apage43: well i would have "gotten" awk and sed a lot better/sooner if it was still 1975 or so but to say I miss out on essentials,.... |
| 03:47 | ChongLi | Arafangion: it's helping me appreciate and understand the unix philosophy |
| 03:48 | ChongLi | if vi doesn't have some weird feature I need I can often get it by piping to an external command |
| 03:48 | Apage43 | at home I'm on an Arch linux machine and at work I use a macbook |
| 03:48 | ChongLi | plus I just really like the low latency |
| 03:48 | supersym | can you compile vi in utf-8? |
| 03:48 | Arafangion | ChongLi: Worse Is Better? :) |
| 03:48 | ChongLi | emacs was starting to drive me nuts with its latency |
| 03:49 | Arafangion | ChongLi: Funnily, that was what made me switch from vim to emacs. :) |
| 03:49 | ChongLi | when you have auto-complete running and everything it does is synchronous |
| 03:49 | ChongLi | it can often block the UI for 1/4 second to 1/2 second on every keystroke |
| 03:49 | Arafangion | ChongLi: So don't do auto-complete, then. You don't have it with vi, anyway. :) |
| 03:49 | Chousuke | that's one of the only remaining big issues emacs has tbh :P |
| 03:50 | Apage43 | I've noticed that MacVim is a lot snapper than gvim for me |
| 03:50 | Apage43 | *snappier |
| 03:51 | supersym | Arafangion: can't you do ctags for that? |
| 03:51 | Chousuke | it's not easy to transform 30 years of code into something multithreaded |
| 03:51 | Arafangion | supersym: I can, but ctags for object-oriented languages is very limited. |
| 03:51 | Chousuke | especially with elisp being dynamically scoped. Though didn't they already add lexical scoping in 24? |
| 03:52 | Arafangion | supersym: I do, in point of fact, use ctags from time to time. |
| 03:52 | supersym | ok :) |
| 03:53 | Apage43 | https://github.com/Valloric/YouCompleteMe is actually quite usable, but a hell of a pain to set up for c/c++ |
| 03:53 | supersym | ah... well I do miss out of Visual Studio...2010 Ultimate was such a breeze |
| 03:53 | supersym | I really got spoiled |
| 03:53 | Arafangion | supersym: You think VS 2010 is a breeze? |
| 03:53 | Arafangion | supersym: You obviously haven't tried VS 2012. VS 2010 was just... Meh... |
| 03:54 | supersym | yeah I hardly had any issues... |
| 03:54 | supersym | ah ok no i havent |
| 03:54 | supersym | I know there was a lot not done yet |
| 03:54 | supersym | like menu customizing was like 40% done :P |
| 03:54 | Arafangion | Heh. |
| 03:55 | supersym | only thing really buggy was rending xaml |
| 03:55 | supersym | at times |
| 03:56 | supersym | i should fire up a vm and check out 2012 some time .. |
| 03:57 | Arafangion | supersym: Definitely, and while I haven't tested it, they claim to be backwards compatible, for once. |
| 04:02 | ucb | is anybody here using lightable in anger (other than the devs :) ? |
| 04:03 | ChongLi | I haven't used it enough to make me angry |
| 04:03 | ChongLi | I really haven't "got it" yet |
| 04:03 | ucb | I just tried it and, of course, I was confused by it. |
| 04:03 | Apage43 | ucb, I typically fall back to my typical setup for a while when it does something weird |
| 04:03 | Apage43 | it's nice when it works of course |
| 04:03 | ucb | but that's because I come with bad old habits |
| 04:04 | ucb | Apage43: oh? I was wondering about that email sent to the ML saying that it has leiningen integration. That's why I decided to give it a go. |
| 04:04 | Apage43 | my typical problem is I'll type something that is going to block a thread for a while, it tries to evaluate it, and then nothing that involves evaling code works for a bit =P |
| 04:04 | Apage43 | ucb, it does. It works really well actually. |
| 04:05 | ucb | Apage43: I failed to see where that was done. Unless it's all automagical? |
| 04:06 | Apage43 | ucb, when you have a .clj open and do the eval-this-form shortcut (ctrl-enter), it'll go through the process of going up the directory tree to find a project.clj and starting up a nrepl connection |
| 04:06 | ucb | ah, cool |
| 04:06 | Apage43 | if you never actually do anything that needs it to talk to lein/nrepl it won't actually bother |
| 04:08 | ucb | I see. I suppose I'll stick to my emacs for now. I rely too much on nrepl, midje-mode and others :( |
| 04:10 | Apage43 | you can also pull up a instarepl-tab on a connected project |
| 04:10 | Apage43 | if you just need a scratchpad |
| 04:11 | Apage43 | That's the one where I get in trouble, since it evals the code as soon as it is valid |
| 04:11 | ucb | yeah, saw that |
| 04:11 | ucb | oh |
| 04:11 | Apage43 | typically really nice, until you're messing with stuff that blocks |
| 04:12 | Apage43 | you can turn off the live update behavior though and just make it a scratchpad you can eval in on-demand |
| 04:19 | broquaint | ??maud |
| 04:19 | broquaint | ww |
| 04:54 | ChongLi | thinking of maud you forget everything else! |
| 04:56 | Raynes | ChongLi: http://en.wikipedia.org/wiki/Maude_(TV_series) |
| 04:57 | ChongLi | Raynes: http://www.bartleby.com/42/6491.html |
| 06:02 | augustl | is there still no way to easily run a single deftest with "lein test" other than creating tags and adding metadata etc? |
| 06:03 | clgv | augustl: in midje, evaluation of the test namespace runs the tests as well |
| 06:06 | ucb | +1 for midje |
| 06:09 | pisketti | clgv: but if you just want a single deftest/fact be run, how do you go about it? |
| 06:09 | pisketti | with lein |
| 06:09 | augustl | I'm not using midje though, I'm using the built-in stuff |
| 06:10 | clgv | pisketti: why do you want to do it with lein? most IDEs support evaluation of single forms (emacs, CCW, ...) |
| 06:10 | ucb | augustl: I believe that lein-midje can run your standard deftest tests |
| 06:10 | pisketti | it does |
| 06:11 | augustl | how would I go about running a single deftest with lein-midje? |
| 06:11 | pisketti | It runs and reports both deftests and midje facts |
| 06:11 | pisketti | clgv: That question aside, can it be done? :) |
| 06:13 | clgv | pisketti: I guess there is no real use to select a single test. but you can use the tag/metadata approach |
| 06:13 | pisketti | I guess I'm not familiar with that either |
| 06:13 | clgv | pisketti: usually you group those test in meaningful groups which you often want to test together |
| 06:14 | pisketti | And midje has support for such groups then? |
| 06:15 | clgv | good question, I do not remember if what was mentioned here was clojure.test only |
| 06:16 | augustl | so lein-midje is not able to run a single deftest? |
| 06:16 | clgv | pisketti: yes it has: https://github.com/marick/Midje/wiki/Metadata |
| 06:16 | clgv | augustl: what works for groups also works for trivial groups of size 1 ;) |
| 06:17 | clgv | lein midje :filter my-single-test |
| 06:17 | pisketti | heh |
| 06:17 | augustl | i just want to run a single test by name without having to edit the source code |
| 06:17 | clgv | well at least when written as midje fact. dont know if deftest works as well |
| 06:17 | pisketti | clgv: Thanks |
| 06:17 | augustl | oh I see |
| 06:18 | clgv | augustl: you gotta research that on your own ;) |
| 06:18 | pisketti | and perhaps write your own lein plugin 8) |
| 06:18 | augustl | so my-single-test is just the name of the test, not a group/tag I have to create? |
| 06:19 | clgv | augustl: see the wiki page above. it shows how it works for midje. |
| 06:20 | clgv | oh but the feature is new in midje 1.5 ... |
| 06:21 | pisketti | I noticed |
| 06:21 | pisketti | I'm currently using 1.4 |
| 06:21 | pisketti | But I guess I have no reason not to upgrade |
| 06:25 | ucb | pisketti: are you using midje-mode? if so, together with nrepl? |
| 06:40 | jcidaho | Hi - looking at using clostache... anyone had success with it? |
| 06:44 | jcidaho | there is stencil also.. |
| 06:44 | jcidaho | the CTO here is very keen on using Mustache |
| 06:45 | cmdrdats | in nRepl+emacs, I'd like to automatically load up a namespace when connecting to a speficic |
| 06:45 | cmdrdats | specific* project |
| 06:50 | clgv | jcidaho: well you should be able to try it quickly I guess |
| 06:53 | jcidaho | clgv: yes. Just been through hiccup and enlive before being informed about mustache. Looking at https://groups.google.com/forum/#!topic/clojure/2dRbv-S0UuQ seems Stencil is a good forerunner choice. Performance is very important. |
| 07:00 | augustl | is there a way to disable "lein test", or make "lein test" actually invoke "lein midje"? |
| 07:01 | clgv | augustl: maybe an "alias" can overwrite it |
| 07:07 | augustl | doesn't seem like there's an easy way to run a single "deftest" with "lein midje" |
| 07:15 | pisketti | ucb: No. I don't know why I've kept using lein to run my tests. ;) |
| 07:15 | pisketti | I do use nrepl, though |
| 07:19 | pbollen | i'm trying to play with https://github.com/pallet/vmfest-playground |
| 07:19 | pbollen | more specifically with https://github.com/pallet/vmfest-playground/blob/master/src/play.clj |
| 07:19 | pbollen | however executing this in the repl: (setup-model "https://s3.amazonaws.com/vmfest-images/debian-6.0.2.1-64bit-v0.3.vdi.gz" my-server) |
| 07:19 | pbollen | gives me: CompilerException java.lang.RuntimeException: Unable to resolve symbol: setup-model in this context, compiling:(NO_SOURCE_PATH:1) |
| 07:20 | pbollen | can't grasp the meaning of this yet... |
| 07:20 | pbollen | any tips? |
| 07:21 | clgv | pbollen: you did not :require or :use the namespace properly |
| 07:21 | pbollen | omg |
| 07:21 | pbollen | I forgot to copy the second line |
| 07:21 | pbollen | thanks! |
| 07:21 | clgv | you need line 2 (use '[vmfest.virtualbox.image :only [setup-model]]) |
| 07:23 | pbollen | (y) thx! |
| 07:30 | ucb | pisketti: so do I. But it does take a bit with the whole a new JVM every time I try to run tests :( |
| 07:33 | clgv | ucb: SSDs do really help with that |
| 07:33 | ucb | clgv: surely that's not the right answer though? |
| 07:34 | clgv | ucb: well if you have the problem of slow leiningen (startup, compile, uberjar) very often it is good workaround. |
| 07:35 | ucb | clgv: in terms of lein things drip has helped me a great deal, but for some reason it doesn't seem to work with midje. Perhaps I should query the ML |
| 07:35 | clgv | usb: just for the testing there is lazytest and from midje 1.5 on it offers the same functionality |
| 07:35 | clgv | midje 1.4 works with lazytest.... |
| 07:36 | mpenet | ucb: you can run the tests from the nrepl |
| 07:36 | mpenet | just put a (run-tests) at the end of the file an reload it |
| 07:36 | mpenet | or C-c C-c the expression |
| 07:37 | ucb | clgv, mpenet: thanks! |
| 07:38 | clgv | ah I thought running from repl was discarded earlier on ... ;) |
| 07:38 | mpenet | was it? |
| 07:39 | ucb | I just want a quick way of running tests as I work on my code |
| 07:39 | mpenet | I am not sure how it would work with midje though |
| 07:39 | ucb | and having to wait several seconds (close to a minute sometimes) breaks my workflow :( |
| 07:41 | mpenet | The nrepl solution is the fastest I know or. There is also lein.el, but I never tested it. |
| 07:41 | mpenet | of* |
| 07:43 | ucb | midje-mode was great because of the navigation between test->code and such |
| 07:43 | ucb | unfortunately it's broken for nrepl |
| 07:50 | dan_b | just before I go to the effort of downloading and building JUDS by hand - is there any less involved way of reading from a unix domain socket in clojure? |
| 07:52 | dan_b | oh wait, https://github.com/jnr/jnr-unixsocket may fit the bill |
| 10:12 | devn | good morning my fellow clojurians |
| 10:12 | devn | i hope the force is with you today |
| 10:14 | hyPiRion | wish it were |
| 10:14 | hyPiRion | I have to work with locks and mutexes today |
| 10:17 | znDuff | (Distributed locking, even, with cleanup required). |
| 10:18 | hyPiRion | Oh dear. |
| 10:27 | pepijndevos | danlarkin: ping |
| 10:27 | danlarkin | hi |
| 10:27 | hyPiRion | arcatan: That actually sounds interesting |
| 10:28 | hyPiRion | hard, but interesting |
| 10:28 | pepijndevos | danlarkin: I came across your IRC server. Curious what the status of that is. I also read you whre considering moving to Aleph? |
| 10:28 | dcolish | distributed locking is the most fun |
| 10:28 | arcatan | hyPiRion: let me show you a video of our garbage collector: http://www.youtube.com/watch?v=R-HLwHHtDT8 :) |
| 10:30 | pepijndevos | arcatan: wow, you work for them?! Awesome |
| 10:31 | arcatan | pepijndevos: yea, it's pretty cool |
| 10:33 | hyPiRion | arcatan: Oh, hahahah. Garbage collection. I got it now. |
| 10:33 | danlarkin | pepijndevos: cool, yeah, it's "in production" at work |
| 10:33 | hyPiRion | Looks pretty sweet though |
| 10:33 | danlarkin | totally stable |
| 10:33 | danlarkin | I made a spike at using aleph but it's lacking support for some things I need right now |
| 10:49 | pepijndevos | danlarkin: I got netsplit, so if you said anything after saying hi, I did not get it. |
| 10:50 | Fatalnix | Can I set the classpath for clojure on the command line? changing javas classpath doesn't seem to do anything. |
| 10:51 | pepijndevos | Fatalnix: Are you using leiningen? As far as I know, Clojure uses the Java classpath |
| 10:51 | Fatalnix | pepijndevos: I do, but not at the moment, I'm just doing some tiny tests |
| 10:51 | Fatalnix | that's weird. |
| 10:51 | Ember- | clojure does use java's classpath |
| 10:52 | znDuff | Fatalnix: How are you invoking Clojure? If you're going through Leiningen, that's a very different thing. |
| 10:53 | Ember- | leiningen does not pass -D parameters for example to your app |
| 10:53 | Fatalnix | oh no, for this I'm just invoking the clojure 1.4 jar |
| 10:55 | Fatalnix | I was just testing some tiny java interopt but I couldn't get a file to compile because it complains it doesn't exist, when its right there and my classpath is my current working directory, so I just thought it was weird. |
| 10:55 | Fatalnix | I'd use lein but I didn't want the whole mess of files distributed around. |
| 10:57 | znDuff | Fatalnix: ...so, if you ask the JVM what its classpath is... |
| 10:57 | Fatalnix | well I defined its classpath with -cp |
| 10:59 | hyPiRion | Clojure 1.5 out |
| 10:59 | hyPiRion | Party time |
| 10:59 | Fatalnix | lol |
| 11:02 | aroemers | Nice! |
| 11:02 | Ember- | really? clojure 1.5 final? |
| 11:02 | Ember- | \o/ |
| 11:03 | Ember- | http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.clojure%22%20AND%20a%3A%22clojure%22%20AND%20v%3A1.5.0* <- only RC17 available? |
| 11:03 | ejackson | woo hoo ! |
| 11:04 | mpenet | it take a little time to get on maven central |
| 11:04 | Ember- | no link on clojure home page either |
| 11:04 | aroemers | Takes a while, see: https://groups.google.com/forum/?fromgroups=#!topic/clojure/kzF5O0Yfdhc |
| 11:04 | Ember- | this must be *really* new thing |
| 11:04 | hyPiRion | Ember-: it's on the dev list |
| 11:05 | danlarkin | pepijndevos: yeah I said it's "in production" at work, very stable |
| 11:05 | danlarkin | it doesn't support all of the RFC(s) but it's enough for what we need |
| 11:07 | pepijndevos | danlarkin: cool. I found some post on the aleph list about plans to change from jetty to aleph. Did that ever happen? |
| 11:07 | danlarkin | netty |
| 11:07 | pepijndevos | project.clj includes both |
| 11:07 | danlarkin | I started working on it, yeah, but aleph doesn't support some things I need yet |
| 11:07 | danlarkin | so that's on hold |
| 11:08 | pepijndevos | danlarkin: ah i see. Aleph is also based on netty right? What doesn't aleph support? |
| 11:08 | danlarkin | lamina is an abstraction over netty channels |
| 11:09 | danlarkin | but unfortunately it's not perfect, like I can't get the InetAddress object that I'm connected to |
| 11:09 | danlarkin | but I need that for hostname formatting |
| 11:09 | pepijndevos | I see. |
| 11:09 | Ember- | cool stuff, just read the changelog |
| 11:11 | pepijndevos | danlarkin: I wonder if I could build some bouncer like functionality right into the server, especially replaying messages. |
| 11:11 | danlarkin | it's been suggested before |
| 11:11 | pepijndevos | but there where objections, or it just never happened? |
| 11:12 | danlarkin | and it's definitely possible, of course, but there are some issues beyond just the code-writing |
| 11:12 | danlarkin | like how do you know who's connected, to send them the right messages |
| 11:13 | pepijndevos | danlarkin: uh, just look at the nick? juding your response, it can;t be that simpe... |
| 11:13 | danlarkin | but what if I log in with your nick? |
| 11:13 | danlarkin | am I allowed to get your PMs? |
| 11:14 | pepijndevos | then you get my messages… I never studied IRC security, but can you just do that? |
| 11:15 | danlarkin | some networks have what are called "services" to prevent it |
| 11:15 | pepijndevos | I mean, I'm on ZNC now, if you would log in as me, you'd also get my messages |
| 11:15 | pepijndevos | nickserv and such? |
| 11:15 | danlarkin | NickServ on freenode,yeah |
| 11:16 | pepijndevos | My bouncer has a password, but I'm not sure how that works. |
| 11:16 | danlarkin | it works as a server password |
| 11:16 | danlarkin | meaning anyone who knows that password (which should be only you) can log in and act as you |
| 11:16 | danlarkin | but what it means is that your ZNC can only serve one user, you |
| 11:16 | pepijndevos | yea, that's how password generally work... |
| 11:17 | pepijndevos | no, ZNC support multiple accounts |
| 11:17 | danlarkin | on different ports, yes |
| 11:17 | pepijndevos | really? *reads NC wiki* |
| 11:17 | danlarkin | different unix processes |
| 11:18 | yedi | happy release day, #clojure |
| 11:18 | yedi | what's on the celebration agenda |
| 11:18 | danlarkin | oh, looks like it can do it in the same process, but each is on its own port |
| 11:18 | hyPiRion | yedi: booze and cake |
| 11:19 | yedi | hyPiRion: ahh, can't go wrong with that |
| 11:19 | hyPiRion | exactly |
| 11:21 | aroemers | leiningen 2.0.0 out not too long ago, now clojure 1.5, happy times! |
| 11:22 | jajohnson | Using the jetty ring adapter I'm seeing a hard limit of 1k simultaneous connections. Even when increasing the max thread pool size and ulimit for the user - can't get the needle to move. |
| 11:23 | jajohnson | I have a graph, even! http://i.imgur.com/l8uD9lX.png |
| 11:23 | jajohnson | Anyone ever see something like this? |
| 11:24 | pepijndevos | danlarkin: ZNC seems to do PASS username:password. That would work a server as well, right? |
| 11:24 | hashbang1 | haha i love that you have a graph. I wish i could help but am clueless |
| 11:25 | danlarkin | pepijndevos: oh, that's smart, yeah maybe so |
| 11:25 | jajohnson | The actual count is 1009 simultaneous connections, if that means anything. The graph isn't completely clear on that point. |
| 11:26 | Fatalnix | what am I doing wrong here with :methods ? I've tried replacing them with nil and leaving them blank: http://pastebin.com/JHAgParQ |
| 11:27 | pepijndevos | danlarkin: Maybe I'll try implementing this, if it makes sense to you. |
| 11:27 | danlarkin | sure |
| 11:27 | danlarkin | IMO just using ZNC seems easier :) |
| 11:27 | pepijndevos | meh... |
| 11:27 | Fatalnix | I just keep irssi on a vps |
| 11:27 | Fatalnix | and screen it |
| 11:28 | Fatalnix | if you're talking about the IRC bouncer |
| 11:28 | Frozenlock | \o/ 1.5 baby |
| 11:28 | pepijndevos | danlarkin: why did you chose to use this in-memory clojure database? |
| 11:29 | weavejester | jajohnson: Have you tried increasing the amount of memory available to the VM instance? |
| 11:29 | danlarkin | I was use contrib's datalog way back when, but I was using such a small set of its features I decided to write something from scratch that suited what I needed |
| 11:29 | danlarkin | and that's what I ended up with |
| 11:30 | jajohnson | weavejester: I have, starting the jvm with java -server -Xms256m -Xmx3072m -Xss256k -- the vm doesn't ever break 1g though. |
| 11:31 | pepijndevos | danlarkin: I think that if the server is actually going to store messages, I would rather use something persistent. |
| 11:31 | aroemers | leiningen 2.0.0 out not too long ago, now clojure 1.5, happy times! |
| 11:31 | aroemers | whoops.. |
| 11:32 | danlarkin | pepijndevos: sure |
| 11:32 | Fatalnix | is lein using 1.5 yet though? |
| 11:32 | pepijndevos | I'll browse the code a bit over the weekend and see if it's something I'd like to hack on. |
| 11:34 | xeqi | Fatalnix: lein itself uses 1.4, but you can use whichever for your project |
| 11:34 | Fatalnix | yeah I know that much |
| 11:34 | weavejester | jajohnson: Curious. You've used the :max-threads option to set the max number of threads higher than 1000? |
| 11:35 | Fatalnix | EW |
| 11:35 | ambrosebs | Is Aaron Cohen in here? |
| 11:35 | Fatalnix | more than 1000 threads? that sounds dangerous. |
| 11:35 | Ember- | indeed |
| 11:35 | jajohnson | weavejester: yeah, it's set to 2k at the moment. |
| 11:35 | Ember- | oh wow |
| 11:35 | Fatalnix | fewwer threads + promises to make up for it? |
| 11:35 | jajohnson | Fatalnix: lots and lots of CPU and memory in these machines :) |
| 11:35 | Fatalnix | yeah but.. |
| 11:35 | weavejester | Fatalnix: It's a web server |
| 11:36 | hashbang1 | Fatalnix: depending on the hardware, i dont think thats unreasonable |
| 11:36 | Fatalnix | I dunno, it just doesn't sound right. |
| 11:36 | jajohnson | weavejester: toying with the ulimit on my load machine. may have fiddled with that incorrectly. one sec. |
| 11:36 | Ember- | linux kernel scheduler starts to spend more time on thread context switches than on anything else after something like 1500 threads if I remember correctly |
| 11:36 | Fatalnix | I would provide like 1 thread per x ammount of connections, and try some sort of non blocking like promise to handle them. |
| 11:37 | Fatalnix | so thered be like say 5 threads per 20 connections. |
| 11:37 | weavejester | jajohnson: What does ulimit -n say? |
| 11:38 | jajohnson | weavejester: 10k on the web server, still 1024 on the load server. think I missed the mod to the pam config to make it sticky-er. may explain what's going on here. |
| 11:39 | jajohnson | once I'm sure that takes, I'll run this again. |
| 11:39 | weavejester | Fatalnix: Jetty does use nio for connections, I believe. |
| 11:39 | Fatalnix | I see. |
| 11:40 | Fatalnix | I thought this was some custom codebase |
| 11:42 | jajohnson | weavejester: aha! we're in business! 2k connected. |
| 11:42 | jajohnson | the server was fine, it was my load machine. |
| 11:42 | jajohnson | most excellent. |
| 11:42 | weavejester | jajohnson: Ah, excellent :) |
| 11:43 | Fatalnix | huh, I wonder what if I build an interface instead of supplying methods in the ns form |
| 11:43 | Fatalnix | and the interface could be used for java to find methods? |
| 11:43 | jajohnson | weavejester: thanks for taking a moment. very much appreciate your work, btw. |
| 11:43 | weavejester | jajohnson: No problem |
| 11:49 | octagon | hi, how would i read in some clojure forms from a string and obtain an AST? |
| 11:50 | antares_ | octagon: read-string (if it is from a trusted source) |
| 11:50 | antares_ | ,(read-string "(count [1 2 3 4])") |
| 11:50 | octagon | antares_: read-string gives forms, but not an analyzed AST |
| 11:50 | clojurebot | (count [1 2 3 4]) |
| 11:51 | antares_ | octagon: what is analyzed AST in Clojure? |
| 11:51 | antares_ | octagon: forms are AST. Details of the Java compiler are not exposed much further, I believe |
| 11:51 | ambrosebs | Is this what you want? https://github.com/frenchy64/analyze |
| 11:51 | octagon | antares_: well metadata about the forms that is used in the compilation process. the AST is a map of some sort, which contains type info that the compiler uses |
| 11:52 | antares_ | octagon: I am not a Clojure compiler expert but from what I saw in the source, I don't think that's exposed via clojure.core |
| 11:52 | antares_ | and that it is meant to be easy to consume without knowing much about clojure.lang.Compiler internals |
| 11:52 | octagon | ambrosebs: thanks man, that looks like what i need |
| 11:52 | ambrosebs | antares_: You're correct. The above project digs it out with reflection. |
| 11:54 | octagon | antares_: sometimes you need to know the _meaning_ of forms, which is something that is done in the analysis phase. |
| 11:54 | ambrosebs | I think antares_ is worried that there is no official way of doing it, and he's right. |
| 11:55 | ambrosebs | analyze is a bit of a hack, but it does the job mostly. |
| 11:56 | octagon | ambrosebs: i'm working on a little structural editor for programming in clojure, so i need more than just the forms themselves |
| 11:57 | ambrosebs | there's a thread going on currently on the ml about a possible tools.analyze, you might be interested. |
| 11:57 | ambrosebs | ah, clojure-dev actually |
| 12:05 | cemerick | Bodil: why does cljs-noderepl define its own :eval fn (nrepl-eval)? It doesn't seem to do anything special. |
| 12:08 | pepijndevos | danlarkin: huh, it seems some bouncer code is already there: https://github.com/danlarkin/subrosa/blob/master/src/subrosa/plugins/catchup.clj |
| 12:08 | danlarkin | sortof |
| 12:08 | danlarkin | not exactly bouncer, just replying chat |
| 12:09 | Frozenlock | I'm somewhat afraid... I've tried a function that previously took 12 minutes with `map', and with `pmap' it took ~30s o_O (It's a network polling function) |
| 12:11 | hyPiRion | Frozenlock: 24x speedup? |
| 12:11 | Frozenlock | yeah |
| 12:12 | Frozenlock | Most of the time wasted was just 'waiting for other machine to respond', so I suppose it makes sense. |
| 12:14 | hyPiRion | still fast, I think pmap runs x + 2 tasks at most |
| 12:14 | hyPiRion | where x is core # |
| 12:25 | Frozenlock | I can't believe how fast it is now. Or how dumb I was doing everything in sequence. |
| 12:25 | mrb_bk | what's the preferred means of using lein2/repl with a github SHA commit as the dep in project.clj? |
| 12:27 | cemerick | mrb_bk: first, we mock you for using SHA-versioned dependencies. Then we hesitantly point you towards e.g. https://github.com/tobyhede/lein-git-deps |
| 12:28 | mrb_bk | cemerick: blame dnolen for putting shit on github that i want to play with! |
| 12:29 | cemerick | mrb_bk: Fair. Using checkout dependencies would probably be saner |
| 12:29 | leku | hi anyone use 'Joodo'? |
| 12:32 | mrb_bk | cemerick: ahhh right i forgot about thtose |
| 13:11 | Frozenlock | Is there a parallel 'for', just like pmap? |
| 13:47 | pandeiro | cemerick: would a couchdb log parsing utility be something appropriate for clutch? |
| 13:47 | cemerick | log parsing? |
| 13:47 | cemerick | like, from the couchdb process? |
| 13:47 | pandeiro | yeah |
| 13:48 | pandeiro | i need to do some work with my couchdb logs and i am here trying to write the parser and then i wondered if that were something that would belong in a couchdb client lib or not |
| 13:48 | cemerick | no, probably not |
| 13:48 | cemerick | why would you be parsing couchdb logs? |
| 13:49 | pandeiro | well i need to do some analysis and i was inspired by mmcgrana's talk at 2011 conj i think it was |
| 13:49 | pandeiro | about logs as data |
| 13:49 | pandeiro | i would love to just transform them into a map |
| 13:49 | pandeiro | a sequence of maps i mean |
| 13:50 | cemerick | sure |
| 13:50 | pandeiro | maybe i am missing some tool that already does this? |
| 13:50 | cemerick | but, you're talking about application logs, then? |
| 13:50 | cemerick | not the couchdb process' log file? |
| 13:50 | pandeiro | yeah, /var/log/couchdb/couch.log |
| 13:51 | cemerick | ah, ok, that makes a lot more sense |
| 13:51 | cemerick | it's certainly something that could *use* couch |
| 13:51 | cemerick | s/couch/clutch |
| 13:51 | cemerick | probably not something that should be in the client API |
| 13:51 | seangrove | Should I (or is it even possible to) type-hint functions and return values in cljs libraries I'm writing? |
| 13:52 | pandeiro | is there a lib out there that will do that parsing for me? like i somehow define a grammar and it does the hard stuff? |
| 13:52 | pandeiro | there's a good couchdb log parser for nodejs that i could use to create JSON and just flip it over |
| 13:53 | gfredericks | can repositories configured in leiningen have proxy info included? |
| 13:55 | cemerick | pandeiro: Not sure. I'm sure there's a ton of log parsing libs in Java-land. |
| 13:58 | DaReaper5 | Quick question: how do i get the lenght of (.toByteArray out-stream) |
| 13:58 | Frozenlock | Any clojuredocs maintainter in here? I would REALLY like an autofocus function for the search field :) |
| 13:58 | DaReaper5 | (.length (...)) does not wrk |
| 13:58 | DaReaper5 | work* |
| 13:58 | gfredericks | DaReaper5: count should work |
| 13:58 | DaReaper5 | ok thanks |
| 13:58 | dakrone | Frozenlock: I maintain it since zkim left, but I'm not really a rails person |
| 13:58 | znDuff | DaReaper5: alen, IIRC |
| 13:58 | gfredericks | ,(-> [1 2 3 4] (into-array) (count)) |
| 13:58 | znDuff | count is expensive. |
| 13:58 | clojurebot | 4 |
| 13:58 | znDuff | ...well, potentially expensive. It doesn't promise not to be expensive. |
| 13:58 | gfredericks | is it? |
| 13:59 | gfredericks | for arrays? |
| 13:59 | Frozenlock | dakrone: Ah? clojuredocs isn't written in clojure o_O |
| 13:59 | znDuff | For arrays, there's alength |
| 13:59 | dakrone | Frozenlock: not the first iteration, we're working on a rewrite in clojure |
| 13:59 | DaReaper5 | alength? ill try that |
| 14:00 | Frozenlock | dakrone: Well let me tell you that I find it to be an amazing resource :) |
| 14:01 | dakrone | Frozenlock: glad you like it, it definitely shows its age though |
| 14:08 | Frozenlock | When I started using clojure, it was so that I could use an existing java library. And yet, I find myself canalizing and re-writing more and more of its part in clojure. |
| 14:08 | Frozenlock | I find that awesome, but at the same it's like I completely missed my goal -_- |
| 14:08 | Frozenlock | *time |
| 14:11 | gfredericks | any way to use proxies in leiningen for deploy repos? |
| 14:14 | cemerick | gfredericks: you can definitely set a global proxy configuration. There may be per-repo options too, but I don't recall atm. |
| 14:14 | gfredericks | they only thing I saw was some env variables; I guess that's what you mean by "global proxy configuration"? |
| 14:16 | jsims | I'm trying to use atoms with lazy seqs…attempting to do something like this give me an out of memory error: (swap! (atom (range)) next) is there a lazy way to do this? |
| 14:17 | cemerick | gfredericks: yeah; actually, looks like that's all that's available. Aether supports per-repository proxies, but only allows one per dependency resolution. |
| 14:17 | cemerick | s/but/but pomegranate |
| 14:18 | gfredericks | `lein deploy` failed because leiningen was trying to sign the jar |
| 14:19 | Bronsa | mmh, one of my ticket in jira has been closed because the test case I provided couldn't be reproduced because it got fixed by another commit, I have another case where that bug still holds though, should I reopen the ticket myself or just leave a comment? |
| 14:20 | Bronsa | I have sufficent permissions to reopen the ticked, I'm not sure if I'm supposed to do so though :) |
| 14:20 | technomancy | http://p.hagelb.org/mystery.gif |
| 14:22 | amalloy | jsims: that OOM is from the repl trying to print the whole range for you |
| 14:23 | znDuff | Why is pull-seq in clojure.data.xml private? |
| 14:23 | jsims | amalloy: you're right….grr. thanks |
| 14:24 | gfredericks | are there docs somewhere on why lein is trying to sign my jar? |
| 14:24 | technomancy | gfredericks: :sign-releases for the given :repositories entry isn't set to false |
| 14:25 | technomancy | I think it's covered in `lein help deploying`; if not it should be |
| 14:25 | gfredericks | technomancy: aw man I swear I had skimmed DEPLOY.md thoroughly enough :D :( |
| 14:25 | hyPiRion | gfredericks: Yeah, I hate it when Leiningen is trying to do the right thing™ |
| 14:25 | gfredericks | hyPiRion: I don't mind it doing that I just couldn't figure out how to get it to do anything else |
| 14:26 | hyPiRion | ah |
| 14:30 | devn | https://github.com/tpope/heroku-fucking-console |
| 14:30 | devn | whoops, wrong channel |
| 14:30 | Gonzih | hehe, nice plugin :) |
| 14:30 | devn | haha, yeah, great name |
| 14:37 | TimMc | Good license as well. |
| 14:38 | TimMc | I can't remember whether Legal ever got back to me at my last job about whether we could incorporate WTFPL code into our products. |
| 14:39 | Arafangion | Don't they usually just say "no"? |
| 14:39 | devn | That's just an excuse people use to not ask |
| 14:40 | devn | but i would imagine the answer is often "no", simply because they don't want to spend the time |
| 14:40 | technomancy | at least it's not the JSON license |
| 14:40 | technomancy | ("must be used for good, not evil") |
| 14:40 | devn | ugh |
| 14:40 | cemerick | oh, that's funny |
| 14:41 | Arafangion | devn: It's the less risky answer, too, from their perspective. |
| 14:41 | devn | *nod* |
| 14:41 | TimMc | technomancy: That would be a fantastic court case. |
| 14:42 | technomancy | TimMc: could be fun to issue C&Ds to DRM systems found in violation |
| 14:42 | TimMc | Except the lawyers would probably argue that that's meant to be silly, and therefore not material. |
| 14:42 | hiredman | "man is evil, there for no one can use json" |
| 14:43 | cemerick | sounds like progress |
| 14:43 | technomancy | "the prosecution would like to draw your attention to exhibit A: Contra Pelagius by St. Augustine of Hippo" |
| 14:44 | TimMc | snrk |
| 14:45 | leku | loll |
| 14:45 | leku | type 'do the harlem shake' into the youtube search field on the mainpage |
| 14:47 | S11001001 | devn: I've seen a legal team delay for literally years on getting back to me on such a subject, despite pinging every month or so. So no thanks. |
| 14:48 | Frozenlock | Is there a function in core that does `(if (coll? x) x [x]) ? |
| 14:48 | S11001001 | coincidentally I saw this today https://www.gnu.org/licenses/license-list.html#JSON |
| 14:55 | technomancy | that seems to imply the license is on the format, not an implementation of a parser |
| 14:55 | technomancy | I don't think that's actually possible? |
| 14:56 | technomancy | oh, misread; nm |
| 14:56 | randomenduser | if I have nrepl running with `lein repl`, what's a good way just to send one command to that instance from another terminal and get the output? |
| 14:57 | gfredericks | so most config approaches seem to rely on a single "config.clj" being available on the classpath, implying that the file is creating dynamically based on the environment you want; if that's the case, is hooking around `lein jar` or some other task the best place to create the config.clj file? |
| 14:57 | gfredericks | or profiles with extra classpath dirs? |
| 14:57 | technomancy | randomenduser: you would need leiningen 2.1.0-SNAPSHOT to do that |
| 14:57 | hiredman | gfredericks: carica looks at all config.clj files on the classpath and merges them |
| 14:57 | gfredericks | hiredman: that's what I was looking at |
| 14:57 | technomancy | (inc carica) |
| 14:57 | lazybot | ⇒ 1 |
| 14:58 | technomancy | randomenduser: :eval-in :nrepl |
| 14:58 | randomenduser | technomancy, so it'll be available in 2.1.0? I'll check out the docs for that version, thanks :) |
| 14:58 | technomancy | randomenduser: currently only on git master |
| 14:58 | gfredericks | I guess I haven't figured out how that translates to "now I'm going to deploy to UAT" |
| 14:58 | hiredman | gfredericks: at work we have config files with defaults that get built in to the jars, then chef generates overriding configs and puts them on the classpath |
| 14:58 | randomenduser | technomancy, hmm, what about from bash? |
| 14:58 | hiredman | gfredericks: so for us chef knows what stack it is deploying to and what values to put where |
| 14:58 | technomancy | randomenduser: bash is a shell? |
| 14:59 | gfredericks | hiredman: okay so your deployed runtime config file is not in the jar? |
| 14:59 | gfredericks | (or there is one but it's overridden) |
| 14:59 | hiredman | gfredericks: some parts are overridden, some are not |
| 14:59 | hiredman | carica does a merge |
| 15:00 | randomenduser | technomancy, yes? are you saying :eval-in will work there? or is that a command I can pass to leiningen or something? |
| 15:00 | hiredman | so there are configs in the jar and configs on disk written by chef |
| 15:00 | technomancy | randomenduser: you need an nrepl implementation to communicate with a running repl process. Leiningen includes one, which can be activated by putting :eval-in :nrepl in project.clj or a profile |
| 15:00 | technomancy | or you could use another nrepl client like nrepl.el (from eshell) or jark (which I'm not sure works yet) |
| 15:01 | gfredericks | hiredman: that's helpful, thanks |
| 15:02 | technomancy | something like jark would be best if you don't use eshell since you wouldn't have to pay a startup time penalty, but development on it doesn't seem particularly active |
| 15:02 | randomenduser | technomancy, ahh, so I need to either write a client or use one is what you're saying? that makes sense. what I'm trying to do is run a command in the shell, and see it's output in some other shell (that's running `lein repl`) |
| 15:03 | ljos | Is there a way to apply a constructor over a seq? something like this, just that doesn't work: (apply Integer. [1]) |
| 15:03 | gfredericks | I think only with reflection |
| 15:03 | gfredericks | unless you have the seq at compile-time |
| 15:04 | ljos | What if it is a record instead> |
| 15:04 | ljos | ? |
| 15:06 | technomancy | randomenduser: you could do something simpler by just opening a socket in your application code and sending stuff via netcat |
| 15:07 | ljos | gfrederics: I think map->Contructor might help; thanks. |
| 15:07 | technomancy | but all the existing tooling centers around nrepl |
| 15:30 | randomenduser | technomancy, opening a socket? that sounds good. do I just send something like this to the running nrepl: https://github.com/clojure/tools.nrepl/blob/e7cd0d44fd4b7c9c0589cf9a3abf4b2654aa3518/src/main/clojure/clojure/tools/nrepl.clj#L148 |
| 15:31 | randomenduser | technomancy, also, the output (and input from my socket, I guess) would show up in the running repl, right? |
| 15:31 | technomancy | randomenduser: for nrepl you need to use bencode, which is more complicated unfortunately. I meant if you want to avoid bencode you could just use a socket-repl. |
| 15:32 | randomenduser | technomancy, why would I need to use bencode? I think I need to get a POC up to understand this more |
| 15:33 | hiredman | nrepl uses bencode |
| 15:33 | hiredman | nrepl is not just a repl on a socket |
| 15:33 | technomancy | https://github.com/technomancy/server-socket <- this is probably more in line with what you're looking for |
| 15:33 | technomancy | you can just netcat straight to it and not worry about bencode |
| 15:34 | randomenduser | technomancy, fancy :) thanks |
| 16:17 | craigbro | dakrone: aroundp? |
| 16:17 | craigbro | dakrone: a clj-http question |
| 16:17 | dakrone | craigbro: what's up? |
| 16:18 | craigbro | dakrone: looking in request, it appears that you don't shutdown the conn-mgr if in lines 240 - 244 of core.clj |
| 16:18 | craigbro | there is an error |
| 16:18 | craigbro | I don't know apache http client well enough, but it would seem to me that should be try/finally'ed |
| 16:19 | dakrone | true, I should move the when predicate to a finally block there |
| 16:19 | craigbro | ok, so we discovered it 8) |
| 16:19 | craigbro | hehe |
| 16:19 | craigbro | I have an http API for a sublayer of our app |
| 16:20 | craigbro | and when one of our users scripted some stuff againt our top level HTTP api, we saw hundreds of sockets open |
| 16:20 | craigbro | cause he was calling an API call that resulted in a 406 or some other error from the second level HTTP api |
| 16:21 | craigbro | me gusta clj-http |
| 16:21 | dakrone | craigbro: glad to hear it, if I push this to master can you give it a try and let me know if it works for you? |
| 16:22 | craigbro | ok, I'll have ot figure out how to get it into my app |
| 16:22 | craigbro | I've not yet explored the hell of git deps in lein etc.. |
| 16:22 | dakrone | craigbro: how are you using it currently? |
| 16:22 | craigbro | clojars |
| 16:22 | technomancy | snapshots |
| 16:22 | technomancy | plz |
| 16:22 | craigbro | I could aso just monkey patch that function |
| 16:23 | craigbro | and test it that way |
| 16:23 | dakrone | yea, I can push a snapshot |
| 16:26 | dakrone | craigbro: pushed clj-http-0.6.5-SNAPSHOT |
| 16:26 | technomancy | I mean in general any time you're tempted to use git deps you should use snapshots instead |
| 16:26 | craigbro | dakrone: am I corect that (execute DefaultHTTPClient....) will throw an error on a 406 or 404 or any non 200? |
| 16:27 | dakrone | craigbro: no, it shouldn't; exceptions are handled by wrap-exceptions in client.clj |
| 16:27 | craigbro | dakrone: ok, but that would trigger this boog |
| 16:27 | craigbro | dakrone: the case here is that I was calling something that returned a 40? |
| 16:27 | dakrone | craigbro: do you have a stacktrace? |
| 16:28 | craigbro | not handy, but I can scare one up |
| 16:28 | dakrone | that would be excellent |
| 16:28 | craigbro | i don't have a non production recipe yet, so... |
| 16:28 | craigbro | ok, I have it here |
| 16:29 | craigbro | https://gist.github.com/craigbro/5067961 |
| 16:29 | craigbro | you can see wrap-exceptions catch it |
| 16:30 | dakrone | yea, in that case, it should have been shut down |
| 16:30 | craigbro | dakrone: are you saying that wrap-exception wouldhave shut it down? |
| 16:31 | dakrone | no, it would have been shut down previous to that, core.clj wouldn't do the actual exception throwing, so the .shutdown would have happened |
| 16:31 | dakrone | are you using connection pooling by chance? |
| 16:31 | craigbro | not on this code path |
| 16:32 | gfredericks | lastlog -clear |
| 16:32 | craigbro | dakrone: to be clear, I'm still running the old code here |
| 16:33 | craigbro | dakrone: I see only two calls to .shutdown, one in coerce body type, and then that one insdie the (when clause in request |
| 16:34 | dakrone | yea, but the exception isn't actually short-circuiting the shutdown in core.clj, so I'm not sure how it would remain open |
| 16:34 | dakrone | how are you checking for the open connections? |
| 16:35 | craigbro | netstat 8^) |
| 16:35 | craigbro | I will get a recipe to reproduce this |
| 16:35 | dakrone | so, it may be that the connection has been closed by clj-http, but is still in a half-open state from the OS perspective |
| 16:36 | craigbro | we have 1k+ sockets in established and 588 sitting in CLOSE_WAIT |
| 16:36 | craigbro | the CLOSE_WAIT would be what you are talking about |
| 16:36 | craigbro | the 588 are sitting in close_wait (aka, no change in the set of sockets) |
| 16:37 | dakrone | craigbro: hmm, if you do have a way to reproduce, I'd be very interested in figuring it out |
| 16:37 | craigbro | one of our devs did alot of android work, and apparently this is a big issue with the http client (built on apache http client) |
| 16:37 | dakrone | are you starting 1000 threads each doing a request? |
| 16:37 | craigbro | dakrone: yah, I'll work on that, I just came across the issue with the .shutDown being bypassable when reviewing code |
| 16:38 | craigbro | dakrone: nope, not even close to that number |
| 16:38 | craigbro | dakrone: which is why I was suspicious of conn-mgr being left alive |
| 16:38 | dakrone | craigbro: let me run some tests with itsy and see if I can reproduce it locally |
| 16:38 | craigbro | dakrone: I'll work on a recipe here too |
| 16:38 | dakrone | craigbro: can you open an issue with clj-http so I don't forget it? |
| 17:07 | mpenet | is there a way to have print statements from another thread show in the nrepl buffer? |
| 17:07 | mpenet | it worked in slime |
| 17:12 | rabbit_airstrike | I feel like a similar question was asked an hour or two ago |
| 17:13 | casion | there's has to be some sort of end of the loop of trying to learn web development, where every guide/tutorial says "just like in ruby/python" |
| 17:13 | casion | clojure seems to be no exception to this :| |
| 17:13 | rabbit_airstrike | "<randomenduser> if I have nrepl running with `lein repl`, what's a good way just to send one command to that instance from another terminal and get the output?" |
| 17:14 | rabbit_airstrike | mpenet: is that more or less similar to what you're looking for? |
| 17:15 | mpenet | not really |
| 17:15 | rabbit_airstrike | oh well :/ |
| 17:16 | mpenet | I am testing multithreaded code, and it seems some statements don't show depending which thread does them. |
| 17:17 | mpenet | anyway, I am using atoms instead, but for quick (and dirty) testing, it was useful |
| 17:17 | rabbit_airstrike | maybe send messages to a single logging agent? |
| 17:18 | rabbit_airstrike | I'd love to hear the best solution in this case |
| 17:19 | mpenet | odd (future (println :foo)) just works, I'll have to dig in the giant pile of java that does the threading magic |
| 17:23 | mpenet | well no, the magic is in future, (.start (Thread. (fn [] (println :foo)))) outputs nothing |
| 17:25 | mpenet | this works though, good enough for now (.start (Thread. (bound-fn [] (println :foo)))) |
| 17:26 | craigbro | dakrone: so, I cannot get a anice reproduction of our sitaution on my local machine |
| 17:26 | craigbro | dakrone: s/anice/naive |
| 17:28 | dakrone | craigbro: hmm, well I'll try to get something that does it on my end |
| 17:32 | craigbro | dakrone: I'm keeping at it too |
| 17:33 | craigbro | dakrone: one issue with this production instance is we are getting a weird mix of tcp and tcp6 |
| 17:34 | dakrone | craigbro: that I have no idea about, is your DNS sending ipv6 stuff? |
| 17:34 | craigbro | dakrone: should not, we removed the :::0.1 or whaever from /etc/hosts |
| 17:35 | craigbro | dakrone: it looks like that bug I brought up earlier is a red herring tho |
| 17:35 | craigbro | dakrone: prolly a good idea to put tht in a finally anyways, since .execute is declared to throw 2 different exception types |
| 17:35 | craigbro | dakrone: I'm getting more suspicious of it being some environment issue tho |
| 17:36 | dakrone | are you blocking reset packets in some way that prevents connections from being entirely closed? |
| 17:37 | craigbro | dakrone: this is all over localhost |
| 17:37 | craigbro | dakrone: no blockination 8) |
| 17:37 | dakrone | could try 127.0.0.1 to prevent DNS |
| 17:39 | craigbro | dakrone: intrestinly enough, when I do that on my local machine, i still get tcp6 |
| 17:39 | craigbro | dakrone: however curl to 127.0.0.1 uses tcp |
| 17:39 | craigbro | dakrone: oh, the world is a funny place 8) |
| 17:39 | dakrone | interesting |
| 17:40 | craigbro | dakrone: when I reproduce the errors we were getting I get sockets properly going into TIME_WAIT |
| 17:40 | jonasac | is there something like lein execute or something that would let me run a clojure file more like a script |
| 17:41 | mindbender1 | is there a way to use cljsbuild as a development middleware? |
| 17:42 | craigbro | dakrone: anyways, thanks for your help so far, consider this one punting back into my half until I have a working recipe for you 8) |
| 17:42 | dnolen | mindbender1: googling turned this up http://github.com/jblomo/ring.middleware.clojurescript |
| 17:42 | dakrone | craigbro: np, I'll let you know if I find anything while trying to reproduce |
| 17:42 | corecode | hi there |
| 17:43 | corecode | is (mapv (fn ...) ...) a common construct, or are there other ones that are more typical? |
| 17:44 | mindbender1 | dnolen: thanks, I think that's great I'll investigate it further |
| 17:48 | squidz | what would be the preferred way of developing interactive web app graphics. Use clojurescripts c2 library for d3.js, or code in javascript then compile with closure |
| 17:50 | rabbit_airstrike | I thought c2 was inspired by but distinct from d3? |
| 17:50 | rabbit_airstrike | last I looked into it c2 wasn't well suited to animations which bummed me out |
| 17:51 | rabbit_airstrike | "Unlike D3, C2 does not have an animation system, although you can use CSS transitions to perform animations." |
| 17:51 | squidz | yeah that's also what I heard. So is it common practice to have pieces of code in java script alongside clojurescript |
| 17:51 | rabbit_airstrike | unfortunately I don't know much more than that, hopefully someone else here does |
| 17:52 | squidz | ill wait and see if anybody is awake |
| 17:53 | mpenet | squidz: yes, cljs-build helps with all that |
| 17:54 | mpenet | you will need an externs file for d3 if you want to compile in advanced mode |
| 17:54 | Frozenlock | Oh the rabbit hole of `externs'... |
| 17:54 | mpenet | not really, it's often 1 google search away |
| 17:55 | mpenet | there are a few here as well https://code.google.com/p/closure-compiler/source/browse/#git%2Fcontrib%2Fexterns |
| 17:55 | squidz | mpenet: so it is common practice, okay that's what I wanted to know before embarking on my journey. Also, if a project requires javascript, would compiling clojurescript with closure produce readable js for non-clojurists. I assume it could be readable but not neccisarily beautiful in non-advanced mode |
| 17:56 | Frozenlock | mpenet: I spent a day trying to figure out to make my own externs, and then making sure it was included when jaring everything. |
| 17:57 | Bodil | squidz: Frankly, I'd avoid JS as much as possible. At the very least, write a wrapper. |
| 17:57 | mpenet | if not in advanced it is somewhat readable for a developer with js + clojure knowledge. But it won't be as clear as say coffeescript |
| 17:58 | mpenet | yeah +1 on thin wrappers |
| 17:58 | squidz | okay, thanks for the tips guys |
| 18:07 | lynaghk | squidz: C2 is a lot of the same ideas as D3, but implemented entirely in Clojure/ClojureScript. That said, it's definitely not as complete as D3 is w.r.t. different scales and layout functions |
| 18:08 | squidz | lynaghk: okay, so as much as i'd like to use c2, I think i'll have to wait until it matures |
| 18:08 | lynaghk | squidz: As for animation, there's no explicit support for JavaScript tweening because that's a disaster for performance on mobile. We do tons of animated stuff with C2---we just use CSS animations |
| 18:08 | squidz | lynaghk: do you have any examples? |
| 18:09 | squidz | of css animations that is |
| 18:10 | lynaghk | squidz: nah, not anything specific to CSS animation |
| 18:10 | squidz | okay. I will probably use c2 for personal stuff, but I will probably have to drop to using d3 for when i'm doing stuff for others |
| 18:11 | lynaghk | that's an orthogonal topic to C2. The tl;dr is to just add "transition: all 1s" to your CSS, and then any style property changes will animate over 1 second. |
| 18:12 | squidz | lynaghk: i was actually watching your talk before you messaged me on http://blip.tv/clojure/kevin-lynagh-extending-javascript-libraries-from-clojurescript-5919758 |
| 18:12 | lynaghk | squidz: it's definitely worth considering the tradeoffs of language/library popularity if you're building something that needs to be maintained or extended by others. The JavaScript and D3 communities are an order of magnitude or two larger than ClojureScript and C2. |
| 18:14 | lynaghk | squidz: hope you find something helpful/interesting in there =) That's a pretty old talk---at least, it was before C2. If you want to hear more recent talks they're all at http://keminglabs.com/talks/ |
| 18:14 | squidz | oh thanks ill definitely take a look |
| 18:14 | lynaghk | Bodil, mpenet: just curious, what benefits are you getting from writing wrappers around JavaScript stuff? |
| 18:17 | Bodil | lynaghk: It gives me more concise and (pardon the French) more idiomatic code. |
| 18:18 | squidz | lynaghk: just a quick question. When you develop frontend stuff, I assume you use some sort of templating library. Do you use enlive/hiccup or something else? |
| 18:18 | lynaghk | Bodil: heh. Have you seen Zach Tellman's talk about wrapping Java API's from Clojure/west last year? |
| 18:19 | lynaghk | squidz: we've typically used HAML, but we just switched to Slim |
| 18:19 | Bodil | lynaghk: Though I'm not advocating wrappers over native Cljs. :) |
| 18:19 | squidz | lynaghk: okay thanks |
| 18:19 | Bodil | lynaghk: No. But I will if you tell me I should. :) |
| 18:19 | lynaghk | squidz: almost all of our stuff is clientside applications though---we don't generate any markup serverside. |
| 18:19 | saolsen | When you reset! an atom, which thread do any of the atom watchers get called on? Do they get called on the same thread and execute before the reset! returns? |
| 18:20 | squidz | lynaghk: so you are using ruby? |
| 18:20 | lynaghk | Bodil: you should, it's a great talk about the tradeoffs of writing wrappers. |
| 18:20 | squidz | do you maybe have a link to that talk? |
| 18:21 | Bodil | And please please let it not be on InfoQ... |
| 18:21 | lynaghk | squidz: yeah, the templating story is much more mature in the Ruby world than the Clojure world (e.g., Compass is essential for doing any real design work). Also most solid designers are already familiar with those things. |
| 18:22 | lynaghk | Bodil, squidz: http://www.infoq.com/presentations/Distilling-Java-Libraries |
| 18:22 | squidz | so it is just the templating? or are yall also using rails |
| 18:23 | lynaghk | squidz: just templating; most of our apps have been rich frontends hitting either existing or custom-designed Compojure-based APIs |
| 18:23 | squidz | okay thanks. Interesting to know. And thanks for the talk ill take a look |
| 18:24 | akhudek | you can use compass with clojure + enlive |
| 18:24 | lynaghk | squidz: although now that I think about it we've outsourced a few Rails backends for totally-stock CRUD apps rather than reinvent that wheel in Clojure. |
| 18:25 | squidz | : yeah I can understand. |
| 18:26 | pandeiro | clojure.data.json is faster than cheshire? |
| 18:26 | dakrone | pandeiro: shouldn't be |
| 18:27 | akhudek | last I heard cheshire was the fastest |
| 18:27 | akhudek | though things could have changed |
| 18:28 | pandeiro | just parsed a 411kb json file with no key fn or anything and clojure.data.json/read-str outperforms cheshire/parse-string |
| 18:29 | dakrone | pandeiro: did you use criterium to benchmark it? |
| 18:29 | pandeiro | dakrone: nope, just did a dirty bench inside nrepl.el |
| 18:31 | pandeiro | wow lighttable just keeps updating itself right before my eyes |
| 18:41 | n_b | Having a tiny bit of trouble with lazy-cat here and thinking I'm doing something very stupid - https://gist.github.com/nickbarnwell/5068816 |
| 18:43 | n_b | Running into an eventual memory overflow, which is, I assume from exec-request continually concatting until everything blows |
| 18:44 | n_b | but I'd expect that to only happen once more requests had actually been realised |
| 18:45 | hiredman | too many concats will blow the stack |
| 18:46 | n_b | right, but shouldn't lazy-cat return a lazy seq? |
| 18:47 | hiredman | but once you realize it puts one method call on stack per lazy-seq layer |
| 18:48 | hiredman | so, for example, if resp once is nil or empty lots, and you have lots of (lazy-cat resp (genenerte-more-resp)) once you go to realize it, it explodes |
| 18:49 | pandeiro | dakrone: yeah so with criterium cheshire is >2x faster.. happy to discover that tool, thanks |
| 19:01 | n_b | hiredman: oh, I've done it again. I always forget REPL tries to realise the entire seq before printing it >> |
| 19:02 | n_b | so my fn *does* work, just not if I do => (fn foo bar) |
| 19:12 | doerp | hi; I'm relatively new to languages targetting the JVM. Is it a reasonable idea to assume I can write GUI applications in Clojure (and, say, Seesaw) and use lein uberjar to produce something that will run on major platforms with a JVM? |
| 19:14 | znDuff | doerp: Yes. |
| 19:16 | doerp | I don't know why I dismissed this for so long, then :P |
| 19:17 | doerp | not a huge fan of Java, but Clojure looks like a lot of fun... |
| 19:18 | znDuff | doerp: It is that. Takes a bit to get into the mindset if you don't have experience with other functional languages, but well worth it once you're there. |
| 19:20 | doerp | I spent a decent amount of time with CL back in the day, so this is a little mind blowing that I can actually deploy it easily |
| 19:41 | majyk | in counterclockwise is there a way to disable the namespace hint that shows right below the tab for the current file being edited? |
| 19:52 | trenthauck | Hi, I have a csv file, what is good way to work with it? Idealy I'd be able to refer to columns be a header, and calculate simple aggregate statistics... |
| 19:52 | trenthauck | be = by |
| 19:52 | hiredman | there is a csv parser in contrib |
| 19:52 | hiredman | http://clojure.github.com/data.csv/ |
| 19:54 | trenthauck | thanks - I should've been more specific - I already have what I think is an seq... I'm new to clojure... how can I process taht |
| 19:54 | hiredman | http://clojure.org/sequences |
| 19:56 | trenthauck | (rest (-main)) |
| 19:56 | trenthauck | exit |
| 20:10 | harob | Is there a way to create an agent with a bounded queue size? e.g. Such that `(send ag foo)` would block if ag already has 100 tasks in its queue. Or is there another pattern that would give similar functionality? |
| 20:11 | bbloom | harob: you can just use java's concurrent queues |
| 20:12 | harob | bbloom: Would I still be able to use an agent, or would I just use a future that consumes the queue? |
| 20:12 | bbloom | depends on your use case |
| 20:13 | amalloy | harob: i thought of writing such an agent once, and it turned out to be harder than i expected: a lot of agents' existing functionality is tangled together with the idea of using a c.l.PersistentQueue |
| 20:15 | harob | I am processing some huge files (larger than can fit in memory - I am reading them line by line, doing some processing and then writing out to various other files). To speed things up I am parallelizing as much as possible, and in particular want to do some of the output work in an agent. But if the agent gets too backed up then its queue might blow the heap, hence the bounded requirement. |
| 20:15 | harob | amalloy: how did you end up resolving your need then? |
| 20:18 | preyalone | Where can I find an MSI installer for Clojure that adds a "clj.exe" to PATH? The typical "clj.bat" in most installers isn't compatible with Git Bash (msysGit). |
| 20:25 | AtKaaZ | i guess I could add a way here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=385973 |
| 20:26 | technomancy | preyalone: don't install Clojure |
| 20:26 | AtKaaZ | oops wrong window, sorry |
| 20:27 | preyalone | technomancy: Let me guess... "Install Leiningen"? |
| 20:27 | preyalone | Because Chocolatey Leiningen fails, and so does the "Cygwin-compatible" shell script. |
| 20:27 | preyalone | I've looked at five different vectors for installing Clojure, and they're all terrible, some 3 years out of date. |
| 20:28 | preyalone | That Clojure is based on a JAR is really cool, but it's a reasonably critical feature that the JAR be deployed with a one-click MSI installer in Windows. |
| 20:28 | technomancy | they're all terrible because no one uses them |
| 20:29 | preyalone | In particular, some Windows installers for Clojure DO work, but they only add a "clj.bat", which Git Bash can't run. "clj.exe" is a more flexible target for this reason, but most installers don't provide one. |
| 20:30 | hiredman | what technomancy said |
| 20:30 | hiredman | preyalone: what do you want such a thing? |
| 20:31 | hiredman | why |
| 20:33 | preyalone | hiredman: Do you use Windows? |
| 20:33 | hiredman | of course not |
| 20:33 | AtKaaZ | preyalone: did you try lein.bat ? |
| 20:35 | preyalone | AtKaaZ: Yes. I tried Chocolatey Leiningen, lein.bat, and the "Cygwin-compatible" lein shell script. All fail, either silently, or with thrown Java errors. |
| 20:35 | AtKaaZ | preyalone: ok i see you just replied that on ML |
| 20:35 | hiredman | generally the why I run clojure/clojure code breaks down in to 1. developement (run, tests, do builds etc) which lein does 2. "production" which is run from a jar via java … or was a war via jetty-runner 3. as a "script" with #!/path/to/java -jar /path/to/clojure.jar |
| 20:35 | AtKaaZ | but lein.bat from master? or other? |
| 20:36 | preyalone | AtKaaZ: Whatever the official Leiningen repo's README linked to. |
| 20:37 | preyalone | The point is, I've tried more than a few ways to install Clojure, and they all suck. Needs MSI installer. |
| 20:38 | hiredman | preyalone: that runs counter to how clojure is typically used |
| 20:38 | hiredman | generally clojure is just another library dependency that your build system (lein, maven, ?) deals with |
| 20:38 | preyalone | hiredman: Not so. That Clojure is at its core a JAR is great, but the JAR's delivery needs a nice wrapper. Hence Homebrew Clojure, Chocolatey Clojure, Aptitude Clojure, ... |
| 20:39 | hiredman | preyalone: yeah, those are all dumb and I would never use them |
| 20:39 | preyalone | I'm not taking the bait. |
| 20:39 | hiredman | there is a reason why the scripts suck, it is because no one uses them, and the reason no one uses them is they are dumb |
| 20:40 | AtKaaZ | I'll check latest lein.bat and see what's "wrong" |
| 20:40 | preyalone | Clojure installed very nicely on my MacBook with Homebrew. |
| 20:40 | hiredman | :( |
| 20:40 | hiredman | ridiculous |
| 20:40 | preyalone | Clojure also installed incredibly well on my Android phone through the Google Play store (Clojure REPL app). |
| 20:41 | kzar | If you've got a tree and you're starting at the root how do you come up with a list of the complete path to each leaf node? I did it in PHP by writing a recursive function that, when there were no children, just printed the path out. I can't figure out how to do something similar in a functional way though and it's bugging me |
| 20:41 | preyalone | AtKaaZ: Thank you, I'll redownload it and paste error traces. An hour ago, it successfully downloaded a JAR, but silently halted after that and never finished self-installing. |
| 20:43 | preyalone | AtKaaZ: I don't mind having to run the initial lein.bat setup through a Command Prompt, just as long as the end result can be run from Git Bash. |
| 20:43 | akhudek | kzar: look up clojure.zip |
| 20:44 | AtKaaZ | preyalone: ok, though I only ever used lein.bat but I do still have git bash |
| 20:45 | preyalone | AtKaaZ: This is what lein.bat is doing on my computer. http://pastebin.com/A82E0auL |
| 20:45 | kzar | akhudek: I was hoping to understand the idea behind how to do it rather than using a library to do it for me. |
| 20:47 | akhudek | kzar: basically, you want to walk the tree and carry around some state that tracks the current path |
| 20:47 | AtKaaZ | preyalone: i see that lein.bat got changed since last time I used it... what does lein bash script do? |
| 20:47 | akhudek | that library implements something called a "functional zipper" that does exactly that |
| 20:48 | akhudek | I think there are some talks/tutorials around that explain the details behind the zipper |
| 20:48 | preyalone | AtKaaZ: From what I gather, every lein... thing is supposed to download a leiningen bootstrap script in order to perform "self-install", the real leiningen installation process. |
| 20:48 | akhudek | it's not too complicated |
| 20:48 | craigbro | dakrone: reproced it, but don't think it's a clj-http issue at all |
| 20:48 | kzar | akhudek: Right I get the part of passing the path along down to the leaf node a step at a time, but how do you get that path back to the result if you can't just print it out or modify some variable outside? |
| 20:49 | craigbro | dakrone: so in ring you can provide a stream as the body of a response, and it appears that if the client shuts down the connection, that stream stays open indefinetly |
| 20:49 | craigbro | dakrone: and in our case, that meant damn near forever |
| 20:49 | hiredman | cute |
| 20:49 | craigbro | so, a client polling us with a timeout on their client, was effectively DoSing us do to this FD leak |
| 20:49 | akhudek | kzar: add it to a container in your state |
| 20:49 | hiredman | time for an ExpiringInputStream |
| 20:50 | AtKaaZ | preyalone: they're both failing on my system now http://pastebin.com/GCjVpXDa |
| 20:50 | craigbro | hiredman: or have ring close the stream? |
| 20:50 | akhudek | kzar: so you have in your state the current path, plus a list of leaf paths that you've stored so far, at the end you return the right part of the state |
| 20:50 | craigbro | hiredman: or immediate fix was for the backend rest API to put a timeout in place |
| 20:50 | AtKaaZ | preyalone: but to be honest i never used them to download, I rather compiled leiningen myself so it didn't have to download the .jar, i made it build it |
| 20:50 | craigbro | hiredman: shutting down the stream from the far side basically 8) |
| 20:50 | preyalone | AtKaaZ: I like how we get completely different errors. |
| 20:51 | hiredman | craigbro: ring may just pass the stream on to the servlet whatever |
| 20:51 | AtKaaZ | preyalone: i used the lein.bat and lein bash from master branch |
| 20:51 | preyalone | AtKaaZ: Also it's funny how many of the Leiningen installers have an unstated requirement of wget.exe |
| 20:51 | AtKaaZ | preyalone: here https://github.com/technomancy/leiningen/tree/master/bin |
| 20:51 | akhudek | kzar: http://www.ibm.com/developerworks/java/library/j-treevisit/index.html?ca=drs- |
| 20:52 | hiredman | https://github.com/ring-clojure/ring/blob/master/ring-servlet/src/ring/util/servlet.clj#L93 huh |
| 20:52 | AtKaaZ | preyalone: i think the lein.bat from master switched to using powershell(in windows) so no wget required |
| 20:52 | hiredman | I would expect the finally in the with-open to close it |
| 20:52 | preyalone | AtKaaZ: Ah, I used the stable one. I guess both are broken. Nice, no wget dependency :) |
| 20:53 | craigbro | hiredman: hmmm |
| 20:53 | craigbro | (.openStream (java.net.URL. (artifact-url "d6ee3b53340a825a6f4635580147abdf" "processes.json"))) |
| 20:53 | craigbro | #<HttpInputStream sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@7ac68e7c> |
| 20:53 | craigbro | yah, I would assume so too |
| 20:53 | craigbro | maybe my ring is old |
| 20:53 | preyalone | If someone can produce a "clj.exe", I can write an MSI installer for it. |
| 20:55 | craigbro | hiredman: ok, get this. I bet that copy is waiting on input, which never comes |
| 20:56 | hiredman | Heh |
| 20:56 | kzar | akhudek: thanks |
| 20:57 | craigbro | hiredman: wether the close gets fired woudl depend on the servlet handler (jetty?) |
| 20:57 | AtKaaZ | preyalone: i don't know how to fix the 403... |
| 21:00 | craigbro | hiredman: I have a hook middleware layer where I could stick a FN that closes the stream I suppose |
| 21:53 | majyk | anyone familiar with building CCW? Where can I get the missing library called 'lib': "Project 'ccw.core' is missing required library: 'lib' ccw.core" |
| 21:53 | tyler_ | whats the difference between `lein run` and `lein trampoline run` ? |
| 21:54 | tyler_ | it says it quits the leiningen jvm |
| 21:54 | tyler_ | but why not just do that in lein run if its a good idea |
| 21:56 | TimMc | tyler_: It's not compatible with all tasks, especially some things that plugins do. |
| 21:57 | tyler_ | TimMc: ah gotcha. how do you find out if its 'compatible'? run it and see if it fails? |
| 21:58 | TimMc | I suppose? It's not a feature I use, in general. |
| 21:59 | TimMc | Anything that does multiple invocations is generally not a good idea to try to use with trampoline. For instance, I had weird results with the lein-multi plugin. |
| 21:59 | tyler_ | TimMc: thats my where my curosity comes into play. if its sole purpose is to kill leiningen jvm to save memory, one would think everone would use it. Does it just not save enough memory to be valuable? |
| 22:01 | TimMc | It does, but it's extra typing. :-P |
| 22:01 | tyler_ | you seriously let extra typing inhibit memory management? |
| 22:01 | tyler_ | ok |
| 22:01 | tyler_ | heh |
| 22:01 | xeqi | I'd imagine it takes extra time |
| 22:01 | TimMc | I have 8 GB of RAM. Memory is not usually the issue. |
| 22:02 | TimMc | The LEIN_FAST_TRAMPOLINE feature will save time, too, so I might start using trampoline when that comes out. (Or is that already in 2.0.0?) |
| 22:24 | gfredericks | consarnit crate. I apparently can't do svg by hand when it goes straing from cljs->dom |
| 22:24 | gfredericks | straight* |
| 22:59 | tyler_ | is there a way to make reader macros yourself or are they hard coded into the language? |
| 23:00 | Raynes | You cannot make reader macros. |
| 23:00 | tyler_ | meh |
| 23:00 | tyler_ | "Unlike Common Lisp, Clojure doesn't support user-defined reader macros" |
| 23:01 | tyler_ | Raynes: is there a way to make a 'wrapped' macro (for lack of a better term) like <<<fooo>>> or is that synonymous with reader macro? |
| 23:05 | tomoj | tyler_: http://clojure.org/reader#The%20Reader--Tagged%20Literals |
| 23:05 | tomoj | that's what you've got |
| 23:05 | tyler_ | tomoj: thanks |
| 23:05 | tomoj | so `#tyler/tagged fooo` or something |
| 23:05 | TimMc | Technically, you *can* reach into the reader and do horrible things to its entrails, but people will beat you with sticks. |
| 23:06 | tyler_ | TimMc: yeah i try to avoid that, one of the reasons im fleeing ruby for clojureland is that im tired of everyone monkeypatching the shite out of everything |
| 23:06 | TimMc | Yeah, and this would be even worse, since it involves wallhacks. |
| 23:07 | ChongLi | wallhacks are a method of cheating in first-person-shooters |
| 23:07 | tyler_ | ahh |
| 23:07 | ChongLi | they allow you to see through walls! |
| 23:07 | tyler_ | like idclipping |
| 23:08 | TimMc | tyler_: If the security manager doesn't forbid it, you can force a private method to become callable by otherwise locked-out code. |
| 23:08 | amalloy | tyler_: well, different from that. in shooters, you can shoot through walls without cheating. the hack just allows you to also see through them |
| 23:10 | tyler_ | im just looking for a way to make pseudoidiomatic cute macros, i don't want to violate anything sacred |
| 23:11 | TimMc | Yeah, there are times when it would be nice to have Racket's language embedding features. |
| 23:12 | TimMc | Not *many* times, but they're there. |
| 23:25 | TimMc | Ring/Compojure question: How can I wrap my handlers in a reloading middleware only if I'm running it in dev mode? (e.g. FOO_DEV=true in the environment) |
| 23:26 | TimMc | I don't like the idea of automatically running modified code in production; seems like a stepping-stone for an attacker. |
| 23:28 | Raynes | TimMc: Do you use lein ring? |
| 23:29 | TimMc | I have been, but it has seemed unpredictable. |
| 23:29 | Raynes | So no? |
| 23:29 | Raynes | This is a simple question with exactly two answers. |
| 23:29 | TimMc | heh |
| 23:29 | Raynes | My response depends on the precise answer. |
| 23:29 | TimMc | Well... I was using it a couple of commits ago. |
| 23:29 | TimMc | "No" is misleading, in this case. |
| 23:29 | Raynes | So you have stopped and intent to remain that way? |
| 23:29 | Raynes | intend* |
| 23:30 | TimMc | No idea. I'm new to this Ring business. |
| 23:30 | Raynes | TimMc: If using lein ring, setting LEIN_NO_DEV turns off reloading and any other extraneous middleware. |
| 23:31 | Raynes | If not using lein ring, you can look for that variable yourself, or some new variable, and simply not use the middleware in those cases. |
| 23:31 | TimMc | Hmm, OK. Interesting that it's an opt-in thing. |
| 23:32 | TimMc | Raynes: The "not use the middleware" bit is what I'm having trouble with. Let me... refheap some code. |
| 23:32 | Lajjla | Raynes, let us worship His Shadow together. |
| 23:33 | TimMc | Hmm, I see that Persona is still being a bit of a piece of shit. |
| 23:34 | Raynes | I think you're literally the only person who isn't using conkeror that has issues with it. |
| 23:34 | amalloy | TimMc: (defn wrap-maybe-debug [handler] (if (debug-mode?) (wrap-debug handler) handler))? |
| 23:34 | Raynes | That's generally the answer. |
| 23:35 | TimMc | Raynes: I'm on Firefox 16, which probably doesn't have a certain bugfix that's blocking password saving. |
| 23:35 | TimMc | amalloy: That's more or less what I tried: https://www.refheap.com/paste/11990 |
| 23:36 | TimMc | (Part of the problem here is that I'm cargo-culting my way to a working app.) |
| 23:36 | Raynes | It looks fine except that apparently the @settings/config :dev bit doesn't work. |
| 23:37 | amalloy | yeah, agreed. what you posted looks fine except for the comment saying it's not fine |
| 23:37 | TimMc | app is a def, so dev-wrap is called at compile time |
| 23:37 | Raynes | And the -> calls for just two forms that always causes my ass to itch a bit. |
| 23:37 | TimMc | Ah, settings/config is not available until runtime. |
| 23:37 | Raynes | ;) |
| 23:37 | TimMc | Raynes: It's there for hysterical raisins. |
| 23:37 | Raynes | lol |
| 23:38 | amalloy | TimMc: so just put app into start-server, not as a def |
| 23:39 | TimMc | Doesn't that hurt reloadability? |
| 23:39 | amalloy | my suggestion probably doesn't work. but you're the one building control towers out of wood |
| 23:39 | Raynes | lol |
| 23:39 | Raynes | Interesting. |
| 23:39 | TimMc | hrmf |
| 23:40 | amalloy | anyway, i don't really know how wrap-reload *works* |
| 23:40 | amalloy | so i can't comment on whether i've broken it |
| 23:40 | TimMc | It's just this thing, you know? |
| 23:40 | TimMc | Some... middleware thingum. |
| 23:42 | TimMc | I guess I'll go look at 4clojure and see how it does things. |
| 23:45 | TimMc | OK, you're doing something similar: https://github.com/4clojure/4clojure/blob/develop/src/foreclojure/core.clj#L54 |
| 23:46 | TimMc | Apparently 4clojure just reads its config file at compile time, like a badass. |
| 23:47 | amalloy | TimMc: it's not like we AOT, so runtime is compile time |
| 23:48 | TimMc | It's not quite the right phrase, yeah. |
| 23:48 | TimMc | At... namespace load time? |
| 23:55 | TimMc | Yeah, that works. |
| 23:56 | TimMc | amalloy: Anyway, what do you mean by "building control towers out of wood"? This looks a *lot* like 4clojure's core.clj. |
| 23:56 | amalloy | well, i didn't say you were doing anything wrong. you just asserted you were cargo-culting, so it seemed apropos |
| 23:59 | TimMc | Oh! Yes. |