Friday, May 30, 2025

Link count

The link count of a directory or file in Linux refer to the number directory reference table o the inode from all the directories in the inode table. This include .. in a child directory. 

The exception is for the root inode with an extra 1 link count because this is the superblovk pointer to the root inode 

Sunday, May 25, 2025

QR code

Quick response code is designed to be readable in high speed comparing to barcode. QR code has special position detection pattern at 3 comers so that the code can be read 360 degeee. Applications can detect the QR code 20 times faster than bar code. 

QR code position pattern at 3 corner allows it to be easily derived if its position, size and inclination. It also has timing pattern running from one position detection pattern to another,and alignment patterns as smaller square within the code grid. 

Friday, May 23, 2025

Schmitt trigger

Noise will be transferred to output when mapping through a transfer function because noise cause the signal to cross the threshold more than once. Transfer function is not symmetric such as the rising and falling of signal follow a different transfer functions. The difference between the 2 transfer function added buffer to the noise and thus increased noise resistance   Gate that include hysteresis was invented by Schmitt. The cost for Schmitt trigger gate is more expensive to produce because they are more complex. 

Vacuum tube

Vacuum tube has a cathode and an anode. When heat applies to the cathode, electrons become free to move and is collected at the anode. A grid placed between the cathode and anode and manipulating the grid turns vacccum tube into a switch

Electromechanical relay

A relay is a device that use electromagnet to move a switch. As magnetic is created by passing electricity through a wire coil, the magnetic force attract a level to either break or complete a circuit to give an output based on the design. 

Mechanical relay is slow, noisy and can wear out. A bug trapped in a rely give the term bug in computer. 

Transfer function

A transfer function is a graph that map values if input to output. The steepness of the function graph “amplify” the input and becomes the output. The transfer function in real world is not linear. The toe and shoulder of the graph are termed as cut off and distortion respectively. The steepness of the curve in the middle section is called gain. The design of the mechanism is to make sure the input stay in the stable (linear) middle portion of the graph. 

Friday, May 9, 2025

Bash spawn new bash

When executing a script, a child bash process (shell) is spawned. The child shell inherits the environment variables from the parent. The child shell sources $HOME/.bashrc for further customisation.