Saturday, May 30, 2009

ExtJS Tip : Dynamically change a button icon

This works for ExtJS 2 or higher. Oddly, there is no method in the button class that allows you to change the icon dynamically. This is useful if you want to reuse buttons in the toolbar for example.

I found an override from this forum post which worked for me after a few tweaks.

Ext.override(Ext.Button, {
setIcon: function(url){
if (this.rendered){
var btnEl = this.getEl().child(this.buttonSelector);
btnEl.setStyle('background-image', 'url(' +url+')');

Friday, May 29, 2009

An exercise in Metacognition ... computer for sale ads

A Facebook buddy posted this as his status ...

60K PHP for brand-new MB466,2.0 GHz, IntelCore2Duo,160GB DDR3 Memory, 160GB HD, NVIDIA GeForce 9400M graphics, stndrd kbrd, aluminum unibo

What went thru my mind during the first few seconds of reading ....
  1. 60K PHP ? Kinda expensive for a PC
  2. Is this a laptop or desktop ?
  3. MB466 ? must be the model number of something.
  4. 2.0 IntelCore2Duo ? really expensive PC, I could probably assemble an entry level Core i7 with 60K
  5. 160GB DDR3 Memory ? WOW must be a server or workstation.
  6. aluminum unibo ?! Great Scott ! It's a Mac !
What I learned about myself ....
  1. I immediately knew it was an ad for a computer.
  2. I focus too much on the price, so much so that it influences everything else about the ad, maybe that's why I don't have a Mac :-)
  3. I don't know the specs for a Mac when I see one.

Tuesday, May 19, 2009

Reusing Coffee Grounds

A couple of months ago I got myself a coffee press and started trying out different blends from my local Starbucks.

All this time I've been throwing away the coffee grounds when I could have been using them for something else.

According to the Natural Home Magazine article that this Lifehacker blog post points to, used coffee grounds can be used ...

  • as deodorizer for your refrigerator
  • dish washing pad
  • as fertilizer
  • as a facial mask
Uhm, I probably won't try that last one :-)

Tuesday, May 12, 2009

the Star Trek reboot

Firstly, I think it shouldn't be called a prequal. It's probably fashionable to make prequals after the "Star Wars" movies but this is by no means a prequal.

I would rather call it a retelling of sorts.

What if James Kirk grew up without a father ?
What if Spock is more emotional than logical ?

Star Trek : The Next Generation (TNG) was the series that turned me into a "trekkie". Prior to watching that series, I had no idea who Captain Kirk was, let alone Spock. Truth be told, I fell in love with the Star Trek of Capt. Jean Luc Picard in the 24th century because of the tech. I was fascinated by the comm badge, the hypospray, VISORS, dilithium crystal powered cores, holodecks, warp drive engines, force fields and the LCARS console.

Apparently, though, I'm not hard core enough a "trekkie" because I've been trying to get myself to watch reruns of The Original Star Trek series (TOS) but have failed miserably to finish a single episode.

I did not like the original TV series but I definitely liked watching this Star Trek movie. Yup, I liked it, in spite of the flaws in the story telling and the scientific inconsistencies.

Oddly, I liked it not for the same reasons that I liked watching TNG (the tech) , Heroes (super powers) or Fringe (mystery behind William Bell), nope I liked it because ...
  • James Kirk seems more complex and driven. He is motivated to live up to his parallel self in the other timeline.
  • Spock is not stubbornly logical and is giving in to his human side.
  • Bones' colorful rhetoric, specially when he's upset.
  • Chekov, Scotty and Sulu for the comic relief
This was my first time watching a movie on IMAX, btw. I can't say I liked it very much. I thought the screen was too close and too big for me to see all the action.

I DON'T want free laptops from Sony Ericsson

I got 3 forwarded e-mails urging me to forward the e-mail to 8 people for me to get a free Sony Ericsson laptop. As a bonus, if I send it to 20 people, I get a higher spec'd Sony Ericsson laptop.

I hate to break it to you folks but Sony Ericsson makes cellphones. Both the T18 and R320 are retired cellphone models from Sony Ericcson.

A quick google search got me to the following links, all of which says that this is a big hoax !!!
So please stop forwarding these e-mails because no one is getting a free laptop from this. It's not clear what the intent of the perpetrators are but one thing is for sure, you're exposing yourself and your contacts to people you do not know. Internet marketers are the least of your worries, there are spammers, hackers and worst of all identity thieves to contend with, so please think before you click "forward".