Skip to main content

Brian's Blog

Go Search
Home
  

Other Blogs
There are no items in this list.
Blog of Brian Ellis.
Quick Tip: Making Fiddler Work with Localhost and Firefox 3.0

As I mentioned yesterday, I recently upgraded to Firefox 3.0 and immediately found a few issues with the application we are testing.  After going through the standard debugging steps, I pulled out Fiddler, an awesome (and free) application to analyze the HTTP traffic.  Now, Fiddler is a fantastic tool but has a lot of quirks about when it decides to analyze traffic.  The most common issue is that it doesn't analyze traffic from your localhost.  The Fiddler site says this is because "IE7 and the .Net Framework are hardcoded not to send requests for Localhost through proxies".  Since most of you reading this (including myself) are developers using Cassini and testing on our localhost, fixes are in order.  Some of the basics include:

I've seen all of these work to some degree.  However, I had never realized that Fiddler didn't seem to pick up Firefox traffic AT ALL.  I looked into it a bit and found a quick older fix for this on the "Life of a Java Disciple" blog.  Updated for Firefox 3, the steps are as follows:

  • Go to My Documents > Fiddler2 > Scripts.  There should be a file called BrowserPAC.js.  Make note of the full path for this file.
  • Open Firefox 3.0.  Open the Tools menu and click Options. 
  • Under the Network Tab, click Connection > Settings.
  • Under Setting > Choose "Automatic proxy configuration URL" and put the full path to BrowserPAC.js in the text box. 
  • Click OK

Open Fiddler and try Firefox again.  You should start seeing requests show up.  Hope this helps.

UPDATE: I removed the recommendation for "Using the name of your machine, rather than localhost" after I was assured by a co-worker that this doesn't work now (if it ever did).  This is why it's good to be surrounded by smart people.

Quick Tip: Making Firefox Work With SharePoint

Since a lot of people (including me) are upgrading to Firefox 3.0, I thought I'd share a quick tip that I rediscovered on Patrick Cauldwell's Blog.  If you use Firefox (any version), it can drive you crazy trying to access internal network sites (specifically SharePoint sites in my case).  I end up having to log in every time I want to approve blog comments, access our internal project sites, etc.  I found this fix to enable NTLM so that Firefox will authenticate automatically like IE does.

  1. Open Firefox
  2. Type about:config in the address bar
  3. Type network.automatic in the Filter bar
  4. Right click network.automatic-ntlm-auth.trusted-uris and click Modify
  5. Enter only the names of your internal servers in a comma-delimited list.  For example: [server1],[server2] and click okay.
  6. Restart Firefox

You should be able to access all of your internal sites on the servers you entered through Firefox now without entering your name and password repeatedly.

Replacing Notepad with Notepad 2

UPDATE: This post applies to Windows Vista, although comments indicate that it works on XP despite a few warnings. 

I've been playing with IronPython and IronRuby the past week or two.  To get basic syntax highlighting, I use the Notepad2 text editor since Visual Studio doesn't really support the dynamic languages yet (unless you download something like IronPythonStudio, which I do like) and Notepad is about as close to worthless as you can get in a text editor these days.  My goal is to completely replace the default Notepad text editor so that the replacement (Notepad2) opens as the default text editor everywhere in Windows, even if you "View Source" from a web page.

<rant>

Seriously, when was the last time Notepad was updated?  Windows '98?  Does anyone find it reasonable that it is 2008 and my text editor choices that ship with Windows Vista are Notepad (a text editor so basic that it still doesn't support line numbers) and Wordpad (a useless middle child that messes with my doc too much to code in and sucks too bad to replace MS Word)?

</rant>

Among Notepad replacements, my favorites are Notepad2 and Notepad++.  I usually stick with Notepad2 but either works.  Since Windows keeps backups of Notepad and now UAC protects the documents, it can be a bit difficult to replace the default Notepad.  There are some methods involving copying the file around over system files that never seems to work for me.  I found an awesome batch file on the "My Digital Life" forum that you can use to easily install Notepad2 and override the copies and UAC but I'm always losing it so I'm putting it up here as well.  So, to install Notepad2:

  • Download Notepad2
  • Extract it to a folder.
  • Create two batch files in the same folder as Notepad2.  I usually just call them install.bat and uninstall.bat
  • Put the following code in install.bat and save it.

    @echo off
    TITLE Notepad2 Install Script for Complete Vista Notepad Replacement
    echo.
    echo Notepad2 Install Script for Complete Vista Notepad Replacement
    echo Version 1.1
    echo.
    echo (c) My Digital Life (www.mydigitallife.info)
    echo.
    echo.
    echo.
    echo Confirm to apply? (Press Ctrl-C and answer Y to terminate)
    pause
    echo.
    echo.

    if exist %Systemroot%\notepad.original.exe goto exist_notepad2_already
    if exist %Systemroot%\System32\notepad.original.exe goto exist_notepad2_already
    takeown /f %Systemroot%\notepad.exe
    takeown /f %Systemroot%\System32\notepad.exe
    icacls %Systemroot%\notepad.exe /grant "%username%":f
    icacls %Systemroot%\System32\notepad.exe /grant "%username%":f
    IF EXIST %SYSTEMROOT%\SysWOW64 (bcdedit.exe -set loadoptions "DDISABLE_INTEGRITY_CHECKS")
    copy %Systemroot%\notepad.exe %Systemroot%\notepad.original.exe
    copy %Systemroot%\System32\notepad.exe %Systemroot%\System32\notepad.original.exe 
    echo.
    echo Original notepad.exe has been renamed to "notepad.original.exe" in its original folder.
    echo.
    copy notepad2.exe %Systemroot%\notepad.exe /y
    copy notepad2.exe %systemroot%\System32\notepad.exe /y
    echo.
    echo Notepad2 installation is completed.
    echo If no error occurred, Notepad2 will now replace all Notepad functions.
    echo.
    pause
    exit

    :exist_notepad2_already
    echo.
    echo INSTALLED NOTEPAD2  ALREADY!.
    echo.
    pause
    exit

  • Put the following code in uninstall.bat and save it.

    @echo off
    TITLE Notepad2 UnInstall Script for Complete Vista Notepad Replacement
    echo.
    echo Notepad2 UnInstall Script for Complete Vista Notepad Replacement
    echo Version 1.1
    echo.
    echo (c) My Digital Life (www.mydigitallife.info)
    echo.
    echo.
    echo.
    echo Confirm to apply? (Press Ctrl-C and answer Y to terminate)
    pause
    echo.
    echo.

    if not exist %Systemroot%\notepad.original.exe goto not_exist_notepad2
    if not exist %Systemroot%\System32\notepad.original.exe goto not_exist_notepad2
    takeown /f %Systemroot%\notepad.exe
    takeown /f %Systemroot%\System32\notepad.exe
    icacls %Systemroot%\notepad.exe /grant "%username%":f
    icacls %Systemroot%\System32\notepad.exe /grant "%username%":f
    IF EXIST %SYSTEMROOT%\SysWOW64 (bcdedit.exe -set loadoptions "DDISABLE_INTEGRITY_CHECKS")
    del %Systemroot%\notepad.exe
    del %Systemroot%\System32\notepad.exe
    echo.
    echo notepad.exe(notepad2) has been deleted.
    echo.
    ren %Systemroot%\notepad.original.exe notepad.exe
    ren %Systemroot%\System32\notepad.original.exe notepad.exe
    echo.
    echo Original notepad.original.exe has been renamed to "notepad.exe" in its original folder.
    echo.
    echo Notepad2 uninstallation is completed.
    echo.
    goto exit_uninstall

    :not_exist_notepad2
    echo.
    echo ERROR NOTEPAD2 NOT EXIST or NOT INSTALL.
    goto exit_uninstall

    :exit_uninstall
    pause

  • Navigate to the directory you put Notepad2 and the batch files in and just run install.bat or uninstall.bat (for whichever operation you'd like) as Administrator.  The easiest way to do this is to right click the file you'd like to run while holding the left shift key, then clicking "Run as Administrator".

After that, your new Notepad editor should be set up.  Just type Notepad and see what comes up.  Enjoy.

Entity Framework: Vote of No Confidence

I thought I'd post this summary that I sent out to our internal developer list earlier today. 

UPDATE: Tim posted his views on the EF and the open letter here.

--------

There have been a lot of complaints about the current implementation of the Entity Framework in the community and a bunch of the more visible alt.net figures have put together an open letter detailing what they see as its faults. 

http://efvote.wufoo.com/forms/ado-net-entity-framework-vote-of-no-confidence/

The purpose of this open letter is supposedly not to torpedo it, but to make Microsoft address these issues in the future.  I’m far from an expert in this but on a quick read-through, their complaints seem to be:

  • The design of the framework entities is that they are data only, causing issues in maintainability and making it difficult or impossible to implement business objects or more “real-world” objects. 
  • The design of the framework entities is that they cannot be persistence ignorant, so things like unit testing become next to impossible because you cannot test the model without the database (for instance).
  • Lazy loading is not supported at all and requires a lot of extra code to make work.  This confuses me.  I thought I saw "lazy-loading" demoed internally but I might be mistaken.
  • Shared, canonical models contradict software best practices.  This appears to be related to using a single shared model for multiple contexts in the EF, rather than multiple models, one for each individual context.  I’ll be honest, I don’t much about this other than what I read in the explanation.
  • Excessive merge conflicts with source control.  Apparently, since the diagram contains the model and the visualization, it causes tons of merge conflicts when a team is using it.

Just thought I’d pass this on.  It’s interesting from at least a best practices point of view.

Microsoft Web Development Partner of the Year

Microsoft recently announced it's picks for the Worldwide Partner Conference awards and Vertigo was officially named as Microsoft Web Development Partner of the Year for Custom Development Solutions.  According to Microsoft, the awards are a chance to:

"...recognize partners who have developed exemplary solutions for their customers during the past year and who are winners of and finalists for the 2008 Worldwide Partner Conference (WPC) Awards. These outstanding partners demonstrated significant customer impact, originality, effective time to market, deployment of advanced features, and the ability to optimize their use of Microsoft technologies to meet business needs. "

You can check out the full award list here.  The full text of the category that Vertigo won is as follows:

Custom Development Solutions, Web Development Partner of the Year

Finalist: TI-M, Mexico
Finalist: Infusion Development, United States

Winner: Vertigo Software, United States
Vertigo created a solution with the Hard Rock Cafe to enable users to view and interact online with its memorabilia collection. The collection houses 70,000 pieces—and 70,000 stories—and the Hard Rock vision called for new photography, new copy, a new content-management system, and a new online database with a compelling user interface. While going live with 70,000 pieces of memorabilia would be a few years off, it was critical to Hard Rock management—and to the reemerging brand—that the site go live with rich content as soon as possible. Vertigo made this solution real by using Silverlight and Microsoft .NET Framework 3.5. The solution also included a content-management system built with Windows SharePoint Services 3.0.

I'm not sure of the exact numbers, but in a partner ecosystem with hundreds of thousands of Microsoft partners worldwide, we are very proud of the Hard Rock application and this award.  Congratulations to the Hard Rock team.  Take a second and go check out the Hard Rock application yourself!

Of Course

I'm not going to jump on the bandwagon yelling at Twitter for being down.

Okay, I lied.  You know it's gotten ridiculous when there is a site dedicated exclusively to your up and down swings and even they have begun to lose their sense of humor about the situation.  Seriously people, get your act together. 

http://www.istwitterdown.com/

image

Getting the Most Out of ScottGu's Silverlight 2.0 Overview

I'm sure you saw the Silverlight 2 Overview that Scott Guthrie posted a little while back at his site.  The small Digg client he wrote is a great walkthru if you're looking for something to get you started with Silverlight 2.  It covers a lot of basic Silverlight concepts and types as well as spreading the code between XAML and the code-behind.  He also posted the working code sample on the site with his eight part overview. 

I like to write the code as I follow along with things like this and I had a few problems getting my code sample working.  I fixed some of the errors by looking at Scott's provided code sample and others looking through the comments at the site.  In the comments, I also saw there were a lot similar problems and a few working answers.  Some of them helped me and most of the fixes were minor tweaks so I made notes as I went to try to collect all the fixes in one place.  Here they are in case you need them.

  • Overall
    • I try not to complain about free help but pictures of code stink.  You can't cut and paste code from a picture and trying to type it produces errors in translation.  I missed the question mark in the Digg query string and spent a few minutes staring at the code trying to figure out why it didn't work.
    • Scott changes the DataGrid to a List in Part 5 of the tutorial.  The overview makes note of it but it can be pretty confusing if you're not looking ahead.  Just stick with the grid and change it in Part 5.
    • Scott works over the sample a little bit in Part 8 to make it work with WPF instead of Silverlight.  That's why the code in the downloaded sample may not match what you're staring at prior to Part 8.
  • PART 2
    • The searchbutton and related click event are renamed appropriately between Part 1 and Part 2.  It doesn't make a difference in functionality but you may want to rename them for sanity.
  • PART 3
    • I believe I had to add a reference to System.Linq and System.XML for the code to compile.
    • To use the DataGrid as shown, you'll need to add a namespace reference for the Silverlight DataGrid to the top of Page.xaml.  Add the following line to the namespace attribute:
      • xmlns:Data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
    • When you query Digg, the topic you are querying for has to really exist at Digg or you'll get a "Download Failure" error.  Try "basketball" as your search.
  • PART 4
    • When you start moving all of your attributes out to styles as shown in the code sample, you'll have to set the TargetType for the style or you'll get parser errors at runtime.  Note: Errors are supposed to get better in future versions.
    • If you try to move all of the attributes to styles, you may get some parser errors at runtime.  Some of the attributes that are more control specific need parenthesis in their Setter.  For instance, you'll need to refer to "(Grid.ShowGridLines)" instead of "Grid.ShowGridLines" in your Setter.  Most of these attributes in the sample are just in there for debugging and aren't there in the final code sample.
    • You'lll notice the WatermarkedTextbox changes to TextBox in code pics.  This is because of the changes for WPF in Part 8.  Either works.
  • PART 5
    • This is where Data:DataGrid becomes a Listbox.  Don't forget to set the TargetType in the style Setter appropriately or you'll get runtime errors.  If you continue to use the DataGrid, you'll need to add the namespace line from above to the App.xaml file as well.
  • PART 6
    • If you follow the code to the letter, you'll need to add the DiggSample namespace to the top of Page.xaml:
      • xmlns:Digg="clr-namespace:DiggSample;assembly=DiggSample"
    • You'll need to remove the default width and height on the StoryDetailsView.xaml control or else it will get cut off. 
    • There seems to be an error with title field conversion with some content (dashes, maybe?).  I don't expect this to be a fault-tolerant app.  If you get an error clicking through a Digg link, just try another. 

So that's about it.  Like I said, all minor irritants.  I hope this saves you a bit of time.

Joel and IE8

Joel posted a rather lengthy post today about the war between "pragmatists" (or "realists") and "idealists" with regards to IE 8 and web standards.  I usually agree with Joel but I can't agree with him on this.  I guess that puts me solidly in the "idealist" camp.  Skipping the long intro of the article about headsets and going down to the halfway point of the post, Joel's basic points as I understand them are:

  • Idealists want the world to be standard because it really should be.
  • Pragmatists want things to be backwards compatible because they understand the realities of the world.
  • Joel thinks they're both right and he's not going to take sides but his tone and past posts place him solidly in the pragmatist camp.

Normally I'm in the Pragmatist camp when it comes to any issue.  I understand that it never works out ideally and engineers that strive for it despite the realities are generally disappointed.  When someone recently talked about customers not understanding they weren't the only customers, my reply was "you're confusing your problems with [your customers problems].  their only concern is what you can do for them.".  I even agree when he says:

All you smug idealists are laughing at this newbie/idjit. The consumer is not an idiot.  She's your wife.  So stop laughing. 98% of the world will install IE8 and say, “It has bugs and I can’t see my sites.” They don’t give a flicking flick about your stupid religious enthusiasm for making web browsers which conform to some mythical, platonic “standard” that is not actually implemented anywhere.

I understand exactly where Joel is coming from and I agree with him.

However, what puts me in the idealist camp on this issue is the fact that web standards aren't perfect and they aren't easy but we have to try.  The standards don't have to be perfect and known but if we don't all at least try to shoot for the same area, then we end up where we are today.  Throw a site into Firefox, Safari and IE.  Firefox and Safari don't have the same issues but they're in the same ballpark.  IE, on the other hand, is usually miles from that ballpark.  Honestly, I don't even see how Joel agrees with himself in this case since he was talking about "NewSDK" last September.  "NewSDK" was a theoretical language that compiled to cross-platform Javascript.  Here's what he said then:

Right now the big hole in the portability story is — tada! — client-side JavaScript, and especially the DOM in web browsers. Writing applications that work in all different browsers is a friggin’ nightmare. There is simply no alternative but to test exhaustively on Firefox, IE6, IE7, Safari, and Opera, and guess what? I don’t have time to test on Opera. Sucks to be Opera. Startup web browsers don’t stand a chance.

I'm sure there is a lot of gray area in this argument.  I'm sure you can push for standards and backwards compatibility at the same time.  However, that make-believe "NewSDK" is already showing up in bits and pieces all over the web and it requires browsers to at least be predictable, if not exactly the same as one another.  IE has never had to play nice and be compliant, predictable or even friendly at all.  As a consequence, we're all stuck saying "Sucks to be Opera".  I look at the disaster that is Vista and I know that there are dangers to breaking changes.  However, I just can't feel sorry that IE is going to finally be dragged into modern web development, even kicking and screaming. 

 

Will existing sites break?  Yes

Will the high-profile sites get updated?  Yes

Will corporate applications break and just drop in the "Use IE7 tag" rather than updating? Yes

Will there be applications that are on CD-ROM or just don't have the user base to get updated? Yes

 

All of these are valid concerns but I consider them to be a necessary evil if web development is going to continue to move forward or even be maintainable in it's current state.

Carry On Wayward Son

As I'm sure many of you are aware, Jeff Atwood (aka "Jeff", aka "Coding Horror", aka "Jimmy the Squid") left Vertigo this week to pursue some website (Pets.com?).  CodingHorror.com speaks for itself but I thought I'd take a moment to recognize one of his lesser known but equally important contributions.  I'm speaking of course...of his ability to rock.  You may not know this, but Jeff has long been a core member of Vertigo's in-house fake band (seen below at MIX '08). 

I've written before about the gaming culture at Vertigo.  I believe that gaming can bring people together in ways that might not happen otherwise and Jeff is a perfect example.

Our fake band is more of an rotating ensemble than a concrete lineup but we're definitely on critics radars.  I don't like to brag but we've often been described as "revolutionary", "amazing", and "ridiculous looking".  In an informal survey consisting of myself driving to work, we were described as "easily the best fake band in the big conference room on weeknights".

For his part, Jeff was an ideal band member, slow to anger but quick to solo.  He never let success ("@!&% Electric Eye!") or failure ("@!&% Devil Went Down to Georgia!") go to his head.  I still believe his story that the time he screamed "I am a golden rock god!" and jumped off the roof of Vertigo was due to a spoiled pop tart, and not his ability to beat "Play With Me" by Extreme.

Jeff is a great example of Vertigo culture and we will miss him.  We all wish him the best of luck in his future endeavors, even "while my guitar gently weeps".  Rock on.

Vertigo, Hard Rock and Duncan Channon Mix It Up with Silverlight 2

If you were under a rock last week, you'd be forgiven for not knowing that MIX '08 was going on.  On the other hand, most of you were probably wondering if there was anything else these crazy Internet people could talk about.  Vertigo had a few teams at MIX and got to help launch a new Hard Rock Memorabilia site using the new Deep Zoom technology in Silverlight 2.  We were thrilled work with Hard Rock and Duncan/Channon to create and launch the new site. To view it, you'll need to install Silverlight 2 (Beta 1) but I definitely think it's worth it.

Everyone here at Vertigo is very proud of the Hard Rock site and you can check it out here.  You can see the announcement video of the keynote at the Mix Sessions site.  I would at least skim the whole keynote, but you can check out demo of the site at around 1:41:00 into the video. 

It's also awesome that the demo seems to be a huge hit with the community:

I wasn't on the team that put this together so I went into the site as a total end-user and came away very impressed.  Granted, I'm biased (we're hiring).  However, I'm also a music fiend and could get lost in the Hard Rock site for hours (see also, Wikipedia).  I love the documents section that people have talked about, but being a grunge kid means that the highlight for me is the alternative section.  Check out Pearl Jam's hand-written first set list, a wall of picks and Gidget's bass!  Try out the site and let us know what you think.

1 - 10 Next

 ‭(Hidden)‬ Admin Links