#clojure log - Dec 08 2016

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

9:04 chouser: Hello, friends.

9:05 hyPiRion: hi there

9:09 Rovanion: About the named keys/associative arguments discussion yesterday: Ended up converting my named args to an options map being passed in to the function which I then destructured in the declaration of the function. Became much easier to proxy functions after that so thank you all!

9:10 So for todays question: Is there a function like map but which maps f to on all the leaves of a nested map?

9:11 So that (leafmap inc {:a 5 :b {:c 3}} would return {:a 6 :b {:c 4}}.

9:13 What I want to do is to truncate all numbers in: http://paste.debian.net/901209/ so that they're just integers.

9:13 ridcully_: postwalk?

9:14 ,(clojure.walk/postwalk #(if (number? %) (inc %) %) {:a 5 :b {:c 3}})

9:14 clojurebot: {:a 6, :b {:c 4}}

9:15 chouser: ridcully_: That's exactly what's in my repl. I mean _exactly_.

9:15 Rovanion: Hahaha you're all adorable!

9:15 ridcully_: chouser: it was in my repl too. magic ;)

9:16 chouser: Hm, I mean -- I wrote the same thing at the same time.

9:16 But maybe you understood that already, hence the ";)"

9:16 ridcully_: yeah. i meant, that it wrote it out in my repl first (too) and not just here

9:17 s/it/i/

9:17 chouser: ah, yes, of course.

9:17 The thing before it in my repl is the docs for postwalk :-)

9:17 Rovanion: So if % is a number return %+1, else return %. Cool!

9:18 chouser: Rovanion: Note that operates on keys as well as values.

9:18 ...and will descend into vectors, as well, etc.

9:18 Rovanion: Hence the need to check if the arg is a number.

9:18 ridcully_: was using that way to often recently - so i had it memorized

9:20 chouser: ,(clojure.walk/postwalk #(if (number? %) (inc %) %) {[1 1] :a, :b {1 1, 2 [2 2]}})

9:20 clojurebot: {[2 2] :a, :b {2 2, 3 [3 3]}}

9:21 chouser: Thus even with the 'number?' check, it may do more than you want in some cases. Depends on what you want of course.

9:21 Rovanion: Yeah, will screw up any map with numbers for keys.

9:21 Unless that's what you want.

9:24 chouser: ,((fn inc-leaf [m] (if (map? m) (zipmap (keys m) (map inc-leaf (vals m))) (inc m))) {:a 5 :b {2 3}})

9:25 clojurebot: {:a 6, :b {2 4}}

10:50 neoncont_: Trying to find a recipe to attach a watch to a js variable, is there a way?

10:51 dysfun: MutationObserver ?

10:52 oh no, that only does DOM

10:53 neoncont_: d'oh

10:53 I suppose I could attach it, but I was hoping I could bind to localstorage

10:55 * dysfun is starting to get a feel for rum

10:55 * dysfun wrote his first custom mixin today

10:55 dysfun: it does awful things with state

11:25 * osfabibisi waves at dysfun

11:26 dysfun: hello

11:26 are you stealth osfameron?

11:27 osfabibisi: I'm work osfameron, yeah

11:27 dysfun: welcome to our beautiful channel

11:28 osfabibisi: I love what you've done with the place ;-)

11:29 dysfun: so you're having a good look at clojure now?

11:30 osfabibisi: we're deploying a sample microservice with it, to see if we want to use it as a team

11:30 instead of our current Python stuff

11:30 dysfun: ah

11:30 osfabibisi: the other serious alternative would be Scala, which $boss hates ;-)

11:30 dysfun: must say, i'm quite fond of clojure

11:31 osfabibisi: I'm quite enjoying so far, I have to say

11:31 dysfun: i'm not at all fond of scala though, despite liking haskell

11:31 osfabibisi: scala looks like "a better Java"

11:31 dysfun: pretty much

