Fork me on GitHub
#clojure-uk
<
2016-12-08
>
paulspencerwilliams08:12:22

A day of two halves for me yesterday. A morning of sorrow; pint of water 1, brand new Macbook Pro 0. Gutted I’ve £££££££ paperweight, but equally gutted that I’d lost my Clojure spec playground which was the basis for my company internal hackathon in the afternoon. The afternoon was a little better, and I got to play with Clojure for the afternoon / evening which was nice. Obviously didn’t achieve what I wanted to (who does in a hackathon?) but I’ve got a better mental model of Clojure Spec now.

paulspencerwilliams08:12:03

@agile_geek I didn’t use that word.

agile_geek08:12:25

I spilled a small amount of coffee on my old MBP and it died but I unplugged it quick, took the back off and let it dry. Then I had to very carefully scrape dried milk/coffee off a tiny bit of the circuit board, switched it back on and crossed my finger...and fortunately for me it worked! Do you have Apple Care (I have had to use it twice in past but can't remember if it cover accidental damage but think it does)

paulspencerwilliams08:12:10

@agile_geek doesn’t cover accidental damage. Taken it to Western Computers around the corner (authorised repairer) and they’re looking at it.

agile_geek08:12:49

Reminds me I spent over £200 on after sales support for my Lenovo X1 Carbon when I bought it this year...need to check I'm covered for accidental damage!

agile_geek08:12:34

@paulspencerwilliams none of this is making you feel better I know! However, glad you have a better understanding of Spec...you can explain it to me someday!

paulspencerwilliams08:12:36

@agile_geek I’ll try. I hope to expand my hackathon project to gain more ‘leverage’. What I wanted to achieve is to apply a spec around a query object populated by a conversation style (think NLP) UI. The spec would first prevent invalid queries from being passed to the end repo, but also, the conversation would use

s/explain-data
to drive subsequent questions until
s/valid?

agile_geek08:12:26

Hmm, interesting.

agile_geek08:12:47

I'd like to follow your progress on that

paulspencerwilliams08:12:20

@agile_geek yeah, suppose the equivalent in Java would be to use reflection to assertion the validity of a bean and perform actions thereof.

paulspencerwilliams08:12:07

@agile_geek I’ll try and keep working on it, and maybe run it as a session at BirminghamFP etc.

agile_geek08:12:38

Share the code in github?

paulspencerwilliams09:12:28

@agile_geek I will. It’ll be in the company Bitbucket too 🙂

jonpither09:12:22

I ran over my last mac in my car

jonpither09:12:03

Still worked, just had a banana shape to it and didnt close properly

korny09:12:38

@paulspencerwilliams thanks for the reminder to check my backups 🙂

korny09:12:12

I have most things on DropBox, but I have a separate task to encrypt client-confidential stuff and move it to DropBox, which I have to kick off manually

paulspencerwilliams09:12:33

@korny haha, happy to help 🙂 Annoyance is losing ‘working data’ like bash_history etc.

dominicm09:12:58

I've been using syncthing instead of Dropbox and am largely happy with it. Use it to "backup" camera pictures to my desktop and laptop. Also contains my shared files, wallpapers etc. It uses an encrypted p2p system, so I don't have to worry about encrypting the contents

korny09:12:51

hmm - looks nice - where do you sync your data to for backups? Also, is there a mobile client? One of the things I like about DropBox is there are clients everywhere.

korny09:12:51

I use duplicity to encrypt private stuff that I then dump on DropBox. I also use TrueCrypt, but I’m trying to use that less as it seems to be abandonware

dominicm09:12:03

DON'T USE TRUECRYPT8. The signing key didn't align, I think there were other issues. There is a mobile client. I call it a backup because it's on my phone, laptop and desktop.

dominicm09:12:47

If you don't mind something proprietary, there's resilio sync by BitTorrent company. Slightly more polished UX. I prefer open source cryptography.

korny09:12:06

fair enough. It’d be pretty easy to set up a sync to your own AWS storage too, for longer-term backups.

dominicm09:12:57

Well, AWS pricing is beyond what I'd probably be willing to pay, given the cost of a buyvm storage vps. But yep.

korny09:12:12

and yeah, the TrueCrypt8 stuff is one of the reasons I want to stop using it. It’s annoying that there doesn’t seem to be an open source alternative.

dominicm09:12:08

I'd probably look at, there's this great backup service. Run by a BSD guy. I mostly use PGP for encrypted files now.

dominicm09:12:00

I'm also not sure if I can use AWS, last time I did I got a huge bill. I've never paid it. Not sure what would happen Tbh. I shut down all my servers, but apparently that's not enough to stop paying.

korny09:12:21

re: buyvm and the like - I’m willing to pay a premium for not having to change anything very often 🙂 That’s the other reason I use DropBox - it’s a big commercial company, I can be lazy and just use it, it’s not going anywhere fast. I’ve used the same web host for 15 years, it’s great to not have to change very often!

korny09:12:39

Duplicity uses GPG - it’s very nice for incremental encryption: http://duplicity.nongnu.org/

dominicm09:12:16

BuyVM has been around forever. Which is why I like it.

dominicm09:12:21

Duplicity looks really cool.

korny09:12:39

cool, I hadn’t heard of them, but I haven’t looked for a while.

dominicm10:12:20

BuyVM are small VPS, so you probably wouldn't hear about them because most people want big and cheap (so oversold)

agile_geek10:12:29

Open question: I've used core.async dozens of times but I always struggle with this so...help! If I have a non-blocking take <! in a go block, how can I return the value from the take? I can think of two ways: 1. If I need to process the value in a separate chain of fn's simply call the fn with the value from within the go block i.e. (go (my-fn (<! channel))) 2. Use an atom to store the returned value an access it from outside the go i.e. (go (swap my-atom (<! channel))) ;; this feels wrong! FYI my use case is I need to test some code that has a blocking put >!! and inside the deftest I have passed a dummy channel to the code under test but I need to set up a non-blocking take or my test blocks and never returns. This is fine as I just call (go (<! test-channel)) before invoking the code under test. However, I wanted to check the value put on the test-channel in an is. I tried calling the is within the go but it didn't work (I suspect cos it's a macro?). I ended up storing the result of the <! in an atom and testing that but it felt wrong. Any better approaches?

