The following are the blog posts for the month of December 2008
Dec
31
2008

2008 is 1 second extended!

I read about this news in Reuters.

Several hours from now, we will all be ending 2008 — greeting a new year. But hey, we won’t be greeting a New Year at 12:00 midnight and 0.0 seconds. 2008 is extended by one second!

Unlike other leap years in which we add another day to a year, 2008 is something different — a leap second is added. This is a result to the gradually slowing rate of  spin of the Earth along its axis.

Countries around the World will be injecting the leap second on the last second of 2008 in UTC (December 31 2008: 23:59:59 UTC). The decision was made by the International Earth Rotation and Reference Systems Service, an international body responsible for adding or removing a second to the World Time based on the Earth’s rotation.

The latest injection of a leap second was last December 31 of 2005. Leap seconds can be injected on the end of the months June or December.

Anyway, how do we describe the time during that instant? December 31, 2008, 11:59:60 pm?

Tags:  
Posted in Random


Dec
23
2008

A Geek Day with PHP, Magpie RSS, Cron, mail function and Everything Niice

DISCLAIMER: For those who are not interested in PHP, you better not bore yourself with this post.

It was ages ago since I made posted some really geek stuff. I think I had to live up with my blog title, Build that Geek — and so I had to rebuild the geek inside me.

bot

Overview

An hour ago, a brilliant idea was distracting my sleepy brain (it was around 4am). The idea was shining so much that my eyes were blinded by it (my pair of eye was facing the inside of my head). At first, I was hesitant to do it by I eventually gave in.

The idea was to create a PHP program that would notify me thru SMS and email every time a PRC Board Exam result is released. The program would ran every five minutes by means of creating a cron job that would execute it.

