Wednesday, November 16, 2011

The curve is going through dugged up path

More updates, or desperation, may just be ahead on the horizon for Adobe's Flash Development... and probably the others that goes along with it -- Flex for one. The article published on The Register provides more gleam on this one.

A new developer on Flex, Flash, and Air.. may have to look shop somewhere else or this may turn out to be a good one. About a few weeks ago, I just got the latest Flex SDK (4.5.6), now, rumor says it's no longer marketable... But who knows? This can just be inviting more attention..

Hope's something worthwhile ride comes by.

Thursday, November 10, 2011

Mobile development taking some curves

Adobe announced today that they're killing mobile Flash development.

This is received differently by different group of people - developers, reviewers, hackers, and even Jobs enthusiasts. Some believe and titled their articles as if Steve Jobs really killed Flash with his persistent denial of Flash's existence and importance in the horizon -- to put Flash out any near his turf. A few more comments that Flash may not just go away easily and it may take some time to actually "die". In between, some developers feel aweful about their expertise with Actionscript and Flash development -- real investment seemingly going to trashbins. The other side of the fence goes saying AS is basically ECMAScript and that switching to Javascript wouldn't hurt a lot.

Along all the sides of the differing point of views, there's this me. Just started out liking development with Flash Builder 4.5 with the ability to retain and enhance my PHP skills and adjust to AS and Flex. Actually, most of what I've done is just following video tutorials using the provided example projects. Whenever I tried changing the samples with the data I could use for my own application, something just goes awefully wrong.

Great time last week was spent working on a solution on why suddenly I can't start a project other than for Android OS - no iOS, no Blackberry -- I was stucked. Got it miraculously working after OS re-installation, which it really is not a factor in the solution equation. Got it working after forceful update to version 4.5.1.

A few days back, most hours after the whole day's work were spent trying to make the ZendFramework work for the PHP class I've developed from scratch just to come up with the basic structure for a DataService configuration I have tried during the first few days of the toturials. To this day, I really doesn't know to make it work.. Stuck.

Despite the seatback and the not-so-good timely news of Adobe's killing Flash, There's some light in the horizon: "package native apps with Adobe AIR for all major app stores". Build one, deploy to all.. That's pretty good!!!

The other side of the fence of developers, developing not from the native code, would mean performance penalties and sacrifices. These performance penalties may be quite OK with hardware devices overcoming the penalties (e.g.: a 1.2Ghz with a 800Mhz output). Might be OK or awefully bad.

A good time to expand the horizon and pool more options.

Thursday, October 27, 2011

To iOS or NOT

Last week, I attended a 4-hour seminar/showcase of iOS Application Development at Mint College in Fort Bonifacio. iOS basically is the operating system for iPhone and iPad devices. It integrates closely with Mac and of course Apple.

A few weeks before that, Steve Jobs passed away raising the question: "How will Apple and innovations from it without Steve Jobs?". You can come up with your own view of the matter, but we'll reserve that for some other time.

The market of mobile applications is increasing exponentially. It's just like the days when all companies and establishments wanted to have their own website and website application has been on the same rise. Now, establishments are clamouring for their own mobile application.

Mobile applications are not new to the horizon, even at the consumer level. Back in the early ages of cellphones, applications already exists and most are on the courrier's end. Eventually, they were made to adopt the Internet and made the system port to websites -- e-commerce came to play a great role, online-banking, and the fraud part, also joined the wagon.

When Apple launched its first version of iPad for the tablet framework, suddenly, the landscape of computing started to change. Despite the existence of tablets way before Apple released its own, (hence the legal battle that it is facing on all sort of countries from other players), tablets are not seen as usefull of to be considered consumer-based or business platform.

Apple changed the outlook on tablets down to the consumer level. Application development needs to pursue and grab the opportunities that it presents in almost all industries: Education for the technology-end; business operations; medical practice.... and the list goes on to coin the tag "I have an app for that".

A couple of years back, the challenge to develop for the mobile platform, as suggested by the increasing adoption of devices, came to play a role in the process. I am a web application developer, though I started my programming practice from DOS-based applications, I should be able to bridge any deficiencies or any adjustment for the web. In about a few weeks of searching for faster solution, I cam accross jQueryMobile - a javascript implementation that uses the industry-proven jQuery framework. It was in its Alpha-1 stage back then. Now, it's in RC2 release -- just about to go mainstream.

I was pulled by it. Going through the readings and searching, jQuerymobile pulled them too. The path is, I will not have must adjustment from how I develop my applications using PHP-MySQL-Javascript-CSS-XHTML and others. jQueryMobile provides really beautiful integration for the mobile platform. As part of the challenge, I had developed a mobile version of the school system I am improving. A restaurant/bar menu and ordering system came next. It was easy, you can build an application with database-integration and custom-views in a matter of hours or days, way faster that most available practices at that time.

There's a catch however, as it is web-based, it can only run with a mobile's browser. Well, by right now, most mobile devices comes with an Internet browser. From my tests and with the available devices I can lay hands on, there are browsers that do not interpret javascript and CSS -- you'll be doomed with text-only -- not good.

Development in the native form -- like iOS -- will eliminate such -- but you can only develop for iOS device -- the ones that ONLY come from Apple. I am not liking the way how it can go. Like when I dropped MS VB development -- thinking I'll be stucked developing for windows only. To this day, that had not changed much. I went to open source -- for the web.

The same dilemna approaches me. If I'm going to develop with iOS:

  • I'll get familiar with using Objective-C. (anyone knows who and what else uses Objective-C? I have not gone to knowing this yet)
  • I can build iOS apps definitely
  • Consequently, I may go away from my web-application development and into iOS. Because, they don't mix and match and the tendency is you'll accommodate one for the place of the other.

After drilling further, I came accross Adobe's Flex Builder with PHP(AFBP) -- SWEET!!!!! I can do Flash faster and I can exploit my PHP know-how.

It is SWEET!

Going through a little reading and tutorials, I found out that developing for iOS and Android can just be an option away from distribution. Build on one platform and implement on others. If I go iOS, the app can only work on iOS device. with AFBP, I can leverage to work on Android too..

Further, using PHP on the server-side gives me comfort. I can expand this to use databases -- mySQL is just a script away.

How about other adjustments? Well, I need to learn how to do Flex and Active Scripting -- but that's just part of the tutorials I can go through..

On to the next exercise...

Thursday, October 6, 2011

The Concerned Plumber

Being new at a city, a plumber, who's workplace is around the corner, rented a room at the first floor on a four-storey building. Starting on the next day, he would go out early to catch up his ride to his workplace and from work, he'll dip himself to the lone bed in his room.

One day, he woke up hearing some water dripping just next to his bathroom. We wondered if he left the faucet on the night before. He got up, guided by the familiar sound of the water dripping, led him to see that the water was coming from the ceiling. The problem is just not his own right to fix and do it right. So, he decided to talk to the building owner and suggested that he can take care of it at the expense of the owner or the occupant of the room above his.

The owner agreed and so he finished his work early at his workplace to give himself some time to take a look at the seemingly plumbing problem. He walked-up the stair and find his way to the room in question. He knocked cautiously not wanting to alarm anyone. The door opened to a few months old baby crying to its heart out carried by his mother while asking the stranger what he wants. The plumber obediently went in and calmly expressed his concern about the water leaking through the floor. As busy as the mother trying to ease up the baby crying, she just motioned to the guest to just go ahead and take a look at it himself.

The guest went through a sea-full of different toys and stuff cluttered on the floor and through a separate room leading to the kitchen. To his surprise, there really isn't any plumbing that needs to be done -- the kitchen sink is full of dishes and a few more stuffs and the faucet is left open.

As the concerned and affected plumber, what would be the best way to solve the problem?

Tuesday, September 20, 2011

Chaining scripts with LABjs

This article-guide on the use of LABjs may be simple or complex depending on how you approach.

