Fork me on GitHub
#clojure-uk
<
2019-05-10
>
maleghast10:05:57

Morning everyone 🙂

otfrom11:05:01

ugh, I can never remember how to get a periodic-seq out of clojure.java-time

otfrom11:05:27

is there something better than the following?

(defn months-seq
  "Takes t/year-months like: (months-seq (t/year-month 2017 7) (t/year-month) \"yyyy-MM\")"
  ([start]
   (map (fn [x] (t/plus start
                        (t/months x)))
        (range)))
  ([start end]
   (take-while #(t/before? % (t/plus end (t/months 1)))
               (months-seq start)))
  ([start end fmt]
   (map #(t/format fmt %) (months-seq start end))))

Ben Hammond14:05:17

(take 10 (reductions java-time/plus (java-time/local-date) (repeat (java-time/period "P1M"))))

Ben Hammond14:05:46

thats using

clojure.java-time {:mvn/version "0.3.2"}

Ben Hammond14:05:07

if you can depend upon such a thing

otfrom14:05:14

heh... depend

😁 4
otfrom11:05:37

(at least it is less code this time 🙂 )

jasonbell11:05:06

That’s the only place I can ever remember using it.

otfrom11:05:08

ah, but that is good old clj-time, and I know that has periodic-seq. 😉 I was hoping to use the newer java-time (I stole that code from the private disco you remember)

jasonbell11:05:19

ah right, I get ya

dominicm11:05:29

I think tick has some stuff for doing this with the new java time 🙂

otfrom11:05:43

🎵 any old sequence will do

😄 4
jasonbell11:05:55

Yeah I remember Malcolm doing the demo at ClojureX a couple of years back

otfrom11:05:03

@dominicm ah, tick. Should I be using that for my time and date needs?

jasonbell11:05:06

So it’ll be in a SkillsMatter vid

dominicm11:05:47

@otfrom up to you, we use it and like it :)

otfrom11:05:09

that is a wonderfully British recommendation 😄

alexlynham13:05:19

felt too ill to cycle in this morning, but remembered I have chores to run, so figured I would cycle in to the co-working space at lunch. Just prepped the bike and saw it’s started raining. Great.

Conor13:05:51

Go to bed dude, that is the plus point of being perm

otfrom13:05:33

@alex.lynham yeah, if you are perm stay home. Don't infect your cow-orking buddies

otfrom13:05:46

only contractor scum get to do that

alexlynham13:05:42

I was going to go anyway and then the rain has intensified further

alexlynham13:05:05

the thing is, the chore I need to do is get the parts to tap a keg for a party tomorrow

metal 4
otfrom13:05:19

well, that you can do and I won't tell any bosses

alexlynham13:05:32

basic utilitarian philosophy states I am expendable in the face of the commonwealth having access to beer

otfrom13:05:59

I think :spock-hand: has something to say about that

otfrom13:05:17

don't make us go past the Klingons to get you from the Genesis planet

alexlynham13:05:09

xactly, spock was right

yogidevbear13:05:31

>cow-orking 😆

otfrom13:05:00

@alex.lynham that kind of thinking is how you get starships shot out from underneath you

rickmoynihan13:05:24

it’s for the greater good 🍻 🍻 🍻 🍻 🍻

rickmoynihan13:05:00

Just discovered my first ever legitimate use for a <marquee> tag, and found html5 made it obsolete. 😢

rickmoynihan13:05:53

much better to use a style than a tag; but still disappointed we can’t build modern webapps like we did in ’98

jasonbell14:05:57

Can we go back to J2ME please…

dharrigan14:05:04

(if it was up to oracle, it would be a yes yes yes )

rickmoynihan14:05:37

I’m with @maleghast on this one… MIDP was a royal PITA.

jasonbell14:05:00

Lighten up chaps I was joking.

rickmoynihan14:05:01

@jasonbell You’ve just brought back bad memories; well and truly burried of struggling to get a multiplayer battle of gettysberg game working on an old Nokia 6600 for Orange/France Telecom… I might not sleep tonight.

rickmoynihan14:05:19

I’d almost forgotten I could claim I was once through an unfortunate contract; a mobile games developer… not that the game ever made it to market.

jasonbell14:05:31

Think of me as your programming therapist @rickmoynihan taking you back on some regression therapy to old projects. How did you feel when you wrote those things, thinking back how what could you have done differently……. now forget all this 🙂

rickmoynihan14:05:03

alone a stranger and afraid, in a world I never made

Ben Hammond16:05:21

have good weekends everyone

Ben Hammond16:05:49

(the right but not the obligation)