Chronological order of The Witcher

Posted by Michał ‘mina86’ Nazarewicz on 11th of December 2022

Ever since Witcher games took off the franchise skyrocketed in popularity. Books, comics, TV show, games, more comics, another TV show… The story of Geralt and his marry company has been told in so many ways that it’s becoming a wee bit hard to keep track of chronology of all the events; especially across different forms of media.

In this article I’ve collected all official Witcher works ordering them in chronological order. To avoid any confusion, let me state up front that if you’re new to the franchise or haven’t read the books yet this list might not be for you. If you’re looking for the order to read the books in, I’ve prepared a separate article which describes that.

Skip right to the chronology

Reading order of The Witcher

Posted by Michał ‘mina86’ Nazarewicz on 31st of July 2022

Without beating around the bush, the reading order for the Witcher books is as follows:

1.The Last WishShort
stories
2.Sword of Destiny
3.Blood of ElvesThe Witcher Saga
4.Time of Contempt
5.Baptism of Fire
6.The Tower of the Swallow
7.The Lady of the Lake
8.Season of Storms

Pro tip: You can put URLs in C & C++ code

Posted by Michał ‘mina86’ Nazarewicz on 1st of April 2022

Documenting source code is important part of software engineering. Code is read more often than it’s written making it crucial to provide enough context for reader to understand what the implementation is doing. This can come in the form of links to external resources providing description of an algorithm, reference for an API or historic context justifying the code.

As it turns out, C and C++ languages offer a little-known feature which allows URLs to be included directly in the function source code. For example:

static float rsqrt(float x) {
	https://en.wikipedia.org/wiki/Fast_inverse_square_root
	static_assert(std::numeric_limits<float>::is_iec559);
	auto i = std::bit_cast<uint32_t>(x) >> 1;
	auto y = std::bit_cast<float>(UINT32_C(0x5F375A86) - i);
	y *= 1.5f - x * 0.5F * y * y;
	return y;
}

Primes ≤ 100 in Rust

Posted by Michał ‘mina86’ Nazarewicz on 20th of June 2021

In a past life I’ve talked about a challenge to write the shortest program which prints all prime numbers less than a hundred. Back then I’ve discussed a 60-character long solution written in C. Since Rust is the future, inspired by a recent thread on Sieve of Eratosthenes I’ve decided to carry the task for Rust as well.

To avoid spoiling the solution, I’m padding this article with a bit of unrelated content. To jump straight to the code, skip the next block of paragraphs. Otherwise, here’s a joke for ya:

Names of operands of arithmetic operations

Posted by Michał ‘mina86’ Nazarewicz on 2nd of May 2021

