Fork me on GitHub
#clojure-uk
<
2017-11-17
>
thomas08:11:38

moin moin morning

guy10:11:25

Morning!

mccraigmccraig11:11:36

(fortunately i didn't bugger up the other two replicas and recovery was relatively straightforward)

danm11:11:03

Kafka? Or using Zookeeper for some other porpoise?

mccraigmccraig11:11:28

@carr0t were i to build these AMIs again i would do exactly that

mccraigmccraig11:11:38

zk is for dc/os

mccraigmccraig11:11:58

although kafka and onyx are using it too

dotemacs12:11:59

@mccraigmccraig what are you doing with zookeeper that filled up the disks ? I know what zookeepr is and what it’s used for, especially in DC/OS context. But I’ve never experienced this. What did you do to get into this state in the first place ? You gave your server instances very few GBs… ?

mccraigmccraig12:11:53

@dotemacs it was partly me being dumb - i uploaded a large CQL file to the root volume. there is plenty of space on the non-root volumes, but it seems that this dc/os deploy has put the ZK db on the root volume

mccraigmccraig12:11:54

most of the space is on /var/lib/docker, /var/lib/mesos and /dcos/volumeN volumes. ZK however is at /var/lib/dcos and whoever at mesosphere (who produced the base AMI scripts) didn't think that merited its own volume... it lives on the 8GB root volume

yogidevbear13:11:18

Bejeezuzz! Black Friday is making a black hole in my bank account 😞

dominicm13:11:29

When is black friday? Today?

yogidevbear13:11:47

It is at some places

yogidevbear13:11:56

Like Amazon if you're on Prime

yogidevbear13:11:05

Curries have black friday stuff going on too

dominicm13:11:23

explains the great deal on psvr

minimal13:11:41

next friday

yogidevbear13:11:04

Officially, but some places have already started

minimal13:11:17

oh yeah, amazon already started

minimal13:11:45

eventually it will be the whole month

danm13:11:15

Is it actually a great deal?

danm13:11:35

I thought a lot of places did stuff like ramp up prices for the month beforehand so the deal looked much better than it actually was

jasonbell14:11:48

When the local radio station is blasting out “black friday deals” for a local shop, it’s all gone too far.

otfrom14:11:35

I wanna be an American Idiot

thomas15:11:59

How do people feel about things being :require ... but not used at all in the file later on? clean up? or leave as is (this code is already in production)

conan15:11:44

i always clean up. i keep all requires alphabetised to avoid duplication (which always happens), but if you're requiring something for side effects (something i find happens a lot with spec) then it doesn't have a :refer or an :as in it, in which case i know to be careful

rickmoynihan10:11:47

For purely side-effecting requires, e.g. loading protocol extensions, I’ve adopted the convention of including them outside the ns definition as (require 'foo.bar) ;; side effect, that way I can use cljr-clean-ns without fear.

thomas15:11:27

I would like to clean it up.... I guess if I get it wrong I would get a compile error 🙂

reborg15:11:57

@thomas also double check they are not loading defprotocol extensions, a legitimate case of require that does not show up as usage in a namespace

mccraigmccraig15:11:45

clean up. easy to do with clojure (clj-refactor has a fn), harder with clojurescript. and what @reborg said. that gives you runtime errors

thomas15:11:08

in this case it is mainly ...java.jdbc so I think I am ok... but better check 😉

bronsa15:11:09

that said, if you find yourself in a positon where you need to load a namespace solely for side-effects, you might be either organizing your namespaces wrong (this with the recent exception of spec namespaces) and not keeping type/protocol definitions and declarations together, or you're having too much state in your programs :)

seancorfield15:11:34

Is there an argument for using a top-level require

seancorfield15:11:35

For such side-effecting namespace loading?

bronsa15:11:36

in some cases there is I'd say (`.spec` segments, very specific situations like e.g. in the cljs compiler)

bronsa15:11:52

but 90% of the cases it's quite the code smell

reborg16:11:53

not sure I follow @bronsa, we have dozens of suppliers and counting, each one of them extending a bunch of defmethods, I surely don't want all of those implementations to end up in a single namespace. Is that a code smell?

seancorfield16:11:35

Well... I was thinking it might stand out as "here be side-effects"... I ran across it with tools.deps because it has multi-methods across multiple namespaces.

bronsa16:11:02

@reborg well, as I see it there's 2 situations

dominicm16:11:11

I have heard someone called out the practice of using java.jdbc's protocols for extending joda dates & such going against "best practices", due to this reason.

bronsa16:11:23

(pressed enter too early, message incoming :))

seancorfield16:11:40

You have to require all the namespaces to make the parsing work but you don't use those namespaces otherwise. You literally require them for the side-effect of defining the methods.

bronsa16:11:01

-1 you have namespaces whose only reason is to register defmethods for a specific supplier

bronsa16:11:22

-2 you have namespaces about those suppliers with functions AND a bunch of defmethods

bronsa16:11:07

i'd say 1 is a big code smell and should be in a single file, 2 is fine IME, as you keep functions that manipulate a certain object and the stateful defmethods/extends coupled

bronsa16:11:39

but that's just my opinion

dominicm16:11:19

I agree with your opinion. I've had significant pain with -1.

bronsa16:11:53

@seancorfield yeah and I don't like that about tools.deps TBH, I don't see why they have to be namespaces and not just either separate files that just get loaded in (like what clojure.core does), or simply alll in a file

dominicm16:11:28

I have seen another option:

(defn activate-magic! []
  (defmethod …))
Which was a compromise in order to satisfy refactor.el I think.

bronsa16:11:01

i mean that works but eugh :)

seancorfield16:11:04

Since it's Cognitect code I sort of assume it's how they think we should do it 😀

bronsa16:11:44

meh, I don't buy that argument :)

reborg16:11:21

It's number -2 here (phew). It's much better to search for a supplier and have all the info you need in a single place (actually a folder with several ns). If the defmethod was elsewhere, it would make life more difficult. Having said so, there is one ns that collects all the side-effecting ones, so when that's required, everything is registered

bronsa16:11:26

tools.deps itself was broken for a few days initially precisely because it didn't require the file ns for side effects

seancorfield17:11:23

That's only in tools.deps.alpha.makecp so if you happen not to :require that -- I wasn't using it, only reader at first -- then you run into that problem.

seancorfield17:11:39

The code is strangely structured, IMO, since the alias handling is not public, and you need access to that in tooling if you want to wrap tools.deps properly.

bronsa18:11:14

voted :thumbsup:

dominicm16:11:45

@bronsa Yeah, I agree, eugh.

seancorfield16:11:58

Ah, I missed the single all-loading ns.

paulspencerwilliams17:11:05

Right, it's the weekend y'all, and thus for most of us non @ work Clojure types...... #ClojureTime! For me, it's all about reacquainting myself with SICP after a few failed attempts at going through it a few years back. Anyone else got any exciting plans?

seancorfield17:11:23

That's only in tools.deps.alpha.makecp so if you happen not to :require that -- I wasn't using it, only reader at first -- then you run into that problem.

chrisjd21:11:37

@paulspencerwilliams #ClojureTime here, too. 🙂 I've found ways to use Clojure a little at work, but the vast majority of my constructive time with it is after my daughter's gone to bed.

seancorfield21:11:55

Hopefully my weekend #ClojureTime will be continuing to work on the new documentation for Expectations and improving clojure.test compatibility!

dominicm21:11:45

I'm hacking on REPLant. I'm trying to get it such that when you do an eval, the stacktrace opens a nice error buffer.