• mina86.com

  • Categories
  • Code
  • Contact
  • AI images should be copyrightable

    In September 2022, ‘Théâtre D’opéra Spatial’, a work submitted by Jason Allen, won the 2022 Colorado State Fair’s annual fine art competition in the digital art category. What made the success noteworthy was that the image had been AI-generated. Mr Allen eventually tried to register the work with the US Copyright Office but his attempts turned out fruitless. In September 2023 the Office refused his registration.

    ‘Théâtre D’opéra Spatial’ by Jason M. Allen ‘A Recent Entrance to Paradise’ by Steven J. Thaler’s Creativity Machine
    First, ‘Théâtre D’opéra Spatial’ by Jason M. Allen. Second, ‘A Recent Entrance to Paradise’ by Steven J. Thaler’s Creativity Machine.

    I didn’t think much of it at the time. I wasn’t that invested in the consideration of what kind of ‘two-dimensional artworks’ are protected by copyright and, more notably, I somewhat agreed with the decision. Perhaps the prompt was protected, but if only minor manual edits were made to the image, it felt like a stretch to say the image as a whole could be covered by copyright law.

    Chronological order of The Witcher

    • Updated in November 2024 to include Crossroads of Ravens.
    • Updated in May 2024 to include journey stories from GWENT game.
    • Updated in January 2025 to include Netflix’ Sirens of the Deep.

    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

    Updated in November 2024 to include Crossroads of Ravens.

    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
    9.Crossroads of Ravens

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

    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

    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

    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\} & = \left\{ \begin{matrix} \text{sum} \\ \text{total} \end{matrix} \right. \\[.5em] \text{minuend} - \text{subtrahend} & = \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}} & = \left\{ \begin{matrix} \text{root} \\ \text{radical} \end{matrix} \right. \\[.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

    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

    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

    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

    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: