Friday, October 27, 2006

Standard Template Library

For the past few days, I'm learning STL. The good think is that I'm reading it continuously without break and working out the examples chapter by chaper.

STL in a Nutshell
============
STL is a powerful library. It adds more PERL power to C++. STL is an elegant and generic solution. STL have 3 major components :

* Container
* Algorithms
* Iterator

Containers
=======
Stores and retrives data. Examples:

* Simple Array
* Vector (dynamic array)
* Deque (double ended queue)
* List (dohbly linked list)
* Sets & Multisets
* Maps & Multimaps

Algorithms
========
* Copy
* Sort
* Min/Max
* etc ... (You name it, everything is here, expect graph algorithms)

Iterator
========
Thanks to Wikipedia
* input iterator
* output iterator
* forward iterator (sets & maps)
* bi-directional iterator
* Random access iterator

It took me around 1 hr correct the problem in the following code

template <typename>
void display(ttype v) {
typedef typename ttype::iterator v_itr;
cout<<"Element in v :";
for(v_itr i=v.begin();i != v.end();++i)
cout<<*i<<" ";
cout<<endl;
}

I was not able to declare the iterator for the generic type ttype. Most of the programmers are used to

for(int i=0;i<x;i++)

We use i++, postfix increment operator. In some compiler implementation i++ consumes more cpu cycles/memory read than ++i (prefix). The problem is we dont understand i++, when i++ stands alone there is no use. i++ must be used in expressions/assignments.

Tuesday, October 17, 2006

Silence is sometimes the best answer

Always remember that silence is sometimes the best answer.

Today is a good day. Woke up at 7:00 pm. Morning walk @ Anna nagar.

It was a long time since my brother mailed me. I mailed him today, after all he is my own brother. I can forgive him.

I'm keep shifting my books. I couldnt read the books which I promised myself to read.

Currently I'm reading no technical books or self-help books. I'm reading "Children of the Lamp" by PB Kerr. I need to start learning Linux System programming and C++ programming, then Linux kernel programming.

Last week I read "Zen Tarot", the fool is the first one. There are 3 types of fools.
1. simple fool - who dont know that he dont know anything
2. complex fool - who dont know anything, but think that he knows everything
3. blessed fool - who knows that he dont know anything

Tuesday, October 10, 2006

Done it again

I woke up at 6:30 am today, went for walking and Kovai fruit stall. I need to repeat the success.

As I already said I'm reading "The 7 Habits". P/PC (Production/Production Capacity) factor with the "Golden eggs laying Goose" parable is really exceptional. I name it as "Producer/Consumer" factor, the thing is simple, if you want to consume more, then produce more. Examples
* If you want to good healthy, excercise
* If you want good job, learn
* If you want good finance, save and invest

The 7 Habits are

Independance
==========
* Be Proactive
* Begin end in mind
* First things first

Interdependance
============
* Think win/win
* Seek to understand, then to be understood
* Synergize

Excellence
========
* Sharpen the Saw

Sunday, October 08, 2006

Good Start Up

Voila, I made it. I woke up at 6:30 am this morning. It is a great experience.

I've started learing Thinking in C++ (Bruce Ekcel). It is a good book to start with.

I will be reading Pragmatic programmer and The Practice of Programming, next.

One shot at a time. "One Donkey at a time" - Oscar Sir(my school teacher).

Manonmani Miss - My Favorate Teacher

I'm starting with C++, my favorate. I first started learning C++ from 1998(NIIT). My friends used to call Bjorne Stroustrup as my MAMA.

I know this article is not structured, sorry.

Technical Book to Read This Month: Thinking in C++
Self Help Book to Read This Month: The 7 Habits of Effective People

nothing else, I will read it completely. "No beating around the bushes this time".

Thursday, October 05, 2006

Quiz

Yesterday I won 3 Chocos for answering 3 question ?

Figure the personality - Dijkstra
What is Euler cycle ?
Diff. between mutex & semaphore ?

The question which I loved to answer was answered by another guy.

How to distinguish postfix and prefix operator in operator overloading ?

Ans: Add a dummy variable "int" in postfix

I ran a sample program using boost library. It is so cool.

I need to learn Qt.

sample boost code:
==================

vector x;

x+=1,2,3,4,5,6,8,9,0;

will append the elements into the vector. += operator is overloaded and used (...) variable parameters.

Now, Finally I have list of Areas which I need to Master
=========================================================
1. Data Structures & Algorithms (C, C++, Perl)
2. Unix/Linux Internals (Maurice J.Bach, Vahallia, Understanding Linux Kernal)
3. Object Oriented Programming & Design (+UML)
4. Network Programming (Richard Stevens)

I don't want any deviation from these areas. From here onwards I will be posting blogs regarding these Areas(and nothing other than this).

God Please Help Me !!!