Every now and again I need a specific name for operands or results of various arithmetic operations. It usually takes me embarrassingly long time to look that information up. To save time in the future, here’s the list: $$ \begin{align} \left. \begin{matrix} \text{augend} + \text{addend†} \\ \text{summand} + \text{summand} \\ \text{term} + \text{term} \end{matrix} \right\} & = \text{sum} \\[.5em] \left. \begin{matrix} \text{minuend} - \text{subtrahend} \\ \text{term} - \text{term} \end{matrix} \right\} & = \text{difference} \\[.5em] \left. \begin{matrix} \text{multiplier} × \text{multiplicand} \\ \text{factor} × \text{factor} \\ \end{matrix} \right\} & = \text{product} \\[.5em] \left. \begin{matrix} \text{dividend} ÷ \text{divisor} \\ {\text{numerator}\over\text{denominator}} \end{matrix} \right\} & = \left\{ \begin{matrix} \text{ratio} \\ \text{fraction} \\ \text{quotient‡} + \text{remainder} \end{matrix} \right. \\[.5em] \text{base}^{\text{exponent}} & = \text{power} \\[.5em] \sqrt[\text{degree}]{\text{radicand}} & = \text{root} \\[.5em] \log_\text{base}(\text{anti-logarithm}) & = \text{logarithm} \end{align} $$

† Occasionally used to mean any operand of addition.
‡ Occasionally used to mean the fraction itself rather than only the integer part.

List in big part thanks to Wikipedia.

Most vexing parse

Posted by Michał ‘mina86’ Nazarewicz on 25th of April 2021

Here’s a puzzle: What does the following C++ code output:

#include <cstdio>
#include <string>

struct Foo {
	Foo(unsigned n = 1) {
		std::printf("Hell%s,", std::string(n, 'o').c_str());
	}
	~Foo() {
		std::printf("%s", " world");
	}
};

static constexpr double pi = 3.141592653589793238;

int main(void) {
	Foo foo();
	Foo bar(unsigned(pi));
}

Strach

Posted by Michał ‘mina86’ Nazarewicz on 28th of September 2016

English version available on The Codeless Code.

Niedawno przyjęty do świątyni mnich zbliżył się do mistrza.

― Otrzymałem zadanie dodania kilku nowych funkcji do systemu obsługi zamówień Cesarskiego Szewca, ale nie jestem w stanie zrozumieć, jak on działa. Logika jest rozproszona pomiędzy wiele aplikacji zaimplementowanych przy użyciu najróżniejszych technologii. Zamiast stworzyć wspólne biblioteki, autorzy najzwyklej skopiowali fragmenty kodu pomiędzy różnymi miejscami, często wprowadzając subtelne rozbieżności. Zadania pracujące w tle wyszukują i modyfikują rekordy w bazie danych bez żadnego udokumentowanego powodu. Sama baza danych wydaje się spiskować przeciwko mnie: prosta modyfikacja jednej tabeli może wyzwolić kaskadę zmian w wielu innych.

The time has come to stand up for the GPL

Posted by Michał ‘mina86’ Nazarewicz on 11th of March 2015

For people who know me it should come with no surprise that I support free software in most forms it can take. I also believe that if someone gives you something at zero price, basic courtesy dictates that you follow wishes of that person. This is why when Software Freedom Conservancy started a GPL Compliance Project for Linux Developers I didn’t hesitate even for a minute to offer little Linux copyright I held to help the effort.

Most importantly though, it is why I fully support Conservancy in taking legal action against VMware which for years has been out of compliance with Linux’s license.

If you care about free software, the GPL or want more projects like OpenWrt, consider donating to help Christoph Hellwig and the Conservancy with their legal battle against this multi-billion-dollar corporation who for some reason decided to free-ride on other people’s work without respecting their wishes.

If you can’t or don’t want to donate, twitting something along the lines of ‘Play by the rules, @VMware. I defend the #GPL with Christoph & @Conservancy. #DTRTvmware Help at https://sfconservancy.org/supporter/’ or otherwise spreading the word will help as well. Oh, and in case you were, like I was, wondering — DTRT stands for ‘do the right thing’.

And if you want to know more:

Miscellaneous tips and tricks

Posted by Michał ‘mina86’ Nazarewicz on 14th of December 2014

Don’t you hate when you need to do something you had done before, but cannot remember how exactly? I’ve been in that situation several times and sometimes looking up for a correct method turned out considerably harder than it should. To alleviate the need for future Googling, here’s a bag of notes I can reference easily:

Looking for Python stuff? Those are now in separate post:

Prime numbers less than 100

Posted by Michał ‘mina86’ Nazarewicz on 12th of December 2010

Anyone working in a major company must have been hit by some ‘funny’ mail from a coworker that helps everyone gets through the day. No different at my office — at one point all engineers have been challenged to write the shortest code in C that prints all prime numbers (and only prime numbers) less than a hundred each on separate line.

This is an interesting brain-teaser so posting it here so others may choose to think about it while their code’s compiling.

Of course, a ‘C program’ needs not to be taken too seriously — depending on not too far fetched undefined behaviours of given implementation is all right (but please do not use system or exec family of calls; not that I can see how that would help).

By the way, if you’re interested in how this challenge looks solved in Rust, I’ve described that as well.