I'm a Mac user

I have officially switched my personal computer to a Mac (MacBook Pro to be specific). I’m sure some of you might be wondering, why did I switch to a Mac? Most of my blog is on .NET and Powershell related topics, which aren’t so prevalent on a Mac. Well, here are a few of the main reasons. Promoters - Mac owners are promoters. When I asked the Twitterverse what I should do, all but one response was “Get a Mac!”. »

Brian Hartsock on #Mac,

Transitioning from svn to git

Great post on git commands and their subversion equivalent. Very concise compared to most articles. (Sorry for all the links, but I have been catching up on Google Reader and finding some real gems) »

Brian Hartsock on #git, #svn,

A better Start-Job cmdlet

With Powershell 2, the Start-Job command was added, which allows statements to be executed in the background. There are a few oddities regarding script blocks that need to be understood first though. Powershell doesn’t support closures The current working directory isn’t preserved I confronted these issues first hand today while working with a Rails app. I wanted to execute ruby script\server in a job, but it wasn’t working. PS C:\Users\Brian\workspace\myapp> start-job { ruby script\server } Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- 3 Job3 Running True localhost ruby script\server PS C:\Users\Brian\workspace\myapp> receive-job 3 C:\Ruby19\bin\ruby.exe: No such file or directory -- script/server (LoadError) + CategoryInfo : NotSpecified: (C:\Ruby19\bin\r...ver (LoadError):String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError For some reason, when executing the job, it is executing in a different working directory. »

Why the hell can't I delete that folder?

The other day I heard a coworker cussing about the fact he couldn’t delete a folder. To give him credit, he dual boots Linux and Windows, and has just recently realized Windows is much better. But, Windows doesn’t have sudo rm -f (ignoring chattr +i which I didn’t know about until today). The problem is easy to solve though. Download process explorer Start it up and go to Find -> Find Handle or DLL… Search for the path of the folder, and you see the process/executable holding onto the file. »

Brian Hartsock on #Windows,

Get file extension information with Powershell

I wanted to get a list of different file extensions in a project I was looking at so I knew the makeup of the code and technology. Pretty cool little command. gci -recurse | select -expand extension | group | sort count -Descending Which returned the following. Count Name Group ----- ---- ----- 667 .asp {.asp, .asp, .asp, .asp...} 530 .gif {.gif, .gif, .gif, .gif...} 345 {, , , ...} »

MSBuild performance tips

A while back, I posted about a Powershell script I wrote to help analyze build performance. Today I spent a good amount of time looking at the output and tweaking things. I came across a couple BIG performance enhancements that I thought I would share. Tip #1 - Don’t start external processes Starting another process is a time consuming activity, and if you are doing it on a post/pre build event, that is going to slow your build down tremendously. »

Brian Hartsock on #MSBuild,

The truth about college

Did You Know? from Amybeth on Vimeo. After watching this video, I was reminded of something that I continually realize in the technology industry (and probably nearly ever industry). You learn very little in college compared to how much you learn on the job. The important thing about college is providing a foundation to get your foot in the door, and teaching you how to learn. Never stop learning, or you will get left behind. »

Unintended consequences - Transactions

What’s wrong with the following code? using (var transaction = session.BeginTransaction()) { session.Save(something); transaction .Commit(); } Nothing if you are using MySQL connector 6.0, which has the following Dispose method on its MySqlTransaction class. protected override void Dispose(bool disposing) { if ((((this.conn != null) && (this.conn.State == ConnectionState.Open)) || this.conn.SoftClosed) && this.open) { this.Rollback(); } base.Dispose(disposing); } But if you are using 5.0.9, check out this code (which is actually from the underlying DbTransaction object). »

Can you beat my remote work setup?

I travel every now and again with work. When I do, I tend to take a fairly large bookbag with way too much electronic equipment. Check out my setup last time I was in the Jungle Disk Atlanta office. »