Fork me on GitHub
#clojure-uk
<
2017-02-01
>
paulspencerwilliams08:02:42

Some peeps are having a real bad day....

maleghast08:02:51

Yeah... I was glad to read on the more detailed status page(s) that the repos were not affected, just Issues and Merge Requests, but still...

maleghast08:02:01

Morning, btw 🙂

paulspencerwilliams08:02:44

It's nice when companies fuck up, are open about it, and because of that customers support them.

jasonbell08:02:01

"So in other words, out of 5 backup/replication techniques deployed none are working reliably or set up in the first place.” was just reading through that doc

maleghast08:02:54

Morning @jonpither - How are things going with your move to Arch?

maleghast08:02:14

@paulspencerwilliams - I agree, transparency is the key at times like this; Gitlab will be fine because they are being clear about what the problem is and how they intend to fix it, so I expect that their customers will feel pretty much that they want to stick around.

maleghast08:02:42

Last time I was caught up in a Github snafu the comms were good but not this good...

maleghast08:02:59

...and even then the fact that there were comms made me a lot happier.

jonpither08:02:28

when I moved from the Mac to Ubuntu, it was nice, but had some niggles, and I wasn't like 'wow, this is amazing'

jonpither08:02:45

but moving to Arch and I3, going much more minimal but using a proper window/tiling manager, it just fits the way I want to work

maleghast08:02:47

@jonpither - Glad to hear it! Once I am in a position to have a desktop / base somewhere I will be adopting Arch as my main work OS

jonpither08:02:00

I like numbered windows and sane tiles inside

maleghast08:02:12

Sounds very... comforting

maleghast08:02:23

