Keeping in Touch

I think it’s ironic how modern technologies have actually made people worse communicators. The excuses of “convenience factor” in how someone can just pick up the phone and call anytime… or just write an email anytime… are pseudo. What it boils down to is this: you either write or you don’t… you either call or you don’t.

I remember when we moved to Thailand, I instantly got half a dozen penpals from my circle of friends — even ones I didn’t know so well. One nice thing about good old snail mails is the sense of anticipation in waiting for something that someone actually put some effort into doing for you.

Writing a letter, at least for me at that time, really meant something. I’d write when it was calm, usually at night. I’d carefully read through what was in each letter and carefully respond to or spend some time thinking about what I’d write in these letters — each written to suit the personality, ongoing conversation or the mood of that specific letter. And I felt the same thing from the letters I received. I enjoyed that.

Fast forward to the Internet era. Emails have made communication fast and easy. There’s now less “anticipation” factor in waiting. Instead of waiting for days or even weeks, gratification can be had right NOW. But because of this convenience made possible by the technology, I’ve noticed people just become “lazy”… Emails have become trivial. And these emails get shorter and shorter every year.

At first they are “here’s what I’ve been up to” emails. Then they are “just want to say hi”. And then eventually they become links to articles or news with minimal word descriptions. To some people, this is their way of saying, “I thought about you when I saw this,” or “I though you might like this.” But ultimately, even these emails rarely appear in the “inbox” anymore.

I’ve sent quite a bit of emails with links and short blurbs about what I think about something contained in that link to people. But more than likely I’d get cold shoulders. I am not sure if they got it, liked it/didn’t like it, didn’t care for it or they even bothered to open the link(s).

After a while, I stop sending them links or even “hello” emails. It takes two to communicate. Right?

Technology has made life more convenient than ever. Unfortunately, it has also made life busier than ever. Consequently, technology becomes an excuse for not having time of the day to communicate.

But of course there are those who AWALYS have a spare minute to write about or reply to even the most trivial things just to keep a conversation going (you know who you are!). And I think that really kicks ass.

Review of Mac PHP Development IDEs

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?

Damn Chinese Characters

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!

VNC on Fedora Core 6

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

1
System -> Administration -> Security Level and Firewall

2. (enter the appropriate password when prompted)
3. Under the

1
Firewall Options

tab, click on the white arrow at the bottom that’s labeled

1
Other ports

4. Click on

1
Add

and enter the port number you are allowing access; in my case, it was

1
5902