11:31 osfabibisi: (ah yes, the *other* serious option is Java itself, which I'm not very keen on)

11:31 dysfun: if you want to use java, clojure is the best language to do it from

11:32 but while you're here, we have a bunch of nice libraries too

11:33 and if you're using postgres, we have some very nice things

11:33 osfabibisi: nope, no postgres

11:34 dysfun: pity, i work on several postgres projects

11:34 osfabibisi: HTTP calls, Kafka, Consul

11:34 (and MarkLogic as DB, but we interact with that via http)

11:34 dysfun: if you want a high performing http client, i recommend aleph (has a pool)

11:35 * dysfun also uses it as a server

11:35 osfabibisi: ah, we just went for the popular one, clj-http or some such

11:35 dysfun: yeah, clj-http is slightly more featureful at the minute

11:36 the main blocker aleph has for client use is multipart post at the minute

11:36 * dysfun is actually doing more cljs/nodejs at the minute than clojure

11:39 deadghost: dysfun, I've been thinking of making my project more cljs heavy

11:40 make my pages static

11:40 keep clojure on the backend for api calls from the pages

11:40 * dysfun likes everything to be accessible without javascript

11:41 dysfun: client i'm working on today has a clojure site, one page template rendered through selmer and the backend is a single page rum app with server side rendering

11:43 deadghost: dysfun, I don't see too many arguments against rendering clientside

11:43 dysfun: well it's not strictly necessary in this case

11:43 ridcully_: is it intentional, that clojure.inspector/inspect-tree show the same element in a vector only once and leaves gaps for the dups before?

11:43 dysfun: but i do want to understand how to do fully progressive react apps with rum

11:43 deadghost: not really necessary in my case either

11:44 it's just easier/nicer for me

11:44 dysfun: but this is just an admin panel

11:44 future things i do want it to work for

11:44 deadghost: I guess clientside rendering might slow load times

11:44 and that might impact seo or whatever

11:44 dysfun: and my client hasn't complained too loudly about my slackness in doing it, so i get to try things

11:45 if i can't browse your website in elinks, it's broken

11:45 deadghost: what is an elink even

11:45 dysfun: elinks is a terminal browser

11:45 TimMc: deadghost: If your site won't display anything without JS, I often just won't come back.

11:45 * dysfun too

11:45 deadghost: I'm not catering to nerds though

11:45 TimMc: I don't see why I have to run arbitrary programs from you in a VM in order to see your FAQ.

11:46 dysfun: are you catering to people who work in banks stuck on ie8 with scripting restrictions?

11:47 deadghost: no

11:47 dysfun: how about people on slow connections?

11:47 TimMc: or when your JS breaks because a shitware browser extension installed by one of your non-nerd clientele screws with the page

11:47 deadghost: for now, no

11:47 TimMc: You see the most amazing thigns in CSP reports.

11:47 deadghost: hmm TimMc does that happen?

11:48 TimMc: hahahaha yes

11:48 dysfun: i got banned from skyscanner for using ghostery this week

11:48 scriptor: how often

11:48 deadghost: I use pentadactyl and it messes with stuff sometimes

11:48 TimMc: Sometimes the malware will even try to mess with the CSP headers to make itself allowed

11:48 scriptor: deadghost: what kind of app is this

11:48 TimMc: or heck, even antivirus software will do these things

11:48 JS is *fragile*, don't put all your eggs in one basket.

11:49 dysfun: anyway, i think we've established that i don't want to use whatever site deadghost is building

11:49 deadghost: scriptor, makes websites for franchisees of a specific franchise

11:49 scriptor: deadghost: what are the pros to clientside rendering

11:50 TimMc: As long as you use static pages for the basics, I'd still use it. :-)

11:50 deadghost: hmmm

11:50 justin_smith: I make an application, for the most part the fact that it runs in a web browser is an implementation detail - we have no "basics"

11:50 TimMc: There's a chat site I frequent that is all built in React and whatnot, but the home page and etc. are all static.

11:50 justin_smith: I mean there's a home page in wordpress or somesuch, but that's not something I ever touch

11:51 scriptor: I'm fine with actual applications using js rendering. Chat apps, editors, etc.

11:51 TimMc: right

11:51 scriptor: but I'm sick of sites that are just supposed to display text pretending they're an SPA

11:52 dysfun: TimMc: i'm trying to make a react app that decomposes to a useful static stie

11:52 TimMc: but I get the impression these are currently static pages, not an app

11:52 dysfun: Yeah, I feel like we're continually just 1-2 years away from websites that can fluently render both clietn and server side.

11:53 dysfun: well, the react team has pulled off server side rendering now

11:53 TimMc: A coworker pointed out that the hard part is the intermediate states of user interactions.

11:53 dysfun: i get it for free through rum

11:53 TimMc: yeah, animations and such

11:53 scriptor: it's kind of funny that "server side rendering" is a thing now

11:53 TimMc: heh

11:53 scriptor: like, that was the default 10 years ago

11:53 dysfun: yeah, but it's improved

11:53 cause i can build it with reusable components

11:54 justin_smith: "the whole page is a gif, just send the next frame of the animation from the server"

11:54 scriptor: I thought it was more about reusing the front-end code to also generate html on the backend

11:54 TimMc: deadghost: I don't have numbers on how often browser-invading monsters from another world muck with the page, sorry. It's not super uncommon, though.

11:54 scriptor: hence react

11:54 TimMc: justin_smith: oh shit

11:54 and make it an imagemap

11:54 justin_smith: exactly!

11:54 total freedom

11:54 ystael: congratulations you have built runescape

11:54 deadghost: I've seen a few sites that display text as gif

11:54 TimMc: please someone make this and then shoot it

11:55 ystael: Run, escape!

11:55 dysfun: scriptor: well the point to me is that i just want to write the code once and use it from both contexts. the name is just an artifact of the way react was born in the frontend imo

11:55 ridcully_: justin_smith: and pixel accurate layouts!

11:56 TimMc: (I can't read it any other way.)

11:56 dysfun: If rendering react on the server means less XSS, I'm all for it just for that.

11:56 Bronsa: si`

11:56 (welp, wrong window)

11:57 justin_smith: si`

11:57 dysfun: ah yes, and it caught some bad input because it forced me to "do it properly" instead of essentially concatenating strings with a template language

11:58 overall, quite happy with "server side rendering"

11:58 although that said, i'm using the rum 'static' render, not the react copy the data over one

12:01 deadghost: hmm yeah I think I'll eventually move stuff that can be rendered serverside to the back

12:01 I really can't come up with convincing reasons for me to render simple pages clientside

12:01 other than it's already written + lazy

12:02 lok[m]: Who can spare 2 hours to settle my tablet?

12:06 TimMc: lazy is good

12:06 deadghost: arguments against clientside rendering isn't strong enough for me to immediately get to it

12:06 MJB47: pretty sure he means lazy as in "cant be bothered to set up server side rendering"

12:07 dysfun: i'd get server side rendering set up early if you want to use the integrated stuff

12:07 because it's impossible to debug when it goes wrong

12:07 deadghost: dysfun, integrated?

12:08 dysfun: the native react server side rendering

12:08 deadghost: and you're using node for your server yeah?

12:08 dysfun: it embeds a checksum and such

12:08 i'm not using it because something went wrong and i didn't do it early enough i can just mess around in git

12:08 so i changed to rum's static rendering instead and the only difference i notice is that react stops barking at me

12:09 deadghost: dysfun, I also get things for free via reagent yeah?

12:09 dysfun: don't think reagent has server side rendering support

12:10 MJB47: it kind of does

12:10 dysfun: and the react server side rendering support is js

12:10 MJB47: https://github.com/reagent-project/reagent-cookbook/tree/master/recipes/reagent-server-rendering

12:10 dysfun: oh ok

12:10 MJB47: in the same way that react does

12:10 dysfun: oh, nashorn

12:10 fuck that

12:10 MJB47: well, this is one way to do it

12:10 Bronsa: was gonna say that

12:10 using nashonrn to do server side rendering is a terrible idea

12:11 dysfun: rum can do it without nashorn

12:12 deadghost: ehh maybe I'll think about porting to rum

12:12 really my app can be architected much better

12:12 but you know

12:12 whatever works

12:12 dysfun: gotta say, i was pretty anti-react, but rum swayed me

12:13 MJB47: you dont need to use nashorn for reagent

12:13 dysfun: "you can use rhino too"?

12:13 Frozenlock: dysfun: FYI, some people are looking to replace React in Reagent https://github.com/reagent-project/reagent/issues/271#issuecomment-265795936

12:14 MJB47: https://yogthos.net/posts/2015-11-24-Serverside-Reagent.html

12:14 dysfun: oooh

12:14 MJB47: heres a guide compiling to hiccup

12:14 but you can also use node or w/e

12:14 deadghost: what's preact

12:14 I can't keep up with all this js

12:14 changes every half week

12:15 dysfun: "Fast 3kB alternative to React with the same ES6 API."

12:15 deadghost: what's wrong with react

12:15 dysfun: it's big

12:15 MJB47: its react without all the stuff that makes react usable for production code

12:15 so its smaller

12:15 dysfun: what do they remove?

12:15 osfabibisi: dysfun: eeek, HTML in code :-(

12:16 MJB47: i dont remember, i just remember looking into it last month or so

12:16 dysfun: osfabibisi: html as data!

12:16 MJB47: and thinking "well yeah if react dropped support for ie10 it would be smaller too"

12:16 Bronsa: MJB47: that approach won't work for components using react.core/create-class

12:17 osfabibisi: dysfun: as data that your designers can't read! yay!

12:17 MJB47: idk about you but ive never had a designer go in and edit an html template

12:17 css rarely

12:17 dysfun: osfabibisi: i've concluded that it doesn't matter

12:17 Frozenlock: Bronsa: that's a bummer, I've used that quite often. :-/

12:17 deadghost: osfabibisi, I'd like to believe designers can understand <p>text</p> == [:p "text"]

12:18 justin_smith: TFW the designer breaks the code with smartquotes

12:18 TimMc: D-:

12:18 dysfun: if you're doing something where react makes sense, you've already jumped the complexity shark and your designer won't keep up anyway

12:18 justin_smith: TimMc: the worst thing is my console font at the time didn't really display the smartquotes differently than normal '"

12:18 TimMc: I want a complexity shark.

12:19 osfabibisi: dysfun: hmm, that's an interesting perspective. I still thought that a more "template animation" approach (like HTML::Zoom) would work with React or similar though

12:19 justin_smith: TimMc: with fricken O(1) lasers

12:19 osfabibisi: I was more interested in cycle.js, but again the devs seem to focus on programmatic code, and I can't get over the strong gag reflex

12:19 er, programmatic *html*

12:19 dysfun: HTML::Zoom would be utterly trivial to port to clojure. i was doing the work necessary for it the other week

12:19 deadghost: we like composable data yes

12:20 justin_smith: maybe O(n^n) lasers are better

12:20 dysfun: however, i've long since thought of it as the right answer

12:20 TimMc: http://www.bluebird-electric.net/artificial_intelligence_autonomous_robotics/insectronics_robotics_pictures_animatronic_soldiers/shark-robot-drawings.jpg

12:20 dysfun: rum is very very nice

12:20 osfabibisi: yeah, I keep meaning to port it to Haskell, as I haven't found a templating library I like there

12:20 dysfun: if the cost of that is we need to teach html people a little, so be it

12:20 deadghost: dysfun, how do you have your server set up?

12:21 dysfun: no, i haven't found a haskell templating library i like either

12:21 osfabibisi: you need to teach them to build and run clojure code ... that's arguably not "a little"

12:21 deadghost: do you have nginx reverse proxy to your node server or what?

12:21 dysfun: i haven't deployed any nodejs yet

12:21 deadghost: I've never significantly worked with node servers

12:21 dysfun: the site is currently clojure deployed as an uberjar with aleph behind nginx

12:22 or i might have switched it over to apache, i forget

12:22 justin_smith: osfabibisi: if you do it right it should be your version control, plus lein, plus maybe 2 or 3 lein commands

12:23 dysfun: osfabibisi: have you seen figwheel in action? it's super sweet

12:23 and you get that with one command from a git checkout

12:23 deadghost: dysfun, when/how do you render your rum stuff?

12:23 justin_smith: trufax

12:23 dysfun: deadghost: i use render-static-html on the server and mount it on the client over the top

12:24 deadghost: is render-static-html a rum fn?

12:24 oh rum is clj too

12:24 that's neat

12:24 dysfun: yes, rum is very neat

12:25 deadghost: so you're actually using rum from clj

12:25 dysfun: yes

12:25 temporarily

12:25 deadghost: hmm?

12:25 dysfun: i'm going to take the clojure out back and shoot it next week to replace it with nodejs

12:25 deadghost: what's the upside

12:26 justin_smith: dysfun: deploy it to a great big server out in the country with lots and lots of ram

12:26 dysfun: haha

12:26 deadghost: memory. it's a one page site, the jvm is a little overkill

12:27 deadghost: hmm yeah that's been a great annoyance

12:27 when would the jvm > nodejs server

12:27 dysfun: depends what you're doing

12:28 if all you are is a frontend to a database, quite possibly never

12:28 if you're doing actual transactional logic, then the jvm is a good candidate

12:29 deadghost: dysfun, is that another way of saying heavy computing

12:29 dysfun: sure

12:30 in general, "heavyweight" = jvm, "lightweight" = not jvm

12:30 osfabibisi: justin_smith: dysfun: "plus lein" isn't free. It took a pair of devs here a half-day to get `boot repl` running this week...

12:30 justin_smith: that's boot not lein though

12:30 dysfun: also wut?

12:30 boot just works here

12:31 justin_smith: I've never had issues getting lein running (unless the project itself is broken, and that's up to the devs)

12:31 osfabibisi: we have a corporate proxy, + installing the right version of java, I think were the issues

12:31 TimMc: ouch

12:31 dysfun: "right version of java"

12:32 that should be whatever your distro offers you

12:32 osfabibisi: workaround for proxy was connecting to a different network, which then required reconfiguring email, irc, ssh proxies, etc. (so you can imagine how long we spent trying to configure whatever Java needed to speak to outside world before we gave up ;-)

12:33 sobel: Welp, i just grepped a couple codebases for 'raynes' to be sure. Yup, I'd call that a legacy.

12:33 osfabibisi: yeah, that was fine on my new mac, but caused some fun on $colleague's linux machine

12:34 TimMc: So this is a proxy that you have to configure software for to talk to the outside world?

12:34 osfabibisi: anyway, that busywork is all fine if you're actually writing clojure, skeptical about adding to an HTML designer's workload (+ a dev to handhold them)

12:35 deadghost: dysfun, I'm also considering a migration to cljs only but it sounds like I'd get most of the benefits if I just port my reagent code over to rum

12:35 dysfun: pretty much

12:35 and a seamless upgrade path

12:35 osfabibisi: TimMc: it's just a corporate socks proxy. We have e.g. .curlrc and browsers configured to speak to it as part of our onboarding setup. But couldn't figure out getting boot to talk to it

12:35 dysfun: osfabibisi: i've never had to deal with it behind a corporate network, i think this is the difficulty

12:36 deadghost: dysfun, I'm concerned about stuff not quite working cljs only

12:36 like datomic

12:37 dysfun: well no, datomic won't work without something clojure

12:37 osfabibisi: dysfun: I guess if we were a JVM dev team already we'd have had the local knowledge too

12:37 dysfun: they have a new model where you can proxy, but you'd still need something to run that

12:38 osfabibisi: hrm, i'd say there's a distinct skew in people in here towards people moving from java

12:38 perhaps this explains why - only java people pass the jumping through hoops test

12:38 sobel: i used to use squid as a transparent proxy, just redirecting port 80 through it. it was only a slightly special squid config to make it work in transparent mode rather than regular proxy mode, IIRC.

12:39 if you're building in a container, you might be an iptables statement away from doing the same

12:39 technomancy: dysfun: you mean moving from java-the-language or moving off java-the-platform?

12:40 dysfun: java the language

12:40 * technomancy nods

12:40 sobel: i find it's not that i want to be off java the language or the platform, so much as i want to be able to use other platforms or at least their languages

12:40 TimMc: technomancy: It's nice to see you around here again!

12:41 sobel: clojure has done a pretty interesting job of bridging language gaps and interoperability needs

12:41 technomancy: TimMc: thanks; likewise =)

12:41 sobel: imo

12:41 technomancy: sobel: you mean bridging different languages on the same runtime or bridging different runtimes?

12:42 sobel: technomancy: yes to both

12:43 technomancy: I dunno; whenever I read anything about cljs it's completely baffling to me

12:43 IMO it's much easier to change languages than to change runtimes

12:44 dysfun: technomancy: dunno about that, i'm moving over to nodejs pretty easily at the minute

12:44 TimMc: Langauges are easy to learn, ecosystems are hard.

12:44 (libraries, build tools, etc.)

12:44 dysfun: and nodejs is vastly improved by the addition of the clojurescript compiler

12:44 sobel: runtimes/ecosystems are an investment. i like being able to harnes those investments under programming languages.

12:45 i like that the language is flexible enough handle this case without me developing a rich abstraction over my problem space

12:46 dysfun: java and javascript both have libraries for everything you could ever need

12:46 and you never know all the libraries you need for a project anyway

12:46 and even if you did you'd have to go check the docs to make sure

12:46 justin_smith: there's a few rough edges, like the package/dependency/namespace triad

12:48 sobel: there'll always be things keeping real programmers in work

12:48 but there's a solid opportunity to share healthy amounts of server code with your client that wasn't there before, and that's kinda cool to me

12:50 TimMc: Certainly if it means not having to reimplement e.g. URL parsing I am so down with that.

12:55 sobel: talking with a peer earlier, we id'd a number of basic data structure transforms that were easily applicable on the server as the client. stuff like menu pruning, message templating/localization/i18n, its entire data edit/cache layer

12:56 i'd love to sell my team on isolating the server from the database the same way we isolate the client from the database (REST) and that we could do it using the exact same code

13:02 TimMc: sobel: Hmm, time for a business logic layer? :-)

