The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,366 other followers

Archive for August 16th, 2017

Closed: HDD Guardian – Home

Posted by jpluimers on 2017/08/16

Too bad: it was fun while it lasted.

Mid april 2017 [WayBackHDD Guardian – Home closed down, so the latest commit removed all the [WayBackHDD Guardian – Source Code.

HDD Guardian provides a Windows front-end for smartctl, a utility which monitors your hard drive(s) and SSD(s) for health status, taking advantage of S.M.AR.T.

The WayBack machine and Archive.is have archived some links though:

Anyone interested in getting it before codeplex itself shuts down:

git svn clone https://hddguardian.svn.codeplex.com/svn

–jeroen

Posted in .NET, Development, Power User, Software Development, VB.NET, Windows | Leave a Comment »

What is the right way to convert into UNIX timestamp from the date and time in C/C++? – Stack Overflow

Posted by jpluimers on 2017/08/16

Thanks R.. for answering this:

POSIX has a formula for exactly what you want:

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_15 [WayBack]

tm_sec + tm_min*60 + tm_hour*3600 + tm_yday*86400 +
    (tm_year-70)*31536000 + ((tm_year-69)/4)*86400 -
    ((tm_year-1)/100)*86400 + ((tm_year+299)/400)*86400

This works whenever you have a broken-down time in GMT, even if the underlying system’s mktime, etc. functions do not use the same format time_t as “Unix timestamps”.

If your original time is in local time, you can use mktime and gmtime to convert it to GMT using the system’s notion of timezone rules. If you want to apply your own timezone offset rules, just do that manually before using the above formula.

Source: What is the right way to convert into UNIX timestamp from the date and time in C/C++? – Stack Overflow [WayBack]

For testing and more examples: Epoch Converter – Unix Timestamp Converter [WayBack]

Hopefully this will help me getting better implementations for these:

–jeroen

Posted in Algorithms, C, C++, Development, Software Development | Leave a Comment »

Why doesn’t RevertToSelf undo the most recent SetThreadToken? | The Old New Thing

Posted by jpluimers on 2017/08/16

Oops: I fell in this trap as well: When you call Set­Thread­Token, [WayBack] it replaces the token. When you call Revert­To­Self [WayBack], the token is cleared and the thread no longer has a token. Maybe Revert­To­Self should have been named Clear­Thread­Token, since that would emphasize that the function erases any existing thread token, leaving the thread to inherit the identity of its host process.

Source: Why doesn’t RevertToSelf undo the most recent SetThreadToken? | The Old New Thing [WayBack]

–jeroen

Posted in Development, Software Development | Leave a Comment »

 
%d bloggers like this: