RSSAmplifier

Blog

Jorenar --blog

jorenar.comRSS feed ↗10 posts

Latest posts

Retrieving array length across computer languages

The upcoming revision of the C language standard (for now called C2y) is about to feature a new operator that essentially is a standardization of ages old sizeof arr / sizeof arr[0] trick for getting number of elements in an array. But as we all know, beside cache invalidation, and off-by-one errors, the 2nd hard problem in Computer Science is naming things. Initially it was supposed to be just a…

Generation 2½ of video game consoles

Initially I wanted to write a full fledged text about the topic, but then I've found a decade old article Why the Second Generation of Video Game Consoles Is Really Two Distinct and Separate Generations by Rev. Robert A. Vinciguerra on the archive of their blog The Rev. Rob Times, which more or less encapsulates what I've planned to say...

Creating rootfs.tar.gz from Linux LiveCD

While the user facing part of LiveCD works mostly the same across Linux distros, the internals can be more or less different. That's why in this text I'll present how to extract filesystem from two distributions: Debian and Fedora. That ought to give anyone enough overview to reproduce for any other distribution.

C++ is a superset of only a subset of C

C and C++ are two very interlaced, but still distinct languages. Believe it or not, there were already tiny divergences even at the very birth of C++. Yet many developers fall into the trap of thinking of C++ as a perfect superset over C, what then leads to unpleasant surprise when something differs. Thus below I list few online resources where one may learn a bit on the topic.

GOTOphobia considered harmful

gotophobia -- fear of goto statement; usually caused by a lack of context, and misunderstanding of stories from dark ages of programming. Programmers with gotophobia tend to make their code less readable just to avoid using goto.

Short list of C esoterica

There are some tricks, quirks, and features which seems to throw even experienced developers off the track. Thus, I periodically revisit this blogpost, to do a sloppy job of gathering them in an unordered list with some short explanations, examples, quotes, or references.

Legitimate use-cases of VM types in C

An earlier version of my Pitfalls of VLA in C article contained an example of useful case of VLA, but since there are actually two of them (and I'd be overjoyed being presented with more), they deserve a dedicated, if low effort, post of their own. After all, those use-cases are the only reason why I compile with -Wvla-larger-than=0 rather than more strict and reliable -Wvla.

Pitfalls of VLA in C

It generates much more code, and much slower code (and more fragile code), than just using a fixed key size would have done ~ Linus Torvalds

Steps to learn Vim

Learn how to ask questions the smart way Do vimtutor - it's a 30-minute tutorial that teaches the most basic Vim functionality hands-on RTFM! User manual (:h user-manual) will guide you through every feature from basic to advanced :h faq - Frequently Asked Questions :h quickref - quick reference guide :help and :helpgrep to find more detailed documentation of specific feature USE IT! More…

Make Vim follow XDG Base Directory specification

XDG Base Directory specification, $XDG_CONFIG_HOME etc. Great thing - configs separated from user data and cache, no clutter in home directory. Unfortunately, many programs still don't respect it, including Vim. But what would be our favourite text editor if we wouldn't be able to reconfigure it!