13:03 tdammers: microservices are clearly more webscale than plain old REST

13:03 sobel: https://pbs.twimg.com/media/BNELF1GCUAExynU.png

13:05 justin_smith: haha

13:05 sobel: realistically, we have a decade of technical debt and it's not that crazy to refactor it as microservices. there's a concurrent business case that makes it more attractive than it might seem from what i've mentioned so far.

13:06 namely, opportunities to make smaller sales with relatively more focused products

13:07 the sad part is i think selling clojure here would be the deal killer. "we'll never get our team using a functional language, we'll never be able to hire that skillset"

13:08 dysfun: so call it an enterprise language then

13:08 sobel: i'm backdooring it through the star engineers (civil engineers, we're not overtly a software co)

13:08 * dysfun imagines sobel in "house of cards"

13:09 sobel: hehe

13:09 dysfun: "you might think that but i couldn't possibly comment"

13:13 TimMc: sobel: "We'll never be able to hire any of those people who are incredibly eager to get a job using a functional programming language."

13:15 (OK, OK, a lot of said people are pretty junior, but when has that stopped people from hiring anyhow...)

13:15 Anyway, just call it a Java library. ;-)

13:15 justin_smith: TimMc: framework, surely

13:15 xemdetia: abstract framework factory, surely

13:15 TimMc: That might sell it better, yes.

