Thursday, June 28, 2007

Bye Bye Beagle

That is what hundreds of Linux users will be saying as they download Google's latest masterpiece, Google Desktop for Linux.

Get it now before all the geeks flood their servers ....
http://desktop.google.com/linux/

Tuesday, June 26, 2007

Addicted to Ice Tea

Yes, I will admit it, I am addicted .... addicted to iced tea.

What's worse, it's not your regular P20 ($0.50) iced tea. In fact a large cup costs about 5 times as much but, I dare say, it tastes as good as it is expensive.

I am biased towards the Southern Blend Iced Tea served at the Coffee Bean and Tea Leaf which I frequent quite often since I fell in love with the exquisite drink. I've always thought that I was a Starbucks Frapuccino guy but when it's scorching hot and you're parched, a frapuccino isn't exactly the kind of beverage that will quench your thirst.


05272007179

Wednesday, June 20, 2007

HELP : Link texts gone on Safari Beta on windows

Update : Safari doesn't work on Windows 2003 Server. Although the installer won't complain that you're installing it on an unsupported OS, you will end up with the problems below if you do try it out.

It seems I can truly forego buying that Macbook Pro I've been drooling over because Safari is finally available for Windows. I promptly downloaded the setup file from apple.com and went thru the rudimentary install.

Lo and behold Apple's start page on Safari.



However, when I visited my favorite search engine Google, I see this ....



I tried to edit the font preferences but they're all blanked out. Clicking "Select" allows me to select a font but nothing shows up on the textboxes after making the selection.



Any help or hint will be most appreciated :-)

Blogger "Tagalized"

I guess it was only a matter of time, it first happened to "Anime" and "Korea Novelas" on TV, and now Blogger too.

I logged in to my Blogger dashboard today to find "tagalog" as the language used on the dashboard. I'm sure the Japanese and Chinese will cheer to see dashboard scribbled in their local dialect but I doubt that Filipinos will find it an improvement. That's just my opinion though.

Friday, June 15, 2007

Quirksmode and Strict Mode

Being a back end developer for the longest time, I never really bothered myself with web browser standards. Not until recently.

I've been into Web 2.0 a lot where the development is more on the front end. I've come to realize how front end web developers are completely at the mercy of web browsers and the stubborn adamant companies who make them.

If you find yourself working on the front end of web development a lot, I encourage you to not only know the standards (yes, we do have standards, that's what the W3C is for) but to also know and understand the quirks of the most popular browsers around.

I guess nobody is perfect, the newer version of Internet Explorer for instance tried to be more standards compliant but have fallen quite short.

Click the title link above to learn about quirks mode and strict mode. May it help you keep your hair on your head and most importantly your sanity.

Wednesday, June 13, 2007

Monday, June 11, 2007

Apollo is now AIR

The Ajaxian reports that Adobe Apollo has graduated from Alpha and is now in beta with a fresh new name .... AIR (Apollo Integrated Runtime)

What makes Apollo, I mean AIR, such a promising product is that it allows web developers to enter the realm of desktop development. Well, it's not like web developers don't know a thing or two about desktop application development, as a matter of fact, I'm quite sure that many web developers, specially the older ones (cough!cough!), came from a desktop application development background.

AIR allows developers to leverage knowledge acquired during web development to develop desktop applications. It may not be exciting for the old timers but the new kids on the block that were born to, live with and breath the web have a cause to smile.

Just between you and me, Apollo is a way cooler name :-)

Friday, June 08, 2007

VMWare Fusion and Unity

If this ain't a compelling enough reason to get a Mac, I don't know what is ...



Furthermore, unlike Parallels, Fusion is free. I hope it stays that way.

Thursday, June 07, 2007

Alternative Uses for the Google Gears WorkerPool Module

Last week I described how the Local Server module from Google Gears can help speed up loading time of subpages.

I had another brain storm today and it involved using the WorkerPool API to improve interactivity within a website. It's not uncommon for front end developers to use a technique called polling to do such things as real time popup notification or instant chat messages.

My idea is to use the workerpool instead of polling.

Interesting, but is it feasible and worthwhile ?

To be feasible, you'll need people to have gears installed, otherwise your app won't work, unless of course you degrade gracefully in its absence.

To be worthwhile there has to be some advantage in using the workerpool as opposed to polling.

Tuesday, June 05, 2007

Santa Rosa MacBook Pros : Is it time to switch religions ? ?

Within minutes of reading the Engadget and Gizmodo feeds from google reader about the apple store being down in anticipation of an update, I went to Apple.com and sure enough, I see two giant images of the new MacBook Pros on the frontpage.

Oh how I wish they'd just put "Santa Rosa" in there somewhere. I had to navigate all the way to this page and read about the 800Mhz frontside bus before I could confirm that these are indeed Santa Rosa based laptops.

My old trustee IBM bit the dust a few months back and went to laptop heaven. The shop I went to tells me that unless there's some sentimental value in bringing it back to life, I'd be better off buying a new one.

I've been a windows and linux user for as long as I can remember, frankly, buying a laptop with a different OS, even if it's unix based, is scary, specially if it's worth $1999 and up :-)

However, I have to admit both bootcamp and parallels (coherence mode) are tipping the scales in favor of a new Mac. Another problem is that by the time they get to Philippine shores, there'll be new portables to drool over ... and then the cycle continues ...

Which in itself is a good thing because it means I don't need a laptop, at least not yet, otherwise, I would've snapped up one as fast as I got my desktop.

Web 2.0 for a cellphone ?

I signed up for alpha testing a new (I guess, locally developed) web 2.0 site (ala friendster).

I'm just as curious as Yuga is as to how a Web 2.0 site will be able to promote mobile phones.
Will the site be viewable in one form or another in the cellphone ?
Will the site provide some sort of special service that users of this new mobile phone can use ?
Also, I would be very interested to find out if they used some sort of development or ajax framework.

I guess I'll find out when I see it.

Monday, June 04, 2007

Debugging javascript with debugger

Aside from console.log, there is another javascript command that is available that has been immensely helpful in diagnosing javascript code

It's called "debugger".

Just place that command anywhere in your javascript code. When your page loads, execution will stop on the line where you placed debugger. This works on ...
  • Firefox with firebug installed
  • Internet Explorer with the Script Debugger installed

var myvar="this is myvar";
// execution stops here and the debugger window appears
debugger;
alert(myvar);

Saturday, June 02, 2007

Speeding up loading time by using Google Gears' LocalServer module

When I visited the Google Gear's developer site and read about the LocalServer module, the first thing that popped into my head was that it could be useful for speeding up our web applications.

I think the web application I am developing right now isn't ready to become an offline web app at least not yet. But when I read the following statement from the Google Gear developer site, I knew instantly that we can indeed use it to help speed up loading time and to acquire slightly better level of control over the user experience when using the web application.

***
The LocalServer always serves a cached resource when the conditions are met, regardless of the network connection. The URLs contained in a store are eligible for local serving without requiring the application to open the store.
***

This basically means that the Google Gear Local Server, using the ManagedResourceStore
  • intercepts all HTTP/HTTPS requests to a resource (be it an image, style sheet or javascript file),
  • checks if it is a captured resource and
  • serve the resource file from the LocalServer if it is found to be a captured resource,
and it does this whether the user's computer can access the server or not.

It can be akin to a local proxy server that caches resource files. The difference is that the store resides on the user's PC and not on a separate machine and our web application has control over the cached resources thru a couple of lines of javascript and a manifests file.

The manifests file has a JSON data structure with the list of resources to cache in the LocalServer and a version string. This version string is used to determine if the resources in the LocalServer should be updated.

{
"betaManifestVersion": 1,
"version": "6",
"entries": [
{ "url": "/resources/ajaxhelper/gears/gears_init.js"},
{ "url": "/resources/acs-subsite/core.js"},
{ "url": "/resources/ajaxhelper/yui-ext/yui-ext.js"},
{ "url": "/resources/ajaxhelper/ext/adapter/yui/ext-yui-adapter.js"},
{ "url": "/resources/ajaxhelper/ext/ext-all.js"},
{ "url": "/resources/ajaxhelper/ext/ext2-all.js"},
{ "url": "/resources/acs-templating/ajax-list.js"),
{ "url": "/resources/ajaxhelper/ext/resources/css/ext-all.css"},
{ "url": "/resources/ajaxhelper/ext/resources/css/ytheme-green.css"},
{ "url": "/resources/capital-projects/controlpanel/cp.css"},
{ "url": "/resources/jobs-db/controlpanel/cp.css"},
{ "url": "/resources/acs-templating/lists.css"},
{ "url": "/resources/style.css"},
{ "url": "/resources/acs-subsite/old-ui-master.css"}
]
}

contents of a sample manifests file

The lines of javascript will be responsible for
  • capturing the resource files into the LocalServer
  • checking for updates
  • updating the captured resource files
Notice that javascript is not needed to tell the browser to use the LocalServer each time a page is loaded, this is done automatically for you by Google Gears without using any additional javasript aside from the first one that instantiates the store and captures the resuource files.



<script src="/resources/ajaxhelper/gears/gears_init.js"></script>
<script>
if (!window.google || !google.gears) {
// console.log("google gears not installed");
} else {
// console.log("installed");

// initialize some variables
var STORE_NAME="csm_store"
var MANIFEST_FILENAME="csm-gears_manifest.json"

// instantiate google gears
try {
var localServer = google.gears.factory.create("beta.localserver","1.0");
} catch(e) {
// user denied access to google gears
}
if (typeof(localServer) == "object") {
var store = localServer.createManagedStore(STORE_NAME);
store.manifestUrl = "/"+MANIFEST_FILENAME;

// check for changes and capture files
store.checkForUpdate();

// notification for debugging only
/*
var timerId = window.setInterval(function() {
// When the currentVersion property has a value, all of the resources
// listed in the manifest file for that version are captured. There is
// an open bug to surface this state change as an event.
if (store.currentVersion) {
window.clearInterval(timerId);
console.log("Using store version: " +store.currentVersion);
} else if (store.updateStatus == 3) {
console.log("Error: " + store.lastErrorMessage);
}
}, 500);
*/
}
}
</script>


The above script, which is partially lifted from this tutorial, is placed on the landing page of the web site or web application. It loads up the entries from the manifest file into the LocalServer.

This is done only after checking that Google Gears is installed and will not need to be done again until any of the files in the manifest entries change, at which time changing the version string in the manifest file, and rerunning the javascript above will force Google Gears to recapture the files into the local store.

The script also tries to be unobtrusive. It doesn't alert the user that it's trying to use Google Gears and fails gracefully if it isn't installed.

If Google Gears is installed, the user will need to give explicit permission to the page for it to be able to use Google Gears.

gears-security

Although this is an interesting idea, I have yet to do benchmarks to determine how much of a speed improvement can be derived from this. As far as my preliminary testing goes I seem to get perceivably faster response times if the bigger javascript and css files are cached in the LocalServer.

Thursday, May 31, 2007

An application I would like to see on Microsoft Surface

Microsoft this week launched Surface which I can only describe as a tool that provides a more human way to interact with computers.

It just so happens that one of the TED talks posted over at the TED blog was of Blaise Aguera y Arcas, a software architect at Microsoft, who spoke about and demoed Photosynth.

Play the video to see why i think we could be seeing Photosynth in Microsoft Surface very soon. Heck it might already be in there ....

Google Gears, Enabling Offline Web Apps

I logged in to my google reader account today and found an interesting link called "Offline" on the upper right hand corner of the page.


Clicking it launches a window that prompts me to install Google Gears that will apparently enable google reader to work offline.

Upon visiting the developer guide for Google Gears, it seems there are some components it has that may be beneficial towards speeding up an ajax web app, like, for instance, the workerpool.

I am going to install it and give it a go. Most people are on broadband anyway so I don't quite see why an Offline app would be any use, unless of course you're constantly on the go, leeching free wi-fi internet access anywhere you can get it.

Premature optimization is the root of all evil

Jeff Vogel writes on IBM Developerworks and shares his "Six ways to write more comprehensible code".

What has been most relevant to me recently is Tip # 5.

Game development isn't exactly the same as web application development.

So my question is, if the client wanted the web app "done yesterday", is it not possible to do optimization while coding ? If yes, is it a good idea ?

Wednesday, May 30, 2007

Rereading the Art of War

One interesting factoid I learned from my high school english teacher is that your personal interpretation, understanding and enjoyment of a book changes with age.

She advised us to revisit the books that we've read after ten or so years and attempt to remember our thoughts and feelings as we were reading the book many years before.

Obviously, the text doesn't change (or at least it shouldn't). What does change is ... well, a lot of things. Intelligence, maturity, state of mind, priorities, perspective and many other things that evolve as you grow older, hopefully wiser and more experienced.

Oh yes, I still have the "Art of War" in my bookshelf and I do revisit its pages once in a while. However, the interpretation and format over at sonshi (click the title above) seems to be much better, at least for me.

The spaces between the phrases is like the pause between refrains. It lets you ponder and relish before you read the next set of words, that will equally be full of meaning.

The direct link (?) to the forums related to each phrase is a thoughtful addition and opens up the text to further discussion and interpretation. It's one thing to read it on your own and another to read it with someone and learn about his views of the text.

I have to credit Guy Kawasaki's recent blog post for the link.

Tuesday, May 29, 2007

Lessons learned from "Getting your ajax app to run faster and better"

While waiting for feedback from the client, I thought I would share a couple of educational tidbits that I and my colleagues learned in the process of speeding up our ajax web app.
  • It's not just about loading time anymore. Web development a few years ago was all about minimizing the loading time of web pages. This means minimizing the file size of graphics and utilizing CSS for styling. It still is, but today where javascript is as ubiquitous as people during rush hour, web developers also have to consider execution time of javascript. An audit of the javascript code and identifying which part exactly is taking the longest time is the key here.
  • A faster PC makes a difference. One observation is how the same web app running on the same browser can perform differently on PC's of varying speed. Again a few years ago, I would've shrugged at the need to have absolutely the latest and greatest for just suring the net. Apparently, web apps like the one we are developing really put the browser to the test, so it demands more CPU power and memory. The more your machine has the better it seems is the experience. Obviously, you have very little control over what your users use to surf to your web app, unless of course it's an internal web application like ours.
  • The browser cache is your friend. Pre-loading some of the CSS and javascript files on lighter and less busy pages like the login screen helps. By the time the user logs in, majority of the javascript and css files would have already been cached on the browser so loading time is much improved. We use YUI where the actual javascript files are stored on Yahoo's fast servers. The Yahoo webpages also use YUI so if the user happens to be a regular Yahoo page visitor, then you're in luck as the YUI javascript files may already be cached.
  • Two domains are better than one. There seems to be an internal limit on the number of connections that a browser can make to a single domain. Loading your css and other static files from another domain seems to allow us to work around that limit.
  • Compression is relative. One of the things I thought of implementing was gzip compression to miniimize load time. Most mainstream browsers since 1999 already have the capability to decompress gzipped content as they are received. This means that I can gzip a 50KB javascript file into a 10KB gzip file and serve that to IE or Firefox and they would know what to do with it. If you happen to be using Apache, you won't need to manually gzip your files as you can use mod_gzip to have Apache do it automatically with a few changes in configuration. On AOLServer 4.0.10 there is the Ns_Compress module but you have to compile aolserver with a zlib parameter that points to the zlib library files on your server for it to work. However, you have to keep in mind that the browser has to deflate/decompress the file for it to be useful, so the speed you get during load time could be once again taken away if you have a slow PC and decompression takes longer.
  • Measure, measure, measure. Unlike me :-) , Dave knows the value of good measurements, so he took the time to profile the speed of the webapp before and after each of our attempts and changes. Otherwise, how would we have guessed that compression doesn't necessarily speed up the webapp.
  • Optimize javascript. I think the most important thing I learned here is that even if you are using a fast and object oriented javascript library, how you code with it affects performance a great deal. The tips I found on this page helped me optimize my implementation of the javascript code. I didn't see a major jump in speed but I noticed some improvements in perceived execution time.

Ubuntu is not all that people say it is

Ubuntu has been touted as one of the easiest linux distributions to use. Yuga points out that it failed Serdar Yegulalp's "Granny test" in an article over at Information Week pitting it against Windows Vista.

I hate to say it but I also fell for the "easiest linux" hype. I've been a linux user for 6 years and it's never been as "easy" as Windows.

When I plugin my digital camera to a Windows machine I'm almost certain that it'll just work and that it will show me my photos in an automatically created drive in windows explorer.

In much the same way, I am almost certain that when I plugin the same device to my SuSE Linux machine, I'm bound to check the logs or manually type in a mount command. Apparently it's the same for Ubuntu too.

I recently installed Ubuntu 7 on my brother's PC (who has been using windows since he started using a computer) and he has nothing but complaints. They're nothing a little tweaking can't fix but still cumbersome to not have been preset or configured out of the box.

In conclusion, I agree that Ubuntu has some ways to go. It's probably the easiest linux distribution but it still not as easy as Windows in some cases.

Sunday, May 27, 2007

Peso now 'uncomfortably strong'

This basically means that there is less peso for every dollar you exchange.

Oil price hikes are looming and the transportation sector is requesting an increase in the minimum fare.

So tell me again why a strong peso is good ?

Many might view this as positive for the Philippine economy. This is good news for the government and companies that have dollar denominated debt, but it's certainly taking a while for the regular Juan dela Cruz to feel the positive effects of a stronger local currency.