Fork me on GitHub
#clojure-uk
<
2017-06-01
>
thomas07:06:27

morning 😼 mogge

thomas07:06:11

my understanding is that you can only watch the iPlayer outside of the UK when you go through a proxy which is in the UK. never tried it myself though

mccraigmccraig08:06:44

^ a greeting with rotational symmetry of degree 2

mccraigmccraig08:06:00

@thomas imho putting some effort into understanding monads is well worth it - they essentially give you a common pattern to structure functional code in order to achieve pluggable evaluation behaviour

mccraigmccraig08:06:45

once you have grokked the monad 'pattern' then any monadic code becomes easy to read, without getting tangled up with the complexities of the particular evaluation behaviour (either, promises, i/o, state, continuations etc)

mccraigmccraig08:06:37

so you get to the essence of the code more quickly, and also get to rely on well tested evaluation strategies

thomas08:06:42

@mccraigmccraig I'll add it to my ever increasing list of things to do... I ordered a new camera yesterday... so I suspect that is where a lot of my time in the new future will go.

thomas08:06:58

but thank you for the encouragement.

mccraigmccraig08:06:39

yw 🙂 it took me ages to get around to grokking them - in the end all those blog posts didn't help very much - just writing a little code did the trick

thomas08:06:59

hence my comment yesterday that I should write a blog post...

thomas08:06:02

I think it was brian marick (?) saying something like that. (in order to learn about Monads --> write about them)

practicalli-john08:06:32

@yogidevbear it was a great talk by James Reeves last night. In a nutshell he described Clojure by first talking about edn. Edn is a better version of Json & Clojure is edn + eval. James also had a nice analogy for simple made easy, using a twisted road that you have to put barriers around, whereas in Clojure you would just build a straight road. Main points were that immutable data + pure functions make code simpler to reason about. This is very valuable as it's the human element that is the harder aspect of scaling your code. The talk was recorded, so hopefully should be up in the next day or two.

joetague19:06:41

jr0cket: Hi just wondering what channel that talk might end up on?

dotemacs12:06:31

Thanks for the summary @jr0cket

dotemacs12:06:40

and the link

practicalli-john13:06:33

No problem, see you tonight

yogidevbear08:06:33

That's awesome. I'll be sure to give it a watch

yogidevbear08:06:43

Turns out my talk proposal was accepted!

yogidevbear08:06:01

Looks like I might be taking you up on that offer to test pilot my talk, @jr0cket

thomas09:06:59

@jr0cket sounds like a very interesting talk indeed.

practicalli-john09:06:54

I think James' talk was definitely conference keynote quality...

thomas09:06:24

even better

thomas09:06:49

is umawn the new covfefe?

mccraigmccraig09:06:37

it's a greeting with degree 2 rotational symmetry @thomas !

thomas09:06:16

maybe covfefe is something similar... we just don't know it yet.....

peterwestmacott09:06:16

no, 'covfefe' is the fumbled mistake of an overbearing fool

yogidevbear11:06:19

Wow! 10k members and counting

mccraigmccraig11:06:27

can you feel the overbearing edge of slack's damoclean sword yet @yogidevbear ?

yogidevbear11:06:57

Well, I did sign up to the Discord group when I heard some chatter 😉

thomas12:06:52

is that where we'll be going to next?

thomas12:06:28

(I have to say I quite like slack. certainly better than Hipchat which we use here at work)

dominicm12:06:34

I had a few issues with Discord when I last used it. It didn't feel very polished to me.

dominicm12:06:44

Things like sharing didn't work in the mobile app for example.

yogidevbear14:06:00

I've only got the mobile app at the moment and it definitely feels less polished to me than slack

dominicm14:06:28

slack has nailed the "work well 99% of the time"

alexsays15:06:50

thomas: > he was seen on 9 March leaving the Ecuadorian embassy where Assange has lived for years Putting it a little lightly..

thomas15:06:28

yes, I remember seeing that on the news.

thomas15:06:06

as the article says... farage keeps turning up

maleghast17:06:31

Nigel Farage in questionable associations shocker... I am in no way surprised, put it that way.

thomas14:06:29

🙂 🙂 🙂

maleghast17:06:39

Just back on-topic for a sec... If I've got my SQL db "stuff" (yesql) in a separate namespace, will I need to wrap it up as a component to have it updated by (reset) after adding new queries to the query file?

