Friday, July 15, 2011

Setting up correct Git config parameters on Windows

So when configuring Git to run on Windows, I ran into an annoying thing that took me a bit to figure out.

When you configure Git via bash, specifying the config setting with git config --global yadayadayada was not properly linking to the editors, diff tools, etc. The reason was that the config file could not determine the location of the apps because quotes were either missing, or added to the config file without escape characters.

Here is the .gitconfig file:
[user]
 name = mkadlec
 email = kadlecmark@hotmail.com
[core]
 editor = \"C:/Program Files (x86)/Git/bin/git-core-editor.sh\"
 autocrlf = false
[merge]
 tool = kdiff3
[diff]
 tool = kdiff3
 guitool = kdiff3
[mergetool "kdiff3"]
 keepBackup = false
 trustExitCode = false
 path = \"c:/Program Files (x86)/KDiff3/kdiff3.exe\"
[difftool "kdiff3"]
 path = \"c:/Program Files (x86)/KDiff3/kdiff3.exe\"
 keepBackup = false
 trustExitCode = false
 cmd = \"c:/Program Files (x86)/KDiff3/kdiff3.exe\" \"$LOCAL\" \"$REMOTE\"
See? Look closely, you have to escape all the quotations, and wrap any file locations with quotes if they are not. Once configured, all is good!

Monday, May 2, 2011

Modify TFS for Agile development

TFS is a great tool for Agile development, especially if you are already using it to develop your code!  There are some very good templates out there already.  Scrum for Team System is my favourite, and Microsoft now has their own: Scrum 1.0.  You can modify any of these templates to add fields, change statuses, and modify the flow.

If you are running Visual Studio 2010, here's the quick and dirty on how to modify the templates:
1.  Open Visual Studio Command Console, then go to
     C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE>

2.  Run Command to Export the xml
  witadmin exportwitd /collection:http://tfs_server_name:8080/tfs/collection_name /p:"project_name" /f:"output_xml_file" /n:"Task"​

  This will generate output.xml in the same location.  


  Eg: >witadmin exportwitd /collection:http://vprdtfs2010:8080/tfs/quorumdevprojects /p:"er57q1" /f:"output.xml" /n:"Task"​
  If you want to export the User Story template, simply use "UserStory" instead of "Task".



3. Change the file as necessary.  Remember, the output is simply an XML representation of the template and it is pretty intuitive when you open it up and start digging.  Add states, fields, transitions, etc.



4.  Run Command to Import the xml

  witadmin importwitd /collection:http://tfs_server_name:8080/tfs/collection_name /p:"project_name" /f:"input_xml_file"​


Eg: >witadmin importwitd /collection:http://vprdtfs2010:8080/tfs/quorumdevprojects /p:"er57q1" /f:"output.xml"​

Qwinsta, better than a rap name

If I were to have a 3rd kid I think I would be inclined to name him Qwinsta...

One of the most underrated, secret, powerful commands out there, if you want to see who is logged on to a Server, simply type:

           qwinsta /server:[your server name here]

At the command prompt and voila, all users are listed. Pair that with a Powershell script and you are like Capt. Kirk sitting in his command chair.


I use it a lot to see who is logged in to a Server in case the max connections are exceeded.

Thursday, March 31, 2011

Qdoba versus Chipotle

Ever wonder which restaurant serves the better burrito, Qdoba or Chipotle?

I wondered the same thing for years, when a co-worker of mine though we should apply scientific theory to this important question.  So we did...

The Test: Order the same burrito from each restaurant (with medium sauce, black beans).  One person cuts the burritos in half, sticks a toothpick in the one they know the brand, then the other person will choose to either switch the toothpicks or not (while the other person is not looking).  This ensures that neither person know which is which until it is revealed at the end.

One person remarked prior to the test that Chipotle is better in some meats than others, so we decided to do the test for all meats.

Here are the results:

CHICKEN WINNER: Chipotle 2 - 0
MarkChipotle
JamieChipotle

PORK WINNER: Qdoba 3 - 1
MarkQdoba
JamieChipotle
PadamQdoba
RianQdoba

STEAK WINNER: Chipotle 2 - 0
MarkChipotle
JamieChipotle

SHREDDED BEEF WINNER: Chipotle 2 - 0
MarkChipotle
JamieChipotle

It's over, Chipotle with the overall victory 3-1! It's worth a trip to Qdoba though if you are in the mood for pork (or craving their Queso sauce), otherwise, Chipotle is the place to go.   Also to note, the burritos were priced within 5% of each other, so cost was not a factor in this comparison.

Wednesday, October 27, 2010

Early morning running - Lessons learned

Today I decided to get a jump start to the day and get a run in before work. Since the Seattle marathon is a month away, I wanted to do a 10 mile run today.  So I set my alarm clock for 06:15, got woken up at 05:30 by my 4 year old son, by 6am I was ready to go.

Lessons learned:

1.  Eating a banana and a pack of gummy bears before the run I thought I would be safe to run right away, but even with a banana I think it's better to wait 1/2 hour.

2.  I played soccer 2 days before and had a knock on my quad, no big deal at all.  But after 5 miles every little injury is a big deal.

3.  There are a lot of old people going for walks at 6am.  Normally I get motivated seeing other runners or people being active.  Instead I felt myself saying "Ahh, that's a good life I could get used to...".  Not exactly motivating me to run faster.

4.  In the dark you need to be more careful.  I stepped into two little potholes before learning this one.  Another thing to be very aware of is that your watch is hard to read.  My pace was all over the place, it made me realize how much I rely on my watch to monitor pace.

5.  On the contrary, the sunrise in Seattle can be pretty awesome.  Kept my attention for the second half of the run.

Friday, August 27, 2010

Capturing window "close" action

I was presented with the task of capturing the event in which one of our users would hit the close browser button (you know, that little 'x' on the top right).  The business wanted me to give a warning to the user that his information was still not saved yet.

  I remembered a solution I did a couple of years ago where I simply added a before unload event to my body and some simple Javascript:

     
This works great... in IE, not in Firefox or Chrome though.  The problem is that IE tracks the clientY mouse position and the other browsers don't, so a different solution was needed.  I got some snippets off of the web for tracking mouse position and came up with this cross-browser solution and it works great. First, add the following Javascript to your page:
    


    

Next, add the following form to your page, this simply stores the mouse coordinates, you could use the var values, but I liked having these to debug and see what's happening.
   

That's it! Now you can warn users using any browser that they still have unsaved work. You will still need to monitor whether the page is dirty, etc, but this allows you to at least capture the event.

Monday, August 9, 2010

Backup sensitive file information using Amazon's S3 cloud

Everyone please answer the following questions honestly:

1. Do you store all your digital pictures on your home computer's hard drive, and do you have backups if the hard drive got corrupted?

Would your data be safe? Do you have duplicate media?

2. What if your entire house burned down? (hopefully this will never be the case!)

I have backups, and the HD backup sits about 2 feet from my computer, so I realized that if my house burned down, I could not retrieve my photos.

There are a few options, what I like to call "The Ghetto" backup, which would entail me giving my backup HD to a friend, but guess what? Then I lose access to that and it can easily be outdated.

There are some very good backup services, but they run $50 year, still good to have though.

I opted for Amazon's S3 cloud services, here is their pricing, considering I've got about 10 Gig of pictures, I'm only out about $20/year.

It's honestly pretty rudimentary, they don't really have a great interface, you are left using REST/SOAP calls for advanced handling. That is until I discovered the S3Fox Firefox plugin which makes things a breeze!

Now I have my pictures backed up, and another cool feature is that if I am away from my computer, I still have full access to all my original photos. See the screenshot below, real easy...