Snow Leopard
The Snow Leopard (Uncia uncia) sometimes known as ounce is a large cat native to mountain ranges in Central Asia from Afghanistan to Lake Baikal and Eastern Tibet. Snow Leopard normally weights 35kg to 55kg and slightly smaller than Leopard.
Apple’s Mac OS X Snow Leopard is the next version of the world most advanced operating system with a smaller footprint compared to its predecessor, Leopard. Snow Leopard will take full advantage of 64-bit and multi-core technology to the height.
Since Apple introduced Mac OS X in 2001, thousands of new features have been implemented and introduced. In Leopard, the ability to take advantage of multi-core and 64-bit addressing have opened up new dimension in desktop computing. Virtualization becomes possible. New features such as Time Machine automatically backup the Mac hard disk without user knowing.
Snow Leopard, to be released a year from now, is going to be smaller than Leopard but more powerful. Snow Leopard dramatically reduces the foot print on hard disk, using less disk space, freeing them for more music, photos and videos.
Snow Leopard fully makes use of 64-bit addressing to increase the RAM size to the theoretically 16TB, 500 times more than what is possible today. “Grand Central” a new set of technologies built into Snow Leopard brings unrivaled multi-core support and capabilities to Mac OS X. More cores, not faster clock speed, drives performance faster in today’s modern processors. Grand Central takes full advantage by making all of Mac OS X multicore aware and optimizing it for allocating tasks across multiple cores and processors. The result: more powerful applications at faster speed.
HOWTO - Clone your Mac OS X hard drive
First of all, why do I need to clone the hard drive? Good question though. Here are a few possible answers:
- I have too much money to spend for a spare hard drive to clone my Mac hard drive.
- I want to have a bootable external hard drive, installing on an external USB hard drive is not possible.
- I want to upgrade my Mac’s hard drive, and I don’t want to do the installations and setup all over again
Obviously number 3 is my answer. I acquired a bigger capacity hard drive to upgrade my current 120GB hard drive in my MacBook. After some Googling around, I found an answer.
There is an Apple utility program called Apple restore or asr located in /usr/sbin. Connect your external USB hard drive and format it using Disk Utility. Open the Terminal in Applications -> Utilities. Type the following command line into the Terminal to copy your hard drive over your external drive.
% sudo asr -source /Volumes/OSX BOOT VOLUME NAME/ -target /Volumes/TARGET VOLUME NAME/
Replace “OSX BOOT VOLUME NAME” and “TARGET VOLUME NAME” with actual volume names. asr will take quite some time to copy the contents of hard drive to external hard drive. Get a cuppa, pop in your iPod earphone and relax.
When asr completes the execution, it will print a message:
asr: did not copy blessed information to target, which may have missing or out-of-date blessed folder information.
Then, bless your target drive with this:
% sudo bless -folder /Volumes/TARGET VOLUME NAME/System/Library/CoreServices
Now, the hard drive is bootable. Restart your Mac and hold down “option” key. A screen will appear allowing to choose which volume to boot from.
Another happy new Mac user
To follow up my article, “Am I a Mac advocate?”
Just came back from a business meeting which I delivered an Apple MacBook to a customer. She is a mutual fund manager and is totally new to Apple. The moment she took out her new MacBook from the box, her impression was “Wow! It is so beautiful, sleek and … “, something words could not describe.
I spent some hours to guide her using a Mac and she caught on quite well. She was most impressed when I showed her how I could help her using her Mac via iChat. Totally amazed, how iChat could allow her to share her screen to me and I could guide her to use her Mac and some applications over the Internet.
Another happy Mac user.
Am I a Mac advocate?
Yes, I am!
I started to use an Apple iBook with Mac OS X five years ago. And ever since then, I do my daily works like emailing, web browsing, IM/Skype, appointment, todo, word processing, spreadsheet and almost everything on Mac. Today, I am a total Mac advocate and I also develop software for Mac. Most of the Mac applications I worked on are easily ported to any UNIX systems such as Linux and Solaris or vice versa.
I have switched many people from Windows to Mac. I have helped businesses to switch from Windows to Mac. And the result? They are happy Mac users and I am a happy Mac advocate. Supporting customers in Mac is ever easier and hassle free compare to Windows. Supporting Linux and Solaris mostly as a server together with server applications cannot be compared in that way because the application area and environment are totally different.
Although the initial investment is higher comparing to any other Wintel (Windows and Intel) PC, Mac gives you awesome user experience you can never enjoy with Wintel. The end result, ROI or Return of Investment is higher.
Read my other article about Mac in business here.
Virtualization - Installing Ubuntu Linux with VMware on MacBook
I have successfully installed 64-bit Ubuntu 8.04 (Hardy Heron) Linux on my Mac Book. Out of my expectation, the installation was rather quick and easy compared to installing Solaris 10. I had tried installing Solaris 10 on my Mac Book. Solaris installation was successful but I couldn’t boot into it. I wondered why.
My Mac Book sports an Intel Core 2 Duo 2.16GHz with 2GB RAM and 160GB hard drive. I am too skeptical to have 2 physical partitions on my hard drive. Thanks to VMWare Fusion, I can create virtual partition with it. After I have installed VMware Fusion 1.1.1, I created a Ubuntu-64-bit virtual partition and installed Ubuntu from the ISO disk image. With VMware Fusion, I can install directly from the disk image without having to burn a CD or DVD.
Since my Mac Book is codenamed Uranus, I called my Ubuntu on Mac Book, Uranus-Zeta. The idea is from the ζ-ring of Uranus
Like Linux, Mac OS X is a UNIX like operating system. Why do I need Linux? Well, there are a number of reasons. One being you can and another to learn new things. But these are not the reasons to motivate me. Being a software developer developing cross-platform software, I do tests on multiple platforms. Having Linux to run on my MacBook means I can develop and test my software on both Mac OS X and Linux environment without switching to my Linux/Solaris boxes. Another important reason is that I see the needs to support my clients on Linux arise and soon Solaris. Having the ability to run three different operating systems on one machine can be productive and versatile for me.
The other obvious reason is that I have a Core 2 Duo. Meaning I am having two 64-bit CPUs in one processor. It will be a waste of resources if I don’t utilize the computing power I already have. Assigning each CPU to run different operating systems and tasks is called virtualization.
With VMware Fusion, I can run Linux and Solaris side-by-side with Mac OS X without the need to boot into anyone of them at one time. This is a great feature when supporting clients in Mac OS X, Linux and Solaris.
Here are some screen shots (click to enlarge) of Uranus-Zeta:

Time Machine
I finally got a 160GB hard drive to upgrade my MacBook. I took out the original Apple’s 120GB, put it in an external enclosure and connected it to Pluto (Mac Mini) via USB. Since I already have a 30GB hard drive (code named Nix, a small moon of Pluto) as a backup for doing file to file backup on Pluto, it is quite troublesome to do file to file backup on regular basis. The result is I seldom do backup.
This 120GB hard drive was formatted to become Time Machine hard drive. I named it Charon. Charon is a larger moon of Pluto compare to Nix. The moment I configured Charon to be used as Time Machine’s hard drive, the backup began immediately.
Time Machine is an innovative backup application in Leopard (Mac OS 10.5). The initial backup took quite a long time to complete. After it started, I went to bed as recommended by many users in Mac forums. I don’t actually know how long it took to backup.
After the first backup, the following backup is incremental. Time Machine stores hourly backups for the past 24 hours, daily backups for the past month and weekly backups until hard drive is full. After a few hours of running, I have got some hourly backup. I tried to restoring some files which I purposely modified. The restoration is really easy.
Charon is a more affordable alternative to Apple’s Time Capsule which is selling at the price tag of RM1,199 for 500GB capacity. Of course, it comes with WIFI and USB port for network printing. I already have a WIFI router at home so getting a Time Capsule will render my current hardware redundant. After all, Time Capsule is more expensive than having Charon. 160GB hard drive costs me RM230 and the external enclosure RM75. Total is RM305. About 70% more affordable than Time Capsule. But after using Time Machine, I find Time Capsule will be a good investment for convenience and data safety. So start making more money and start saving for a Time Capsule.
Tunnel X from Gutsy to Leopard
I have been tunneling X from Linux to Tiger for almost two years without any problems and happy with it. After upgrading to Leopard, a disaster struck me. I was unable to access my Linux applications on my Ubuntu box. I used to do it with Tiger without any problems. When I ssh tunnel X from Gutsy to Leopard, I had keyboard problem. When I pressed some keys on the keyboard, I got numbers and some weird characters like close windows and minimize windows.
The problem lies within Apple’s new X11 in Leopard. The keyboard is not properly mapped after establishing the X tunnel. After searching the web and Ubuntu forum, I found a solution:
% ssh -X username@gutsy
% xmodmap -pke > ~/.keymap
% gnome-panel 1>/dev/null 2>/dev/null & xmodmap ~/.keymap
Just do xmodmap map once will do. After that, ssh into Ubuntu and invoke gnome-panel.
Nokia 6300
It has been a week since I lost my Sony Ericsson K700i. Choosing a cellphone is always a chaotic headache. So many models! I had been a Nokia fan before I switched to Sony Ericsson 3 years ago. The most important feature I wanted for my phone is the Bluetooth sync feature which allows me to sync my Calendar, To-do, Address with Mac OS X. That was the main reason I chose K700i.
Another criteria is that I want a phone to look like a phone. The 6300 has got a classic phone look after Nokia releases so many garbage. Deciding on a model is never easy. I listened to many live user experience from friends and relatives and even youngsters who own phones as a hobby. Reading comparison and comments on Internet is never as good as listening to real people talking straight out of their minds.
Apple’s iSync and Nokia do not support this model for syncing via Bluetooth. I did some research and found the 6300 is using Nokia’s Series 40 software and there are many similar phones have been supported. I need to do a hack to iSync so I referred to the following sites:
- Koos Kasper.nl: How to iSync a Nokia 6300
- dabgotra.com: Nokia 6300, iSync, and Contact Photos…
By following Koos’ hacks, I managed to setup Bluetooth link and iSync away in less than 2 minutes. Now, my 6300 is populated with so much data from my Calendar, To-do and Contact. I have yet to try dabgotra’s hacks to iSync contact with photos.
I lost my cell phone
I had to go to one of my client’s outlet at Sentral Melaka to service their IP camera. When I arrived at the outlet, I received an SMS from LA followed by a phone call from Richard. He asked me lot of questions about his insurance claim and also to thank me for providing assistance and information about his insurance claim. I remembered clearly I put my Sony Ericsson K700i which I bought in 2005.
I was a Nokia user before switching to SE because I read about how seamlessly SE K700i syncs with Apple’s Mac OS X applications via Bluetooth. The SE K700i is a very nice phone with many features I love about. One of them is K700i can be used as a remote control for Apple’s Keynote presentation software. The control is via Bluetooth as well.
Soon when I realized it was not in my waist pouch, I quickly dialed the number using another phone. The phone had been switched off. Total silence. It’s gone! A phone which has been my friend for almost 3 years is now gone.
I went back to the outlet after taking Dmitry from school and the staffs told me they didn’t see it. Disappointed.
Safari 3
I updated to Safari 3 two days ago. It is included in the free 10.4.11 (Tiger) software update. Although it is still in Beta, it is already usable and it has got many features which I like.
- Movable tabs - It is sometime a need to rearrange the tabs according to the tasks I am working with on the browser. When I was too tangled up with web projects and web browsing, I used to like Firefox as it allows to rearrange tabs.
- Reopen all windows from last session - This is another handy features which you can reopen web pages where you left off after say, you accidentally closed the browser. Again, I don’t need Firefox anymore.
Rendering of Chinese characters on Safari is the most superb. No web browser can beat Safari. This is another great reason why I still stick with Safari.
Leopard unleashed!
Apple has unleashed Leopard (Mac OS 10.5) last week. It’s an awesome operating system beating all other OS flat out! New features such as time machine, desktop space, interoperability with Apple Mail and many more.
Time Machine is a repository with version control system to keep track all the changes to your files and directories. When you plug in a FireWire hard disk, Leopard will automatically version all your files and directories onto the external hard disk. You are able to go back in time to look for a file (or directory), which you have deleted or modified, and to restore them.
Desktop Space gives you more desktop spaces to organize your works on the screen. It makes switching from task to task simple and easy with a click of the mouse.
It will be a nice upgrade but if you are developing software with Ada, unfortunately, you have to wait for a while. Ada does not come with xcode yet. The folks at MacAda is still working on a stable and working version of Ada compiler.
Safari vs. Firefox
Last November I blogged about Firefox 2 here. I love Firefox but it is too buggy and slow in execution. Safari remains as my main choice of web browser. When inputting Chinese character, I will definitely for sure to use Safari. Its Chinese support is superb compared to Firefox. In Firefox, some of the Chinese characters cannot be displayed properly. Safari now supports inline spell checking. Although, I still use Firefox once in a while for some reasons, Safari remains my favorite web browser.
HOWTO - Building GtkAda project with xcode
My current project (here) requires to develop a GUI application for displaying some JPEG images. I intended to develop a native Mac OS X GUI application using Carbon or Cocoa. Since there is no Cocoa binding in Ada, I narrowed down my option to Carbon. I hit on the wall of frustration where Carbon binding on MacAda.org is very old and supports only gnat-3.3 and PPC (I hope I am not wrong on this).
I have to turn to Gtk+ which will require GtkAda and X11 on Mac OS X. I compiled my test code written for GtkAda very well on console. But when I imported the codes into xcode project, it did not compile. I got the following errors:
error: "gtk.ads" must be recompiled ("a-except.ads" has been modified)
error: "gdk.ads" must be recompiled ("a-except.ads" has been modified)
error: "glib.adb" must be recompiled ("a-except.ads" has been modified)
error: "glib-object.adb" must be recompiled ("a-except.ads" has been modified)
error: "glib-type_conversion_hooks.adb" must be recompiled ("a-except.ads" has been modified)
error: "gtkada.ads" must be recompiled ("system.ads" has been modified)
error: "gtkada-bindings.adb" must be recompiled ("a-except.ads" has been modified)
error: "gtkada-c.adb" must be recompiled ("system.ads" has been modified)
...
I sought help from GNAT-OSX mailing list (September 2007 archive), but there was no avail. I spent many days investigating the cause of the errors. I found out that gtkada source codes would be compiled and produced .ali and .o files in the build directory when I used gnatmake to build my GtkAda application.
$ gnatmake testproject.adb `gtkada-config`
To build a GtkAda project in xcode, follow the instructions below:
- In the project browser, under the Group & Files column, locate Targets and the your project name. Right click your project name and select Add Link Binary With Libraries. Select GtkAda libraries from /opt/local/lib/gtkada and necessary libraries from /opt/local/lib.
- Select your project name and click on the Info button. In Build tab, select Search Paths under Collection. Include /opt/local/include/gtkada in Header Search Paths. Also include /opt/local/lib and /opt/local/lib/gtkada in Library Search Paths.
- Select Source in your project. Select Add to Project … in Project menu. Include all the GtkAda source files in /opt/local/include/gtkada.
HOWTO - Installing gnat-4.3 on Mac OS X
Perhaps someone has written this before but it seems no where to be found. So I just write a simple HOWTO about installing gnat-4.3 on Mac OS X.
My installation is on MacBook 2.16GHz Intel Core 2 Duo running Mac OS 10.4.10 with Xcode 2.4.1. Pre-requisition is to have Xcode installed before installing gnat-4.3.
- Go to MacAda.org to download gnat-4.3 and other necessary tools. Launch the installation in the disk image.
- Make the following softlinks:
$ ln -s /usr/local/ada-4.3/bin/gcc /usr/bin/gcc-4.3 $ ln -s /usr/local/ada-4.3/bin/g++ /usr/bin/g++-4.3 - Launch gcc_select:
$ sudo gcc_select 4.3
Ubuntu Feisty Fawn
A few months ago, when fornax’s hard disk was dead, I upgraded it from 40GB to 160GB and installed Debian Etch. Debian Etch has once again boosted my confidence about Linux. The graphical desktop was working up to my expectation. It could support up to 1280 x 1024 resolution! Upgrading Debian is easier compared to other Linux distros like SuSE, RedHat and etc. Actually, I quite like Debian to power fornax as an alternative development platform and also for some general purpose computing and testing purposes. I did not blog about my Debian installation a few months ago. I should blog about Ubuntu installation to record my experience.
Today, after some months, reinstalled fornax again with Ubuntu 7.04, code named Feisty Fawn. The UI is even more superb than Debian. Everything has been nicely done and packaged. To my surprised, I can run KDE applications from Gnome’s menu. This could not be done in Debian and some other Linux. How nice!
As the matter of fact, I did not like Gnome very much because KDE applications would not appear in Gome’s menu. Ubuntu has changed my perceptual experience about Gnome and once again Linux!
I find Ubuntu has more human touch than any other Linux distros. I also find that Ubuntu is very closely competitive with Mac OS X!
Really, I have download Ubuntu’s alternate install CD in June but I had never had a good reason to install Ubuntu over Debian. This morning, I had to install and configure many software, for instance, Subversion, apache and many other software development tools; it gave me a good reason to install Ubuntu. Not because Debian did not have all these software packages (Ubuntu is based on Debian), it was because I had to do most of the tasks which were almost like installing a fresh system.
Ubuntu’s installation is easier than Debian and faster. I had it up and running in less than 20 minutes!
Now, fornax has once again become my Linux development platform as well as SCM (Source Code Management) server. Oh! I run ktorrent for downloading movies as well. It really flies and sucking all the bandwidth. I have to stopped ktorrent whenever I want to work on Internet.
Adrenaline Hack
Wow! I’ve done it! Yes! Yes! Yes!
After a successful hack to receive a server-push JPEG stream from a video server (more story here), the next challenge for me was to display the JPEG in a GUI window.
I have been trying to get Carbon binding to work with gnat 4.3 on xcode but I am forced to abandon it for a while. I switched my target to GtkAda which will require X11 on Mac OS X. One plus side is that my application will be platform independent if I use Gtk/GtkAda. That means my application can be compiled and run on Linux, Solaris and Windows with the platform-independent GUI. More business may be and hopefully.
I was working to get GtkAda to work on my Mac since yesterday but I had corrupted some of the files I installed with Fink. Fortunately, I have a backup (actually I copied) on my MacBook but I guess I won’t need it anymore since the Gtk+2 and GtkAda are working on my Mac Mini. I will delete the copy on my MacBook later and install it with the working Gtk+/GtkAda.
I spent the entire morning and noon to write a single window, stripped down application to display the JPEG image I downloaded using the application I worked on earlier. I could not get the result. After many hours of hacking, I finally got it to work!
It is so rewarding to see it happens and I have got a good dose of adrenaline today. The feeling is difficult to describe. So it is difficult for other people to feel the excitement and the rewarding state of mind I am into.
The next challenge is to write an experimental application to continuously receive multiple streams of JPEG images and display them in multiple frames in a window, the last and toughest task with parallelism involving socket and GUI. After this, comes the serious software development by integrating all these experimental applications into a nice GUI application.
A Petition To Apple
I have been on and off using Ada (gnat) on Mac OS X. The folks at MacAda.org are doing a great job. Thanks to Jim Hoppers, Andrew Reynolds, Mike Feldman and others.
It has been years since Apple rolled out Xcode, an integrated development environment. Xcode is heavily centered around Objective C and Cocoa. MacAda.org, a group of Ada enthusiasts, took on a NDA (Non Disclosure Agreement) with Apple and integrate Ada, based on gnat, into Xcode. This is very encouraging for developers who develop on Ada to switch to Mac.
I have been developing some Ada standard tools (console applications without GUI) on Mac with Xcode. I am kind of on and off of Ada on the Mac. Every each time when I come back with a project with Ada on the Mac, I will find inconsistencies and between Ada and Xcode.
The support of Ada-Carbon is really hard to follow up with. Even the MacAda’s website does not provide enough information and a proper link to the Carbon binding. The easiest way to develop a GUI application using Ada on Mac is using GtkAda. But getting GtkAda built and installed will require tremendously arduous work to build and install Gtk+ first. And running the GtkAda application will require X11 and of course Gtk+. The application will not be Mac native application.
I (and many others too) would love to see Apple really makes serious consideration to incorporate Ada into Xcode as a de facto standard. Here’s the list:
- Makes Ada comes with Apple’s Xcode so that there will be a consistency with every updates from Apple and not from 3rd party website such as MacAda.
- Enable Xcode to create Cocoa and Carbon projects with Ada bindings.
- Support Core Data Application project using Ada.
Any Mac Ada developers who wish to add to the list, please feel free to post your comments. Thank you!
Server-Push JPEG Stream
I am working on a video server project since last week. This project is to develop a client software running on Mac OS X to control a video server and to retrieve streams of JPEG images from it. And of course, I am going to develop with Ada together with AWS (Ada Web Server).
Up to this point, I am able to connect to the video server with AWS and retrieve a stream of JPEG images from the video server. I have been able to manually extract JPEG images from the stream identified by SOI (0xFFD8) and EOI (0xFFD9). But some of the images extracted from the stream are not recognized as JPEG file while some images appeared to be corrupted. I am totally puzzled by this behavior.
Could it be the size of the stream buffer (512 bytes) causing the corruption? Could it be the output of the received stream to a disk file delay the receiving process?
Here’s a snip of my Ada code:
...
Data : Ada.Streams.Stream_Element_Array (1 .. 512);
...
loop
AWS.CLient.Read_Some (Connection, Data, Offset);
exit when Offset < Data'First or Count > 512_000;
Ada.Streams.Stream_IO.Write (File_Handler, Data);
Count := Count + Integer (Offset);
end loop;
...
It is quite fun spending entire day hacking the server-push stream and the JPEG images. It has been a long time since my last hacking. Welcome back to the reality!
My first experience with Mac Book
Yesterday I took Uranus out to work. This was the first time I really worked on the new Mac Book after hours of installation, testing and playing.
The Mac Book sports a 2.16GHz Intel Core 2 Duo, 1GB memory, 120GB hard disk, 13-inch wide screen, double-layer super drive, 1 firewire, 2 USB, bluetooth, Wi-Fi 802.11G and wired Ethernet.
It runs some applications a little slower with 1GB of memory comparing on Pluto (Mac Mini) with 2GB of memory. Otherwise, performance is quite good with fast responsive.
The only setback is the 13-inch cinema type wide screen clear LCD display. It is difficult to read the screen when use in a bright area. The reflective clear surface of the LCD makes reflection uneasy to the eye. At dim light area, the screen looks crystal clear and crispy. The screen is also a little too small to my eyes, especially after my eye surgery (because of retinal detachment and cataract) with some defective vision (perfect straight line is seen crooked). Otherwise, the LCD is a good form factor for a notebook computer to snug tightly and comfortably in your arm or in a backpack. Compare with the Apple G3 iBook I previous owned, I preferred the 14-inch LCD to this 13-inch wide-screen. But I guess it will be comfortable for me after sometimes of adaptation.
The Firewire transfer during the first initial setup does not copy the entire hard disk from an old Mac. Many programs which I used daily were not copied. One of them is the indispensable X11. I had to install it from the installation CD. The others were Xcode and its supporting packages.
The sound system is really below my expectation. Its speakers are carefully conceal at the air vent at the back (the LCD hinge). The volume it generates is really too low and the sound can hardly be heard in a noisy environment even I have increased the volume to maximum. At 4 bar below maximum, the sound appears to be a little “sizzling”. Not so good for multimedia presentation in a noisy environment.
Overall, I am happy with the new Mac Book. I have again reclaimed my computing mobility after 11 months since my previous iBook died. Again a formidable road warrior who likes to work 20,000 feet above sea levels.
Uranus goes live!
Uranus is my new Apple Mac Book! Named after the 7th planet in our solar system.
This morning, I took the new Mac Book out of her packaging. She was wrapped with a thin and tight cloth-like material. I plugged in the power supply to charge the battery. At 07:07:07 on 07/07/07, I pushed the power button and she came alive. Booting up with excitement. Then, I started the first round of data exchange, copying applications, user’s accounts and files, preferences and all other files from Pluto, the Mac Mini, to Uranus.
After making a copy (almost a mirror copy) of the data, the installation of Mac OS X was completed on Uranus and I started to logged in.
Then I started 2nd round of exchange, connecting to the Internet to update the Mac OS X on Uranus (she comes with 10.4.9 and I have to update to 10.4.10). After downloaded some files, the updates were installed and Uranus was restarted.
Then I started the 3rd round of exchange. Setting up rsync so that I can sync my data between Uranus and Pluto. When I need to go out with Uranus, I can sync files from Pluto to Uranus and bring along the latest files with me. After I worked on some files on the go with Uranus, I can sync back to Pluto when I am home.
The 4th round of exchange was to setup remote links to the other Linux and Solaris boxes.
The 5th round was to install some software which was not copied to Uranus in the 1st round of exchange.
The 6th round was to reload some files archived earlier which were not found on Pluto.
The 7th round was to make a copy of both hard disk to a USB hard disk using rsync.
Exhausted after 7 hours of setting up and testing.
MacOSForge
I came to know about MacOSForge from Apple’s website a few months ago but this site was not completely up yet. Yesterday, I received an email about MacOSForge from a friend of mine. I was very excited to see MacOSForge to take off.
MacOSForge is Apple’s initiative to create an open source software development community for Mac OS X. Well done Apple!
I hope I would have some projects and more time to contribute to MacOSForge. Perhaps I can make a recipe on how to toast an Apple pie.
Peculiar behavior of Sed
What is Sed?
Sed is the ultimate stream editor. If that sounds strange, picture a stream flowing through a pipe. Okay, you can’t see a stream if it’s inside a pipe. That’s what I get for attempting a flowing analogy. You want literature, read James Joyce.
Anyhow, sed is a marvelous utility. Unfortunately, most people never learn its real power. The language is very simple, but the documentation is terrible. The Solaris on-line manual pages for sed are five pages long, and two of those pages describe the 34 different errors you can get. A program that spends as much space documenting the errors than it does documenting the language has a serious learning curve.
You can read more about Sed here.
My project uses a thick binding of PostgreSQL/MySQL called APQ. APQ is a project by Warren and I helped to host it at my server. See my post here. The configure and make process are not really stable which I think is due to various version of MySQL and the Linux tools such as sed.
To build APQ, first, two MySQL include files, errmsg.h and mysqld_error.h need to be parsed. These files contain MySQL error codes and they need to be parsed and translated into Ada syntax. This translated Ada code will be inserted into apq_mysql.ads.
However, this parsing and translation process are not working correctly as they supposed to be. When I look into this problem, I found a peculiar abnormality. The parser uses sed. When I built APQ on Mac OS X, FC5 and Solaris (Intel), the result in apq_mysql.ads is not consistent on these different OS.
After I upgraded to Mac OS X 10.4.9, the parser refused to work with some error messages which I think caused by sed. I was mingling with the configure script until this hour. Suddenly, something struck my mind. Why do I need to mingle with configure? The problem is the parsing and it deserves the highest priority. The build configuration does not perform a thorough check of the environment but it still works fine at this point. So, I moved my priority to write a parser in Ada to solve the parsing problem. This light shed on me at this whee hour in the morning and I was really too tire to continue working on the parser.
Apple wireless keyboard
I bought an Apple wireless keyboard on Monday. It is a real beauty and works seamlessly with Mac Mini Bluetooth.
The keys are crisp and there is no sticky key. The white keyboard is pleasant to look at but it can be a real hassle to clean. I tried to look for a keyboard cover which is made of silicon and molded according to the keyboard but seems like it is selling like a hot cake.
With this keyboard, typing is absolute pleasure. I was using a keyboard from one of my Compaq PC and the feeling is not comparable.
The installation and setup is a breeze. Just pop in 4 AA batteries. The power switch is located at the bottom of the keyboard. Switch it on for the first time and click Set up Bluetooth Device and in a few seconds, you will be prompted to enter pairing code on the wireless keyboard. As soon as you press Enter, you are on your way enjoying the keyboard. To conserve batteries, it will be a hassle to switch the keyboard on and off. It will be nice if the power switch is conveniently located at either side or at the back of the keyboard.
Building wget for Mac OS X
wget is a very useful utility. It can retrieve files from the web using http or ftp protocols. Unfortunately, it does not come natively in Mac OS X. I had occassionally tried to use wget to download some html pages from some websites a few months ago but wget just wasn’t there. I was kind of lazy to download and compile the source until today, when I needed to download some 50 files from a website. I needed wget badly.
It took me not more than 5 minutes to download, build and install. I downloaded the latest and stable version 1.10.2 on Mac OS X 10.4.8.
- Download the source from http://ftp.gnu.org/gnu/wget/
- Unpack the tarball tar xzvf wget-1.10.2.tar.gz
- This creates a director wget-1.10.2. Change the working directory to it: cd wget-1.10.2
- Configure the build: ./configure
- Build: make
- Install: sudo make install
- wget should now be in /usr/local/bin
Cocoa Bindings and Core Data Workshop
The workshop was conducted by Leon at Apple Malaysia office at Bukit Damansara today. It was a really nice and productive workshop. I had experience in C/C++ long time ago then I moved to Ada sometime in 1995. I was first exposed to Objective-C during this workshop. Although I am not really interested in C and other C-derived languages, I do find Objective-C better than C++. Objective-C is a message passing object-oriented language. I develop applications on Carbon with Ada bindings. Cocoa is a object oriented native framework of Mac OS X build on Carbon which is procedural native framework in comparison.

