Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Methylethylaldehyde
Oct 23, 2004

BAKA BAKA

18 Character Limit posted:

Yeah, that happens in the series to some places.

Holy poo poo, I knew there was a reason I liked that show as a kid.

Adbot
ADBOT LOVES YOU

chin up everything sucks
Jan 29, 2012

Samizdata posted:

I need to get the DVDs and watch that again.

I have the DVDs. Such a good show.

Well, at least my nostalgia tells me it's a good show.

Samizdata
May 14, 2007

chin up everything sucks posted:

I have the DVDs. Such a good show.

Well, at least my nostalgia tells me it's a good show.

So does mine, so that makes two of us.

The Fool
Oct 16, 2003


A ticket went out, to a vendor who's product we use to manage board meetings.

quote:

I did some further testing and believe the issue is related to how time zones are handled.

If my system time is UTC0 and meeting time is UTC0, everything works correctly.
If my system time is UTC0 and meeting time is local (UTC-9), the offset is +9 (should be -9)
If my system time is UTC0 and meeting time is local (UTC-1), the offset is +1 (should be -1)
If my system time is UTC0 and meeting time is local (UTC-12), the offset is 0. (should be -12)


If my system time is local (UTC-9) and meeting time is local (UTC-9), the meeting appears to be offset by -24 hours. (Should be 0)
If my system time is local (UTC-9) and meeting time is UTC0, the meeting appears to be offset by -32 hours. (Should be +9)
If my system time is local (UTC-9) and meeting time is UTC+9, the meeting appears to be offset by -41 hours (Should be +18)
If my system time is local (UTC-9) and meeting time is UTC-12, the meeting appears to be offset by -32 hours. (Should be -3)
If my system time is local (UTC-9) and meeting time is UTC-10, the meeting appears to be offset by -11 hours. (Should be -1)
If my system time is local (UTC-9) and meeting time is UTC+1, the meeting appears to be offset by -46 hours. (Should be +10)
If my system time is local (UTC-9) and meeting time is UTC-1, the meeting appears to be offset by -31 hours. (Should be +8)

The pattern appears to be - ( 24 + ( offset - 1 ) )

I can make a video demonstrating this if you’d like.

vosk
Jul 28, 2005

THE PRODIGOON SON
I saw an incident come through and couldn't help but think of you guys:

Desc: Phones are on fire and smoking.
Priority: 2-High

ChubbyThePhat
Dec 22, 2006

Who nico nico needs anyone else

The Fool posted:

A ticket went out, to a vendor who's product we use to manage board meetings.

I know that time is a savage and brutal beast in the programming world, but PEER REVIEW YOUR loving CODE YOU SODS.

Collateral Damage
Jun 13, 2009

The Fool posted:

A ticket went out, to a vendor who's product we use to manage board meetings.
Recommend they watch this:
https://www.youtube.com/watch?v=-5wpm-gesOY

ChubbyThePhat
Dec 22, 2006

Who nico nico needs anyone else

ChubbyThePhat posted:

I know that time is a savage and brutal beast in the programming world, but PEER REVIEW YOUR loving CODE YOU SODS.

My brain still hurts as I think about what he must have implemented to arrive at that outcome. UGH. THAT ISN'T HOW THAT WORKS.

The Fool
Oct 16, 2003


ChubbyThePhat posted:

My brain still hurts as I think about what he must have implemented to arrive at that outcome. UGH. THAT ISN'T HOW THAT WORKS.

This one is my favorite:

quote:

If my system time is UTC0 and meeting time is local (UTC-12), the offset is 0. (should be -12)

Seriously, if I switch between UTC0 and UTC-12, the displayed time does not change at all.

ChubbyThePhat
Dec 22, 2006

Who nico nico needs anyone else
It entirely reeks of somebody trying to be way more clever than they actually are. The initial shock has passed and now I'm just laughing at it.

ConfusedUs
Feb 24, 2004

Bees?
You want fucking bees?
Here you go!
ROLL INITIATIVE!!






I used this exact video to explain why I'm not adding time zone calculations to a report, it should be done at the data gathering/database level using some existing code. And until that happens, my reports will be in UTC, since that's what the data source uses.

The Fool
Oct 16, 2003


In most cases, (IMO) you should be storing the time in UTC, then doing whatever local time transform you need in the client view.

Where my vendors product messes up is that they allow you to specify the timezone of the location of the meeting.

As a result, they should be doing something like this:
code:
$displayTime = $basetime  + ($meetingOffset - $localOffset)
Instead they do.. something else entirely

I'm probably wrong too, but less wrong than they are.

Proteus Jones
Feb 28, 2013