Simple, if you're starting up or your scripts are located in external files and your chain of scripts are accessible from inside the <head> and are called the same from all over your scripts.

Complex, if you have otherwise and/or script blocks are inserted within or after the page. Changes can be all over.

The comment post of "Kevin Hakanson" provided the more simpler way to approach it, at least on how my projects are made : (script blocks can be anywhere you need them against putting all in one location and manipulating them there --- atomic approach may not always work). The method allows a single $LAB chain accross your pages, even if they are called separately or individually == define the instance of $LAB and use this variable in all independently called script blocks (taking his example):

  var instance = $LAB
.wait(function(){ myscript.init(); });


As you defined the variable as "instance", you can then call it on the other script blocks as "instance.script().wait()" chain to all script blocks.

Monday, July 25, 2011

MySQL "Push" backup strategy

A "pull" backup strategy can be achieved by a MySQL replication.

Alternatively, a "push" backup strategy can also be achieved through cron or task scheduler with the following 2-step strategy:

1. take a backup of the database

> mysqldump [options] database > backup.sql

2. send or dump the backup to the remote database

> mysql -u<user> -p<password> -h<remotehost> [options] < backup.sql

Note: the second step should have an explicit password, it should not be blank; to avoid prompt.

You can then add this to your cronjob or Task Scheduler (on Windows) to execute at a certain interval and frequency.

Friday, July 22, 2011

Duplicating MySQL table to another table

Method #1: [the better option]

  1. get the creation table information of the table to be duplicated
  2. change the table name
  3. execute the script

Method #2: this will remove the index definitions of the table though. Use:

CREATE TABLE <newtable>  SELECT * FROM <oldtable> WHERE 1 = 0;

the where clause just says you are ONLY copying the structure and not the data.

