Sunday, May 20, 2007

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.

Wednesday, March 14, 2007

Beware Paypal Phishing


phishing
Originally uploaded by osirishinzen.
I received an e-mail today supposedly from PayPal, telling me that my account has been changed to a limited access account.

Here are the tell tale signs that told me instantly that this was a phishing attempt :

* The e-mail address was sent to ham at solutiongrove.com instead of the e-mail address I used to sign up for Paypal
* The FROM field is from update@service.com. Shouldn't it at least be from an e-mail address in the paypal domain ?
* When I mouseover the login link, I noticed that it goes to http://residents.oakbrookwalk.com/loggin.php.

A good thing is that if I had failed to see the signs above, Firefox would have warned me instantly that it's a phishing site.

Sunday, March 04, 2007

VMWare Server 1.0.2 is out

I can't say blinking in VGA mode is a good reason to upgrade unless your system suffers from any of the resolved issues in the link above.

Saturday, March 03, 2007

Intel vPro, Big Brother ?

I thought that Intel's vPro technology was just some marketing hype on some already existing technology.

Well, apparently, it's not all hype. As the video will demonstrate, it does offer some very interesting built in tools for serious enterprise system administrators and possibly Big Brother ;-)

As a side note, I actually feel disturbed that someone from the cable company can remotely connect to my cable box and potentially find out what I am watching ;-)

one way to save on electricity bills ... upgrade your linux distribution

Summer is upon us and from what I hear, it's going to be a hot one here in the Philippines. Everyone whom I chat with online who is either in the US east coast or somewhere in Europe are shocked when they hear that my room thermometer reads 30 degrees celsius.

I've gotten responses from the typical "are you sure (your thermometer's not broken) ?" to the more extreme "that's insane !!". I shouldn't be surprised. Dirk who lives in Germany, for instance, says that it's 12 degrees celsius and he calls the weather warm.

One thing is for sure, my household electricity bill is going to go up because primarily of air conditioning. It's not uncommon for temperatures here to go up to a toasty 33 to 34 degrees celsius during the day or at least that's what my room thermometer tells me.

Oddly, to many, one solution I thought of is to upgrade my linux operating system.

Don't get me wrong, Suse Linux Enterprise Server (SLES) has served me incredibly well for over a year now. It is stable and has kept my system running almost 24x7 with very minimal problems. I take comfort in knowing that when I wake up everything I left open last night or in the early morning will still be open and the system will still be up and running like I never left my desk.

I knew that if I wanted to save a little on my electricity bill, I needed to turn off my PC when I'm asleep and be able to start it up fast when I need it, like it was never turned off.

Unfortunately, I couldn't get the hibernate or suspend feature to work and "Cool n' Quiet", the AMD technology that throttles cpu frequencies to lower levels when it's idle thereby consuming less power, messes up the clocks on my virtual machines. So it's turned off.

I spent half a day today upgrading to openSuse 10.2. It's probably the fastest and most efficient upgrade I have ever done. It's all thanks to VMware server. I'll save that story for another blog posting. What's important to note right now with openSuse 10.2 is that hibernate works, at least it does flawlessly on my system.

Now, all I need to do at the end of my working day is to hibernate my PC and configure the BIOS to power up my machine at a pre-configured time which is hopefully before I wake up and start work the next day.

I'm going to do it for the first time tonight.

I'll probably find out if it made a dent on my electricity bill after a month. I'm hoping it does.

short lived ranking ....

Hmmm. Someone from Technorati must've read my last post and wondered ... how does a loser of a blog like this get from a rank of 1,000,000 to 800,000. There must be a bug somewhere.

Well, they seem to have fixed the bug because I'm back to 1,000,000 plus.

However, it seems there's another bug they haven't fixed. It says my blog is linked to 3 other blogs although the list shows 5, interesting .....

Tuesday, February 27, 2007

Getting serious about blogging

I've been quite busy in the past few weeks that I haven't checked how my blog is doing. I got quite a surprise to see that I am now ranked 899,581 from number 1,000,000 or so a year ago when I started.
I have to credit that article I wrote about Skype over at the PinoyTechBlog and that blog post I wrote about how virtualization can boost your productivity.

I have also signed up for a free mybloglog account. It tells me a thing or two about what people visiting my site view or click in the past 5 days. If it starts to get real interesting, I might consider getting a premium account.

Quote of the Day

" ... I have long felt that most computers today do not use electricity. They instead seem to be powered by the "pumping" motion of the mouse! ..."

http://linuxcommand.org/learning_the_shell.php

Friday, February 23, 2007

YUI is 1 year old, Yahoo offers to host it for free

This is great news. Basically this means that you don't need to include the entire YUI library in your web app. Developers can just load the stuff from Yahoo's servers, sweet!!!

On a related note, I found this http://blog.davglass.com/2006/06/yui-code-samples/. The guy wrote some excellent reusable components, widgets and stuff from YUI.

Sunday, February 18, 2007

恭喜發財

Happy Chinese New Year !!!!

Thursday, February 15, 2007

Coping with Stress, Working at home is not as stress free as everyone thinks ...

I just love reading this blog. As a home web worker my self, I find a lot of articles enlightening. I've lost count of how many times I would say "yeah" or "that's exactly how I feel" while reading their articles.

This one in particular provides some tips on how to cope with stress for the home web worker.

Monday, February 12, 2007

Hoopa !

Hoopa !!! is what the gentleman below shouted as he lit ablaze our dessert of Flaming Mangoes.



Cyma is one of the few mediterranean restaurants in the Metro Manila area that I know off and I had the pleasure of having lunch last sunday in their branch inside the Edsa Shang-ri La with the family. Our only experience with mediterranean food is with Cafe Mediterranean's Gyros so we were feeling rather adventurous not to mention hungry. It was almost 2pm when we got to the place and all the tables were filled. Since it was already quite late, we didn't have to wait too long to be seated.



The center of attraction is when they serve flaming dishes. The waiter seving the dish would light it up and everyone shouts Hoopa ! We enjoyed being the center of attention twice, once with their Flaming Cheese (appetizer) and finally with their Flaming Mangoes (dessert)

Here are a couple of scrumptious pics I took of the food we ordered. I had to shoot fast before the food was all gone, so please excuse the amateur photos but I hope they're enough to get you salivating.



Saturday, February 10, 2007

Broken nForce Chipset Cooler, Saving my PC from Overheating

I've known for quite a while that the nforce chipset fan (sometimes mistaken for the northbridge) on the motherboard of my PC has been defective. In anticipation I was able to buy a replacement cooler, a Thermalright HR05-SLI. Since, installing this cooler will cause me to completely remove the motherboard from the case, a time consuming endeavor which I do not wish to do often, I decided to kill two birds with one stone and upgrade the noisy stock cpu cooler as well.

I was eying the Thermaltake Sonic Tower but decided to go with the Scythe Ininity after Roel mentioned he was getting one for his new rig and reading some excellent reviews about it. I like tower coolers in general because they give you the option to cool the CPU passively just by removing or not installing a fan.

