Virial Theorem

The Ravings of a Lunatic

February 28th, 2008

Harvesting Common Sense

I fail, epically.

It’s been about a month since I started my foray into Java and things are going at a slow, yet fairly steady pace. However, programming is all about common sense. And although I realized it a long time ago, today was the day that it really hit me how little common sense I have.

We had to make a program the would prompt the user to enter 5 integers and then print out the lowest of them. Fairly easy stuff right? Well this is what Luke came up with:

int number = c.readInt ();
int minimum = number;

for (int i = 1; i < 5; i++)
{
minimum = Math.min (minimum, number);
number = c.readInt ();
}
c.print (minimum);

THIS, is what I came up with:

int num1 = c.readInt ();
int num2 = c.readInt ();
int num3 = c.readInt ();
int num4 = c.readInt ();
int num5 = c.readInt ();

int first = Math.min (num1, num2);
int second = Math.min (num3, num4);
int third = Math.min (first, second);

c.print (Math.min (third, num5));

Like I said, fail.

Posted in java, programming, sense by Bassam | 2 Comments »


February 6th, 2008

All kinds are good except the kind that bores you.

For some reason, I hate snow days. They tend to bug the crap out of me. Today especially because I was really looking forward to school, I love the second semester (and today we were supposed to have two hours of computer info).

I think the reason they annoy me is because of how insanely boring the day suddenly becomes. There is absolutely nothing to do. I haven’t planned anything for that day and the fact that I’m getting tired of the internet doesn’t help my boredom at all. So I’ve been home almost the entire day doing absolutely nothing.

I no longer have the imagination of a kid and the little remnants of that imagination no longer amuse me. I’ve found that the older I get the harder it is for me to entertain myself. I suspect this pattern will continue until my late twenties. That is when I will begin to find better ways to spend my time. My parents for example find it incredibly easy to entertain themselves; they’ll watch TV, and if there’s nothing on, they’ll read a book, and if they don’t have one, they are more than happy to simply lie down and talk or even take a nap. As of right now, I couldn’t possibly do that, but chances are that by the time I’m their age, I too will be like them.

Posted in life by Bassam | 5 Comments »