Fork me on GitHub
#clojure-europe
<
2020-09-02
>
slipset06:09:46

So, here's a short little story about a morning that could've turned this day and the following days into a true disaster.

slipset06:09:51

Every morning, I start my day with a nice cup of cafe au lait from my trusty old Silvia. She's been serving us well for almost 10 years.

slipset06:09:08

This morning she would not heat up.

slipset06:09:04

I was petrified. A morning without coffee, a lunch without coffee, and then it dawned upon me. She might have to be repaired at a shop, which would mean weeks without decent coffee.

slipset06:09:47

But luckily, Silvia is engineered in the finest of ways. She's composed of simple, small building blocks, one of which is a fuse.

slipset06:09:13

I decomposed her slightly, got access to her fuse, reset it, and bang she was hot again.

slipset06:09:28

Coffee was made, and the day was good.

🎉 12
3
dominicm06:09:27

10/10. Will read the sequel.

🙂 6
synthomat07:09:26

a good morning!

otfrom07:09:06

@slipset that is a great advert for understandable, repairable things

3
synthomat12:09:53

wow all of this date-time handling is driving me nuts. will there ever be the magical moment where, all of a sudden, everything appears clear and understandable?

Eugene Koontz12:09:33

I encountered something similar: I added this to my project.clj: https://gist.github.com/ekoontz/3c80b084e48fc47c6a8a1482defd3107

synthomat12:09:27

why do I receive a UTC time stamp, convert it to a UTC date for Postgres, PG has the UTC timezone set, but when I query my timestamps they are off by -2hrs?

synthomat12:09:37

huh, what… does IntellIJ also convert timezones in the sql output?? :man-facepalming:

synthomat13:09:14

okay found the issue… it’s not IntelliJs fault

RAMart14:09:00

Is it in front of it? 😎 SCNR

synthomat14:09:43

yes, of course! 😄

synthomat14:09:29

what I didn’t know: apparently the pg-jdbc driver subtracts the local timezone from a LocalDateTime object to store it as a UTC timestamp

synthomat14:09:16

i was sending a UTC date, and Postgres (or the driver?) subtracted the local TZ from it :man-facepalming:

RAMart15:09:14

DateTime is really PITA. But Encoding is also: e.g. "I have a UTF-8 string, the JDBC-Connection is set to UTF-8, the database is set to UTF-8, the console is set to UTF-8 and even the used font is able to render UTF-8. Why the f... do I see nothing but garbage?" It's always "fun" to debug this. And it's really too hard for newbies.

RAMart15:09:05

Back to ASCII-7! 😂

Ben Hammond09:09:57

what was the UTF-8 problem you describe, @U1Z4D5SSV?

RAMart09:09:47

It depends. 😁 I'm the one helping to hunt these bugs down. If one of my colleagues states "I have a UTF-8 string..." I ask "How do you know?". Sometimes the source code file isn't UTF-8, so his/her assumption was wrong. Or it looks like an UTF-8 string in the debugger, but the debugger lies right into your face. Just too many layers of encoding and decoding when watching at a simple string on your screen.