Wednesday, June 25, 2008

OpenSUSE 11.0 GM on a Lenovo ThinkPad T61

Hardware Specifications :

Lenovo ThinkPad T61
Model : 7662CTO
CPU : Intel Core 2 DUO T7300 2.0 GHZ
Display : 14.1" 1440x900 NVIDIA Quadro NVS 140M
Hard disk : 120 GB Hitachi HTS54161 5400 rpm
CD ROM : Matsushita CD ROM UJ-852
Memory : 4GB
Wireless : Atheros AR5BXB6 a/b/g
with Bluetooth, Express Card and PCMCIA slot
No fingerprint scanner and no SD/MMC card reader

Software :

OpenSUSE 11.0 Gold DVD downloaded from
http://software.opensuse.org/

OpenSUSE was downloaded via bittorrent and burned into a DVD. Clean installation thru the DVD took about 45 minutes to an hour excluding tweaking and other setup as outlined below.

I chose to install KDE 3.5.9.

Video :

Installation detected the resolution, size and color depth of the laptop. Other users could probably leave it as is but I decided to install the NVIDIA drivers thru one click install from the CyberOrg Blog

Wireless :

The installation detected the wireless card on the T61 and used the newer arth5k driver but for some reason it couldn't detect any available access points. Research reveals that the wireless card is suppose to be supported.

I decided to checkout MadWifi.org where I got the drivers for the card when I installed OpenSUSE 10.3 but as of install time, MadWifi.org hasn't released their wireless drivers for OpenSUSE 11 final. Only the drivers compiled against OpenSUSE 11 Beta are available.

I had no choice but to download, compile and install from source. I followed instructions from this page up to the "Installaing MadWifi" section.

I then reboot, logged in as root and launched YAST. I went to the Network Settings interface to edit the wireless card and changed the module name from ath5k to ath_pci.

Update 7/2/08 : I revisited Madwifi.org and found that they have released packages for OpenSUSE 11 GM.

Sound :

Worked out of the box but I had to right click on the kmix mixer applet, click on Select Master Channel and choose PCM.

Update 6/29/08: I just noticed that the built in mute and the volume up and volume down buttons are working. Back when I was using OpenSUSE 10.3, they weren't working too well.

Bluetooth :

The Fn+F5 key that activates bluetooth wasn't working after install so I had to go to Yast Software Management to install "hotkey". After installation the function key now works and can be used to activate or deactivate bluetooth on the laptop.

Suspend to Disk and Memory :

This is probably the most compelling reason for installing OpenSUSE 11 on my ThinkPad, at least for me. Both work after install with no tweaks or changes what so ever. I just got a bit confused because the Suspend options were not available in the menu. I had to suspend to disk and/or suspend to memory by right clicking the kpowersave applet.

Update 6/29/08: It seems suspend to memory was not working after all but there was an easy fix. It seems you need to have S2RAM_OPTS="-f -a3" in /usr/lib/pm-utils/defaults. Also it seems the suspend options were not in my menu because I was reusing an older home directory.

DeskTop Effects :

Unlike OpenSUSE 10.3 where you have to make a couple of modifications and symlinks, in OpenSUSE 11 Compiz is now better integrated. From the menu, search for "Desktop Effects", launch it and check the checkbox to enable.

First Impressions and Notes:

  • Boot up and shutdown time are noticeably faster for me
  • YAST is speedier, specially the Software Management module.
  • Network Manager doesn't seem to be working too well for me. When I was using OpenSUSE 10.3 it detects if I'm on a wired network and automatically turns off wireless connections. It doesn't do that on OpenSUSE 11, instead it keeps both connections, the wired and the wireless, on.

Monday, June 09, 2008

a quote from the Early Edition episode Hoops

" Everybody has a dream, it comes with being alive, it doesn't matter who you are or what you do or where you grew up ... if you're breathing you got one ... but the dreams that you dream when you're young, those are the ones that count, the ones that you never give up .... when every second lasts a lifetime ... and when you know beyond a doubt that you're different ... and that you're gonna live forever "



Online Videos by Veoh.com

Wednesday, April 16, 2008

Better Merging with Subversion

Check out the blog article I wrote about using svnmerge.py when merging with Subversion.

Wednesday, March 26, 2008

a Ham quote

I've had my fair share of ham jokes but a ham "quote" is something else. Allow me to reproduce it here as read from Dimsumdolly.com ...

The most exquisite peak in culinary art is conquered when you do right by a ham, for a ham, in the very nature of the process it has undergone since it last stalked on its feet, combines in its flavour the tang of smoky autumnal woods, the maternal softness of earthy field delivered of their crop children, the wineyness of a late sun, the intimate kiss of fertilising rain, and the bite of fire. You must slice it thin, too, almost as thin as this page you have in your hands. The making of a ham dinner, like the making of a gentleman, starts a long, long time before the event.

~ W.B. Courtney


Monday, March 17, 2008

Cross Browser Web Development and coming to terms with IE

I just published a blog entry over at Solution Grove with tips on cross browser web development and Internet Explorer.

If you happen to be a front-end web developer, you might find this article interesting.

Monday, March 10, 2008

the story of how "Steve Jobs Made Me Miss My Flight"

I got this link from Rickey.org about how Steve Jobs indirectly caused the guy to miss his flight.

Now I wish I bought a Mac

Apple released the long awaited iPhone SDK last week and boy does Steve Jobs know how to make you regret buying your new PC.

The SDK seems to only come in the form of a dmg file which means that you can only install and use it on OSX.

Ironically, the linux news sites were all abuzz about the iPhone SDK in recent weeks leading up to its release.

I'm sure the *Nix geeks are out there scratching their heads and wondering if there will be a version of the SDK we can download, install and try on Linux.

3 days without DSL and living on Wifi

It's been a while since I have gone without DSL. Last friday, PLDT, my service provider, decided that I needed to go without it for a while. Needless to say it took a while (3 days to be exact) before it was sorted out. Thank God it was a weekend.

For the first time, I was actually thankful that I was paying the extra P99 per month for Airborne Access Wifi.

The problem then was to find a place with a good enough signal at decent speeds. Funny that Airborne claims that they have "the widest coverage, connecting you through the most wi fi location nationwide" because many of the Airborne Access hotspots I went to in the past few months were either offline, excruciatingly slow or just plain difficult to connect to.

So I'm either incredibly unlucky at finding hotspots or they're not very good at keeping their hotspots online and working.

There is, however, one consistently good hot spot in my experience. The Starbucks at Petron Macapagal Avenue always seems to have a good signal at decent speeds.

I felt quite at home because many of the laptop wielding crowd had Thinkpads. They came in all shapes and sizes from the very portable X series to the huge and heavy iSeries, you name it someone has it.

Anyway, the internet has become quite accessible now thanks to wifi. I can remember a year or two ago when internet cafe's were the only place to get internet access. Today, you have wifi hotspots even at the mall. Some, like the Robinson's Malls even offer it for free, mallwide.

Well, my DSL is back and I have to start cutting back on the caffeine now. :-)

Wednesday, February 27, 2008

gearsAJAXHelper: Using Gears as an optional speed boost

I remember trying to do something along these lines a couple of months back. You still need gears to be installed on your browser though.

Read more about gearsAjaxHelper

Saturday, February 23, 2008

iGoogle uses YUI CSS Tools

While messing around with firebug, I found out that iGoogle uses YUI's CSS Tools ...

yui-css-on-igoogle

Friday, February 22, 2008

Yahoo ! releases YUI 2.5

Recently, Dave and I worked on adding some neat features to the list template code.

It's patterned after some of the things we saw in DabbleDB that we thought would be a nice have for list template on OpenACS.

Just last week Dave demoed Ajax List Template at the OpenACS conference at Guatemala.

So how is this related to YUI 2.5.

Well, with the release of 2.5 comes the Data Table control and from the looks of it we'll be rewriting the Ajax List Template to use it soon. The current version uses YUI menus and a lot of back-end code. With the Data Table control it seems we will be able to "progressively enhance" a list template better than how we did it now.

In addition to the Data Table control, a few more notable additions include :

Image Cropper
Layout Manager
  • This looks like the layout manager that ExtJs has.
Uploader

  • Looks like this is a flash based experimental file uploader based on the one they have at Flickr
  • I still like SwfUpload though :-)
Resize Utility
  • This utility will relieve us all of mucking around with the drag and drop api to make elements resizable with YUI :-)

Friday, February 01, 2008

Microsoft Offers $44.6 Billion To Acquire Yahoo

TechCrunch reports that Microsoft is offering to acquire Yahoo for $44.6 Billion. A copy of the letter Microsoft sent to Yahoo is also in the article.

I must admit, the offer must be tempting for shareholders given Yahoo's current state.

The guys at Microsoft were quite patient to wait a year and rather intent to offer so much for a company struggling to stay in the black.

All I can say is ... "Resistance is futile .... "

I'm just worried about what will happen to YUI, if the buyout happens. Is YUI.NET in the horizon ?

Thursday, January 31, 2008

Kernel upgrade to 2.6.22.16-0.1 and minor MadWifi inconvenience

The opensuse updater applet upgraded my kernel and the nvidia graphic card drivers on my opensuse 10.3. Everything was ok except Wifi stopped working.

I have a T61 with the Atheros chipset using MadWifi. It seems the MadWifi repositories haven't caught up. Luckily you can search for updated MadWifi rpms from software.opensuse.org/search.

So first things first is to check what my new kernel is ....

uname -r

Next I search for madwifi-kmp-default that matches the kernel I'm using on http://software.opensuse.org/search and I click on the "One click install" icon to install it.

Sunday, January 27, 2008

My sister's EEE-PC

Lucky my sister has small fingers. I can't imagine myself using this thing for work. The keys on the keyboard are so small and the screen though bright and clear is just too small. I guess that's the adjective that best describes this machine. It's small but it's just fine for my sister who happens to be just as petite ;-)

The unit is the PC-701 model equipped with a 1.3 megapixel webcam, 1GB memory and a 4 GB solid state hard disk with Xandros Linux pre-installed.

Three days before purchase I called to ask if there were available units. The sales person I spoke with said they had 75 units available but he added that these things were selling like hotcakes. When we finally dragged ourselves to the store, there were only 3 units left, he wasn't kidding !!!

I had a chance to play with it for about an hour and here are my first impressions.
  • Boot up is fast. No doubt, due to the solid state hard disk. It beat my T61 to the login screen.
  • The posters and flyers say its "Shock Proof - Weather Proof - Best in Class !". I'm inclined to agree, it feels solid and it's light. It feels like you can actually throw it around without worry.
  • It's linux of course, so the apps were all familiar linux apps like Pidgin, OpenOffice and Firefox, nothing any linux user hasn't seen.
  • Applications were quite responsive. Skype worked out of the box with the webcam.
  • There's a voice command app but I didn't get a chance to try it out yet.
Here are a couple of photos from my camera phone. The last two shots give you a feeling of how exactly small it is.


01242008264


01242008269


01242008270

01242008271

01242008272

Friday, January 25, 2008

ExtJS 2.0.1 is out

Everybody start your download managers and get ExtJS 2.0.1 from ExtJS.com

http://extjs.com/download

Looks like I'll be busy updating projects today ....

Wednesday, January 23, 2008

Can I have your name sir ?

When I go order my favorite venti coffee jelly frapuccino from our local Starbucks, the barista always asks if I want a ham sandwich to go with it, I wonder why ?

