Sunday, September 5, 2010

Save Web Page as PDF on iPad then Annotate

I was viewing the schedule for Twin Cities Code Camp on my iPad this morning and wanted to circle the talks I was interested in. I quickly realized I wasn't going to be able to do this without some help. After some research here's what I came up with.
  1. Configure your iPad to sync Bookmarks with one of your browsers (I picked Safari)


  2. Add this Bookmarklet for converting web pages to PDF from PDF Download to Safari (originally found this tip on "The Heat Web")

  3. Sync your iPad with iTunes to get the Bookmarklet onto your iPad.
  4. Install one of the iPad PDF Annotation apps. I picked Noterize by Robert Stretch. I also looked at iAnnotate which I'll try next if I don't like Noterize.
  5. Browse to the web page you want to annotate, open your Bookmarks, and select Save Page As PDF
  6. Unfortuantely I had to hit stop and then "refresh" in Safari to get PDF Download to work (your results may vary)
  7. PDF Download will eventually open the page as a PDF. (it can take a while)
  8. Copy the URL of the PDF.
  9. Open Noterize, go to the root of your Notes and click Import PDF/PPT. Select the Web Browser option and paste in the copied URL.
  10. The PDF is now available to annotate.
I also highly recommend using Dropbox so you can easily save your annotations and view them on your computer or in other apps that support Dropbox. You can use Dropbox to easily get PDFs into Noterize from your computer as well.

Noterize does not automatically save your PDF's to Dropbox. You'll need to Share the PDF within Noterize after it has been annotated and then upload to Dropbox.

I'd love to hear from you! Leave a comment or reply to @cdeutsch on Twitter if you find something useful.



Saturday, August 21, 2010

Code-First Entity Framework ISession for Tekpub MVC Starter Site

I've been using a lot of the ideas/code in Tekpub's MVC Starter Site for a personal project of mine. For better or worse the features of .NET 4.0 and MVC keep rapidly changing. I wanted to use both MVC 3 Preview 1 and Code-First Development with Entity Framework 4 so I've taken the time to upgrade the MVC Starter Site to support both of these features. You can download my working project here. See this post for more info on the headache to upgrade to MVC 3.

IMO it took way too much time to do this but a lot of it is probably due to my inexperience with MVC and in particular Dependency Injection.

Below is the class I added in order to use Code-First in the MVC Starter Site. The class inherits ISession. At first I tried to get access to the underlying ObjectContext so I could just use the already written EFSession class. I couldn't get this to work and then luckily I took a step back and realized I didn't need it to. I still haven't figure out how to do a working IReadOnlySession.cs but for my needs it won't be an issue at this time.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
using System.Data.Metadata.Edm;
using System.Data.Entity;

namespace Web.Infrastructure.Storage
{
    public class EFCFSession : ISession
    {
        DbContext _context;
        public EFCFSession(DbContext context)
        {
            _context = context;
        }

        
        public void CommitChanges() {
            _context.SaveChanges();
        }

        public void Delete<T>(System.Linq.Expressions.Expression<Func<T, bool>> expression) where T: class, new() {

            var query = All<T>().Where(expression);
            foreach (var item in query) {
                Delete(item);
            }
        }

        public void Delete<T>(T item) where T: class, new() {
            _context.Set<T>().Remove(item);
        }

        public void DeleteAll<T>() where T: class, new() {
            var query = All<T>();
            foreach (var item in query) {
                Delete(item);
            }
        }

        public void Dispose() {
            _context.Dispose();
        }

        public T Single<T>(System.Linq.Expressions.Expression<Func<T, bool>> expression) where T: class, new() {
            return All<T>().FirstOrDefault(expression);
        }

        public IQueryable<T> All<T>() where T: class, new() {
            return _context.Set<T>().AsQueryable<T>();
        }

        public void Add<T>(T item) where T: class, new() {
            _context.Set<T>().Add(item);
        }
        public void Add<T>(IEnumerable<T> items) where T: class, new() {
            foreach (var item in items) {
                Add(item);
            }
        }
        public void Update<T>(T item) where T: class, new() {
            //nothing needed here
        }
    }
}

