Home Blogs 2 Wikis 34
Wikis

Static Initialization Order Fiasco

December 6, 2022 - Reading time: ~1 minute

The static initialization order fiasco refers to the ambiguity in the order that objects with static storage duration in different translation units are initialized in. If an object in one translation unit relies on an object in another translation unit already being initialized, a crash can occur if the compiler decides to initialize them in the wrong order. For example, the order in which .cpp files are specified on the command line may alter this order. The Construct on First Use Idiom can be used to avoid the static initialization order fiasco and ensure that all objects are initialized in the correct order.

Within a single translation unit, the fiasco does not apply because the objects are initialized from top to bottom.

External links

Read more
Wikis

The Stack and the Heap

November 29, 2022 - Reading time: 4 minutes

Many programming languages don’t require you to think about the stack and the heap very often. But in a systems programming languages like C, C++(this days not very often) and the Rust, whether a value is on the stack or the heap affects how the language behaves and why you have to make certain decisions. Parts of ownership will be described in relation to the stack and the heap later in this chapter, so here is a brief explanation in preparation.

Read more
Wikis

Fibonacci coding

July 6, 2022 - Reading time: ~1 minute

Implementation

In [1]: 


import functools

@functools.cache
def fib(n):
    if n < 2:
        return n
    return fib(n - 1) + fib(n - 2)
Read more
Wikis

Emacs

July 6, 2022 - Reading time: ~1 minute

Emacs is a programmer’s text editor that can be extended and configured using it’s embedded scripting language ELisp (Emacs Lisp).

Variants


There are multiple members of the Emacs editor family, the most popular one being GNU Emacs. These have varying levels of compatibility with each other, ranging from “mostly compatible” to “some key bindings are the same”.

  • GNU Emacs
Read more
Wikis

Burrows Wheeler Transform

June 20, 2022 - Reading time: 3 minutes

In [1]: 


get_ipython().ast_node_interactivity = 'all'

import string
Read more
Wikis

BunnyCDN Log file format

June 18, 2022 - Reading time: ~1 minute

The BunnyCDN log format is a plain-text format. By default, BunnyCDN provides logs for 3 days, and you can fetch these with your account key.

Each request is logged on a separate line, and the fields are delimited by |. Here are the fields in order, and their short descriptions.

  1. Cache status
    • If the request was served from the cache, the value is HIT. Otherwise, the value is MISS.
Read more

About

Thanks for checking out my website. You can read my blogs & wikis and inspect my cv in here also you can look at my projects too.

Hit Counter

0