Saturday, December 29, 2007

see ya later ... Netscape

All around the web candles are being lit for the once great browser we call Netscape. As sad as it sounds, we all take comfort that its legacy will live on thru Mozilla Firefox.

My earliest memory of Netscape was in college queuing up at the university library waiting for my turn to use the internet in 1994. On a 486 PC running Windows 3.1, I used Netscape and browsed the internet for the first time. My first ever download was Star Trek TNG icons and wallpapers from a gopher site I can no longer remember. Geeky huh ?

Here's a quick round up of the news, "obituaries" and "eulogies" around the web ....

Wednesday, December 26, 2007

Check your Gmail filters .... and I mean NOW !!!!

Before anything else, login to Gmail now and check your filters and POP Forwarding settings and make sure there aren't any strange filters or e-mail address you don't recognize.

I read an incredibly alarming item from digg today about how an unscrupulous hacker stole someone's domain name by hacking into the person's gmail account.

David Airey, the victim, tells his story and the on-going saga to get his domain back in this blog post. If you're a freelancer, your website is your life, I can just imagine the emotional distress he is in.

According to the blog post, Google has already fixed this but the fix will NOT remove filters or settings that have been added or changed by the exploit, so I say again, check your Gmail account now.

Details of the hack can be found in http://www.gnucitizen.org/blog/google-gmail-e-mail-hijack-technique/

Monday, December 24, 2007

Holiday greetings and how Starbucks saved a man's life

I found this touching story from digg about how Starbucks saved Michael Gill's life.

Who is Michael Gill, you ask ? Go ahead, click the link and find out.

I think it's a fitting story to share this Christmas because it's about hope in time of great tribulations and finding happiness in the simplest things.

Happy Holidays everyone !!!!

Sunday, December 23, 2007

NVIDIA Driver 169.07, Compiz and OpenSUSE 10.3

I left my PC to update overnight and I was surprised this morning after a reboot that Compiz isn't working anymore.

It seems the OpenSUSE updater upgraded the Nvidia drivers to version 169.07 but it broke Compiz in the process.

After some exhaustive googling I found the solution in this blog. It's in Italian and it seems meant for Ubuntu users but the code snippets were easy enough to follow and they worked for me on OpenSUSE 10.3

After installing the updates and rebooting, I noticed that compiz wasn't working anymore so I manually executed compiz from a gnome terminal and got this error ....

“No GLXFBConfig for default depth”

The solution according to M0rF3uS’ Ubuntu Blog is to execute the following in your terminal

LIBGL_ALWAYS_INDIRECT=1 compiz -–no-libgl-fallback -–replace ccp &

Alternatively, if you use fusion-icon to launch compiz, open the file

/usr/lib/python2.5/site-packages/FusionIcon/data.py


and locate the line with compiz_args.

edit it so that it looks like

compiz_args = [’–replace’, ‘–sm-disable’, ‘–ignore-desktop-hints’, ‘ccp’, ‘–no-libgl-fallback’]

Then, open a terminal and execute

LIBGL_ALWAYS_INDIRECT=1 fusion-icon

UPDATE: This latest version of the NVIDIA drivers fixed the function keys that control the brightness on my T61. This means that I don't have to exit X windows anymore to adjust the brightness.

Tuesday, December 18, 2007

Microsoft Philippines sued for Piracy!

I dugg the story on one of the earlier Inquirer.net news breaks ...

http://digg.com/microsoft/Another_Lawsuit_against_Microsoft_2

At the time I thought that it was probably an honest mistake on Microsoft Philippine's part.

Well, apparently, it wasn't.

From reading the most recent Inquirer article it seems that Microsoft was fully aware and even "tried to resolve the copyright dispute" as the title says.

It's also apparent that whatever Microsoft was offering to the university to resolve the dispute must have been unacceptable (to put it mildly) for it to actually go so far as to sue Microsoft Philippines and to name Microsoft Corp. in the US as a respondent.

Out of curiosity, I visited the university's website at http://www.southeastern.com.ph/. While it's not as famous as it's neighbor from a few blocks away (DeLa Salle University) the university has been around since 1946.

The article says that "Microsoft Philippines Inc. is disappointed", I think and believe the proper term is stunned that a little known university would challenge them in court and sue them for something that they are, ironically, staunch advocates.

I would dare say that if Microsoft Philippines was dealing with DLSU, UP or Ateneo, the story would be very different.

On the other hand, it could be a huge malicious publicity stunt but an incredibly risky one at that, even if they have Estelito Mendoza as their lawyer, because, all things considered, they're not suing just any company, they're suing the company that made the Internet Explorer browser, the spreadsheet application (MS Excel) and word processor (MS Word) that you and many people around the world use, and a company that has been known to exert "influence" on governments and entities.

I'm rooting for the underdog here.

Any person or organization should think twice, thrice and ten times before thinking of challenging a giant with vast resources such as Microsoft. To step forward and sue is either incredibly foolish or admirably principled. I hope they are the latter.

As a final note ...

The article also quotes a statement from Microsoft Philippines ...

" .... For all intents and purposes, this is a purely local matter which does not involve Microsoft Corporation, ... ”

I seriously beg to differ because if Microsoft loses this case, they will also lose the "moral pedestal" to demand companies to abide by intellectual property and copyright laws.

So the world will be watching, reading and listening in anticipation of what "Goliath" will do to "David" and if "David" can slay the giant or whether he will just give up in the end.

Friday, December 14, 2007

The Why Not Forums : Our local version of TED

They could probably do a better job with the website, nevertheless, I can only describe this forum as the local, proudly Filipino, version of TED.

I wouldn't be surprised if it's patterned after it. Their tag line "Think New Thoughts, Share Big Dreams, Do Brave Things" isn't that far away from "Ideas worth sharing" , if not a bolder, stronger more inspiring statement.