The workshop at Apple Malaysia.

Leon (light blue) helping Peter to solve problems.

That’s me working on Cocoa and Objective-C.

K.K. Chan (with eye glass) gets his hands on Cocoa.

Chris (front) from DevSIG.

Brian from SuavéWare.
Leon, thanks for the productive workshop. I look forward to more Cocoa workshop particularly MySQL framework in Cocoa. More photos here.
First hand on Objective-C and Cocoa
I am attending the Cocoa Bindings and Core Data Workshop at Apple Malaysia. This is the first time I look at Objective-C which is a superset of C. Objective-C is object-oriented. I personally find that Objective-C is safer than C++ at the first look but it is essentially still C which inherits all the unsafe features and properties of C.
On the other hand, Cocoa is really powerful and flexible to develop GUI application on Mac OS X. The only drawback is that there is no Ada binding for Cocoa. And I still very much prefer Ada than C and any C-derived languages.
Right at this moment, I am still keeping my option open as Cocoa is quite nice to use in developing GUI applications for Mac OS X.
A quick search on Google and I find a project on Google Code. The project seems not taking to any height. The project can be found here.
Seashore
Seashore is a graphics tool for Mac OS X. It is an open source image editor based on Gimp and does not require X11. It runs natively on Mac OS X Cocoa. Seashore is also a stripped down version of Gimp without script-fu. One obvious advantage of Seashore is that it loads quicker than Gimp. Download Seashore here.
Compare to Gimp, Seashore runs much slower on and uses more CPU resources than Gimp. I prefer Gimp because of its speediness and scripts. Script-fu is also known as macros as in Windows but is more powerful than macros. Script-fu is based on an interpreting language called Scheme. You can do all kinds of things with script-fu and will probably use it for automating things that:
- you want to do frequently.
- are really complicated and difficult to remember.
You can do a whole lot with script-fu. The scripts that come with Gimp are quite useful and can be handy at times.
Download Gimp here.
Mac Mini USB port hangs!
I tried to connect a USB card reader via an USB extension (1 to 1 port) which was connected to one of the USB port on Pluto. The power light on the reader came on and I inserted a CF card into the reader. The light on on the card slot did not turn on. I tried many times and still could not mount my CF card.
I unplugged the USB extension and connect the card reader directly to USB port and it was still unmountable. I unplugged the optical mouse from another USB port and plugged it into the troubled port. The red LED of the optical mouse did not turn on. I tried with a keyboard and had no response on the keyboard.
Finally, I decided to restart Pluto. After the restart, the troubled USB port works again. I wonder what caused the USB port to hang. Is it the USB extension? Is it a software glitch? I sure hope that it is not a hardware problem.
Cease development on SGI’s IRIX
After a 30 minutes discussion with my co-workers, we have unanimously decided to cease all development on SGI’s IRIX. We began developing applications on SGI’s IRIX about 5 years ago because of demands in 3-D graphics visualization. We used Ada to implement our 3-D visualization solutions.
With today’s availability of powerful microprocessor such as AMD and Intel 64-bit processor, SGI’s hardware has become too expensive too invest and maintain. Another reason is the difficulty to find tools such as gnat Ada compiler. The download site usually provides out of date version that makes maintaining the consistency of compiler versions across other platforms difficult.
This decision should have been made long time ago. A lot of time and resources had been wasted in maintaining existing software and development of new applications. Our clients’ decisions to migrate to Opteron and Mac OS X based platforms have also contributed to this decision. We expect zero or next to zero porting problem because we are using portable technologies such as Ada, GTK+, GtkAda and OpenGL. This decision enables our development to focus on both Opteron (Solaris and Linux) and Mac OS X platforms.
Firefox 2
Mozilla has released the long awaited Firefox 2 web browser. Firefox 2 is a major upgrade to its popular and acclaimed free, open source web browser. I just finished downloading and installing Firefox 2 on my Mac OS X, Linux and Solaris 10 x86 machines. I noticed improvement in performance, speed and user interface compared to version 1.x.
Firefox 2 has made web browsing easier and delivered best online experience. On Mac, I use both Safari and Firefox for my browsing. Unfortunately, Safari is not really working together with WordPress. For example, I lose all the editing functions when I write my post. The editing functions panel is not displayed in Safari. In the contrary, Firefox 2 displays the editing functions panel and I am able to access these functions by clicking on the icons. Firefox 2 allows me to easily write my posts.
I have not been using any Microsoft products since I completely ditched Microsoft in 1998. The only product that I had on my Mac was IE, Microsoft’s web browser. In terms of performance, speed and security, IE really sucks. I have deleted IE on my Macs and replaced with Firefox.
Mozilla makes improvements to the user interface, security tools and options for customization, combine to deliver rich, engaging, safer and more productive web browsing experience for all.
One feature I like most in Firefox is its ability to view background image and page info. These are valuable tools for web development. Another feature I use most is displaying my browsing history in the sidebar which allows me to browse my history side-by-side with web pages.
Tabbed browsing has become a de facto standard feature in most modern web browser. Mozilla has changed the user interface of tab and allowed moving tab to any position you like so that you can arrange the pages you are browsing according to your priority. Another plus for Firefox 2 which makes web browsing more productive. Apple’s Safari does not allow moving the tab.
Another good selling point of Firefox 2 over Apple’s Safari is the built-in spell checker in input fields. Firefox 2 will underline misspelling inline and is very useful for blogging. With Firefox’s built-in spell checker, there is absolutely no necessity to install additional plugins for blogging tools such as WordPress.
Although Apple’s Safari is also a nice web browser, it still needs some patch up to be on par with Firefox 2. The only best feature in Safari is its excellent support of international character encoding. Apple has done a great job not only in Safari but in Mac OS X and applications as the whole.
So much on the features that I like most and often use. I will let you to discover Firefox 2 yourselves.






