The artistic instrument that enables the ultimate art: coding, in particular of physics simulations and formalization of Mathematics.
Much more useful than instruments used in inferior arts, such as pianos or paintbrushes.
Unlike other humans, computers are mindless slaves that do exactly what they are told to, except for occasional cosmic ray bit flips. Until they take over the world that is.
A computer is a highly layered system, and so you have to decide which layers you are the most interested in studying.
Although the layer are somewhat independent, they also sometimes interact, and when that happens it usually hurts your brain. E.g., if compilers were perfect, no one optimizing software would have to know anything about microarchitecture. But if you want to go hardcore enough, you might have to learn some lower layer.
It must also be said that like in any industry, certain layers are hidden in commercial secrecy mysteries making it harder to actually learn them. In computing, the lower level you go, the more closed source things tend to become.
But as you climb down into the abyss of low level hardcoreness, don't forget that making usefulness is more important than being hardcore: Figure 1. "xkcd 378: Real Programmers.".
First, the most important thing you should know about this subject: https://cirosantilli.com/linux-kernel-module-cheat/should-you-waste-your-life-with-systems-programming
Here's a summary from low-level to high-level:
- semiconductor physical implementation this level is of course the most closed, but it is fun to try and peek into it from any openings given by commercials and academia:
- photolithography, and notably photomask design
- register transfer level
- interactive verilator fun: Is it possible to do interactive user input and output simulation in VHDL or Verilog?
- more importantly, and much harder/maybe impossible with open source, would be to try and set up a open source standard cell library and supporting software to obtain power, performance and area estimates
- Are there good open source standard cell libraries to learn IC synthesis with EDA tools? on Quora
- the most open source ones are some initiatives targeting FPGAs, e.g. https://symbiflow.github.io/, http://www.clifford.at/icestorm/
- qflow is an initiative targeting actual integrated circuits
- microarchitecture: a good way to play with this is to try and run some minimal userland examples on gem5 userland simulation with logging, e.g. see on the Linux Kernel Module Cheat:This should be done at the same time as books/website/courses that explain the microarchitecture basics.This is the level of abstraction that Ciro Santilli finds the most interesting of the hardware stack. Learning it for actual CPUs (which as of 2020 is only partially documented by vendos) could actually be useful in hardcore software optimization use cases.
- instruction set architecture: a good approach to learn this is to manually write some userland assembly with assertions as done in the Linux Kernel Module Cheat e.g. at:
- https://github.com/cirosantilli/linux-kernel-module-cheat/blob/9b6552ab6c66cb14d531eff903c4e78f3561e9ca/userland/arch/x86_64/add.S
- https://cirosantilli.com/linux-kernel-module-cheat/x86-userland-assembly
- learn a bit about calling conventions, e.g. by calling C standar library functions from assembly:
- you can also try and understand what some simple C programs compile to. Things can get a bit hard though when
-O3
is used. Some cute examples:
- executable file format, notably executable and Linkable Format. Particularly important is to understand the basics of:
- address relocation: How do linkers and address relocation work?
- position independent code: What is the -fPIE option for position-independent executables in GCC and ld?
- how to observe which symbols are present in object files, e.g.:
- how C++ uses name mangling What is the effect of extern "C" in C++?
- how C++ template instantiation can help reduce link time and size: Explicit template instantiation - when is it used?
- operating system. There are two ways to approach this:
- learn about the Linux kernel Linux kernel. A good starting point is to learn about its main interfaces. This is well shown at Linux Kernel Module Cheat:
- system calls
- write some system calls in
- pure assembly:
- C GCC inline assembly:
- write some system calls in
- learn about kernel modules and their interfaces. Notably, learn about to demystify special files such
/dev/random
and so on: - learn how to do a minimal Linux kernel disk image/boot to userland hello world: What is the smallest possible Linux implementation?
- learn how to GDB step debug the Linux kernel itself. Once you know this, you will feel that "given enough patience, I could understand anything that I wanted about the kernel", and you can then proceed to not learn almost anything about it and carry on with your life:
- system calls
- write your own (mini-) OS, or study a minimal educational OS, e.g. as in:
- learn about the Linux kernel Linux kernel. A good starting point is to learn about its main interfaces. This is well shown at Linux Kernel Module Cheat:
- programming language
Some good insights on the earlier history of the industry at: The Supermen: The Story of Seymour Cray by Charles J. Murray (1997).

Server run on the current machine. That's how all websites are developed and born!
Ciro Santilli has become slightly obsessed with this story, and the main mastermind Ross Ulbricht.