It's the 2nd time for this forum, the first having been held last Sept 27. Our Awesome Planet's Anton attended and wrote a review of that event. Apparently he wasn't all that thrilled with the line up of speakers. Nevertheless, I got wind of Why Not Forums 2.0 from his most recent blog entry to date and the line up seems much better this time around.

Saturday, December 08, 2007

Pulse Audio the "Compiz for Audio" on OpenSUSE

Fedora 8 made waves with Pulse Audio when it was released. It was such a hit that other linux distributions are following suite. OpenSUSE 10.3 users (yours truly included) can now install Pulse Audio using the one click install.

So what's the big deal over Pulse Audio ?
  1. With Pulse Audio, you can run multiple applications (e.g. skype, pidgin, flash video on firefox, Banshee) that use sound and you can hear them all at the same time, even go so far as to control the volume for each application.
  2. Works with or over existing audio systems like ESD for Gnome and aRTS for KDE.
  3. From Linux.com : "PulseAudio can route audio from multiple sources to multiple sinks, both locally and over the network. You can use it to combine multiple soundcards into a single virtual device, to forward music from one PC to another, or to share a single microphone as an input between multiple PCs." Cool !!!
It was an easy installation, the one click install did most of the work for me, although I still had to do a couple of additional things to get it to work. If you happen to have OpenSUSE 10.3 with GNOME, use the one click install and try the following to get Pulse Audio up and running :
  1. After the one click install completes, login as root and edit /etc/group and add all the users who will use Pulse Audio on your system to the pulse group.
  2. Reboot your system
  3. Login as a desktop user, in the Gnome Control Center click Sessions.
  4. In the Startup Programs tab click Add
  5. Type PulseAudio Server on the name field.
  6. Type pulseaudio & on the command field.
  7. Locate and run the PulseAudio Device Chooser from your Application Browser
  8. Logut and then login again.

Wednesday, December 05, 2007

YUI 2.4.0

On the heels of the release of ExtJs 2.0 comes YUI 2.4.0 and it comes packed with some interesting (at least to me) stuff like :
  • charting control/widget
  • it's own css selector engine (about time !)
  • json utility
Is it me or is YUI starting to look more and more like dojo ? I hope Yahoo doesn't do a "dojo" and separate the widgets into their own code base with it's own branding, frankly "Yijits" or "Yuidgets" sounds ridiculous :-)

Tuesday, December 04, 2007

Ext 2.0 stable release is out

A pleasant surprise today.

Ext 2.0 has graduated from RC1. The "stable release" is already available for download at http://extjs.com/download

There's a new file called CHANGES.txt which outlines the changes between 2.0RC1 and 2.0 stable.

Wednesday, November 21, 2007

VMware Server 2.0 Beta : Tempted ? Don't !!!

If you're tempted to give VMware 2.0 BETA for a spin, take my advice and wait.
Here are 2 compelling reasons why NOT ....
  • The VMware server console desktop application is gone. The only 2 ways to access your virtual machine is (a) thru the web browser by installing a plugin to view and control the console and (b) remote desktop access (e.g. vnc or rdp)
  • It installs tomcat and friends. It's possible that memory management on virtual machines may have improved on 2.0 but whatever memory you save will no doubt be consumed by the web server that serves up the web interface.
I for one am extremely disappointed that the server console is gone. It seems I am not alone. VMware server 2.0 would be great if I have a dedicated server to run all my virtual machines, problem is I and many others don't and VMware is forgetting about us by not including a desktop client like VMware server 1.0 has.

Are we doomed to VMware player instead ? Or maybe it's time to try VirtualBox :-)

Wednesday, November 14, 2007

multiple TinyMCE 3 instances on one page

Two of my favorite javascript libraries, YUI and ExtJS, both have WYSIWYG editors. While the editor for ExtJS , in my opinion, has some more ways to go, I've heard raves about YUI's implementation at least from one other developer.

However, there is one WYSIWYG editor that trumps them both and all the others I've seen, it's called TinyMCE.

So it's no wonder that many a developer would like to use it and/or integrate it into their javascript library of choice, including myself.

If you visit the TinyMCE wiki, you'll probably learn to initialize TinyMCE like this


tinyMCE.init({
theme : "advanced",
mode : "textarea",
language : "en",
theme_advanced_layout_manager : "SimpleLayout",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough"
});


This works great if :
  1. you want the editor to appear immediately after the page has loaded
  2. all the editors on your page share the same configuration
In one of my recent projects with ExtJS 2.0 I needed to instantiate two different TinyMCE instances in different layout panels so the method above won't work, so here's how I did it.

Store the configuration objects in an array.

var configArray = [{
theme : "advanced",
mode : "none",
language : "en",
height:"200",
width:"100%",
theme_advanced_layout_manager : "SimpleLayout",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : ""
},{
theme : "advanced",
mode : "none",
language : "en",
width:"100%",
theme_advanced_layout_manager : "SimpleLayout",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left"
}]


In a DOM event, like click or expand that reveals one of my TinyMCE instances (textarea1), I do ..


tinyMCE.settings = configArray[0];
tinyMCE.execCommand('mceAddControl', true, "textarea1");



When I want to reveal my second TinyMCE instance (textarea2), I do ..



tinyMCE.settings = configArray[1];
tinyMCE.execCommand('mceAddControl', true, "textarea2");




To clear the contents of the TinyMCE editor on textarea1, I do ...



tinyMCE.editors.textarea1.setContent(" ");




Here is an html page with the above in action. Remember to change the src of the tinymce javascript.


<html>

<head>
<title>TinyMCE </title>

<script type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
<script>

