Readings From Intelligent Investor

The common bonds:

Muni Bonds - Taxable and tax free. Unless you are not in the lowest tax brackets you shouldn’t invest in the taxable bonds.

Hoare Vs Mesa Semantics

Conditon Variables - Hoare vs Mesa semantics.

Condition variables comes in two main flavors - one following the hoare semantics and another following the mesa semantics. In his [paper https://john.cs.olemiss.edu/~dwilkins/Seminar/S05/Monitors.pdf] Hoare described a conditional variable as below:
  1. “Note that a condition “variable” is neither true nor false; indeed, it does not have any stored value accessible to the program. In practice, a condition variable will be represented by an (initially empty) queue of processes which are currently waiting on the condition”

  2. “The acquire procedure does not have to retest that busy has gone false when it resumes after its wait, since the release procedure has guaranteed that this is so; and as mentioned before, no other program can intervene between the signal and the continuation of exactly one waiting program.”

  3. “If more than one program is waiting on a condition, we postulate that the signal operation will reactivate the longest waiting program. This gives a simple neutral queuing discipline which ensures that every waiting program will eventually get its turn.”

The Mesa Semantics

Sempahores sometime fall short in a lot of area. You need a combined API which tells you if you have to be put to sleep and should also relinquish the underlying the synchronization primative, so that when the predicate becomes true, you can be woken-up. A critical question is when the execution of the program comes back to the point in the user-space where the cv.wait() was called, two of the following things can happen. The cv can garuntee the predicate is still valid, or it might not be valid and you would have re-check it.

Mesa semantics is a case of leaky abstraction - anyone using it needs to be aware of spurious wake-ups and the fact that a predicate associated with it should be covered in a while loop.

In the early 90’s Richard Gabriel wrote a piece titled “Worse is better”. In there, he discusses two different philosophies for software design - the “New Jersey Approach” and the “MIT/Stanford Approach”. He contrast the two design along the following design dimensions - simplicity, correctness, consistency, completeness.

Replication, Regulation and Recombination

We start off where we ended the last chapter. How does the form of the DNA able its function? Looking at in reverse the three functions a DNA performs - replication, regulation and recombination.

Replication - when a new cell is created how does the DNA get replicated?

Regulation - what prevents the dna from frenzied unabated replication. The lack of which we know now causes cancer. And also how does a single common genome code in cells enable cells across the body perform varied functions. To put in the author’s words - “Why is hemoglobin protein only found the RBC and not in our eyes”.

Recombination - how does DNA from parents get transmutes and progagate in progenies?

The key to all the three functions is the double helical structure and the fact that bases pairs come in pairs.

When it needs to replicate, the DNA sort of unzips/splits into two single strands and two copies of the original are formed - serving replication function.

Jacquet Monad was studying the exponential growth of e.coli bacteria when fed with glucose and lactose. On mixing both glucose and lactoss he observed the e coli would consume first one of the two sugars and then switch to consuming the second sugar. During the switch the growth of the bacteria would take a minor kink. Monad was interested in explaining why was only one sugar consumed at first and why was there a kink when it switched to consume the second sugar.

The eventually answer explaining the above phenomen opened doors to understand how regulation works in DNA. Based on the environments presented to the cell (sugar present in this case) the underlying DNA turns on and off the genes needed to build the proteins to break this sugar. Therefore when a new sugar enters the system, the corresponding genes necessary to make that protein are turned on.

The question then comes, how does the cell know of the current needs of the environment. As in how does it detect the presence of a certain sugar? The DNA comes to help again by having sugar sensing proteins which hold the key to unlocking the genes necessary to break and synthesize these sugars. Once unlocked more RNA messages would generate relevant enzymes to digest the sugar.

The genes therefore had in it information encoded not only about how to make the protein but also the circumstances/environment in which it is to be turned on.

Regulatory function should also encompasses a cells ability to able to limit the DNA’s splitting and exponential growth. A replicator protein (DNA polymerase) takes up this role. A bunch of environment variables like age of the cell, current nutrients available dictates its ‘on’ and ‘off’ toggle mechanism. Like every other protein in the cell the DNA polymerase is also an off-product on the genome code in DNA. The DNA- ‘god what a molecule’ has provided itself information with information on how to replicate.

Lastly how does the DNA transmute in its progenies and have both common and varied features from its parent organism? The simple transmution of single base pair can happen due to extragenous factors like exposure to x-rays or errors that can happen during replication. Where an A is switched to T.

The more promient transmutation, coined ‘recombination’ happens when parent chromosomes (one from the mother, one from father) intermix. A hybrid gene is produced by swapping large chunks of DNA picks a few genes from the mother chromosome and a few from the father chromosome.