Thursday, April 27, 2006
Houston Astros Rock
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
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
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
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
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: