Thursday, April 27, 2006

Houston Astros Rock

It is a slow game Wednesday night: the Astros beats LA Dodgers 4 to 3 after 14 innings! No homerun. I've been in the ball park several times. But this is the first time I get admitted to sit in the club section which accounts for about $40 a ticket. Expensive for a baseball game but you get for what you pay: the view is fantastic and full service is available upon request. In deed, you don't have to get up and buy your own beverage, just make a call and somebody will attend to get your order and bring the drinks for you!

The roof is closed even though the weather is very nice. I guess the management wants to keep noise level high on a weekday game.


I also see president George Bush senior in the game. See if you spot him in the crowd

Wednesday, April 26, 2006

The Chronicle of Gas Price

I remember by the time Rita hit Texas, which is about 9 months ago, I saw gas price was at 3 bucks a gal and people just got in line to get it by hook or by crook. Now, gas price jumps up to 3 bucks again but this time nobody is excited about getting gas. I feel bad for those bastuhh driving big trucks and hummers. Seem like those guys gotta have defibrillators in their in case of getting a heart attack after filling the tanks.

Here is top ten ways to lower gas price brought to you by David Letterman:

10. Sell gas by the half-gallon (same thing with making the barrels smaller!: my idea)
9.
Sneak up to gas stations in the middle of the night and switch the price numbers
8.
Cut out that expensive ingredient that gives it that delicious gas smell (ouch!)
7.
Forget OPEC, start getting oil from Wal-Mart
6.
Step one: Oprah buys all the gas. Step 2: Oprah gives the gas away.
5.
Build time machine, then drive back to 1965 when gas was cheap.
4.
Fill car with root beer. Cars won't know no better.
3.
Release the recipe so people can make their own gas
2.
Drive really fast so you're not driving so long
1.
Invade Iran

And thanks Sonny for those pictures:t




Drunken Good Time

Some photos taken by Ann's camera @ Baker street last Friday. I don't know what in those glasses (besides oldie Jack) Shari gave me but they sure did a good job turning me to a funny guy. To assure you guys I wasn't drunk at all. But it's just me: even with a little bit of alcohol in my blood is enough to make me a comedian.
The dart games were awesome even though I didn't really play them at all. I did hit a bull's eye, didn't I? Hey Ann, where is Kelly's pic?

Those pics I believe had been undergone some major retouching in Photoshop. There is no way I could look that ridiculous :-)

Well, nothing serious, just having a good time and have fun.



"Beer is proof that God loves us and wants us to be happy." ~ Benjamin Franklin

Monday, April 24, 2006

Going to an Opera

A friend of mine recently asks if I would like to attend an opera sometimes on May. The show (The Coronation of Poppea) will be at the Houston Grand Opera.
I've never been in an opera concert before. Partly because I often associate opera with the following assumptions:

1. Opera is only for rich people
2. Opera will put me to sleep
3. Opera is a dead art form, ancient operas are performed over and over again
4. Opera is sung in foreign languages which I don't have a clue

So I search around the web and even go to the Houston Grand Opera website to find out more about this form of performance art. What I could conclude, in retrospect, from the above assumptions are:

1. While getting front-row seats at a top-notch opera theater like the Houston Grand Opera can cost you a month's worth of groceries (over $200) but if you're willing to sacrifice your fantastic view of performers' feet, cheap seats usually available for $40.
2. Not unless you're bored by murders, intrigue, magic, switched identities and star-crossed lovers
3. Just because most operas are ancient doesn't mean it stops attracting people. In fact, the fastest growing opera audience in the U.S. right now is people in their twenties and thirties, so the classics do keep their appeal.
4. It's true that most well-known operas were written in Italian, German or French. Most opera companies now offer translation on stage for the audience. Personally, I think opera is not like watching movies. You can just read the story line before going to the opera. The experience will be more enjoyable!

So I am looking forward to going to this opera show!

For those who wonder how "soap" opera was coined soap opera, here is the reason in short:

In the 1920s, radio was booming, and broadcasters wanted to get advertisers in to increase their station's profits. So radio stations convinced businesses that sold household goods to sponsor radio shows. To appeal to the main consumers of these items -- female homemakers -- the radio stations created the daytime serial drama format. The first radio soap opera ran in Chicago and was sponsored by a margarine company.

