Grant6899 Blog

Time goes on. We live. We learn.

Virtual Inheritance

Diamond Inheritance Problem As we all know, when we’re trying to create classes in the below structure: A natural way comes to our mind is class Singer : public Worker {...}; class Waiter : pub...

Thoughts from a Rational class

Source Code I wrote a Rational class for fun during weekends. Below is the header file: /************************************************************************* > File Name: Rational.h > ...

Storage Duration

Scope and Linkage Scope describes how widely visible a name is in a file. Linkage describes how a name can be shared in different units. A name with external linkage can be shared across files...

Value Semantic vs Reference Semantic

Definition Value semantic means the copy of objects has nothing to do with the original object. After the copy, the new object will be detached from the model one. They are independent and will no...

Linked List Summary

Linked List Definition Below is the assumption of ListNode definition on which we are based for this blog. struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; ...

Codesigning the Debugger

The Darwin Kernel requires the debugger to have special permissions before it is allowed to control other processes. These permissions are granted by codesigning the GDB executable. Without these p...

Why is American option's value equal to European option's when there is no dividend?

American Call vs European Call - No Dividend An American option can be exercised at any time, whereas a European option can only be exercised at the expiration date. This added flexibility of Amer...

How to pass arguments to thread

Thread function must return void The function used to initialize threads cannot retrun anything but void. void partial_sum(int st, int ed, boost::uint64_t& total) { for (int i = st; i < ed...

Interest rate swap

Definition An interest rate swap is a financial derivative instrument in which two parties agree to exchange interest rate cash flows. It is used in order to hedge against or speculate on changes ...

Interest Rate Summary

Interest Rate Definitions | Concept | Definition | Comment | |:—|:-|:-| | Treasury Rate | Treasury rates are the rates an investor earns on Treasury bills and Treasury bonds. | Treasury rate...