13:16 a list processing framework, if you will

13:16 justin_smith: "it's a framework that injects code dependencies via static data files describing algorithms and updates the classloader to access new native code generated at runtime - cutting edge stuff"

13:17 tdammers: a framework is a library that has forgotten what it set out to do in the first place

13:17 TimMc: A framework is a library with control issues.

13:18 sobel: TimMc: funny, i didn't even ask to use clojure the first time, i just added it to the maven deps and started committing code.

13:18 because it is exactly a java library

13:18 i think i'm just going to start saying it's a Thneed

13:18 (which is a wonderful thing which everyone needs)

13:19 TimMc: can i quote you on that re: frameworks? :)

13:19 justin_smith: s/clojure/monorail/g

13:20 tdammers: TIL angular insists on having a module system of its own that is both mandatory and incompatible with the existing JS module systems that everyone else uses

13:20 xemdetia: maybe I can get around clojure as a dep if I just call it a JCL

13:22 TimMc: sobel: Sure, but I probably stole it from someone else. :-P

13:23 sobel: fair!

13:32 tdammers: sneaking in technologies behind your stakeholders' back can backfire badly

13:33 if you have to do it, start with a small low-stakes project with a very limited scope

13:33 use that to show what you can do with this tech

13:33 makes it much easier to get management buy-in

