Mac Programming is Driving Me Nuts!

September 26, 2010

I’ve been writing computer programs since the old Timex Sinclair 1000 came out when I was in Middle School back in the 70’s. Back then it was some form of BASIC language that was stored and loaded from cassette tape. Over the years I’ve learned several languages such as Fortran and C, as well as scripting languages such as tsh, Perl, Javascript, etc. I’ve written programs for the Pocket PC and later Windows Mobile devices, as well as UNIX X11 apps and Microsoft Windows (WIN32) apps all using straight C programming. Recently I’ve written several apps for the Palm Pre/Pixi WebOS smartphones using Javascript and various HTML5 components.

Since switching from a Microsoft Windows PC-based system to an Apple iMac, I’ve decided to explore writing applications for my Mac as well as the iPhone/iPod Touch and iPad devices. Fortunately, Apple supplies the development system (IDE) free with every OS X installation disk, so it would be no added expense to have all the compilers, etc. to create Apple applications.

I understood that programming for the Mac is done using “Objective-C”, so I purchase three programming books on the topic (as recommended on Amazon.com) to get me up to speed. So this weekend I’ve been reading parts of each of these three books and working through the various included examples. I have to say that after three days with this stuff I just want to scream!

I’ve been programming in straight C for over 20 years, and haven’t done much with C++ (which is a superset of C that implements Object Oriented Programming), so the OOP stuff is new to me. I thought I knew the basics of OOP, but after going through the Objective-C material I’m totally lost. Putting everything in classes with the @interface/@end and @implementation/@end notations, and the -/+ symbols before the method names is just nuts. Why make this so difficult? Am I just stupid? Maybe I should have bought the book, “Mac Programming for Super Dummies” because I just don’t get it.

I really like the Interface Builder tool which allows you to interactively create the application’s interface with buttons, text boxes, etc. But having to hook up those controls to the application via classes and objects is so convoluted.  It might seem easy, but to me it is very confusing and difficult to come back and maintain if put aside for several months.

At one time I did some Mac programming (with the Mac Classic OS) but this NextStep Cocoa Framework stuff is really complicated. I just wonder how are so many people creating iPhone apps for the Apple App Catalog? Am I just a big dummy and can’t get it? It sure seems that way right now.

Since I usually never give up, I’ll keep at it and see if all this nonsense will make sense to me at some point in time. I’m hoping all this convoluted Class stuff is limited to mainly the GUI, and if that’s the case I can use straight C programming for the bulk of my app and just brute-force my way with the GUI coding. I’ll also do a Google search to see if anyone else feels the same way as I, and has some saged advice on how to get through this rough patch of mine.

If you have any pearls of wisdom that you would like to share, I certainly do welcome it! 🙂

Update: After doing a search on Amazon.com I found this: Objective-C for Absolute Beginners: iPhone and Mac Programming Made Easy. So hopefully armed with this book I should make more headway into Mac programming. I’ll post an update after I receive the book in a few days and let everyone know if it is truly for “absolute beginners”!


On the road and staying connected

September 22, 2010

I’m currently on a business trip to Phoenix, and with the great tools available on the Internet I’m able to stay connected and operate efficiently. For example, I’ve got my Palm Pixi WebOS smartphone which has an app called Flight Predictor that helps me monitor any delays on return flight to Seattle this evening. I also can check my emails from different accounts and read up on news, weather reports, and Engadget tidbits (my favorite) all from my Palm phone.

I also have been using the LogMeIn Ignition application on my laptop which allows me to connect to my iMac at my home via the Internet. It seems to work very well, all though the screen updates are a little bit slow due to the slow hotel Internet connection. But, it is certainly usable for running applications and checking emails on my home iMac system remotely.

I also use the DropBox service which allows me to sync files between the cloud and all my computer systems. So certain important files on my home systems are automatically synced and made available on my Netbook system.

Whenever I have some downtime between meetings, I can duck into a local Starbucks and use my laptop or netbook to check my email or do a bit of work using their free WiFi connection. As a backup, I can always use my Verizon USB Wireless Adapter to connect my laptop/netbook to the Internet if WiFi is not available.

Of course, with all these electronic gadgets I need to bring along various charging adapters and cables to stay up and running. It can be challenging to find power outlets while on the go, so I keep my phone and laptop charging whenever I get a chance.

I definitely rely on my Palm Pixi smartphone as my main traveling tool. I use it to find places to eat, nearby Starbucks, gas stations, etc. which is very handy. The Sprint Navigation app is also a valuable asset, as I don’t need to bring along my dedicated GPS navigation device. After using these connected tools for a while, it sure would be hard to not have them!


Using VMWare Fusion for Windows 7 on a Mac

