Coding for OS X and iPhone – Part II

After fighting with Dashcode for about 24 hours, I quickly discovered that most of my problems involved overthinking the problems. For example, after scouring Google for solutions to load and reload images from the web into a image containter the answer was so trivial that I missed it several times.

URL = “http://www.example.com;
document.getElementById(‘picture’).src = URL;

Where “picture” is the name of the image container in the layout.

After fighting with Dashcode for about 24 hours, I quickly discovered that most of my problems involved overthinking the problems. For example, after scouring Google for solutions to load and reload images from the web into a image containter the answer was so trivial that I missed it several times.

URL = “http://www.example.com;
document.getElementById(‘picture’).src = URL;

Where “picture” is the name of the image container in the layout.

After looking at XMLrequestHTTP and other procedure calls, this was a rather trivial answer to something I beat my head against for 3 hours. It is clear the single issue about dealing with multiple types of object oriented programing is correctly identifying the object properties and there Getters and Setters.

BC Ferries WebCams Dashboard Widget available for download

BC Ferries WebCams on you iPhone can be reached by browsing to http://maxwest.net/releases/BCF/

Further developments on these and other projects will be posted to the Software Forum

Questions and comments to customer@maxwest.net

The crappy old version – BC Ferries Widget

A long time ago in a galaxy far away there was a concept of ‘Widgets’ taken from product lore and applied to the computer interface. The first widespread use I ever had was with a tool called Konfabulator (which today lives on as Yahoo Widgets)

A long time ago in a galaxy far away there was a concept of ‘Widgets’ taken from product lore and applied to the computer interface. The first widespread use I ever had was with a tool called Konfabulator (which today lives on as Yahoo Widgets)

There were a number of interesting applications but one I used as a frequent Ferry traveler was a webcam app that looked at the Ferry lineups. Orignally posted by Richard Smith based on an update of some Ottawa webcams widget. BC Ferries Widget – Yahoo It later broke when BC Ferries updated their site and in the absence of any other updates I stepped in and updated the code and redistributed it.

There are now about 20 different ‘widget-thing’ environments. When Apple subsumed the widget into the operating system with the inclusion of Dashboard. I made a feeble attempt to move my previous effort over. While it worked it was a bit of a cludge. (Slightly revised Dashboard version)

This largely ported the old Javascript code to the Dashboard environment as is. It doesn’t really use the standards of Apple’s Dashboard.

Enter Dashcode; this is the development environment that is availble from Apple Developer Connection to create Dashboard Widgets. It is laughingly simple in some respects and the ability creating a few one-off applications for your own use is a massively underutilized part of the OS X environment.

The other factor in Dashcode is it can also be used to deploy to the iPhone (+ iPod Touch). While coding has never been a main part of my work – the thought of creating tools that you can run on your cellphone is just too cool to pass up. So the short term goal is to re-write the old BC Ferries Widget using the standard conventions of Dashcode and hopefully port it as an iPhone app. Documenting what I can about the sucesses and failures for all to see – here.

Coding for OS X and iPhone – Part I

While there are a massive number of environments, scripting languages, and APIs that are designed to make programs lives ‘easier’, it is impossible to even keep up with more than a couple.

While you can get involved in several they all fall into a a relatively few categories

  • Application Programming – full blown implementation for desktop operating systems. Using a common programming language like C and yypically relying on the OS APIs to manage the user interaction

While there are a massive number of environments, scripting languages, and APIs that are designed to make programs lives ‘easier’, it is impossible to even keep up with more than a couple.

While you can get involved in several they all fall into a a relatively few categories

  • Application Programming – full blown implementation for desktop operating systems. Using a common programming language like C and yypically relying on the OS APIs to manage the user interaction
  • Web Application – Server side coding where the user interaction happens through a client usually a web browser.
  • Scripting – the use of a language that can apply to one or more environments to provide automation handle small process, lives within other environments
  • Widgets – programs that live within a reduced environment such as Adobe Air, Google Gadgets or Apple Dashboard

For those working in Mac environments (including iPhone) there are a host of common tools that meet those functions

  • XCode is the GUI tool for the primary Programming environment in Mac OS X, it uses Objective C as its language
  • DashCode is the Widget environment for both OS X and the iPhone
  • Automator is the GUI tool for scripting within the Operating systems and Applications

