The Wiert Corner – irregular stream of stuff

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

  • My work

  • 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,824 other followers

Archive for the ‘Algorithms’ Category

Mikrotik date and time calculations

Posted by jpluimers on 2017/08/29

Some ideas for date and time calculation:

It should get better (and verifyable) implementations in stead of these Julian (not Gregorian!) date conversions:

Notes:

–jeroen

Posted in Algorithms, Development, Internet, MikroTik, Power User, RouterOS, Routers, Scripting, Software Development | 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 »

Sorting visualised with traditional folk dancing

Posted by jpluimers on 2017/08/08

Some really cool YouTube videos below nicely visualise different sorting algorithms are in the playlist below.

They are an extension of https://www.youtube.com/user/AlgoRythmics/videos

It impressed me more than the audible playlist I wrote about in Fun to watch/listen to: Sorting Algorithms (slower, grouped and ordered) – YouTube, likely because the various steps in each sorting algorithm are much more clear.

To me it’s also more entertaining than Sorting | Visual.ly, even though the latter even more clearly show the various operations in a sorting algorithm.

Not all algorithms are covered; https://www.toptal.com/developers/sorting-algorithms/ has many more of them and to my surprise, Heap Sort beats Quick and Quick3 sort on various distributions.

Discussing sorting seems a never ending story…

–jeroen

via: [WayBack] Best description of Bubblesort i’ve ever seen °.° – Fabian S. Biehn – Google+

Read the rest of this entry »

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

“Large-Scale Deep Learning with TensorFlow,” Jeff Dean – YouTube

Posted by jpluimers on 2017/08/01

Via: Kristian Köhntopp originally shared“Large-Scale Deep Learning with TensorFlow,” Jeff Dean

Read the rest of this entry »

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

Another of +Steven Wittens step-by-step visual mathematical explorations

Posted by jpluimers on 2017/06/22

Another of +Steven Wittens step-by-step visual mathematical explorations: Fourier Analysis Look and Listen For this one headphones and a microphone are required, including a good machine…

–jeroen

–more–

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

 
%d bloggers like this: