Friday, June 18, 2010

Leadership

Session on June 18 2010, SafeNet Infotech Noida, Col Yash Mor

  • Hope of Success vs Fear of Failure.
  • liberty of spreading the wings to subordinates
  • smaller milestones; (sense of achievement, Motivation)
  • unconventional and nonusual methods (innovation)

Wednesday, June 9, 2010

STL (Standard Template Library)

STL is available with C++. It defines various template classes which implement commonly used data strcutures.

Vector This is a dynamic array whose size can grow dynamically unlike static array.

list This is a doubly linked list implementation.

set / multiset : This can store single value which forms the key.

map/multimap : These can store key,value pairs.

Tuesday, June 8, 2010

Synchronization

A classic problem related to synchronization is reader-writer problem, in which multiple readers and writers try to access a shared memory location. The shared memory access by reader and writers can be protected straightaway with a mutex, but that solution will not be optimal, since it doesn't make sense to block readers when there are no writers.

In the first reader-writer problem, the reader are given priority over writer and is solved like this:

Mutex m, local
int reader_count;

//Readers access

Wait(local); //Acquires a mutex
reader_count ++;
if(reader_count == 1) Wait(m);
Signal(local); //Release a mutex

....
...
...


Wait(local);
reader_count --;
if(reader_count == 0) Singal(m);
Signal(local);

//Writer Access
Wait(m);

...
...
...

Signal(m);

Saturday, June 5, 2010

Microsoft SQL Server 2008 Express edition

To install MS Sql Server 2008 Express edition following instructions can be followed:
http://www.symantec.com/connect/articles/install-and-configure-sql-server-2008-express

C#

C# doesn't support multiple inheritance. It doesn't have pointers. Class objects can be referred only through references. Unlike C++, there is no concept of structure. Properties are supported, which are like class fields with a getter and/or setter function.

Data types

C# has 15 value types.

Following are the integer value types used to store whole numbers:
long : 64 bits
int : 32 bits
short : 16 bits
byte : 8 bits

Numbers having decimal places can use the following:

float : 32 bits :single precision
double : 64 bits : double precision
decimal : 128 bits : most accurate

Following are the non-numeric data types:

bool : 8 bits
string : depends on size of string
char : 16 bits

Other data types include :

Arrays : In C# array is an object. They are declared as follows
int [] var[10];
And initialized as follows
var = new int[10];

Reference In C# references are labels for objects. For a class Box, an object reference is declared like this
Box box;
At this point box is set to null. The following statement makes box refer an instance of Box type.
box = new Box();
If no reference exits to an object, it is garbage collected by the CLR.

Properties : Properties in C# can be declared like this
public int numberofBox
{
get
{ ... }
set
{ ... }
}
Through properties calculation associated with backing fields can be performed by using get / set functions.

Interfaces : Different types of objects can support a common functionality by implementing an interface. A class implements an interface by declaring like this:

class Box : IBox
{
...
}

It's possible to create references using IBox interface:
IBox ibox = new Box();

This "is" keyword can determine whether an object supports a type (class or interface)

if( ibox is IBox)

Friday, June 4, 2010

UML

The UML specification was developed by Rational Software, under the leadership of Grady Booch, Ivar Jacobson and Jim Rumbaugh. It's now managed by OMG (Object Management Group) http://www.omg.org/

Thursday, June 3, 2010

OOAD

OOAD stands for Object Orient Analysis and Design.

A good book on this topic is,

Head First Object oriented analysis & Design:

http://books.google.co.in/books?id=-QpmamSKl_EC&dq=object+oriented+analysis+and+design+%2B+head+first&printsec=frontcover&source=bn&hl=en&ei=WHEHTLG6KsOxrAey_9CKAQ&sa=X&oi=book_result&ct=result&resnum=4&ved=0CBwQ6AEwAw#v=onepage&q&f=false

1. Great Software meets customer expectation.2
2. Great Software is well-designed and well-coded. It's easy to maintain, reuse and extend.

In strucuture programming we design modules which are loosely coupled. In Object oriented programming, objects should be designed so that they are loosely coupled. This allows object to behave independately. This improves reusability, since object can be reused anywhere. This also improves flexibility, since the object can be changed independentaly of each other.