Plurrrr

a tumblelog
09 Oct 2019

Timsort

Timsort is a sorting algorithm that is efficient for real-world data and not created in an academic laboratory. Tim Peters created Timsort for the Python programming language in 2001. Timsort first analyses the list it is trying to sort and then chooses an approach based on the analysis of the list.

Since the algorithm has been invented it has been used as the default sorting algorithm in Python, Java, the Android Platform, and in GNU Octave.

Timsort’s big O notation is O(n log n). To learn about Big O notation, read this.

Source: Timsort — the fastest sorting algorithm you’ve never heard of, an article by Brandon Skerritt.

Dark mode in a website with CSS

Today I learned that there is a CSS media query to detect if your device is running in dark mode:

@media
  (prefers-color-scheme: dark) {
  // your CSS rules go here
}

Source: Dark mode in a website with CSS.

See also: Using media queries.

New style: Wednesday

In the evening I finished a style for tumblelog that I had started on the previous day: Wednesday.

tumblelog style "Wednesday"
tumblelog style Wednesday in action.

This style shows some tweaking in the header of the blog using position: relative.