Fork me on GitHub
#clojure-uk
<
2018-03-18
>
yogidevbear07:03:10

Morning. Nice and white outside this morning

yogidevbear07:03:13

Go start a snowball fight @dominicm 😉 ❄️

otfrom11:03:55

thinking yet more about event sourcing today and what it really means from a design pov (I love that everything becomes map and reduce and I'm thinking that I don't need a database any more for my aggregates as long as I have a good durable store for my events)

otfrom11:03:29

I've got some code I'm pretty happy with that works for a batch. I just need to think about how it changes when reads are happening at the same time as writes so I need to think about how I'll model things using atoms/refs/other in ways that avoid too much contention

maleghast11:03:58

Hello All... Crikey @dominicm you were up early for a Sunday!

dominicm11:03:37

Dog needs tablets every 8 hours, I get the morning shift :)

maleghast11:03:55

@otfrom - I would really love to pick your brain about this stuff (event sourcing) some time (soon)...

dominicm11:03:04

I like being up early tbh

maleghast11:03:07

@dominicm - Ah, yes, I can see how that would get one up.

maleghast11:03:39

@dominicm - Seeing as you are up... Am I being dense or is it possible that tick does not yet support creating a sequnce of "ticks" that are one year apart?

maleghast11:03:22

I've looked through the source code and can't find an implementation of "years" and if I do this:

(take 10 (timeline (periodic-seq startdate (years 1))))
I get 10 datetime objects that are exactly the same as one another, whereas if I do this:
(take 10 (timeline (periodic-seq startdate (days 10))))
I get a 10 datetime objects that are each 10 days apart...

dominicm11:03:11

@maleghast something tells me you have found a bug 😛

maleghast11:03:48

OK, that's encouraging - I felt it was as likely that I was being dense 🙂

maleghast11:03:25

In the short term I can probably use clojure.java-time to do what I want, but I like tick and its API so I was hoping to use it for what I need too...

dominicm11:03:11

We definitely had this at some point, but things went into deprecated namespaces and I'm not sure anymore.

maleghast11:03:04

I'll maybe raise an issue on the Github repo?

maleghast11:03:34

If I had more time on my hands I would fork it and try and fix it / put it back, but I need to get some other stuff done__

maleghast11:03:49

Maybe later in the week...

otfrom12:03:25

and this is before dealing with all the dynamic vars and bindings

maleghast12:03:27

So... While @otfrom manages migration Hell... If I had (1,2,3,4) and I wanted ([1, 2], [2,3], [3,4]) is there a standard library function that can do that..?

maleghast12:03:56

I thought that there might be 🙂

otfrom12:03:13

look at the docs. It takes a step

otfrom12:03:28

and you might want partition-all, but idk your use case

maleghast12:03:36

I'll have a look at partition-all, but partition appears to be exactly what I wanted. These are the reasons why I ❤️ Clojure... This would be nested loops in Ruby.

maleghast12:03:55

(I bet there's a neat functional(ish) way to do it in Python)

maleghast12:03:20

Ah, I am doing a (partition 2 1 coll), so I don't think that I need partition-all...

maleghast12:03:19

Yeah, partition works for any length of collection with these params.

maleghast12:03:33

(apart from a collection of 1 item)

otfrom12:03:47

list comprehensions in python at a guess. I really disagree w/Guido that they are easier to understand than map and reduce

otfrom13:03:37

just have to fix delete now according to the tests

otfrom17:03:15

and now it works. Anyone fancy giving me their opinion on the PR? https://github.com/otfrom/clucy/pull/1