September 20, 2010

My recent conversion from a Windows 7 Professional Desktop PC to an Apple iMac has been a painless transition, where I’m close to shutting down my PC for good. There are only two PC-based applications which I currently still need to run on my desktop: (1) Password Manager Application, (2) Paint.net graphics application.

Fortunately, there exists a product called CrossOver which allows me to run certain Microsoft Windows applications inside of Mac OS X. CrossOver is based on the WINE WIN32 emulation and basically emulates the Windows calls for most of the Microsoft Windows system functions. So you aren’t running the full-blown Windows OS but still can run Windows applications. As such, running such apps with CrossOver is fairly quick on the Mac. CrossOver is a commercial product that normally sells for $40 US, but after the trial period ends they sent me an email offering the product for $20 US which I thought was a deal, so I purchased it.

Now, CrossOver worked fine for running my Password Manager application, as it was based on standard WIN32 calls and control libraries. So, I can start up my Password app very easily by just selecting the app’s icon from the Mac Applications Folder. I have to note that the buttons, and other various Windows controls look very Windows XP-ish (not Vista or Windows 7), and some of the fonts used in the app are a bit off, but neverthless the app runs quite well.

Unfortunately, I can’t run the Paint.net application using CrossOver since this application heavily uses Microsoft’s .NET technology. Apparently, CrossOver doesn’t have a way of emulating the latest .NET libraries so I’m out-of-luck with running my favorite graphics application on the Mac.

After searching through all the available native Mac graphics apps, I still can’t find anything that can do everything I need to do easily as with Paint.net. So, I tend to run back to my Windows 7 Desktop PC (using a Remote Desktop Connection from my Mac) whenever I need to do some graphics image editing. Since at some point I want to turn off my Desktop PC forever, I need to find a solution to this issue.

So, I decided to explore using Virtualization Software which will emulate the x86 hardware virtually, basically simulating a Desktop PC. I can then install Windows 7 in that environment and run Windows and Windows-based applications through this emulation.

There seems to be three big players in this field to choose from: (1) Parallels, (2) VMWare Fusion, and (3) VirtualBox. Both Parallels and VMWare Fusion are commercial products that go head-to-head for this application, and both cost around $80 US. VirtualBox is freeware offered by Sun Microsystems which has similar virtualization technology. I’ve used VirtualBox for my Palm WebOS development (the Palm Emulator runs inside of it) and it seems to work fairly well. I’ve also used VirtualBox with Windows 7 and it also worked fine, but seemed a little slow when starting up the applications.

Both Parallels and VMWare Fusion are designed for a smoother and transparent operation running on the Mac when compared to VirtualBox, in my opinion. Both of these products offer the ability to run a Windows App on the Mac such that it appears to be a Mac application. So if I run my Paint.net application it will popup in a window on my Mac and operate just as it would on my PC in it’s own window.

So, I decided to download the VMWare Fusion software and use their 30-day trial period to test it out. After jumping through their hoops to get a temporary activation code, the installation of VMWare Fusion and the Windows 7 OS was a piece of cake. Very easy to install, as I simply inserted my Windows 7 OS install CD when asked for it from VMFusion, and away I went.

I used the default settings for the virtual environment of 40 GB of simulated disk drive space, along with 1 GB of RAM. This should be sufficient for running Windows 7 and my Paint.net application. After the Win 7 installation and the various Microsoft Updates, I was all ready to do. No need to fuss with internet connections, etc.

I then installed Paint.net in this virtual world and was able to run it using VMWare’s “Unity” mode which makes the app appear to be a Mac application (running in it’s own window). So I don’t see the Windows 7 Desktop, just my Paint.net app running in a window on my Mac’s desktop screen. Sweet!

I was surprised at the responsiveness of Windows 7 running in this environment, as it appears just as snappy as running it on my Desktop PC. I especially like the Unity-mode, which allows me to run a single app on my Mac. In fact, there’s a drop-down menu from my Mac’s menu bar which allows me access to all the installed apps in the VMWare Fusion’s Windows environment, so I can effectively run any installed app very easily. Note, that Parallels has a similar feature called “Coherence”, so you can probably do something similar with that product.

Another cool thing is that I can configure VMWare to share my Mac’s desktop, and as such all the files currently on my Mac’s desktop appear on the Window’s desktop as well. I can also place an icon of a Windows application on my Mac’s Dock bar so I can launch it very easily.

Now the real test, is how quickly can I start up VMWare Fusion on my Mac when I want to run Paint.net? It would be a real drag if it took 5 minutes for the entire system to boot up for me to run a single application. So I did a quick test on my iMac quad-core i7 machine to see how fast I can bring up the Paint.net application with VMWare Fusion not running in the background.