The program flow are as follows:

  • START
  • The program, thru the PHP server would contact an external source requesting information.
  • The external source would feed the requested information back to the PHP server.
  • The program would parse the data in a PHP-readable format.
  • The parsed data will be filtered (non-PRC related stuff would be dropped).
  • CONDITIONAL: Was the parsed data previously been sent:
    • if yes: END.
    • if no, continue.
  • The program will notify me regarding the PRC Board Exam result release thru SMS [thru an SMS Gateway] and email [thru PHP's mail function]
  • END

The Search for Source of Information

gmanewstvlogo

I strolled around the Internet. The most reliable source I could have is the PRC Official Website. I visited the website and tried to search for an RSS or a well-organized XML file. Too bad there weren’t any. I thought of extacting information from the website the dirty way (using eregi, str_replace, and other string manipulation functions) but it was too much for my tired brain.

The next one was Philippine Daily Inquirer’s inquirer.net. I immediately searsuched their site and poof, there’s this XML feed. I thought it was all fine but when I checked it, it was pretty outdated. If I’d use it, the program would defeat the purpose of informing me really fast of the latest news.

Next was ABS-CBN News. In their Public Service area, they served PRC Board Exam result news. They supplied an RSS feed, but sadly it was blank. It contained no information.

The last one who successfully won me was GMANews.tv. I checked their site and they were also serving PRC Board Exam result news. I learned that they publish it on-the-go on their Nation section. Their top stories section had a usable RSS feed, woot. Finally, I’ve got it.

Data Parsing and Extraction

The next thing to do was to extract the data. How could I parse the RSS feed in such a way PHP would understand it well. Since Google is my friend, I tried googling my problem. Google (search engine) introduced to me Magpie RSS, the program I was looking. Just feed an RSS feed to Magpie RSS and it would break the individual feed items into arrays.

Implementation of Magpie RSS to the program was easy since they have posted a simple how-to on their website.

Filtering the Data

0002_thebigloser_billjunk

Since it was a Nation section feed, not all items on the feed were regarding PRC. There was a need to filter it out. The easiest way that came into my mind was to match either one of the following string “prc” or “professional” to the feed descriptions. If the feed description contained the said strings in a non-case-sensitive way, then retain the information; else drop them. What I used in this part was the eregi function.

Notification and all sorts of stuff

The next thing to worry about was on how to notify me. I also realized that previously sent news did not need to be sent from time to time. For this, I made a MySQL database that would save previously sent information. If the information about to be sent is not on the database, then send it; otherwise, don’t.

The email notification was easy. Gladly, PHP has this easy-to-use mail function. For the SMS notification, I used a free SMS gateway.

Keep it running, indefinitely

Since the program needs to run from time to time, I made a cron entry that would command the server to run it from time-to-time.

Conclusion

The idea was possible. Barely 30 minutes were spent doing it. Source code may be requested by contacting me thru my contact page (accessible in the header and footer).

Tags: ,  
Posted in Programming


Dec
20
2008

Internet Explorer, on the spotlight!

Internet Explorer on the spotlight“It’s fine to say ‘don’t use Internet Explorer’ for now, but other browsers may well find themselves in a similar situation”, these were the exact words of Darien Graham-Smith, PC Pro security editor.

Recently, Microsoft discovered a new security hole (vulnerability) to all released versions of Internet Explorer. Being the default Internet browser on most Windows workstations, this issue undoubtedly placed Internet Explorer to the spotlight.

The security hole was discovered by hackers before Microsoft did. In return, malicious websites that install programs that steal passwords for online games were already on the cloud (Internet) during Microsoft’s discovery. Even nongamers should be worried about this as the same security hole could have been used to steal more sensitive information.

Even though Microsoft already released a patch to the vulnerability, not everyone is vigilant enough to download it. I guess Microsoft has to give this issue more publicity. Internet cafes and maintainers of public Internet terminals should know the issue as the general public’s safety is on stake.

Personally, I’ve quit using Internet Explorer 5 years ago. I’ve been overwhelmed with the large volume of security holes that install malicious software. I switched to Mozilla Firefox and was very satisfied.

Related reads:


Dec
19
2008

Boooo, Mikko is back!

Random Shots

Mikko is back. Mikko, the owner of this blog. Conrad Miguel E. Gozalo’s nickname since birth.

Despite the fact that I regained my laptop and Internet access three days after I posted my Internetless post, it was no enough reason for me to immediately return to blogging. I still had a lot of other things in my priority. And for the first time in my life, I spent more time in my academics more than ever.

Random Shots 2

Although I get to cut some few classes, my attendance in class is now a lot better than the previous semester. I realized that it’s not as hard as I thought. Last semester, I always pitied those people with 7am class – now I have one every Tuesday and Thursday. It’s the class I never wanted to miss.

Reorganizing my laptop also made me busy. There was this one afternoon that I devoted my time reorganizing the 6 (logical and extended) partitions I have. I reduced it to four – one for my Windows OS, one for Linux, one accessible by both Windows and Linux and finally one for my laptop’s recovery system. It’s a good thing that I have Ubuntu Live CDs, I can edit my partitions using Free and Open Source Software. There was no need for me to download a proprietary software and a keygen to make it work, ilegally.

Before Shaving

Not only did I reorganize my partitions, I also reorganized my files. I placed most of my personal documents, photos and videos, installers and music library in my largest partition. It was fun since I rediscovered some long lost files – files I forgot to acknowledge that they existed. One thing I discovered during the cleanup was that I had hundreds of photos of myself in my laptop. It made me remember of the days when I still had moustache slash facial hair as seen above. Months ago, I trimmed them off as a response to my siter’s request. Below are my pictures after I shaved (or shove) them off.

After Shaving

Another thing that bugged me was my attempt to migrate from Photoshop to GIMP (GNU Image Manipulation Program), a Free and Open Source Software. It was not easy for me, being a Photoshop user for 5 years. Gladly, my will to go open source helped me a lot in the process. I think of it as wearing a new apparel, of course you don’t expect that the pockets are on the same exact place. They could be on any other place.

Fitting Room Pics
Some pictures from the fitting room

Now that I’m back, I’ve got a lot of catching up to do. UPCAT Results 2009 is expected to be out this January. I’ve got a lot of optimization to do. I’m also planning of making a new theme for this blog, nah nah. Another thing I learned during my blog hiatus was that it gave me passive income. Not so big, but decent — for doing nothing.

Posted in Blogging


Dec
10
2008

Internetlessness

Lately, I’ve been having a hard time getting Internet connectivity. My laptop’s wireless module is some sort of sick for a while, and more recently the whole notebook went brick. I’ve already dropped it off to the HP Service Center at Gil Puyat in Makati for repair, and I they still have to inform me tomorrow on how long my laptop will be staying there.

I don’t really feel using a computer in an Internet cafe for a reason I, too, don’t know. Maybe because of the high cost of renting one, 20 pesos per hour.

I don’t really think Internet connection should cost that much. I’m looking forward for free wireless Internet connectivity here in the Philippines. Our country should exert more effort on making information available to the masses, thus breaking the digital divide.  I believe the idea is still far from reality. Abuse of such free Internet will certainly become an issue, plus the cost. Restrictions on gambling, porn, bandwidth-hog and other non-child-friendly websites should also be imposed if ever the project comes to reality.

The digital divide I am experiencing now has thought me of using the University’s facilities. I have been utilizing the free 20 hours per semester Internet access at the University library – a freebie to victims of the 300% Tuition and Other Fee increase approved last 2006. Last semester, only used less than an hour of it. Too sad the unused hours not cumulative, thus forfeited.

Basically, what I want to tell you is that the reason of my absence in this blog is because I’m Internetless. The good side is I’m going home this 17th back to GenSan. I’ll be active again, reliving the soul of this blog. Woot.

Posted in Personal