• Home
  • Posts RSS
  • Comments RSS
  • Edit
Blue Orange Green Pink Purple

Matt Linder

My Photo Much like Hector Salamanca, I believe family is everything. I run and cycle sometimes, too. I spend the majority of my week days implementing a solution, or solving problems at a computer, aided by a trusty bag of almond m&ms.

Google Accounts Multiple Sign-In

Google accounts now offers multiple sign-in. The feature may have to be enabled if you have not done so already for each account you plan to use...

Read More

Unity config changes for 2.1


Unity is a great tool from the patterns and practices team at Microsoft. Its an asset to loosely couple classes for different patterns and architectures.

After running into a snag with Unity, I decided to run through the demo available from the microsoft download. I have installed VS 2012 and love the new features.

Unfortunately, the 2008 demo has the old style configuration schema, which breaks when you reference the new Unity assemblies. After a few minutes of reviewing the documentation I got it t work. I will include the new format here in case anyone else needs it.

Original:


<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration"/>
  </configSections>
  <unity>
    <typeAliases>
      <typeAlias alias="int" type="System.Int32, mscorlib" />
      <typeAlias alias="singleton"
                 type="Microsoft.Practices.Unity.ContainerControlledLifetimeManager, Microsoft.Practices.Unity" />
      <typeAlias alias="transient"
                 type="Microsoft.Practices.Unity.TransientLifetimeManager, Microsoft.Practices.Unity" />
      <typeAlias alias="IMachineDisplay"
                 type="SlotMachine.IMachineDisplay, SlotMachine" />
      <typeAlias alias="ISpinner"
                 type="SlotMachine.ISpinner, SlotMachine" />
      <typeAlias alias="IWinningsCalculator"
                 type="SlotMachine.IWinningsCalculator, SlotMachine" />
    </typeAliases>
    <containers>
      <container>
        <types>
          <type type="IMachineDisplay" mapTo="SlotMachine.ConsoleDisplay, SlotMachine">
            <lifetime type="singleton" />
          </type>
          
          <type type="ISpinner" mapTo="SlotMachine.SimpleSpinner, SlotMachine">
            
            <typeConfig extensionType="Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration">
              <property name="Display" propertyType="IMachineDisplay" />
            </typeConfig>
          
          </type>

          <type type="IWinningsCalculator" mapTo="SlotMachine.AirportWinningsCalculator, SlotMachine" />

          <type type="SlotMachine.SlotMachine, SlotMachine">
            <typeConfig extensionType="Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration">
              <constructor>
                <param name="id" parameterType="int">
                  <value value="37" type="int" />
                </param>
                <param name="display" parameterType="IMachineDisplay">
                  <dependency />
                </param>
                <param name="spinner" parameterType="ISpinner">
                  <dependency />
                </param>
                <param name="calculator" parameterType="IWinningsCalculator">
                  <dependency name="debug"/>
                </param>
              </constructor>
            </typeConfig>
          </type>
        </types>
      </container>

      <container name="child">
        <types>
          <type type="IMachineDisplay" mapTo="SlotMachine.ConsoleDisplay, SlotMachine">
            <lifetime type="transient" />
          </type>
        </types>
      </container>
      
    </containers>
  </unity>
</configuration>

Updated:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration"/>
  </configSections>
  <unity xmlns="http://schemas.microsoft.com/practices/2010/unity"

    <alias alias="int" type="System.Int32, mscorlib" />
    <alias alias="singleton"
               type="Microsoft.Practices.Unity.ContainerControlledLifetimeManager, Microsoft.Practices.Unity" />
    <alias alias="transient"
               type="Microsoft.Practices.Unity.TransientLifetimeManager, Microsoft.Practices.Unity" />
    <alias alias="IMachineDisplay"
               type="SlotMachine.IMachineDisplay, SlotMachine" />
    <alias alias="ISpinner"
               type="SlotMachine.ISpinner, SlotMachine" />
    <alias alias="IWinningsCalculator"
               type="SlotMachine.IWinningsCalculator, SlotMachine" />

    <containers>
      <container>
        <register type="IMachineDisplay" mapTo="SlotMachine.ConsoleDisplay, SlotMachine">
          <lifetime type="singleton" />
        </register>
        <register type="ISpinner" mapTo="SlotMachine.SimpleSpinner, SlotMachine">
          <property name="Display" dependencyType="IMachineDisplay" />          
        </register>
        <register type="IWinningsCalculator" mapTo="SlotMachine.AirportWinningsCalculator, SlotMachine" />
        <register type="SlotMachine.SlotMachine, SlotMachine">
          <constructor>
            <param name="id" value="37" >
            </param>
            <param name="display" >
              <dependency />
            </param>
            <param name="spinner">
              <dependency />
            </param>
            <param name="calculator">
              <dependency name="debug"/>
            </param>
          </constructor>
        </register>
      </container>

      <container name="child">
        <register type="IMachineDisplay" mapTo="SlotMachine.ConsoleDisplay, SlotMachine">
          <lifetime type="transient" />
        </register>
      </container>
    </containers>
  </unity>