Another interesting thing I found when doing this is that I couldn't use the same DB for the ReportingDB DbContext and the SiteDB DbContext without Code-First wiping the other out. Not a huge deal at the moment but could become an issue down the road.

So far I'm loving the idea of using POCO model classes and can't wait to try combine them with the MVC 3 Model Validation improvements!



Sunday, August 15, 2010

Upgrade MVC2 to MVC3

Today I upgrade a fairly new MVC2 app to MVC3. My original MVC2 app was based off of The Tekpub ASP.NET MVC 2.0 Starter Site

The first step is to update your projects references. This blog post by Rick Schott worked great to handle that task.

After doing that I was faced with the error:
No parameterless constructor defined for this object.

My original global.asax.cs looked like this:
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Ninject.Web.Mvc;
using Ninject;
using Ninject.Modules;
using Site.Infrastructure.Logging;
using Web.Infrastructure.Authentication;
using Web.Infrastructure.Reporting;
using Web.Infrastructure.Storage;
using Web.Model;

namespace Web
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : NinjectHttpApplication
    {
        public static ISession Session
        {
            get
            {
                return _container.Get<ISession>();
            }
        }

        public static void RegisterRoutes(RouteCollection routes)
        {
            
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("favicon.ico");
            routes.MapRoute(
                "Login", // Route name
                "login", // URL with parameters
                new { controller = "Session", action = "Create" } // Parameter defaults
            );
            routes.MapRoute(
                "Logout", // Route name
                "logout", // URL with parameters
                new { controller = "Session", action = "Delete" } // Parameter defaults
            );

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );

        }

        protected override void OnApplicationStarted()
        {
            Logger.Info("App is starting");

            //Database.SetInitializer<SiteDB>(new AlwaysRecreateDatabase<SiteDB>());

            AreaRegistration.RegisterAllAreas();
            RegisterRoutes(RouteTable.Routes);

            //ControllerBuilder.Current.SetControllerFactory(new NinjectControllerFactory(Container));
        }

        protected void Application_End()
        {
            Logger.Info("App is shutting down");
        }

        protected void Application_Error()
        {
            Exception lastException = Server.GetLastError();
            Logger.Fatal(lastException);
        }

        /// <summary>
        /// IoC stuff below
        /// </summary>
        /// <returns></returns>
        protected override IKernel CreateKernel()
        {
            return Container;
        }

        internal class SiteModule : NinjectModule
        {
            public override void Load()
            {
                //a typical binding
                Bind<ILogger>().To<NLogLogger>().InSingletonScope();
                //Bind<INoSqlServer>().To<DB4OServer>().InSingletonScope();
                //Bind<ISession>().To<Db4oSession>().InRequestScope();

                //You can use the SimpleRepository to build out your database
                //it runs "Auto Migrations" - changing your schema on the fly for you
                //should you change your model. You can switch it out as you need.
                //http://subsonicproject.com/docs/Using_SimpleRepository
                Bind<ISession>().To<SiteEFSession>();
                Bind<IReporting>().To<ReportingSession>();
                Bind<IAuthenticationService>().To<UserAuthenticationService>();
            }
        }

        public ILogger Logger
        {
            get
            {
                return Container.Get<ILogger>();
            }
        }

        static IKernel _container;
        public static IKernel Container
        {
            get
            {
                if (_container == null)
                {
                    _container = new StandardKernel(new SiteModule());
                }
                return _container;
            }
        }
    }
}

I then tried to add the NinjectServiceLocator.cs class and update my global.asax.cs to use Ninject like this sample from Scott Gu.

It looked something like this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Ninject;
using Ninject.Modules;
using Site.Infrastructure.Logging;
using Web.Infrastructure.Authentication;
using Web.Infrastructure.Reporting;
using Web.Infrastructure.Storage;
using Web.Model;
using Mvc3Ninject.Utility;

