Life Beyond Code

Archive for January 2007

Now a days, For my fun job, i am learning How to Play with RUBY and RUBY on Rails. I can not describe properly in words how passionate i am about this language but let me try.

“if this is the Real RUBY, I believe IT WILL RULE ONE DAY”

Some one of you will agree with me that Ruby doesnt seem a computer language, it seems as we are reading Plain English essay . Let me give you an example


def sampleFunction

10.times do |num|

square = num * num

return num, square if num > 5



num, square = sampleFunction

puts num

puts square

You can see a simple Ruby program above.  sampleFunction is  a method. now look on Bold text in above program and tell me how cool it looks ,  Let me describe you above three bold sentences in Plain English.

– Ten Times do something with num.

– return num and square if num is greater than 5

– put in num and square the return values from sampleFunction

RUBY code is almost a copy of my Plain English description above.

Hundreds of other examples, but its time now to explore yourself.

: ENJOY another DYNAMIC TYPED Language.

I know I am going to LOVE this Language.

One of nice  tutorials on Ruby for Starters is  A very short Tutorial On Ruby




For my graduation research work, i got my first reseach pubication in IEEE in December 2004. The title of my paper is “Language Independent Optical Character Recognition(OCR) for handwritten text”. If you have a valid IEEE login , you can access this research paper at following link.

Project Abstract:


Handwritten Language Independent Optical Character Reader (OCR) has emerged as a new idea to overcome the difficulties to understand the document datasets for different languages in single OCR software. Main idea behind Handwritten Language independent OCR is that all languages can be represented in some common basic geometrical strokes. Our research show that, with stroke based character segmentation and a Neural Network trained on basic geometrical shapes, a Language independent OCR can be born.

This software was developed in C#.NET and it is for windows operating system.

This software uses Pitman Shorthand Language and English as its testing languages. Shorthand is an international language used by journalists/stenographers in live conferences and seminars because of its high speed recording advantage (can record over 200-1200 words/min.).As shorthand is written with lead pencil, it has a poor document image with very less gray level difference between background and original text.

This software takes as input a handwritten document, perform necessary operations to convert document into a form suitable for further processing. After preprocessing subsequent operations involve, removing background lines ( Hough Transformation ) and noise, finding connected components , produce skeleton of each component, segmenting individual components into its basic geometrical strokes , extracting necessary features from these strokes, classification and recognition of PSL characters by analyzing these strokes using a trained Neural Network for basic geometrical shapes, and finally converts the recognized PSL strokes to editable form.

Being Language independent OCR, it covers wide areas of applications. This software can be perfectly used for encryption because user can define his own language too. It can also be used for data updates of offline literature written in any language, for enhancing the idea of paper-less office, for making a newspaper reader for blinds. It can be used by newspaper agencies for translating their journalist’s hand written PSL documents into Standard English requiring no more effort of stenographers for understanding PSL documents.


Today i solved a puzzle,  The name of the game is Petals Around the Rose. The name of the game is important. The computer will roll five dice and ask you to guess the score for the roll. The score will always be zero or an even number. Your mission is to work out how the computer calculates the score. To play around with puzzle, go to following link

Note: Bill Gates took 1 hour to solve this puzzle. At the end of page in above link, you can see story of how Bill gates solve it.

If you find answer, Please keep that secret. Never divulge the secret of the game to anyone else. Only those that can work it out for themselves should know the secret of Petals Around the Rose.  Be part of this community

Btw: I solved it in 20 mintues……………it was a constant thinking process.

Hint: Answer is very simple. very very simple. :).  Note that  “Name of the game is important”

If you solve it and tell 10 correct answers in 10 attempts, you will see a new link which will take you to registration page. you will become part of community automatically.



Today i was reading an Interview of Bjrane Stroustrup. This document clears on of my confusion about overloading in C++. Copy of that text is below.

That question (in many variations) are usually prompted by an example like this:

 using namespace std;
class B {
        int f(int i) { cout << "f(int): "; return i+1; }
class D : public B {
       double f(double d) { cout << "f(double): "; return d+1.3; }
        // ...
int main()
    D* pd = new D;
    cout << pd->f(2) << '\n';
    cout << pd->f(2.3) << '\n';

which will produce:

	f(double): 3.3
 	 f(double): 3.6

rather than the

	f(int): 3
	 f(double): 3.6

that some people (wrongly) guessed.

In other words, there is no overload resolution between D and B. The compiler looks into the scope of D, finds the single function “double f(double)” and calls it. It never bothers with the (enclosing) scope of B. In C++, there is no overloading across scopes – derived class scopes are not an exception to this general rule. (See D&E or TC++PL3 for details).

But what if I want to create an overload set of all my f() functions from my base and derived class? That’s easily done using a using-declaration:

class D : public B {
	using B::f;	// make every f from B available
	double f(double d) { cout << "f(double): "; return d+1.3; }
		// ...

Give that modification, the output will be

	f(int): 3
	 f(double): 3.6

That is, overload resolution was applied to B’s f() and D’s f() to select the most appropriate f() to call


January 2007
« Sep   Feb »


RSS Readings

  • An error has occurred; the feed is probably down. Try again later.

And Here is ME...

Top Clicks

  • None