Soon, all the networks had shows aimed at women, and companies selling cleaners and food products raced to sponsor the shows. For example, Proctor & Gamble's Oxydol soap powder sponsored a popular serial drama in 1933. By 1939 the press started calling the shows "soap operas" because so many were sponsored by soap manufacturers.

Wednesday, April 19, 2006

Remote Scripting on Google's BlogSpot

Create eye-candy visual effect in web applications requires extensive use of Javascript. There are tons of javascript framework works out there to use. However, I faced one of the most challenging yet fundamental issue in javascript: cross-domain scripting (CDS).

CDS restriction implemented in standard web browsers to prevent the execution of scripts reside in a different domain from the current domain hosting the web applications. CDS restriction's primary purpose is against malicious scripts from being executed at a unknown untrusted domain. If you are familiar with Java Applet, here is a similar analogy: in an applet application, you are literally prohibited from making connections to the outside world differing from your own domain.

In this blog, I will try to explain a way to allow remote scripting with BlogSpot and certainly you can use it with other web application as well.

First attempt: Load the scripts directly (failure)

so you include the remote scripts with the following statements:

<script type="text/javascript" src="http://remote-domain/test.js"/>

And then when you try to call a method in that test.js script, the browser chokes complaining permission denied.

It doesn't work because we can't fool CDS with this trick!

Second attempt: request the remote scripts then load them programmatically (failure)

This time, I try to get the scripts from my local script then attempt to load them in memory using the built-in eval method of javascript 1.4. here is how it works:

<script>

var req;
function loadJS(url)
{

req = false; // branch for native XMLHttpRequest object
if(window.XMLHttpRequest)
{
try { req = new XMLHttpRequest(); } catch(e) { req = false; }

// branch for IE/Windows ActiveX version }
else if(window.ActiveXObject)
{
try
{
req = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
req = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e) { req = false; }
}
}
if(req)
{
req.onreadystatechange = insertJS;
req.open("GET", url, true); req.send("");
}

}

function insertJS()
{
var code = req.getResponseText;
eval(code);
}
<script/>

So you call this method loadJS('http://remote-domain/test.js') and hope it works. No it doesn't! The same error "permission denied" will popup again.

Third attempt: request the remote scripts then define inline scripts using those script (failure)

So I use the previous code to request the scripts from different domain as above. But this time, instead of using the eval method, I create a DOM node to build an inline script tag:

function insertJS()
{
var code = req.getResponseText;
var sNode = document.createElement('script');
sNode.setAttribute('type','text/javascript');
sNode.appendChild(document.createTextNode(code));
}

The browser (IE) chokes at the line
sNode.appendChild(document.createTextNode(code));
Microsoft is smart enough to check that if the element you create has a tag named "script" then you cannnot alter its text value!

A little worthy note here: instead of trying to change the script's text node as above, you can include the script using the following:

sNode.setAttribute('scr',url-to-script);

But this approach brings us back to the first (failure) attempt ! You can use it to dynamically include a serries of JS files though.

Fourth attempt: loading the script remotely (successful!)

So I use something similar to the first attempt. But this time, I change the file extension to .html instead of using .js
Secondly, I concatenate all the scripts into a big-ass file (which I accidentally called bigass.html Tongue out ).
Loading the script as normal:

<script type="text/javascript" src="http://remote-domain/bigass.html"/>

Now everything works like a champ.

I setup a blog call Random hack to test my hack. You can visit the blog to see the hack as I use prototype framework, scriptaculous to create special effect on the page. For the moment, something strange may happen as I change my code everyday.

I do not know for sure why or how it works yet. If you know, please post a comment so everybody could learn.

happy Coding

Comment on Reading Poetry on Blog

If I could choose between...
...reading poetry of a blogger or sticking my finger in a light socket, I'd rather pick electrocution.
...reading poetry of a blogger or getting lost in a middle of a jungle without a map and compass, I would pick getting lost.
...reading poetry of a blogger or eating live grasshoppers, I'd grab some ketchup and start chewing.
...reading poetry of a blogger or vomiting into a bucket only to have it later poured on my body while I am asleep, I rather choose the vomit blanket.
...reading poetry of a blogger or converting the current project to the new "UFO", I rather read the blog :-)

