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.

Safari Still Unbearable

After ditching Firefox for Safari less than 48 hours ago, I am back using Firefox again. Safari’s memory leak was simply unbearable. After doing some surfing on how to boost both Safari and Firefox’s performance as well as reduce potential for memory leaks, I came across this nifty command line to check leaks:

For Safari, in the command prompt, run

1
2
3
4
5
6
7
cosmo:~ zzz$ leaks Safari
Process 16320: 296847 nodes malloced for 47252 KB
Process 16320: 56 leaks for 6176 total leaked bytes.
.
.
.
(lines and lines or error codes)

For Firefox, run

1
2
3
4
5
6
7
cosmo:~ zzz$ leaks firefox-bin
Process 16320: 309998 nodes malloced for 47750 KB
Process 16320: 111 leaks for 3440 total leaked bytes.
.
.
.
(lines and lines of error codes)

When

1
leaks Safari

was executed, the error codes ran for pages and pages in the command prompt. It was so long that the command prompt’s buffer ran out of memory (and only after I piped the errors to a text file did I find out that the error code generated a 20MB plain text file!!). And that was after I launched Safari fresh with 10 tabs. In comparison, Firefox’s error code was only a few mouse scrolls away. On top of that, after only having used Safari for less than 12 hours yesterday, I watched it gobbling up almost 200MB of RAM where as in Firefox, I can go on for days with keep the memory occupancy at less than 135MB. Again, this was all with about 10 tabs opened simultanously at all times.

After I decided to quit Safari (again), I closed the windows one by one after transfering all the pages to Firefox. And it gave me this error:

The following world leaks were detected (the check is done when all browser windows are closed):

2 WebView objects, 1 WebFrame object, 1 WebDataSource object, 1 WebFrameView object, 1 WebHTMLRepresentation object, 1 WebBridge object, 2 JavaScript interpreters.

Please write a bug report about this, along with reproducible steps if possible.

Safari Leaks

Supposedly Finder and almost everything else leaks memory as well… But I am surprised the OS holds up so well after having gone weeks (sometimes months) without a reboot… I wonder how XP and/or other OSes and their Desktops/X hold up against leaks. But I have never heard of Linux having to restart from crashes or bad memory leaks. And OSX has been pretty stable for the past 3.5 years in various versions I have been using. So Windows must just suck more then?

Argh… memory leaks are annoying…

Mac Uptime

Murdza sent me this image the other day….

Mac: 200 days without reboot

That’s 200 days of Mac OSX running without a reboot. I am sure there are machines/OSes that have last longer than that. But it’s impressive nonetheless. I would never want to bet with someone if I had a Windows-based machine to be up and running for that kind of up time.

Murdza, don’t you ever apply OSX updates that Apple issues? They almost certainly require reboots!

Old School Keynote Speeches from Steve Jobs

Murdza sent me this pretty neat link to some classic keynotes of Steve Jobs back in the days…. The one in 1997, his return to Apple, was probably one of the best ones. He pretty much laid out the road map that Apple has been doing, except at the time it all sounded like secret codes that only he and the Apple board understood.

For you diehard Steve Jobs fans, this is a great place to collect those speeches that you’ve always regretted not having a copy of (I know Murdza and I now have a copy!). For you new comers to the Mac, this was the Second Coming of Steve Jobs…

OH, and the site also has pretty much all the classic Apple commercials from the old days… Fun!

UPDATE 02.27.2006: Another site filled with Appple ads.

A Funny Mac Switcher Story

This is by far the best and funniest article I have read in the recent years.

An excerpt:

Look, you can pester me all you want, mock my stubbornness, and even point at me and laugh, but one thing is certain: I’m not buying a Mac.

For more than 20 years, I have used only MS-DOS- and Windows-based computers. During that time, I have purchased enough Microsoft software to feed a small family for a year — assuming that I could somehow transform 600-page manuals and stacks of 3.5-inch floppy disks and those annoying “Certificates of Authenticity” into edible human nourishment.

To date, I have endured 1.4 million system crashes, watched 19,874 word processing documents vanish into the ether — many of which would certainly have won prestigious literary prizes — and directed 455,391 expletives at “Bill Gates” and “Michael Dell” and “any human being remotely involved in the creation of this hideous device.”

Despite all this, every few years I replace my outdated PC with a new one. “I already know how to do everything on a PC,” I say, echoing the most popular explanation for not switching to Apple.

Meanwhile, since the mid-1980s I have seen Mac users walk around as if they don’t have a care in the world. With a playful jauntiness in their step, and noticeably fewer forehead lines, they boast about the “coolness factor” of their iMacs and iBooks and G4s. And from what I can tell, their lives are as clean and uncluttered as Apple’s elegant user interface, all smooth and logical and perfect.

Make sure you read the full article to get a good chuckle out of the column. His other articles are also peppered with great insight and original humor.

The author, Bill Shein, is the Winner of the 2005 National Press Club Award for Humor.

via [MacDailyNews]

Home Made DVD Problem Resolved

After having some issues with burning DVDs using Apple’s iDVD dvd authoring software on Grace’s slower Mac, I decided to encode the project file on my laptop and see what happens. And it turns out that CPU speed DID matter in the case of dvd video encoding, at least in this one instance. Another cool thing I found out is that Apple’s iDVD can pull source files (raw video footage) over the network! All I had was the iDVD project file on my laptop, the rest of the source files (videos and music) were all on Grace’s Mac. It was way faster to encode the DVD on my Mac pulling source materials from Grace’s Mac over the network than encoding locally on her Mac!! WOW!

So the blue flickering is gone now. Copies will be made to anyone who wants one (namely, our moms and maybe friends of Grace).

Home Made DVD for Mom

After completing my last programming gig, I took a collection of Bryan’s video clips and made a DVD for our moms. I guess Grace’s Mac is way too old (and mine is seriously running out of space), it takes forever to compress the damn thing into the MPEG-2 format that consumer DVD players recognize. It took a whole day for the poor 400Mhz G4 with 700MB+ RAM to compress two dozen 1-2 minute clips (plus the menu… etc)!! But the result is wonderful. The images I used in the background of the main menu are all moving movie clips. Each of them loops as the image panes rotate through 8 different movie clips, complete with background music. And of course, the mirror reflections below them move as well!!

Thanks for Apple’s iLife suite, putting the clips and the dvd menu together took only less than an hour (it’s the rendering and compression that really killed the process).

DVD collection of Bryan's video clips

Unfortunately, something went wrong with the menu looping sequence. The first loop of the menu would flicker with a blue tint. And this only happens to the first loop of menu selection screens (including scene selections). My cousin’s boyfriend thinks it’s either that my DVD player is picky about the DVD-R I used or that Apple’s iDVD simply dislikes the DVD player… Both Googling and Apple’s iDVD support/discussion sites also didn’t provide any clues. I am compressing the DVD into disk image now. I will try burning again using a different burning software to see if that changes anything.

Blue screen flickers

Just to make the record complete (for anyone else who’s having similar issues and for trouble shooting’s sake), similar issue happened when I used iDVD 5 with the same burner in Panther (as well as Tiger). So it’s probably not the problem with the OS, iDVD apps or their preference files. It might have to do with how iDVD writes to the DVD on that first pass which the DVD burner is not happy about… Live and learn.

Steve Jobs’ Reality Distortion Field is Real

Steve Jobs’ MacWorld Expo 2006 keynote came and went. All last week I eagerly waited for this day to come. It’s not very cool that Apple has stopped web casting the keynote since 2003 (or maybe 2004?). But maybe the cost of keeping up with the bandwidth was just not worth it.

Whatever the reason. I intentionally avoided reading all those “live update” sites just so that I could watch the keynote in one piece and hear everything for myself. But instead of holding out, I started reading stuff from various Mac news sites.