mccraigmccraig10:12:32

@agile_geek can you not return the value as the result of the go block and then do a blocking take on that ?

agile_geek10:12:22

@mccraigmccraig hmmm, maybe? LEt me try

glenjamin10:12:57

it’s pretty good for CSP, but I rarely model things as communicating sequential processes

glenjamin10:12:27

my approach to avoiding callback hell has mostly been to stop doing so many damn async things in sequence

agile_geek10:12:45

@mccraigmccraig that worked but talking to my teammate here he came up with simply making my test-channel a buffered channel by supplying a size of 1 let [test-channel (chan 1)]... and then doing a blocking take on the test-channel in the test after the call the the code under test.

otfrom10:12:48

mccraigmccraig you are happier w/things like manifold aren't you?

mccraigmccraig10:12:04

@otfrom yes, i've much preferred manifold - the error handling built in to the abstractions makes them much easier to work with

mccraigmccraig10:12:51

@glenjamin that's probably my gripe - i have rarely (ever?) come across a problem which is well modelled by a stream of values with no error-states

mccraigmccraig10:12:04

@glenjamin i've got hundreds of async things in sequence - promise-monad to the rescue, there is no callback hell

glenjamin10:12:39

well, callback-hell examples IME are mostly lots of async actions in sequence without any abstraction, naming or grouping

glenjamin10:12:52

but what’s the case where you have hundreds of things in sequence?

mccraigmccraig10:12:58

everything is async - composed chains of operations can get very long

mccraigmccraig10:12:09

not hundreds of things in sequence with no structure

glenjamin10:12:31

but is it actually all async, or is it forced to be async because a non-zero number of things in the chain are?

mccraigmccraig10:12:18

almost everything is async - i think there is one example of local tempfs access which isn't, all network i/o is async

mccraigmccraig10:12:58

webserver is async, db client is async, http client is async etc

glenjamin10:12:20

ah, i was thinking with my client-side hat on

glenjamin10:12:36

where in most cases i aim to reduce the async chain to one action - by pushing all of that onto the server

glenjamin10:12:48