Method #3: Copy to and from another database

  1. Copy the table to another database[#2]
  2. Rename the table on the other database[#2]
  3. Copy back to the source database[#1]


Tuesday, July 19, 2011

Requirement Management in four notes

  • Planning good requirements: "What the heck are we building?"
  • Collaboration and buy-in: "Just approve the scope, already!"
  • Traceability and change management: "Wait, does the dev team know that changed?"
  • Quality assurance: "Hello, did anyone test this thing?"

Friday, July 15, 2011

Scheduled Remote MySQL backup using PHP

There's a nice 10 ways to backup mysql database from here.

There's also the use of MySQL Administrator or MySQL Workbench if both machines are Windows-based.

However, if you have the MySQL remotely and can be on Linux; some are on Windows; on different machines; and you want to grab backup from all of them, this one can be helpful.

On my development desktop, I have PHP and MySQL installed. Though it is not necessary to have these installed, it's rather handy on a development workstation.

1. Copy, paste it to your favorite text editor and save it somewhere as backup.php (or any filename you wish, just make sure it's recognized by PHP). For the sake of this tutorial, I saved it at D:\DBbackup\

* This should be run on command prompt
* @params
* host
* user
* password
* [db] defaults as {host}
* [port] defaults as 3306
$DATABASES = array(
'user' => 'user1'
,'host' => ''
,'password' => 'mypassword'
'user' => 'user2'
,'host' => ''
,'password' => 'anotherpassword'
,'port' => '6609'
'user' => 'user2'
,'host' => ''
,'password' => 'itspassword'
,'db' => 'mydatabase'
,'port' => '3308'
# add as many database connection as needed using the structure above
if (defined('STDIN')){ # make sure it's only run on command line interface (CLI)
$start = date('H:i:s');
$date = date('Ymd');
foreach($DATABASES as $instance){
$port = (isset($instance['port']) ? $instance['port'] : '3306');
$db = (isset($instance['db']) ? $instance['db'] : $instance['user']);
exec("mysqldump "
." -h".$instance['host'] #host
." -u".$instance['user'] #user
." -p".$instance['password'] #password
." -P".$port
." --compress" #you may customize the options appropriate to your servers
." --create-options"
." --extended-insert"
." --no-create-db"
." --quote-names"
." --verbose"
." ".$db
." --result-file=".dirname(__FILE__).DIRECTORY_SEPARATOR.$date."-".$db."@".$instance['host'].".sql"
# you may add other routines here like:
# compress using 7z
exec("echo 'STARTED: ".$start." DONE: ".date('H:i:s')."' > ".$date.".txt"); #keep log
} else{
echo 'This should be run on a command line';

2. Test it on your local
a. open a command prompt on d:\dbbackup\ directory
> d:
> cd dbbackup
b. test php [PHPpath]php --info
> C:\PHP\php.exe D:\dbbackup\backup.php
c. it will create *.sql files on d:\dbbackup\ directory for every database you want to backup

3. Add as task to automate execution
a. Open Task Scheduler
b. Add new task that starts a program.
Program to execute: C:\PHP\php.exe
Parameters (or add it to Program to execute depending on your Windows version)
: D:\dbbackup\backup.php
This will basically execute as
C:\PHP\php.exe D:\dbbackup\backup.php
Put the desired frequency and schedule to backup.

The length of time to execute the script will depend on the amount of data and speed of your connection to the server.

Wednesday, February 16, 2011

JQuery Mobile Project update

I just launched a list of modules using jQueryMobile just in time for the Alpha3 release of jQueryMobile. I had employed tabs, menu-selections, form submissions.

I just yet to know more on how to execute JS routines on the modules in any way possible. I'm hoping it would be jQuery(ish) and not native JS.

It is easy and fun doing the modules. I had not to worry about layout, design and color-selections as they are already pre-built with the package. I created a templating system to make development even faster. This allowed me to produce the mobile-counterpart of submodules on the system.

Next move is to add more functionalities and open opportunities exploiting the user-experience of the mobile. A new module fo e-commerce shop will be underway.

Wednesday, February 2, 2011

Web Development for the Mobile

A new project drops heavily on my lap the past few days: develop a system that interfaces with a mobile browser primarily to support the online education project of the college.

The college has been using Moodle ( as its Learning Management System (LMS) and the closest link towards the project is Mobile Moodle (MOMO

I read through the product and it requires me to have a mobile device with web browser and preferrably with a WiFi connection. At the back of my mind, if I am to build with a web browser, there's not much options to choose from away from what I am currently doing -- web application with PHP, MySQL and JS (jQuery preferrably).

With more searches, clicks and reading, I have come accross to:

  • Sencha ( - a Mobile Javascript built from ExtJS background.
  • WebKit Open Source Project ( - web browser engine.
  • FMA SDK ( - had used it to interface between mobile and other appliances.
  • PhoneGap ( - open source mobile platform that supports 6 platforms. 
  • jQTouch ( - "A jQuery plugin for mobile web development on iPhone, iPod Touch, and other forward-thinking devices". This can use the WebKit for a preview and development.
  • dotMobi ( - This offers training for design, development and background information about mobile development.
  • Nokia SDKs ( - flowing through with the dotMobi leads and just about to start dwelling into learning each one of those mentioned in its training articles and archives.

Then suddenly, I just felt the urge to go ahead and start to code. I decided to make a new module - new set of libraries, objects, structure and coding standards. But in order to do that, it's nice to get acquianted with MVC platforms for a change. I crossed with Kohana ( -- a PHP5 MVC framework from CodeIgniter background.

I then went through a little tutorial on how to use Kohana and it seems promising. Tried a few samples but then I stopped. Starting a new one with this platform would mean I have to forget about how I got through all the codes I've used in the same project I am working with.

After a few minutes of big sighs and a mug of coffee, my click landed on jQMobile ( - jQuery's own(as in from the creator of jQuery) mobile platform. It is on its Alpha 2 release and sounds very promising:

  • least adjustment in coding structure
  • gets me more intimate with jQuery
  • gets me more intimate with MVC framework
  • lets me grow with it

Well, a new tool for keeping me to speed, a big step in keeping me ahead.

Wish me luck!

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.