13:33 technomancy: or be content to find a new job if it backfires; handy in a last-ditch situation where you already want to leave =)

13:33 tdammers: or that, yes

13:35 but assuming that you actually want to keep your job, the ideal situation would be that you build a prototype in, say, clojure, and make it such that you finish it way ahead of the deadline, exceed the expectations, and go crazy on maintainability & readability

13:35 sobel: tdammers: it went through code review by all the eyes who might care. they aren't entirely cutoff from the world of other languages on the jvm; we already have jython and groovy in the mix.

13:35 it was a small, low-stakes project of limited scope. in fact.

13:35 tdammers: in that case, ignore what I said

13:36 sobel: i mean, i didn't run it up to the director for permission, but i can't operate in a vacuum even if i try

13:36 the 'sneaking' is that 98% of the other code is java and there's no official line about language use, except the obvious one of getting pushback if it's not in the JVM ecosystem

13:45 pepijndevos: :'(

13:47 TimMc: pepijndevos: ?

13:48 pepijndevos: Raynes. TBH it hit me harder than a friend of my parents passing away last week.

13:49 sobel: pepijndevos: same, it's made me reconsider who my real community is.

13:51 pepijndevos: On really awkward question from a non-native speaker though: What is meant with "bringing him home"?

13:52 deadghost: pepijndevos, they're shipping his body back to his home state

