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.

Thursday, November 12, 2009

Language

elated
with a vengeance
fumble
talk/speak out of turn
in seclusion
dizziness
drowsiness

Usage of "were to"
http://www.englishpage.com/conditional/wereto.html

Monday, November 9, 2009

Linux/Unix Programming

Limits of handles etc:
http://www.moythreads.com/wordpress/2009/12/22/select-system-call-limitation/
Commands:
Touching all files in a directory including subdirectories :
find ./ -type f -exec touch "{}" \;

Viewing system name
uname
Setting environment variable:
export ENV_VAR=
Unsetting environment variable:
unset ENV_VAR
Viewing environment variables
env

Viewing processes running on the system
ps -a

Tuesday, November 3, 2009

Java

To view free audio / flash tutorials on Java see the following:
http://www.jeogrip.com
http://www.javavideotutes.com

Java for desktop/servers use is available in the form of Java SE. The JDK (Jave SE Development kit) can be downloaded from http://java.sun.com/javase/downloads/index.jsp.

Books:
The Sun Java Series contains good book on Java. For an introductory text covering Java SE 6 "The Java Tutorial 4th Edition" is good.

Key points :

1. Java doesn't support Multiple inheritance, which is supported by C++.
2. Java implements namespaces through packages.
3. interface defines the contract that the class implements, and is enforced by the compiler.


Notable differences b/w C++ and Java :
1. No support for Multiple Inheritance.
2. No support for Pointers.
3. No support for preprocessor directives.
4. Everything should belong to a class, even the main method.
5. New for statement syntax : for( int a = arrayOfInts) { //.... };
6. By default, reference are created to object and arrays. In C++, you need to explicity create a reference by using &. Primitive data types in Java don't use references.
7. Object need to be explicity free in C++, where automatic garbage collection is done in Java.

Thursday, October 22, 2009

C

C can be called as a vanilla language in today's scenario, lacking all object oriented programming features. There are many language elements in C which are unique to it (and the languages derived or based on it).

Ten important concepts that all C programmers should know:

1. Scope - Local, global, file
2. Conversion of integers into binary, hexadecimal and octal forms. Representation of these constants in C.
3. Usage of standard library functions for input,output,string handling, date-time,dynamic memory allocation, assert,abort,error etc.
4. Usage of Bitwise Operations - Setting a bit, Clearing a bit, Toggling (inverting) a bit, checking a bit.
5. What is the use of pointers to pointers?
6. Difference between structure and union.
7. Pointer Arithmetic. Difference between *ptr++, *++ptr, (*ptr)++, ++*ptr.
8. Pointer to functions.
9. Usage of const with normal variables, pointers, in function parameters.
10.