Anyway, today, I didn't notice that the chipset fan on the motherboard totally stopped spinning until my PC started becoming slightly unstable. I had no choice but to replace the parts now.

Well, I just completed the replacements. Pics below. I definitely noticed it's quieter and temps seem stable at around 46C.

Update : After some time to settle in, it seems my idle temps is about an average of 40C. No time yet to test temps on full load.


Friday, February 09, 2007

Check if your cpu supports virtualization

On a linux terminal type ....
grep -E '^flags.*(vmx|svm)' /proc/cpuinfo


Wednesday, February 07, 2007

Get a screenshot of an X server running in the background

Ok, before I completely forget about this again.
To capture a screenshot of a running X server instance in the background,

On a linux terminal type ...

DISPLAY=:X import -window root xvfb.png

where X is the display number where the X server is running at and xvfb.png is the output, the file with the screenshot.

Sunday, February 04, 2007

Use my Javascript ... It's Light Weight

When selling a product, the marketing folks would come up with an easy to remember tag line that describes something about the product that's easy to recall.

I think the tagline or tagword for the new and upcoming javascript frameworks is "lightweight".
Just see how "lightweight" is touted as a positive characteristic of these javascript products/frameworks.

MooTools : http://moofx.mad4milk.net/
JQuery : http://jquery.com/
Plotr : http://www.solutoire.com/plotr

It's almost like saying Prototype, Scriptaculous, YUI and Dojo are bloated ;-)

Saturday, February 03, 2007

Pickled Green Mangoes

No, it's not a title for a movie ala Fried Green Tomatoes. It just happens to be one of my all time favorite food stuff. We buy them from a chinese deli over at china town. They make great snacks. I like them specially when chilled a little.

It's really just a coincidence that the brand name is the last 6 letters of my first name.


Friday, February 02, 2007

Swamped but Coping

I'm neck deep in tasks. Or am I really ? Do you ever get that feeling that you're running and running but not really going anywhere ?

How do you cope ?

Patrick a few weeks ago introduced me to emergent task timing . The idea, it seems, is to force yourself to be aware of the time you spend on tasks by checking in every 15 minutes. There is flash application with a time sheet you can mark. It sounds an alarm every 15 minutes to remind you to mark the sheet and to adjust your tasks accordingly.

Does it work ? I'll find out soon.

Thursday, February 01, 2007

Bitterness

A friend shared this with me today.
" ... Look at Joseph at the end of his life. He had been abused by his family, had his reputation ruined by being falsely accused of adultery, he was forgotten by friends, and at times it must have felt as if God had forgotten him. But at the end of his life, when faced with those who were responsible for the years of slavery and pain, he forgives his brothers. He said to them: 'You meant it for evil, but God meant it for good.' Despite all that has happened to him, he acknowledges the sovereignty of God, and God's amazing creative ability to bring good out of evil...
"

Wednesday, January 31, 2007

Are you a Firebug power user ?

If you think you know everything that is to know about developing Javascript with firebug, think again !
Click the title to the ajaxian blog entry with Joe Hewitt demonstrating the firebug for power-users.

Tuesday, January 30, 2007

Javascript rocks ... seriously

The Ajaxian has a blog post about a javascript api that allows developers to integrate sound into their webpages. Meebo's been doing this a while. It's nice to see that we'd be able to do it too now, thanks to this api.

Sunday, January 28, 2007

She sings a love song to a Mac Pro

I think I'm starting to crave for one of them Macs.
Click the title to see a Filipina singing modified lyrics of James Blunt's "You're Beautiful" to a Mac Pro. Hilarious !

Sunday, January 21, 2007

Enjoying my Seafood inspite of my allergies

I count myself as one of the many that are allergic to seafood, specifically shrimp and crab. In my younger years, I found that I must stay away from food with those ingredients unless I want to end up with itchy red blotches all over my face and body.

While growing up, I discovered that certain things will allow me to enjoy seafood without very adverse effects.

1 - Devein the shrimp. Deveining removes the vein or the dark line that runs along the back of the shrimp. I noticed my allergies are less intense when eating deveined shrimp.

2 - Avoid the head of the shrimp. It seems whatever is causing my allergies, as far as shrimp goes, is heavily concentrated in the head so I stay away from it and eat the body only.

3 - Cider Vinegar and Pepper. I dip shrimp and crab meat in cider vinegar with pepper before I put it my mouth. I feel that it tastes really good and more importantly it seems to counter act the itchiness I usually get in my mouth after eating it.

4 - Lemon. I discovered this while dining at a UCC coffee shop. The water they served smelled like rubbing alcohol, at least it did to me. I inquired and it was in fact lemon and NOT rubbing alcohol. It seems dipping shrimp and crab in lemon has the same effect as cider vinegar and pepper. Alternatively, I found that I could chase away the itchiness in my mouth if I drink water with some lemon juice.

WARNING : The above are based on my personal experiences only. I classify my condition as mild. People with very serious reactions to seafood like shrimp or crab should consult a physician. As mild as the term "allergy" sounds, there have been known incidents of people dying due to allergic reactions. You have been warned !

Wednesday, January 10, 2007

there's an iPhone after all

I can't count myself an Apple "fanboy" just yet but since the news broke out that "pigs can fly" I've been pretty keen about the goings on in the world of Macintosh.

Just a few hours ago Steve Jobs announced to an ecstatic crowd the availability of a mobile phone developed by Apple. I'm not sure I share the same sentiment. It's cool but will it fly this June 2007 ?

Monday, January 08, 2007

Are you on the list ?

I don't get to watch a lot of television. Heck, it's been so long since I've been to a movie theatre I can't even remember what it's like inside. It's a good thing because by the time I figure out that it's something I like to watch ...

- It'll be on the internet (e.g. youtube, peekvid, dailymotion).
- If it's a TV series, I can watch all the episodes in succession without worrying about schedules.

One thing I did notice about my TV and movie habits is how many of the stuff I watch are about super heroes. Not heroism in the patriotic everyday sense but rather seemingly ordinary people with extraordinary abilities.

Hero is no exception.

What's different about it is that, it's good, really good. It's the kind of series that makes you ask the obvious questions but it keeps you engaged with the wonder of discovering the answers. Like the recent big screen encarnations of Spiderman and Superman, the writers attempt to add the 'human' component. The characters are not portrayed as 'super heroes' but human beings with special abilities. Yes, there's a difference. The former connotes a level that you or I can never achieve while the latter identifies us mere mortals with the characters.

If you're in the US, you'll be able to see the episodes from http://www.nbc.com/Heroes/episodes/. Outside the US, I would suggest http://www.peekvid.com.

Friday, January 05, 2007

Google Answer to Filling Jobs Is an Algorithm

I didn't realize that Google has so many employees already, 10,000 and counting.
They've been known to do the most innovative things to attract prospective employees. Remember the math problem on the billboard ?.
Looks like they're going to go a step further and innovate the selection process with an alogrithm.
Click on the title to read the NY Times article.

Tuesday, January 02, 2007

Gmail's CSRF Security Flaw, is OpenACS vulnerable to a CSRF attack ?

For those interested to read about Gmail's CSRF security flaw, click the title to go directly to the article over at Ajaxian.

Don't be misled, just because it's in the Ajaxian, doesn't mean that this is purely a problem with web applications that use Ajax. In fact, if I understand CSRF correctly, an out of the box OpenACS application that uses ad_form is possibly vulnerable. Well, except for the login form :-) Curious ? read on ....

What is CSRF ?

CSRF is an acronym for "cross site request forgery". Also known as "session riding", it describes a malicious exploit where a script takes advantage of an authenticated session to get information, like in Gmail's case, your contact list, but in other cases can be your personal or, worse, your financial information from the site that your browser is currently authenticated with.

How does it Work ?

The players involved are (A) you, the user, (B) the site with the malicious script and (C) the website where you are currently logged in or authenticated with. Examples of (C) are Gmail, your online banking website or an OpenACS web application.

The scenario would go something like this.

The user (A) logs in to (C) and stays logged in by checking "Remember me on this computer". On another window or tab, (A) goes to a website (B) with the malicious script. The script in (B) gets executed either from clicking a link or loading a page. The script from (B) will attempt to access (C) using the authenticated session and attempt to retrieve information like your contact list or other information.

Javascript can't do that ! Can it ?

Javascript is not suppose to be able to have access to cookies from other domains. Cookies are used to determine if a user is logged in to a site. They contain session information and other user specific information, hence, the browser imposes this cross domain limitation on javascript. In short, you can't use javascript to fake or manipulate cookies of other domains.

So this exploit will only work if the user (A) is logged in to (C) at the moment the script in (B) is executed.

Where did Gmail go wrong ?

In the case of Gmail, they were exposing a URL that returned JSON structured data that contained the contact list information. Hence you can actually put this url in script tags with the src pointing to this url. Like so


<script type="text/javascript" src="http://docs.google.com/data/contacts?out=js&show=ALL&psort=Affinity&callback=google&max=99999"></script<


While the browser prevents javascript from one domain to control a window in another domain, it will however allow you to specify a javascript source file from another domain.

I'm sure Gmail checks that the user is logged in before actually serving the javascript source file but after this check it has no way of knowing for sure that it was the user who requested it or a script from (B) a malicious website.

Is my OpenACS Web Application vulnerable ?

Unless your OpenACS application is running a web service or providing some sort of API, chances are its not.

he turned down an offer from Google

This post is about a year old, it is nevertheless an interesting read.
He blogs about how his 2 day interview with Google went and how (and more importantly, why) he turned down their offer.

Saturday, December 30, 2006

Notes on recent AOLserver research

I'm looking into using a flash (xmlsockets) gateway to implement low latency connections between the browser and the server (Aolserver), in short, an implementation of COMET using a flash component.

I must admit that creating a socket server in AOLserver is not as straightforward as say in Apache with PHP or CGI perl but my research has led me to a number of different (possibly unrelated but potentially usefull) things.

Memcached : Someone has written a tcl api to memcached. Memcached caches db requests for clusters of AOLservers. It can run as a daemon on an unused server and allow several clustered web servers to share a cache of db requests. I was particularly intrigued that LiveJournal .com uses it with positive results. Dave suggests that it would be neat if this could be augmented into ns_cache.

Naviserver : I've known for sometime that there is a fork of AOLServer. I just noticed that they have lots of potentially useful modules. Some of these are familiar AOLServer modules. I would be interested to find out if any of these modules will work on AOLServer 4.0.10 and 4.5. Another intriguing question is whether OpenACS can run on NAVISERVER.

Saturday, December 23, 2006

One year of blogging

One year and 6 days ago was when I signed up for a blogger account and made my first post.
85 blog posts later who would have thought that it would still be here :-)

I hope next year will be a great year for blogging ...

Wednesday, December 20, 2006

Embed an encoded file in the URL

In additon to http, https, ftp etc. This guy discovered a protocol "data". I would be interested to know how we can take advantage of this in Ajax Applications.

He lists a couple of possible applications. Click on the title to jump to the article at Hackzine.

Sunday, December 17, 2006

they posted my article

I do a lot of geeky stuff for fun. One of the articles I wrote about one of my projects just got published at the PinoyTech Blog. :-)

Upgrading to a larger hard disk

For several weeks my hard disk has been making a clicking sound. I couldn't reboot anymore because the clicking sound becomes worse during boot up and I got really worried that one day it wouldn't boot at all. It's my 4 year old Western Digital 40GB 7200rpm hard drive. I've been using it as my root partition for the last year and I think it's saying its last prayers.



In the past, upgrading to a larger hard disk for me was always an opportunity to reinstall everything and start with a new OS. This time, however, I can't afford to do that because I have a pile of things on my plate that I want to clear out before the end of the year. In addition, I happen to be quite happy with SLES 10 (Suse Linux Enterprise 10) on my workstation and I would be devastated if I had to redo all my settings and configurations.


I went to the mall and got myself a new hard drive. It's a Seagate Barracuda 7200.9 160GB 7200rpm with 8MB cache. I would've wanted a Barracuda ES but it's available on order basis only and I didn't want to wait too long.



So here's the sitch ... I have an old 40GB hard drive that's about to give and I want to upgrade to my new 160GB hard drive but I don't want to reinstall my OS.

Thank goodness for the internet, to everyone who likes to post about their problems with their hard disks and best of all to everyone who answers.

So here's what I did.

First, I turned off the computer and unplugged it. My motherboard supports both SATA and IDE interfaces. I installed my new hard drive and plugged it into SATA1.


Next, I boot up my PC and enter the BIOS. On my PC, I just press the delete key while it's booting up. Then, I configure the hard disk boot sequence so that it boots from SATA instead of the IDE interface. Note that not all motherboards supports this feature. While I am in the BIOS, I also configure the CDROM to boot first, you'll find out why next.


I used a Xubuntu Live CD to boot the PC after the configurations I made to the BIOS. In Xubuntu, I open a terminal and executed the following.




dd if=/dev/hda of=/dev/sda



My old hard disk is detected as /dev/hda while by new hard disk is /dev/sda. The dd command will copy my old hard disk into my new one byte per byte including the master boot records. There are some people that will argue that the above command can be used ONLY to clone two hard disks that are exactly the same so I was cautious but the explanations weren't very convincing so I decided to take a risk.


The copy took a while to finish. After it was done, I used cfdisk to verify the partitions on my new hard disk



cfdisk /dev/sda




From cfdisk I can see that I have a 40GB partition and about 110GB free disk space. I converted the free space into a new partition. I saved the configurations and exited cfdisk. Note that I could also have opted to resize the existing partition to use the entire disk.


I then ran fsck on /dev/sda1 which is the new partition which is the copy of my old hard drive. fsck did not report any problems.


Before rebooting, I mounted /dev/sda1 into a temporary directory.


cd /
mkdir tmpdir
mount /dev/sda1 tmpdir


Then I went into /tmpdir/boot and proceeded to edit the following files.

  • /boot/grub/menu.lst
  • /boot/grub/device.map
  • /etc/fstab

I changed all instances of /dev/hda1 to /dev/sda1.


I rebooted the PC and crossed my fingers. I was welcomed by the familiar grub menu and it proceeded to boot SLES 10. I logged in and it was like nothing changed.




Helpful Links

http://forums.gentoo.org/viewtopic-t-72947-highlight-cfdisk.html

http://www.linuxquestions.org/questions/showthread.php?p=1848006#post1848006

http://en.wikipedia.org/wiki/Dd_%28Unix%29

Tuesday, December 12, 2006

Dreamweaver, eat your heart out !!! Here comes Aptana.

The founder of Aptana demoes how easy it is to use Aptana's Web IDE to develop Ajax applications using YUI.

Debug Javascript with Firebug

If you've never heard of or used firebug, on which rock have you been hiding under all this time :-)
Joe Hewitt introduces you to Firebug on this video.

Monday, December 11, 2006

Are you an INTJ ? Take the test and find out.

Click the title link. It will bring you to a page where you can take an online test to determine your personality.

Nope, don't worry, it's not from COSMOPOLITAN or some women's magazine ...

Saturday, December 02, 2006

Encounters with IE

Aside from the preparations for the super typhoon that did not hit manila. This week was full of encounters with Internet Explorer.


1 - Operation Aborted error when printing a Web page. This happens on IE 6 only. If you happen to use "Tags" as an input name, you're users are bound to get the Operation Aborted Error.


2 - Page can not be displayed error. I couldn't find the original blog article where I read this particular problem. It occurs on a webpage where you have inline javascript that is trying to manipulate an html element that has not been loaded yet. The solution is to put the javascript in a function that gets called on the window.onload event.

Reming missed Manila

We are all thankful in Manila that Reming changed course. It's bad news for the Bicol region, though, especially in Legaspi, Albay where Mayon volcano is. They are now dealing with the aftermath of a super typhoon in addition to a possible eruption.

Thursday, November 30, 2006

Getting Ready for Reming


Indeed, what are the chances of another typhoon hitting Metro Manila just 2 months after the last one.


There's nothing to do but to "hope for the best and expect the worst".


Power is already out my house and I'm on my laptop using my cellphone as a modem.


Yuga has some great tips.

puTTY for your phone

This is for all the hardcore sys ads out there.

SSH to your servers right from the comfort of your palm (oh wait, that's a different device).

This puTTY runs on a Symbian OS based cell phone like my N70.

Monday, November 27, 2006

5 things a Geek does with his new Nokia N70


Nothing beats the feeling of getting a free phone.


A relative was a offered a promo with a lock in period of 2 years for a specific plan in exchange for 2 spanking new 3G Nokia cellphones. Suffice to say that I got 1 of the two units the cell phone company was giving away.


I'll probably keep my T610 for sentimental reasons but I hear it'll still fetch about P2,000.00 at Virra Mall.


So what is a geek to do with a new nokia N70.


1st - Plug it into a computer. Unfortunately Linux isn't supported. Bummer!! I do however have a windows virtual machine running inside VMware server. I plugged in the phone onto a free usb slot via the provided data cable and created a new usb port on the virtual machine. It's a good thing that the phone was autodetected, so I just clicked on Removable Devices -> USB -> Nokia N70 in the VMware server console. Prior to that I installed the drivers and the PC Suite.


2nd - Surf the Internet. It's a 3G phone :-) It's bundled with a browser by Opera. Yahoo Messenger and Yahoo Mail are also bundled.


3rd - Customize the hell out of it. Change themes, alter settings, transfer contacts, change ring tones and alerts until everything is just right (which will probably be never).


4th - Install GNUBOX . Internet over a cell phone, at least here in the Philippines, is expensive. GNUBOX is a nice symbian application that allows you to surf using bluetooth. I happen to have a bluetooth adapter and just went for it.


5th - Attempt to sync up your contacts with your e-mail client. Still no success in this front specially with me using Linux. I signed up for an account at scheduleworld.com. I'll need to find some time to try out synching.

Monday, November 06, 2006

Taking a Queue from the Ubuntu Developer Summit

I evesdropped at the recently concluded OpenACS Conference over Skype.


Coincidentally, Canonical (the company behind Ubuntu) will make VOIP available so that ubuntu developers who could not physically be present can listen in and even participate in the discussions if they have a microphone.


The OpenACS conference also had two days of hacking and bug bashing. It would be interesting if remote developers could also participate using Gobby.


Ah well, there's always the next conference. ;-)

Sunday, November 05, 2006

Fix for broken vmware console after upgrade to Ubuntu 6.10

If you upgraded to Ubuntu 6.10 and you suddenly find that you can't run vmware-console anymore, here's a solution from the ubuntuforums that you can try.


Create a shell script in your home directory using your trusty editor, name it vmware-console-fix.


vi vmware-console-fix



Edit the script and put this in


LD_PRELOAD=/usr/lib/libdbus-1.so.3:$LD_PRELOAD vmware-server-console


Make it executable.


chmod -x vmware-console-fix


Now when you need to run vmware-console just execute vmware-console-fix


./vmware-console-fix

Friday, November 03, 2006

Why bundle so many javascript libraries in Ajax Helper ?

Here is a list of reasons why Ajax Helper is using two (soon to be three) different javascript libraries.

1) We don't want to reinvent the wheel. We are leveraging code that is actively developed, highly recommended and used by the web development community with open source licenses (GPL, BSD, AFL and MIT). We are not maintaining their code, we are simply bundling them into a package.

2) Grab the Best of Different Worlds. Each javascript library has its strengths and weeknesses. We try to tap into the strengths of each when we write tcl wrappers for them.

3) More Choices. If you think that dojo is better than YUI, you are free to use dojo. If you feel that there should be a wrapper for some very useful functions in dojo that are not in Ajax Helper, you can write them and help the next developer embarking on his/her next ajax weilding openacs web application.

Why use AjaxHelper ?

I would like to make it very clear that you do not need Ajax Helper to use Ajax in OpenACS. It's really just a "helper" for people like me who may not have the patience for debugging cryptic javascript errors.


Here are my top 3 reasons to use Ajax Helper.

1) Easier for OpenACS Developers (at least I hope it is). The intention is to write tcl wrapper scripts around existing javascript functions. The idea is that OpenACS developers will be much more comfortable with server side TCL than front end javascript. The existing wrapper scripts are relatively well documented with links to the documentation for the javascript function they wrap.


2) Batteries are included, javascript libraries already bundled. If you're a seasoned javascript programmer/developer you *might* not find Ajax Helper useful, however, it does bundle the javascript libraries inside www/resources and this saves you the trouble of downloading and housing the javascript libraries separately. Furthermore, I will be making sure that Ajax Helper is updated with the latest from the javascript libraries that are bundled with it. If I happen to miss an update, feel free to holler and let me know.


3) Get Results Fast. If you're not the academic type who would like to find out what XMLHTTP is and you just want stunning effects and useful ajax on your OpenACS web apps, look no further. Check out the tutorials and the api-doc for ajaxhelper.

Basic Effects
http://www.solutiongrove.com/blogger/one-entry?entry%5fid=266153
http://www.solutiongrove.com/mashup/tutorial1

Using Ajax
http://www.solutiongrove.com/blogger/one-entry?entry%5fid=266155
http://www.solutiongrove.com/mashup/tutorial2

Drag and Drop
http://www.solutiongrove.com/blogger/one-entry?entry%5fid=268010
http://www.solutiongrove.com/mashup/tutorial3


Evesdropping on the OpenACS Conference at Boston

I could not get myself to visit Boston for the OpenACS conference but Caroline was kind enough to turn on Skype for me to evesdrop on the second day of the conference :-)


Caroline and Dave did a presentation for me with the slides I made here.


I heard a couple of questions which I don't think I was able to help answer due to time constraints, a relatively slow internet connection (Dave's latptop was connected to a VNC server running inside a vmware virtual machine on my PC which is all the way here in the Philippines) and my slow typing skills.



What I'll do is to answer a couple of them here in my blog.

Wednesday, October 18, 2006

Installation Notes : AOLServer 4.5


I compiled and installed a copy of Aolserver 4.5 with Postgresql and OpenACS successfully last June 2006 when it was released. Now I am trying to do it again and found myself stuck and unable to recall all the things I did during my last installation. Luckily the OpenACS forums is littered with people asking questions about setting up AOLServer 4.5.


Here's my step by step on a Suse 10.1 virtual machine with Postgres 7.4.13 already installed.


1) Login as root


2) Download and install tcl



cd /usr/local/src
wget http://heanet.dl.sourceforge.net/sourceforge/tcl/tcl8.4.13-src.tar.gz
tar xfz tcl8.4.13-src.tar.gz
cd tcl8.4.13/unix
./configure --enable-threads
make install


3) Download, apply ns_conn patch for background delivery and compile AOLServer


mkdir /usr/local/aolserver45
cd /usr/local/src
wget http://umn.dl.sourceforge.net/sourceforge/aolserver/aolserver-4.5.0-src.tar.gz
wget http://media.wu-wien.ac.at/download/aolserver45-nsd-conn.patch
tar xfz aolserver-4.5.0-src.tar.gz
cd /usr/local/src/aolserver-4.5.0
patch -p0 < ../aolserver45-nsd-conn.patch
/usr/local/bin/tclsh nsconfig.tcl -install /usr/local/aolserver45
make install


4) Check out and compile ns_postgres


cd /usr/local/src/aolserver-4.5.0
cvs -z3 -d:pserver:anonymous@aolserver.cvs.sourceforge.net:/cvsroot/aolserver co nspostgres
cd nspostgres
make AOLSERVER=/usr/local/aolserver45 POSTGRES=/usr/local/pgsql ACS=1 install


5) Check out and compile ns_cache


cd /usr/local/src/aolserver-4.5.0
cvs -z3 -d:pserver:anonymous@aolserver.cvs.sourceforge.net:/cvsroot/aolserver co nscache
cd nscache
make install


6) Check out and compile ns_ssha1


cd /usr/local/src/aolserver-4.5.0
cvs -z3 -d:pserver:anonymous@aolserver.cvs.sourceforge.net:/cvsroot/aolserver co nssha1
cd nssha1
make install


7) Download and install TDOM


cd /usr/local/src
wget http://www.tdom.org/files/tDOM-0.8.0.tar.gz
tar xvfz tDOM-0.8.0.tar.gz
cd tDOM-0.8.0/unix

Uncomment and edit a line in CONFIG to match your setup

../configure --enable-threads --disable-tdomalloc
--prefix=/usr/local/aolserver45 --with-tcl=/usr/local/lib

Run the config script and make install

sh CONFIG
make install


8) Download and install xotcl


cd /usr/local/src
wget http://media.wu-wien.ac.at/download/xotcl-1.5.2.tar.gz
tar xfz xotcl-1.5.2.tar.gz
cd xotcl-1.5.2
./configure --enable-threads --enable-symbols --prefix=/usr/local/aolserver --exec_prefix=/usr/local/aolserver --with-tcl=/usr/src/tcl8.4.13/unix
make
make install-aol


9) Download and install libthread


cd /usr/local/src
wget http://umn.dl.sourceforge.net/sourceforge/tcl/thread2.6.5.tar.gz
tar xfz thread2.6.5.tar.gz
cd threads2.6.5/unix

Uncomment and edit a line in CONFIG to match your setup

../configure --enable-threads --disable-tdomalloc
--prefix=/usr/local/aolserver45 --with-tcl=/usr/local/lib

Run the config script and make install

sh CONFIG
make install

10) Download and uncompress tcllib from http://sourceforge.net/projects/tcllib/
cd /usr/local/src
tar -xzvf tcllib-1.9.tar.gz
./configure --prefix=/usr/local/aolserver45/ --enable-threads --enable-symbols --enable-gcc --enable-shared
tclsh8.4 installer.tcl -no-wait -no-gui -no-examples -pkg-path /usr/local/aolserver45/lib -no-apps

References :

http://www.openacs.org/doc/current/aolserver4.html
http://www.openacs.org/forums/message-view?message_id=481781
http://openacs.org/forums/message-view?message_id=457933
http://openacs.org/forums/message-view?message_id=487137

Monday, September 25, 2006

Dengue Lessons

My younger brothers, the twins, caught the disease this week. Needless to say they were confined for 3 to 5 days at the hospital.

In honor of their being discharged I've compiled a list of lessons learned from this experience.

  1. An unexplicably long fever. If you have fever that comes and goes in a span of 2 to 3 days, don't wait, get a blood test, quick. I mean NOW!!!
  2. CBC. A complete blood count or a blood test is the only sure way to determine if you have the disease. A platelette count lower than 150 means that you could have the disease. My brother's platelette count was an alarming 50.
  3. Pesky Mosquitos. Keep a stock of mosquito repellant lotion. The disease spreads thru mosquito bites. Even if it's not dengue season, make it a habit to dab some on exposed skin before the late afternoon, that's when they bite.
  4. Fluids and lots of it. Dengue is caused by a virus. The only way to fight it is with the body's own immune system. When you get confined, the first thing they do is stick you with dextrose. If you're strong enough to drink water, drink lots of it.
  5. a Doctor in the House. It pays to have a doctor in the family. They're always on call for the members of the family. A pleasant bonus is that doctors and nurses who treat you at the hospital will be extra careful when they find out that you have a doctor in the family.

Monday, September 11, 2006

the 5th reason for virtualization

I just noticed that I have only 4 out of 5 reasons for liking virtualization .

Today a friend Vinod encountered some difficulty while installing Ubuntu on VMware server. The problem maybe related to his cd burner.

He has the ISO file. He burned it on CD and was trying to install it on a virtual machine.

I told him that he could skip burning the cd and just configure the virtual machine to read the ISO file ! :-)

That's my reason No. 5. It's easy to install a new operating system, you don't need to burn a CD , just change the settings for the virtual machine to read from the ISO file.


Friday, September 08, 2006

So you wanna be a Public Speaker

I started learning the art of public speaking in high school.


I was pretty much an introvert, I never understood why my class would vote a "silent type" to represent us in a public speaking competition. The only two reasons I can think of are (1) no one wanted our class to win and (2) no one wanted to represent the class so everyone figured the "silent type" would be silent enough not to object.

I could be wrong on both counts, in which case, the people who voted for the introvert to participate, really believed that he had it in him :-)



I think I did. I won first runner up on my first competition and I started participating in a few more.


I have to thank my adviser and my classmates at the time. They provided the opportunity and the encouragement. I just had to muster up enough confidence.


I doubt that I will ever be as good as these poeple in TED. I'd be lucky if I could at least have a quarter of their wit, presence, impact and humor on stage.


My favorites so far include :


Wednesday, September 06, 2006

The Long Tail applied to Job Boards

I have rediscovered Joel Spolsky's blog. This is an interesting way of looking at job boards. Reading the article, it kind of reminds me of the concept of the "Long Tail".

Hmmm I wonder if the OpenACS community should open up it's own job board :-)
Seems we have a fair share of forum posts looking for OpenACS coders.

Tuesday, September 05, 2006

Meeting Meebo

Being in the web development industry, I really ought to be more security conscious. I showed meebo to a friend a few months back. His first reaction after seeing the log-in page was ... "yeah right, like I'm just going to type in the passwords to all my IM accounts".


It occurred to me later that he probably thought that I was trying to "phish" his passwords.


Phishing is indeed one of the things that you need to look out for when surfing online but so are companies that are just plain "evil". These companies exist online to extract statistics, marketing trends and user information from people that sign up to their so called services.

Don't get me wrong, gathering information about your users is not evil. It's when they sell it or use the information without explicit permission, worse still if they sneak that little detail in the "terms of service" which no one bothers to read. When they do that, it's not just sneaky, it's plain evil.


Meebo doesn't seem to be that type of company.


I read their meeblog once in a while and I like how their blog articles are posted. It makes me wonder if all of them are excellent writers or whether an editor reads thru them first before they get posted. Either way, I find that the style of writing is informative yet casual, almost endearing at times :-) This is a recent example.


The about page is another one to like. These people don't hide themselves behind a brand name, a mission statement or a company logo. They put themselves out into the open and post pictures of themselves with clever captions. It's the people that make the company and not the other way around.

Friday, September 01, 2006

What's the fuss over COMET

A friend of mine, who works at a gaming firm, and I were chatting about the recent buzzwords that we have been hearing about on the web.


I was describing COMET and how it differs from the behavior of the web as we know it today. As I was mentioning how COMET keeps a persistent connection between the browser and the server, he raised the fact that it's the case too for Massive Online Multi-Player games where the game client needs to keep a persistent connection with the game server to communicate game status, statistics and other game information.


This got me to think. COMET is not a new concept and yet there are many who think that the next "Holy Grail" of the web, the next killer web app is one that actually uses it and uses it well.


Then, it dawned on me. It's not the technology per se that has everybody hyped but rather where it is implemented.


It's all about the "universal client". The one software that you find pre-installed on any operating system on this planet. The one client that every computer user has access to and knows how to use. The Web Browser.


To play a game of Ragnarok, you need to download a client in the 5 to 10 MB range. You need to install it on your computer and configure it before you can use it. It's no surprise why gaming firms spend a lot in marketing. This marketing effort even includes giving away free CD's in promotions and tie ups.


Imagine if an MMORPG can someday run comfortably on a web browser using COMET. It will make the games ever more accessible to many more people at much less cost to gaming firms than ever before.


Maybe that day is not too far off.

Thursday, August 31, 2006

Virtualize and be Productive ...

