jeffesp's posterous http://jeffesp.com Most recent posts at jeffesp's posterous posterous.com Wed, 11 Jan 2012 11:53:00 -0800 The Dead Milkmen http://jeffesp.com/the-dead-milkmen http://jeffesp.com/the-dead-milkmen

The girl with the strong arm has started licking batteries. And that's kind of strange even for her.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied
Wed, 12 Aug 2009 18:08:00 -0700 Pandora Radio http://jeffesp.com/20885122 http://jeffesp.com/20885122

The Trip-Hop station on Pandora rocks. I guess not literally.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied
Mon, 03 Aug 2009 14:56:00 -0700 Thoughts on TDD and BDD http://jeffesp.com/thoughts-on-tdd-and-bdd-0 http://jeffesp.com/thoughts-on-tdd-and-bdd-0

I just finished reading Martin Fowler's Mocks Aren't Stubs. This is a great document because it gives some names to things that I hadn't been able to name before. Classicist vs. Mockist TDD is a key distinction that we have been struggling to define as we develop more concrete testing methods at work. To know that other people, who know what they are doing, have also dealt with it helps us to know that we are not just making things up.

My key conclusion from this is that I follow a Classic TDD model. I don't want to care about the behavior of my methods and therefore I am not going to do strict mocking where I verify that certain methods have been called. The interesting wrinkle here is that I really want to use a mocking framework for the ease with which I can create a stub or dummy object. This isn't well supported in all of the frameworks, but I have heard that Moq is going to be what I want to look at.

Fowler's article linked to Dan North's BDD introduction. I hadn't understood BDD before, and I can't claim that I really do at this point, but there is some interesting content in this introduction. The first few paragraphs of this description really seems to address a number of problems that I have had with TDD and unit testing in general. Here are the questions he poses:


  • Where to start?

  • What to test and what not to test?

  • How much to test in one go?

  • What to call their tests?

  • And how to understand why a test fails?

I had yet to come up with satisfactory answers to these question. But North has a simple answer for all of them: write your test names like sentences. If my test class is named FooLookupTests and my test method is named FindFooByIdTest(), I can write "Foo lookup - find foo by id." When the test classes and methods create this structure, then I am working in the right direction. When they do not create this structure, then I need to review what I am testing and refactor my tests and possibly the code under test to follow this guideline.

After this simple suggestion, North goes on to point out how he developed the BDD method from this insight. On my first evaluation of this description, I do not like it. While I like North's initial insight and I think his answer to the questions above is very insightful and useful, I can't see myself adopting a full BDD process.

Update: my coworker John mentioned that the main point of North's introduction is more that the test methods need to be named in a testShould...() format. Certainly the BDD people would argue that you are doing it wrong if your test methods aren't of this form. For my purposes, I don't think this is strictly necessary, but is a useful point to keep in mind.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied
Tue, 28 Jul 2009 15:01:00 -0700 Subversion Rename using Powershell http://jeffesp.com/subversion-rename-using-powershell-0 http://jeffesp.com/subversion-rename-using-powershell-0 I am working on an ASP.NET project that is hosted in subversion. I mainly use the command line client to work with things, but occasionally that doesn't easily get me where I need to be. I wanted to rename a page with it's codebehind, so I did the following:
get-childitem MyPage.aspx* | %{ svn rename $_ $($_.ToString() -replace 'MyPage', 'new-page') }
This isn't anything new for powershell veterans, but it is the first time I found the immensely useful 'replace' string operation.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied
Tue, 12 May 2009 11:26:00 -0700 Untitled http://jeffesp.com/20885141 http://jeffesp.com/20885141

Although prepared for martyrdom, I preferred that it be postponed.

Sir Winston Churchill

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied
Wed, 29 Apr 2009 07:54:33 -0700 Music: Damien Jurado http://jeffesp.com/music-damien-jurado http://jeffesp.com/music-damien-jurado http://www.damienjurado.com/

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied
Wed, 29 Apr 2009 07:54:33 -0700 Music: Eilen Jewell http://jeffesp.com/music-eilen-jewell http://jeffesp.com/music-eilen-jewell http://www.eilenjewell.com/

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied
Mon, 27 Apr 2009 07:51:51 -0700 Stefano's Linotype " Why Programmers Suck at CSS Design http://jeffesp.com/stefanos-linotype-why-programmers-suck-at-css-0 http://jeffesp.com/stefanos-linotype-why-programmers-suck-at-css-0 http://www.betaversion.org/~stefano/linotype/news/169/

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied
Mon, 27 Apr 2009 07:51:51 -0700 8 Simple Ways to Improve Typography In Your Designs • Blog Archive • AisleOne http://jeffesp.com/8-simple-ways-to-improve-typography-in-your-d-8 http://jeffesp.com/8-simple-ways-to-improve-typography-in-your-d-8 http://www.aisleone.net/2009/design/8-ways-to-improve-your-typography/

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied
Fri, 24 Apr 2009 13:49:32 -0700 Delta Spirit http://jeffesp.com/delta-spirit-4 http://jeffesp.com/delta-spirit-4 http://www.deltaspirit.net/

Excellent Music. Saw them in February. It was fun.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied
Fri, 24 Apr 2009 11:47:00 -0700 Untitled http://jeffesp.com/20885154 http://jeffesp.com/20885154

Nothing changes: 

If success is rare and slow, everybody knows how quick and easy ruin is.

William Makepeace Thackeray. Vanity Fair. 1848

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied
Fri, 24 Apr 2009 05:38:03 -0700 The Economist http://jeffesp.com/the-economist-152 http://jeffesp.com/the-economist-152 http://www.theonion.com/content/node/34138

