Fork me on GitHub
#clojure-uk
<
2018-11-07
>
Rob J09:11:31

Morning all- cheers @jasonbell. I’m in Bristol and try as often as possible to get myself along to our Clojure (study) meetup. Found the UK channel and thought I’d stick my head in 😄

yogidevbear09:11:52

Welcome Rod 🙂 Where are you based in Bristol? Do you work for Ovo on their Clojure team there?

rowanharg09:11:25

Morning all, anyone know of Clojure companies or meetups in the Oxford area?

rowanharg09:11:47

I saw Juxt's blog post about Crossref (https://juxt.pro/blog/posts/clojure-in-crossref.html)

👍 8
alexlynham10:11:10

iirc these or somebody else was hiring and posted in the jobs channel recently

folcon10:11:44

Morning 😃

yogidevbear13:11:50

\o/ /o\ o< /o\

🚪 8
8
💯 12
😂 12
waving 16
maleghast15:11:16

I am having quite the day, not in a bad way per se, but wow...

maleghast15:11:32

Y'All ok out there in UK Clojure-land?

dominicm15:11:45

I'm learning about Athena 🤓

mario-star 4
jasonbell16:11:45

All the major hat tipping and thank yous to @dominicm Aleph/Yada SSL demo on Github. Worked first time, thank you!

😃 8
maleghast17:11:30

Anyone got any idea how I can create a Transit reader that does not need a ByteArray as a parameter..?

maleghast17:11:24

There are 2016-vintage tutorials that show this:

(def r (cognitect.transit/reader :json))
(cognitect.transit/read r "{}")

maleghast17:11:10

type of thing, but when I try to create a reader like this I get an arity error and it seems__ to be the case that the /reader function wants a ByteArray and indeed for that to be the content I want to read... Have I misunderstood..?

maleghast18:11:24

I've looked at the sourcecode - I need to supply an InputStream, I can see that... Need to fix this tomorrow...

jasonbell21:11:58

Going to post this here but I’ve also post it in #hugsql too.

jasonbell21:11:02

I have a Luminus app that’s coercing times of dates incorrectly when they are pulled from MySQL.

| daa2f7fe-fafb-4525-8bac-c991c37b799b | 2018-11-30 13:00:00    |
from the db becomes
#object[org.joda.time.DateTime 0x422e20d2 2018-11-30T07:00:00.000Z]
, is there any verbose logging I can turn on? I see that [clj-time.jdbc] is used when the database connection is established with Luminus but I’m at a loss on how to fix this one.

jasonbell21:11:31

Wondering if @seancorfield has come across this one before?

jasonbell21:11:21

And the local time of the db server is correct….

$ date
Wed  7 Nov 2018 21:16:53 GMT

dominicm21:11:30

@jasonbell where is the conversion code?

dominicm21:11:39

For jdbc reads

jasonbell21:11:50

HugSQL handles all that

jasonbell21:11:00

All I do is handle SQL queries.

seancorfield21:11:12

What is the timezone of your database and what is the timezone of your JVM/application?

jasonbell21:11:25

GMT, currently on the same machine

seancorfield21:11:30

Hmm, I've only ever seen that sort of thing when the TZ of the JVM pulling the data is different to the DB...

jasonbell21:11:15

user> (t/now)
#object[org.joda.time.DateTime 0x44cf71f4 "2018-11-07T21:21:03.981Z"]

seancorfield21:11:25

And that's kind of an odd TZ offset to adjust by (6 hours). That's neither West Coast nor East Coast nor anywhere in Europe...?

jasonbell21:11:52

My thinking too. I’ll keep digging around. If I come up with anything I’ll let you know.

jasonbell21:11:02

I’ve got a work around if it all goes really wrong 🙂

seancorfield21:11:25

Is it consistently wrong by 6 hours on all date/times coming from the DB?

jasonbell21:11:53

mysql> select now();
+---------------------+
| now()               |
+---------------------+
| 2018-11-07 21:22:38 |
+---------------------+
1 row in set (0.00 sec)

jasonbell21:11:27

yes it is it’s weird. It might be some strange HugSQL bug, that’s the only black box bit I can’t see what’s going on

jasonbell21:11:34

Which is kind of annoying.

jasonbell21:11:42

But my choice at the time.

seancorfield21:11:47

In your REPL, just as a sanity check, what do (java.util.Date.) and (clj-time.coerce/from-date (java.util.Date.)) return?

jasonbell21:11:40

user> (java.util.Date.)
#inst "2018-11-07T21:25:04.296-00:00"
user> (clj-time.coerce/from-date (java.util.Date.))
#object[org.joda.time.DateTime 0x7621213d "2018-11-07T21:25:26.398Z"]
user> 

jasonbell21:11:27

Luminus/HugSQL combo is using Conman to do it’s SQL execution so I’m going to REPL that and see what happens

3Jane22:11:47

Two things to check

3Jane22:11:37

1) that your mysql client does not have some weird default time zone per session which auto-converts the time stamp

👍 4
3Jane22:11:42

^ I’ve gotten bitten by that when my app was showing different times than my command line client

3Jane22:11:16

2) what happens if you store the data as time stamp without timezone? (Not sure what the MySQL equivalent of that type is)

alexlynham23:11:04

we had a problem with 2 recently where with postgres it was pushing UTC times into BST

alexlynham23:11:44

it was something silly like times were being coerced by some library wrong and we had to make sure everything had Z at the end or something