This blog is where I post about my consulting work with Microsoft Technologies, and other random tidbits that don't fit in my Photo Blog or my Iraq Blog.

Sunday, November 29, 2009

Happy Holidays!

, originally uploaded by ScrappyDog.

Family 2.0 portrait at "the Farm" in Grand Marais over Thanksgiving. Photo by Gramma Betsy.

Wednesday, November 11, 2009

Question from a friend: I need a more "professional" email address, but I don't want to give up my Gmail address

Question of the day from a friend: I'm applying for jobs, and I need a more "professional" email address, but I don't want to give up my Gmail address, and I don't want to have to log into two different accounts all the time to check my mail.

Example current address: binge.drinker@gmail.com
New email address: john.a.doe@gmail.com

No problem!
  1. First step create the new Gmail account.
  2. Then you need to pick which mailbox you want to use as the primary one that you are going to login to (you probably want to keep using the existing one, because it has all your old mail).
  3. Go into the new email box and click on the "Settings" link at the top right.
  4. Select the "Forwarding and POP/IMAP" tab.
  5. Select "Forward a copy of incoming mail to" and enter the email address of the old account.
  6. I would recommend setting "archive Gmail's copy".

You are now done with step one. All email sent to the new address should start showing up in you old inbox.
Now you want to be able choose which address to use when you send/reply to email in your old inbox.
  1. Go into the old email box and click on the "Settings" link at the top right.
  2. Select the "Accounts and Import" tab.
  3. Go to the "Send mail as:" section and click the "Send mail from another address" button enter the other (new) email address.
  4. Check the "Reply from the same address the message was sent to" option.
  5. Gmail is now going to send you an email to confirm that you own the other address, you will need to click a link in the email to confirm.
You should be all set.

Now when you are composing an email you will notice there is "change" link after the "From:" address. You can use this to pick which address you would like your email to be from.

Monday, November 9, 2009

ScrappyDB: C# Object Mapper for Amazon SimpleDB

I've been working on a new C# Object Mapper for Amazon SimpleDB for a few months to provide an "infinitely" scalable back end for a personal web project, and today I'm releasing it on CodePlex.


Project Description

ScrappyDB is a simple object mapper for storing .NET classes and collections in Amazon SimpleDB. It is currently under active development to support the needs of a specific website. As such it only provides functionality to support the needs of one "customer", this means that there are many "obvious" use cases and data types that are not yet supported... because we didn't need them. But we think other people may find it useful, so we are sharing it here...

Why create an new tool instead of using one of the existing .NET tools for SimpleDB?

In particular:
  • Simple Savant http://simplesavant.codeplex.com/ (Simple Savant is a great tool and definitly a more mature code base. We would recommend that you investigate it first before considering ScrappyDB.)

Features that we felt were important for our implementation:
  • Support for multi-value attributes (using arrays or arraylists).
  • Support for nested objects and relationships (in particular cases where a custom class has a property that is a collection of some other custom class).
  • Integrated support for web caching for performance.
  • Location data (in particular the ability to do proximity searches "show me all records within 5 miles of X").

Things that we did NOT feel were important for our implementation:
  • Support for all .NET data types (we only support a subset of "common" data types, but there is no reason you can't enhance it to support the one you need).
  • Update caching to work around "eventual consistency" (if you don't have a full understanding of what eventual consistency means take the time to learn about it before you decide whether SimpleDB is a viable platform for your data).

About the source code
  • To do what it does ScrappyDB makes extensive use of some painful reflection.
  • The code does not follow any identifiable design patterns and it doesn't follow any of the latest inversion of control fashions: "I'm just a caveman, and I'm not familiar with your modern ways..."

Known Issues:
  • Current code is definitely ALPHA, has not had any significant production use.
  • Relationship logic is lightly testing, is probably buggy and is likely to see some significant refactoring.
    • We are planning to add a second relationship type that uses multivalued attributes for "1 to few" relationships ("1 to many" relationships use an intermediate relationship "table" which is slower).

  • Currently the primary developer documentation for ScrappyDB is the unit tests included with the source code.

But here are a few basic examples to help you get started:

Basic Save
            var db = new DB();
var o = new MyClass {Id = Guid.NewGuid, TestProperty = "HelloWorld"};

Basic Load by Id
            var result = db.Load(testId);

Save a Collection
            var a = new ScrappyDbCollection();
a.Add(new TestItem() { Id = Guid.NewGuid(), TestString = "test1" });
a.Add(new TestItem() { Id = Guid.NewGuid(), TestString = "test2" });
a.Add(new TestItem() { Id = Guid.NewGuid(), TestString = "test3" });


Query a Collection
            var b = new ScrappyDbCollection();
b.QueryCollection(" TestString = 'test2' ");