November 27, 2007

Calculating Time Duration For Billing Systems in C#

Filed under: Software Development — Tags: , , , , , , , , , , , , — syedfaisal @ 4:52 pm

If you are developing a hotel management system, car parking area management system etc then you will need to calculate the charges per hour,min etc.

Below is the code I used in my application for per hour billing with a condition that after 10 minutes of every new hour it charges for full hour:

DateTime c = DateTime.Parse(“11/27/2007 11:59:43 PM”);

//ref time you can use entry time etc

DateTime endTime = DateTime.Now;

 TimeSpan span = endTime.Subtract(c);

 TimeSpan span2 = span.Duration();

 string Shours= span2.Hours.ToString();

string Smin = span2.Minutes.ToString();

int Imin = int.Parse(Smin);

int Ihours = int.Parse(Shours);

if (Imin > 10)


              Ihours = Ihours + 1; }

int charges=Ihours*100;

Label1.Text = “Hours Used:”+Ihours.ToString()+“,Charges@100 Rs perhour:”+charges.ToString() ;  

The output will be in the form of:

Hours Used:17,Charges@100 Rs perhour:1700 (obviously this is the output I got wrt my system time)

I hope the code will help you in your application development.


November 25, 2007

Want to know about a person?

Filed under: life, stupidity — Tags: , , , , , , , , , — syedfaisal @ 7:27 pm

In old days people used to say”Want to know about a person?Observe his friends”

BUT now things have changed and now we can say

“Want to know about a person?Read his blog”

Crap isn’t it?

November 19, 2007

Infinity and Emotions……..need of a unit of emotions

The topic might look a bit stupid but that’s how emotions are. I was having a discussion with someone regarding emotions and the level of emotions and then during my way back home from my office I was thinking whether emotions do have some quantified value or not, whether their is something you can call infinite love or hatred etc.

Most of the people say love cannot be quantified cannot be compared or put to some axiomatic statement or love is blind(bla bla bla…) But when you look at your life you find  different levels of affection or hatred for different people like you love A more than B or hate C more than D etc and also if you think  you love something more than any thing and at then you say that your love something is infinite it’s again look illogical because that thing which you love more than any thing is actually your absolute reference  of love(similar is the case with other emotions such as hatred,anger etc) such as light for many physicists is absolute reference(and even speed of light has a value i.e. 3 x 10^8 m/s and now people are talking about FTL phenomenon)  means emotions must have some unit direct or indirect for e.g. love may have some relationship with the your brain cells and in the example if you love A more then B means if your love count for B is X number of brain cells utilized for the love portion then for A it must be X+1 or X+ Y depends on how much you love A more than B and similar is the case with comparing two different emotions about a person for e.g. if you hate someone means your hate units for that person have out-numbered your love units for that person and also if you hate C more than D means you have some love portion for C which is more than your love portion for D.

So from the above argument it is proved that emotions are quantifiable and there is a need to develop a unit for emotions.

And perhaps the concept of “infinite emotions” will become obsolete.

Basically the discussion started when I was having my finance class and there was an issue of amortizing the goodwill of a company and the teacher said “there are few analysts who think we cannot have an accurate measure of the worth of goodwill as is the case with emotions because we don’t have a measurable unit to exchange(and to me it looked unusual)”.

November 16, 2007

I am almost speechless…..Is this the way to treat the family of our national hero

Filed under: life, politics — Tags: , , , , , , , , , — syedfaisal @ 7:57 pm

Assalam o alaikum

I am almost speechless on the behavior shown by the government first with Imran Khan and then with his family.”> Click here and feel ashamed if you are a Pakistani

Many people may differ from his political views but no one can deny his contributions for Pakistan. He brought our first ever and up-till now the only cricket world cup, made the dream of a cancer hospital in a poor country like Pakistan to come true and his commitment to a strong system of justice.

The manhandling shows how brutal,ruthless and shameless can dictator can be.

November 11, 2007

Just another post…….

Filed under: life — Tags: , , , , , , — syedfaisal @ 12:16 pm

Being silent has become a symbol of being intellectual.

November 10, 2007

Real threat to Pakistan! the mind set of its people

I was thinking and in someway analyzing the situation of Pakistan.Why
its in a real hopeless situation.Is it feudalism,corruption,racism,sectarianism n
linguistic discrimination(muhajir,sindhi,punjabi,pukhtoon,baloch etc)
or absence of the system of justice.

