Using multiple files while coding in c++

I am working on wt (a web toolkit for c++). I remember hearing about it few years ago when i was in diploma and then I had an aquintance with it again as a challenge. The challenge was to build a website in wt. While i am working on the tutorials for wt, i am also working on creating a tutorial website for wt. (that was the challenge). So till now i (and many other novice programmers like me) have been happy with single .cpp file to put all the code in. No doubt we were very much told about the demerits and suggested a lot about having a good habit of having multiple files. I remember Indermohan Singh using header files in c++ few years back. But I was ignorant and never paid heed to it until i got struck into a place where there seems no other option.

Difference between break and continue

Very simple but yet confusing to beginners.
"Break quits the loop without executing the rest of the statements in the loop. Continue stops the execution of the current iteration and goes back to the beginning of the loop to begin the next iteration"

Comma operator and Comma separator: Java

Comma separator (not seperator :P) is one that divides and differentiates. As a separator comma is partial and is used to differentiate between two method arguments, or to separate definitions.


subroutine(var A, var B); // comma used to divide

Comma operator has only one use in Java: in the control expression of a for loop when you want to have multiple statements expressed in control expression of for loop at once. Mind my limited knowledge of english and use the following example to have gist of what i want to say.

for(a=1,b=2; a < b; a++,b++){//i am immortal}

Short-Circuiting in Java

I have been absent from about a month, well who the hell is reading this blog??. I write it for myself and will write it on my will and desire. The birth day was a bad day as it has been from few years, (may be after I was dumped by a girl 7 yrs from now). Well the month has been interesting, I have took a pause in game development just to start it again with a better zeal and skill set. This month I had been busy in java and "algorithm analysis and design course" from the most intelligent Tim Roughgarden and a bit in webtoolkit. This post is about java and also soon you would know why am i back to this blog.
It's 23:58hrs of 23rd of june, and while skimming through a book "Thinking in java" I was finding pen and paper to note down some useful stuff. Having failed to locate a pen and paper at my table and the laziness to stand up and find it somewhere else reminded me of this blog. This is one of topic from the basics of java language, that I found interesting and worthy to write here on this blog.

Short circuiting happens when you are dealing with multiple logical operators at once. In contrast to notorious short circuiting in electrical circuits this one increases the potential and saves time.Sounds Interesting huh!
 Suppose there are three subroutines

A()
B() and
C()


they all return a Boolean value which is either true or false. Now suppose another expression involving the results from above mentioned subroutines

A() && B() && C()


Now being little sloppy here I suggest you to suppose again that A() results True, B() results False and C() results True again. Now my friends that are somewhat into programming must be aware that anything that ANDs with false gives a false. Similar to anything multiplied with zero returns zero. So instead of solving all the three subroutines clever java compilers stop at B() because this smart bot knows that whatever the rest of expression may be, the result will eventually be false. This technique saves time and effort and is also termed as "Short Circuiting".

Tip: 
In any OOP language  object.method(arg);under the hood is actually class.method(object,arg);

Birthday

Hey, it's my birthday today. Happy Birthday to me.. hehe.. Those who wanna have treat from ma side are welcome at Techno Campus at 1:00 pm from where we can go for lunch and there after towards college.

Narrow mindedness

It's been whole 24 hours and memory of one single incident of yesterday has been punching hard on my face. How can people in such a modern society be so narrow minded. The thing is there is a defect in there eyes, they only find one relation between boy and a girl. They will call you and shamelessly ask you,
what's your relation with that girl?
which girl?
 The one you were walking along with?
 " do i first need to have a relation with a girl to walk along her from the gate of my college to gurudwara. And for your answer she is a good friend of mine. "
 "I have seen you, you come here everyday"
Firstly, it's been two days and secondly Isn't it nice to come to Gurdwara everyday.
It's not allowed to sit here like this.
What is not allowed?? to come at gurudwara and sit in gurudwara?? what??
Which hostel are you from?
No , I am dayscholar
Get out of here, outsiders are not allowed.
Sir, Day-scholar means I am student of this college but I don't live in hostel.
Whatever it is, (now he turned from Punjabi to Hindi) it is not allowed to sit here like that.
I kowtowed before my lord, prayed for these pathetic brains, picked my boots and started wearing my socks. Now he was saying all that stuff to her. That was intolerable, but I had to bear all that with silence.Yet it was not over, I was again stopped at gate where I had to prove that I am from this college before I could come back home and write this post.
It has been in draft for a lot of time as I was just little hesitant but now I am sharing it. 

Issues


Yeah! I admit I have been irregular previously and then absent for few days. I had issues with friends, parents and myself. May be that’s the reason for wasting so many days without doing anything that was worth my time. But I truly believe that it has been other way around. Not utilizing my time lead to dissatisfaction and frustration that gave birth to these petty issues.
Apart from all that I just bought Amazing13.com and also Inderplus.com and also unlimited hosting from hostmonster.com. I have promised to renovate the website Nanaksarnakodar.in and also I have got a project from a secret organization for some secret social work that I can’t share publicly. Apart from that I am attending training on java, have to work on my game dream and not to forget GD (wt) (and it’s not group discussion) and open source. That sounds a lot of stuff and yes it really is. May be I have to pick each one by one and shoot them off or maybe I have to delegate stuff that’s not important to me and even reject some. The thing that I lack and I am in utter desire is some management and planning.I will come back to it later.   

How Bad you want success?

This video that I am posting here contains nothing new, that i haven't heard of before. But the way this person speaks, and tells you is just awesome. It instills in you so much energy that after you watch this video you may just stop reading this blog for further and start working on the thing that could make you successful in your life. This is one of the many videos that i watch regularly, they keep the fire burning inside me. It's a part of my  regular dose that motivates me.  I hope it does the same for you. 

Game Failure and How Satinder Sartaaj helped me to find the solution

That was lot of  non-technical stuff on my calendar, it's time to get back to work. I just looked at my game that i have been developing from few months in actionscript. I cannot believe that I wrote all that code. It's all messy and the worst thing is I am unable to expand it. It's above 1000 lines of code and it all seems worthless to me. I am thinking about starting from the starting again.  Actually the game evolved along with my knowledge of actionscript and nothing was planned as it should be. I am done with level one but frankly speaking it's crap.It is not entertaining or fun to play and without all that I hate it. I am also unable to add more levels to it. So here it ends and I may have to start over again. I also don't know whether I should concentrate on actionscript that I have been working upon for around two years or should I go for the newer HTML5 game development technology.Which is going to cover the major parts of market soon. I also have in plan to learn game development in python and or c++. This time management and number of choices is frightening. I will come back to it later.

Journey to the lord of the earth (and the rest of the universe) - II

First read (if you haven't)  Journey to the lord of the earth and rest of universe - I

VILLA OF SANT BABA RAM SINGH JI (CARETAKER OF THE PALACE)
It's 1700 hrs now, I am sitting down in the holy dust of sangat in the bus. After watching the majestic and splendid palace of the lord it was time to take a glimpse of actual caretaker of lord's palace.  To have a glimpse at the wonderful painting of Baba Mahaharnam singh ji  we had to go to Bathinda at Sant Baba Ram Singh Ji's villa. It was huge and enormous, a trial of richness and dignity of those who have been blessed by the lord.

Running on the floor fried with the sun, through the garden and then varranda we climbed stairs and reached a room. The room which had the rare painting. The whole sangat was eagerly yearning to have a glimpse, I was one of them, slowly, slowly moving an inch at a time I reached the front row from where i could gaze at the incarnated master. In the painting Baba Mahaharnam singh ji  in a royal attire