maleghast17:06:56

I've added a query but it's not "present"

dominicm17:06:04

https://clojuredocs.org/clojure.core/find seems useful. Can't think why :thinking_face:

minimal17:06:37

handy for distinguishing between keys with nil values and non-existent keys

minimal17:06:38

… and when you want to use the results

dominicm17:06:05

boot.user=> (when-let [[_ v] (find {:a 1} :a)] (+ v 1))
2
boot.user=> (when-let [[_ v] (find {:b 1} :a)] (+ v 1))
nil
My approval!

mccraigmccraig17:06:46

lol @dominicm here's my example i was just about to paste

minimal17:06:48

if-let / when-let find is a common pattern

mccraigmccraig17:06:53

(when-let [[k v] (find {:foo 100} :foo)] [k v])

dominicm17:06:02

spoookyyy 😜

minimal17:06:06

and i have an example in my clipboard

minimal17:06:14

(if-let [[k v] (find {:a 1 :b 2 :c 3} :a)]
  (blah k v)
  :fail)

dominicm17:06:29

Unless find works on inherited keys, don't know that I'd ever use the k in this destructuring

dominicm17:06:06

@maleghast refresh tracking is done by looking at clojure files. There's no known dependency between the clj file & those sql files.

dominicm17:06:13

I think this is an issue that enlive has too

maleghast17:06:07

Right, but if I make the whole namespace a component then (reset) would re-load it, right, thereby re-running (defqueries ...) ?

dominicm17:06:39

If the component ran defqueries, that should work, yeah. Not considered idiomatic afaik, but appropriate here I think 🙂

dominicm17:06:13

leave a comment for confused readers of the future 😛

maleghast17:06:18

@dominicm - Thanks; that's what I am going to do in that case, 'cos restarting the entire app from cold every time I add a new SQL query is going to REALLY annoy me 😉

dominicm17:06:28

There's also refresh-all 🙂

dominicm17:06:33

or (reset-all)

maleghast17:06:44

Well I will try that first...

dominicm17:06:10

Some people get upset about modifying code in response to developer happiness ¯\(ツ)

dominicm17:06:28

I definitely try & fix these things at the root as much as possible

dominicm17:06:38

tools.namespace isn't changing much. But this would be a nice feature to have

maleghast17:06:36

(reset-all) did the trick actually, so I am not going to component-ise the sql-db namespace. Thanks!

maleghast17:06:15

I am re-discovering my love for yesql and Clojure as a language for "doing stuff" with PostgreSQL - so nice...

maleghast17:06:47

(I still like Datomic too, but this is like a nice bowl of homemade soup, you know, familiar and comforting 😉 )

dominicm17:06:56

You might want to check out hugsql 🙂

maleghast17:06:24

Hmmm... Hold on...

dominicm17:06:53

next generation of yesql 🙂

maleghast17:06:09

Looks interesting... I am going to stick with "what I know" right now__, but I will definitely have a poke at this soon. Thanks @dominicm 🙂

dominicm18:06:03

I've been thinking up something, kinda like an in the middle of gorilla repl & protorepl. Issues with gorilla repl: - Must start the nrepl, makes it harder to plug with everything else - Doesn't work with boot - Clojurescript is now a big thing, which gives lots of oppurtunity to do live graphs I'm thinking of a gorilla repl, where you could integrate your editor, e.g. a cider-eval-code–like thing that could send code to thisthing. & It would visualize it for you, very similar to how protorepl does, but it should work with any editor (yay!). I also want the interactive repl, so that should be a feature too, but I might make these two features one & the same. Feedback, thoughts?

dotemacs19:06:44

@dominicm sounds cool, if you have the time to dedicate to building this tool, go for it! Maybe also mention it at your talk?

peterwestmacott19:06:23

are you suggesting something that visualises code?

dominicm19:06:27

@peterwestmacott It could do :thinking_face: I think protoREPL had a feature like that, it could visualize function calls from a function so you could see a graph of that for example.

dominicm19:06:59

I hope to make it extensible in the same way Gorilla REPL is w/ graphs.

peterwestmacott19:06:11

I don’t think I quite ‘get’ what you’re describing

dominicm19:06:13

@dotemacs A good idea, I will. That night is shaping up to be full of tooling.

peterwestmacott19:06:30

perhaps if I had played with Gorilla REPL and protoREPL I would understand

