Thursday, July 8, 2010

Difficult People

Dealing With Specific Types of Difficult People

Types of Difficult People:
  • Complainer
  • Know-it-all
  • SteamRoller (BigBully)
  • Sniper
  • Can't-Say-No
  • Staller

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.

Sunday, May 23, 2010

Windows Programming

Windows supports two types of applications: those with a console user interface (CUI) and those with graphical user interface (GUI). The PE32/PE32+ file format header indicates which type of file it is : GUI/CUI for applications or DLL for library.

Handles, Threads,... Limits in windows

http://blogs.technet.com/b/markrussinovich/archive/2009/09/29/3283844.aspx

Process Explorer Tool:

http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

DLL in windows

Good article on dll in windows :
http://www.akadia.com/services/dotnet_assemblies.html#Private%20Assemblies%20are%20Referencing%20DLLs
On windows there are two way to load dll:

1. run-time dynamic linking


Run-time dynamic linking enables the process to continue running even if a DLL is not available. The process can then use an alternate method to accomplish its objective. For example, if a process is unable to locate one DLL, it can try to use another, or it can notify the user of an error. If the user can provide the full path of the missing DLL, the process can use this information to load the DLL even though it is not in the normal search path. This situation contrasts with load-time linking, in which the system simply terminates the process if it cannot find the DLL.


2. load-time dynamic linking

In this case application is linked with "import library" (*.lib files) at link time. This library supplies the system with the information needed to load the dll and locate the exported dll functions when the application is loaded.

See this msdn article for complete information:

http://msdn.microsoft.com/en-us/library/ms681914(v=VS.85).aspx


This a good free tool to detect memory leaks dynamically:

Visual Leak Detector:
http://vld.codeplex.com/

Windows limitation of 2000 threads

http://blogs.msdn.com/b/oldnewthing/archive/2005/07/29/444912.aspx

C99 types for Windows:

http://code.google.com/p/msinttypes/

Saturday, May 8, 2010

Make

Make can be used to build source code. it utilizes Makefiles to perform tasks.
A Makefile has the following structure:

target:dependencies
-commands to build target from dependencies-

Sunday, April 4, 2010

Cryptographic Algorithms

There are many cryptographic algorithms(Ciphers) that are used to secure information.
These can be divided into following categories:

Symmetric Ciphers : Uses same key for encryption and decryption.

>>>>Stream ciphers : RC4

>>>>Block ciphers : AES, DES, DESede, SEED

Asymmetric Ciphers : Uses different key for encryption and decryption.RSA,DSA

RC4
RC4 is a stream symmetric cipher. operations are performed by XORing plain text bits with key bits.
AES
AES stands for Advance Encryption Standard. It was accepted as a NIST standard. AES has a fixed block size of 128 bits.
AES is a block symmetric cipher. It divides the plain text into blocks (128 bytes). AES Keys can be of 128,192 or 256 bits long.
DES
DES is a block symmetric cipher. DES keys are 56 bits long.
DESede
DESede is also a block symmetric cipher derived from DES.
RSA
RSA is an asymmetric cipher.
choose your plaintext be at least one byte shorter than the RSA modulus, and before RSA encryption, pad or encrypt the message content.
See http://forums.devshed.com/security-and-cryptography-17/plaintext-max-size-calculation-for-rsa-610111.html


DSA
DSA is asymmetric cipher.

Perl

Perl is a scripting language. Scripts written in perl requires the perl executable to execute them.

Hello World Script:

#!/usr/bin/perl

print "Hello World!";

Capturing the output of command in perl variables

$output = `ls -l`;

Using system call to execute commands

system("cp src dst");

Difference b/w double quotes string and single quoted string

print "name is $name" : expands $name and prints it.

print 'name is $name' : prints $name as it is.

Perl is available for many systems; check http://www.cpan.org

Shell Scripting

if constuct
The if condition can test various conditions.

Usage of if to test successful execution of commands:
if cp src dst
then
echo "cp succeeded"
fi

Usage of test directive with if:
if test a -lt b
then
echo "a < b"
fi

Usage of if with [ ]
if [ a -lt b ]
then
echo "a < b"
fi

IBM Power Systems

IBM Power Systems are servers based on IBM Power 6 / 7 architecture. They have the capability to run Linux, AIX and IBMi operating systems.

IBMi was formerly called OS/400. Developers familiar with Unix/Linux systems can use the PASE and QSH interface for development.

Here is a brief description of terminology associated with the IBM Power Systems.


CCSID

In qsh, the environment variable QIBM_CCSID controls the CCSID assigned to new files that are created.

US English - EBCDIC 37

Wednesday, January 27, 2010

Software Project Management

Good Books : The Mythical Man-Month

Estimation is critical to project planning.

Wikipedia : http://en.wikipedia.org/wiki/Estimation_%28project_management%29

Many methods are used to do estimation. To see a detailed description see The Mythical Man-Month Book.

l/3 : Planning
l/6 : Coding
l/4 : Component Test and early system test
l/4 : System Test, all components in hand.

Brook's law: "adding manpower to a late software project makes it later".
See http://en.wikipedia.org/wiki/Brooks%27s_law
The number of months of a project depends upon its sequential constraints.
The maximum number of men depends upon the number of independent subtasks.