It’s funny because it’s true.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied
Wed, 15 Apr 2009 05:20:18 -0700 Untitled http://jeffesp.com/20885170 http://jeffesp.com/20885170
Humankind cannot stand very much reality.

T. S. Eliot

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied
Fri, 10 Apr 2009 13:02:40 -0700 Untitled http://jeffesp.com/20885173 http://jeffesp.com/20885173
Laughter and tears are both responses to frustration and exhaustion. I myself prefer to laugh, since there is less cleaning up to do afterward.

Kurt Vonnegut

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied
Tue, 07 Apr 2009 21:01:00 -0700 Zebra (alternating color) Tables in ASP.NET http://jeffesp.com/zebra-alternating-color-tables-in-aspnet-0 http://jeffesp.com/zebra-alternating-color-tables-in-aspnet-0 This is just a small note to say that I love doing this:
<tr class='<%# ((IDataItemContainer)Container).DisplayIndex % 2 == 0 ? "CommonListRow" : "CommonListRowAlt"  %>'>

When using any type of ASP.Net repeating control (such as asp:Repeater). It is much more maintainable than copying and pasting code between the <ItemTemplate> and <AlternatingItemTemplate>.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied
Thu, 30 Oct 2008 14:35:00 -0700 Windows Server 2008 Domain Controller Backup http://jeffesp.com/windows-server-2008-domain-controller-backup http://jeffesp.com/windows-server-2008-domain-controller-backup All the information you need can be pulled from TechNet, but I have condensed it here.

You need to run the following command to get the system state backup, which is what you can use to restore a DC it fails and you need to restore to a different machine, or to a new install on the same machine.

wbadmin start systemstatebackup -backupTarget:<driveletter>:

Be sure to run it in cmd and not in powershell because powershell does not like the -backupTarget: part of the command. If you normally work in PSH, then a cmd /c "wbadmin ..." will allow you to run this command.

A few other notes that are valuable:

When you are saving system state you must backup to a drive, it can't be a network share.

And can't be one of the source drives of the backup, but you can get around that. To get around the drive limitation create a DWORD in the registry at:

HKLM\SYSTEM\CurrentControlSet\Services\wbengine\SystemStateBackup\AllowSSBToAnyVolume

and set the value to 1. This allows you to backup to a source drive of the backup. The TechNet article says there can be issues with this, but allows you to do it anyway and from what I can tell does not have issues. This is a bit frightening, but seems to be the best we can do with the tools provided.

If you have the space, you can also backup the entire machine with a job defined through the GUI (or wbadmin). This will allow you to restore to the machine the backup was pulled from. It is good idea to have both this kind of backup and the system state backup.

Microsoft would ultimately like to sell you their System Center Data Protection Manager (DPM) product and that is why there are not as many options for wbadmin as there were for ntbackup. We don't need (or have the hardware to support) DPM here, so we are currently making do with some wbadmin and some scripts cobbled together.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied
Tue, 14 Oct 2008 14:41:00 -0700 Good Software http://jeffesp.com/good-software http://jeffesp.com/good-software One of the guys on a private mailing list asked about what software people couldn't live without. Here's my list.

  1. Notepad2 - I rename it to n2 and put it in my PATH. Then it is just a WindowsKey + R, n2 away.

  2. Firebug - Couldn't style a webpage without it.

  3. DiffMerge - Comparing versions of code is pretty and easy.

  4. Pidgin - Allows me to be on MSN and Google Talk.

  5. GridMove - I have a 1920x1200 screen which is too much real estate to only use one window at a time, but Windows doesn't have a good way to manage my application windows.

  6. Depending on what I am working on, either VS 2008, or Vim + ctags.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied
Sat, 04 Oct 2008 01:33:00 -0700 Powershell Tricks http://jeffesp.com/powershell-tricks http://jeffesp.com/powershell-tricks Here are two things that I haven't found written about other places, but that are hinted at in the help for New-Object.

Open an explorer window in the current directory:

> $shell = New-Object -comObject shell.application> $shell.Explore("$(resolve-path .)")

You can present a folder selection dialog to a user:

> $shell.BrowseForFolder(0, "Title", 0, "c:\") | get-member   TypeName: System.__ComObject#{a7ae5f64-c4d7-4d7f-9307-4d24ee54b841}Name                       MemberType Definition----                       ---------- ----------CopyHere                   Method     void CopyHere (Variant, Variant)DismissedWebViewBarricade  Method     void DismissedWebViewBarricade ()GetDetailsOf               Method     string GetDetailsOf (Variant, int)Items                      Method     FolderItems Items ()MoveHere                   Method     void MoveHere (Variant, Variant)NewFolder                  Method     void NewFolder (string, Variant)ParseName                  Method     FolderItem ParseName (string)Synchronize                Method     void Synchronize ()Application                Property   IDispatch Application () {get}HaveToShowWebViewBarricade Property   bool HaveToShowWebViewBarricade () {get}OfflineStatus              Property   int OfflineStatus () {get}Parent                     Property   IDispatch Parent () {get}ParentFolder               Property   Folder ParentFolder () {get}Self                       Property   FolderItem Self () {get}ShowWebViewBarricade       Property   bool ShowWebViewBarricade () {get} {set}Title                      Property   string Title () {get}

Use above to select something:
> $shell.BrowseForFolder(0, "Title", 0, "c:\").Self.Path


MSDN gives the information you need for the third argument. It is a 'flags' field that can be any combo of ulFlags on that page.

See $shell | Get-Member for more.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/608554/rodion.jpg http://posterous.com/users/5Al1JBnm830l Jeff Espenschied jeffesp Jeff Espenschied