Upgrades

I’ve been dying to upgrade my aging PowerBook for about 8 months now. Even though I think its recent slowdown is caused by lack of hard drive space (only around 10% left), I am having a hard time finding stuff I can just get rid of without looking back.

Along with my PowerBook, a few things should probably go with it too: a 19″ CRT monitor (hello LCD monitor), a carpal-tunnel-syndrome causing mouse (umm, ergonomic mouse would be nice) and an old 802.11b wireless router/access point (which is now half broken). With one of those Intel Macs, many things I couldn’t do easily before will suddenly become possible (and obligatory) — like finally finish editing my wedding video.

I told Murdza I ran out of excuses not to get a new MacBook Pro. But I think I just came up with a few:

1. Would be nice to have Leopard shipped with it;
2. Would be great if video RAM was 256MB 512MB like some of Dell’s line ups;
3. Wouldn’t hurt if the LCD actually packed in more resolution like its PC counterparts;
4. Would love to finally know what file system Apple is eventually moving to;
5. I wish I had a great backup NAS drive for my home network.

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?

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

Civilization IV for Mac

I saw that Civilization IV for Mac was finally released, and a demo version is now available for download. I checked out the specs needed to run the game and was sadly disappointed — it requires a G5 processor or an Intel Mac!

Simulation games are about the only thing I like as far as gaming’s concerned: The SimCity series, Civilization series, Age of Empires series and those Rainbow Six/Rouge Spear military/special forces games. Argh!… But then again it has been 4 years since I got my PowerBook… Damn old Macs…

Safari Unable to Load Nested xhmHttpRequest Objects!

I started a project where I used pure CSS and Ajax on the interface, like how Google implemented the Gmail interface. But soon it was clear that Safari’s handling of Ajax and dynamic DOM element updates is very limited.

I created a “div” tag on the base page to load various sections of the website into it using xmlHttpRequest object. Where Safari (and Shiira as well as Opera) failed was when I started loading a separate page into another “div” tag that was dynamically created by the “div” tag created by the base page. At first the problem persisted only within my application. But then I was able to recreate the problem by making a bare application just to load one “div” tag into another.

So basically, Safari is unable to recognize nested HTML elements created by xmlHttpRequest…. Or so my theory goes.

Yuck…

UPDATE 08.02.2006: I tested using a plain javascript to load DOM elements into each other without Safari complaining. So one can assume the issue is only with loading DOM elements via xmlHttpRequest or that the particular method I am using makes Safari very unhappy.

Rare Appearance of Steve Jobs

I don’t know where he found it, but Murdza sent me a link to City of Cupertino’s webcast archives. And in it, there’s a short appearance of Steve Jobs announcing Apple’s decision to stay in Cupertino for its second campus it decided to build.

Steve Jobs addresses the city council of Cupertino

To view it, you can download the Real Player file here. Or you can go to the webcast archive, under “CITY COUNCIL MEETINGS”, and in the “MEETING VIDEO” drop down menu, select “April 18, 2006” to download. When your player of choice launches, there should be a menu somewhere around the main video itself. Simply click on “Oral Communications”. Steve is the first one to speak.

Murdza said Steve looks drunk. I thought the image of him scratching himself didn’t look too graceful. But at least he was true to his all-too-cliche image… he wore a black turtle-ish long sleeve shirt with jeans. I wonder if he considers that outfit his uniform… I mean, I wear similar stuff all the time, but not to the extreme of wearing the same thing day in and day out… I guess the way he thinks is the same as how school administrators in most Asian countries think: Don’t get distracted by what you have to wear everyday to school/work. Thus, if everyone wears exactly the same thing everyday, there’s one less thing to worry about which allows one to concentrate on what matters the most — work.