One of the best things that VMware has done in recent memory is to release VMWare Server free of charge for anyone to download, setup and use with no license restrictions whatsover. We may have the likes of Microsoft (http://www.microsoft.com/windows/virtualpc/downloads/sp1.mspx) and Xen (http://www.xensource.com/), both having their own virtualization products, to thank for that ingenious (perhaps calculated) move.


I've been using VMware server since it was released. Here are the top 5 things I really like about virtualization with VMware server in particular.


  1. Compartmentalize. I can create virtual machines for a specific project or for a group of projects. This is nice because it does not mess up the install on my host computer. If the project requires additional software, I can install it, worry free, inside the virtual machine where the project resides. If I completely mess up and break the project, I can delete the entire virtual machine and start from scratch without worry.
  2. Reuse. Each virtual machine can be different from the other but if you're working on projects with pretty much the same setup, you can create one virtual machine and create clones of it for each of the projects that you have.
  3. Remote Access. VMware has 2 additional software that allows you to monitor and connect to a virtual machine in a VMWare server. The VMware server console and MUI. The VMware server console is almost like VNC, only but better because in addition to interacting with the OS, you can also set and edit the preferences of a virtual machine. MUI, on the other hand, gives you control over the virtual machines on the server. It basically allows you to suspend, run or power down a virtual machine thru a web interface.
  4. Pause. This is probably the feature that I like the most. I can literally pause an entire virtual machine and turn off the computer at the end of the day. On the next working day when I power up my machine, I can start right where I left off by.
It's not all a bed of roses, though. I maxed out my RAM to 2GB and got myself an Athlon 64 dual core processor before I felt that I could comfortably use VMware server on my machine. Then again I run 2-5 virtual machines at the same time so you may not need as powerful a rig as that. However, newer computers come with more powerful processors, faster memory and hard disks in the hundreds of gigabytes, so this could be a non-issue on newer hardware.

Update : Seems I forgot reason number 5, it's here

Friday, August 25, 2006

shortcut to delicious and scriptculous

I just discovered the darndest thing today. I have always had a difficult time typing del.icio.us or script.aculo.us on the address bar because I could never pin point where the "." should go in the url.

Well, today, I said to hell with it and typed the whole word "delicious" instead of "del.icio.us" on the Firefox address bar. Guess what, it redirected me to the correct site. Seems to work on Internet Explorer too.

Postgresql Tip : Resizing Varchar Columns

As great as postgresql is, there are little things that you wish could be easier to do. On version 7 of Postgresql, changing some of the column attributes meant that you had to either dump, modify and restore or drop a column and recreate it.

It's because there is no straight forward sql statement to do it. I found this hack that shows you how to resize a varchar column.

Tuesday, August 22, 2006

Guy Reviews the Honda Fit (it's the Jazz to us here in the Philippines)

I just love gadgets. Who doesn't ? When you talk of gadgets, what usually comes to mind is a nifty watch, cellphone or PDA but seldom a car. Imagine my surprise that Guy's first gadget is the Honda Jazz :-)


In the Philippines, the Honda Fit is known as the Honda Jazz. Don't ask me about the name change. My guess is as good as any, but I have a feeling it has more to do with marketing than anything else.


What Guy failed to highlight in the review, and I think this is really important given the rising prices of gasoline, is the fuel efficiency and mileage.


A big oil firm, Petron, in the Philippines ran a promotion touting their unleaded gasoline as the most economical giving the customer more miles in one full tank than any other fuel. Their car of choice was the Honda Jazz. I'll let you guys in on an insider secret .... it's not the fuel.... it's the car !!!


Anybody who owns a Honda will swear by it's fuel efficiency. I drive a year 2000 1.6 Liter Honda Civic and I consistently get somewhere between 10 to 12 kilometers per litre.


Honda really makes great cars.

Sunday, August 20, 2006

Unobtrusive Ajax with Fallback

I found myself trying to remember on which project and which feature I implemented unobtrusive ajax with fallback. So I'm writing it here in case I forget again.


One of our recent clients requested implementing ajax and some nice effects on their blog comments.


I thought it was an excellent exercise to see if it was possible to keep the old way the system added comments, which is to submit a form, and to use ajax whenever the browser supports it.


I was able to accomplish this by using the events library in YUI (Yahoo User Interface).


I used the addlistener function to add the javascript that performs the ajax call that adds the comment.


I pretty much left the original form intact, meaning there is still a method and action attribute. I prevented the default behavior from firing by using Event.preventDefault().


The beauty of YUI is that if javascript is turned off, the form will do a normal submit to add the comment instead of calling the ajax function.

Wednesday, July 26, 2006

Two articles that prove that Linux is here to stay

... and why Windows will eventually but gradually meet it's demise :-)

http://www.kroah.com/log/linux/ols_2006_keynote.html
http://pcmag.com/category2/0,1738,3574,00.asp

Wednesday, July 19, 2006

job candidate interview and car alarm troubles

I was asked to meet someone for lunch yesterday. He is a candidate for a programming job at Solution Grove. Caroline sums him up as geeky and I tend to agree. He's had teaching experience, java experience and more importantly a willingness to learn someting new like OpenACS.

We met at Italianni's. I was hoping it was going to be quiet as it's a tuesday. Boy, was I wrong. It was jampacked filled with people by the time we finished.

A few minutes after the meeting, as I was on my way to the parking lot, I fumbled for the car alarm remote and was shocked. The screw may have somehow slipped and the mechanism inside the plastic casing was gone.

It was extremely embarrassing. I had to prove to the guard that the car was mine. I showed him the keys and the car park ticket. I was able to stop the sound by opening the hood and disconnecting a wire but that did not allow me to start the car. Fortunately, a nice gentlemen knew how to disarm the system and did so for me. I offered him a reward for his trouble but he declined. Very nice fellow.

The first thing I did afterwards was to replace the whole alarm system. There was no way to get a new remote as the current system does not support programmable frequencies. Even worse, if someone had gotten the mechanism from the original remote then they would have been able to open my car.

The new system cost me about P2300 but it seems worth it. It uses a very bright blue LED, nicer remote and best of all it has an emergency disarming feature. If I had lost the remote but if I still had the key, I could disarm the system by (1) opening the car with my key (2) press the brake pedal as I did the following (3) put key in ignition on ACC (4) turn it from OFF to ON 10 times.

I now keep that manual in the glove compartment of the car ...

Lesson learned :-)

Sunday, July 16, 2006

Free Guitar Tabs

One of my fondest memories of high school was with a guitar.

I remember it quite vividly but not vividly enough to remember the song, the day or all the exact details, just that it was practice for mass.

I graduated from a catholic high school. We have mass every now and then to celebrate certain events in the church calendar. Again, I can't seem to remember what it was.

A class was usually picked to host a mass. I beleive our class was chosen. It was my 3rd year in high school. Being host meant our class made the preparations, chose the songs, lead the readings and, of course, the singing. This particular celebration was particularly important, it seems, because our values ed teacher gave us the period free to practice the songs.

One song was written with chalk on the blackboard already.

I remember looking out the window that day. In my minds eye I can see the grasses in the vacant lot on the other street, they were brown and dry, it must've been a hot, sunny and lazy afternoon. The weather was probably getting to everyone because no one was practicing.

I must have been crazy because I asked a friend to play the song on the blackboard with the guitar with me. He was hesitant at first but after some convincing he agreed. It was a crazy idea because I am not exactly a very good guitar player. I knew the chords but strumming was all I could do.

Luckily, that was all the song called for, strumming.

I just started playing the chords with him. I do not know why and I can't exactly remember how but I found myself strumming the chords and singing in tune ... and everyone in the room was singing with me. My writing probably could not do justice to what I felt while I was in that moment. I remember the feeling well because my best friend at the time was smiling at me and loooking at me like I've never seen him look at me before, as if I was doing something incredibly different or amazing. Probably the better description is something "out of character".

Sometime during that, I had wished that the song did not end but when it did, I remember that it ended loud and everyone was happy.

Anyway, we did not have the internet back then. We had to get the tablatures and chords from magazines and song hits. Today, in the age of informaiton, they are freely available and downloadable from the internet.

the concept of an "Unconference", and I did not misspell

The single most important variable to the equation that will make this a success is when passionate and knowledgable people who have something in common come together and meet. It's almost natural. It's amazing.

Saturday, July 15, 2006

my Athlon X2 is now officially yesterday's big news

Just barely six months after I got myself an X2, Intel decides to ship dual cores that beat the crap out of them. Sigh ....

Vmware and Ubuntu, my virtual cpu is losing ticks

I have been having problems with Ubuntu 6 on vmware recently.

I run a virtual machine where all my current web development projects are installed and running. The web files are exported to this virtual machine thru NFS.

Just this week the NFS client on my virtual machine would complain that the server has stopped responding and connection is timing out. This caused my web applications to hang and the web server to just stop serving pages.

I noticed 2 things.

(1) the date and time on the virtual machine kept getting out of sync with my host operating system

(2) I saw a weird log entry that said that my "...CPU is losing ticks, checking if CPU frequency has changed"

Almost everytime my web applications hung, it woud be because NFS stopped connecting and in almost all cases I saw both symptoms.

After losing some hours over this, I found an article over at the VMware knowledge base about it.

What ended up fixing it for me was:

(1) make sure vmware-tools was syncing time with my host operating system

(2) added the "clock=pit" to the kernel bootup parameters.

I run Ubuntu 6.06 with a server kernel. I meant this virtual machine to be a server so no X-windows or any such GUI is installed. That turned out to be a problem with configuring vmware-tools to sync time with the host OS.

It seems the solution to that one was to edit the .vmx file for the virtual machine and setting tools.syncTime to "TRUE".

Update : Interestingly, technologies like speedstep and cool n' quiet can also cause this problem. Check this article out. Try turning off speedstep and/or cool n' quiet from the BIOS and see how it works.

Time for new headphones

My head phones of 1 year and a half have snapped, literally.




It's a labtec worth P1000.00. Does anyone have any idea on how to salvage them ?
The mic and headphones still work great. Its just that I can't put them on my head anymore.

New DSL Modem

My old modem was a speedstream. The new one seems only to be branded PLDT (my service provider). Underneath I read Model No. PL-DSL2.




This is what my old modem looked like.


My worst nightmare came true ... dial-up.

My worst nightmare came true this week. I went back to using dial up internet.

It was the wind. There was a lot of rain too. The real culprit, however, were the power fluctuations. Since last week friday up until the middle of this week, we've had at least one power outage a day.

Last saturday, there was one in the morning. I was not at home when the power came back. I was at the new V-mall shopping center at greenhills buying a telephone set (more on this on my next blog).

My brother turned on the power strip and the UPS. The router turned on, my pc was brought back to life but the modem remained off. My brother called me on the cell and told me the bad news.

I asked him ....

Did you try a different power outlet ?

Did you turn on the switch ?

Did you make sure the power cord is plugged in right on both the modem and outlet ?
... but to no avail.

When I got home, I checked the device again myself. As if to resuscitate the dead, I shook it and tried all the things I had asked my brother to do over the phone, but to no avail.

Henceforth I was on dial up and my worst nightmare had come true.

Sunday, July 02, 2006

To watch or not to watch ? that is the P350 question.

It's a long weekend in the United States, they're celebrating independence day. My Boss is out camping and I'm guessing with the lack of support tickets since friday evening, most of our clients are out too, making the most of it.

So what to do on a long hopefully uneventful and quiet weekend. My first choice was to hop myself over to the recently opened SM Mall of Asia and watch Superman Returns on Imax.

The mall is just 30 minutes away from the house via the coastal road. I've been there thrice. While it seemed humongous on my first visit, it somehow did not feel that way on my subsequent trips. Maybe it's because you start to remember where all the shops are, where to go and how to get there.

As it turns out, tickets for the IMAX experience is P350 per person. Stingy as I was, I asked "what's so special that I have to pay P350 for a movie ?". Apparently, you get to sit on a lazy boy and some 3D glasses. What ? No free pop corn :-) This blogger thought it was worth it, though.

Sunday, June 11, 2006

HOW TO: Build your memory by 'Pegging'

This is a great in-depth article on an effective memorization system called pegging. The first thing that you need to do in order to learn how to peg, is to memorise the basic phonetic sounds that will be used to represent the numbers 0-9. To speed up your mastery of this number/letter code, I have offered a few memory aids.

It's extremely cool and unbelievably easy. I am trying to get the 100 common peg words into memory but I think it will take a fair amount of practice to automatically transform a series of numbers into images and commit them to memory.

read more | digg story

Mark Shuttleworth almost strip searched by US customs

"When Ubuntu founder Mark Shuttleworth recently traveled to the US, he was declined entry and almost strip searched! (He refused, and they relented). Furthermore, he now has to fill out a visa application form for "people with a criminal record" every time he wishes to travel to the US."

Obviously the customs people do not use Ubuntu :-)

Seriously, though, I find this a rather large coincidence. I am applying for a B1/B2 (for those who don't know, a tourist/business visa) from our local embassy. I'm not worried anymore about getting declined on the interview, now I'm worried that I'll get rejected right at the airport when I arrive.

read more | digg story

Working in the US

Read the comments.

It is fascinating to read the comments that people have about foreigners working in the United States, about the h-1b visa, about how the system supposedly protects local workers and how it is sometimes abused by US companies.

I consider my self blessed because I work for a company in the US and yet I have not had to set one foot in US soil. All of my work is done online thru e-mail, instant messaging and ssh. I doubt that my salary is at par with US software engineers because that is my edge, living in the Philippines. It is, however, competitive when compared against local salaries. There are no health benefits and things like that, but I do get to work at home and time is pretty flexible.

Thursday, May 18, 2006

Finally 64-bit Dual Core Laptops

Now I am happy that I did not jump the gun and buy a macbook pro.

Wednesday, May 17, 2006

AOLServer, XoTCL and Comet

Before the buzzword COMET was coined there was xotcl, a patched aolserver and Gustaf Neumann's background delivery and streaming modes.

http://www.openacs.org/forums/message-view?message_id=389271

Now I have got to find the time to play with this !!!!!

Sun To Open Source Java

I think it's about time. This is what will bring Sun out of the rut it's in right now.

Friday, May 05, 2006

Filipino mom to ask for public apology

This little incident is a perfect example of how something possibly trivial can go way out of hand. It also shows how much influence the press has on people and why journalists have such a great responsiblity to produce fair, accurate and truthfull reportage.

First, let me state my position. I do not know the parents. I do not know the child. I do no know the principal. I have not been to the school or talked to anyone in it. I am a Filipino and I eat regular meals with a fork and spoon. All the information I gather about this incident is from this article and from the many articles posted around the internet about it be it in an online news paper, a comment or blog. It is a position that you, as readers, and I share. We should all remember it.

Children are "children" and no one should be surprised if they act like children during meal time, heck I know perfectly mature adults who act like children in front of the dinner table. It is, therefore, a prerogative to discipline and to guide them about correct etiquitte be it the Canadian or the Filipino way. IF the child was unruly during meal time then the school representatives had every right to impose discipline and reprimand the child for his behavior. I beleive it is their duty to do so.

What concerns me here is that people are so enraged at the comments of the principal and his staff that they may not have stopped to consider that it may not be about the "spoon and fork" but rather the behavior of the child during meal time. It may not be about what utensils the child was using but HOW the child was using them.

The article mentions that the mother has spoken with the principal. What is not evident to me is that aside from the phone conversasion, was whether she had a chance to talk personally with the principal before lodging her complaint.

I empathize with one of the commenters of this article who is vigorously trying to explain that it is a disciplinary issue and not racial or cultural one, for it may very well NOT be about Filipino or Canadian etiquette. It may really just be about a child that has been reprimanded for unbecoming behavior.

The comments of the principal can easily be misconstrued as an attack on the eating habits of Filipinos.

It is also possible that the mother beleives it to be so, an attack on the use of a fork and spoon. None of us can really tell for sure because how it was said is just as important as what was said.

Read more at www.westislandchronicle...

Wednesday, May 03, 2006

LiveScience.com - Walk a Quarter-Mile or Die

It's hard to beleive but the study is compelling.

While it's no guarrantee, the simplicity and ease might just help us monitor our health way better than expensive check ups.

My measurements could be off but this means that if you can walk from Building A to Building B at the Sm Megamall at record time, then you're probably in pretty good shape :-)

Read more at www.livescience.com/hum...