I don't like reading poems created by random bloggers. I don't know why it's so hard for them to recognize that it doesn't make any sense. So to all of your wanna-be-poets, good luck, but you suck!

Tuesday, April 18, 2006

Hacking Blogspot

The nice thing about Blogspot that I prefer over several blogging system (Xanga, LiveJournal...) is that you can do a lot of hacking with Blogspot.
Well, just look at my last blog entry, I screwed the layout completely when I tried to cheat HTML table to render two images in the same row.

And here is my latest hack: post flash content on Blogspot. If you can see the Flash, congrats, I will post more cool flash content here. If you can't, hmmm... maybe you need to change your glasses (or new computer).
If the flash is too anouying, please right click on it and de-select "play".





Monday, April 17, 2006

Amazing Origami Arts

When I was about 7 , my dad bought me a origami instruction book. For some reasons, origami attracts me a lot. Drawn into its magical symmetrical shapes, its offering for a tranquil state of mind I could spend several hours trying to solve a figure.

The art of origami is that each figure has a set of instructions to guide you to the solution. But ultimately you need to practice and work the instructions out. Just like the central principle in Zen Buddhism: the Buddha's text shows you the way to enlightenment, but getting there is your sole responsibility, no one can help you.

These are some origami artwork of Hojyo Takashi. Of course I am far away from making something like those! He is a true master.



























You can download the PowerPoint containing all 35 photos with a very nice background instrumental. Thank you Sonny.

"Hatred does not cease by hatred, but only by love. This is the eternal rule." ~ Gautama Buddha

Gyoza's New Career Move

Gyoza wanted to try out if she's suited to replace Taco Bell chihuahua.

This one is called "bon-bon Jovi" doggie style: hey, what do you call my mother, punk?

How about ESPN swimsuit model without swimsuit

The good the bad, now the... sleepy. Come on, it's just11:00, let me sleep a lit' bit more. I still feel dizzy (probably from hang over last night)

I know how you feel. Just tell me your problem, it'd make you feel better ok.

Can I watch Tv for just a little bit mommy?

I am contemplating the incompleteness of quantum physics.


Oh, happy Easter.
"... Retired generals today gathered to call for Rumsfeld step down. The difference between Bush and Clinton is that president Bush can't control his generals while president Clinton can't control his private." jay leno - Tonight Show


Saturday, April 15, 2006

Anatomy of a Geek Office Space

Okay.. day to day life starts from here. I feel comfortable working in this company because it literally doesn't strictly enforce dress-code. So T-shirt and jean are my usual outfit. Some guys even are more than just casual here: they wear sleep pants or shorts that look like boxers to work too (yes, i'm serious). I remember one time, we had an unexpected client greet and meet event. I ended up going to the meeting with my windpants on. Needless to say, it was so awful (or awesome).

My office space: not really nicely decorated like some forks' here but i feel comfortable and that
means everything, right? Look a bit messy in contrast to my code ;-).
Footnote here: forks who have nice office spaces often don't do "shiite" at work.


And these are some buddies at work: i have to admit that they are word class developers and the brightest group of people I ever met in my life despite the fact that I've been living for only 25 years. Scene like this happens almost everyday at lunch time when most of great ideas in every topic of life is discussed (usually blasphemy :-) , j/k). They are like Socrates, Plato or Descartes to me.

Thursday, April 13, 2006

Google Calendar

Google has just launched a new service called Calendar using only Ajax technology. Although it's still in beta mode like most of Google's services but the interface is very impressive. Ease of use is excellent and the UI is simple but informative.

If you have a Google account, go here to check out this new service:

http://www.google.com/calendar

Or email me to get invitation if you don't have one :-).

Wednesday, April 12, 2006

Bored Graphic Designer

I found some very cool fx photos created by bored desginers in their spare time, enjoy...


Milk, beef, and geography. A triple threat.


KISS panda style



