This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-27
Channels
- # aleph (7)
- # beginners (80)
- # boot (1)
- # cider (3)
- # cljs-dev (277)
- # cljsjs (52)
- # cljsrn (1)
- # clojure (69)
- # clojure-gamedev (4)
- # clojure-italy (1)
- # clojure-losangeles (2)
- # clojure-russia (89)
- # clojure-spec (92)
- # clojure-uk (196)
- # clojured (1)
- # clojurescript (70)
- # cursive (5)
- # data-science (1)
- # datascript (84)
- # datomic (9)
- # defnpodcast (12)
- # docker (1)
- # emacs (4)
- # events (1)
- # fulcro (112)
- # graphql (1)
- # jobs (1)
- # lumo (1)
- # nrepl (21)
- # off-topic (2)
- # onyx (3)
- # protorepl (10)
- # re-frame (23)
- # reagent (66)
- # reitit (2)
- # rum (13)
- # shadow-cljs (144)
- # spacemacs (14)
- # sql (4)
- # unrepl (29)
- # vim (16)
månmån
I find that a comical thought for some reason (re Malcolm cursing)
Morning Craig
How are you doing this fine snowy morning?
my kids are all running around in the snow this morning, but i've been ill and am confined indoors 😭
Oh dear. Then I won't mention that white stuff again
ha, it's fine - i'm off to norway on wednesday for some snowboarding with my eldest, so i'll get a good dose of snow... just a bit sad to be missing out on the snowman building and snowball fights though
Lovely. I'm very envious
morning!
my southern train ran this morning:exclamation:
@peterwestmacott you should perhaps save your surprise for after your home-train 😬
very true
I’m half way through building a lego rocket with my kids, they’ll be disappointed if I’m late home.
I bet you can't wait until it's complete. You'll never need depend on Southern again.
It isn’t modelled on Stephenson’s Rocket!
a quick look at bullet acceleration gives figures in the ~10,000g range... i'm not sure can cope with that, even eyes-in @otfrom
if you are maintaining a databases as a hashmap. Is it worth having it as a atom of a hashmap with <k, atom> pairs?
@mccraigmccraig ballistic doesn't need to be that fast
@otfrom it's quite a long way from brighton to london
@mccraigmccraig to beat Southern I would estimate that 0.1g would be more than sufficient.
@otfrom why are you wanting the inner atoms ?
@mccraigmccraig partly so that I can work on them independently of the outer atom
@otfrom and have you considered agents too ?
IIUC if I swap! the inner atom it won't cause an issue w/the outer atom (which I'm also mutating)
I'm a bit worried with this design that I'm going full erlang. And you should never go full erlang. 😉
correct - swap!ing the inner atom won't cause any contention on the outer atom (since the value of the outer atom remains unchanged)
a while back i had an atom which was suffering from contention and swapped it for an agent and everything was happy again... i think it's the only time i've ever used an agent in anger
what's the thing that you are doing?
creating audit trails for various resources (so consuming events across different domains and a single event can update a lot of things)
so I'm just letting the go loops look after a single resource each and made the decision for its one thing
ah, i see - so you will send events to all the channels and each go-block will decide whether to apply to its atom or not ?
well it sounds very simple to implement - but you are multiplying your event flow so you might have throughput problems if you have too many keys to update
ok, so filtering early will help with that. I was wondering where the bottlenecks might be
how many keys and what event rate are you talking about ?
but I can filter quite a bit of the event stream as some things aren't interested in some of the messages
i'd go with the simplest solution first and iterate if you hit any throughput problems
simple and obviously correct is a valuable attribute of an event processing system 🙂
i've never played with specter - is it good ?
looks like an interesting alternative to zippers for some things and datascript for others
@otfrom - I am fascinated by ^^ about atoms withing atoms... Also WTF is Specter, and how does the maintainer justify the misspelling?
hmm @otfrom i'm not sure the atom within atom thing works - creating go blocks is a side-effect and you don't want your swap! fns to have any side-effects, since they can (and do) get repeatedly applied
the go block isn't in the atom. It just has a reference to it and can change it as it receives things on its channel
right, but if the go-block is created in the outer-atom's swap! then it's a side-effect of that, and you may get multiple go-blocks created for a single key
probably create the inner atom, swap! it into the outer atom and then hand the inner atom off to the go block
although an agent with inner atoms should be ok @otfrom
i think i should look at specter for our re-frame app... it looks like it might make a bunch of our app-db transforms a lot simpler
have you used it lots @dominicm?
@mccraigmccraig low-medium. I understood it for about a day or two.
Novice is probably the word I'm looking for. I know where it would help, and roughly what it provides.
I used it for the first time the other day. Made traversing nested vectors quite easy
So would that be interpreted as "bend your data to fit the tooling"?
that's pretty much the lisp philosophy @yogidevbear - bend your language to be easily transformable by the tooling
You know, with the word spelled not only correctly, but also in such a way as to preserve the meaning of the shadowy organisation that dogs the heels of James Bond..? (the Special Executive for Counter-intelligence, Terrorism, Revenge, and Extortion)
the performance optimizations it uses are undeniably good, but also completely unnecessary to me
in my experience when - data gets too nested, I don’t reach for a better zipper or a different lens abstraction, but I flatten it out instead and use some querying language over the flat db - the default updating operators get too slow, micropotiminzing a few microseconds away is not enough, it means I have to switch data representation/data structure
@bronsa you mean something like https://github.com/alandipert/intension ?
(specter noob warning) the other thing specter seems to offer is type-preserving transformations - that seems quite useful ?
I have found myself writing a few type-preserving transformation protocols for places where I expect the algorithmic complexity to not be problematic.
@dominicm I don’t know how that library works but if it does translate the nested DS in a flat EAV-like db, then yes
I have a Clojure question. I have the following function:
(defn F
[X Y C]
(let [_C (get-point-value X Y)]
;...
(map
#(if (= _C (get-point-value (inc (first %)) (inc (last %))))
(recur [(inc (first %)) (inc (last %)) (str "\"" C "\"")]))
(get-adjacent-points [X Y]))))
I get the following error when running (F 1 1 "X")
:
ClassCastException java.base/java.lang.String cannot be cast to java.base/java.lang.Number clojure.lang.Numbers.inc (Numbers.java:112)
The offending line is: (recur [(inc (first %)) (inc (last %)) (str "\"" C "\"")]))
If I adjust the function to the following...
(defn F
[X Y C]
(let [_C (get-point-value X Y)]
;...
(map
#(if (= _C (get-point-value (inc (first %)) (inc (last %))))
(println [(inc (first %)) (inc (last %)) (str "\"" C "\"")]))
;(recur [(inc (first %)) (inc (last %)) (str "\"" C "\"")]))
(get-adjacent-points [X Y]))))
... and run (F 1 1 "X")
, then I don't see the error, but rather:
[2 1 "X"]
[1 2 "X"]
which is correct for the scenario.
My question: Does anyone know what might be causing the issue in the offending line?
(recur [(inc (first %)) (inc (last %)) (str "\"" C "\"")]))
If I change it to prn
I get:
[2 1 "\"X\""]
[1 2 "\"X\""]
Or better yet, if I adjust it to:
(prn [(inc (first %)) (inc (last %)) C]))
I get
[2 1 "X"]
[1 2 "X"]
Alright, if I change my original function to:
(defn F
[X Y C]
(let [_C (get-point-value X Y)]
;...
(map
#(if (= _C (get-point-value (inc (first %)) (inc (last %))))
;(prn [(inc (first %)) (inc (last %)) C]))
(recur (prn [(inc (first %)) (inc (last %)) C])))
(get-adjacent-points [X Y]))))
I get the following error:
NullPointerException clojure.lang.Numbers.ops (Numbers.java:1018)
@bronsa I'm curious what querying language(s) you've used on the flat db, and what your experiences are with that?
What would be the idiomatic lazy way of recuring to F
?
do you mean https://github.com/martintrojer/datalog ? or something else for datalog?
@yogidevbear calling F
@dominicm I massively prefer declarative querying over “structural” navigation, for expressiveness and power
I thought recur
did work in a lazy fashion as it doesn't hold onto the tail (not sure I'm using the right terminology here)
I mean that could work too but if you work on flattened data from the start then you get easy updates for free
Or only holds onto the tail or something
Ok cool, thanks for clarifying that 🙂
Yay! It works! 🎉
anyone tried out https://github.com/dcos/terraform-dcos ( @otfrom ? ) - i have to rebuild my dc/os cluster (to increase a sysctl dammit) and terraform-dcos looks like it might be a better approach than the mesosphere AWS CF templates (which work fine, but don't support upgrades)
ah, yeah - we talked about it a while ago 🙂 but slack is terrible at history, and my memory is poor
how has terraform-dcos been for you ?
what does that mean ?
the annoying thing is that it creates the cluster with node’s port 22 exposed to the world
it creates it with PK only ssh auth though ?
ok, so a bit poo but probably not actually insecure
can you specify custom AMIs for the different roles (master, public-agent, private-agent) ?
about the module thing: when you do terraform, you can include some libraries as a module and then have your main setup just use that module. But the way this setup is created, you’ll be using this as the “the main thing” and adding your own tweaks to it
i see... i'm ok with that i think
the CF templates are the same - one AMI to rule them all
it's a bit pants, when you want your private agents to have a load of storage and your public agents and masters not so much
yea, you can set the disk size per functionality for sure (master, bootstrap, agent…)
currently i'm specifying a bunch of EBS mounts, which i can then use as dc/os MOUNT volumes
it makes for easy isolation of the storage for my persistence services
The thing that fsck-ed me up is that they specify a particular AWS DNS server on setup, but only for Google cloud. And if you don’t declare it for AWS, when you try to boot up Kafka, it just won’t work. Kafka broker won’t be able to look up any of the agents it has. It just won’t resolve them. So you must have this declared before hand. It’s sort of tribal knowledge… I really should do a PR for this…
is that just a tf variable ?
this one - https://github.com/dcos/terraform-dcos/blob/master/aws/variables.tf#L135
or something else ?
cool... well i guess i'll give it a go and see how far i get - thanks for the help 🙂
no problem. one thing that you might want to do is declare a s3 bucket, which you should create before hand, to store the terraform state in
is that the dcos_aws_template_storage_bucket
tf var ?
or the dcos_s3_bucket
var ?
but the thing is, I think that you need to set up your s3 bucket before you start running this setup… from what I remember
http://www.bbc.co.uk/news/uk-england-coventry-warwickshire-41108152 I just had a letter through the door about disbanding the council, this was one of their reasons. It Shocked me.
Councils are happy to attempt to fill empty space and get the retailer on the business rates instead. Been on the rise for a while.
A business would pay the rent on the lease of the property and also rates to the council (policing and so on). They are two different payments. A lot of landlords/councils will sweeten a deal by writing off the rent but still expect the business rates to be paid.
> Councils are happy to attempt to fill empty space I think this part particularly surprises me. Why not use the reduced prices to make it more appealing for a local business to open? They always bring something unique to the area.