Pages

Monday, October 17, 2011

Regular Expression Terms

Pattern
Matcher
Metacharacters

Regex types :
 -  Simple
 -  Negation
 -  Ranges
 -  Union
 -  Intersections
 -  Subtraction

Escaped Constructs
Quantifiers
Zero Length Matches
Greedy, Reluctant, Possessive Quantifiers

Capturing groups
Backreference
Boundary Matchers

Index Methods
Study Methods
Replacement Methods

Monday, September 19, 2011

Multi Threading terms

Process
Thread
Sleep
Lock
Interrupts
Joins
Synchronization
Reentrant Synchronization
Atomic Access
Liveness
Deadlock
Starvation
Livelock
Guarded Blocks

Saturday, September 17, 2011

Process Vs. Threads


Processes

A process has a self-contained execution environment. A process generally has a complete, private set of basic run-time resources; in particular, each process has its own memory space. Processes are often seen as synonymous with programs or applications.
To facilitate communication between processes, most operating systems support Inter Process Communication (IPC) resources, such as pipes and sockets. IPC is used not just for communication between processes on the same system, but processes on different systems.

Threads
Threads are sometimes called lightweight processes. Both processes and threads provide an execution environment, but creating a new thread requires fewer resources than creating a new process.
Threads exist within a process — every process has at least one. Threads share the process's resources, including memory and open files. This makes for efficient, but potentially problematic, communication.

Monday, August 15, 2011

Symbolic or soft links vs. Hard Links


Hard links are more restrictive than symbolic links, as follows:
  • The target of the link must exist.
  • Hard links are generally not allowed on directories.
  • Hard links are not allowed to cross partitions or volumes. Therefore, they cannot exist across file systems.
  • A hard link looks, and behaves, like a regular file, so they can be hard to find.
  • A hard link is, for all intents and purposes, the same entity as the original file. They have the same file permissions, time stamps, and so on. All attributes are identical.

Friday, July 8, 2011

Stack vs Heap memory


Stack
Stack memory stores variable types in address' in memory, these variables in programming are called local variables and are often stored for short amounts of time while a function/method block uses them to compute a task.
Once a function/method has completed its cycle the reference to the variable in the stack is removed.

Heap
Heap memory stores all instances or attributes, constructors and methods of a class/object.

Comparison
A Heap reference is also stored in Stack memory until the life cycle of the object has completed. Inside the Heap reference all the the contents of the object are stored whereas with a local variable only the variable contents are stored in the stack.
Example:
Stack
var blue
var red
ref 0x456783 (Heap reference)
var tom
ref 0x498702 (Heap reference)
var diane

Heap (0x456783)
name => Susan
age => 26
city => London
height => 5'7
sex => female

Heap (0x498702)
name => Paul
age => 21
city => Glasgow
height => 6'0
sex => male