That's what happens when the mouse works too hard



Must be chilly up there for lady liberty

Priceless

Sunday, April 09, 2006

Japanese Festival 2006 - Houston Texas

Location: Hermann Park
Houston, we have a gorgeous weekend! Japanese Festival this year was held on April 8th and 9th at Hermann Park. With two days of clear sky, lot of sunshine and temperature tops 75, we have a perfect weather to get outside.

I came Saturday to help my teammates set up the tents for our dojo- Houston Budokan. Parking space is full even when it's still early in the morning. Only parking to the museum of fine arts, the one next to Presbyterian church, is available. The festival is mainly located around the pool of reflection: the left side serves food and beverage, the right side is mainly for martial art dojos, main events occurs on stages located right after the pool and in front of McGovern lake. My dojo has two performance sessions from 12 to 1 everyday. Sad to say but I think most of the people there look pretty interested in taiko drum performance by Kaminari taiko group. I myself could feel the magnetic power of the strong but spiritual drum beats.

Kaminari Taiko Group (kudo to the fat guy)

My team has a Judo and Karate-do performance session on Saturday. Then after that is Kendo kata demonstration.

Sensei cregg in blue dress demonstrates with a police officer

Some of the strangle technique. Ouch!


Koge and Mark sensei in Kendo kata


Nazumi - 2nd degree black belt. She's exchange student and is practicing Kendo at our dojo. She's getting ready to get on stage for a match.

It heats up a a lot on Sunday. The stage floor gets so hot that we have to keep our flip-flops on when we are on stage and only take them out when we perform. A couple of enthusiastic youngsters have their feet burned. Things get worse when during Jujitsu demonstration, a horrible accident happens: one of my team-mate hits a sensei in his right eye with the shinai (bamboo sword) sending him off stage and out of the demo. Luckily, it just causes a bruise and everything seems to be fine.

Ben Efting with his katana getting ready for Iaido demo. The sword is "live" (real blade).

One thing I notice in the festival: the Japanese really respects the katana - the long samurai sword as shown above. Their eyes never move away from our swords every time they have to go across us. In addition, they usually make a big circle and go around us to pass instead of walking by our side. I ask my sensei about this and he explains that in Japan, the sword is considered as dangerous as a firearm. Apparently, American people never feel the same way :-).

By the way, I have seen some of my friends purchased katanas for decoration purpose (dull blade) and they usually place the swords wrongly. The correct position should be made so that the blade is curved upward instead of downward. This is to maintain the sharpness of the blade as shown below:

And also, the way one places the hilt (tsuka) makes a significant indication of his/her hospitality! Placing the tsuka on the left side as shown above indicates that the guests are welcome to enter the house anytime they want. Placing it on the opposite side often means watch out for your heads. Why? Because you can easily draw the katana out of the scabbard (saya) if you set the hilt on your right hand! Little detail can change the context completely.


Time for the dual demo:

Brett (left) and I

Nazumi executes a wrist cut.

Phew! A little shade is very much appreciated as we prepare for the next event: carry the shrine around the park.


I wanted to hold the flag but Carlos (the guy in blue standing next to me) got it back when I went to the restroom. What could I do, he is in a higher rank than i am!

Hey Ben, nice fans, pardon us for the portable toilets in the background!

The shrine is right behind us. Made completely in gold (14K i think) and costs about 15 grands. We borrow it (of course) from the Japanese Society of Kendo in Houston.

matching thru isle of food kiots.



After all of that, i finally have my own time to shop around for food. I have about 20 coupons ($1 each) - free for dojo students, and bought another 20 from Ben for 25 cents each. Enough coupons to feed my hungry and growling stomach.

Fresh sushi in this condition? Hard to believe...

After babbling for about 5 minutes trying to explain to those Japanese girls that I like to take picture "with" them, they all gather for me to take a shot withoutt me. I guess they don't understand what I say... Agrigato gozaimasu.


Oh.. Thank you all of my friends for coming over and support us! Specially Sam Sam :-). I love you.


"Some day, when I'm awfully low,
When the world is cold,
I will feel a glow just thinking of you...
And the way you look tonight."
Frank Sinatra