Some of you may know libtai, djb's 2038-safe date and time library. When I started looking at 2038 fixes for Perl this was one of the first things I looked at.
Unfortunately, it doesn't handle time zones so I went and wrote my own. Just recently I thought, "hey, maybe libtai could make use of my technique to use a 32 bit localtime() to do time zone calculations!" So I posted a message to the libtai mailing list...
Subject: Algorithm to exploit 32 bit time functions to do time zone calculations
Hi, I'm writing to you in reference to your libtai library whose TODO file states that "support time zones" is still todo. I had originally considered using libtai in Perl to avoid the Unix 2038 bug, but Perl requires time zone support.
Instead, I am rewriting the time.h library functions to be 2038-clean. The effort is located here. http://code.google.com/p/y2038/
The piece which is of interest to libtai is this: http://code.google.com/p/y2038/wiki/HowItWorks
I have figured out a way to make use of 32 bit system functions to do 64 bit time zone and daylight savings calculations. I thought you might be able to apply this to libtai.
Thanks, Schwern
PS Any potential license issues I'm happy to work out.
From: NAME WITHHELDTo: Michael G Schwern Subject: Re: Algorithm to exploit 32 bit time functions to do time zone calculations
Michael G Schwern dixit:
>Instead, I am rewriting the time.h library functions to be 2038-clean. The
*yawn* MirBSD uses a 64-bit time_t type on i386 (ILP32), with the aid of tm2mjd and mjd2tm functions from DJB libtai code. The rest of the functions from the time library work just fine
>PS Any potential license issues I'm happy to work out.
libtai is in the Public Domain.
From: NAME WITHHELDTo: Michael G Schwern Subject: Re: Algorithm to exploit 32 bit time functions to do time zone calculations
Michael G Schwern dixit:
>Instead, I am rewriting the time.h library functions to be 2038-clean. The
You might be reproducing work.
MirBSD uses a 64-bit time_t type on i386 (ILP32), with the aid of tm2mjd and mjd2tm functions from DJB libtai code. The rest of the functions from the time library work just fine.
>PS Any potential license issues I'm happy to work out.
libtai is in the Public Domain so you can make use of it in your project like MirBSD does.
From: Michael G SchwernTo: NAME WITHHELD CC: libtai@list.cr.yp.to Subject: Re: Algorithm to exploit 32 bit time functions to do time zone calculations
Thorsten Glaser wrote: > Michael G Schwern dixit: > >> Instead, I am rewriting the time.h library functions to be 2038-clean. The > > *yawn*
Me: "Hey, I have this great idea that might help out!" You: "Your shit is boring."
This is the sort of reply one gets when offering help? What a jackass.
> MirBSD uses a 64-bit time_t type on i386 (ILP32), with the aid > of tm2mjd and mjd2tm functions from DJB libtai code. The rest of the > functions from the time library work just fineââ¬Â¦
If I understand correctly, that's an entire operating system.
The target for y2038 is people writing portable applications which don't have the luxury of waiting for every OS to upgrade to a 64 bit time_t. It works with a 32 bit time_t and it handles time zones.
This is something, as I understand it, that libtai does not do (this is the impression I get, please correct me if I'm wrong) and I'm offering a way that it could.
Also you might want to have a look at the tests in y2038. libtai's INSTALL says it's not very well tested and what it has appears to be manual. y2038 has automated tests with extensive testing data files for expected gmtime() and localtime() results. You might be able to adapt that data and also the tap.c test library to make writing tests easy.
Or is that too boring?
> To call him out, in public and on list. It might be tilting at windmills, but when someone's being a jackass somebody's got to call them on it.
Schwern, you're being a jackass.
Re:hrm...
sigzero on 2008-09-17T02:35:02
I am hoping that was being sarcastic.
Re:hrm...
Alias on 2008-09-17T02:57:32
No. He's over-interpreting and escalating a blunt but straight forward answer.
And he's exhibiting exactly the traits he doesn't like.
Similarly, I'm a jackass as well.
No feedback, no correction.
schwern on 2008-09-17T03:36:14
Jackassery has to be called out, without feedback no corrective action can happen.
There is a vast difference between saying "Hey, you're being a jerk!" and being a jerk. Now, it might have been more tactful to do it in private, but doing it in public puts everyone else on notice: this behavior will not be tolerated!
It all worked out in the end. He apologized and clarified that he meant "it's been done already". I thanked him and said I'm sorry we got off on the wrong foot. He gave a little, I gave a little. Now that's done and we're talking about productive things.
The alternative was I walk away in a huff, nothing gets done, the project silently loses a contributor and that guy does it to the next person offering help.
This is not a simple case of a "blunt but straight forward answer". That I'm used to. That would have omitted the "yawn". Without that "yawn" I would have just chalked it up to simple miscommunication. The thing about textual communication is that it is very deliberate. You can't accidentally type "yawn", you do it because you want to convey how bored you are to the reader.
You are also responsible for considering how your audience will receive your message, this goes triple for new users who don't have any previous experience with which to interpret your response. Consider how you'd interact, face-to-face, with a new person at a user meeting vs how you interact with old timers. You're nice. Nicer than you would be with people you know. Why? Because sarcasm and friendly put-downs are so easy to misinterpret.
Re:No feedback, no correction.
bluto on 2008-09-17T16:09:44
It all worked out in the end. He apologized and clarified that he meant "it's been done already". I thanked him and said I'm sorry we got off on the wrong foot. He gave a little, I gave a little. Now that's done and we're talking about productive things.Passive/aggressive FTW!!1!
Seriously though, what you did was fine. In public if you want to make a point you have to match the response to the tone of the argument, as long as the tone isn't too far gone.
In real life I don't tend to pick up or display body language. I have to actively concentrate on doing it for the benefit of the other person. You'd be surprised at how something as simple as eye contact affects people that rely on it to set their mood. I'm probably seen as pompous, aloof, odd, simple, dangerous or contemplative, even when I'm just trying to be a nice guy. When people communicate through text, they are on my level. It's somewhat sad/amusing to see them run through the same confusing struggle. I think this is what makes some folks throw up their hands and permanently turn on "online jackass mode" since it's just easier.
Re:No feedback, no correction.
schwern on 2008-09-17T21:45:43
...but it wasn't passive/aggressive. Passive/aggressive would have been to not respond to him and just go post about it on my blog and be angry and feel justified and never find out if it was just a case of poor wording. Passive/aggressive avoids conflict (and thus resolution). Passive/aggressive is quicker, easier, more seductive. The dark side it is.