</configuration>
Read More 0 comments | Posted by Matt Linder edit post

Windows 7 64 bit WHS backup "Cannot mount the backup"

I just migrated to a new computer, but was unable to open/restore old backups. I had to enable automount in diskpart and uninstall the Home Server Restore Driver as found here:
http://forum.wegotserved.com/index.php/topic/15405-cannot-mount-the-backup/

"Finally found the solution. I've been struggling with this for a year. just go into your device manager on your client and expand the system devices tree and uninstall any Home Server Restore Driver you see. Reboot if necessary then you should be able to mount your backup. "

I did not need to reboot.
Read More 0 comments | Posted by Matt Linder edit post

Jsonp and MVC

JSON is a powerful way to transmit or expose sets of data to jQuery or javascript. There are several api's such as twitter, flicker, and yahoo that allow this functionality. Unfortunately, it can be used for bad intentions. To curtail such experiences, a "defense system" for foreign requests was created. This defense places restrictions on requests that occur on cross-domain http requests via javascript for returning data in the JSON format.

For visualization:


To bypass this issue and reduce the opportunity for accidental exposure of vulnerabilites, you have to change the response type of requests for this scenario. In jQuery 1.2, JSONP support was introduced. Jsonp, or JSON with Padding, is a a way to wrap json responses in callback manner, and remove client side get requests allowing only posts.


example source
Using MVC, you can easily expose JSON responses with your Controller. A simple way is to return a JsonResult. To add JSONP functionality, however, you will have to create a custom class, or extend the existing JsonResult.

Changing something like this:
{"Id" : 4, "Name" : "Matt Linder"}
to this:
callback({"Id" : 4, "Name" : "Matt Linder"});

I have implemented a default callback on the originating server, with the option to specify a custom consumer script for the callback, which seems to work well.
Read More 1 Comment | Posted by Matt Linder edit post

Entity Framework Migration

Working on my first major from scratch MVC/EF Codefirst project, things 'bout to get real. After the poc/dev process, a project may involve tweeks  or changes that will be abandoned. There are great processes for scripting changes, but EF has a nice feature called migrations.

Here is a good post on Entity Framework Migrations. Note 9 applies best. Its always the little things.
Read More 1 Comment | Posted by Matt Linder edit post

jQuery Background Image Bug

Sorry, this is for me and  me alone.

We had an issue with a drupal install that only impacted IE8 on XP. After checking hotfixes, antivirus and duplicating the issue,
Read More 0 comments | Posted by Matt Linder edit post

Be Your Own Boss

Sometimes people ask you when you work for your self what its like to be your own boss. I always respond jokingly, something to the effect of 'its horrible--my boss is a jerk'. Really, I'm not sure, because when you 'work for yourself' you always have
a boss-if not many.

Lunch break FUTAB (Feet Up Taking A Break) in my cubicle at work  #newsfromthecube

Your boss is(are) your customers. They do not necessary dictate when you will come into the office, or what you will do day to day, what you wear, but nonetheless you work for them. I have learned that the trick to satisfy so many bosses it to focus on being proactive instead of being responsive. Of course, you have to respond to needs, or priorities of your customers, but if you lack vision or planning, you will never truly be successful. It helps to learn to anticipate feedback, or project needs, or urgency before it becomes urgent. If you can do this, you are rewarded with more bosses, with more conflicting needs or priorities.And in the end, that's what we all want. Right?

Having may bosses is not meant to be a bad thing. The alternative is worse. But having so many conflicting requests will create challenges .So, in the end, focus on the right things, be proactive and refine your process. Improve and plan to avoid getting fired when you 'work for yourself'.
Read More 0 comments | Posted by Matt Linder edit post

NTLM Authentication in IIS with FireFox Yields 401.2

Request Header
I made an interesting find. In firefox, there is a bug using ajax and ntlm authentication with IIS. After an initial authentication, the NTLM credentials should be cached and transmitted in the subsequent requests. On XMLHttpRequest requests, however, if a resource is nested, the header either is missing the credentials, or has it in an invalid format.
By nested, I mean for example that if there is a css file with links to images on the same IIS application, these subsequent requests will result in a 401.2 response. I have been able to duplicate this and have verified a workaround. The subsequent files in my case are images, and are wholy contained in an images folder, which I can configure for anonymous access. This removes the need to authenticate for the nested requests. Nevertheless, the bug remains.

