ARCHIVE: November, 2007

You know it’s funny that I read a similiar article for last year’s nominations forwarded by a friend. He told me to check out some of the young entrepreneurs in the region. I remember how I admired them, yet couldn’t stop to envy them for starting out at such a young age.

At that time, I had just started Pluit Solutions, and BookJetty was still a pet project; deep inside, there was a slightest hope to be shortlisted before I pass the age limit.

And believe it or not, yesterday’s morning, on BookJetty shoutbox, Isaak said, he spotted me in BusinessWeek.com, shorlisted as one of the 25 finalists for Asia’s Young Entrepreneurs.

I couldn’t be more happy than this, I was ecstatic, close to jumping up and down, not just for being featured, but at least for the re-assurance that the steps I took are leading me forward.

BusinessWeek's Asia Young Entrepreneurs

It has not been easy to start on your own, to run a business, to build a product, to bootstrap, to be frugal, to be wise, to take risks, to make mistakes, to learn, and to endure.

There are days when you wake up in the morning, feeling afraid that you may not have made it. Thus it is comforting to be acknowledged once in a while, and let it be the extra fuel for more late nights to burn. :)

BusinessWeek's Asia Young Entrepreneurs

PNG Image Fix For IE

SUN, 18 NOV 2007

If you are a web designer, you know that PNG image rocks for its fine transparency support. But lacking of support on IE6 and below, probably has gotten into your nerve at some point of your life.

The journey for PNG image fix on IE has started long ago, and it all voices back to the use of AlphaImageLoader filter hack.

<div style="height:400; width:400; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.png', sizingMethod='scale');"></div>

Some guys wrote Javascript codes to automatically reload PNG images found in image tags with AlphaImageLoader, an example would the pngfix.js by Bob Osola, the first you will find if you search for “PNG fix” on Google.

But the problems with Bob’s script, it fixes only the <img> tags, how about your <div> tags with PNG image background, and if you have small images, like an icon that I had with 12px height, the width and height will be distorted.

That will lead you to find a better solution to solve these two problems, and you may have bumped into TwinHelix IE PNG Fix or other similar solutions.

It fixes both <img> and <div> tags, and solve the width and height distortion through the use of blank.gif. On top of that, it uses a clever way of calling the javacript codes through CSS behavior attribute, supported only by IE, which gives you more choices on which element to fix.

img, div.img {
    behavior: url("pngfix.htc");
}

And human is definitely an amazing creature, whom can not be easily pleased. Two weeks ago, Rogie King from Komodo Media, published a clever way to PNG fix through CSS. Now you do not even need an external file, such as pngifx.js or pngfix.htc.

The concept is similar except it is neater and cleaner, and the javascript codes are compacted and called inline from behavior attribute. After all, PNG images are more of a styling issue, thus putting the fix under CSS seems to make more sense.

* html img,
* html .png {
  azimuth: expression(
    this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none",
    this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='image')",
    this.src = "/images/blank.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''),
    this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "', sizingMethod='crop')",
    this.runtimeStyle.backgroundImage = "none")),this.pngSet=true
  );
}

This is the best I’ve seen so far to solve my PNG image transparency issue, probaby yours too. Thank you Roque.

UPDATE:

Here are the quick step-by-step instructions, as requested by some:

  • Download pngfix.css, file created for your convenience.
  • Download blank.gif, a transparent 1×1 pixel image to help out with the fix, mouse right click and save it to /images folder.
  • If you store blank.gif in other folder other than /images, please edit pngfix.css to relect blank.gif location.
  • Copy the following code snippet and paste it in your HTML source codes, inside <head> tag, to load pngfix.css only for IE 6 and below; IE 7 doesn’t have PNG transparency issue.
    <!--[if lt IE 7]>
      <link href="/stylesheets/pngfix.css" media="screen" rel="stylesheet" type="text/css" />    
    <![endif]-->
    
  • That’s all, for all <img> tags with transparent PNG images will be automatically fixed, while for background images defined in stylesheet, you will need to add "png" class name to the respective elements, e.g. assuming that “flower_bg” defines a transparent PNG background
      <div class="flower_bg png">
         Hope you get a clear picture now.
      </div>
    