but then yeah, someone on the server has to deal with it 😄

mccraigmccraig10:12:05

ah, yeah, client side is different

agile_geek10:12:33

The example I was testing was server side but almost all the core.async here is client side.

thomas11:12:59

All we seem to do here is (:body (<! (http/get (str ... in a let statement

thomas11:12:15

not quite sure what the value of that is though.

thomas11:12:23

ooh and this is client side btw.

paulspencerwilliams11:12:14

What services would peeps recommend for allowing an external service to perform http requests to your local development machine behind NAT / firewall?

glenjamin11:12:43

I’ve used ngrok, localtunnel, finch

glenjamin11:12:48

all were decent

agile_geek11:12:14

I once wrote a query with 15 deep nested sub queries!

Rachel Westmacott12:12:38

I once had to refactor a 2000 line SQL statement that someone else had written.

paulspencerwilliams12:12:48

@glenjamin ngrok was the one I was thinking of...

agile_geek12:12:38

@peterwestmacott that one was just a fraction under 5000 lines (the upper limit for DB2 at the time!)

agile_geek12:12:57

I wrote about 10 of similar complexity (required due to a ridiculously abstract data model!) and each took about 1.5 weeks to write and test!

korny12:12:52

Grr… I hate being on tech support for something I know needs level 3 support. Wading through all the hoops to get to a technical person...

otfrom13:12:53

thomas only 66 lines?

thomas13:12:01

@otfrom I know... but I don't really know any SQL beyond select * from table_name where xxx = 'yyyy'

Rachel Westmacott13:12:55

I’m not sure line count is much of a proxy for complexity when it comes to SQL. Certainly a better heuristic than for minified JS though.

paulspencerwilliams13:12:32

I must say that bounded contexts / duplication in schemas has helped greatly on projects we’ve employed it in to minimise massive queries.

dominicm16:12:31

https://www.terraform.io/docs/providers/github/index.html I'm struggling to get a grasp on the purpose of this provider in terraform. Any use cases spring to mind?

glenjamin16:12:49

I did something similar in chef once

glenjamin16:12:07

if you wanted to enforce via tooling that repos had certain settings

glenjamin16:12:19

or who was in which team

glenjamin16:12:38

basically for the same reason clicking around the web UI of your firewall isn’t great

dominicm16:12:45

@glenjamin A declarative version of your github team & their permissions then?

glenjamin17:12:14

the idea was also to speed up webhook/integration setup for new repos

dominicm17:12:04

Might be interesting to see a slack provider & google apps. You could declaratively add a new team member and have them get an email, slack, etc. all together.

glenjamin17:12:59

it’s even better for leavers

glenjamin17:12:10

if someone’s started and doesn’t have access - they complain about it

glenjamin17:12:22

if someone’s left and still has access - they might not even notice for a while

dominicm17:12:44

That too 🙂.

dominicm17:12:50

SSH keys would be an interesting one too.

dominicm17:12:09

Of course, we are way outside what Terraform is intended for.

dominicm17:12:38

Another question google doesn't seem to have much answer for: How does the local version of DynamoDB differ from that in the cloud? Could someone use it to build a dynamodb hosting service? Vendor lock-in is something I try to not permit.

mccraigmccraig18:12:32

@otfrom except it's a dead project, and systemd is here and pallet is going to die

mccraigmccraig18:12:17

and jeez pallet is inscrutable in my altogether too extensive experience

ali_king18:12:08

@otfrom I have added some hug-related emoji for you from another Slack I'm on

ali_king18:12:07

Usage example - A: I'm having a rubbish day 😞 B: maybehugs A: yeshugs

otfrom18:12:03

ali_king that is completely and utterly awesome

otfrom18:12:26

I'm pretty much always A unless I have serious lurgy

otfrom18:12:30

or a missing arm

ali_king18:12:56

There's also nohugs & interrobanghugs

otfrom18:12:22

thx ali_king

ali_king18:12:53

As you probably figured, they're inspired by Haskell data types rather than Clojure - hope that's ok 😉

otfrom18:12:22

lots of cool ideas to steal from Haskell

otfrom18:12:26

:haskell_stealing:

otfrom18:12:30

:emoji_fail:

benedek19:12:03

hugmonads, awesome