BUT the real thing which i can now observe and say really confidently
that all this is because the mindset we ve developed as a nation. The
real thing is all the problems mentioned above ve become part of our
culture n we don’t want to fix it coz our minds r dead , not willing
to change, not willing to think as honest,just and freedom loving nation.

the real battle is the battle of minds and its a real shame that this
battle field is not active so the war is on the streets n valleys.

Most of us are beneficiaries of the current corrupt and unjust political and social system, we ve our ethnic,political,sectarian n interest based affiliations which stop us from even thinking freely n discussing da issues freely.
Its real easy to keep ur selves away from issues and telling ur self
that i m a doctor,engineer or so n so ,its not my job.

No sir, defending da values,system of justice and humanity is da
responsibility of each n every individual otherwise we ve seen nations
becoming just another forgotten part of  the pages of history.

Its not the matter who is more responsible, its just who has the will to
resist the damage.


November 6, 2007

Something I wrote……. more than a year ago

Filed under: life — Tags: , , , , , , , , , — syedfaisal @ 12:49 pm

  The world I live in,
  Shining like the sun,
  Burning in the fire,
  Dying hopes and living desires,
  The way I have been with the dreams unseen,
  Walking alone,
  With fears in my eyes,
  No where to run and no where to hide,
  Tempest in my mind,
  Tears of the red and aim of the blue,
  All the hallucinations! Can they be true?,
  With all my efforts summing to zero,
  Betraying myself,
  My own unwanted being,
  With all these thoughts,
  Suddenly I look up on the skies,
  Saving myself falling in oblivion,
  Bowing myself in front of “The Lord”,
  With rising hopes,
  And searing passion to win,
  Collecting myself with resolve stronger,
  Ahead is the world I have to conquer.

Also visit:


November 5, 2007

Its time to Take Action! (Go! Dictatorship Go!)

Filed under: Uncategorized — Tags: , , , , , — syedfaisal @ 4:35 pm

We neither are  animals so that who ever wants to take us in the direction he wants us to go and we will obey him without thinking nor we are slaves, we are free people.

We as a nation need to think

and act as an honest, just and

freedom loving nation.

In this time of difficulty the nation must rise for the survival of Pakistan and tell the dictator Musharraf we want to live with freedom under the rule of law.

And people who think all this effort is a waste of time.

“Whoever amongst you sees anything objectionable, let him change it with his hand, if he is not able, then with his tongue, and if he is not even able to do so, then with his heart, and the latter is the weakest form of faith.”(Hadith)
Go! Dictatorship Go!

E-Protest against Emergency

We, the people and the friends of Pakistan, denounce and strongly protest against the curtailment of fundamental rights, the curbs on electronic and print media, attacks on independence of Judiciary, suspension of Constitution of 1973, arrests of judges, lawyers, human right activist and teachers and Martial Law which has been imposed by General Musharraf as the Cheif of Army Staff.

Pakistan was formed as a democratic state where the rule of law will reign supreme. The people of Pakistan have given great sacrifices to gain these rights of living with freedom. These right of free speech, ability to chose the government and access to fair judiciary cannot be taken away from the people at the disguise of any threat.



SEND THIS LINK USING Facebook, Orkut, Friendster, Beebo, MySpace, Digg AND emails TO EVERYONE YOU KNOW

( )

November 3, 2007


Filed under: politics — syedfaisal @ 11:17 pm

Assalam o alaikum

The dictator General Musharraf has taken another disasterous decision for Pakistan.

According to reports not only that emergency is imposed but CJP is also removed from his post and the new CJP has taken oath.

I don’t know what are we waiting for, its an appeal to all the Pakistanis to get united in the name of Allah and for the sake of the survival of Pakistan and throw this MARTIAL LAW on the dictators face.

We have seen the bombing and the use of force on our people

We saw how our own military supposed to be the defenders of the nation did there best to destroy the foundations of Pakistan.

Its time to wake up and fight in what ever manner we can to stop all this .

MR. Musharraf your ending days are near…….. .

I think no body would like to say after 15-20 years to its kids that “There was a country named Pakistan!” atleast I cannot say it, I will prefer to die before that day.

Older Posts »

Create a free website or blog at