Wednesday, January 26, 2011

PHP5.2.14 to PHP5.3.5 initial impressions on migration

I had been optimistic that my codes way back from PHP4.3 can do well with my the new version PHP5.3.5 after my codes had undergone migration to PHP5 standards.

I decided to use PHP5.3.5 after its announcement that PHP5.2 reaches its EOL (end of life) -- meaning, there's no more effort in maintaining it -- so the only path is to go with the 5.3 series.

My initial readings had lead me to some of the important issues for the migration: specifically on the backward incompatible changes.

I had paid less attention to the differences on PHP5. But just migrating to the new version changed all that.

A brief rundown of the issues I begin to love on the new one:

1. "strrpos() and strripos() now use the entire string as a needle" - this allows faster and better determination of the existence of a string instead of using strstr() and stristr()

2. normalization of path on Windows when using include_once() and require_once() "so that including A.php and a.php include the file just once".

3. array_replace() and array_replace_recursive() - replaces elements from passed arrays into one array. This should have been #1 on my list. Most of my functions and methods can now accept array parameters that act as triggers and options to return values. They must, however, have default values.

4. "gethostname() - Return the current host name for the local machine". Great use in adding info to the log

5. "date_add() - Adds an amount of days, months, years,hours, minutes and seconds to a DateTime object" and the DateTime class and its methods... I have to upgrade a lot of these.

Well, this is an initial list.. I may have to scour the whole repository for codes that needed upgrading and migration.

Good luck to me!



Thursday, January 20, 2011

Green - economical, minimal polution, earth-friendly

Talk about "green ideas" and a lot of people find it differently:

  • green-minded? yeah, you can guess
  • earth-friendly? in ads? in products? in ways and wastes?
  • just color them green

Yesterday, I am acquainted with something really cool. Cool that I'd like to get one right away. If only I have more reasons to get one, I should have asked someone get it for me -- without thinking how much it cost.

Yesterday, I met a few models of ELECTRIC SCOOTERS -- the kind where there's no smoke, almost ninja-move silence, almost  no-maintenance, regular-looking.. (oh I have a lot in mind to describe it away from the regular ones I know.

They are battery operated, no oils needed, no sparkplugs to clean, no Transportation Registration necessary.

They come in models that differs in wattage and a few features. Wattages range from 400 to 650, at least for the models on display and can bring you to 80-100 kilometers on a battery charge. One, you can drive manually or turbo-speed the scooter. Charging is just as simple as putting on the plug as you do with any appliance.

If you are not convinced by the basic idea that its economical, eco-friendly, easy to operate and costs less than half the price of a regular gasoline-operated scooters, the design can deceive you with the absence of the exhaust pipe.

One thing that some riders look for is the speed. These models only can max 50 kilometers per hour. Forget about the sound, it's silent as wheels on friction with the road.

I'm putting up the site for info on how to get one.


Tuesday, January 18, 2011

I'm currently one of those called "Company Men"

What if one day, you got back to work, a little bit late, a litte bit in a rush, a little bit upbeat and a litte bit hasty, however, just to know within the first hour that you're out of the job?

You have worked for years to go up the so called "ladder", keep a high standard of workmanship -- dependable, independent, initiator, democratic and "loyal". Such effort turned the tide and the next thing you know, you're out of job.

"What a pathetic story" -- must have applied during the time of our forefathers -- industrial age. This time, this could be really "REAL". The older we get in a company, the better chance we get associated with "company liability".

The movie "Company Men" starts with the sad story of good (smart, idealistic and productive) people being fired. It struct me with the question posted above.

Robert Kiyosaki, author of the book "Rich Dad, Poor Dad", suggests a lot of ideas in his "Rich Kid, Smart Kid" edition of his book: don't work for money, let money work for you. It's a little absurb at first but it takes an alarm level and conscious thinking as I read the book. Now that I'm watching this movie, it sounds more bells of alarm: "What if I losses my job?"

The "Rich Kid" suggests that I have to invest in a way -- whatever and however that may be, to start.

Anyone out there want to lend a hand, drop by a comment, I'd love to get in touch with you.

Monday, January 17, 2011

GoDaddy domain transfer

When you sign up for godaddy hosting, it will try to identify the closest server farm from your location. The purpose of which is to make your access to the server faster -- less latency and DNS seeks.

However, at some point, this is condescending to the purpose of the site. You would want your server be closer to your intended audience rather than to yours.

Just today, I finished transfering some domains that are hosted on GD's Singapore server farms to their US server farms. My client is forced to get another hosting plan (extension of the offer from GD is a good reason). To transfer, you have just a few minutes to make the transfer. The transfer on a shared linux hosting entails as follows:

  1. Download webfiles to your localhost
  2. While you're downloading, create the database on the new host.
  3. Modify the config files for path and DB connection settings on your local copy
  4. Upload the files to the new host
  5. While you're doing #4, copy the database to your new host
  6. When #5 is done, delete the domain from the old host
  7. Create the domain on the new host. An error will be displayed if the domain is not yet cleared from the old host.
  8. Traceroute for the new domain to resolve to the new host. You may have to modify the DNS server.
  9. Create FTP account for the specific domain if necessary
  10. Test the new site with the configurations set

It's essential to have the fastest Internet connection available to facilitate the smooth transfer.

Should you need assistance soon, you can email aingelcarbonell_at_gmail_dot_com.