So I read the headlines one by one…
Intel iMac with the same features but faster…. big deal.
iLife gets an update… blah… whatever.
iLife gets iWeb… yawn…
iWork gets an update… whatever… where’s the real news?
iPod gets Apple-made FM tuner… Um… two years too late…
Blah blah blah…

What a stupid boring keynote, I thought.

But then Apple made the keynote available for steaming. And Apple’s website was updated.

HOLY SHIT. I immediately got sucked into the reality of Steve Jobs, a whole other dimension in space and time. As the keynote progressed, he introduced products I’d already read about earlier. But for some unexplained reason, I felt excited, energized and wowed by everything he introduced (except the iPhoto and speed bench demos).

I have problem with one thing though…. MacBook Pro? What the hell is wrong with that name? MacBook? Com’on… give us something original like Apple’s been doing with one-word names on its applications. Or lose the “book” — that sounds so 2001!

Launching MacBook was a calculated move. PowerBook has been long overdue for a new life. And this delivered that for everyone who were just waiting for that new Intel PowerBook. PowerBook buyers are also known to be early adopters. They are not afraid of becoming Apple’s unofficial beta testers for the first generation of Intel Macs. They are survivors and fighters. Even if all the MacBooks burst into flame, they’ll get free replacements simply because they would be the same crowd who’s smart enough to get AppleCare!

It’s my suspicion that iBook will be replaced with a, quite simply, MacBook (no Pro). I believe this is a consolidation of Apple’s new branding strategy (just look at the iPod line of products) in an effort to tighten its image and focus in products. I wonder what the new PowerMacs will be called.

Out of all this, one thing did surprise me. Kyung, of all people, pledged his allegiance to the new MacBook Pro if there was ever a 17″ version. But claims OSX would be replaced by Linux and Windows as soon as he gets his hands on one.

In conclusion, Steve Jobs’ Reality Distortion Field is for real. But I am still a little bit disappointed with what came out of this year’s MacWorld Expo (MacTV?). I will be eagerly waiting for other announcement throughout the rest of the year for that “one more thing” announcement.

Roxio Toast and DVD Burning

I must have burned 40+ DVD backups using the TDK DVD-R 8X on the Sony RW DW-U18A DVD burner with Roxio Toast Titanium 7.0. But for no apparent reason at all (no OS updates or software patches), it simply wouldn’t burn the last 5 discs on that TDK 50-pack! And it always gave me the following errors:

The drive reported an error:
Sense Key = ILLEGAL REQUEST
Sense Code = 0x72, 0x02
SESSION FIXATION ERROR WRITING LEAD-OUT

Roxio Toast DVD burning errors

So….

I know what that last phrase meant, but WTF is the rest of the crap? Searches on Google and Roxio’s support site returned nothing useful. Most people on various forums just “THINK” they know what it MIGHT mean. But nothing to decode the mysterious “0x72, 0x02” bit.

So I updated Toast to 7.0.3, fixed permissions (ah, Unix!), restarted, tried again. Failed again.

It turned out that the drive just decided it didn’t like the discs. F*cking moody DVD burners.

Make Mac OSX Support Third Party DVD Burners

PatchBurn logo I inherited a nice Sony DVDRW drive (specifically Sony RW DW-U18A) from Kyung when he went back to NYC. Unfortunately Apple has issues with “unauthorized” third party dvd burners working with its apps (iTunes, iDVD… etc) in Panther (OSX 10.3). I couldn’t burn my iTunes playlist or home made DVD movies with it, rending the drive essentially useless with those apps. Fortunately PatchBurn pretty much resolved that problem. It’s a collection of drivers and patch files to allow Apple apps to recognize third party burners. With the release of Tiger (OSX 10.4) though, the drive was supported natively right out of the box without installing PatchBurn. Nonetheless, it’s a very nice collection of patches for Mac OSX before Tiger.