Solution to slow Git bash when logged in as a domain user

by Theo19. March 2010 12:44

Today i found that my newly installed git on my laptop at work was working pretty slow. 0.5 ~ 1sec delay on loading the git bash, and on every command. I logged in as a local user on the computer and the delay was gone.

Searching the internet a bit, i found that git uses the default home, on my account set to be a network account. This ment that git would look in this directory all the time, causing the delay.

To fix this i created a local user environment variable, overriding the default one, and setting it to %USERPROFILE% which points at c:\users\[username].


This makes git look the right place for the git.config.

Next is that when you click the git bash shortcut, i opened on my default homedrive, which was a network connection.  Looking at the properties for the shortcut it looks like this:

Git Start In

Changing the "Start in" to c:\user\[user], or any other place made the shortcut open much faster for me.

Now my git bash is back and fast again :)

Calling ASP.NET AJAX web-services from JQuery

by Theo11. October 2009 20:51

I recently looked into calling ASP.NET Ajax web-services from JQuery, and it’s actually not that hard.

The ASP.NET Ajax web-service

To create a client script enabled web-service, add the [ScriptService] to the web service class. This makes sure that the methods can be called from client script and also makes the returntype a JSON.

[WebService(Namespace = "")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class AjaxWebservice : System.Web.Services.WebService
public string HelloWorld()
return "Hello World - " + DateTime.Now.ToShortTimeString();
public object HelloObject(int id)
return new { Id = id, Success = true, Text="<b>It went well!</b>" };

Note that the returned object in the last webservice method, is converted to a JSON object, which we will see shortly can be used very easily in the client.

The client-side JQuery ajax call

Now we have the ajax web service done, in .net manner, we would like to use JQuery’s easy and simple interface to consume it.

The default way to create an asynchronous client side call using JQuery is via an $.ajax() call
( see for more details on this)

The client-side script able to consume the HelloObject webmethod, looks like this:

type: "POST",
contentType: "application/json; charset=utf-8",
data: "{}",
dataFilter: function(data) {
var msg;
if (typeof (JSON) !== 'undefined' &&
typeof (JSON.parse) === 'function')
msg = JSON.parse(data);
msg = eval('(' + data + ')');
if (msg.hasOwnProperty('d'))
return msg.d;
return msg;
url: "AjaxWebservice.asmx/HelloObject",
data: "{id:3}",
success: function(msg) {
if (msg.Success) {
alert("yes: " + msg.Text + "(" + msg.Id + ")");
else {
alert("nop: " + msg.Text + "(" + msg.Id + ")");

The first $.ajaxSetup() part, sets the default values for all subsequent ajax calls, and the last $.ajax() call makes the asynchronous request to the server. The dataFilter function is supposed to even out some of the variations, different version of net handle JSON, but i haven’t gone that much in detail with it. ( go here to read more about it :

This example calls the the webserver with an id having the value two, which then responds with a JSON object. When the client side successfully completes the request, it creates an alertbox from the data in the returned JSON object.


Git - Fast distributed code versioning

by Theo24. September 2009 23:16

In case you haven’t noticed, there's a new code versioning system around, that's gaining popularity fast.

Meet Git.. :)
(click to open git’s homepage)

Now i am just starting to lean git, but as far as I've understood, here's are some of the main points:

  • Distributed model, as opposed to the normal centralized model from CVS and Subversion – this means that you don’t see your versioning as working from one place all the time. You have your own repository that you commit to, and then you pull or push your changes to or from others from that.
  • Your repository contains the whole history of git (the whole thing) locally  – that both means that diff’s and history lookups are dead fast – and also that you have images of everything lying on every person on the projects computer.
  • Git tracks content not files – this means that there's better code-tracking even across files, and also makes it easier for it to merge content.
  • Open source and made by Linus Thorvalds and his team – is currently used for versioning the Linux kernel.
  • Most open source projects around are currently converting from subversion to it, because the distributed model suits open source project much better – also there's free hosting for open source projects on Github.

On Git’s homepage you can find information, tutorials, and also a nice video of Linus expressing his view on code versioning.

Now git is developed on linux, but there's a port for Windows called msysGit and extensions which add a nicer gui and visual studio support on sourceforge (GitExtensions)

Now it seems that git is stronger and faster than Subversion which we normally use on our projects (or Team Foundation), but there's a slight learning hump to start with, as most people are used to a centralized versioning model, as CVS, SVN and Team Foundation (although you can of cause use a central repository with git also). Once people get more acquainted with git I'm sure it will gain even more popularity.

That's all for now on Git - once I've played around with it some more I'll write another post about my experiences.

JQuery - Smarter client scripting

by Theo28. August 2009 22:10

Web developers should already be familiar with JQuery. It's an opensouce JavaScript library that makes writing simpler and more effective JavaScript possible. And it's made to abstract away differences between browsers.

Actually it requires nothing more than a JavaScript library that you download and reference.

Normally i would show some JQuery code here, but as i'm myself just starting learning and using JQuery, I will just tell you that there's a good tutorial and info about JQuery on its site:

Yet another development blog online.

by Theo24. July 2009 22:49

This is the beginning of yet another development blog, mostly oriented on .NET development.

I’m an software engineer, just in the beginning of my career and as I'm learning and expanding my knowledge and skills, I've decided to create a blog, thinking that it will make me improve my own skills sharing the knowledge. 

How?.. well:

  • Blogging interesting or tricky subjects forces me to work the subject to present it in an understandable manner – which will give me a better understanding of the topic
  • This is the place i can go to for all my future “How the #¤#” did i do that” -experiences
  • Eventually someone will click the wrong link somewhere, or write the wrong url in the browser, and end on my blog - and perhaps that someone will comment a post, and make me learn something i got wrong, or something that could have been done different. It’s all about sharing and learning
  • And finally… I use blogs all the time when ever I’m sorting out some problem or learning about a new development topic, it’s time to give something back, and perhaps somebody somewhere will benefit of it.

So I'll try to keep putting tricks, thoughts or anything I find interesting and useful on this blog. Maybe I'll even find a name for it one day.

BlogEngine.NET is by the way is a great, easy to set up, ASP.NET based blogging platform.
(and its made by a dane ;) )

Theo Andersen

Hi, you've reached my blog on software development.

I use this blog mostly for my own purpose of remembering stuff, so i only put things here once in a while when i get the time.

My current focus is on TDD, unit testing, object oriented code and IOS development.