#clojure logs

2014-02-22

00:00nido`No, I'm on windows 7 for the most part, though I do have an install of ubuntu 12.04
00:00TravisDoh, never mind then. There is this irritating issue with GUI applications on Mac OS where they don't see the PATH updates in your login scripts
00:01nido`maybe I'll double check my path then, who knows
00:01TravisDdid you use lein to install clojure?
00:01nido`yeah
00:02TravisDHmm, sorry. I don't know very much about it
00:02nido`I only need the .lein in the path, right?
00:02nido`There's no cider-specific file that needs to be available?
00:04TravisDyeah, although I suspect the issue is not with cider, since "lein repl" doesn't work either
00:04TravisDafaik cider relies on leiningen for cider-jack-in
00:06daccanyone have a favorite property based testing lib?
00:07nido`travisd: thanks, I'll double check along those lines
00:17dsrxdacc: i've used simple-check a little bit, seems good enough
00:19daccok thanks
01:23TravisDCan anyone come up with a simpler implementation of this function? https://www.refheap.com/44486
01:24TravisDAlso, the doctoring is awful, sorry :)
01:25TravisDdocstring* my IRC client auto-replaces what it assumes are typos
01:26Cr8you on a phone or what
01:27Cr8i had to like
01:27TravisDNah, I use colloquy on MacOS. It's the only app I have that does it, and I can't figure out how to turn it off
01:27Cr8turn that off on OS X to get work done
01:27TravisDAh, how do you turn it off?
01:27Cr8TravisD: prolly the OS X built in auto correct. Its in keyboard settings in system preferences.
01:28TravisDCr8: Ah, that fixed it. You're a life saver :)
01:28Cr8https://www.evernote.com/shard/s17/res/d5b0a8df-b995-47d8-a3a0-e2f1e6072677/skitch.png?resizeSmall&width=676
01:28Cr8ah
01:28Cr8yeah
01:28TravisDDon't have access to view that link
01:28Cr8oh
01:28Cr8just a screen of that section
01:28Cr8https://www.evernote.com/shard/s17/sh/dc93870b-f5a9-432a-9beb-1f1569b030bf/431ea0ef6f3c3cadef1fb35a88d92971
01:29TravisDHaha, I like the annotations
01:29Cr8Skype has the same issue
01:29TravisDAh, now that you mention it, I also noticed it there
01:29Cr8I took that screen when I had to turn it off because it kept "correcting" work-jargon on a war-room groupchat
01:29TravisDwar-room?
01:30Cr8bad stuff happened so we're pulling in folks and making sure they are working on it til its fixed type issue
01:30TravisDahh
01:30TravisDthat sounds so stressful
01:31Cr8it is. They're not as bad at my current employer, but I used to work at Walmart HQ
01:31Cr8where there was typically a very high "dollars we are losing per minute this system is broken" figure
01:32TravisDhehe, also sounds a bit exciting. I guess as long as there wasn't risk of being fired
01:33Cr8Incidentally one of the things I used Clojure for really early was live-coding monitoring dashboards for war-rooms
01:34TravisDso, you used it to write some programs that would mintor other people's editors or something?
01:34Cr8had some junk-drawer stuff with clj-ssh and jfreechart and swing, and could chart or watch arbitrary metrics and toss them on the projector
01:34TravisDAnyone else being spammed by user linnuxx?
01:34Cr8monitor system stats on the problem machine usually
01:34Cr8I am
01:35TravisDIs there something to do about that?
01:35Cr8hm
01:35Cr8you can set your user mode +R and then only registered users can /msg you.
01:35TravisDAh, added him to my ignore list.
01:35Cr8https://freenode.net/faq.shtml#spambots
01:36TravisDCool, thanks
01:41Cr8w.r.t. original paste might look at how tree-seq works https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L4535-L4550
01:41Cr8could prolly augment that with the path
01:41Cr8ah
01:41Cr8but it gets -all- nodes, not just leaves
01:42TravisDah, good idea to have a branch? function
01:43Cr8branch? is just there so that you can provide a children function that may not be safe to call at all nodes
01:43TravisDI was actually solving a very specific problem and noticed that it had this more general structure
01:43TravisDyeah
01:44Cr8if your children function returns empty list on any node that doesn't have children, branch? can be (constantly true)
01:44TravisDThat's a better interface than nested collections
01:44Cr8its nice because it works with lots of different representations
01:44TravisDyeah
01:45Cr8you can tree-seq over stuff from xml and html parsers, for example
01:45TravisDIn the code I'm working on, I wanted to transform a "rectangular" string like "...\n...\n..." into a lazy seq of coordinates and characters
01:46TravisDand to do that you can do something like (tree-paths (map seq (clojure.string/split str #"\w+")))
01:46TravisDbut it would be better to use some built-in functions instead of reinventing the wheel :)
01:47Cr8yeah, unfortunately i don't think anything like what you want is built-in
01:48Cr8reminds me of Om's cursors, which are super neat
01:48TravisDI haven't heard of them, do you have a link?
01:48Cr8they're wrappers around clojure structures that "remember" their lookup path
01:49Cr8https://github.com/swannodette/om/wiki/Conceptual-overview#wiki-cursors
01:50Cr8explanation
01:50Cr8^
01:50Cr8and implementation: https://github.com/swannodette/om/blob/master/src/om/core.cljs#L251-L442
01:51TravisDThat sounds pretty neat
01:51Cr8basically you do something like (:foo (:bar app-state)) and you get the thing at that place in app-state, with metadata attached that knows it was fetched by going down that path, so anything rendered from that path can get auto-updated when it changes
01:52TravisDah, that's actually really cool
01:54TravisDI've only been using clojure for about a week, but I'm really enjoying it so far. Seems like there are lots of exciting things going on
01:55Cr8yeah it has a -lot- of breadth
01:55xusergood or bad breadth?
01:56xuseroh I read breath ;)
02:11daccis there a function to test if something's a ref?
02:15TravisDdacc: Not sure if this helps: http://stackoverflow.com/questions/7293289/how-do-we-test-whether-something-is-a-reference
02:15TravisDIt's quite old
02:16daccTravisD: thanks -- found a different way
02:16TravisDwhat is it, out of curiosity
02:18daccpolymorphic function takes either an instance of a java class or a ref
02:18daccso just switched to testing for instances of the class instead
02:19daccmostly to help with testing -- it's a gen-class situation =)
02:19dacctrying to pass in the :state ref directly from test code
02:19TravisDAh, cool. I don't know about gen-class
02:21dacchopefully you'll never need to =)
02:21TravisDhehe
02:24bob2TravisD, assoc
02:25TravisDbob2: in reference to what?
02:26bob2non-nested-update-in
02:26TravisDbob2: Ah, but assoc doesn't update with a function, it just replaces the value
02:37amalloyTravisD: one reason update doesn't exist is because it's not actually clear what the &args should do
02:37amalloyyou think it should add extra args like update-in does, but why shouldn't it update multiple keys like assoc does?
02:38Moilkolaanamalloy, do you still love me?
02:38TravisDamalloy: Ah, good point
02:38amalloyeg, (update m k1 f1 k2 f2)
02:38TravisDthat is a good reason
02:44frank_____Test
04:43borkdudeI just watched this lecture by Rich Hickey, The Language of the System
04:43borkdudehttp://www.youtube.com/watch?v=ROor6_NGIWU
04:44borkdudein it he recommends: build simple services instead of libraries
04:44borkdudewhat are good (recent) examples of these services instead of libraries?
04:44sm0kereally?
04:45sm0kei thought clojures philosophy is to have small libraries rather than big frameworks
04:51rob3when i think of a service i think of something like a HTTP web service
04:52rob3didn't check out the video yet
05:53scape_during system update, "debconf is not responding".. sigh
07:35palangoA question regarding the friend auth lib: Is there a way to run a function after the authentification workflow is finished? I'd like to add some data to the session.
08:30beyeran__Has anyone experience with Leiningen and Cider on Mint Linux?
08:30beyeran__I'm using the same configuration on Windows (on which it works perfekty), but on Linux it freezes saying: "Connecting to nREPL..."
08:32bob2does 'lein repl' work in that project
08:32jowagI'm using mint but using nrepl instead of cider and all works fine
08:33beyeran__bob2: Yes it does
08:33beyeran__jowag: Is'nt nrepl a part of cider?
08:33bob2nrepl's afaict the old name for cider
08:34jowagcider is new incarnation of nrepl, but AFAIK is still in alpha
08:34bob2perhaps you're using apparmor or selinux or iptables or ...
08:34bob2(but tldr it works excellently on linux)
08:35beyeran__At first I try, if it works with nrepl
08:38beyeran__no, same with nrepl
08:40beyeran__bob2: I'm not so experienced with networking on linux, but by typing "prgrep iptables" or apparmor or selinux, it seems that none of these are running
08:40sverihi, i setup a luminus project with http-kit, i can start the jetty with "lein run -dev" from command lein, is there a way to start that same server from the project repl?
08:40beyeran__bob2: It's a pretty fresh install of Mint, I don't know if something was set up automatically
08:41beyeran__jowag: Do you perhaps know, if Mint has something running in the background, what disturbes the connection to lein?
08:44bob2beyeran__, none of them are processes
08:46beyeran__bob2: I restarted emacs, used nrepl again and this time it responded: "Connection refused", does this add with your idea?
08:47jowagI'm using emacs too, but have no problems. Check if you are connecting to the same port as nrepl is listening on
08:47bob2I don't know what you're running
08:47bob2I'd suggest using cider-jack-in instead of wahtever you're doing
08:47jowagI have default mint's firewall turned off (by default)
08:49zachmassiaIs there a recommended why of automating a ns reload on file change with Quil?
08:49beyeran__jowag: good to know!
08:49zachmassias/why/way
08:49beyeran__bob2: cider-jack-in also freezes
08:51hyPiRionbeyeran__: Okay, I have a suggestion. Do `lein repl :headless` in a shell window, and attempt to connect through it in emacs by doing `M-x cider`, and then put in host and port. Does that work?
08:51hyPiRion(`M-x cider RET`)
08:52jowagmy conf: emacs 24 (from mints packages), nrepl.el 0.2.0, nrepl 0.2.3, repl-y 0.3.0, clojure 1.6 snapshot, lein 2.3.4, java 1.7, server started with lein nrepl, from emacs M-x nrepl ...
08:56beyeran__hyPiRion: no, the same with that. (on cider and nrepl)
08:56hyPiRiongurr
08:59beyeran__jowag: lein 2.3.4? My version seems much older (lein --version = 1.7.1), perhaps that's the problem
09:00hyPiRionbeyeran__: oh yeah, that's probably it
09:00hyPiRiondid you install it from the package manager in mint? If so, uninstall it and follow the instructions over at leiningen.org. It's very easy to set up leiningen manually
09:17beyeran__hyPiRion: Oh boy... that solved it... I feel embaressed
09:18patrkristpope: hi. do you have (or know of somebody else that does) a minimal example showing the setup needed to get :Piggieback working in Vim? I'm getting a NullPointerException trying to get started.
09:21hyPiRionbeyeran__: Don't worry, it's not that unusual that people use the package manager for leiningen and end up with that issue. It's more of a problem on our side, really, we should help linux packagers with the packaging of a 2.x version
09:21hyPiRion(not specifically that issue, but some issue related to 1.x/2.x incompatibility)