var tinymceConfigs = [ {theme : "advanced",
mode : "none",
language : "en",
height:"200",
width:"100%",
theme_advanced_layout_manager : "SimpleLayout",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "" },{ theme : "advanced",
mode : "none",
language : "en",
height:"200",
width:"100%",
theme_advanced_layout_manager : "SimpleLayout",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left"}];

function tinyfy(settingid,el_id) {
tinyMCE.settings = tinymceConfigs[settingid];
tinyMCE.execCommand('mceAddControl', true, el_id);
}

</script>

</head>

<body>

<h2>Editor 1</h2>
<a href="javascript:void(0)" onclick="tinyfy(0,'ed1')">show editor 1</a>

<br><textarea id="ed1"></textarea>

<h2>Editor 2</h2>
<a href="javascript:void(0)" onclick="tinyfy(1,'ed2')">show editor 2</a>

<br><textarea id="ed2"></textarea>

</body>

</html>

Sunday, October 14, 2007

Friend Webs on Facebook

Got a facebook account ?

Why don't you login to facebook and head on over to http://apps.facebook.com/friendwebs/ and see Solutiongrove's first ever Facebook app.

It's a neat interactive visualization of your friends on Facebook. If you're curious as to why we called it Friend Webs, take a look at the screen shot below, it's obvious.

We used Jsviz to generate the cool force directed graph and Extjs for the toolbar, popup and effects.

Dave wrote an openacs facebook-api package that made it really easy to talk to facebook from OpenACS.

It's currently in beta and we would really appreciate comments and suggestions on how to improve it and make it even cooler.

friendwebs

Thursday, October 04, 2007

UC Berkeley first to post full lectures to YouTube

You need to have a lot of money, a lot of discipline and a lot of smarts to be able to get into and graduate from an ivy league school like MIT or UC Berkeley.

If you happen to have a lot of discipline and just enough smarts but don't have a lot of money, you could settle for the online courses and videos that these institutions are generously making available online and for FREE.

While MIT has quite a head start with their MITOpenCourseware, UC Berkley has just recently decided to utilize YouTube to distribute videos of its courses.

Don't you just love the internet :-)

Friday, September 21, 2007

Compiz on a Thinkpad T61

It's always a chore installing linux on a new computer but it has never been this gratifying.
I recently had the chance to install OpenSUSE 10.2 on a brand new Thinkpad T61. I'll write a review on my next post about my experiences, but for now allow me to indulge you with a few pics of the latest Compiz-Fusion in action on this sweet machine.








Now we can sync with Google Calendar

Hot off the Ajaxian presses, Google now allows you to write back using the GData API. In the past, all developers have been able to do is to consume data from services like Google Calendar, however, with this development, it won't be long before we see web apps or even desktop apps that sync with Google Calendar.

Making Sense of the NBN Project

I think having close to all the cabinet secretaries and resource persons who had a hand or are directly or indirectly related to the NBN Broadband project in that room was decisive and well played in the part of the Executive.

It sends a strong message to the Filipino people, at least it did to me, that the government is executing this project in good faith, that it is above board, that they have nothing to hide and that it is in the interest of the nation.

Whether or not you or I believe it is a totally different matter, of course :-)

However, sticking to the TECH side of things, Yuga enumerates exactly what that contract will get us if it ever pushes thru.

Wednesday, August 08, 2007

Web Page Development ala Opera

I love the Opera Web Browser. It's the browser I use to check mail, read feeds and chat (yup Opera comes with an IRC chat client).

It's the one browser I can keep on for almost forever on my linux desktop without crashing or using up a ton of resources. If it does crash, it's intuitive enough to resume and launch the pages prior to it crashing. Firefox has that same feature now but I do recall Opera was first to introduce it (please correct me if I am wrong). In fact, tabbed browsing has been an Opera mainstay way before Firefox or IE had it.

What's interesting and maybe laudable about Opera (the company) is that they're not out to conquer your desktop. It seems they're taking aim on consumer devices like mobile phones and game consoles. I was rather intrigued to find out that Opera developed a web browser for the Nintendo Wii. They even have a javascript API for the Wiimote. Too bad I don't have a wii yet and the browser (aka the Internet Channel) isn't free anymore.

If any geeks out there happen to have a Wii and would like to develop web pages on Opera, they might find this page helpful. I've always raved about the firebug on firefox combination for developers.

It seems Opera has a couple of nifty developer tools to challenge the dynamic duo of web development with its Developer Console and DOM Snapshot tools.

Thursday, August 02, 2007

On the Other Hand: The Flip Side of Entrepreneurship by Glenn Kelman

If you're like me, I'm sure you were elated after watching this video. For a split second I'm sure you thought that you too could create a site like or even better than Plenty of Fish that gets twelve billion page views, 380 hits per second, $5-6 million a year in ad revenue and with only two hours of work a day.

The elation gradually wears away though after reality bites and you realize how hard starting a Web 2.0 company really is and that Markus Frind is probably in sane to believe that his site is up and running getting that many hits with ASP.Net on just one IIS server.

Well, after the let down, I encourage you to read this article, also from Guy Kawasaki's blog on Glen Kelman's counterpoint.

He makes interesting, encouraging and comforting points about the flip side of entrepreneurship. He cites very interesting and relevant anecdotes and quotes while presenting his points in a free flowing train of easy to comprehend text. If he wasn't introduced as CEO of Redfin I'd say he's a professional writer/blogger and a good one too.

Saturday, July 28, 2007

Ajax powered File Manager demo

The revolution started a few short years ago with Google's Gmail.

It's the web application that put WOW back into WWW.

It is truly the first web application that I would trade in my trusty e-mail client for. The decision to switch was a no brainer. Yahoo Mail didn't have POP. At that time, no free email hosting provider offered more than a measely 5MB of email storage. Outlook Express crashes at the sheer volume of e-mail I get everyday. Finally, searching thru hundreds to thousands of messages wasn't such a chore because it actually works !

Suddenly, more and more people were turning to their browsers to read mail, gradually weaning away from the desktop e-mail clients that they have become so use to.

After the e-mail client, is the file manager not too far away from the same fate ?

Probably not in the near future. As I have mentioned before, browsers need a little catching up before we can actually see that happening. Right now, for instance, if you want seamless dragging and dropping of files from your desktop to a web page, you have to rely on a java applet.

Click the title link above to see a demo I wrote of an ajax powered file manager (username:coa,password:123) that works on top of the robust OpenACS File Storage package.

I wouldn't call it innovative, in fact, it copies a lot of things from Windows Explorer but it has to start somewhere :-)

Thursday, July 26, 2007

Yahoo! Announces YSlow, Firebug based performance tool

Just a few weeks ago I posted my lessons learned from trying to get an ajax powered web application to run better and faster.

No doubt many developers are constantly trying to find ways to do just that and it looks like Yahoo! has answered the call with this plug-in.

Sunday, July 22, 2007

Globe says subscribers "abusing" their network ....

It's rather upsetting to hear Globe say that their subscribers are "abusing" their network.

Are they in effect saying that people should only subscribe to their internet service to do important stuff like work and not for something trivial as downloading torrents ?

How can it be abusive for subscribers to maximize the usage of a service that they are paying for ?

Don't get me wrong, I believe the reason for the cap is valid, we're talking about the survival of their service and their company after all.

Furthermore, if it will improve the quality of service, why not. As one commenter on Yuga's blog posted :

"The 5 GB cap would be fine with me, if they could deliver the service with decent speeds".

However, to say that the reason for the action is that their subscribers are "abusing" their network is like adding insult to injury, in particular, to the subscribers who are paying for the service but are not really getting the advertised speeds.

If I were Globe, I would just be honest and admit that their network isn't up to that kind of load at the present time. Don't blame your subscribers for maximizing their usage of your service !

PS : I'm not a Globe visibility subscriber :-)

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.

Eat all you can - Ala Carte

When someone says "eat all you can", the image that you conjure in your mind is of a table or tables lined with all sorts of food from appetizers to desserts and queues of people lining up with empty plates waiting to be filled.

A growing trend that I've observed here in Metro Manila, at least, is to offer "eat all you can" a la carte.

What is it and how is it different from traditional "eat all you can" ?

Instead of lining up to get food, you stay seated and order the food from a set menu. The waiter takes your order and promptly serves it after a few minutes. You can order as many of each food item as you like.

Is it better than traditional "eat all you can" ?

In my opinion, yes !!! It's better because ....
  • You don't need to stand up every now and then to get food from the buffet table.
  • You don't feel the pressure to get the best part of the roast duck or worry that you'll run out of shrimp tempura.
  • The waiter does all the work.
  • Insert other thoughts why it's better here .....
Where ?

I have had the pleasure of dining in two such restaurants and they happen to be both Japanese. The first is at Zensho (click the link to read a review) over at Tomas Morato, Quezon City and the other one at the redkimono at the Fort Strip, Taguig.

Too bad I misplaced the pics from Zensho I really like the dining experience as it was also teppanyaki, the cook put on a good show and the food was good too :-)