No, what you do is use an accepted timezone library/module and use that to do all the heavy lifting.

Don't write your own TZ routines is the take away here.

https://www.youtube.com/watch?v=-5wpm-gesOY

(8:50 is where he says to give up and use someone else code)

Proteus Jones fucked around with this message at 20:13 on Oct 20, 2017

The Fool
Oct 16, 2003


You're the second person to post the same youtube clip, I guess I'll actually watch it.

ChubbyThePhat
Dec 22, 2006

Who nico nico needs anyone else

The Fool posted:

In most cases, (IMO) you should be storing the time in UTC, then doing whatever local time transform you need in the client view.

Where my vendors product messes up is that they allow you to specify the timezone of the location of the meeting.

As a result, they should be doing something like this:
code:
$displayTime = $basetime  + ($meetingOffset - $localOffset)
Instead they do.. something else entirely

I'm probably wrong too, but less wrong than they are.

I don't think you're far off from what was actually implemented here. They tried to convert every time to a standard "known value" and adjust the offset from there. They obviously did the math incredibly wrong, on top of the logic doesn't quite work.

The correct answer is the same one you've seen already; don't do your own timezones. Use a library that already does this for you.

Dr. Arbitrary
Mar 15, 2006

Bleak Gremlin

ChubbyThePhat posted:

I don't think you're far off from what was actually implemented here. They tried to convert every time to a standard "known value" and adjust the offset from there. They obviously did the math incredibly wrong, on top of the logic doesn't quite work.

The correct answer is the same one you've seen already; don't do your own timezones. Use a library that already does this for you.