Here is an excellent resource for configuring IIS for authentication.
Read More 2 comments | Posted by Matt Linder edit post

Cannot connect to user default database

To handle the message "Cannot connect to database. Cannot open user default database. Login Failed." you have to change the user default database.

To do this, click opens on your login form, and then type the name of the database you want to connect to.

Read More 1 Comment | Posted by Matt Linder edit post

Tech Worker Dress Code

Work in IT requires interaction with people at varying levels. At my current job, we don't have a formal dress code. This differs from my most recent previous places of employment. The culture is more metro/urban also. Jeans are rarely seen on our team when someoone has a meeting with an external customer. As a developer, it is necessary sometimes to meet with internal customers. Rarely, with external customers.

I find it interesting that we are not banned from wearing sandals, shorts or flip flops. Previously I have worked in environments that require business casual of people who never have contact with anyone outside of there group. I have worked where they have casual Fridays. But with the lack of restriction at work, I routinely see people wearing suits, slack and jackets, business dresses without the code. Of course clothing in a work environment should be modest enough to not detract from the work, but I am not sure how having a dress code benefits an organization in which the majority of the workers have no interactions outside their internal group. Is it possible to consider coworkers professionals regardless of apparel?

I generally try to wear jeans twice a week and have noticed that I feel more productive with comfortable shoes and jeans than with not, but still feel obligated to not appear flagrantly inappropriate.

Do you think dress codes should be implemented at all businesses for IT people?
Read More 2 comments | Posted by Matt Linder edit post

Google Accounts Multiple Sign-in

Google accounts now offers multiple sign-in. The feature may have to be enabled if you have not done so already for each account you plan to use. This is a powerful enhancement that allows convenience when attempting to use more than one account on the same pc and browser session. This feature is utitlized by clicking on your profile and clicking the 'Switch Account's link. This works with Calendar, Reader, Code, Sites and Gmail. One annoyance is that for existing applications such as Gmail, the wrong account may keep coming up first. There is a way to set the default account, and even subsequent accounts in the shortcuts for the applications. Here's what you can do.

The first account you sign into is the default account when using mulitiple sign-on. There are a few google products that support it. Remember though, that if you sign out of any google product, it signs you out of all accounts. Now, Google's URLs include a different path for each account such as http://mail.google.com/mail/u/0/, http://mail.google.com/mail/u/1/, etc. This can allow you to update existing application shortcuts manually, to use the account you prefer, or even change with convenience.
Read More 1 Comment | Posted by Matt Linder edit post

Droid 2 Global Keyboard Issue - Space Bar Crashing Google Voice

My wife and I purchased two Droid 2 Global phones last year. Recently, her phone started to lock up when she pressed either the space bar on the physical keyboard on the touchscreen one. Mine never experienced this.

Reinstalling, rebooting or restarting the google voice app did not resolve the issue. After some digging, it appears that the android keyboard application is the culprit. To resolve it, perform the following on your phone.

Menu - Settings - Applications - Manage Applications - All - Multi-Touch Keyboard - Clear Data
Read More 1 Comment | Posted by Matt Linder edit post
Newer Posts Home

Matt Linder

  • About

      Former scoutmaster, soccer coach, long distance runner turned donut connoisseur and father of five with a passion for learning technology and solving technical problems!

      View Matt Linder's profile on LinkedIn
    • About Me

      My photo
      Matt Linder
      South Carolina native, lover of peanut butter and donuts, and web developer.
      View my complete profile

      Professional Matt Linder

      Matt Linder's public blog.

      Blog Archive

      • ►  2015 (1)
        • ►  August (1)
      • ►  2013 (1)
        • ►  October (1)
      • ▼  2012 (11)
        • ▼  October (1)
          • Unity config changes for 2.1
        • ►  July (2)
          • Windows 7 64 bit WHS backup "Cannot mount the backup"
          • Jsonp and MVC
        • ►  June (1)
          • Entity Framework Migration
        • ►  April (2)
          • jQuery Background Image Bug
          • Be Your Own Boss
        • ►  March (5)
          • NTLM Authentication in IIS with FireFox Yields 401.2
          • Cannot connect to user default database
          • Tech Worker Dress Code
          • Google Accounts Multiple Sign-in
          • Droid 2 Global Keyboard Issue - Space Bar Crashing...

      Achievements Unlocked

      fitness apps fitness apps fitness apps fitness apps
    • Search






      • Home
      • Posts RSS
      • Comments RSS
      • Edit

      © Copyright Professional Matt Linder. All rights reserved.

      Designed by FTL Wordpress Themes | Bloggerized by FalconHive.com | Blogger Templates
      brought to you by Smashing Magazine

      Back to Top