The redkimono's specialty is kamameshi rice. It's a rice dish with toppings served in a wooden platform. I would recommend the Ebi (shrimp) kamameshi. The shrimp according to my brother was firm. The crunchy california maki is unique and the sukiyaki was fragrant.



05272007169
outside the redkimono


05272007168
redkimono menu


05272007175
Tofu Steak


05272007178
kamameshi rice

Thursday, May 24, 2007

Getting your ajax web app to run faster and better.

After designing a nice user interface with ajax and everything, the complaints start coming in that it's slow. Though I wish the client can be more specific but at the moment that's all I have to work with.

What I don't know is whether it's slow on certain parts of the application or whether he means the loading time takes forever.

I'm now determined to scour the web for everything and anything to get this web application to run like a desktop app. Impossible, you say ? Maybe not, if our user is on broadband and he has a considerably mainstream PC as a lot of computing power is done client side now thanks to javascript.

So what have i found so far that seem useful :

http://www.peachpit.com/articles/article.asp?p=31567&seqNum=5&rl=1
http://ajaxpatterns.org/On-Demand_Javascript
http://www.zimbra.com/blog/archives/2006/07/oscon_ajax_slid.html
http://www.crockford.com/javascript/jsmin.html

If anybody has anymore, just go ahead and let me know.

Wednesday, May 23, 2007

Javascript Kata

Kata as defined by wikipedia "is a Japanese word describing detailed choreographed patterns of movements practiced either solo or in pairs".

Javscript certainly isn't a form of martial arts, however, it's such a liberal programming language that it is easy to get lost or fall prey to bad habits.

While not a martial art, it takes discipline to code.

Patterns or Kata for javascript that are accepted and proven ways to write the language are certainly invaluable, at least to me :-)

Tuesday, May 22, 2007

Zimbra

I think it was the creator of firebug who once mentioned that the Zimbra messaging and collaboration suite has over 500 javascript files. For an application to have so much javascript and still function so smoothly, the application developers must have done something right.

Now that I'm into web 2.0 application development. I think I could learn a thing or two from these guys.

Monday, May 21, 2007

Avoid extra commas (,) or IE will drive you crazy

Like the title says. While it's perfectly alright to have extra commas (,) in a list of objects in Firefox, IE will throw you cryptic messages like "undefined" or something about a "unique identifier".

The code below will throw the mysterious error messages. See the extra comma at the end of the list of objects.


var myobjlist = [
{name:'status_id', type: 'int'},
{name:'bay_id', type: 'int'},
{name:'project_id', type: 'int'},
];

Sunday, May 20, 2007

Replace javascript alert with Firebug's console.log

