#clojure logs

2013-03-01

01:51RazLaptopHow would I form client.Network.Login("data") in clojure?
01:52RazLaptopMost examples I find only go one object deep
01:54rplaca(.Login (.Network client) "data) ought to do it
01:54RazLaptopthanks, I'll give it a shot :)
01:54rplacanp
01:55RazLaptopPhew it worked! That stumped me for ages- do you know where I can find more relevant info in the doc's?
01:56rplacanot really, just think about it as functions on objects rather than method invocations and it should be pretty clear
01:56RazLaptoprplaca, ok, at least with this I have a footing now, thanks :)
01:57rplacathat 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:57rplacasimilar logic all the way through
03:03ChongLihmm
03:06ChongLilighttable has a bunch of hotkeys using the Cmd key
03:06ChongLibut I don't have that key (on linux)
03:07Apage43ChongLi, most of those are also bound to Ctrl
03:07mytrileTry Alt instea
03:07Apage43or Alt
03:07mytrileinstea*
03:07ChongLiyeah I see that
03:07ChongLihow do remove/change keybindings?
03:07supersymCtrl+Space search for "key"
03:08Apage43command -> Change key bindings/shortcuts
03:08ChongLiyeah I'm on that screen
03:08ChongLiI only see options to add bindings
03:08Apage43ag
03:08Apage43yeah, not sure how to remove them
03:09ChongLithis is so damn slick
03:11supersymyeah I dunno either.. doing some reflection stuff trying to look a bit more inside
03:11supersymI'd like to change some css properties from the repl on the running client :)
03:12supersymI do miss some stuff that was in 0.2 tho - like connect to repo etc? Really would have loved some documentation/source
03:13supersymalso we have editor search but no replace
03:13supersymalso large workspace directory = slugishness
03:14supersymoh well.... o
03:14supersymstill great, sweet and more awesomeness
03:16ChongLithe "vim mode" really ought to be called "vi mode"
03:16ChongLithough it's not even a complete vi mode at that!
03:16supersymyeah
03:17supersymshouldnt be too hard to get some more ... dunno if this is native codemirror or..
03:17ChongLithe key features for me with vi are @ and !
03:18ChongLi@ being the macro key and ! being the "pipe to external command"
03:19supersymyeah i was wondering @? ... q/@ and ! yeah :) I love being able to do :!. %
03:20supersymbut it always seemed a bit silly to have like a seperate 'bash' implement like vim does... dunno whats about that
03:20ChongLiseparate bash?
03:20supersymwouldn't it just have been easier to tie it to the running shell (e.g. I use zsh but vim is still bash)
03:21ChongLiI used zsh for a while but I'm back to bash
03:21supersymor did i miss an option somewhere all those months
03:21ChongLisince I installed on my new ssd I've been avoiding reinstalling stuff like emacs, vim etc.
03:21ChongLiit's really enlightening to use vi and bash in their default states
03:21supersymI love zsh but stopped scripting in it... node.js cli apps way easier to do :P
03:22ChongLiand leverage the full power of unix!
03:22supersymwell with some tweaks vi can be made 'ok'
03:22ChongLiwhat's wrong with it?
03:22supersymdefault key behaviour for me anyway
03:22supersymarrows, home key, maps
03:22ChongLiwhat?!
03:22ChongLiI don't use any of those keys!
03:22ChongLithey're too far away!
03:22ChongLi:)
03:23supersym:P
03:23supersymgood point,... I try to force myself learning to get used to hjkl but it takes tiiime
03:23ChongLiah
03:23supersymdid remap the Caps to esc tho
03:23ChongLiI learned hjkl easily back when I got this keyboard
03:24supersyma lot better
03:24ChongLiit has no numeric keypad
03:24ChongLiso I was forced to learn hjkl to play nethack
03:24supersym^^ nethack
03:24ChongLinow I can't live without it!
03:24supersymfrom that perspective, vi does have great keymap convention by itself, yeah
03:25supersymit actually tries to unlearn your bad-MS-based habit
03:26supersymtrade-off, many ppl got scared away at first tries tho
03:26ChongLihaha, amazing that it can do that from 1976!
03:26supersymI like my vim a lot better with https://github.com/spf13/spf13-vim also
03:26ChongLiyeah I have a vim that's all tricked out too
03:27ChongLiI'm reluctant to go back to it though
03:27ChongLijust too much mental baggage
03:27supersymyeah 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:28ChongLisupersym: why not?
03:29supersymwell 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:29supersymbut I dunno, I have the idea I'll have to rely on sed and awk like stuff to get around :P
03:29ChongLiI think the key to "getting" unix is to understand the gnu coreutils
03:30supersymwell I get the ideas behind a few I guess but automake nor c/c++ seem like my cup of tea
03:31ChongLihttp://www.gnu.org/software/coreutils/manual/coreutils.html
03:31ChongLihere's the giant combined man page of all the coreutils!
03:31supersymsweet
03:32ChongLimy fave commands are column, cut and grep
03:32ChongLiyou can do a lot with those
03:32ChongLisort as well
03:32supersymyeah they are sweet :)
03:32supersymthe best tools are 30 years old or more :P
03:33ChongLiand integrating them with vi is fantastic
03:33ChongLithe other thing I really appreciate about vi is the low latency
03:33ChongLion basically everything
03:34supersymoi.. well u said since 1976.. i was born in 80 and got raised with DOS... go figure
03:34ChongLivim and emacs just seem to feel "heavy"
03:34ChongLithere's a lot going on with every keystroke
03:34ChongLiand a lot of the time it's blocking the UI
03:35supersymyes .. F1 being the most famous :P
03:36supersymwell whats your alternative tho
03:36ChongLialternative to what?
03:36supersymsublime is pretty cool but closed source
03:36supersymvim and emacs being relatively heavy
03:37ChongLithe alternative is to use something light like vi :)
03:37ArafangionAnother editor-discussion?
03:37supersymseems like lighttable might become open-source (mixed model of perhaps free/paid plugin ideas)
03:37supersymArafangion: sorry ><
03:37ChongLilighttable will be open source
03:37supersymok kool
03:37ChongLiI've heard it from ibdknox himself!
03:38ArafangionChongLi: 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:38Apage43most of the .cljs source is pretty easy to find already ;)
03:38supersymyeah
03:38Apage43last I looked anyway
03:38ChongLiArafangion: hmm? I'm not having any problems
03:38supersymline-height is a bitch but so is xft in my urxvt unicode and anti-aliasing with vim
03:39ArafangionChongLi: Where did you get your vi from, then?
03:39ChongLiArafangion: it came installed in the base system
03:39ChongLirunning arch
03:39Apage43ah, perhaps not. The stuff it downloaded used to include the cljs
03:39ArafangionChongLi: Then it's probably linked to vim, running in vi-emulation mode.
03:40ChongLiArafangion: no...
03:40ChongLiwhich vi returns /usr/bin/vi
03:40supersymownm
03:40ArafangionChongLi: 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:41ArafangionChongLi: Very few systems provide the original vi.
03:41ChongLiArafangion: no, it's linked to ex
03:41ArafangionChongLi: Interesting! Then it might be the original vi, after all!
03:42ChongLiyeah it has all the limitations of vi
03:42ChongLisingle undo, no command history or anything like that
03:42ChongLibut it's still just as powerful, you just have to work a bit at it
03:42ChongLia lot like lisp
03:43ArafangionChongLi: This bug refers to the line and column width limitation I mentioned: https://bugs.archlinux.org/task/15844 :)
03:44ChongLiArafangion: ah that's weird
03:44ArafangionChongLi: But sensible, it means you don't have to dynamically allocate the buffer, it's static.
03:44ChongLiwhen I first installed (before even installing X) I was editing stuff with vi fullscreen on my 2560x1600 monitor
03:44ArafangionChongLi: And therefore faster. :)
03:44ArafangionChongLi: That bug there seems to have been fixed in 2010. :)
03:44ChongLiI have no idea how many columns it was but it was a lot
03:45ChongLiApage43: paranoia?
03:45Apage43like you'll learn it too much and be helpless on a machine without your config
03:45ChongLiI've heard that argument before and it makes sense
03:45ChongLibut that's not the one I'm using
03:47ArafangionChongLi: Why do you like ex-vi, anyway?
03:47supersymApage43: 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:47ChongLiArafangion: it's helping me appreciate and understand the unix philosophy
03:48ChongLiif vi doesn't have some weird feature I need I can often get it by piping to an external command
03:48Apage43at home I'm on an Arch linux machine and at work I use a macbook
03:48ChongLiplus I just really like the low latency
03:48supersymcan you compile vi in utf-8?
03:48ArafangionChongLi: Worse Is Better? :)
03:48ChongLiemacs was starting to drive me nuts with its latency
03:49ArafangionChongLi: Funnily, that was what made me switch from vim to emacs. :)
03:49ChongLiwhen you have auto-complete running and everything it does is synchronous
03:49ChongLiit can often block the UI for 1/4 second to 1/2 second on every keystroke
03:49ArafangionChongLi: So don't do auto-complete, then. You don't have it with vi, anyway. :)
03:49Chousukethat's one of the only remaining big issues emacs has tbh :P
03:50Apage43I've noticed that MacVim is a lot snapper than gvim for me
03:50Apage43*snappier
03:51supersymArafangion: can't you do ctags for that?
03:51Chousukeit's not easy to transform 30 years of code into something multithreaded
03:51Arafangionsupersym: I can, but ctags for object-oriented languages is very limited.
03:51Chousukeespecially with elisp being dynamically scoped. Though didn't they already add lexical scoping in 24?
03:52Arafangionsupersym: I do, in point of fact, use ctags from time to time.
03:52supersymok :)
03:53Apage43https://github.com/Valloric/YouCompleteMe is actually quite usable, but a hell of a pain to set up for c/c++
03:53supersymah... well I do miss out of Visual Studio...2010 Ultimate was such a breeze
03:53supersymI really got spoiled
03:53Arafangionsupersym: You think VS 2010 is a breeze?
03:53Arafangionsupersym: You obviously haven't tried VS 2012. VS 2010 was just... Meh...
03:54supersymyeah I hardly had any issues...
03:54supersymah ok no i havent
03:54supersymI know there was a lot not done yet
03:54supersymlike menu customizing was like 40% done :P
03:54ArafangionHeh.
03:55supersymonly thing really buggy was rending xaml
03:55supersymat times
03:56supersymi should fire up a vm and check out 2012 some time ..
03:57Arafangionsupersym: Definitely, and while I haven't tested it, they claim to be backwards compatible, for once.
04:02ucbis anybody here using lightable in anger (other than the devs :) ?
04:03ChongLiI haven't used it enough to make me angry
04:03ChongLiI really haven't "got it" yet
04:03ucbI just tried it and, of course, I was confused by it.
04:03Apage43ucb, I typically fall back to my typical setup for a while when it does something weird
04:03Apage43it's nice when it works of course
04:03ucbbut that's because I come with bad old habits
04:04ucbApage43: 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:04Apage43my 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:04Apage43ucb, it does. It works really well actually.
04:05ucbApage43: I failed to see where that was done. Unless it's all automagical?
04:06Apage43ucb, 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:06ucbah, cool
04:06Apage43if you never actually do anything that needs it to talk to lein/nrepl it won't actually bother
04:08ucbI see. I suppose I'll stick to my emacs for now. I rely too much on nrepl, midje-mode and others :(
04:10Apage43you can also pull up a instarepl-tab on a connected project
04:10Apage43if you just need a scratchpad
04:11Apage43That's the one where I get in trouble, since it evals the code as soon as it is valid
04:11ucbyeah, saw that
04:11ucboh
04:11Apage43typically really nice, until you're messing with stuff that blocks
04:12Apage43you can turn off the live update behavior though and just make it a scratchpad you can eval in on-demand
04:19broquaint??maud
04:19broquaintww
04:54ChongLithinking of maud you forget everything else!
04:56RaynesChongLi: http://en.wikipedia.org/wiki/Maude_(TV_series)
04:57ChongLiRaynes: http://www.bartleby.com/42/6491.html
06:02augustlis there still no way to easily run a single deftest with "lein test" other than creating tags and adding metadata etc?
06:03clgvaugustl: in midje, evaluation of the test namespace runs the tests as well
06:06ucb+1 for midje
06:09pisketticlgv: but if you just want a single deftest/fact be run, how do you go about it?
06:09piskettiwith lein
06:09augustlI'm not using midje though, I'm using the built-in stuff
06:10clgvpisketti: why do you want to do it with lein? most IDEs support evaluation of single forms (emacs, CCW, ...)
06:10ucbaugustl: I believe that lein-midje can run your standard deftest tests
06:10piskettiit does
06:11augustlhow would I go about running a single deftest with lein-midje?
06:11piskettiIt runs and reports both deftests and midje facts
06:11pisketticlgv: That question aside, can it be done? :)
06:13clgvpisketti: I guess there is no real use to select a single test. but you can use the tag/metadata approach
06:13piskettiI guess I'm not familiar with that either
06:13clgvpisketti: usually you group those test in meaningful groups which you often want to test together
06:14piskettiAnd midje has support for such groups then?
06:15clgvgood question, I do not remember if what was mentioned here was clojure.test only
06:16augustlso lein-midje is not able to run a single deftest?
06:16clgvpisketti: yes it has: https://github.com/marick/Midje/wiki/Metadata
06:16clgvaugustl: what works for groups also works for trivial groups of size 1 ;)
06:17clgvlein midje :filter my-single-test
06:17piskettiheh
06:17augustli just want to run a single test by name without having to edit the source code
06:17clgvwell at least when written as midje fact. dont know if deftest works as well
06:17pisketticlgv: Thanks
06:17augustloh I see
06:18clgvaugustl: you gotta research that on your own ;)
06:18piskettiand perhaps write your own lein plugin 8)
06:18augustlso my-single-test is just the name of the test, not a group/tag I have to create?
06:19clgvaugustl: see the wiki page above. it shows how it works for midje.
06:20clgvoh but the feature is new in midje 1.5 ...
06:21piskettiI noticed
06:21piskettiI'm currently using 1.4
06:21piskettiBut I guess I have no reason not to upgrade
06:25ucbpisketti: are you using midje-mode? if so, together with nrepl?
06:40jcidahoHi - looking at using clostache... anyone had success with it?
06:44jcidahothere is stencil also..
06:44jcidahothe CTO here is very keen on using Mustache
06:45cmdrdatsin nRepl+emacs, I'd like to automatically load up a namespace when connecting to a speficic
06:45cmdrdatsspecific* project
06:50clgvjcidaho: well you should be able to try it quickly I guess
06:53jcidahoclgv: 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:00augustlis there a way to disable "lein test", or make "lein test" actually invoke "lein midje"?
07:01clgvaugustl: maybe an "alias" can overwrite it
07:07augustldoesn't seem like there's an easy way to run a single "deftest" with "lein midje"
07:15piskettiucb: No. I don't know why I've kept using lein to run my tests. ;)
07:15piskettiI do use nrepl, though
07:19pbolleni'm trying to play with https://github.com/pallet/vmfest-playground
07:19pbollenmore specifically with https://github.com/pallet/vmfest-playground/blob/master/src/play.clj
07:19pbollenhowever executing this in the repl: (setup-model "https://s3.amazonaws.com/vmfest-images/debian-6.0.2.1-64bit-v0.3.vdi.gz&quot; my-server)
07:19pbollengives me: CompilerException java.lang.RuntimeException: Unable to resolve symbol: setup-model in this context, compiling:(NO_SOURCE_PATH:1)
07:20pbollencan't grasp the meaning of this yet...
07:20pbollenany tips?
07:21clgvpbollen: you did not :require or :use the namespace properly
07:21pbollenomg
07:21pbollenI forgot to copy the second line
07:21pbollenthanks!
07:21clgvyou need line 2 (use '[vmfest.virtualbox.image :only [setup-model]])
07:23pbollen(y) thx!
07:30ucbpisketti: so do I. But it does take a bit with the whole a new JVM every time I try to run tests :(
07:33clgvucb: SSDs do really help with that
07:33ucbclgv: surely that's not the right answer though?
07:34clgvucb: well if you have the problem of slow leiningen (startup, compile, uberjar) very often it is good workaround.
07:35ucbclgv: 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:35clgvusb: just for the testing there is lazytest and from midje 1.5 on it offers the same functionality
07:35clgvmidje 1.4 works with lazytest....
07:36mpenetucb: you can run the tests from the nrepl
07:36mpenetjust put a (run-tests) at the end of the file an reload it
07:36mpenetor C-c C-c the expression
07:37ucbclgv, mpenet: thanks!
07:38clgvah I thought running from repl was discarded earlier on ... ;)
07:38mpenetwas it?
07:39ucbI just want a quick way of running tests as I work on my code
07:39mpenetI am not sure how it would work with midje though
07:39ucband having to wait several seconds (close to a minute sometimes) breaks my workflow :(
07:41mpenetThe nrepl solution is the fastest I know or. There is also lein.el, but I never tested it.
07:41mpenetof*
07:43ucbmidje-mode was great because of the navigation between test->code and such
07:43ucbunfortunately it's broken for nrepl
07:50dan_bjust 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:52dan_boh wait, https://github.com/jnr/jnr-unixsocket may fit the bill
10:12devngood morning my fellow clojurians
10:12devni hope the force is with you today
10:14hyPiRionwish it were
10:14hyPiRionI have to work with locks and mutexes today
10:17znDuff(Distributed locking, even, with cleanup required).
10:18hyPiRionOh dear.
10:27pepijndevosdanlarkin: ping
10:27danlarkinhi
10:27hyPiRionarcatan: That actually sounds interesting
10:28hyPiRionhard, but interesting
10:28pepijndevosdanlarkin: I came across your IRC server. Curious what the status of that is. I also read you whre considering moving to Aleph?
10:28dcolishdistributed locking is the most fun
10:28arcatanhyPiRion: let me show you a video of our garbage collector: http://www.youtube.com/watch?v=R-HLwHHtDT8 :)
10:30pepijndevosarcatan: wow, you work for them?! Awesome
10:31arcatanpepijndevos: yea, it's pretty cool
10:33hyPiRionarcatan: Oh, hahahah. Garbage collection. I got it now.
10:33danlarkinpepijndevos: cool, yeah, it's "in production" at work
10:33hyPiRionLooks pretty sweet though
10:33danlarkintotally stable
10:33danlarkinI made a spike at using aleph but it's lacking support for some things I need right now
10:49pepijndevosdanlarkin: I got netsplit, so if you said anything after saying hi, I did not get it.
10:50FatalnixCan I set the classpath for clojure on the command line? changing javas classpath doesn't seem to do anything.
10:51pepijndevosFatalnix: Are you using leiningen? As far as I know, Clojure uses the Java classpath
10:51Fatalnixpepijndevos: I do, but not at the moment, I'm just doing some tiny tests
10:51Fatalnixthat's weird.
10:51Ember-clojure does use java's classpath
10:52znDuffFatalnix: How are you invoking Clojure? If you're going through Leiningen, that's a very different thing.
10:53Ember-leiningen does not pass -D parameters for example to your app
10:53Fatalnixoh no, for this I'm just invoking the clojure 1.4 jar
10:55FatalnixI 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:55FatalnixI'd use lein but I didn't want the whole mess of files distributed around.
10:57znDuffFatalnix: ...so, if you ask the JVM what its classpath is...
10:57Fatalnixwell I defined its classpath with -cp
10:59hyPiRionClojure 1.5 out
10:59hyPiRionParty time
10:59Fatalnixlol
11:02aroemersNice!
11:02Ember-really? clojure 1.5 final?
11:02Ember-\o/
11:03Ember-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:03ejacksonwoo hoo !
11:04mpenetit take a little time to get on maven central
11:04Ember-no link on clojure home page either
11:04aroemersTakes a while, see: https://groups.google.com/forum/?fromgroups=#!topic/clojure/kzF5O0Yfdhc
11:04Ember-this must be *really* new thing
11:04hyPiRionEmber-: it's on the dev list
11:05danlarkinpepijndevos: yeah I said it's "in production" at work, very stable
11:05danlarkinit doesn't support all of the RFC(s) but it's enough for what we need
11:07pepijndevosdanlarkin: cool. I found some post on the aleph list about plans to change from jetty to aleph. Did that ever happen?
11:07danlarkinnetty
11:07pepijndevosproject.clj includes both
11:07danlarkinI started working on it, yeah, but aleph doesn't support some things I need yet
11:07danlarkinso that's on hold
11:08pepijndevosdanlarkin: ah i see. Aleph is also based on netty right? What doesn't aleph support?
11:08danlarkinlamina is an abstraction over netty channels
11:09danlarkinbut unfortunately it's not perfect, like I can't get the InetAddress object that I'm connected to
11:09danlarkinbut I need that for hostname formatting
11:09pepijndevosI see.
11:09Ember-cool stuff, just read the changelog
11:11pepijndevosdanlarkin: I wonder if I could build some bouncer like functionality right into the server, especially replaying messages.
11:11danlarkinit's been suggested before
11:11pepijndevosbut there where objections, or it just never happened?
11:12danlarkinand it's definitely possible, of course, but there are some issues beyond just the code-writing
11:12danlarkinlike how do you know who's connected, to send them the right messages
11:13pepijndevosdanlarkin: uh, just look at the nick? juding your response, it can;t be that simpe...
11:13danlarkinbut what if I log in with your nick?
11:13danlarkinam I allowed to get your PMs?
11:14pepijndevosthen you get my messages… I never studied IRC security, but can you just do that?
11:15danlarkinsome networks have what are called "services" to prevent it
11:15pepijndevosI mean, I'm on ZNC now, if you would log in as me, you'd also get my messages
11:15pepijndevosnickserv and such?
11:15danlarkinNickServ on freenode,yeah
11:16pepijndevosMy bouncer has a password, but I'm not sure how that works.
11:16danlarkinit works as a server password
11:16danlarkinmeaning anyone who knows that password (which should be only you) can log in and act as you
11:16danlarkinbut what it means is that your ZNC can only serve one user, you
11:16pepijndevosyea, that's how password generally work...
11:17pepijndevosno, ZNC support multiple accounts
11:17danlarkinon different ports, yes
11:17pepijndevosreally? *reads NC wiki*
11:17danlarkindifferent unix processes
11:18yedihappy release day, #clojure
11:18yediwhat's on the celebration agenda
11:18danlarkinoh, looks like it can do it in the same process, but each is on its own port
11:18hyPiRionyedi: booze and cake
11:19yedihyPiRion: ahh, can't go wrong with that
11:19hyPiRionexactly
11:21aroemersleiningen 2.0.0 out not too long ago, now clojure 1.5, happy times!
11:22jajohnsonUsing 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:23jajohnsonI have a graph, even! http://i.imgur.com/l8uD9lX.png
11:23jajohnsonAnyone ever see something like this?
11:24pepijndevosdanlarkin: ZNC seems to do PASS username:password. That would work a server as well, right?
11:24hashbang1haha i love that you have a graph. I wish i could help but am clueless
11:25danlarkinpepijndevos: oh, that's smart, yeah maybe so
11:25jajohnsonThe actual count is 1009 simultaneous connections, if that means anything. The graph isn't completely clear on that point.
11:26Fatalnixwhat am I doing wrong here with :methods ? I've tried replacing them with nil and leaving them blank: http://pastebin.com/JHAgParQ
11:27pepijndevosdanlarkin: Maybe I'll try implementing this, if it makes sense to you.
11:27danlarkinsure
11:27danlarkinIMO just using ZNC seems easier :)
11:27pepijndevosmeh...
11:27FatalnixI just keep irssi on a vps
11:27Fatalnixand screen it
11:28Fatalnixif you're talking about the IRC bouncer
11:28Frozenlock\o/ 1.5 baby
11:28pepijndevosdanlarkin: why did you chose to use this in-memory clojure database?
11:29weavejesterjajohnson: Have you tried increasing the amount of memory available to the VM instance?
11:29danlarkinI 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:29danlarkinand that's what I ended up with
11:30jajohnsonweavejester: I have, starting the jvm with java -server -Xms256m -Xmx3072m -Xss256k -- the vm doesn't ever break 1g though.
11:31pepijndevosdanlarkin: I think that if the server is actually going to store messages, I would rather use something persistent.
11:31aroemersleiningen 2.0.0 out not too long ago, now clojure 1.5, happy times!
11:31aroemerswhoops..
11:32danlarkinpepijndevos: sure
11:32Fatalnixis lein using 1.5 yet though?
11:32pepijndevosI'll browse the code a bit over the weekend and see if it's something I'd like to hack on.
11:34xeqiFatalnix: lein itself uses 1.4, but you can use whichever for your project
11:34Fatalnixyeah I know that much
11:34weavejesterjajohnson: Curious. You've used the :max-threads option to set the max number of threads higher than 1000?
11:35FatalnixEW
11:35ambrosebsIs Aaron Cohen in here?
11:35Fatalnixmore than 1000 threads? that sounds dangerous.
11:35Ember-indeed
11:35jajohnsonweavejester: yeah, it's set to 2k at the moment.
11:35Ember-oh wow
11:35Fatalnixfewwer threads + promises to make up for it?
11:35jajohnsonFatalnix: lots and lots of CPU and memory in these machines :)
11:35Fatalnixyeah but..
11:35weavejesterFatalnix: It's a web server
11:36hashbang1Fatalnix: depending on the hardware, i dont think thats unreasonable
11:36FatalnixI dunno, it just doesn't sound right.
11:36jajohnsonweavejester: toying with the ulimit on my load machine. may have fiddled with that incorrectly. one sec.
11:36Ember-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:36FatalnixI would provide like 1 thread per x ammount of connections, and try some sort of non blocking like promise to handle them.
11:37Fatalnixso thered be like say 5 threads per 20 connections.
11:37weavejesterjajohnson: What does ulimit -n say?
11:38jajohnsonweavejester: 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:39jajohnsononce I'm sure that takes, I'll run this again.
11:39weavejesterFatalnix: Jetty does use nio for connections, I believe.
11:39FatalnixI see.
11:40FatalnixI thought this was some custom codebase
11:42jajohnsonweavejester: aha! we're in business! 2k connected.
11:42jajohnsonthe server was fine, it was my load machine.
11:42jajohnsonmost excellent.
11:42weavejesterjajohnson: Ah, excellent :)
11:43Fatalnixhuh, I wonder what if I build an interface instead of supplying methods in the ns form
11:43Fatalnixand the interface could be used for java to find methods?
11:43jajohnsonweavejester: thanks for taking a moment. very much appreciate your work, btw.
11:43weavejesterjajohnson: No problem
11:49octagonhi, how would i read in some clojure forms from a string and obtain an AST?
11:50antares_octagon: read-string (if it is from a trusted source)
11:50antares_,(read-string "(count [1 2 3 4])")
11:50octagonantares_: read-string gives forms, but not an analyzed AST
11:50clojurebot(count [1 2 3 4])
11:51antares_octagon: what is analyzed AST in Clojure?
11:51antares_octagon: forms are AST. Details of the Java compiler are not exposed much further, I believe
11:51ambrosebsIs this what you want? https://github.com/frenchy64/analyze
11:51octagonantares_: 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:52antares_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:52antares_and that it is meant to be easy to consume without knowing much about clojure.lang.Compiler internals
11:52octagonambrosebs: thanks man, that looks like what i need
11:52ambrosebsantares_: You're correct. The above project digs it out with reflection.
11:54octagonantares_: sometimes you need to know the _meaning_ of forms, which is something that is done in the analysis phase.
11:54ambrosebsI think antares_ is worried that there is no official way of doing it, and he's right.
11:55ambrosebsanalyze is a bit of a hack, but it does the job mostly.
11:56octagonambrosebs: i'm working on a little structural editor for programming in clojure, so i need more than just the forms themselves
11:57ambrosebsthere's a thread going on currently on the ml about a possible tools.analyze, you might be interested.
11:57ambrosebsah, clojure-dev actually
12:05cemerickBodil: why does cljs-noderepl define its own :eval fn (nrepl-eval)? It doesn't seem to do anything special.
12:08pepijndevosdanlarkin: huh, it seems some bouncer code is already there: https://github.com/danlarkin/subrosa/blob/master/src/subrosa/plugins/catchup.clj
12:08danlarkinsortof
12:08danlarkinnot exactly bouncer, just replying chat
12:09FrozenlockI'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:11hyPiRionFrozenlock: 24x speedup?
12:11Frozenlockyeah
12:12FrozenlockMost of the time wasted was just 'waiting for other machine to respond', so I suppose it makes sense.
12:14hyPiRionstill fast, I think pmap runs x + 2 tasks at most
12:14hyPiRionwhere x is core #
12:25FrozenlockI can't believe how fast it is now. Or how dumb I was doing everything in sequence.
12:25mrb_bkwhat's the preferred means of using lein2/repl with a github SHA commit as the dep in project.clj?
12:27cemerickmrb_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:28mrb_bkcemerick: blame dnolen for putting shit on github that i want to play with!
12:29cemerickmrb_bk: Fair. Using checkout dependencies would probably be saner
12:29lekuhi anyone use 'Joodo'?
12:32mrb_bkcemerick: ahhh right i forgot about thtose
13:11FrozenlockIs there a parallel 'for', just like pmap?
13:47pandeirocemerick: would a couchdb log parsing utility be something appropriate for clutch?
13:47cemericklog parsing?
13:47cemericklike, from the couchdb process?
13:47pandeiroyeah
13:48pandeiroi 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:48cemerickno, probably not
13:48cemerickwhy would you be parsing couchdb logs?
13:49pandeirowell i need to do some analysis and i was inspired by mmcgrana's talk at 2011 conj i think it was
13:49pandeiroabout logs as data
13:49pandeiroi would love to just transform them into a map
13:49pandeiroa sequence of maps i mean
13:50cemericksure
13:50pandeiromaybe i am missing some tool that already does this?
13:50cemerickbut, you're talking about application logs, then?
13:50cemericknot the couchdb process' log file?
13:50pandeiroyeah, /var/log/couchdb/couch.log
13:51cemerickah, ok, that makes a lot more sense
13:51cemerickit's certainly something that could *use* couch
13:51cemericks/couch/clutch
13:51cemerickprobably not something that should be in the client API
13:51seangroveShould I (or is it even possible to) type-hint functions and return values in cljs libraries I'm writing?
13:52pandeirois 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:52pandeirothere's a good couchdb log parser for nodejs that i could use to create JSON and just flip it over
13:53gfrederickscan repositories configured in leiningen have proxy info included?
13:55cemerickpandeiro: Not sure. I'm sure there's a ton of log parsing libs in Java-land.
13:58DaReaper5Quick question: how do i get the lenght of (.toByteArray out-stream)
13:58FrozenlockAny clojuredocs maintainter in here? I would REALLY like an autofocus function for the search field :)
13:58DaReaper5(.length (...)) does not wrk
13:58DaReaper5work*
13:58gfredericksDaReaper5: count should work
13:58DaReaper5ok thanks
13:58dakroneFrozenlock: I maintain it since zkim left, but I'm not really a rails person
13:58znDuffDaReaper5: alen, IIRC
13:58gfredericks,(-> [1 2 3 4] (into-array) (count))
13:58znDuffcount is expensive.
13:58clojurebot4
13:58znDuff...well, potentially expensive. It doesn't promise not to be expensive.
13:58gfredericksis it?
13:59gfredericksfor arrays?
13:59Frozenlockdakrone: Ah? clojuredocs isn't written in clojure o_O
13:59znDuffFor arrays, there's alength
13:59dakroneFrozenlock: not the first iteration, we're working on a rewrite in clojure
13:59DaReaper5alength? ill try that
14:00Frozenlockdakrone: Well let me tell you that I find it to be an amazing resource :)
14:01dakroneFrozenlock: glad you like it, it definitely shows its age though
14:08FrozenlockWhen 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:08FrozenlockI find that awesome, but at the same it's like I completely missed my goal -_-
14:08Frozenlock*time
14:11gfredericksany way to use proxies in leiningen for deploy repos?
14:14cemerickgfredericks: you can definitely set a global proxy configuration. There may be per-repo options too, but I don't recall atm.
14:14gfredericksthey only thing I saw was some env variables; I guess that's what you mean by "global proxy configuration"?
14:16jsimsI'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:17cemerickgfredericks: yeah; actually, looks like that's all that's available. Aether supports per-repository proxies, but only allows one per dependency resolution.
14:17cemericks/but/but pomegranate
14:18gfredericks`lein deploy` failed because leiningen was trying to sign the jar
14:19Bronsammh, 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:20BronsaI have sufficent permissions to reopen the ticked, I'm not sure if I'm supposed to do so though :)
14:20technomancyhttp://p.hagelb.org/mystery.gif
14:22amalloyjsims: that OOM is from the repl trying to print the whole range for you
14:23znDuffWhy is pull-seq in clojure.data.xml private?
14:23jsimsamalloy: you're right….grr. thanks
14:24gfredericksare there docs somewhere on why lein is trying to sign my jar?
14:24technomancygfredericks: :sign-releases for the given :repositories entry isn't set to false
14:25technomancyI think it's covered in `lein help deploying`; if not it should be
14:25gfrederickstechnomancy: aw man I swear I had skimmed DEPLOY.md thoroughly enough :D :(
14:25hyPiRiongfredericks: Yeah, I hate it when Leiningen is trying to do the right thing™
14:25gfrederickshyPiRion: I don't mind it doing that I just couldn't figure out how to get it to do anything else
14:26hyPiRionah
14:30devnhttps://github.com/tpope/heroku-fucking-console
14:30devnwhoops, wrong channel
14:30Gonzihhehe, nice plugin :)
14:30devnhaha, yeah, great name
14:37TimMcGood license as well.
14:38TimMcI 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:39ArafangionDon't they usually just say "no"?
14:39devnThat's just an excuse people use to not ask
14:40devnbut i would imagine the answer is often "no", simply because they don't want to spend the time
14:40technomancyat least it's not the JSON license
14:40technomancy("must be used for good, not evil")
14:40devnugh
14:40cemerickoh, that's funny
14:41Arafangiondevn: It's the less risky answer, too, from their perspective.
14:41devn*nod*
14:41TimMctechnomancy: That would be a fantastic court case.
14:42technomancyTimMc: could be fun to issue C&Ds to DRM systems found in violation
14:42TimMcExcept the lawyers would probably argue that that's meant to be silly, and therefore not material.
14:42hiredman"man is evil, there for no one can use json"
14:43cemericksounds like progress
14:43technomancy"the prosecution would like to draw your attention to exhibit A: Contra Pelagius by St. Augustine of Hippo"
14:44TimMcsnrk
14:45lekuloll
14:45lekutype 'do the harlem shake' into the youtube search field on the mainpage
14:47S11001001devn: 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:48FrozenlockIs there a function in core that does `(if (coll? x) x [x]) ?
14:48S11001001coincidentally I saw this today https://www.gnu.org/licenses/license-list.html#JSON
14:55technomancythat seems to imply the license is on the format, not an implementation of a parser
14:55technomancyI don't think that's actually possible?
14:56technomancyoh, misread; nm
14:56randomenduserif 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:57gfredericksso 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:57gfredericksor profiles with extra classpath dirs?
14:57technomancyrandomenduser: you would need leiningen 2.1.0-SNAPSHOT to do that
14:57hiredmangfredericks: carica looks at all config.clj files on the classpath and merges them
14:57gfrederickshiredman: that's what I was looking at
14:57technomancy(inc carica)
14:57lazybot⇒ 1
14:58technomancyrandomenduser: :eval-in :nrepl
14:58randomendusertechnomancy, so it'll be available in 2.1.0? I'll check out the docs for that version, thanks :)
14:58technomancyrandomenduser: currently only on git master
14:58gfredericksI guess I haven't figured out how that translates to "now I'm going to deploy to UAT"
14:58hiredmangfredericks: 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:58randomendusertechnomancy, hmm, what about from bash?
14:58hiredmangfredericks: so for us chef knows what stack it is deploying to and what values to put where
14:58technomancyrandomenduser: bash is a shell?
14:59gfrederickshiredman: okay so your deployed runtime config file is not in the jar?
14:59gfredericks(or there is one but it's overridden)
14:59hiredmangfredericks: some parts are overridden, some are not
14:59hiredmancarica does a merge
15:00randomendusertechnomancy, yes? are you saying :eval-in will work there? or is that a command I can pass to leiningen or something?
15:00hiredmanso there are configs in the jar and configs on disk written by chef
15:00technomancyrandomenduser: 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:00technomancyor you could use another nrepl client like nrepl.el (from eshell) or jark (which I'm not sure works yet)
15:01gfrederickshiredman: that's helpful, thanks
15:02technomancysomething 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:02randomendusertechnomancy, 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:03ljosIs there a way to apply a constructor over a seq? something like this, just that doesn't work: (apply Integer. [1])
15:03gfredericksI think only with reflection
15:03gfredericksunless you have the seq at compile-time
15:04ljosWhat if it is a record instead>
15:04ljos?
15:06technomancyrandomenduser: you could do something simpler by just opening a socket in your application code and sending stuff via netcat
15:07ljosgfrederics: I think map->Contructor might help; thanks.
15:07technomancybut all the existing tooling centers around nrepl
15:30randomendusertechnomancy, 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:31randomendusertechnomancy, also, the output (and input from my socket, I guess) would show up in the running repl, right?
15:31technomancyrandomenduser: 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:32randomendusertechnomancy, why would I need to use bencode? I think I need to get a POC up to understand this more
15:33hiredmannrepl uses bencode
15:33hiredmannrepl is not just a repl on a socket
15:33technomancyhttps://github.com/technomancy/server-socket <- this is probably more in line with what you're looking for
15:33technomancyyou can just netcat straight to it and not worry about bencode
15:34randomendusertechnomancy, fancy :) thanks
16:17craigbrodakrone: aroundp?
16:17craigbrodakrone: a clj-http question
16:17dakronecraigbro: what's up?
16:18craigbrodakrone: looking in request, it appears that you don't shutdown the conn-mgr if in lines 240 - 244 of core.clj
16:18craigbrothere is an error
16:18craigbroI don't know apache http client well enough, but it would seem to me that should be try/finally'ed
16:19dakronetrue, I should move the when predicate to a finally block there
16:19craigbrook, so we discovered it 8)
16:19craigbrohehe
16:19craigbroI have an http API for a sublayer of our app
16:20craigbroand when one of our users scripted some stuff againt our top level HTTP api, we saw hundreds of sockets open
16:20craigbrocause he was calling an API call that resulted in a 406 or some other error from the second level HTTP api
16:21craigbrome gusta clj-http
16:21dakronecraigbro: 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:22craigbrook, I'll have ot figure out how to get it into my app
16:22craigbroI've not yet explored the hell of git deps in lein etc..
16:22dakronecraigbro: how are you using it currently?
16:22craigbroclojars
16:22technomancysnapshots
16:22technomancyplz
16:22craigbroI could aso just monkey patch that function
16:23craigbroand test it that way
16:23dakroneyea, I can push a snapshot
16:26dakronecraigbro: pushed clj-http-0.6.5-SNAPSHOT
16:26technomancyI mean in general any time you're tempted to use git deps you should use snapshots instead
16:26craigbrodakrone: am I corect that (execute DefaultHTTPClient....) will throw an error on a 406 or 404 or any non 200?
16:27dakronecraigbro: no, it shouldn't; exceptions are handled by wrap-exceptions in client.clj
16:27craigbrodakrone: ok, but that would trigger this boog
16:27craigbrodakrone: the case here is that I was calling something that returned a 40?
16:27dakronecraigbro: do you have a stacktrace?
16:28craigbronot handy, but I can scare one up
16:28dakronethat would be excellent
16:28craigbroi don't have a non production recipe yet, so...
16:28craigbrook, I have it here
16:29craigbrohttps://gist.github.com/craigbro/5067961
16:29craigbroyou can see wrap-exceptions catch it
16:30dakroneyea, in that case, it should have been shut down
16:30craigbrodakrone: are you saying that wrap-exception wouldhave shut it down?
16:31dakroneno, 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:31dakroneare you using connection pooling by chance?
16:31craigbronot on this code path
16:32gfrederickslastlog -clear
16:32craigbrodakrone: to be clear, I'm still running the old code here
16:33craigbrodakrone: I see only two calls to .shutdown, one in coerce body type, and then that one insdie the (when clause in request
16:34dakroneyea, but the exception isn't actually short-circuiting the shutdown in core.clj, so I'm not sure how it would remain open
16:34dakronehow are you checking for the open connections?
16:35craigbronetstat 8^)
16:35craigbroI will get a recipe to reproduce this
16:35dakroneso, 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:36craigbrowe have 1k+ sockets in established and 588 sitting in CLOSE_WAIT
16:36craigbrothe CLOSE_WAIT would be what you are talking about
16:36craigbrothe 588 are sitting in close_wait (aka, no change in the set of sockets)
16:37dakronecraigbro: hmm, if you do have a way to reproduce, I'd be very interested in figuring it out
16:37craigbroone 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:37dakroneare you starting 1000 threads each doing a request?
16:37craigbrodakrone: yah, I'll work on that, I just came across the issue with the .shutDown being bypassable when reviewing code
16:38craigbrodakrone: nope, not even close to that number
16:38craigbrodakrone: which is why I was suspicious of conn-mgr being left alive
16:38dakronecraigbro: let me run some tests with itsy and see if I can reproduce it locally
16:38craigbrodakrone: I'll work on a recipe here too
16:38dakronecraigbro: can you open an issue with clj-http so I don't forget it?
17:07mpenetis there a way to have print statements from another thread show in the nrepl buffer?
17:07mpenetit worked in slime
17:12rabbit_airstrikeI feel like a similar question was asked an hour or two ago
17:13casionthere'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:13casionclojure seems to be no exception to this :|
17:13rabbit_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:14rabbit_airstrikempenet: is that more or less similar to what you're looking for?
17:15mpenetnot really
17:15rabbit_airstrikeoh well :/
17:16mpenetI am testing multithreaded code, and it seems some statements don't show depending which thread does them.
17:17mpenetanyway, I am using atoms instead, but for quick (and dirty) testing, it was useful
17:17rabbit_airstrikemaybe send messages to a single logging agent?
17:18rabbit_airstrikeI'd love to hear the best solution in this case
17:19mpenetodd (future (println :foo)) just works, I'll have to dig in the giant pile of java that does the threading magic
17:23mpenetwell no, the magic is in future, (.start (Thread. (fn [] (println :foo)))) outputs nothing
17:25mpenetthis works though, good enough for now (.start (Thread. (bound-fn [] (println :foo))))
17:26craigbrodakrone: so, I cannot get a anice reproduction of our sitaution on my local machine
17:26craigbrodakrone: s/anice/naive
17:28dakronecraigbro: hmm, well I'll try to get something that does it on my end
17:32craigbrodakrone: I'm keeping at it too
17:33craigbrodakrone: one issue with this production instance is we are getting a weird mix of tcp and tcp6
17:34dakronecraigbro: that I have no idea about, is your DNS sending ipv6 stuff?
17:34craigbrodakrone: should not, we removed the :::0.1 or whaever from /etc/hosts
17:35craigbrodakrone: it looks like that bug I brought up earlier is a red herring tho
17:35craigbrodakrone: prolly a good idea to put tht in a finally anyways, since .execute is declared to throw 2 different exception types
17:35craigbrodakrone: I'm getting more suspicious of it being some environment issue tho
17:36dakroneare you blocking reset packets in some way that prevents connections from being entirely closed?
17:37craigbrodakrone: this is all over localhost
17:37craigbrodakrone: no blockination 8)
17:37dakronecould try 127.0.0.1 to prevent DNS
17:39craigbrodakrone: intrestinly enough, when I do that on my local machine, i still get tcp6
17:39craigbrodakrone: however curl to 127.0.0.1 uses tcp
17:39craigbrodakrone: oh, the world is a funny place 8)
17:39dakroneinteresting
17:40craigbrodakrone: when I reproduce the errors we were getting I get sockets properly going into TIME_WAIT
17:40jonasacis there something like lein execute or something that would let me run a clojure file more like a script
17:41mindbender1is there a way to use cljsbuild as a development middleware?
17:42craigbrodakrone: 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:42dnolenmindbender1: googling turned this up http://github.com/jblomo/ring.middleware.clojurescript
17:42dakronecraigbro: np, I'll let you know if I find anything while trying to reproduce
17:42corecodehi there
17:43corecodeis (mapv (fn ...) ...) a common construct, or are there other ones that are more typical?
17:44mindbender1dnolen: thanks, I think that's great I'll investigate it further
17:48squidzwhat 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:50rabbit_airstrikeI thought c2 was inspired by but distinct from d3?
17:50rabbit_airstrikelast I looked into it c2 wasn't well suited to animations which bummed me out
17:51rabbit_airstrike"Unlike D3, C2 does not have an animation system, although you can use CSS transitions to perform animations."
17:51squidzyeah that's also what I heard. So is it common practice to have pieces of code in java script alongside clojurescript
17:51rabbit_airstrikeunfortunately I don't know much more than that, hopefully someone else here does
17:52squidzill wait and see if anybody is awake
17:53mpenetsquidz: yes, cljs-build helps with all that
17:54mpenetyou will need an externs file for d3 if you want to compile in advanced mode
17:54FrozenlockOh the rabbit hole of `externs'...
17:54mpenetnot really, it's often 1 google search away
17:55mpenetthere are a few here as well https://code.google.com/p/closure-compiler/source/browse/#git%2Fcontrib%2Fexterns
17:55squidzmpenet: 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:56Frozenlockmpenet: I spent a day trying to figure out to make my own externs, and then making sure it was included when jaring everything.
17:57Bodilsquidz: Frankly, I'd avoid JS as much as possible. At the very least, write a wrapper.
17:57mpenetif 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:58mpenetyeah +1 on thin wrappers
17:58squidzokay, thanks for the tips guys
18:07lynaghksquidz: 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:08squidzlynaghk: okay, so as much as i'd like to use c2, I think i'll have to wait until it matures
18:08lynaghksquidz: 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:08squidzlynaghk: do you have any examples?
18:09squidzof css animations that is
18:10lynaghksquidz: nah, not anything specific to CSS animation
18:10squidzokay. 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:11lynaghkthat'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:12squidzlynaghk: i was actually watching your talk before you messaged me on http://blip.tv/clojure/kevin-lynagh-extending-javascript-libraries-from-clojurescript-5919758
18:12lynaghksquidz: 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:14lynaghksquidz: 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:14squidzoh thanks ill definitely take a look
18:14lynaghkBodil, mpenet: just curious, what benefits are you getting from writing wrappers around JavaScript stuff?
18:17Bodillynaghk: It gives me more concise and (pardon the French) more idiomatic code.
18:18squidzlynaghk: 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:18lynaghkBodil: heh. Have you seen Zach Tellman's talk about wrapping Java API's from Clojure/west last year?
18:19lynaghksquidz: we've typically used HAML, but we just switched to Slim
18:19Bodillynaghk: Though I'm not advocating wrappers over native Cljs. :)
18:19squidzlynaghk: okay thanks
18:19Bodillynaghk: No. But I will if you tell me I should. :)
18:19lynaghksquidz: almost all of our stuff is clientside applications though---we don't generate any markup serverside.
18:19saolsenWhen 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:20squidzlynaghk: so you are using ruby?
18:20lynaghkBodil: you should, it's a great talk about the tradeoffs of writing wrappers.
18:20squidzdo you maybe have a link to that talk?
18:21BodilAnd please please let it not be on InfoQ...
18:21lynaghksquidz: 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:22lynaghkBodil, squidz: http://www.infoq.com/presentations/Distilling-Java-Libraries
18:22squidzso it is just the templating? or are yall also using rails
18:23lynaghksquidz: just templating; most of our apps have been rich frontends hitting either existing or custom-designed Compojure-based APIs
18:23squidzokay thanks. Interesting to know. And thanks for the talk ill take a look
18:24akhudekyou can use compass with clojure + enlive
18:24lynaghksquidz: 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:25squidz: yeah I can understand.
18:26pandeiroclojure.data.json is faster than cheshire?
18:26dakronepandeiro: shouldn't be
18:27akhudeklast I heard cheshire was the fastest
18:27akhudekthough things could have changed
18:28pandeirojust parsed a 411kb json file with no key fn or anything and clojure.data.json/read-str outperforms cheshire/parse-string
18:29dakronepandeiro: did you use criterium to benchmark it?
18:29pandeirodakrone: nope, just did a dirty bench inside nrepl.el
18:31pandeirowow lighttable just keeps updating itself right before my eyes
18:41n_bHaving a tiny bit of trouble with lazy-cat here and thinking I'm doing something very stupid - https://gist.github.com/nickbarnwell/5068816
18:43n_bRunning into an eventual memory overflow, which is, I assume from exec-request continually concatting until everything blows
18:44n_bbut I'd expect that to only happen once more requests had actually been realised
18:45hiredmantoo many concats will blow the stack
18:46n_bright, but shouldn't lazy-cat return a lazy seq?
18:47hiredmanbut once you realize it puts one method call on stack per lazy-seq layer
18:48hiredmanso, 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:49pandeirodakrone: yeah so with criterium cheshire is >2x faster.. happy to discover that tool, thanks
19:01n_bhiredman: oh, I've done it again. I always forget REPL tries to realise the entire seq before printing it >>
19:02n_bso my fn *does* work, just not if I do => (fn foo bar)
19:12doerphi; 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:14znDuffdoerp: Yes.
19:16doerpI don't know why I dismissed this for so long, then :P
19:17doerpnot a huge fan of Java, but Clojure looks like a lot of fun...
19:18znDuffdoerp: 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:20doerpI 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:41majykin counterclockwise is there a way to disable the namespace hint that shows right below the tab for the current file being edited?
19:52trenthauckHi, 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:52trenthauckbe = by
19:52hiredmanthere is a csv parser in contrib
19:52hiredmanhttp://clojure.github.com/data.csv/
19:54trenthauckthanks - 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:54hiredmanhttp://clojure.org/sequences
19:56trenthauck(rest (-main))
19:56trenthauckexit
20:10harobIs 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:11bbloomharob: you can just use java's concurrent queues
20:12harobbbloom: Would I still be able to use an agent, or would I just use a future that consumes the queue?
20:12bbloomdepends on your use case
20:13amalloyharob: 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:15harobI 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:15harobamalloy: how did you end up resolving your need then?
20:18preyaloneWhere 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:25AtKaaZi guess I could add a way here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=385973
20:26technomancypreyalone: don't install Clojure
20:26AtKaaZoops wrong window, sorry
20:27preyalonetechnomancy: Let me guess... "Install Leiningen"?
20:27preyaloneBecause Chocolatey Leiningen fails, and so does the "Cygwin-compatible" shell script.
20:27preyaloneI've looked at five different vectors for installing Clojure, and they're all terrible, some 3 years out of date.
20:28preyaloneThat 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:28technomancythey're all terrible because no one uses them
20:29preyaloneIn 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:30hiredmanwhat technomancy said
20:30hiredmanpreyalone: what do you want such a thing?
20:31hiredmanwhy
20:33preyalonehiredman: Do you use Windows?
20:33hiredmanof course not
20:33AtKaaZpreyalone: did you try lein.bat ?
20:35preyaloneAtKaaZ: Yes. I tried Chocolatey Leiningen, lein.bat, and the "Cygwin-compatible" lein shell script. All fail, either silently, or with thrown Java errors.
20:35AtKaaZpreyalone: ok i see you just replied that on ML
20:35hiredmangenerally 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:35AtKaaZbut lein.bat from master? or other?
20:36preyaloneAtKaaZ: Whatever the official Leiningen repo's README linked to.
20:37preyaloneThe point is, I've tried more than a few ways to install Clojure, and they all suck. Needs MSI installer.
20:38hiredmanpreyalone: that runs counter to how clojure is typically used
20:38hiredmangenerally clojure is just another library dependency that your build system (lein, maven, ?) deals with
20:38preyalonehiredman: 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:39hiredmanpreyalone: yeah, those are all dumb and I would never use them
20:39preyaloneI'm not taking the bait.
20:39hiredmanthere 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:40AtKaaZI'll check latest lein.bat and see what's "wrong"
20:40preyaloneClojure installed very nicely on my MacBook with Homebrew.
20:40hiredman:(
20:40hiredmanridiculous
20:40preyaloneClojure also installed incredibly well on my Android phone through the Google Play store (Clojure REPL app).
20:41kzarIf 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:41preyaloneAtKaaZ: 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:43preyaloneAtKaaZ: 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:43akhudekkzar: look up clojure.zip
20:44AtKaaZpreyalone: ok, though I only ever used lein.bat but I do still have git bash
20:45preyaloneAtKaaZ: This is what lein.bat is doing on my computer. http://pastebin.com/A82E0auL
20:45kzarakhudek: I was hoping to understand the idea behind how to do it rather than using a library to do it for me.
20:47akhudekkzar: basically, you want to walk the tree and carry around some state that tracks the current path
20:47AtKaaZpreyalone: i see that lein.bat got changed since last time I used it... what does lein bash script do?
20:47akhudekthat library implements something called a "functional zipper" that does exactly that
20:48akhudekI think there are some talks/tutorials around that explain the details behind the zipper
20:48preyaloneAtKaaZ: 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:48akhudekit's not too complicated
20:48craigbrodakrone: reproced it, but don't think it's a clj-http issue at all
20:48kzarakhudek: 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:49craigbrodakrone: 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:49craigbrodakrone: and in our case, that meant damn near forever
20:49hiredmancute
20:49craigbroso, a client polling us with a timeout on their client, was effectively DoSing us do to this FD leak
20:49akhudekkzar: add it to a container in your state
20:49hiredmantime for an ExpiringInputStream
20:50AtKaaZpreyalone: they're both failing on my system now http://pastebin.com/GCjVpXDa
20:50craigbrohiredman: or have ring close the stream?
20:50akhudekkzar: 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:50craigbrohiredman: or immediate fix was for the backend rest API to put a timeout in place
20:50AtKaaZpreyalone: 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:50craigbrohiredman: shutting down the stream from the far side basically 8)
20:50preyaloneAtKaaZ: I like how we get completely different errors.
20:51hiredmancraigbro: ring may just pass the stream on to the servlet whatever
20:51AtKaaZpreyalone: i used the lein.bat and lein bash from master branch
20:51preyaloneAtKaaZ: Also it's funny how many of the Leiningen installers have an unstated requirement of wget.exe
20:51AtKaaZpreyalone: here https://github.com/technomancy/leiningen/tree/master/bin
20:51akhudekkzar: http://www.ibm.com/developerworks/java/library/j-treevisit/index.html?ca=drs-
20:52hiredmanhttps://github.com/ring-clojure/ring/blob/master/ring-servlet/src/ring/util/servlet.clj#L93 huh
20:52AtKaaZpreyalone: i think the lein.bat from master switched to using powershell(in windows) so no wget required
20:52hiredmanI would expect the finally in the with-open to close it
20:52preyaloneAtKaaZ: Ah, I used the stable one. I guess both are broken. Nice, no wget dependency :)
20:53craigbrohiredman: hmmm
20:53craigbro(.openStream (java.net.URL. (artifact-url "d6ee3b53340a825a6f4635580147abdf" "processes.json")))
20:53craigbro#<HttpInputStream sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@7ac68e7c>
20:53craigbroyah, I would assume so too
20:53craigbromaybe my ring is old
20:53preyaloneIf someone can produce a "clj.exe", I can write an MSI installer for it.
20:55craigbrohiredman: ok, get this. I bet that copy is waiting on input, which never comes
20:56hiredmanHeh
20:56kzarakhudek: thanks
20:57craigbrohiredman: wether the close gets fired woudl depend on the servlet handler (jetty?)
20:57AtKaaZpreyalone: i don't know how to fix the 403...
21:00craigbrohiredman: I have a hook middleware layer where I could stick a FN that closes the stream I suppose
21:53majykanyone familiar with building CCW? Where can I get the missing library called 'lib': "Project 'ccw.core' is missing required library: 'lib' ccw.core"
21:53tyler_whats the difference between `lein run` and `lein trampoline run` ?
21:54tyler_it says it quits the leiningen jvm
21:54tyler_but why not just do that in lein run if its a good idea
21:56TimMctyler_: It's not compatible with all tasks, especially some things that plugins do.
21:57tyler_TimMc: ah gotcha. how do you find out if its 'compatible'? run it and see if it fails?
21:58TimMcI suppose? It's not a feature I use, in general.
21:59TimMcAnything 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:59tyler_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:01TimMcIt does, but it's extra typing. :-P
22:01tyler_you seriously let extra typing inhibit memory management?
22:01tyler_ok
22:01tyler_heh
22:01xeqiI'd imagine it takes extra time
22:01TimMcI have 8 GB of RAM. Memory is not usually the issue.
22:02TimMcThe 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:24gfredericksconsarnit crate. I apparently can't do svg by hand when it goes straing from cljs->dom
22:24gfredericksstraight*
22:59tyler_is there a way to make reader macros yourself or are they hard coded into the language?
23:00RaynesYou cannot make reader macros.
23:00tyler_meh
23:00tyler_"Unlike Common Lisp, Clojure doesn't support user-defined reader macros"
23:01tyler_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:05tomojtyler_: http://clojure.org/reader#The%20Reader--Tagged%20Literals
23:05tomojthat's what you've got
23:05tyler_tomoj: thanks
23:05tomojso `#tyler/tagged fooo` or something
23:05TimMcTechnically, you *can* reach into the reader and do horrible things to its entrails, but people will beat you with sticks.
23:06tyler_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:06TimMcYeah, and this would be even worse, since it involves wallhacks.
23:07ChongLiwallhacks are a method of cheating in first-person-shooters
23:07tyler_ahh
23:07ChongLithey allow you to see through walls!
23:07tyler_like idclipping
23:08TimMctyler_: If the security manager doesn't forbid it, you can force a private method to become callable by otherwise locked-out code.
23:08amalloytyler_: well, different from that. in shooters, you can shoot through walls without cheating. the hack just allows you to also see through them
23:10tyler_im just looking for a way to make pseudoidiomatic cute macros, i don't want to violate anything sacred
23:11TimMcYeah, there are times when it would be nice to have Racket's language embedding features.
23:12TimMcNot *many* times, but they're there.
23:25TimMcRing/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:26TimMcI don't like the idea of automatically running modified code in production; seems like a stepping-stone for an attacker.
23:28RaynesTimMc: Do you use lein ring?
23:29TimMcI have been, but it has seemed unpredictable.
23:29RaynesSo no?
23:29RaynesThis is a simple question with exactly two answers.
23:29TimMcheh
23:29RaynesMy response depends on the precise answer.
23:29TimMcWell... I was using it a couple of commits ago.
23:29TimMc"No" is misleading, in this case.
23:29RaynesSo you have stopped and intent to remain that way?
23:29Raynesintend*
23:30TimMcNo idea. I'm new to this Ring business.
23:30RaynesTimMc: If using lein ring, setting LEIN_NO_DEV turns off reloading and any other extraneous middleware.
23:31RaynesIf 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:31TimMcHmm, OK. Interesting that it's an opt-in thing.
23:32TimMcRaynes: The "not use the middleware" bit is what I'm having trouble with. Let me... refheap some code.
23:32LajjlaRaynes, let us worship His Shadow together.
23:33TimMcHmm, I see that Persona is still being a bit of a piece of shit.
23:34RaynesI think you're literally the only person who isn't using conkeror that has issues with it.
23:34amalloyTimMc: (defn wrap-maybe-debug [handler] (if (debug-mode?) (wrap-debug handler) handler))?
23:34RaynesThat's generally the answer.
23:35TimMcRaynes: I'm on Firefox 16, which probably doesn't have a certain bugfix that's blocking password saving.
23:35TimMcamalloy: That's more or less what I tried: https://www.refheap.com/paste/11990
23:36TimMc(Part of the problem here is that I'm cargo-culting my way to a working app.)
23:36RaynesIt looks fine except that apparently the @settings/config :dev bit doesn't work.
23:37amalloyyeah, agreed. what you posted looks fine except for the comment saying it's not fine
23:37TimMcapp is a def, so dev-wrap is called at compile time
23:37RaynesAnd the -> calls for just two forms that always causes my ass to itch a bit.
23:37TimMcAh, settings/config is not available until runtime.
23:37Raynes;)
23:37TimMcRaynes: It's there for hysterical raisins.
23:37Rayneslol
23:38amalloyTimMc: so just put app into start-server, not as a def
23:39TimMcDoesn't that hurt reloadability?
23:39amalloymy suggestion probably doesn't work. but you're the one building control towers out of wood
23:39Rayneslol
23:39RaynesInteresting.
23:39TimMchrmf
23:40amalloyanyway, i don't really know how wrap-reload *works*
23:40amalloyso i can't comment on whether i've broken it
23:40TimMcIt's just this thing, you know?
23:40TimMcSome... middleware thingum.
23:42TimMcI guess I'll go look at 4clojure and see how it does things.
23:45TimMcOK, you're doing something similar: https://github.com/4clojure/4clojure/blob/develop/src/foreclojure/core.clj#L54
23:46TimMcApparently 4clojure just reads its config file at compile time, like a badass.
23:47amalloyTimMc: it's not like we AOT, so runtime is compile time
23:48TimMcIt's not quite the right phrase, yeah.
23:48TimMcAt... namespace load time?
23:55TimMcYeah, that works.
23:56TimMcamalloy: Anyway, what do you mean by "building control towers out of wood"? This looks a *lot* like 4clojure's core.clj.
23:56amalloywell, i didn't say you were doing anything wrong. you just asserted you were cargo-culting, so it seemed apropos
23:59TimMcOh! Yes.