13:55 pepijndevos: Oh ok

13:59 TimMc: I was really happy to see how quickly people raised the money for that.

13:59 and more

15:58 {blake}: bringing

15:59 Deployment! How does it work? Is there any particular issue with using ring?

15:59 technomancy: nah, ring is great

16:00 justin_smith: if you use 'lein ring server' to run during dev, 'lein ring uberwar' will make a war file you can run in a container and 'lein ring uberjar' will make a standalone jar you can run with a jvm and nothing else

16:01 if you don't use lein ring, 'lein uberjar' will make a standalone you can run with a jvm

16:18 jonathanj: what is a war?

16:19 justin_smith: web archive

16:19 something a servlet container can run

16:19 jonathanj: how do you use it?

16:19 justin_smith: by giving it to tomcat

16:19 technomancy: if you don't already know, you probably don't want to =)

16:19 jonathanj: okay

16:19 justin_smith: or jetty, or wildfly, or whatever

16:19 jonathanj: technomancy: that's more or less what i figured

16:20 justin_smith: jonathanj: the most common way to have it come up is that beanstalk from amazone is pretty easy to use and deploy, and it needs wars (it uses beanstalk)

16:20 jonathanj: justin_smith: thanks!

16:20 justin_smith: err, tomcat

16:20 jonathanj: i'm too poor to deploy stuff on aws