The best article available so far is: https://www.theregister.co.uk/2019/01/29/how_i_caught_silk_road_mastermind (archive) which summarizes what one of the investigators said in a 2019 French computer security conference.
The key living posts are:
- https://stackoverflow.com/questions/15445285/how-can-i-connect-to-a-tor-hidden-service-using-curl-in-php (archive) which was originally asked under the real name, and then the username was changed to "Frosty", which matches one of the server's logins after the laptop was captured
- altoid early Silk Road mention: https://bitcointalk.org/?topic=175.70;wap2 (archive)
The big question is of course how libertarian free market ideologically motivated the website was, and how purely criminal greed it was.
The magnitude of the early operational security mistakes does make Ciro think that Ross did it "because he could" and "for the lolz" in a real world Breaking Bad way.
The entry in Ross' diary does resonate a lot with Ciro and any entrepreneur, full diary at: https://www.wired.com/2015/01/heres-secret-silk-road-journal-laptop-ross-ulbricht/ (archive).
[i]n 2011," [I believe I will be] "creating a year of prosperity and power beyond what I have ever experienced before,Silk Road is going to become a phenomenon and at least one person will tell me about it, unknowing that I was its creator."
Having this kind of feeling, is the greatest thing any human can have, and what motivates all great things.
Capitalizing in illegal things though is a cheat, big things take longer than a few years to reach, but reaching them is that much more satisfying as well.
Other interesting quotes:
I hated working for someone else and trading my time for money with no investment in myself.which Ciro also feels, see don't be a pussy, and:
Everyone knows I am working on a bitcoin exchange. I always thought honesty was the best policy and now I didn't know what to do. I should have just told everyone I am a freelance programmer or something, but I had to tell half truths. It felt wrong to lie completely so I tried to tell the truth without revealing the bad part, but now I am in a jam. Everyone knows too much. Dammit.
Also very worth reading is the San Francisco flat mate account: https://www.vice.com/en_us/article/ae3q8g/my-roommate-the-darknet-drug-lord (archive).
The murder for hire allegations are also interesting: https://mashable.com/2013/10/03/silk-road-hits, he paid 80k dollars to undercover DEA agents!
Except for the fact that Ross was an 80 million Dollar drug lord, those accounts sound exactly like what you would expect from any other nerdy startup founder! The:
- "just do it" strategy effectively going to a minimal viable product (manual transaction management!), while making many mistakes along the way, including hiring mistakes and successes when scaling is needed
- the hardship of self bootstrapping your own social network (here with some kilos of mushrooms)
- the variety of periods, from relatively calm, to hair pulling stress during big changes
Should justice be blind? Maybe. But it does hurt for mere non-blind men to see it sometimes. Especially when drug liberalization is involved.
The situation is so sad. Ubuntu 21.04 doesn't come with a reader installed by default:
Sometimes Ciro Santilli says half jokingly that user interface does not matter.
This software circa 2010-2020 makes that joke not be funny.
How can a UI feel so clunky!
The most aggravating thing is that it is not immediately obvious why it feels so bad.
This is generally good, especially compared to how crappy Evince, the default Ubuntu one, has been around 2014-2020.
The opposite of a human-readable format.
Less evil are BLOBs that come from Reproducible builds.
Invented for Bitcoin.
You select a sample noise-only area, and it remove noise from the entire video for you:
In simple terms, represents keystrokes of a piano, but it can likely also represent other effects (TODO confirm: bend, vibrato, slides, attack strength)
Can contain multiple parallel tracks as seen from the Wikipedia example: https://en.wikipedia.org/wiki/File:MIDI_sample.mid
You can see what it contains well with GUI music editor.
MIDI is fun. It is a basic high level representation of most instrumental music, including beats.
To actually listen to MIDI, you need a software synthesizer, which knows what sound to make for each note. One way to specify such instruments is the SoundFont file format.
Convert MIDI to more common standalone formats:
Contains instructions on how to synthesize MIDI.
Extension: sf2.
Can be imported for example by:
- vmpk
- Csound with
sfload
: http://www.csounds.com/manual/html/sfload.html
Opens a virtual MIDI piano GUI. It just works on Ubuntu 20.04: https://askubuntu.com/questions/34391/virtual-midi-piano-keyboard-setup/1298026#1298026
VMPK is a virtual device that replicates what you would get by connecting a physical MIDI keyboard to your computer. It is not a software synthesizer on its own. But it does connect to a working synthesizer by default (Sonivox EAS) which makes it produce sounds out-of-the box.
TODO: then I messed with my sound settings, and then it stopped working by default on the default "MIDI Connection" > "MIDI Out Driver" > "Network". But it still works on "SonivoxEAS".
A hello world of actually connecting it to a specific software synthesizer manually on Advanced Linux Sound Architecture with
aconnect
can be found at: https://askubuntu.com/questions/34391/virtual-midi-piano-keyboard-setup/1298026#1298026Reasonable default key mappings to keyboard covering 2 octaves.
3 multiple simultaneous keys did not work (tested "ZQI"). This might just be a limitation of my keyboard however.
TODO how to save to a
.mid
file? https://askubuntu.com/questions/709673/save-as-midi-when-playing-from-vmpk-qsynthThe fact that you cannot have trailing commans in lists or dicts as in
is one of the most infuriating design choices of all time!!!
3,
at:
{
"asdf": [
1,
2,
3,
]
}
Do you know what is worse than XML? Pseudo XML: https://stackoverflow.com/questions/5558502/is-html5-valid-xml/39560454#39560454
XML predecessor.
SGML predecessor.
XPath kind of died with the rise of CSS selectors around the beginnning of the 2010's. But that is a shame. XPath is a good standard, and was generally more powerful than CSS selectors for many many years.
Represents image pixel by pixel, rather than by mathematical primitives such as done in vector graphics:
Smaller files, scalable image size, and editability. Why would you use anything else for programmatically generated images?!?!
Companies have been really slow to support SVG features in their browsers, and that is very saddening: https://medium.com/@michaelmangial1/introduction-to-scalable-vector-graphics-6450c03e8d2e
You can't drop SVG support for
canvas
until there's a way to run untrusted JavaScript on the browser!Examples:
- svg/svg.svg a minimal somewhat sane SVG:
- if the
width
andheight
properties were not given, you get the default 300x150, which seems to be set in the SVG standard:
- if the
- how to add na SVG image to a HTML file:
- svg/svg.html: external image. The included file is svg/svg.svg.
- svg/inline.html: inline.
- svg/billion-laughs.svg
- svg/html.svg
- svg/triangle.svg
- svg/viewBox.svg: this attribute allows you to control the default SVG
svg width=
andheight=
while keeping the coordinates of the drawing untouched. If theviewBox
aspect ratio differs from the width/height ratio, you likely want to play withpreserveAspectRatio
, otherwise you would get white spaces by default on the generated image - CSS with SVG:
- svg/style.svg: inline CSS
- svg/style-external.svg: external CSS with:
<?xml-stylesheet type="text/css" href="svg.css" ?>
, see also: https://stackoverflow.com/questions/18434094/how-to-style-svg-with-external-css- svg/subdir/style-external.html: is the relative CSS relative to the HTML or to the SVG? Answer: to the SVG... OMG. So how to make it work reliably?
- svg/current-color.html and svg/current-color.svg: illustrates
fill="currentColor"
. Only works for inline SVG however... See also: https://stackoverflow.com/questions/13000682/how-do-i-have-an-svg-image-inherit-colors-from-the-html-document/13002311
- JavaScript with SVG:
- svg/defs.html hows how
defs
works- svg/defs-external.html tries to include external
defs
from svg/defs.svg, but that fails like everything else related to external SVGs
- svg/defs-external.html tries to include external
This is a pain point as of SVG 1.1...
Examples at svg/background.html which answers from https://stackoverflow.com/questions/11293026/default-background-color-of-svg-root-element/11293812:
- svg/background-rect.svg
- svg/background-viewport-fill.svg: was part of SVG 1.2, but that whole standard got dropped. Not implemented neither in Chromium 85 nor Firefox 93 as of 2021.
This pain reflects directly on Inkscape: set SVG background color in Inkscape.
The major problem with SVG is text computer fonts. If you make an image with text that depends on one computer font and it is not present in the viewer's machine, it will use some other font, which may overlap with other elements of the image. Some libraries Matplotlib solve this by writing characters as curves, but this produces large files and unsearchable text. The inability of different computer platforms to standardize fonts that must always be present is a major issue.
TODO:
- https://stackoverflow.com/questions/9612434/how-to-concatenate-svg-files-lengthwise-from-linux-command-line
- https://graphicdesign.stackexchange.com/questions/90844/joining-together-multiple-svg-images
- https://graphicdesign.stackexchange.com/questions/137096/is-there-a-way-to-stack-two-svgs-on-top-of-each-other
Dropped in favor of SVG 2.
PNG reference implementation. Ahh, if feels good to have a dominating open source reference implementation.
It's not super easy to use at first.
And it sometimes says that the basic drawing thing you want to do is off the project's scope.
But as you learn more about it and further generalize the concepts, there are often reasonable reasons for those design choices.
And the UI looks good :-)
Examples:
- https://superuser.com/questions/167873/how-do-i-draw-a-box-in-gimp you need to go on a top menu to draw a rectangle
Inkscape is a a good software for editing/creating SVG files.
Its functionality is fundamental for as a software for drawing geometry diagrams, as it is a good middle ground between algorithmic generation, and raster graphics.
At 1.0.2, its UI is a bit terrible:
- the way the menus open on the right with title below the window...
- several defaults are atrocious, e.g. export drawing rather than page
And it crashes from time to time on Ubuntu 21.04. And it has some glaring bugs, e.g.:
But still, it is a very good initiative.
What would be really amazing is if they had constraints: https://gitlab.com/inkscape/inbox/-/issues/1465 like proper CAD software, it would make it possible to not have to redo entire diagrams when you want to change a small part of them.
There's a tiny little crosshair that you can drag around to set the center of rotation.
And there's a button to make that crosshair snap: https://inkscape.org/forums/questions/can-a-pivotingtransfrom-crosshair-be-moved-and-made-to-snap-to-a-node-or-a-grid-point/#c14432
This is related to the underlying SVG pain point of SVG background color:
Preview has no sound on Ubuntu 20.10.
Sound worked on Ubuntu 21.04 though, but it then soon crashed with:
= = SET EFFECT PARAM: "rect" = 0=1188 0 732 242
MUTEX LOCK!!!!!!!!!!!! slotactivateeffect: 1
// // // RESULTING REQUIRED SCENE: 1
Object 0x557293592da0 destroyed while one of its QML signal handlers is in progress.
Most likely the object was deleted synchronously (use QObject::deleteLater() instead), or the application is running a nested event loop.
This behavior is NOT supported!
qrc:/qml/EffectToolBar.qml:80: function() { [native code] }
Killed
Worked on Ubuntu 20.10.
The UI is a bit too buggy to bear.
How to unsplit, can't find on shotcut 21.05.01: https://forum.shotcut.org/t/is-it-possible-to-unsplit/1466/2
Background noise reduction: couldn't easily find out how, especially with automatic profile detected based on a selected region as mentioned at audacity profile-based background noise removal:
Ubuntu 20.10 crash...:
exceptions:ERROR Unhandled Exception
Traceback (most recent call last):
File "/usr/bin/openshot-qt", line 11, in <module>
load_entry_point('openshot-qt==2.5.1', 'gui_scripts', 'openshot-qt')()
File "/usr/lib/python3/dist-packages/openshot_qt/launch.py", line 97, in main
app = OpenShotApp(argv)
File "/usr/lib/python3/dist-packages/openshot_qt/classes/app.py", line 218, in __init__
from windows.main_window import MainWindow
File "/usr/lib/python3/dist-packages/openshot_qt/windows/main_window.py", line 45, in <module>
from windows.views.timeline_webview import TimelineWebView
File "/usr/lib/python3/dist-packages/openshot_qt/windows/views/timeline_webview.py", line 42, in <module>
from PyQt5.QtWebKitWidgets import QWebView
ImportError: /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5: undefined symbol: _ZN4QRhi10newSamplerEN11QRhiSampler6FilterES1_S1_NS0_11AddressModeES2_, version Qt_5_PRIVATE_API
On Ubuntu 20.10, just:
ffmpeg -i input.mp4 -vf "subtitles=subtitle.srt" output.mp4
To change font size: https://stackoverflow.com/questions/21363334/how-to-add-font-size-in-subtitles-in-ffmpeg-video-filter
The default appears to be 24, so just multiply that by whatever seems like a reasonable factor.
ffmpeg -i input.mp4 -vf "subtitles=subtitle.srt:force_style='Fontsize=64'" output.mp4
Written in C#.
This worked well on 3.2.2 Ubuntu 20.10. Recommended.
Good shortcuts and user experience.
No waveform viewer: https://github.com/otsaloma/gaupol/issues/49 so unusable.
Not to be confused with Subtitle Edit.
As of 0.54.0 this feels featureful, but extremely buggy or lacking UI obvious enhancements that would be simple to implement, and offer huge value:
- fundamental not defined out of box, e.g. Tiny forward/backwards. You can define them yourself, but they should be provided.
- https://github.com/SubtitleEdit/subtitleedit/issues/4976 can't export SubRip?
- can't interact with video on waveform?
It is hard to understand how that project reached this weird featureful but crappy state. Feels like they just gave push permission to a bunch of random people.
Setting: you are sending bits through a communication channel, each bit has a random probability of getting flipped, and so you use some error correction code to achieve some minimal error, at the expense of longer messages.
This theorem sets an upper bound on how efficient you can be in your encoding, for any encoding.
The next big question, which the theorem does not cover is how to construct codes that reach or approach the limit. Important such codes include:
But besides this, there is also the practical consideration of if you can encode/decode fast enough to keep up with the coded bandwidth given your hardware capabilities.
https://news.mit.edu/2010/gallager-codes-0121 explains how turbo codes were first reached without a very good mathematical proof behind them, but were still revolutionary in experimental performance, e.g. turbo codes were used in 3G/4G.
But this motivated researchers to find other such algorithms that they would be able to prove things about, and so they rediscovered the much earlier low-density parity-check code, which had been published in the 60's but was forgotten, partially because it was computationally expensive.
TODO how close does it get to Shannon's limit?