RSS

Tag Archives: definition

Mutual Exclusion

The requirement of ensuring that no two concurrent processes are in their critical section at the same time; it is a basic requirement in concurrency control, to prevent race conditions.

Source: Wikipedia

 
Leave a comment

Posted by on June 23, 2015 in General

 

Tags: ,

Producer-consumer Problem

Two processes, the producer and the consumer, who share a common, fixed-size buffer used as a queue. The producer’s job is to generate a piece of data, put it into the buffer and start again. At the same time, the consumer is consuming the data (i.e., removing it from the buffer) one piece at a time. The problem is to make sure that the producer won’t try to add data into the buffer if it’s full and that the consumer won’t try to remove data from an empty buffer.

While it may sound like a simple problem, the solution is not as easy. Not even simple. There are many sub-impediments you have to watch:

  • Locking / unlocking mechanism.
  • Multiple access to the semaphore.
  • Concurrency and mutual exclusion / race conditions.

Source: Wikipedia

 
Leave a comment

Posted by on June 17, 2015 in General

 

Tags: ,

Boxing x Unboxing

Boxing and unboxing is not to be confused with downcast / upcast.

  • Boxing is the process of converting a value type to the type object or to any interface type implemented by this value type.
  • When the CLR boxes a value type, it wraps the value inside a System.Object and stores it on the managed heap.
  • Unboxing extracts the value type from the object.
  • Boxing is implicit
  • Unboxing is explicit.
  • The concept of boxing and unboxing underlies the C# view that a value of any type can be treated as an object.

Example:

Boxing

int i = 123;
// The following line boxes i. 
object o = i;

Unboxing

o = 123;
i = (int)o;  // unboxing

Reference: MSDN

 
Leave a comment

Posted by on June 5, 2015 in General

 

Tags: , , , ,

Software Laws

I was looking for a specific theorem called CAP theorem, but came across these interesting, sort of funny but somewhat true, software laws.

I think these laws are useful to get better understanding of philosophy behind a software or computer science in general.

  • Atwood’s Law

    Any software that can be written in JavaScript will eventually be written in JavaScript.

  • Brooks’s Law

    Adding manpower to a late software project makes it later.

  • Conway’s law

    Any piece of software reflects the organizational structure that produced it.

  • Miller’s law

    To understand what another person is saying, you must assume that it is true and try to imagine what it could be true of.

  • Wirth’s law

    Software gets slower faster than hardware gets faster.

 
Leave a comment

Posted by on March 1, 2015 in General

 

Tags: , , , ,

What is Sharding?

Sharding is a type of database partitioning that is used to separate very large databases the into smaller, faster, more easily managed pieces called data shards.

It’s partitioning that separates very large databases the into smaller, faster, more easily managed parts called data shards. The word shard means a small part of a whole.

 
Leave a comment

Posted by on January 8, 2015 in General

 

Tags: , , , ,

Metaphone

a phonetic algorithm, published by Lawrence Philips in 1990, for indexing words by their English pronunciation. It uses information about variations and inconsistencies in English spelling and pronunciation to produce a more accurate encoding, which does a better job of matching words and names which sound similar.

Source: Wikipedia: Metaphone

Why does this matter?

In real life, this algorithm can be used for voice translation as well as similar sounding names search.

 
Leave a comment

Posted by on November 25, 2014 in General

 

Tags: ,

Levenshtein Distance

a string metric for measuring the difference between two sequences. Informally, the Levenshtein distance between two words is the minimum number of single-character edits (i.e. insertions, deletions or substitutions) required to change one word into the other.

Source: Wikipedia: Levenshtein Distance

Why does this matter?

Levenshtein distance is a form of approximate string matching. In real life application, Levenshtein distance can be used in spell checking, correction in OCR system (Optical Character Recognition), record linkage, auto suggest words in smart phone and many more.

 
Leave a comment

Posted by on July 29, 2014 in General

 

Tags: ,

 
%d bloggers like this: