Wednesday, December 31, 2008

Nontransitive generic interfaces

We're pretty busy racing to a deadline, so I don't have a great deal of time to dig into this. I just stumbled across a C# feature that works differently than I would have guessed. Check out the following code.

public class test
   public void doTest()
      Interface1<object> win = new Class1<object>();
      Interface2 fail = new Class1<object>();

public interface Interface2 : Interface1<object>

public interface Interface1<t> where T : class

public class Class1<t> : Interface1<t>
   where T : class


All I am really after is for Interface2 to act as an alias for Interface1 and hide the generic declaration bits. Well ... here it is. Maybe I'll come back later if I figure out a solution.

Wednesday, December 3, 2008

Time Machine & Airport Extreme

As I type, my MacBook is backing itself up to a network Time Machine drive. The drive (1TB LaCie) is attached as a USB AirPort Disk to my AirPort Extreme. It took a fair amount of trial and error to get it going. However, once I figured it out, there really isn't anything to it. While most of what I have found on the interwebs cheers that this is a relatively new feature for the AirPort Extreme, the posts out there aren't especially helpful in discussing exactly how to do it. Thus, here are my notes.
  1. To begin, attach the drive to a physical Mac.
  2. Use the Disk Utility and erase the disk using the "Mac OS Extended (Journaled)" format type.
  3. (optional) I went ahead and made two partitions; a little one at the end as a general purpose file share for the network. Not sure if that is a good or bad idea, but thought it would be fun since (I think) I can delete it or resize either partition later.

  4. Unmount the drive from the Mac and plug it in to the AirPort Extreme.
  5. On your Mac, open the AirPort Utility and click the Disks tab.
  6. Click the "File Sharing" button and "Enable file sharing" with "With a disk password". It's kind of a bummer that the APE will not secure each partition with a different option. I would prefer to secure the file share with accounts. Oh well.
  7. The AirPort will probably have to reboot.
  8. When it is back online, open a Finder window and double click the AirPort icon under "Shared".
  9. Open your backup disk, supplying the disk password. You should see a disk icon of your backup disk on the desktop.
  10. Open System Preferences and click Time Machine.
  11. Click Change Disk. You should see your AirPort backup disk as an option.
  12. Choose this disk. When you are prompted for a username and password, provide the name of the disk as the username.
  13. Let it start backing up. It will take a while.
OK. That's where I am right now. I will post more on this topic as it progresses. I hope to get all three Macs in the house automatically doing this. I also read that I can configure the Windows boxes to participate, so I'll try that as well.