So clicking on my Paint.net icon on the Mac dock launches VMWare Fusion (which started up the VMFusion virtualization software and booted up Windows 7 inside of it) and my Paint.net application appeared in a self-contained window on my Mac in 30 seconds. That time is actually pretty good, since VMFusion is booting up Windows 7 from a cold start!

Another feature with VMWare Fusion is that you can save a Windows session as “Suspended”, which stores the current Windows environment in a file for faster startup. So I initiated the suspend mode and then Quit the VMFusion application. Next, when I clicked on the Paint.net icon in my Mac’s Dock bar the Paint.net application appeared in 10 seconds! That was astounding, and perfectly acceptable for my needs of running a few specific Windows applications on my Mac. Who knows if VMWare is achieving this because it’s using the multiple core processors on my i7 iMac, but in any case I’m really liking this!

The only downside to all of this, is that you need a Windows 7 license for your virtual world. That shouldn’t be a problem for me, as I can always decommission one of my retired PCs and use that license. Also, you’re tying up a certain amount of system memory (in my case, 1 GB) and a small amount of disk space on your Mac system, but I think that is perfectly acceptable for what I’m getting in return.

So there you have it. A perfect solution for running much-needed Windows Apps on your Mac. VMWare Fusion seems to run fast and allows easy and convenient access to my Windows Apps. I just need to fork over $80 and get a full license. 😉


Recording TV shows on your Mac

September 14, 2010

For the last several years my wife and I have been using Microsoft’s Windows Media Center to schedule the recording of TV shows on our respective PC machines. In general WMC has been working well, with just a few glitches here and there. Using some external tools (i.e.,DVRMSToolbox and ShowAnalyzer) I have a process in place to record TV shows, cut out the commercials, and converted the recorded shows to WMV format for our Zune media players.

Last year, out of frustration my wife switched from her Vista PC to an Apple MacBook Pro laptop. Since she can’t run the Microsoft Zune syncing software on her MacBook Pro, I kept her PC still up and running to continue recording TV shows and processing them for her Zune 120 player. A few months ago her Zune device stopped working (hard drive failure) so for Mother’s Day I bought her an Apple iPod Touch (32 GB) as a replacement. Mainly because it will easily work with her MacBook Pro using the iTunes software. She still uses her Vista Desktop PC for recording TV shows, but now I’ve modified some of the processing scripts to convert the recordings to MP4 format for her iPod Touch.

Unfortunately, her Vista PC was having trouble recording her favorite TV shows for some reason or another (e.g., couldn’t download the latest TV listings, conversions stalled because of Windows updates, etc.). Twice, I had to reinstall the WMC software because the PC couldn’t download the TV listings from the Internet. So yesterday, I decided I would switch her over to a Mac-based system for recording TV shows from our cable TV service.

Upon doing some investigating, it seems that the product called EyeTV HD was what we needed. This relatively new product is designed to work specifically for the Mac OS X, and has the ability to work with cable set top boxes for changing channels via an IR Blaster. The only issue we currently have, is that this device requires component input for the video and audio, and our current set top box from Comcast only output a coaxial line.

So, I took our current converter box down to the local Comcast office and asked to switch it for a converter that has component output. Unfortunately for me, I didn’t specify I wanted HD component video output so they gave me an old Motorola converter box that has the very old composite video output (think of the old Pong game console that used the composite video connection) which just didn’t work for my needs. I did ask two different people in the Comcast office if this converter would give me digital component output and each of them said, “definitely” without even looking at the connectors on the back of the converter. As such, I came home to verify that this box wouldn’t work (as I suspected) and I called Comcast on the phone to see if they could mail me the right unit. So in about a week I’ll have the proper converter box to continue with my TV recording setup.

The nice thing about the EyeTV HD is that it has a onboard MPEG encoder, so it won’t use the MacBook Pro’s CPU for the encoding. Also, the EyeTV’s software can convert recorded TV shows to both iPad and iPod Touch formats at the same time. So if my wife chooses, she can watch her TV shows on either her iPad or iPod Touch. As such, I probably won’t need to jump through very many hoops to get her TV shows converted to the proper format for her iPod Touch, compared to what I needed to do for my Zune with Windows 7 and Vista.

If this all works out ok, I’ll probably switch over myself to a similar system and then I can shutdown my Windows 7 PC permanently.


Week 4: Apple Mac Update

September 14, 2010

It’s been over 3 weeks now since I purchased my Apple iMac, and I’m still loving it. The system is running strong and fast, I haven’t had the need to reboot it for any reason (except for an OS update), and it just works. I still have my Windows 7 Quad-Core Desktop PC running in my home office, but I only use it for recording my TV shows and converting them for my Zune HD media player.

Surprisingly, it was relatively easy for me to make the switch from Windows to the Mac. I’m finding the “muscle memory” of doing an CTRL+C to copy has been replaced by CMD+C rather easily. In fact, I catch myself now trying to find the CMD key on my Dell Win 7 netbook! The one thing I miss on my Apple Bluetooth keyboard is the equivalent of the DELETE key and the HOME/END keys. Otherwise, I seemed to have adapted well to the Mac OS X environment.

What’s still a big bummer for me, is finding a replacement for my Paint.net graphics application. I absolutely love that app, and I can’t find an adequate replacement for OS X.  I’ve tried Pixelmator, Pinta, Seashore, Gimp, and a few other obscure apps and nothing is as easy to use as Paint.net. Unfortunately, Paint.net will never be ported to the Mac so I’m out of luck. The Pinta app was developed to mimic Paint.net, but it seems to have some glaring bugs when I use it and also doesn’t have all the features that I require from Paint.net. Gimp has been around a long time and has a lot of features, but it is not a native OS X app and requires the old Unix X11 overlay to run it. Pixelmator is the obvious replacement choice, but in using that app I had some unexpected crashes and some difficulty doing basic graphics editing (e.g., making rectangular boxes, etc.). So, nothing is perfect I guess.

I think what’s helped in my transition is the fact that so much of what I do is on the Internet and is web-based. Most of my activities involve a web browser, whether it’s doing online banking, searching for infomation, reading news and articles, checking email messages, creating a map with driving directions, etc. As such, I’m less reliant on having dedicated applications installed on my personal computer to do these activities. So, moving to a different computer platform isn’t such a shocking transition.

I’m certainly glad I made the switch, and over the course of the upcoming months and years I’ll probably continue my migration towards using Apple products. First an Apple iPod Touch to replace my Microsoft Zune HD, then maybe a 13″ Macbook Pro to replace my Dell 11z Notebook, followed by an iPad, and from there who knows?


Great site for travelers

September 11, 2010

Most of my traveling is for business, where I might take a trip 8 times a year. Not a lot, but frequent enough to plan ahead for my travels. For example, I want to make sure I pick out a good, clean, safe hotel when going to a new town and also one that has good restaurants nearby. I happened upon a really good web site called TripAdvisor.com which has reviews made by different travelers who were willing to post their comments.

Reviews on hotels, restaurants, vacation spots, etc. are all on this site. Of course, you need to weed through the anal people who complain about every little thing about a hotel and/or restaurant, but there’s lots of good information to be found. I, personally have posted some of my reviews of hotels and restaurants (good and bad) to help support the community. These postings also offer good advice when appropriate on lots of other travel details with regards to hotels or city activities.

One nice thing for me, is that there’s a Palm WebOS app specifically designed to work with TripAdvisor. So on-the-fly while I’m traveling I can quickly check reviews on nearby hotels and eateries to get the latest information.


DropBox : Great utility for syncing files between computers

September 11, 2010

When I purchased my Apple iMac last month, I was offered the option of signing up for an Apple subscription service called MobileMe, which has several nice online features for syncing and staying connected with my Mac. For example, with MobileMe you can sync your mail, calendar, contacts, etc. between your Apple devices (e.g., Mac, iPod Touch, iPhone). You also have cloud storage where you can easily store data on Apple’s servers and have access to it from your Mac or any web browser. This service goes for $99 per year, and is a good deal if you want to keep your multiple Mac devices in sync. I, however, currently own just one Apple device (my iMac) so I don’t have a real use for this service.

The one attractive thing about MobileMe was the “iDisk” or cloud storage of up to 20 GB, which would allow me to conveniently store files for all of my computers and laptops to access. Fortunately, there’s a few different options available other than MobileMe to do this same function. The best that I’ve found is called DropBox, which allows you to have a folder in the cloud for file storage. You can then automatically sync those files to any computer you choose (PC or Mac) and also access files via apps on the iPhone and Palm WebOS devices. In addition, you can  send shared folder links from DropBox to your friends or anyone via email and let them have access to certain files. It’s a great way to share files (or keep files in sync) when working on a big project with other people.

The best thing about DropBox, is that they offer 2 GB of cloud storage for free. If you need more storage, you can pay a small monthly fee. I’m currently using the basic free service to have a convenient place to put files for my Mac, personal laptop, and work laptop to share. For small files this works great, but if you’re trying to transfer larger files (say, a few hundred Megs) it can take a while to upload, download, and sync.

As I said there’s other similar cloud services available, but I particularly like DropBox because it’s very easy to use, unobtrusive, and has a web-based login page that allows me to upload and download files. Definitely worth checking out!