If you've been developing javascript for a while like me, you're probably the type that have alert messages everywhere in your code. Until firebug, came along that was the only way to determine the value of a variable.

With firebug installed on your Firefox browser, you can now replace the javascript alerts with console.log.


var myvar = "This is my variable"
console.log(myvar);


The above code will output the value of myvar in the firebug console when the page is loaded.

Paging with ExtJs Grid Widget (Updated for ExtJS 2.2)

Updated for ExtJS 2 :

Paging has changed a bit for ExtJS 2.0 from ExtJS 1.0 . In order to get grid paging to work with the grid component on ExtJS 2.2
  1. Create the paging toolbar.
  2. 
    var store = this is the same store used by the grid component
    
    var pagesize = 25;
    var paging_toolbar = new Ext.PagingToolbar({
    pageSize: pagesize,
    displayInfo: true,
    emptyMsg: 'No data found',
    store: store
    })
    
    
  3. Put the toolbar into the bottom bar of the grid component
  4. var grid = new Ext.grid.GridPanel({
    id:'mygrid',
    title:'My Grid',
    columns:[define your columns here]
    store:store,
      bbar:paging_toolbar
    })
    
  5. Call the data store's load function with start and limit parameters. Initially, start should be 0 while limit is the pagesize you pass to the paging toolbar
  6. store.load({params:{start:0,limit:pagesize}});
    
There is very comprehensive FAQ on the ExtJS wiki about the grids component. I encourage anyone who is having trouble with the ExtJS grid component to consult the FAQ.

The item in the FAQ that tackles paging can be found here.

Deprecated : ExtJS 1.0.1 is no longer available but I'm keeping the old content available below just case anybody still uses it for some reason. If you still are, though, I strongly suggest that you should upgrade to ExtJS 2.

There's lots of things to love about ExtJs. The grid widget is one of them. With ExtJs 1.0.1, paging has never been easier. Click the title for a quick tutorial about paging with the grid. If you're new to ExtJS there is a beginner's guide here.

Once you've defined your grid. The snippet below is one of the things you need to add in order to make the paging toolbar appear on your grid.

// create paging
var gridFoot = datagrid.getView().getFooterPanel(true);
var paging = new Ext.PagingToolbar(gridFoot, dataModel, {
pageSize: 20,
displayInfo: true,
displaymsg: 'Displaying {0} - {1} of {2}',
emptyMsg: "No records found"
});
paging.bind(dataModel);

Friday, May 18, 2007

Passing additional arguments to YUI asyncrequest

When using YUI's asyncrequest command (YAHOO.util.Connect.asyncRequest), you need to pass a callback with "success" and "failure" functions. Success is where you put code that executes if the request is successfull and failure is where you put code in case the request failed.


var callback =
{
success: function(o) {/*success handler code*/},
failure: function(o) {/*failure handler code*/},
argument: [argument1, argument2, argument3]
}
YAHOO.util.Connect.asyncRequest('GET', "http://mywebsite.com", callback, null);



When making an ajax request, sometimes you want to be able to manipulate or access variables that are outside the scope of the success or fail function. Here's where the "argument" parameter of the callback comes in.

I discovered that I can literally pass anything I want as an argument. For example, after a successful request, I may want to read additional javascript variables to do further processing. I can even pass a javascript object.

In the snippet below, the argument is appended into "o" the object that is passed into the success and fail functions. To access your argument from either the success or failure functions, you need to use o.argument.argument_name.



var myvar = "this is a variable";
var callback =
{ success: function(o) {
/*success handler code*/
alert(o.argument.extvar);
},failure: function(o) {
/*failure handler code*/
alert(o.argument.extvar);
},argument: { extvar: myvar}
}
YAHOO.util.Connect.asyncRequest('GET', "http://mywebsite.com", callback, null);






Thursday, May 17, 2007

Bye to Blogger Site Feeds, Hello FeedBurner

Just a quick announcement. As part of my "getting serious" about blogging initiative. I have now disabled site feeds from blooger in favor of Feed Burner.

Please unsubscribe from your current feed subscription and click the link on the side bar to subscribe anew.

Thanks for reading !

Wednesday, May 16, 2007

YUI's getElementsByClassname

YUI has a lot of useful shortcut and helper functions. One that has been helpful to me recently is YAHOO.util.Dom.getElementsByClassName.

It returns a javascript array of html elements that have the same classname. This is particularly useful if you want to change the look of a group of html elements like say in a menu bar or in a navigation sidebar.

The snippet below uses getElementsByClassName to get all html elements with a class "sidebarbtn". It also allows you to further qualify what type of html element. In the example below, we are looking for "div" elements with the class "sidebarbtn".

var els = YAHOO.util.Dom.getElementsByClassName('sidebarbtn', 'div');

for (var i =0; i <= els.length; i++) {
YAHOO.util.Dom.removeClass(els[i], "selectedbtn");

}

YAHOO.util.Dom.addClass(selected,"selectedbtn");

Tuesday, May 15, 2007

ExtJS

Everyone who's anyone in the web development world has probably heard of dojo but I think many have yet to find out about ExtJS (the javascript toolkit formerly known as YUI-ext).

In fairness to dojo, I think ExtJS is bordering along the lines of bloatedness but like dojo you get to mix n match and use only the libraries from the toolkit you need.

So what do I like about ExtJS so far;
  • Choice. It started out as a project that extends YUI but it has now expanded to include jQuery and prototype.
  • Widgets. The draggable treepanel and grid widgets are killer.
  • Clean Object Oriented Code. Code can be easily extended or even overwritten if necessary. The uncompresed code is clean.
  • Documentation. While incomplete the documentation and examples provided are clear.
  • Themeing. I love being able to change the theme for all widgets .

Monday, May 14, 2007

Joel on Elevator Technology

Infinitors (the term we call ourselves, those who once worked for InfiniteInfo) would laughingly remember the "hospital building" where we had our offices. It's called the "hospital building" because it can easily be mistaken for one as it's painted all white. While we can joke about the building, we will always scoff at the elevator system they had in place.

What Joel describes as "New Elevator Technology" has been around in the Philippines, in fact, as early as the year 2000 when I joined InfiniteInfo in their then new offices at the Page I building (aka "the hospital") over at Alabang.

It must be great and efficient for a high rise like 7 over at the World Trade Center but it's a nightmare on a building that is less than 20 storeys.

Here are our common complaints and quirks which may or may not be related to the technology itself :
  • The elevator is always broken.
  • There are only 2 elevators.
  • It takes forever for one to be available during rush hour.
  • If you forget to key in your floor and you step in the elevator, you have to step out on the next stop to press your floor number at which time you may already have passed your floor.
  • Pressing *(insert floor number here)* is suppose to prioritize your floor. It doesn't work :-)

Sunday, May 13, 2007

Mother's Day Buffet

Patrick treated us to buffet lunch last Saturday.
I don't think we were planning to go buffet, somehow our legs (or was it our stomachs) dragged us to the doors of Saisaki and before we knew it we were diving into "eat all you can" sushi.
Arnel and Jeff, there's always next time :-)
I hope Deds can upload the photos somewhere :-)

Sunday is Mother's day and the family was planning to have a nice quiet "a la carte" meal at the Serendra. We set our sites on Conti's. We were there early, it was only 11 am but the place was filled and we were number 15 on a waiting list.

That's how we found ourselves at the door step of the Brazilian BBQ. Yes it's buffet again but it's "eat all you can" BBQ this time. All kinds of BBQ from leg of lamb, chicken and pork to believe it or not BBQ'd banana and pineapple.

Our first time in a brazilian barbecue and it was a novel experience.
  • There was a typical buffet table with pasta, rice, appetizers and desserts.
  • Barbecue is served in metal skewers right off the grill and sliced at your table.
  • You use a yoyo to tell the servers if your table would like to be served barbecue. The green side tells them to keep it coming while the red side tells them you don't want any more.



driving automatic

I drive a 7 year old Honda Civic. I love it because it was one of the very few cars in its time that was not only fuel efficient but also powerful and fast.

Honda owners I've talked to would rave about how long their next full tank was and how the fuel meter stays at F for the longest time.

It's the type of car that you love to drive .... when there's no one else on the road.

It's a "stick" shift. It has manual transmission and a clutch. While it's a joy to drive in the wide open roads of Fort Bonifacio, you'll balk at how your feet are killing you when you're stuck at rush hour in Edsa.

I recently had a chance to drive an automatic. My first automatic at that. It's not going to win any races but it's definitely fuel efficient, seats eight people and comes in electronic blue.

It turned heads the first few times. It's probably because people are shocked to see 8 people coming out of such a compact vehicle. No, I'm sure it wasn't the paint job :-)

I still love my Honda but if I ever was going to be stuck in traffic for 2 or more hours or maneuver a tight parking space then I would thank my lucky stars that I'm driving an automatic.

Friday, May 04, 2007

my wish

.... that this life becomes all that you want it to,
Your dreams stay big, and your worries stay small,
You never need to carry more than you can hold ...

Monday, April 30, 2007

As the Software World Turns, Part 1: Engineers In, Programmers Out

And I thought "software engineer" was just better sounding than "programmer".

Saturday, April 28, 2007

Old man Ham

In my college days, one of my classmates was a full 6 years older than the rest of the class. We use to jokingly address him as 'old man'.

It was amusing then but kinda uncanny now that I'm 30.

My metabolism is slower, I'm getting fat (no doubt from all the 'eat-all-you-can' buffets), I have white hair and I think I am starting to see a bald spot.

I had lunch today with Patrick. He asked me about future plans like whether I'm interested to put up a business or if I plan to migrate to anywhere someday. Thinking about it now I probably sounded like an irresponsible happy go lucky shmuck with answers like 'I don't know', 'I haven't thought about it' and 'I'm just taking my time .. enjoying life/work'.

There was a time, a long, long time ago when the family lived in a very cramped apartment. My Dad was overseas and money, the lack of it, was a problem. I remember a time when my younger brother and I once stared at chocolate cupcakes that we knew we liked but couldn't muster the courage to ask money for. It was a stressful time for my parents and we the children felt it.

I just feel blessed today that I don't have to ask money for a chocolate cup cake anymore :-)

Yes, I know, I will need to answer those life questions ... eventually ....

Thursday, April 05, 2007

Parakey is looking for Employee #3

I like how this "wanted" ad is worded. It's straight to the point. It tells you what the company is about, who's behind it, why you should consider joining, the qualifications you need and how to get in touch with them.

I liked it even better because it did not contain the typical "job wanted ad" jargon about graduating from a four year course with a bachelor's degree in "whatever" :-)

I don't quite qualify, though, because I don't think half the word on that ad is "bullshit" (read the part about Skepticism) though I would agree that they'd get a lot of responses if they started it off with that word in bold :-)

Accessing the Database using Javascript

The common routine with ajax based web applications is for javascript to make the ajax request to the server and on the server we write a page with a function in our favorite server side language be it PHP or ASP that performs the request and returns a response.

Well, IBM released a javascript API that lets developers use javascript to update the database of their web applications directly. It still needs a server side gateway to process the requests, nevertheless, it's an interesting concept.

What are the Pros and Cons ? Will the time come where all logic will be in the front end using javascript and we'll have no need for such server side languages like PHP, ASP or even TCL on Aolserver ?

Sunday, April 01, 2007

Wind Power for cell sites

I was at Malapascua last year and the generator the article was referring to at the cell site was quite audible. Too bad I'm not going back this year :-) I would have loved to get a shot of those wind turbines.