If (($UTCTime -eq 0001) -and ($Offset -eq "+1"){$LocalTime = 0101}
ElseIf (($UTCTime -eq 0001) -and ($Offset -eq "+2"){$LocalTime = 0201}
ElseIf (($UTCTime -eq 0001) -and ($Offset -eq "+3"){$LocalTime = 0301}
...

ChubbyThePhat
Dec 22, 2006

Who nico nico needs anyone else
That would have worked much better than the attempt at clever math that was made.

Rashomon
Jun 21, 2006

This machine kills fascists

Judge Schnoopy posted:

e; the 40 year old guy before him played WOW all day every day at work and was run out by the horde

Intentional or not, well done!

Dr. Arbitrary
Mar 15, 2006

Bleak Gremlin

ChubbyThePhat posted:

That would have worked much better than the attempt at clever math that was made.

I'm pretty sure I'm missing parenthesis in there, so don't put that into production without testing.

Dick Trauma
Nov 30, 2007

God damn it, you've got to be kind.
From 1914:

KoRMaK
Jul 31, 2012



re: Timezones. I store the timezone the user prefers with the datetime, then on render I display it with the timezone info next to it so that there are no questions.

This was hard learned after some timezone fuckery in the app I write and maintain at work. The key thing I learned was that a datetime needs two consderations: the timezone it was inputted as, and the timezone for what context you are rendering it to.

ConfusedUs posted:

I used this exact video to explain why I'm not adding time zone calculations to a report, it should be done at the data gathering/database level using some existing code. And until that happens, my reports will be in UTC, since that's what the data source uses.
If they are in UTC, you can just render them adjusted to the user's preferred timezone. I don't know your exact situation, but if they just want to see the times in EST it wouldn't be that hard or zany to do.

KoRMaK fucked around with this message at 03:48 on Oct 22, 2017

ConfusedUs
Feb 24, 2004

Bees?
You want fucking bees?
Here you go!
ROLL INITIATIVE!!





KoRMaK posted:

re: Timezones. I store the timezone the user prefers with the datetime, then on render I display it with the timezone info next to it so that there are no questions.

If they are in UTC, you can just render them adjusted to the user's preferred timezone. I don't know your exact situation, but if they just want to see the times in EST it wouldn't be that hard or zany to do.

At the time it happened, Tableau either did not have any time-zone-adjustment features or I didn't know about them (and couldn't find any).

I wasn't about to start making calculated fields to add/remove hours from the date.

TinTower
Apr 21, 2010

You don't have to 8e a good person to 8e a hero.

how do you call them if your phone isn’t working? :thunk:

KoRMaK
Jul 31, 2012



ConfusedUs posted:

At the time it happened, Tableau either did not have any time-zone-adjustment features or I didn't know about them (and couldn't find any).

I wasn't about to start making calculated fields to add/remove hours from the date.

Oh lol, yea that was the right thing to do. Never write your own timezone library, as the video says

mewse
May 2, 2006

TinTower posted:

how do you call them if your phone isn’t working? :thunk:

SHUT UP THATS HOW

Neddy Seagoon
Oct 12, 2012

"Hi Everybody!"

TinTower posted:

how do you call them if your phone isn’t working? :thunk:

You might want to start noticing that it says "don't 'hit your phone'" not "don't 'hit someone WITH your phone'...", because we can fix several problems at once that way, smartguy :toughguy:.

Renegret
May 26, 2007

THANK YOU FOR CALLING HELP DOG, INC.

YOUR POSITION IN THE QUEUE IS *pbbbbbbbbbbbbbbbbt*


Cat Army Sworn Enemy
Today I learned not to name applications after human names.

Otherwise get e-mails reporting "Cassandra choking on the load" (direct quote)

Samizdata
May 14, 2007

Renegret posted:

Today I learned not to name applications after human names.

Otherwise get e-mails reporting "Cassandra choking on the load" (direct quote)

Who's a bad app? Who's a wicked naughty little app?

Kyrosiris
May 24, 2006

You try to be happy when everyone is summoning you everywhere to "be their friend".



Renegret posted:

Today I learned not to name applications after human names.

Otherwise get e-mails reporting "Cassandra choking on the load" (direct quote)

The real question was, how many times were you warned about the load before it happened? :v:

Agrikk
Oct 17, 2003

Take care with that! We have not fully ascertained its function, and the ticking is accelerating.

Renegret posted:

Today I learned not to name applications after human names.

Otherwise get e-mails reporting "Cassandra choking on the load" (direct quote)

Does she spit data or ingest it?

Methylethylaldehyde
Oct 23, 2004

BAKA BAKA

Agrikk posted:

Does she spit data or ingest it?

It just kinda dribbles out.

Thanks Ants
May 21, 2004

#essereFerrari


:gonk:

Agrikk
Oct 17, 2003

Take care with that! We have not fully ascertained its function, and the ticking is accelerating.

Methylethylaldehyde posted:

It just kinda dribbles out.

:drat:

Attestant
Oct 23, 2012

Don't judge me.

I am printing this out and putting it on the IT departments door. You wouldn't believe how often people admit they "tried hitting a few times" to make something work.

RFC2324
Jun 7, 2012

http 418

Attestant posted:

I am printing this out and putting it on the IT departments door. You wouldn't believe how often people admit they "tried hitting a few times" to make something work.

percussive maintenance is a thing.

https://electronics.stackexchange.com/questions/209010/what-is-the-science-behind-percussive-maintenance

SEKCobra
Feb 28, 2011

Hi
:saddowns: Don't look at my site :saddowns:

"Call our complaint department" in response to your phone not working is great advice.

Alkydere
Jun 7, 2010
Capitol: A building or complex of buildings in which any legislature meets.
Capital: A city designated as a legislative seat by the government or some other authority, often the city in which the government is located; otherwise the most important city within a country or a subdivision of it.




I remember an old story I heard that when the Army switched over to lead-free solder in a lot of their electronics they actually had a problem where said solder tended to create crystalline fibers that caused shorts. So you ended up with scenarios where any electronics on a piece of equipment that vibrated worked find because those crystals would shake off, but stuff that was used gently would fritz out and short. So you'd have Army technicians fixing their officer's radio by "accidentally" dropping it because they don't want to admit to their officer they fixed the radio by slamming it against the desk.

Methylethylaldehyde
Oct 23, 2004

BAKA BAKA

Alkydere posted:

I remember an old story I heard that when the Army switched over to lead-free solder in a lot of their electronics they actually had a problem where said solder tended to create crystalline fibers that caused shorts. So you ended up with scenarios where any electronics on a piece of equipment that vibrated worked find because those crystals would shake off, but stuff that was used gently would fritz out and short. So you'd have Army technicians fixing their officer's radio by "accidentally" dropping it because they don't want to admit to their officer they fixed the radio by slamming it against the desk.

Those are Tin Whiskers, and they're still a pain in the dick to this very day.

Aunt Beth
Feb 24, 2006

Baby, you're ready!
Grimey Drawer

Methylethylaldehyde posted:

Those are Tin Whiskers, and they're still a pain in the dick to this very day.
You haven’t lived until those snap off the logic components of a UPS and get sucked into the electrical stuff. Nothing like a little pop right as you are pulling out a hard drive in the same rack for replacement.

Adbot
ADBOT LOVES YOU

NeuralSpark
Apr 16, 2004

A former customer of mine had to shut down a large video production studio for several days because the mains in the battery backup - generator transfer switch had tin whiskers that were almost in contact with each other. I heard they wanted to get an exception from the state for leaded replacement components, but I don't know if that actually came through.

  • Locked thread