Saturday, October 30, 2010

Custom iPhone 4 Mount For Car

Cutting to the chase. Here are the pics of my new custom iPhone mount!


Previously I had customized my car to mount my iPhone 3G using a Griffin iPhone 3G Windshield Mount.

A couple months later the iPhone4 came out and it does not work with the Griffin mount I was using. I took a gamble and order a Griffin WindowSeat AUX.

I got very lucky and was able to put the cradle from the new Griffin mount onto the existing arm from the 3G mount. It's an extremely tight fit but it works. It doesn't swivel as easily as I'd like but I'm very happy I didn't have to do anymore cutting.

The next customization I wanted to do was to add steering wheel controls for music. I found this Kensington LiquidAUX Bluetooth Car Kit and it was on sale so I got overly excited and bought 2!

After it arrived I was disappointed to find out that my Alpine CDA117 car stereo does not have a regular "line in" that would work with the Kensington Bluetooth kit. :(

In addition the AD2P audio takes over the wired line out so it was looking like I'd have to not use the Bluetooth kit or buy a new stereo. After some googling I found the solution to my problem. If you jailbreak your iPhone and install Bluetooth Profile Selector (BTPS) you can disable the AD2P out and the audio will play out the wired connection, BUT the wireless steering wheel controls still work!

The Kensington Bluetooth kit allows me to play/pause, and skip songs forward and backward and also has a button that will bring up Voice Control. Voice Control seems to work Ok for dialing numbers. So far I haven't found the trick to get it to play songs/artists while connected to the car stereo.

The final mod I did was to disable the "Accessory Connected" splash screen that replaces the iPod apps UI when connected to my head unit. There is another app on Cydia for jailbroken phones called No Accessory Splash. Install this and you can use the iPod app like normal in addition to having the head unit controls work.

The combination of a nice touch screen and steering wheel controls should make my commutes much more pleasant! Especially considering every other feature in my Mitsubishi Evo IX RS is manual (locks, windows, mirrors, seats, etc). For those curious the RS is a stripped down model primarily marketed to be raced. This saves weight and allows the car to be sold at a lower price.

Thursday, October 14, 2010

How Not to Implement Unsubscribe

UPDATE 10/14/2010 11:55 AM CST: SpeakerRate may not have done the unsubscribe correctly. But they know customer service. Thanks guys!
http://twitter.com/#!/speakerrate/status/27356776561

This is just plain unacceptable. I rated one speaker and used my email address to do so. I get a newsletter from SpeakerRate the next day which is fine because I planned to just click the Unsubscribe link at the bottom. Here's what I was presented with:



Do you really think I want to create an account?

Friday, October 8, 2010

Count the Number of Network Connections in Windows

If you need to count the number of network connections to a certain port start by entering this command into a command prompt:
netstat -a -n

Then find the IP:Port combo you want to count and modify the following command to get the count:
netstat -a -n | find /c "<ip:port>"

Example:
netstat -a -n | find /c "127.0.0.1:1935"




Thursday, October 7, 2010

Upgrade ASP.NET MVC 3 Preview to MVC Beta

I previously blogged about upgrading the TekPub ASP.NET 2 Starter Site from MVC2 to MVC3 Preview:
http://blog.cdeutsch.com/2010/08/upgrade-mvc2-to-mvc3.html

Today I upgrade that project to MVC3 Beta.

It was pretty easy. Biggest change was with Dependency Injection. IMvcServiceLocator no longer exits and has been replaced with IDependencyResolver.

My NinjectServiceLocator file has been replaced with NinjectResolver (thanks Jedidja from StackOverflow!) and looks like this:

namespace Mvc3Ninject.Utility
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web.Mvc;
    using Ninject;

    [System.Diagnostics.DebuggerStepThrough]
    public class NinjectResolver : IDependencyResolver
    {
        private static IKernel kernel;

        public NinjectResolver()
        {
            kernel = new StandardKernel();
            RegisterServices(kernel);
        }

        public NinjectResolver(IKernel myKernel)
        {
            kernel = myKernel;
            RegisterServices(kernel);
        }

        public static void RegisterServices(IKernel kernel)
        {
            //kernel.Bind<IThingRepository>().To<SqlThingRepository>();
        }

        public object GetService(Type serviceType)
        {
            return kernel.TryGet(serviceType);
        }

        public IEnumerable<object> GetServices(Type serviceType)
        {
            return kernel.GetAll(serviceType);
        }
    }

}

And then in the Global.asax.cs file I changed this line....

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

...to...

//// Tell ASP.NET MVC 3 to use our Ninject DI Container 
DependencyResolver.SetResolver(new NinjectResolver(_container));

And that's that! Have fun coding!

Here's a complete working sample project based on my Code-First Entity Framework upgrade of the TekPub Starter Site.