Provided you have a computer and operating system that supports the current tools. All of these are availble freely from Apple’s Developer Connection (subject to free registration)

In addition there are several good getting started sites

Resources

Quad boot – Octo Mac Pro, Part IV

To paraphrase Sean Connery (from the Hunt for Red October) … “once again we play our dangerous game against our old adversary” ….. Installing Windows Vista on the Mac Pro.
Apple install

To paraphrase Sean Connery (from the Hunt for Red October) … “once again we play our dangerous game against our old adversary” ….. Installing Windows Vista on the Mac Pro.
Apple install

The basic install of Windows Vista was uneventful, althought it did required about 4 reboots and about 1 hour to complete. Once the install was complete the functionality, including things like Aero Glass were there without any special work. To get the drivers specific to the Apple hardware (especially thing like wireless and bluetooth) I did install the drivers from the current version of the Boot Camp Assistant

The Vista installation was based on the 32-bit version which still is likely the common version deployed. The benefits of the 64-bit version (other than addressing the memory issue mentioned earlier is not really clear.
Not enough RAM

Vista does recognize the 8 processor cores and appears to use all reasonably well.
Vista Task Manager

After running the Performance test under Vista the score ended up at 4.0. This actually went down fom 4.3 after initial install due to poorer graphics performance. Leading me to believe the native Windows drivers did better with the 7300GT NVidia card than the Apple drivers installed by boot camp.

Performance

So with Mac OS 10.4, 10.5, Windows XP and Vista the Mac Pro is now capable of the Quad booting operating systems. It will be interesting to see which one (if any) produces better performance.

But next … OS madness with Parallels and VMware in the OS within and OS department.

Quad boot – Octo Mac Pro, Part III

The installation of OS X 10.5 was without drama. Unfortunately , the post-installation was also without any drama – you kinda wanted Zing after a new OS. The result was a slightly slicker version of 10.4. There are a couple of noteable additions to the interface. The menu bar now boasts an eject button. Just to the right of the ‘Spaces’ (Virtual Desktop) selection
Leopard w/Spaces

The installation of OS X 10.5 was without drama. Unfortunately , the post-installation was also without any drama – you kinda wanted Zing after a new OS. The result was a slightly slicker version of 10.4. There are a couple of noteable additions to the interface. The menu bar now boasts an eject button. Just to the right of the ‘Spaces’ (Virtual Desktop) selection
Leopard w/Spaces
I guess the ‘dragging disks to the trash’ metaphor finally wore a little thin.

The Desktop shows a use of 3-D effects all over, most notable in the dock Leopard Dock

So without revisiting all the items that have been covered elsewhere, on to the Boot Camp stuff.

In preparation for the Windows Vista install I ran the BootCamp assistant. I specifically wanted to try the partitioning utility.
Boot Camp3

This did successfully partition the 250GB drive to allow a 75GB parition for the Windows install. Then boot the installer for Windows.
Boot Camp3

Quad boot – Octo Mac Pro, Part II

The inital installs of Windows on the Mac Pro was successful. Unfortunately the Windows XP installation only recognized 2 of the 5GB installed. Apparently this is a known issue in Windows XP. Other than that issue Windows XP recognizes most of the hardware on the Mac Pro including all the Windows readable partitions on the harddrives attached to the system. The video, keyboard, DVD burner, and all connections; network, USB, and FW are supported.

The inital installs of Windows on the Mac Pro was successful. Unfortunately the Windows XP installation only recognized 2 of the 5GB installed. Apparently this is a known issue in Windows XP. Other than that issue Windows XP recognizes most of the hardware on the Mac Pro including all the Windows readable partitions on the harddrives attached to the system. The video, keyboard, DVD burner, and all connections; network, USB, and FW are supported.

Since the goal here is to create a full multi-boot system, the next step was to look for the next generation of OSes. The Mac Pro is now running OS X (10.4) and Windows XP (SP2). So what’s next …. Vista and Leopard

So while I’m in Windows XP, I thought it would be fun to run the Vista Upgrade Advisor.

The upgrade advisor didn’t have much to say about my hardware, as much of it didn’t seem to be recognized. It complained about Nero but the rest was viewed as okay.

Again the upgrade advisor (like XP) only sees the 2GB of memory. But even under Vista my 5GB of RAM is wasted

From http://support.microsoft.com/kb/929605/en-us Title: The system memory that is reported in the System Information dialog box in Windows Vista is less than you expect if 4 GB of RAM is installed

“The reduction in available system memory depends on the devices that are installed in the computer. However, to avoid potential driver compatibility issues, the 32-bit versions of Windows Vista limit the total available memory to 3.12 GB.”

Next …. installing the next cat

Quad boot – Octo Mac Pro, Part I

The FEDEX gnomes kindly deposited a shinny new 8-core Mac Pro on my doorstep last week and I have been working through the usual migrations of data from old to new systems. The main reason for this purchase was to get multi-OS capability in native booting. And, like Apple’s quarterly financials – results were better than expected.

The FEDEX gnomes kindly deposited a shinny new 8-core Mac Pro on my doorstep last week and I have been working through the usual migrations of data from old to new systems. The main reason for this purchase was to get multi-OS capability in native booting. And, like Apple’s quarterly financials – results were better than expected.

The machine came installed with 10.3 on the internal 250GB drive. I added two other SATA drives that had been languishing in my file cabinet. A 250 out of my old G5 and a 160 out of my Athlon 64. While the 10.4 version on the G5 drive wouldn’t boot the new machine, the Windows XP on the former PC did (almost) and that is what is really interesting.

A drive that had been running in an AMD x64 system, dropped unprepared into my Mac Pro, did actually manage to boot. Unfortunately I couldn’t tell how far it could get because at the ‘Loading your personal settings’ stage it complained about Windows activation. That is the point I found out the Mouse and Keyboard were non-functional – give that the old machine had PS/2 style input devices not USB.

All was not lost however. With a boot of the Windows XP disk, I went through the steps to a new windows install. At the point where it would normally ask about formatting a drive, the installer states it had found a Windows install and would I like to repair it. – Sure go ahead. And after 20-30 agonizing minutes it finished.

With a basic reboot the machine came back – again almost. It got to the windows desktop, in horible 4-bit 640×480 display settings. However all was not lost, I had made a copy of the Boot Camp device drivers and with a few more install minutes I had a functioning copy of Windows XP awaiting activation. With all the programs and files from my Athlon 64.

Battledfield 2, Flight Simulator, MS Office, all seemed to run as they had before. Settings and user configuration included.

That was somewhat amazing to me because I had not thought of Windows installs as overly portable. And the thought of taking a boot drive out of a old PC and get it to boot a new Intel Mac was not what I expected.

Drupal 5 Migration Complete

After a little waiting for some contributed items to get updated, the site is now running on Drupal 5. The improvements in the backend are awesome and new functionality is everywhere. I will try to avoid turning too much on.

Again the good folks at Lullabot are always showing the neat stuff. Such as the new diff capability that gives wiki like change management.Check out the screencast here.

Parallels Virtualization Software released

Parallels Desktop for the Mac was offically release today after a few months of public beta. Running operating systems like Windows XP, Suse and Ubuntu. The release version implements the hardware-based virtualization that is part of the Intel Core Duo chips. This feature was not enabled in the beta. Attempts to run the Vista Beta 2 were unsucessful leading to and ACPI error when booting from the install DVD.

Application testing with Office, Quicken, and Simply Accounting has been very sucessful. Simply Accounting was an application that stubornly refused to work in other emulators.

Parallels Desktop for the Mac was offically release today after a few months of public beta. Running operating systems like Windows XP, Suse and Ubuntu. The release version implements the hardware-based virtualization that is part of the Intel Core Duo chips. This feature was not enabled in the beta. Attempts to run the Vista Beta 2 were unsucessful leading to and ACPI error when booting from the install DVD.

Application testing with Office, Quicken, and Simply Accounting has been very sucessful. Simply Accounting was an application that stubornly refused to work in other emulators. Overall performance is good with no obvious interface lag and the responsiveness is on par with a contemporary PC.