16:21 justin_smith: heh, well, beanstalk spins up easily once it's set up, which is nice, and it needs war files. But just using java with an uberjar is easy enough usually.

16:22 jonathanj: the latter is how i've deployed my ring apps in the past

16:22 what's the advantage of using beanstalk though

16:23 justin_smith: beanstalk is good for like "OK I only need one server but if I get on HN I'll have two minutes notice to have 20 servers running"

16:23 it just generally makes it easy to point-and-click spin up as much as you need, and shut them all down when you're done

16:25 jonathanj: hmm, seems pretty interesting, i don't have any spare money to burn on an experiment but i have a few random uberjar deployments lying around on various machines, i wonder how much it would cost to run them on beanstalk

16:25 justin_smith: along with being able to see all your logs from one place and auto-restart if things crash and easy rolling upgrades and nice things like that

16:25 jonathanj: also, one beanstalk can run more than one app from different routes on one host

16:26 (which is one reason people like the whole container thing)

16:26 jonathanj: what does the word "route" mean in this context?

16:26 justin_smith: jonathanj: http://foo/bar is one route, http://foo/baz is another route

16:26 jonathanj: okay

16:27 justin_smith: each one can be served by a different jar (each one things it is serving /)

16:27 jonathanj: that's prett cool

16:27 how do you configure your applications?

16:27 justin_smith: it's a nice workaround for the heaviness of the vm (as long as the box can handle it all of course)

16:27 there's container level config that decides how routes map to war files (aka jars but with some special config)

16:28 the config for the war tells it how to handle things from inside a container

16:28 jonathanj: how do you configure your application's settings though?

16:28 justin_smith: and then there's some classloader stuff that keeps the apps segregated

16:28 jonathanj: i guess if they're containers there's some way to set up the external environment or something?

16:28 justin_smith: that's also set up in the war and the container (different settings go on each side)

16:29 jonathanj: do you use elastic beanstalk?

16:29 justin_smith: ideally to run in a container you should not be relying on external environment much, and if you do need environment / os tooling then beanstalk might not be a good pick

16:29 I used it extensively in the past

16:29 but not with my current app

16:30 jonathanj: i was mostly wondering how you'd work command line arguments or config files

16:30 justin_smith: oh, yeah, that stuff is all set up by the container

16:31 but really it isn't a "command line argument" any more, rather it's the strings passed to -main (with a well designed app that difference should not matter of course)

16:32 it becomes much easier to rely on resource files on the classpath and jvm system properties, all else being equal

16:36 that's part of what makes environ useful actually, it makes switching the source of that config easy

16:45 {blake}: technomancy, justin_smith thanks

16:45 I'm actually deploying to Amazon.

16:46 I've got an EC2 but I suspect they'll push me into Beanstalk.

16:57 Is there a "search in sorted list" for Clojure?

16:58 justin_smith: {blake}: there's sorted-set and contains?

17:00 {blake}: Sure, but don't those manipulate the existing structure?

17:00 Well, I mean, "sorted-set".

17:01 justin_smith: sorted-set is a data type, it's sorted and supports contains?

17:01 it's the closest thing I know of to what you asked about (for clojure built in things at least)

17:04 {blake}: OK, so if I have a list '("apples", "bananas", "cherries", "dates") and want to get back '(2) when I search for "cherries", but exploiting the sorted nature of the list, I think I build my own?

17:04 And if I have '("apples", "bananas", "cherries", "cherries", "dates") and want to get back '(2 3)--

17:04 Those are the two situations.

17:05 justin_smith: yeah, I don't think clojure has anything built in that would do that

17:05 technomancy: how does sorting a list help if access is still O(n)?

17:06 justin_smith: technomancy: yeah, I would assume it would have to be both sorted and associative (so more of a sorted vector I guess)

17:08 {blake}: The list is already sorted.

17:08 justin_smith: {blake}: the point is that in clojure lists are not associative, getting the nth item takes n steps

17:08 hiredman: but clojure lists don't have random access

17:09 {blake}: Oh, I see. Well, that's what I'm trying to get around. =)

17:09 So I should just stay away from lists.

17:10 What I really have is an array.

17:10 And I'm just trying to get to it from Clojure. I thought I might be able to use lazy-sequences to optimize.

17:11 justin_smith: {blake}: with an array, you can use Arrays/binarySearch

17:12 ,(java.util.Arrays/binarySearch (into-array [:a :b :c :d]) :b)

17:12 clojurebot: 1

17:12 justin_smith: if it's actually an array, at least

17:12 ,(java.util.Arrays/binarySearch (into-array [:a :c :d :b]) :b) ; fails if the array is not sorted

17:12 clojurebot: -2

17:45 neoncontrails: Any suggestions for a sexy, real-world example of Specter in action?

17:46 ridcully_: the author did a nice example with ballancing bank accounts on a conference. thats you yt

17:46 neoncontrails: The impression I'm getting from the docs is that a certain map structure is required in order to get optimal use out of it

17:49 justin_smith: how so?

17:53 neoncontrails: I could be wrong. Lots of the examples involve numerical predicates on indices, and nested arrays

18:00 justin_smith: say you have a somewhat nested collection of components whose values and sequence doesn't really change, but accessing the appropriate datum is awfully longwinded in the base cljs syntax. Is Specter a good fit? Is Om/cursors possibly a better fit?

18:02 I do see that Specter has primitives for declaring paths, but it seems like this is mainly for mapping functions and operations over trees

18:12 markmarkmark: neoncontrails: it looks like you can use the select family of functions/macros to just get things from a collection using a path

18:39 libertytrader: hola

18:40 markmarkmark: o/

20:43 tianshu: Hey, guys, it's possible to have some sounds when grep command have any output?

20:44 is it possible? or easy to implement?

22:17 danneu: you could pipe grep into a script that does it

22:35 Kenai: Hey folks. Is there a UI builder out there for Reagent?

Logging service provided by n01se.net