peterwestmacott19:06:56

I have seen that previously

peterwestmacott19:06:16

I’ve occassionally been lurking on #unrepl - it all sounds super interesting but I still have no idea what anyone is talking about.

dominicm19:06:45

@peterwestmacott essentially Gorilla REPL, but with the ability to send code from vim/emacs into it directly.

peterwestmacott19:06:03

ah - well that sounds useful

peterwestmacott19:06:24

(or it will once I get around to learning emacs)

dominicm19:06:26

I'lll probably modernize it a little too (live graphs w/ atoms perhaps?)

dominicm19:06:33

@peterwestmacott what do you use? 🙂

peterwestmacott19:06:46

I’ve been meaning to learn something that is free for a while

peterwestmacott19:06:07

and I’ve been meaning to write my own editor for a while too, but realistically….

dominicm19:06:15

Cursive is hard for me to know how hard it would be to customize. Being closed makes me think you might be a bit restricted unless Colin gives you a way to do some key mapping that does a modification of the code you send to the repl.

dominicm19:06:06

Vim & Emacs make it pretty simple to do a new binding.

otfrom19:06:34

@dominicm I take it klipse doesn't quite hit what you want?

dominicm19:06:53

@otfrom there isn't a visualization component, is there?

otfrom19:06:36

there is a guy in Berlin doing this in org-mode too. 😉

otfrom19:06:45

:org-mode-ftw:

dominicm20:06:54

@otfrom It's pretty close tbh 🙂. The biggest value-add over that would be project integration. (Hmm, I'd like to view my onyx graph as I go)

dominicm20:06:12

That talk looks interesting, watching now. I might be able to latch on & safe myself a lot of effort 🙂

otfrom20:06:17

and there is the epic literate stuff in http://thi.ng

dominicm20:06:44

> literate > org mode nope. nope. nope.

otfrom20:06:10

@dominicm c'mon. You know you wanna. 😜

dominicm20:06:14

In all honesty. When I build things, I feel obliged to make them hugely interoperable. https://github.com/SevereOverfl0w/clojure-check/ is such an example. CLI that happens to work quite well in Vim. I think it would hook into Emacs really easily.

otfrom20:06:04

I suppose it does depend on who the consumer of what you are building is. 🙂

dominicm20:06:14

I'm not going to lie. I got Org mode extricated from JUXT, partially because there was no way I was giving up Vim 😉 & I got into a big ol' deep path of interop.

dominicm20:06:15

I'm starting to notice that you should try and spend 5-10% more time on making something a little more open for re-use & extension. Wayland suffers from this compared to X. Wayland is a very targetted set of use cases, and ergo all the cool things people could do with X, is no longer possible. It won't affect most users, but it stops people from doing clever things which makes their lives significantly better. Same goes for Org mode vs Using Asciidoctor for organization-wide stuff. One is accessible from all editors, can even be parsed in Java, Ruby & Node.js programatically. By doing that, we've been able to build simple things like the training page on JUXT as a document, but even the profiles on JUXT are Asciidoc (admittedly a little empty right now, but the capability is all there). We index the attributes of those profiles in order to link your blogs to you & run a little search engine too. tl;dr Open for extension = Open for hacks. Silos stop you from doing cool stuff, even if it allows you to do stupid things too 🙂

otfrom20:06:44

surely you can still be a vim user and love org http://www.vim.org/scripts/script.php?script_id=3342

dominicm20:06:16

I mean, it mostly works. But Org changed their syntax again plus it's near impossible to parse Org syntax consistently.

otfrom20:06:27

yeah, org is for my own notes. asciidoc and markdown are for interop and sharing

dominicm20:06:48

Org is great for personal things. & It's my envy there. But I also don't tend to automate too much of my note taking & to-dos. I have automated remember the milk inputs though. By piping into a CLI & stuff that. Too much Unix in my bones I think 😛

dominicm20:06:55

Oh, I see how giraffe works, that's a neat way to pull it together. I could almost use that from Vim. Except no way to show a SVG :thinking_face: Nyaovim can do that though.

otfrom20:06:55

yeah, I have been taking notes in emacs since Oct 2002... so...

otfrom20:06:13

that was in old planner mode and .muse files

otfrom20:06:11

I liked the more bliki nature of planner mode. org doesn't quite do that. it is more about outlining than creating a web