Archive for November, 2006

Businesses and Opportunities

Wednesday, November 29th, 2006

Every business venture has its risks. With these risks, sometimes opportunities for great wealth can also occur. I always frown upon entering into businesses that deal with inventories for the simple fact that these inventories can become financial liabilities if they are not properly handled — the usual headaches of having to have the money up front* to acquire the inventories and the need for a place to store them. And that’s on top of insurance, transporation, competition… etc.

But the “wealth” part of the business I just can’t ignore… Case in point: An old friend approached me a couple of weeks ago asking me to acquire some parts for the company he’s working at. Even though there were only around 300 parts I had to acquire for him, the markups were exceptionally good given his fixed budget I had to work with. Within two days of Googling and a few phone calls for prices, I was able to net enough money for two whole month’s worth of rent + all expenses! And that’s just ONE small deal! I can only enviously imagine how much BIG deals would bring for people who do it for a living… All of a sudden, I understood why virtually all of my and my parents’ import/export friends are sitting pretty with their huge flat screen TVs and huge houses.

On the other hand, my inventories had somewhere to go immediately upon me receiving them. It’d be a different story if I had to find places to offload them or worry about everything I mentioned above.

*If you have good enough credit, you don’t always have to pay up front. You can apply for “Net 30″ or even “Net 60″ payment terms. That is, you get to pay your supplier after 30 or 60 days after you’ve purchased the inventories. Then again, your bigger buyers are going to demand the same thing from you… In conclusion, you need enough money to burn when inventories are waiting to be “turned over”.

One Happy Baby

Wednesday, November 29th, 2006

I came across this the other day… I just have to share this!

Organization Freak

Wednesday, November 29th, 2006

For those of you who’ve know Grace for long enough, you know Grace is an organization and clean freak. Everything in the Universe has to be in certain order — her order. For example, anything with a 90 degree angle MUST line up with perpendicularly with the edge of the table the object is sitting on. If it’s even one degree off, she’ll take the time to realign it no matter how busy she is.

So you can imagine I kind of live in a Cubist household where everything is lined up straight.

Ever since Bryan has become “mobile”, we noticed that he’s taken on this particular habit of Grace’s… at the age of 15 months… Three examples here:

1. Grace taught Bryan to put his toys back to where they belong before we pick him up from his playpen. The other day when I went to pick him up from the playpen, the first thing he did wasn’t putting his hands up, waiting for me to grab him from his underarms. But rather, he immediately started putting all the smaller parts of his toys into this “cooking pan” and even put its lid on. What’s more is, if an angular toy was misaligned in some way, he’d also take the time to put it back “in order” before he even closed the lid (i.e. if a toy was put in there side ways, he’d flip it around to make sure it’s in standing position). NUTS!

2. Bryan crawls all over the place in my work room when he plays. He’d throw things around and crawl to fetch them himself. One time I saw him, god forbid, accidentally bumped my computer bag out of “alignment”. He intuitively reached out his right arm to adjust it so that its back is flushed to the computer on the floor! WHAT THE….

3. The other day a friend from L.A. was in the area with his wife and 13-month-old (whom, by the way, has been WALKING since 12 months). The kid was walking all over the place and kicked the rug hard enough so that one corner was turned. Bryan, who was crawling behind him, immediately made sure the corner was put back in place before he crawled on to his play.

Now that’s discipline.

Plans are in the works to turn him into a back-scratching, shoulder-massaging, dish-washing and foot-rubbing machine.

Review of Mac PHP Development IDEs

Tuesday, November 14th, 2006

Coding, some argue, is an art form. You try to achieve the best results with the most elegant codes you put together within the deadline. And those codes often go through different stages of metamorphosis as you gain more understanding and insight in the knowledge of coding… I don’t mean to get all “Zen” about this, but true geeks know what I am talking about.

And that’s how some people approach the kind of tools they choose to use doing what they do. I, for one, like the minimalistic and swiftness an all-purpose text editing tool like BBEdit offers. It’s light, fast and pretty powerful. And more importantly, it doesn’t screw up my codes like Dreamweaver probably would. But after having dealt with a couple of decent-size web developments, it’s become pretty evident that BBEdit is showing its weaknesses in areas like, for example, debugging, syntax auto-completion and project organization. So I started investigating using IDE to speed up development time and accuracy. I looked at and tested the following packages for Mac OSX:

Apple Xcode
Zend Studio
Eclipse (via PHP plugins: phpEclipse or PHP IDE for Eclipse)
ActiveState Komodo

I also checked out a couple of other simpler, not-quite-IDE, apps just for comparison’s sake against BBEdit:
PHP Studio
Smultron

For you Windows people, someone at IBM also did some homework for you…

Apple’s Xcode was pretty much out of the game as soon I started looking at the specs. There’s no debugging for PHP at all. PHP support stops at syntax coloring. Considering that the IDE is really meant for Macintosh desktop application development, there was no reason for me to pursue further… though I secretly wished it would just somehow magically work…

Next I tested Zend Studio along with Eclipse. Zend’s PHP debugger is very useful in catching even the most insignificant things like if a variable was declared but never used. It also supposedly comes with a “profiling” feature that tests which parts of my codes take the longest to execute so that I can perhaps write a more efficient code. But I never got that feature working. Even Zend’s own documentation and online forums are useless in solving the problem. Another very annoying thing Zend did was including features that are NOT supposed to work unless I paid for and installed Zend’s other products. Zend should at least have the courtesy to gray out those features. But instead, the company simply assumed that those products were already there and lets the user generate endless errors. There are other issues I ran into which made me feel that no one should have to pay for this software — it felt like a cheap beta.

Eclipse is an open source software which plenty of Java developers seem to love. Kyung first told me about Eclipse when he was using it. The setup was pretty straight forward and the debugger was also pretty nice, but its messages weren’t as contextual and as helpful as those in Zend Studio. But it was still a lot more helpful than PHP’s useless error messages. The only complaint I have about Eclipse is its performance on my aging PowerBook and lack of straight forward support for profiling (no graphics, just a bunch of tables).

Komodo is made by the same company that makes ActiveState Perl for Windows. It has by far the BEST user interface of all IDEs for Mac that I’ve tested, and it’s also most Mac-like. Unfortunately, it complained that my installation of PHP was bad (and won’t say why) and refused to work with it. And in order to get profiling to work, I’d have to install xDebug (which I did) and mess with a bunch of settings… It was pretty disappointing not getting Komodo to work.

PHP Studio and Smultron are pretty much like BBEdit except that PHP Studio has a more superior IDE-like code organization (like recognizing functions and classes that I’ve written within the same project and put them nicely in a side panel) which BBEdit doesn’t even come close to having. Unfortunately I could only work on one file at a time (no multiple tabs!). Smultron is pretty much a free version of BBEdit with a few things missing (which I don’t really care about). I probably wouldn’t have paid for BBEdit if I’d known about Smultron sooner….

So at the end, open source rules again. Come to think of it, I’d be pretty embarrassed if I were the project manager woking for Zend Studio or Komodo for making such awful products (though I should give Komodo the benefit of doubt since I couldn’t get it to work).

No wonder Apple ended up making its own IDE seeing that the mac programming IDE market is littered with such inferior alternatives. I wish someone would write an extension/plugin for Xcode and actually make it useful in coding web-based projects (PHP, Javascrit… etc). Maybe Xcode 3?

Green Card Lottery

Sunday, November 12th, 2006

I finally got around to submit for this year’s U.S. Green Card Lottery online. This is the third year we are participating… Between Grace and I, we must know a dozen people who’ve won the lottery and successfully became Permanent Residents in the United States… So, what the heck… It’s worth the try. “You don’t win if you don’t try”, eh?

In the meantime, we are still cranking on our Canadian immigration “stuff”… I am trying very hard NOT to put off studying for my GRE exam (for which I haven’t even registered a date!). And in the meantime, I am still eying on a couple of “seemingly easy to get accepted” schools for a PhD application… This whole deal has made me realize how desperate some universities are with taking in PhD applicants as long as you’ve got the dough to show for… which completely mushed the holiness of a “PhD” degree in my mind. More on that another time in a separate entry.

Living on the “immigration edge” is like having an adrenaline rush over a prolonged period of time — you just never know when you are going to be screwed over by change of immigration rules. I think the good’ol Mexicans from the Southern U.S. borders got it all figured out — stay illegal for long enough and not get caught is the golden ticket to citizenship; only fools like the law-abiding Taiwanese punks pay lawyers.

The morale of the story? Take a page from your friendly Mexicans: When there are enough of you, legal or not, you change make favorable laws happen. And, oh, laws are for them Taiwanese fools.

MacGyver Theme

Wednesday, November 8th, 2006

Murdza sent me a link to MacGyver opening theme music at YouTube yesterday. That piece of music has been stuck in my head ever since…

Now I wish the same for all of you!

If for some reason the Flash movie above doesn’t show, I am sure you can find plenty of them here.

Damn Chinese Characters

Tuesday, November 7th, 2006

I finally got around to upgrading the user forum at SCAD’s Chinese Student Association website the other day. I got fed up with phpBB last year after Lawrence and I were endlessly patching the damn forum for security and spam breaches. Thank god he found Simple Machines Forum (or SMF for short) and we’ve been happily using SMF ever since. For one thing, SMF runs a lot faster and cleaner with a lot more useful features came included in the base install. And additional mods were in the form of plugins and add-ons. And even then, I can easily find AND install plugins/themes from within the control panel! Under phpBB, installing mods means literally opening up half a dozen files (sometimes more) at a time and manually add codes to the base install, which is extremely unsanitary, messy and makes version upgrades a pain in the ass.

One of the legacies that phpBB left after the migration was lack of support of UTF-8 Unicode standard for Chinese character sets. As a result, the damn forum is unreadable if a visitor happens to be on a machine without the appropriate character sets installed. Worse, we have had to support both Simplified and Traditional Chinese, which is a real pain because by selecting one character set means making the other unreadable.

So when I upgraded the SMF forum, I tried converting the entire database from a dirty mix of Big5 and GB Chinese character sets into UTF-8, but something went wrong in the prepackaged SMF UTF-8 conversion tool. And the all the Chinese characters were made into garbage text! Thank goodness SMF made a backup during the upgrade and I was able to fully recover every piece of content.

I guess I will try again the next time SMF releases an upgrade.

The next big thing for the site is to seamlessly integrate some kind of content management system and a wiki so that a single login session session can be used on everything else. This has proved to be a lot tougher than it sounds so far. A couple of kids tried remaking the site as their “independent study” projects. But at the end, that was all it was — a project. The designer-types made the whole site (minus the forum, which is my domain) in HTML, which made updating nearly impossible. That then perpetuates into nobody wants to learn how to mess with the HTML content. Hopefully a wiki and an easy-to-use management tool will make things easier when I get around to doing it…

The site has grown in importance over the years. It’s so far still an “underground” organization as far as SCAD is concerned (or else we’d be shut down by now). But personally, I think the damn site is responsible in recruiting at least 80% of potential Chinese-speaking kids who eventually end up at SCAD. And for that, maybe SCAD oughta pay for the hosting!

Truth Be Told

Sunday, November 5th, 2006

I have been looking forward to seeing Al Gore’s “An Inconvenient Truth” ever since the documentary was announced. Finally I got a chance to see it, albeit it took three days to watch the entire film section by section because of my schedule.

Powerful and jolting facts. A MUST SEE.

If you plan on seeing only one movie till the end of the year, this should be on the top of your list.

VNC on Fedora Core 6

Thursday, November 2nd, 2006

Setting up VNC on a Linux box is always such a hassle. But I had to do it again today so that I don’t have to deal with two sets of mic and keyboards when I am testing my work in VMWare.

Thank goodness for this article that I saved a bunch of time having to figure things out myself. Maybe in the [always] good old college days, I’d have done that. But now time is of utmost importance with an active child in the house and all…

The only hiccups I got was that the above setup failed to discuss the issue with firewall and iptables. To allow outside access (even within the same home network), a port must be open to allow the traffic to flow through. There are a couple of ways to do that:

Adding a rule through a GUI in Gnome:

1. Go to System -> Administration -> Security Level and Firewall
2. (enter the appropriate password when prompted)
3. Under the Firewall Options tab, click on the white arrow at the bottom that’s labeled Other ports
4. Click on Add and enter the port number you are allowing access; in my case, it was 5902 for display number 2. (Leave the protocol at default, which should be tcp
5. Click OK all the way out, and iptables should have been restarted with the rule in place

A geekier way to do it is through command prompt:

1. sudo vi /etc/sysconfig/iptables
2. Add the following line to the rule:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT
3. Restart iptables by issuing:
sudo /etc/rc.d/init.d/iptables restart

Another thing that many Linux novice (like myself) don’t quite grasp is the fact that Linux’s GUI is not at all tied to the operating system. You can have Gnome, KDE, Flux or Blackbox as GUI options installed on the same OS. And you can switch around as you please upon setting the preferred desktop and log/in again. When you are viewing the remote system through VNC, you can do exactly the same thing — you can define what type of GUI you want to see as you launch your preferred VNC viewer client:

Edit /home/_vnc_user_name_/.vnc/xstartup as such:
#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" -e ./menu &
#twm &
#fluxbox &
gnome-session &
#startkde &

Noticed I commented out (#) some desktop GUI options at the bottom except Gnome. Basically you can use any one of them anytime as long as you restart the vncserver after you’ve made the changes.

Hello to Tai

Thursday, November 2nd, 2006

Patrick and his wife, Ee-bin, had a baby last night (the big-C). They named him Tai, or “Lucky Tai” to be precise. They say he brings luck to Patrick because ever since Ee-bin’s pregnancy, Patrick’s screen writing career’s been going pretty smoothly. Hard work, you say? Blah! Hard work is overrated — luck is everything… ;)

Lucky Tai

Speaking of Patrick and luck, he and his partner, Marcus, are having a ball with some of the latest projects they are working on. Rumor has it that they’d been contracted to write the script for The Saw 4!

Here’s the clip for which they got picked and went on to win the Project Green Light.

Upgrading to Fedora Core 6

Thursday, November 2nd, 2006

I finally got around to upgrading my Dell to Fedora Core 6 using yum. My last attempt failed pretty miserably mainly because of some stupid package dependencies I couldn’t figure out how to resolve (something to do with initscripts, which was kind of what happened in my attempt to upgrade from FC4 to FC5). So instead of dealing with it, I simply shut it up… Here are the steps:

1. me@localhost$ rpm -ev fedora-release --nodeps
2. me@localhost$ rpm -Uvh [url-to-fc6-release-notes]
3. me@localhost$ rpm -Uvh [url-to-fc6-release]
4. me@localhost$ yum clean all
5. me@localhost$ yum -y update

By step 5, everything should’ve gone flawlessly, except, again, Fedora threw a fit on dependency problems such as bg5ps, gtkhtml and a couple of other packages. Again, instead of dealing with resolving them, I just removed them:

1. me@localhost$ yum remove bg5ps
2. …. (repeat step 1 until all problematic dependencies are removed)

Then everything was good. And as it turns out, the new kernel that came with FC6 (2.6.18-1.2798.fc6-i686) is capable of handling dual cpu systems, unlike kernels before that where I had to specifically update multi-processor capable kernels (kernel-smp). I wasted about 20 minutes trying to find/update something that never existed!

Finally, after reboot, I got my nice FC6 all up and running. Life was good except now VMWare refuses to launch. So I had to reinstall it because of the new kernel I installed. Unfortunately, VMWare couldn’t locate the new kernel’s c header library (usually installed at /usr/src/`uname -r`/include). But it wasn’t there!!! Even though I had the latest kernel, its c header library still could not be found! After some research, I finally was able to resolve that by force installing kernel and kernel-devel rpm files:

me@localhost$ rpm -Uvh --force [url-to-kernel-rpm-package]
Issue the command above for both the current kernel and kernel-devel

Once VMWare got its kernel c header library, it was happy. And life was good again….

My next project with that machine is to upgrade its CPUs with a couple of nice Pentium 3 Slot 1 modules at the maximum clock speed the machine can handle (which is at around 1.1Ghz — fast compared to 450mhz I currently have). These types of CPUs are pretty hard to come by because Intel abandoned Slot 1 architecture a long time ago.

Fedora Core 6 upgrade made possible by this discussion thread at fedoraforum.org. VMWare troubleshooting and resolution made possible by this discussion thread on VMWare’s community site and this discussion thread on fedoraforum.org.