Archive for the ‘Geek’ Category
Make your YouTube embed code validate as xHTML 1.0 Strict
After rebooting the University of Baguio Science High School up to version 3.5, I ran into some xHTML validation errors with the MultiMedia page which features some TV Commercials of the school hosted on YouTube. It appears that the deceptively simple HTML code that YouTube provides fails to pass the W3C HTML Validator.
Here’s the embed code that YouTube supplied for the UBSHS Belong TV Commercial:
<object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/LuV_Nd8iyQA">
</param>
<embed src="http://www.youtube.com/v/LuV_Nd8iyQA" type="application/x-shockwave-flash" width="425" height="350"> </embed>
</object>
Based on this code, the W3C Mark-up Validator put out several warnings that included errors on the “element ‘embed’ undefined”. Any page that includes YouTube’s generic embed code will thus fail validation. While this may come as no consequence to most people, since the video will generally work with most browsers, any self-respecting web developer would find the generic embed code rather cumbersome.
With the goal of making the embed code pass validation, some redundant and outdated code can be removed and we get the following:
<object type="application/x-shockwave-flash" width="425" height="350" data=" http://www.youtube.com/v/LuV_Nd8iyQA ">
<param name="movie" value=" http://www.youtube.com/v/LuV_Nd8iyQA” />
</object>
Now that’s better! We’ve effectively reduced the number of characters in the embed code from 227 down to 183 in a less cluttered 3 lines. This modified YouTube code passes validation as xHTML 1.0 Strict and the video plays just as well as the original!
Synchronize your computer time with the (Philippine) PAGASA/DOST Network Time Server
Here’s how to synchronize your Mac’s system time to the nearest atomic clock here in the Philippines…
PAGASA (Philippine Atmospheric, Geophysical and Astronomical Services Administration) Press Release:
DOST-ASTI, through the Philippine Research Education and Government Information Network Project (PREGINET) announces the availability of a Network Time Protocol (NTP) server for public access. This is made possible through a partnership with the Time Service Division of PAGASA. PAGASA, as mandated by law, is the official agency that will disseminate the Philippine Standard Time (PST). In connection with this, PAGASA acquired a Global Positioning System Common View (GPSCV) time transfer system which basically provides a timing signal. The GPSCV is composed of a rubidium clock (used for maintaining accurate time), a computer, and a GPS receiver to receive timing signals from the GPS satellites.
To disseminate the time signal received by the GPSCV system in the Internet, PAGASA designates ASTI and DOST-Bicutan to setup their own public NTP servers that will directly connect to the GPSCV system. PAGASA has one public NTP server (ntp.pagasa.dost.gov.ph) as well, and a web-based time reference at their website. ASTI’s NTP server (ntp2.asti.dost.gov.ph) is now also available and DOST-Bicutan’s will be up and running in the near future.
What is NTP?
NTP is a network protocol that synchronizes clocks of hosts and routers in the Internet. NTP is very useful in applications where time accuracy is very important. It is used in network monitoring and measurements, intrusion detection systems, and cryptographic timestamping services, among others. Furthermore, the fact that everyone who uses the NTP service will now have one unified time reference, there will be no longer any excuse why people should blame time for late appointments, late submission of reports, and generally unsynchronized time references.
How to Avail of the NTP Service:
To avail of the service, one must have a client software that will connect to the NTP server. Open System Preferences, then the Date & Time preference pane… and under Internet Time you can connect to ASTI’s NTP server by specifying its hostname (ntp2.asti.dost.gov.ph) or PAGASA’s (ntp.pagasa.dost.gov.ph) in your configuration.
By using a local Philippine server instead of the default setting (usually in California or another Asian country), synching to a local server should be both faster and more accurate.







Make OpenOffice run faster in Mac OS X
(The following screenshots were made from Open-Office 3.0RC1 and Mac OS X Leopard 10.5.4, making the same optimizations with Open-Office 2.x should be quite similar since the same preferences appear across the 2.x and 3.x versions)
Firstly, fire up Open-Office 3.0 from your Applications folder…
You should be greeted with the OpenOffice new document panel with options to make word-processing, spreadsheets, and other types of documents. Just select “Text Document” to make things consistent with this tutorial.
After the OpenOffice Word Processor opens, select Preferences from the application menu. Alternatively, you can also select Options from the Tools menu.
In the Preferences dialog, select Memory from the options on the left side of the dialog window.
Change the some of the settings to the following:
• Reduce the Undo > Number of steps to 25
• Increase the setting for Graphics cache > Use for OpenOffice.org to 128MB (originally just 6MB)
• Increase the setting for Graphics cache > Memory per object to 20MB (originally just 0.5MB)
• Set the Cache for inserted objects > Number of objects to 20
After doing all of that, select Java from the options on the left side of the dialog window. Wait for OpenOffice to detect the Apple Java Runtime Engine. Now uncheck Use a Java runtime environment under Java options.
Restart OpenOffice.org 3.0 and you should notice a considerable improvement in launch times and document interaction.
As noted above, you can also use this optimization tip for lower versions of OpenOffice in Ubuntu and other distros.