Learning new technologies (Apple technologies, that is)

For a long time now, I’ve been wanting to learn various Apple technologies such as Core Data and Bindings. However, it hadn’t been until last week when I finally had a chance to start learning them as well as Image Capture Framework. I came up with an idea that I’m excited about and started work on the project last week. Since I’m supporting OS X 10.4 and later, I can use Cored Data and Bindings (bindings go back to 10.3.9 or so). I always have trouble learning new software stuff if I don’t have a use for it; now that I have a use for it, I learned both technologies in a matter of days. I’m pretty impressed with Core Data. It works well and I haven’t found anything to really dislike about it, yet. Bindings, on the other hand, sounds great in theory, but sometimes just doesn’t work how I want it to work. So, I spend a lot of time trying to jam a square peg in a round hole until I give up and go back to the way I did it before. This isn’t to say that bindings are useless, they’re just not for everything.

On to Image Capture. The sample code made it look easy and scanning was working real well until I tried to muck with the contract, brightness, etc. It appears that none of the settings work (at least with my scanner). So I start poking around and figure out that most scanner apps on my machine are using TWAIN instead of Image Capture. OK, so I wasted another day realizing that Image Capture Framework (for scanners) is broken or I’m not using it right (the sample code produces the same results as my code). TWAIN seems to work OK, until I try to have 2 scanners on my system so that I can detect them. Took me 30 minutes to figure out that the EPSON Perfection 1250 drivers that say that work on Intel Macs aren’t universal binaries, so they work in Rosetta applications, but not native ones. My other scanner, a DocketPORT 465 does have native drivers (that’s one of the reasons I bought it). So my code worked fine, EPSON is just behind the times. On a side note, it’s amazing to me that scanner vendors still are clueless after all these years…they make crappy software and always have.

Anyway, a few more technologies under my belt and it wasn’t all that painful. Stay tuned for my latest product which has managed to get me excited about programming, again!

Software registration schemes; the good, the bad, the ugly

I’ve worked on a number of consumer products in my career, some with registration schemes, some without. What is the purpose of a registration scheme? Are people trying to prevent piracy? Are they trying to keep the honest people honest? Or is there some other motivation? For me, it is about motivating people to purchase the software when the demo has expired (in my shareware world). With some of my products, people use it, like it, and forget that the software is even working, so they forget to register. A registration scheme here has proven to be quite effective on my NotifyMail program. I had another program called PhotoCapture that had no registration scheme (I was young and dumb) and asked people to send me a postcard if they used it. I know it was used on various websites back in the day, but only got a handful of cards. That method clearly didn’t work.

I worked on one product that had such sophisticated registration that it made the product hard to use. That and the fact it was buggy lead to its downfall. So is there a happy medium? In many cases, yes, as long as the software is useful and used frequently. In my opinion, if a product is used infrequently (there are some products that a demo version suffices for some), its value goes down to me and then maybe it needs stronger protection. I was playing around with a program yesterday that I had tried months ago while working on writing something that had a similar concept, but worked in a completely different way. Since I had tried the app, the demo expired and I couldn’t play with it or reset my demo period. After about 3 minutes of poking around with Interface Builder, I discovered a serious flaw in their registration system (Interface Builder is a free developer tool that is available from Apple and ships with every Mac). They had 4 buttons on the registration screen that popped up; register (brings up a dialog to enter your code), purchase (takes you to a website), quit, and try. The try button was grayed out because my demo had expired. So in Interface Builder, I duplicated the try button, linked it to the tryAction, hid the original try button, and then ran the application. Oops. Now I had a working version of the application that I simply had to hit the try button each time I ran it. A simple code/design change could have fixed this. Instead of having a quit and a try button that were separate, have one button that had the title change depending on if the demo had expired and then have the action linked to “dismissRegisterDialog” where code behind that would determine if it should quit or should run in demo mode.

Of course I won’t say which app this was, but a few more minutes with the registration code could go a long way. I don’t think most developers should spend a ton of time on registration schemes as they will be broken by hackers anyway. I think it’s important to make it hard enough that the casual person, even developer, can’t break it. I definitely don’t put in registration schemes that are hacker proof, but they seem to work good enough. In my next product, I think I may take a different approach.

512MB of RAM is ridiculous

Years ago (when Bill Gates said that 640 K is all that is needed or something like that), 512 MB of RAM would have seemed like overkill. Unfortunately (I guess depending on how you look at it), this is no longer the case. I had to send my MacBook Pro in for repairs as it had an annoying whine when running on battery which forced me to use on of my Mac Minis with only 512 MB of RAM for a few days. It clearly wasn’t the speed causing things to slow down (1.66 MHz Core Duo on the Mini and 2.16 GHz Core Duo on the MacBook Pro). The OS kept having to swap things in and out of RAM, everything I did took ages. I was tempted to go buy 2GB of RAM, but couldn’t justify the cost for a test machine. I can’t believe that Apple (and other computer manufacturers) ship machines with this little RAM knowing that it won’t be enough. That’s how they keep the cost down; pay $600 for the machine, spend another $300 in RAM.

Thankfully Apple’s service is fast and I got my MacBook Pro back in 2 days (sent it in on Monday, got it back on Wednesday) otherwise I would have pulled my hair out.

