Archive

Archive for the ‘My Writings’ Category

Lucky sevens day

July 7th, 2007 No comments

777 is special day for many people and different culture for different reasons.
Today is 07-07-07 July 7, 2007 The lucky day! Lots of news today about the lucky magical numbers 7/7/07 which happens once in a century! The biggest wedding day ever is today in many countries around the world, thousands of couples are gonna marry at 7am or pm today at their local time. In addition, Today, Live Earth Cencerts for climate crisis is going to start its campaign.

Here and here you can see various of 777 events are set for today. Many blog are writing what they were doing at 07-07-07 07:07:07 am today all over the web.

What I was doing at 07-07-2007 07:07:07am ? I was damn sleeping! My friend Abdullah reminded me about the date today at our lab class for Software Engineering afternoon. I told him “so what?”!

Yeah! Here in Kuwait emergency number is 777!

I’m going to publish this article at 07-07-07 07:07:07 pm today local time (GMT+3).

Edit: I missed 07:07 today, I published it at 07:13 pm!!!

Categories: General, My Writings Tags:

Project I have been working on.. Charting: part #1

May 30th, 2007 No comments

I have been working on some projects lately for my classes and others for money. One of the project I was doing is a web based program for senior students project on Petruleom Engineering department. The goal of the program is to find how long the oil will last in Kuwait. In addition, the program should find the maximum production and the year of maximum production.

So far it seems easy, but the hard part is coming.. drawing the chart!. Okay, that sounds easy for me at the begining, but after thinking for awhile I realize that will consume time. I start by looking for an open source of a chart program. Searching for over 12hours for charting program on JAVA or ActionScript. All I can find are the ones you have to pay ALOT of money just to make one. Therefore, I decided to make the charting program from scratch.

Adobe Flash’s Actionscript 2 was the language I decided to use for the program. The reason is because I’m going to make the program a web based program which loads on a webpage and works there. Java was my second option because first I’m more experienced on ActionScript than Java, and second because I didn’t have much time to waste on a language I’m less experienced in since final exam was close.

The first kind of graph/chart needed is “scattered xy” with a linear regression line. Arrghh, looking for linear regression equation really exhausted me because I was using the wrong term when searching for it for many hours. I’ll take about it in details in coming posts.

The second kind of the chart is scattered xy with nonlinear regression curve. But I won’t figure out this curve’s equation, I’ll just use the given data to draw the curve. Its almost the same as the first graph idea in coding, just needed to include few more stuffs.

Making phone program with flash

April 8th, 2007 No comments

won before
 use Tel:
 easy

I have written this article before like 4 years ago in arabic and I won 2nd place on a compitition of best articles on the forum of http://www.ce4arab.com . the article was about making a phone call using flash on your pocket pc.

The idea was simple, you can make a phone call through internet explorer using Tel: NUMBER. For example, you want to call 33344422, simply you type on the internet explorer of your pocket pc “Tel: 33344422” and it will make the call. Well, I don’t know the command which will hang up the phone, but you can just press cancel when you placing a call. Anyone good enough in ActionScript will be able to do that without any trouble.

 To implement that on flash, first you have to make 10 buttons for number. Each time you click a button you add that number as a string to your variable, lets call that variable callNumber. For example when you click button five you add the character value 5 to your variable callNumber.

on (release) {
   _root.callNumber = callNumber + “5”;
}

You do that to all the number buttons. However, be sure to deal with the variable as string not as number which will do addition operation. We cannot use callNumber without defining the variable “callNumber”, we want to make it a timeline variable. To make it a timeline variable, go to the current frame and declare a variable with type String:

var callNumber:String = “”;

We gave it the initial value empty.

On the call button you add the string “Tel: ” and callNumber to your getURL command. Therefore, the call button actionscript will be as the following:

on (release)
{
   getURL(“Tel: ” + callNumber);
{

Simple isn’t it? I guess it is, or atleast so far.
We can add a digital LCD to the flash movie, so you can see what you are dialing like real pocket pc phone program. We add a dynamic text field to the stage and give it the var name “callNumber”. Its so simple and easy even for flash newbies.

The way to do it is simple and easy, but the idea that “Tel: number” on PPC internet explorer was unknown by most of you I’m guess. I can’t remember where I learned about the “Tel” command of the internet explorer.

A tip for newbies in data structure design

March 30th, 2007 No comments

Memory is cheap, it is not a priority for developers anymore. However, developers trys their best to avoid as much as possible to reserve extra memory for their programs, sometimes it can’t be helped when performance is needed more. When more performance needed, more memory is needed. Speed and memory are vise versa. To increase speed of a program you need extra memory from the RAM. For example, using double linked list is much faster than single linked list, but double linked list reserves extra memory for the extra link each node will have. You don’t have to go through the whole list again to search for a prevoiuse node if its a single linked list. You just use the previouse link and increase the speed of the program.

Look at the following C++ code:

typename <Item class>class node
{
   private:
   int nodeNumber;
   <Item> data;
   node *next;
};

For double linked list node you have to add an extra pointer for previouse node:

typename <Item class> class node
{
   private:
   int nodeNumber;
   <Item> data;
   node *next;
   node *previous;
};

Categories: My Writings, Programming Tags: