Archive for August, 2005


How To: Making an independant copy of a JavaScript array

Wednesday, August 31st, 2005

In JavaScript, if you want to make an independent copy of an array, use the Array slice() function, as seen below

Code:
// JavaScript syntax
var landArray = new Array("Asia", "Africa");
var continentArray = landArray;
landArray.push("Australia"); // this also adds "Australia" to continentList

To create a copy of an array that is independent of another array:
Use the Array object’s slice() method.

For example, the following statements create an array and then use slice() to make an independent copy of the array.

Code:
// JavaScript syntax
var oldArray = ["a", "b", "c"];
var newArray = oldArray.slice(); // makes an independent copy of oldArray

After newArray is created, editing either oldArray or newArray has no effect on the other.
Save you time and effort to make an independant copy.

Zend & Oracle, Zend & IBM, Zend & PayPal, Zend & …

Wednesday, August 31st, 2005

Today Zend and Oracle released the beta release for the “easy to install” Zend Core for Oracle. Why?

The combination of Zend Core for Oracle and Zend Network provide a seamless, out of the box, enterprise grade PHP environment, easing PHP application development and deployment with Oracle Database.

Basically you can use an Oracle database seamlessly with PHP (not to say you couldn’t before with some effort)

PHP is gaining strength; Zend is doing this by teaming up with big corporations – some examples:

And most recently

All of these were initially announced a while back, but only recently starting to pick up steam with beta releases.

Overall it’s a positive move, but major corporations don’t like to share, and more often than not, want what they don’t (can’t) have. Furthermore, with PHP beginning to look more and more like JAVA, you just have to wonder.

In any case, this healthy competition fuels the language, which kick started my passion for web development.

Wikimedia — nothing is free

Sunday, August 28th, 2005

I just Google’d to get some more information on the CEO of the company I work for this summer, Samuel J Palmisano. One of the results that came up was from Wikipedia – the online free encyclopedia.

At the top of the Wikipedia site, said

Wikimedia needs your help in its 21-day fund drive. See our fundraising page.
Over $110,000 has been donated since the drive began on 19 August. Thank you for your generosity!

So I clicked on this link, and read some staggering information:

Wikipedia.org alone gets 800 million hits a day, making it one of the top 50 websites in the world….

800,000,000 / 24 / 60 / 60 = ~9259 hits / second ——– Thats very serious

and their budget for Q3:

Quarter 3 (1 July to 31 September)

Hosting related

Hardware $125,000.00 63.13%
Hosting charges $16,000.00 8.08%
Domain names $1,000.00 0.51%

Personnel

Chief Technical Officer $12,000.00 6.06%
Hardware assistant $1,500.00 0.76%
Executive assistant $5,000.00 2.53%
Travel $7,500.00 3.79%
Legal expens & insur $4,000.00 2.02%
Office expenses $2,500.00 1.26%
Audit of records $2,000.00 1.01%
Chapter startup money $2,000.00 1.01%
Promotional $500.00 0.25%
Miscellaneous expens $1,000.00 0.51%
Reserve (10%) $18,000.00 9.09%

TOTAL $198,000.00

Thats insane, if you can give some money..

The Phenomenon of the Cron

Saturday, August 27th, 2005

As WebBasedCron has become bigger, and more people have been setting cron jobs, I’ve begun to notice a strange pattern. If someone wanted to set a cron job to run, say every hour, they would generally choose the start of the hour as the trigger time. This is ok in theory, but when everyone does this, it causes a huge load on the server at specific points in time.

I monitored the number of cron jobs run every minute, for a one week period. The plot below shows the number of cron jobs run every minute of a given hour. This is averaged over a one week period, but it shows what I’m talking about. You can see that on the hour, half hour, and every 15 minutes, people generally set their cron jobs to run.

The thing is that if a cron job was to run ever 15 minutes of each hour, it could be set to run on the 3rd minute, the 18th minutes, 33rd minute, etc. rather than 0, 15, 30, etc.

So next time anyone wants to set a cron job, and you want it to run once and hour, just choose a random minute, rather than 0.

WebBasedCron plot

Hard drives crashing

Saturday, August 27th, 2005

My hard drive crashed this past week at IBM, and I lost a lot of information. Apparently the IT guy told be they were having problems with the SATA drives… I had backed up the algorithm I was working on for WebFacing, but I lost a good 30% of it.

I’ve been working hard through the weekend to get the algorithm back up to speed. I plan for Monday to have it ready for some serious testing. I wish I was going to be there longer into the school year, no one is perfect, and I’m sure certain scenarios will be need to be addressed. We’ll back to work..

My First Patent

Friday, August 26th, 2005

This summer I’m working for IBM in the Toronto Software Lab. I was fortunate enough to work with a couple really amazing teams, and put in a position to solve a few serious problems.

I wrote an algorithm for the WebFacing team which solves a series of problems they were having. You can learn more about WebFacing at this IBM internal site. Through the recommendation of my manager, I created a patent application and submitted the algorithm for patent approval.

I’m pretty excited about having a patent under my name, hopefully it gets approved soon.

And so something begins

Thursday, August 25th, 2005

You know what’s the worst part of working hard on something big? Along the way, looking back at what you did, and feeling like you accomplished nothing (or not enough). I find myself feeling like this at times. But then I take a step back, retract my steps, and realize that in fact, I can be satisfied.

To help in organizing my thoughts, and give me a central location to document my progress, I made this online diary. We’ll see how it goes.

And for good luck:
God Bless Greece!