for display number 2. (Leave the

1
protocol

at default, which should be

1
tcp

5. Click

1
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.

1
sudo vi /etc/sysconfig/iptables

2. Add the following line to the rule:

1
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT

3. Restart iptables by issuing:

1
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

1
/home/_vnc_user_name_/.vnc/xstartup

as such:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/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

1
vncserver

after you’ve made the changes.

Upgrading to Fedora Core 6

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

1
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$

1
rpm -ev fedora-release --nodeps

2. me@localhost$

1
rpm -Uvh [url-to-fc6-release-notes]

3. me@localhost$

1
rpm -Uvh [url-to-fc6-release]

4. me@localhost$

1
yum clean all

5. me@localhost$

1
yum -y update

By step 5, everything should’ve gone flawlessly, except, again, Fedora threw a fit on dependency problems such as

1
bg5ps

,

1
gtkhtml

and a couple of other packages. Again, instead of dealing with resolving them, I just removed them:

1. me@localhost$

1
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

1
/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

1
kernel

and

1
kernel-devel

rpm files:

me@localhost$

1
 rpm -Uvh --force [url-to-kernel-rpm-package]

Issue the command above for both the current

1
kernel

and

1
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.

(More) Ajax Woes in Safari

The more I deal with Ajax and Safari, the more interesting problems I get with the combo from time to time. Since my last run in with the dual, which forced me to rebuild that particular section of the site using more traditional means, I have recently discovered one more issue having to do with multiple

1
XMLHttpRequest

calls via the same object from the same page. The short version of the story is: It CAN’T be done in Safari* (or not in the method that I know of). Firefox and IE, however, seem perfectly happy with using a single object to make multiple asynchronous calls.

Fortunately I am not crazy. I found an article that briefly touches on this issue. This article is also a very good short tutorial on how to get started on Ajax (though the author uses a Ruby backend to iterate the codes, which can easily be replaced using any code you are comfortable with.). Another article offers more depth on the same issue with some code samples to show (via Ajaxian.com).

To get around the problem, one way is to simply create multiple objects, one for each call request, as opposed to have one object to handle all the requests. If you don’t do this, when you make one

1
XMLHttpRequest

call, all the other Ajax fields on the same page will start loading as if they are expecting something back from the same request (for which they’ll wait an eternity and never get anything back).

Sometimes I just don’t know how I solve these kinds of voodoo-like problems. Even Google is powerless before I knew what the problem was. I mean, how do you Google for problems you don’t even know how to describe? And this issue was particularly annoying because Safari’s Javascript console didn’t report any errors.

*I also discovered that the same issue takes place in Webkit (the HTML rendering engine at the heat of Safari) based browsers, including Shiira. Though strangely enough, Camino (a cousin of Mozilla FireFox), much of whose gut is based on Safari’s renderer, didn’t have the problem at all! It’s also interesting to note that Opera 9 also suffers from the same issue.

Quotes from God Jobs

Nobody has tried to swallow us since I’ve been here. I think they are afraid how we would taste.
— Steve Jobs, Apple shareholder meeting, April 22, 1998

WOW!

Murdza sent me a link from Wired.com on some of the greatest (and deadly accurate) quotes from Steve Jobs.

Thanks, Murdza (the greatest geek within my direct sphere of influence).

More Geek Talk

Mike Neely discovered something pretty freaking awesome: It’s called Meebo. It’s basically Adiumx (or Trillian for you Windowz folks, gaim for you Linux dorks) except it’s web based. It supports quite a bit of stuff that you are accustomed to using desktop apps.

Speaking of apps, Neely revealed the other day that he’s doing some cocoa programming! I am so envious of him having the initiative and drive to pick up cocoa/objective-c. This reminds me that I ought to get back into desktop programming!

While I am on the topic of “desktop” programming, I tried upgrading my Fedora Core 5 to the latest Core 6 last night but failed. I guess it’s too new that various issues aren’t widely discussed yet (bless Google). I’ll probably give it another try another time. Strangely though, the audio in FC5 just magically started working all by itself — I spent days downloading and compiling various drivers for it to no avail. And that piece of sh*t just decided to work all of a sudden? WTF?! This is yet another reason Linux is far from being ready for mainstream consumption — lack of usability for everyday-users.

Back in Web Development

I have been working on a project non-stop for 2 weeks to get the final features up and running. But I just couldn’t stop squeezing in some good-to-have features to boost the overall “value” of the product a bit. Here’s a short list of what I thought were really slick features:

1. Javascript lightbox: This one feature can probably single-handedly describe what the Web2.0 movement is all about. The BEST part is, integrating Lokesh Dhakar’s code to the project (or ANY project, really) is just a couple of copy and pastes and one line of code change!! That guy is a genius.

2. Recursive delete: This a pretty kick-ass class for recursively deleting whole directory structures even if they are not empty (PHP programming in Unix environments, this is a big deal). My project requires my PHP scripts to interact with physical directories. I thought it’d be a complete waste of my time to write a function/class to do this if someone else’s already got a solid script. Implementing this just took one line of code.

3. Directory compress & backup: I used this script to work in conjunction with “Recursive delete”. Basically before anyone deletes a whole directory, my PHP application will automatically back it up and nicely tug the compressed file in a safe place. Again, this is a kick ass class because it only takes a copy/paste and defining of a couple of variables.

4. Unique ID check via Ajax + PHP: I wrote this myself using an Ajax class I assembled from prior projects. It simply goes to the database and checks if whatever the user ID (or product ID or whatever) already exists. One bug I encountered under Safari was that if

1
XMLHttpRequest

returns nothing from the database (which means the ID the user entered was unique), Safari makes

1
status undefined

or

1
null value

complaints. One way to get past solve this problem is for

1
XMLHttpRequest

to return an empty space via PHP (or whatever language you prefer)… i.e.

1
echo " "

. Here’s a nice blog about Ajax related issues. This issue is also pretty well documented here though “bitterpill.org’s particular trick didn’t solve the problem for me.

5. Multiple file uploads: The Stickman has some really neat references to a handful of technologies I am currently exploring. This “multiple file upload” script isn’t particularly elegant but does its job exceptionally well. I was able to integrate this, along with everything above, into one coherent code base, fortunately.

6. Snif (stands for “simple and nice index file” ) is probably one of the best-looking and utilitarian directory and file index script I have found thus far. There are tons of others that do way too much or too little (some of which cost quite a bit too). The downside of snif is that the code hasn’t been maintained for quite a while, and its forum is littered with more questions than answers. But I did find some nice “mods” to enhance its core functionalities quite a bit. Another problem I had with snif was how hard it was to integrate into my existing code base. That said, snif is still a very solid standalone directory index script though!

7. By accident, I stumbled upon a list of Web2.0 sites from Tucows. I look forward to studying up the latest eye candies these sites offer for my future projects.

So now that most of the core features are done, I just need to find a fast(er) Windows environment to test the css layouts, mostly for IE. I wish IE would just go away so that us web programming types don’t have to deal with Microsoft’s snobbish approach towards web standards. Go Firefox, Opera and Safari.
.
.
.
Apple finally decided to release Core 2 Dual version of MacBook Pro right before Christmas! How kind. I made a pseudo promise that I’d get a MacBook Pro if they upgraded it to Core 2 Dual… not knowing they’d do it before January’s Macworld… But since the budget is kind of tight these days, I will hang on to my trusty old PowerBook G4 until OSX.5 Leopard comes standard with MacBook Pros! Hah!

Apple Is Parallels Shy

We went to the mall today to get Bryan’s picture taken for his Canadian residency application (long story). So I went to the Apple Store to check out the latest iPods and other toys. I was really amazed how thin and light the new iPods are.

One of the things I’ve always wanted to test out was running Parallels, a new emulation software, on an Intel Mac. It’s been widely reported that it is capable of running Windows at near-native speed on an Intel Mac. I really needed to see just how efficient I can be coding within OSX while testing my codes in other browsers under Windows. Unfortunately, Apple doesn’t have any machine with Parallels installed. I wouldn’t be surprised if that was because Parallels did not pay Apple to install its software on Apple’s demo machines. That said, third party softwares are actually pretty hard to find on those demo Macs except for Microsoft Office for Mac.