namespace Web
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : HttpApplication
    {
        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
            filters.Add(new HandleErrorAttribute());
        }

        public static void RegisterRoutes(RouteCollection routes)
        {
            
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("favicon.ico");
            routes.MapRoute(
                "Login", // Route name
                "login", // URL with parameters
                new { controller = "Session", action = "Create" } // Parameter defaults
            );
            routes.MapRoute(
                "Logout", // Route name
                "logout", // URL with parameters
                new { controller = "Session", action = "Delete" } // Parameter defaults
            );

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );

        }

        public static void RegisterServices(IKernel kernel)
        {
            //a typical binding
            kernel.Bind<ILogger>().To<NLogLogger>().InSingletonScope();
            //Bind<INoSqlServer>().To<DB4OServer>().InSingletonScope();
            //Bind<ISession>().To<Db4oSession>().InRequestScope();

            //You can use the SimpleRepository to build out your database
            //it runs "Auto Migrations" - changing your schema on the fly for you
            //should you change your model. You can switch it out as you need.
            //http://subsonicproject.com/docs/Using_SimpleRepository
            kernel.Bind<ISession>().To<SiteEFSession>();
            kernel.Bind<IReporting>().To<ReportingSession>();
            kernel.Bind<IAuthenticationService>().To<UserAuthenticationService>();
        }

        public void SetupDependencyInjection()
        {
            // Create Ninject DI Kernel 
            _container = new StandardKernel();

            //// Register services with our Ninject DI Container
            RegisterServices(_container);

            //// Tell ASP.NET MVC 3 to use our Ninject DI Container 
            MvcServiceLocator.SetCurrent(new NinjectServiceLocator(_container));
        }

        void Application_Start()
        {
            SetupDependencyInjection();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            Logger.Info("App is starting");
        }

        protected void Application_End()
        {
            Logger.Info("App is shutting down");
        }

        protected void Application_Error()
        {
            Exception lastException = Server.GetLastError();
            Logger.Fatal(lastException);
        }

        public ILogger Logger
        {
            get
            {
                return Container.Get<ILogger>();
            }
        }

        static IKernel _container;
        public static IKernel Container
        {
            get
            {
                return _container;
            }
        }
    }
}

This caused the following error to constantly trigger the debugger although the site seems to still be working:
Error activating IControllerFactory
No matching bindings are available, and the type is not self-bindable.

I then added the following line to the RegisterServices function based on this Stackoverflow tip:
kernel.Bind<IControllerFactory>().To<Ninject.Web.Mvc.NinjectControllerFactory>();

This caused the following error:
Method Ninject.Syntax.IBindingToSyntax`1[System.Web.Mvc.IControllerFactory].To: type argument 'Ninject.Web.Mvc.NinjectControllerFactory' violates the constraint of type parameter 'TImplementation'.

I then tried using DefaultControllerFactory instead of the line above and finally success!
kernel.Bind<IControllerFactory>().To<DefaultControllerFactory>();

This is my final working global.asax.cs file:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Ninject;
using Ninject.Modules;
using Site.Infrastructure.Logging;
using Web.Infrastructure.Authentication;
using Web.Infrastructure.Reporting;
using Web.Infrastructure.Storage;
using Web.Model;
using Mvc3Ninject.Utility;

namespace Web
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : HttpApplication
    {
        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
            filters.Add(new HandleErrorAttribute());
        }

        public static void RegisterRoutes(RouteCollection routes)
        {
            
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("favicon.ico");
            routes.MapRoute(
                "Login", // Route name
                "login", // URL with parameters
                new { controller = "Session", action = "Create" } // Parameter defaults
            );
            routes.MapRoute(
                "Logout", // Route name
                "logout", // URL with parameters
                new { controller = "Session", action = "Delete" } // Parameter defaults
            );

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );

        }

        public static void RegisterServices(IKernel kernel)
        {
            kernel.Bind<IControllerFactory>().To<DefaultControllerFactory>();

            //a typical binding
            kernel.Bind<ILogger>().To<NLogLogger>().InSingletonScope();
            //Bind<INoSqlServer>().To<DB4OServer>().InSingletonScope();
            //Bind<ISession>().To<Db4oSession>().InRequestScope();

            //You can use the SimpleRepository to build out your database
            //it runs "Auto Migrations" - changing your schema on the fly for you
            //should you change your model. You can switch it out as you need.
            //http://subsonicproject.com/docs/Using_SimpleRepository
            kernel.Bind<ISession>().To<SiteEFSession>();
            kernel.Bind<IReporting>().To<ReportingSession>();
            kernel.Bind<IAuthenticationService>().To<UserAuthenticationService>();
        }

        public void SetupDependencyInjection()
        {
            // Create Ninject DI Kernel 
            _container = new StandardKernel();

            //// Register services with our Ninject DI Container
            RegisterServices(_container);

            //// Tell ASP.NET MVC 3 to use our Ninject DI Container 
            MvcServiceLocator.SetCurrent(new NinjectServiceLocator(_container));
        }

        void Application_Start()
        {
            SetupDependencyInjection();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            Logger.Info("App is starting");
        }

        protected void Application_End()
        {
            Logger.Info("App is shutting down");
        }

        protected void Application_Error()
        {
            Exception lastException = Server.GetLastError();
            Logger.Fatal(lastException);
        }

        public ILogger Logger
        {
            get
            {
                return Container.Get<ILogger>();
            }
        }

        static IKernel _container;
        public static IKernel Container
        {
            get
            {
                return _container;
            }
        }
    }
}

Alternatively in going through this headache I found downloading the source for both Ninject and Ninject.Web.Mvc and updating it to use .NET Framework 4.0 and Mvc 3 fixed most of the errors above and allows you to NOT change the global.asax.cs at all. You can just use it as it was originally.

To get Ninject.Web.Mvc updated you must:
  • Change the Target Framework to .NET 4.0.
  • Update the reference to System.Web.Mvc to use 3.0.0.0 instead of 2.0.0.0
  • Remove the following references:
    • System.Web.Routing
    • System.Web.Abstractions
In closing, I really wish the MVC team would include a default Dependency Injection with MVC. I've lost way too many hours at this point trying to get DI working between all the different options and all the outdated tutorials. If I'm struggling with it I have to imagine there are many others out there as well. This is making it harder for people to adopt MVC and should be eliminated by the MVC team picking a default to include when installing MVC and generating the default global.asax.



Friday, August 13, 2010

How was the Picture Quality Bitches? - Netflix

Just received this in my inbox:



Maybe Dave Chappelle works at Netflix nowadays? Or at least somebody who loves this bit as much as I do!


Thursday, July 15, 2010

The New Digg Rocks!

If you haven't heard yet Digg.com has done a major upgrade to their site. Currently it's invite only but you can go to new.digg.com to request an invite. 

My username is crdeutsch (cdeutsch was taken) if you want to follow me. 

One of the new features is you can add RSS Feeds of your content to automatically publish to Digg which I've just taken advantage of.  

The new site is way faster, cleaner, and easier to follow people that are relevant to you. Can't wait until more people I know start using the service!

Tuesday, July 13, 2010

Comcast EcoBill Eco Sucks

If you're a Comcast Business customer make sure you write down your account number before signing up for EcoBill otherwise Comcast won't help you. I tried to add Basic TV to my Internet service and first the customer service rep says I can't have business TV since my business is a "residence" so she transfers me to Residential Service where I wait on hold for 10-15 minutes before being told they can't do anything for me since I'm a business customer and they transfer me back to the SAME WOMAN! This time I say the business service is at a "business" so I get to the "next level" in their little game. Now she needs my account number or she can't help me. I ask where to find it and she says on the statement. I get electronic EcoBill statements and guess what? No account number. I searched for Comcast emails and every time I found my account number the beginning is "starred out". So tell me again A) how EcoBill saves me time and money? B) why the hell do I do business with this company? It's rumored you can save time and money by figuring out where the notch filter is for your service and removing it yourself.

UPDATE: Received a call back from my original Sales Rep after shooting him an email about my experience. This is what customer service is supposed to be. He took the time to explain there are some licensing issues with Business Class TV in a residence, etc. So I do indeed need to setup Residential TV Service but the rate should be the same as the one packaged with Business Internet.
2 Tips:
  1. Basic Analog Cable does exist even though I can't find it on their web page
  2. Call after 10pm to avoid commissioned sales reps


Sunday, June 27, 2010

Ultimate Windows Mac - Part 2

This is Part 2 in a series on configure a MacBook for Windows power users.

When I left off in Part 1 I was debating on which SSD to use. I decided on a OCZ Vertex 2 after reading about some issues the RealSSD's were having. I also purchased an MCE ObtiBay. So let's get to installing these parts. UPDATE: I'm having issues getting full performance from the Vertex 2 using Windows (seems to be limited to SATA I speeds). You may be better offer getting a lower ended SSD if your hardware/software combo is the bottle neck. More info will come as I work my way through the issue.


I'm not going to go into great detail on installing the hardware since others have already done it way better then I could. I left the OEM drive where it is and just installed the new SSD using the ObtiBay. The instructions from MCE where excellent. If you still need help with installation Other World Computing is a great resource.


Now that the drive is installed it's time to install Windows. I'll be installing Windows 7 Enterprise N 64bit edition. Since I'm not installing Windows to the same hard drive as OS X, I didn't run Boot Camp to prepare the drive. Instead I just booted from the Windows 7 DVD and installed Windows to the second hard drive (in my case the SSD one since I'll primarily being using Windows). Be careful which drive you install to. If you're paranoid then remove the OEM disk with OS X installed on it before beginning the Windows install.

Once Windows is installed you need to install the Boot Camp software. Put in your OS X installation disc and run setup. If you get the following error "Boot Camp x64 is unsupported on this computer model" which may happen if you use a retail disk of OS X, open a Command Prompt in Windows as Administrator and type the following:
cd /d D:
cd "Boot Camp\Drivers\Apple"
BootCamp64.msi

Run through the installer and most if not all your MacBook hardware should have the correct drivers installed. In my case the Light Sensor gives me a "This device cannot start" error but considering I'll have my laptop hooked up to an external monitor and keyboard 90% of the time I didn't bother fixing it. I'll make an update if I ever spend time looking for a solution.

The next step I do is to configure the keyboard so it's uses a PC style keyboard layout. There are a couple solutions but Sharp Keys is my favorite.

Map the keys as follows. Older MacBooks have an "Enter" to the left of the directional errors. New MacBooks have a "Right Alt/Option" key. The screen shot and direction handle both versions.
Num: Enter (E0_1C)             = Special: Right Ctrl (E0_1D
Special: Left Alt (00_38)      = Special: Left Windows (E0_5B)
Special: Left Windows (E0_5B)  = Special: Left Alt (00_38)
Special: Right Alt (E0_38)     = Special: Right Ctrl (E0_1D)
Special: Right Windows (E0_5C) = Special: Right Alt (E0_38)

This works great if you don't plan to use an external PC style keyboard. I use a Microsoft Natural Ergonic Keyboard 4000 at home and at work. These key mappings will cause the external keyboard to work different so I need to be able to toggle back and forth. Unfortunately Windows needs to be restarted (or at least logged off) for keyboard mapping changes to take effect. The best solution I came up with is to script this. Our custom keyboard mapping is stored in the registry so I've created two registry export files and 2 batch files to either Enable or Disable the custom mapping. As soon as I log into Windows I run the batch file I need and it will immediately log me off and then I'll log back in and the keyboard will be in the configuration I need. I also add 3 registry settings for the mouse. I like the MacBook Pro's trackpad to be "slower" then my external mouse and I also find scrolling 1 line at a time is better with the trackpad versus 3 lines for the external mouse.

You can create the 6 files you need as follows or download them from here.

MacKeyboard-Enable.reg :
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,06,00,00,00,1d,e0,1c,e0,5b,e0,38,00,\
  38,00,5b,e0,1d,e0,38,e0,38,e0,5c,e0,00,00,00,00

MacKeyboard-Disable.reg :
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=-

MacMouse-Enable.reg :
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Control Panel\Desktop]
"WheelScrollChars"="1"
"WheelScrollLines"="1"

[HKEY_CURRENT_USER\Control Panel\Mouse]
"MouseSensitivity"="6"

MacMouse-Disable.reg :
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Control Panel\Desktop]
"WheelScrollChars"="3"
"WheelScrollLines"="3"

[HKEY_CURRENT_USER\Control Panel\Mouse]
"MouseSensitivity"="10"

~MacHardware-Enable.bat (I use the tilde to force the file to the top in the list)
REGEDIT.EXE  /S  "MacKeyboard-Enable.reg"
REGEDIT.EXE  /S  "MacMouse-Enable.reg"
shutdown -l

~MacHardware-Disable.bat
REGEDIT.EXE  /S  "MacKeyboard-Disable.reg"
REGEDIT.EXE  /S  "MacMouse-Disable.reg"
shutdown -l

The next part is specific to my dual hard drive configuration and it's your call if you want to do it. Since I didn't buy a monster sized SSD I want to store any data that is large and relatively static on the regular hard drive we're running OS X off of. The first step is to boot into OS X and use BootCamp assistant to partition your hard drive. Of the 320GB on the hard drive my MacBook came with I gave OS X 60GB and I'll use the other 260GB as a "data" partition. After partitioning with BootCamp choose to "not install windows" at this time and then boot back into Windows to format the drive using NTFS. The drive should now be available as drive D: (drive letter may vary but I'll assume it's D for the rest of this article). You could choose to move the entire "User" folder to the new drive. Since this would include various application temp and setting folders that may be altered often and may benefit from being on an SSD I opted to just move the individual "Documents", "Downloads", "Music", "Pictures", and "Videos" folders.

You could do it the "easy way" built into Windows 7 but I chose a more transparent way since some Windows programs don't seem to default to the correct folder when using the "easy way". I'm going to use the command line program MKLINK to create a "symlink" similar to what Unix has had for ever.

First I create individual "Documents", "Downloads", "Music", "Pictures", and "Videos" folders on the D drive. If you have a lot of data already in these folders on the C drive then use this guide to move the data. My folders are still pretty much empty so I just deleted the folders on the C drive and then opened a command prompt and typed the following from your User Profile directory (ex. C:\Users\CDEUTSCH):
MKLINK /J Downloads D:\Downloads
MKLINK /J Documents D:\Documents
MKLINK /J Music D:\Music
MKLINK /J Pictures D:\Pictures
MKLINK /J Videos D:\Videos

Another optional step is to purchase and install MacDrive if you want the ability to write to the partition with OS X on it.

On my first MacBook Pro I tired to "share iTunes" between OS X and Windows. I stored the files in the default Music folder in OS X, then used MacDrive on Windows to read and write to this location. You can have iTunes open an alternative iTunes library by holding the "Shift" key while opening iTunes. This worked Ok, except iTunes always update the file paths every time you switched from Windows to OS X. This process took way too long sometimes, so after Windows 7 came out I moved iTunes to my Windows partition and now only use iTunes under Windows. I currently mostly use OS X for MonoTouch iPhone development and for casual web browsing. If you're into hooking up your laptop to your TV I highly recommend Boxee, Remote Buddy, and Hulu Desktop (I use a dedicated MacMini for this instead of my laptop). Another thing OS X is great at is backing up your Windows partition. Winclone is excellent but I believe it only works for GPT formated drives. So unless you're running Windows on the same drive as OS X I would find another program for doing a bare metal backup. I may explore this more in a future blog post.