OS X server – deceptively simple

The more I play with OS X server, the more I realize how much Apple tried to slap a GUI on open source stuff and was only moderately successful. Take for instance the WebDAV support. I can give access to a realm to various users and various groups. In my case, users have multiple short names, such as scottgruby and sgruby (I didn’t set this server up). If I give my user access to a DAV realm by dragging it over, OS X server only gives access to the first short name assigned to the user and then even lets me edit the name which makes no sense because if I change the name, I no longer have access to it. I had a user have trouble with this, because she was using the second short name and not the first. Furthermore, OS X server does weird things with the DAV permissions such that even if you have read only access to various parts of a DAV volume, you can’t browse it with a DAV client, i.e. the Finder or Transmit. Apple says this isn’t a bug, but I disagree. Clearly they setup the Apache access permissions incorrectly making it a pain for users to access parts of a DAV volume. So unlike an AFP volume where a user can mount the top level and navigate to directories that he/she has permissions to view, the DAV implementation requires users to mount the particular folder they want access.

I’m not a huge fan of AFP as it doesn’t appear to be the most efficient protocol, allows clients to hang around (using process load) and by default, isn’t secure. You can do AFP over SSH, but you still have to turn on AFP and explicitly tell it to use SSH.

There are some aspects of OS X server that are nice such as turning on the firewall and controlling access, but in my short time using it, I’ve run into a number of bugs (that I need to report) that I’m sure won’t get fixed.

Software Installers should have uninstallers

I’ve not been a huge fan of either software installers or uninstallers, but understand the need for installers. Recently I tried out a program on my Linux box and used the installer to install it; I was unimpressed with the software and the mess it scattered over my drive. I looked around, but couldn’t find an uninstaller. Maybe I deleted it trying to quickly recover from what it had done or maybe it didn’t come with one. If it didn’t come with one, it should have. It took me awhile to remove what it installed and then it wasn’t until a day later that I discovered it changed some of my system files. Luckily I had backups of those and was able to restore them. Hopefully I’ll no longer complain about shipping a product with an uninstaller as I now know firsthand how hard it is to remove some programs.

A GUI isn’t all that it is cracked up to be

This past week, I started learning about OS X server. The interface really confused me at first as there are lots of different options buried in lots of different places. After a few hours of playing around, I started making headway on figuring out what stuff did, but it wasn’t pretty. I then tried to use the GUI to turn on some other features and found out that it hung the system; I had to use the command line to kill off what I tried. Furthermore, I made a mistake and deleted an SSL certificate; when I went to add it back, it kept failing. The log gave a cryptic error message and after some searching, I found a reference to the keychain. So I used Apple Remote Desktop to connect to the server and look at the keychain (the keychain can’t be access using the server admin software), removed some pieces from the keychain and then I had no problem importing the certificate again. While Apple did an OK job (I’m not impressed with the UI) integrating UNIX tools into OS X, I’m not convinced that the GUI on OS X server is all that useful if I keep having to fight it to get stuff working.

On Tuesday, a friend of mine is going to teach me about OS X server; maybe it will change my view on it, especially if I can get everything working.

Cool developer tip of the day

If you’re like me, you only test certain software you’re developing on your main user account. For me, anything that involves syncing, I use a second account or machine for testing. As my second machine is a 6 year old G4 tower that sounds like an airplane, I don’t like firing it up. Today I discovered a really cool trick to make testing with a second user account more efficient. Tiger has support for VNC built in, however, it appears to only allow you to control the user that is at the console, in other words, the user that is using the machine. This creates a problem (fun things happen if you try it) as I want to control a second account.

A program called OSXvnc to the rescue. This program starts up a VNC server in each user account that you run it in (use fast user switching to login to the other accounts and launch this app; make sure you set a password). Then use a VNC viewer, I use Chicken of the VNC, to connect to the other OS X user accounts. This allows me to test from secondary user accounts, while still being logging into AIM, able to check my email, and develop from my main account. Performance is pretty good on my MacBook Pro. This will definitely save me a ton of time.

I’m famous!

OK, maybe not, but as I was doing a routine search for my name, I came across an RFC (Request for Comments) based on my “NotifyMail protocol”. I’m not sure why someone bothered to write it up, but it is RFC 4146, title “Simple New Mail Notification”. For a geek, that’s pretty cool.

Disappointment with Garmin

This week, Garmin announced that they would have their Training Center software available by the end of the year (2006) instead of by the spring of 2006 like they said way back in January. I can understand software delays, but it should have been quite predictable from January. However, I’m pleased that MotionBased has a beta of their Mac plugin that works quite well and the interface is easy to use. In addition, they are quickly rolling out new features and might even bring a feature or two to us Mac users before the Windows users.

Drawing conclusions in bug reports

When I was become an EMT (Emergency Medical Technician), we were taught to observe and report without making a diagnosis, because we were not trained to do so. This concept also applies to bug reports. Over the years I’ve seen users/customers report bugs and attempt to say why the bug is happening. Unfortunately, many times the user is completely wrong. Without seeing the source code, knowing how things work, and/or not knowing a particular standard, it is nearly impossible to draw a conclusion as to why a problem is happening. I wish that bug reports would do what I was trained to do becoming an EMT; observe and report. Let the developers make the conclusions and fix the issue.