TIP:

On some cases if you have a lot of <img> tags with only a few of them are transparent images, you can choose to remove * html img selector for performance reason (remember to remove the comma as well). Without that, you would have to add "png” class name for <img> that needs the tranparency fix.

UPDATE 2:

Original script may cause redundant background ‘none’ call to the server, which may be shown as page not found or server error in the access log. I did some fixes which solve this issue, more about this issue can be found here. Here are the updated version, I’ve also updated pngfix.css, the downloadable version.

* html img,
* html .png {
  azimuth: expression(
    this.pngSet?
      this.pngSet=true : 
        (this.nodeName == "IMG" ? 
          (this.src.toLowerCase().indexOf('.png')>-1 ? 
            (this.runtimeStyle.backgroundImage = "none", this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='image')",
                this.src = "/images/blank.gif") :
            '') :          
          (this.currentStyle.backgroundImage.toLowerCase().indexOf('.png')>-1) ?
            (this.origBg = (this.origBg) ? 
              this.origBg :             
              this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''),
              this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "', sizingMethod='crop')",
              this.runtimeStyle.backgroundImage = "none") :
            ''
        ), this.pngSet=true
  );
}

My Grandparents

FRI, 2 NOV 2007

My grandparents migrated from China on a boat in the late 1930s. Grandma said they were still a kid, and they were running away from war.

They landed on a small village, southern east-coast of Sumatra. They got married in their teen, she has 11 children, 9 daughters and 2 sons. I always find it amusing whenever I told anyone about how many children they have, well, enough to form a soccer team.

They lived in the village for many years, even after all their children had settled down in other towns, they insisted to stay. Until one day a thief broke into their house and grandpa was stabbed on his upper arm, they decided to move to my hometown.

Grandma is the more friendly and chatty type as compared to Granpa, her smile was wide and warm whenever I visited her. At 5-feet tall, probably shorter, she looks really small when she stands beside grandpa, who is towering at 6 feet.

I love talking to grandma, I like to ask her about the past, how was life like during the war and how they used to live their every day life.

One thing that she always said, we all are vey fortunate today. She said basic need like rice, which now we can get easily get from any neighbourhood market, triple AAA grade, imported from Thailand, some even pre-washed. For them, they had to plant themselves.

I remember how she smiled, recalling how tiring it was to plant paddy fields. She said, even after the harvest, they still had to winnow the rice grains, they had to wait for wind to blow the chaff way. How afraid they were many times, when they had to hide under the bed after a gun shot from a distance. How meals could be so simple by just eating tapioca.

Though life is much better today, it may not be always rosy. Not long after they moved to my hometown, grandpa got a stroke, and that left him with half of his body paralyzed, and he had to be wheel-chair bound. Being wheel-chair bound in a small town in Indonesia, where the roads and streets are not disabled friendly, that leaves you with no choice but being confined at home most of the times.

Granpa became really quiet, he hardly spoke more than two words when I visited them, one to acknowledge me when I arrived, and the other when I said good bye. He preferred to spend his days resting on his bed, or on his wheel chair behind an open gate, by the road side, watching people, vechicles and the crowd passed through the time. He always looked sad and weak, and that goes on for a few years.

Last week, when I went back, he seems to be a changed person, more energetic and lively than before, finally I was able to see him smile again when I greeted him.

When he wanted to go out to the yard, Grandma pushed him on his wheelchair, my wife, and I tagged along. We had small conversations, he replied with his soft husky voice, hardly audible, grandma had to bend down, put her left ear close to his lips, she would interpret for us when explaining what granpa had just said, often with small laughters.

I asked her who shaved grandpa’s beard, she proudly said I did, I asked her who cut granpa’s hair, she moved her fingers tidying grandpa’s short hair, she smiled and said I did.

Her small gestures showed how much she loves grandpa, I was proud with her, I saw before my eyes, what wedding vow means when we say through sickness and health.

It is sad that life has to ever grow old, and how I wish granpa is able to walk at his old age. Yet life is always unpredictable, bad things do happen at the unexpected times.

Maybe simple things in life, now I shall learn to cherish each day, to be able to stand up, to walk, to move my fingers, I shall learn to be grateful.