(I'm not taking the piss)

jonpither08:02:37

yeah. I won't lie to you, having @dominicm almost sitting next to me has made the transition very seamless

maleghast08:02:02

Also good to know - when I set up a workstation I will have my MBP to fall back on... 😉

jonpither08:02:03

but if you do try it, ping us away with Qs

maleghast08:02:10

Well, I am coming back to the UK, sooner than expected, and once we are settled and I've got some money coming in there will be a desktop machine and a desk and chair just for me for work and play. It's going to have a boot disk for Arch and (sadly) one for Win10 for gaming.

jonpither08:02:36

wow big news, you're coming back?

maleghast08:02:53

I love working on my Mac, but it's going to be my "on the road" machine and my photography and media machine.

maleghast08:02:08

Yep, we will be coming back to the UK by way of a vacation in Japan in March.

jonpither08:02:53

cool, you've been missed 🙂

maleghast08:02:30

Aww, thanks - I have missed the Clojure community in general and you Juxt fellows and a certain Hugmonster General and a few others in particular.

jonpither08:02:59

wear an extra padded coat for the hug you'll get off @otfrom

maleghast08:02:17

No padding - definitely want to feel it 😉

maleghast08:02:01

I love those emoticons - they are splendid.

dominicm08:02:10

@maleghast If you buy a dedicated gfx card for gaming, you can instruct linux to not touch it, and do a direct pass through to a VM. Given that CPUs are not a particular bottleneck in gaming anymore (especially with virtualization being supported first class in the CPU) you may find that it's more than fast enough to game on Linux.

maleghast08:02:59

@dominicm - That is VERY interesting...

maleghast08:02:13

I had zero idea that that was even an option

dominicm08:02:14

95% he claims.

dominicm09:02:03

Looks like you must dedicate an input to a monitor / have a second monitor. Only real drawback, not too bad really.

maleghast09:02:31

Yep, that looks very interesting. If nothing else it would also provide a Linux / Windows dev environment that could basically just run all the time, allowing me to do website testing on shudder IE without starting up a VM and all of that...

maleghast09:02:42

(minor benefit)

maleghast09:02:01

But most importantly it's Windows gaming without re-booting

dominicm09:02:07

No problem!

dominicm12:02:50

(case (type "")
  java.lang.String
  "foo")

(let [x (type "")]
  (cond
    (= x java.lang.String)
    "foo"))
Only one of these works.

dominicm12:02:50

(case 'foo
  foo
  "foo")
Seems related to evaluation, as this works

bronsa12:02:30

case doesn't evaluate test exprs

bronsa12:02:42

so you're trying to match String the class to java.lang.String the symbol

dominicm12:02:43

@bronsa yeah that's what I was thinking. Must admit that I'm finding some of the behaviours of case quite confusing.

bronsa12:02:50

well, case is optimized for constant time dispatching, evaluation test expressions would prevent that

dominicm12:02:09

@bronsa ah, didn't realise that was the decision. I thought it might have been a trade-off in order to support the (:a :b) syntax.

bronsa12:02:15

you can kind of cheat it by doing (case (type "") #=java.lang.String "foo" "bar")

bronsa12:02:20

but don't do that ;)

dominicm12:02:52

@bronsa Never seen #= before, where can I read about it?

dominicm12:02:02

I've cheated by swapping to condp for now

bronsa12:02:05

no idea if it's documented anywhere

bronsa12:02:34

it's read-eval

bronsa12:02:56

if you're familiar with common lisp, it's kind of like #.

bronsa12:02:26

except it's its shitty cousin that only supports a bunch of expressions, not true eval

dominicm12:02:53

Yeah, just tried playing with it & noticed that...

bronsa12:02:19

yeah, don't ever use it :) it's only in clojure for serialization purposes

dominicm12:02:25

@bronsa is this knowledge you've picked up doing tools.analyzer?

bronsa12:02:05

well kinda

bronsa12:02:16

reading through the clojure compiler and impl in general

reborg12:02:43

but didn’t know about the @bronsa trick 🙂

bronsa13:02:41

that's all it is really, a show-off trick, I would never dare use it for real :)

reborg13:02:51

case is a beautiful engineering piece BTW. It just takes some knowledge to use correctly

bronsa13:02:02

esp because it.. might break in spectacular ways under AOT

reborg13:02:08

@bronsa, if I mention it I’ll do it with your name on the side 🙂

reborg13:02:57

no worries, not going to

bronsa13:02:08

not sure I want to take responsibility for people knowing about it :P

bronsa13:02:06

it can break because case does a hashCode dispatch (for those types of objects), inlining at the bytecode level the hashcode of the class at compile time -- if on some other JDK the hashcode for that class is different, it's not going to match

reborg13:02:39

Right, good to know. Thanks for clarifying.

mattford18:02:24

More n00b questions 🙂

mattford18:02:41

(let [drop-services
        {:alsmp
         {:color :red
          :ips ["10.206.6.145"]
          :cmd "journalctl -xe --since -1min --no-pager -u dropwizard_alsmp-service -f"}
         :alsapi
         {:color :green
          :ips ["10.206.6.245"
                "10.206.6.42"]
          :cmd "journalctl -xe --since -1min --no-pager -u dropwizard_alsapi-service -f"}
         :dmdis
         {:color :blue
          :ips ["10.206.5.239"]
          :cmd "journalctl -xe --since -1min --no-pager -u dropwizard_dmdis-service -f"}
         :mips
         {:color :yellow
          :ips ["10.206.6.33"]
          :cmd "journalctl -xe --since -1min --no-pager -u dropwizard_mips-service -f"}}
        cm-infra
        {:all
         {:color :red
          :ips ["10.204.25.240"
                "10.204.26.33"
                "10.204.24.47"
                "10.204.29.23"

mattford18:02:11

I'm wondering about splitting that out into a config file.

mattford18:02:30

But it's like a dsl

mattford18:02:52

So what do people tend to do?

mattford18:02:13

That hash feeds into a function that basically multiplexes ssh connections so I can watch logs in realtime.

dominicm18:02:21

I don't think it is a DSL, it's just plain ol' data, in a specific form

mattford18:02:18

I'm debating with myself to make a dsl.

mattford18:02:39

versus just passing in the data

dominicm18:02:21

data > functions > macros

mattford18:02:41

i.e

(journalctl dropwizard_alsmp ["10.206.6.145", "10.206.6.42"] :red)

mattford19:02:43

But I'd find it odd to edit my "code" between runs rather than changing a config file.

mattford19:02:04

Anything I can read around this sort of thing?

mattford19:02:20

(with-awsprofile profile
  (with-env sit ;; instances with env tag set to sit
    (stream-dropwizard-service alsmp) ;; instances with service tag set to alsmp
    (stream-dropwizard-service alspi)
    (stream-dropwizard-service dmdis)))

mattford19:02:47

I shall take my thinking offline where it belongs 🙂

jasonbell20:02:39

@mattford config files, we tend to store maps as something called edn files

jasonbell20:02:03

This means you can have mulitple configs for different profile types

jasonbell21:02:51

@mattford (and your thinking is perfectly fine here btw!)

jasonbell21:02:35

@mattford also worth looking at https://github.com/weavejester/environ for reading environment variables via clojure.