An introduction to Z-boxes

You most likely found this post for one of two reasons:

  • Either you haven’t heard of Z-Boxes and are interested in if they can somehow help you
  • or you have to learn about Z-Boxes and you have absolutely no idea how to understand the mathematical definitions.

Either way, we’re going to investigate Z-Boxes – not using a box of formulas but using examples and Python code.

Mehr lesen

Reusing your calendars, the pythonic way

Yesterday got a calendar for 2016. An interesting question came up my mind: When can I reuse this calendar, and for which year can I reuse which old calendar?

The 1st January 2015 was a Thursday. The same day in 2016 is a Friday. Once you follow this pattery you will quickly recognize that the base period of seven years is disrupted by leap years.

It quickly turns out that for some years it takes decades until you can reuse a calendar: 2016 is a leap yer, so you can not reuse it for 2044.

However, there’s a neat quirk that is currently unimplemented in online services like whencanireusethiscalendar.com: You can partially reuse a calendar.

Mehr lesen

HackThisSite Programming Challenge 1 Algorithm (Unscrambling)

Recently hackthissite.org was recommended to me — it’s really fun to play around with, even if I think some of the challenges are not that realistic any more.

I thought it would be just as much fun to post some of my solutions to the programming challenges here. If not absolutely neccessary for understanding the underlying algorithm, I won’t post any information about how to use the programs, because the purpose of these posts shall be to understand it, not to use it in order to solve the HTS challenges.

Mehr lesen