Read + Write + Report
Home | Start a blog | About Orble | FAQ | Sites | Writers | Advertise | My Orble | Login

A Lesson A Day - November 2006

Classes and Objects (Visual Basic .NET)

November 12th 2006 08:00
I’m writing my Visual Basic .NET exam in a few days, and my one friend keeps on asking me what the purpose of a class is – so here goes my conceptual and brief explanation of classes (and please, correct me if I’m wrong.)

Say that you are a programmer, and you want to program virtual persons (something like Sims.) Now there’s two ways you can go about doing this:

1) You can program each and every one of them from scratch: limb by limb, toe by toe, hair by hair.

2) You can first program a generic mold for a person, and then just modify the mold each time you want a different person.


The mold in option 2 is exactly what a class is.

First you ask yourself: What does all persons have? That’s easy: A name, weight, length, head, two arms, two legs, and a torso. This attributes is essential for any person mold (and this attributes are known as the properties of your class.)

But everyone is unique, right? This means that we need a way to make each person with a different name, weight, length, and so on. We need a way to tailor our mold to match the specifications of the specific person we are programming. Imagine that we do this by using a control panel that allows you change the shape of the head, or length of the arms inside the mold for example. This ability to change your mold is the most important aspect of classes, and is known as the methods of the class.

Look at this example of a class: (Note that the class consists of properties and methods.)




Now we actually want to start programming people. The actual person that comes out of the mold is called an object.

Let’s program three people: Jojo, Bob and Sydney. We will use the dot as a way to indicate which method is applied to which property, i.e Name.Change Name = “Emile.” This means that we used the Change Name method to change the Name property to “Emile.”

The specs for each of our three persons will look something like this:







See the beauty of classes yet? We used one mold to program three very unique persons, using only their methods to distinguish them.

So what is a class? A class is a grouping of properties and methods. It allows you to change these properties via methods. Imagine the power that classes puts at your fingertips: you can now add more distinguishing methods to the class – for example, you can program your persons so that they have the ability to run, jump, kick and shout. All three of the persons will do these actions very differently.

Classes sure make programming a whole lot easier.

202
Vote
Shared on
   


Enter, Digital Camera

November 8th 2006 19:41
My good and longtime friend received his brand new Nikon D80 today, and even I must admit, from a non-photographer perspective, that it's a nice looking little camera.

Click here to read a review on it.

You can also view my friend's photography on his deviantART page.

If you take a photo with your digital camera, light bounces of your subject and enters the camera through the lens. Because it is a digital camera, the photo has to be digitized. This is the process whereby the light waves that enter your camera, is translated into a language a computer can understand, called bits. These bits form long strings of 1’s and 0’s, which are broken down into tiny dots of color, called pixels.

A normal analog camera has a piece of film inside that captures the light when the shutters quickly open. Similarly, a digital camera has a sensor that converts light into electrical pulses.

The amount of detail a digital camera can capture is called resolution, measured in pixels. That’s why it’s important that the mega pixels your camera can take on are high enough.

The interesting is that the sensors are colorblind – they only measure light intensity. Filtering is used to filter the light into the three primary colors: blue, red, and green. High quality cameras have a filter for each of the primary colors, and use a beam splitter to split the image so that each one of the filters receive equal amounts of light. Because of the filters, it only responds to that particular primary color. The camera uses these three colors to create any other color in the color spectrum.

What’s nice about a digital camera is that the photos are all stored on a flash memory card. This makes accessing the photos obviously very easy – no more photo labs, just plug in into your PC and voila!

After all the excitement I shared with my friend today, I’m thinking of getting myself a digital camera (but that’ll have to wait until my bank account allows it.)
156
Vote
Shared on
   


Last night I had a dream about me asking my warfare-obsessed college buddy how stealth jets remained invisible. And as usual with dreams, I can’t remember what his answer was. So I decided to find out for myself.

A radar system works something like sonar. It sends out bursts of radio signals. When these signals bounce off objects, it return to the radar antenna, which calculates the time it took to get back. This is how it knows how far away the object is.

To ensure that your standard airplane is aerodynamic, the chassis is rounded. The round shape ensures that no matter where the signal hits, some of it get reflected back (but hey, I prefer to be detected when I fly thousands of feet above the ground in a piece of metal.)

Stealth jets, on the other hand, have other motives. Like bombing. And for this they need to be invisible to the enemy radar. This can be done in two ways. One is by shaping the airplane in such a way that it won’t reflect radar signals. The other way is to make the plane out of a material that absorbs the radar signals.

A stealth aircraft is made of flat surfaces and sharp edges. When the radar signals hit the aircraft, the signals get reflected into all sorts of weird angles – but nowhere near the angle from where the signal originally came from. The result: the plane appears to be a small bird (they’re in for a surprise.)

There is a small catch however. When the plane banks, there is a probability that one of the panels could directly reflect a radar signal back to the antenna. I’ll guess when this happen, the stealth jet can expect to have some heavy anti-air missiles locked onto them very soon.
167
Vote
Shared on
   


Mosquitoes...the eleventh plague?

November 3rd 2006 06:32
I like summer. When the sun shines.

Oh but when the sun sets behind the horizon, the vampires awake and abandon their crypts to hunt for fresh blood


[ Click here to read more ]
167
Vote
Shared on
   


In the beginning God said...

November 2nd 2006 06:36
Let there be light. And a few million years later, humans are sitting in front of flat surfaces, looking at them tinkle and change as our fingers tap away on small buttons on another flat surface. Periodically, when the urge bubbles over, the humans will get up from in front of the flat surfaces, do a zombie march to the kitchen, where they will brew a cup of potion (known to the inner circle-members as coffee.) After that, they do a zombie march back to the flat surfaces and resume their insane tapping away (occasionally sipping on their potion.)

What do they do, you ask


[ Click here to read more ]
219
Vote
Shared on
   


More Posts
5 Posts
5 Posts dating from November 2006
Email Subscription
Receive e-mail notifications of new posts on this blog:
Moderated by Emile
Copyright © 2006 2007 2008 On Topic Media PTY LTD. All Rights Reserved. Design by Vimu.com.
On Topic Media ZPages: Sydney |  Melbourne |  Brisbane |  London |  Birmingham |  Leeds     [ Advertise ] [ Contact Us ] [ Privacy Policy ]