Tigraine

Daniel Hoelbling talks about programming

RSS Feed

Archives for Tools

Git cheatsheet floating on your desktop as Windows 7 gadget

0 Comments

While browsing a bit through the GitHub guides section I noticed a wonderful git cheat sheet that outlines the most used commands with some basic usage instructions created by Zack Rusin.

I have a love/hate relationship with cheat sheets because most of the time I print them and then they usually merge with all the trash that’s laying around my desk so I hardly ever get to use them (except for when I really need them and they are laying face down below my mouse pad).

So the obvious place for that sheet would be my secondary monitor so I can refer to it when needed. Only problem here is that I really don’t want to run a browser window all the time just to see a cheat sheet, and setting it as my wallpaper would mean no more beautiful images changing every 10 minutes (I love Win7 for this!).

Now, what is between your applications and your desktop? Right: Windows gadgets.

By following the guide from the Microsoft developer center I very quickly ended up with a quite nice gadget that now beautifully floats above my desktop with all the common used git commands I need to check while scratching my head (dementia I hate you).

image

Pair this with the awesome Aero Peek at the desktop from Windows 7 (if you hit Win+Space all Windows become glass and you see your gadgets + desktop), and you can quickly glance at the cheat sheet without having to run any application or change your wallpaper. And if I don’t feel like doing git I just close the gadget with one click.

As said above, the cheat sheet is done by Zack Rusin. Thanks for this gem! The code for the gadget and the download is on GitHub and is licensed under the ASL-2 (yeah I like that license a lot).

The GitHub repository is at: http://github.com/Tigraine/git-cheatsheet-gadget

And to just download the gadget hit the downloads section within GitHub (or directly)

Oh and please excuse if GitHub is down sometimes right now. They are in the process of moving their servers to a new hoster and hopefully they will be reliably back up by Monday.

Filed under Coding, Tools
Sep 25, 2009

My new toy: Wacom Bamboo

0 Comments

After almost two weeks of waiting for it I finally picked up my Wacom Bamboo today.

So, here comes the obvious for a programmer:

image

So, I got myself a pen tablet. Why would I do something like that?

First: Rest assured, I didn’t jump on the designer bandwagon, I still suck at drawing and that Hello World up there took me 3 tries and still looks bad.

It just happened that I loved Jon Skeet’s presentation slides he had for the OS Jam at Google London on C# 4 and DLR. The idea is just brilliant. Almost no real content on the slides, just some pointers in a very “human” style.

While I was preparing for this years summer-camp at the University (I’m instructing some kids on XNA game programming again) I used a CintiQ 21UX we have sitting at the company to try this with some pretty cool results:

image

image

Obviously, a bunch of 16 year olds isn’t the perfect gauge for presentation slides, but almost everyone who saw that slide deck loved it. It’s so totally different and less formal and tense that it was totally worth the work. I just didn’t want to make a habit out of using other people’s PCs at work so I obviously needed something similar, yet much cheaper. And that’s where the Bamboo A6 really came in handy: 70€ at my local DiTech store was quite a bargain. (Although it took them 2 weeks to order and deliver that thing!)

On the Bamboo side of things, it just works. You plug it in and it works. After installing the driver I had around 30 minutes of trouble finding the settings dialog to make the tablet not target my whole screen (A6 pointing at a 24” screen is just awful), but once I reduced that it became a joy to work with. Recognition is very sharp and very precise, the different pressure levels are nice in Photoshop.

I’m also amazed about how well the Windows Vista handwriting recognition has become. Obviously as a programmer I’m still a thousand times faster when using the keyboard, but it’s nice see it working.

Another application besides presentations is obviously my blog. I hate UML modeling software with all my heart. So much that my drafts folder has accumulated 3 different rants about how clumsy and slow it is to throw together a UML with the current tools. I usually end up writing code to generate a class diagram instead of trying to model a class without coding it.
With the power of a tablet I can just throw together a raw sketch out the UML to illustrate my point without having to jump through all the hoops current modeling software puts you through. So in the future, expect some of these:

image 

Btw: Thanks for all the feedback on the iC-Website design (if you didn’t already vote, please tell us what you think)!

Filed under Coding, Personal, Tools
Jul 9, 2009

.NET Unit testing tools

2 Comments

After posting my tools list today I got asked why I didn’t list any testing frameworks. Obviously, I love testing, so why no testing tools like Gallio, NUnit or Testdriven.NET etc?
The answer is rather simple, Resharper runs my tests for me.

By default Resharper can run NUnit tests, if you install Mbunit it can run those too, and if you just copy over the resharper support library from the XUnit contrib project to your Resharper/Plugins directory it can also run XUnit.

image

Also, almost all open source frameworks out there include their test runner in their code tree, so you don’t need to worry about what exotic test frameworks are out there, you’ll be provided with the appropriate runners.

On the testing framework side I recently (~4 months) switched over to xUnit as it’s syntax felt much better than that of xUnit or Mbunit.
Also I am currently looking into maybe using a BDD testing framework like MSpec.

Filed under .NET, Testing, Tools
May 31, 2009

Essential tools for .NET Developers

0 Comments

I always thought that I am up and running the moment Visual Studio is installed on a machine.
Unfortunately, life isn’t that easy any more and I thought it might be interesting to share what I consider essential from my toolbox.

IDEs

  1. Visual Studio 2008
  2. Resharper 4.5
  3. Notepad++

Although some people say they can work with other IDEs in .NET, I consider Visual Studio a absolute necessity. Not so much for the Studio itself but as a shell for Resharper, the very best tool I have yet come across. It’s so damn convenient and increases productivity by such a margin that I simply can’t use Visual Studio without it any more. Although Resharper isn’t free, I strongly suggest you try it out for 30 days. I feel it’s a good investment.

And Notepad++ is one of many great simple editors that make editing and reviewing of files easy.

Source Control

If you plan on working with open source tools, be prepared to bring their tools to the party. Nothing is worse than needing some source and not being able to access the SCM.
I usually install the following:

  1. TortoiseSVN – Subversion right from the Explorer right click menu. Very good and very mature SVN client.
  2. SlikSVN – Unfortunately TortosieSVN doesn’t install SVN binaries, so if you want to be able to run SVN from the command line you better get the conveniently packed SlikSVN subversion binaries.
  3. TortoiseHG – Same idea as with TortoiseSVN but for Mercurial, but it installs the hg binaries so you can use hg from the command line.
  4. msysGit – A GUI for git together with a custom git command line that emulates a *nix shell for git operations. Not so convenient as HG, but Fluent Nhibernate and most tools by Jon Skeet use git.
Build tools

Getting the source is usually not enough, sometimes you need to be able to build it too.
While most projects can be built by simply starting up Visual Studio and building, others require you to run a build script like NAnt.

  1. NAnt – NAnt is a free .NET build tool. In theory it is kind of like make without make’s wrinkles. In practice it’s a lot like Ant.

Download the latest NAnt release and unpack the zip to some convenient folder. Then create a file called nant.bat in your C:\windows folder with the following content:

@echo off
"C:\Program Files\NAnt\bin\NAnt.exe" %*

(Obviously you should change the path to your NAnt executable).

Now whenever you encounter a project with a *.build file you can simply start a command line window and type nant to start building the source (that’s how you build the the Castle Project and NHibernate).

  1. Rake – I don’t use rake, but I sure know Fluent NHibernate does. Rake is the build tool used for Ruby projects, but it’s gaining popularity. On windows installing it was rather simple, just get the Ruby One-Click Installer from their downloads page and install it with gems (gems is used for installing extensions and libaries).

If none of the above apply, usually every project has a howtobuild.txt that instructs you on how to run the build.

Database

Hugely depends on what tools you use. But it never hurts to have the following:

  1. Sql Server 2008 Management Studio Express – It’s free, and allows you to run queries and create databases. Nothing fancy as reporting or real server administration, but what developer really wants to do a DBAs job?
  2. NHProf – If you are using NHibernate for your data access needs (and I believe you should), you will find this tool well worth it’s money. It’s by no means cheap, but it will watch all your database queries, analyze them and point out possible performance bottlenecks for you.
Others
  1. Sourcegear DiffMerge – A very good and free diff tool in case the ones in TortoiseSVN don’t cut it.
  2. .NET Reflector – Sometimes you don’t have access to the source code, or you don’t want to get the source just to look at one file.

    .NET Reflector allows you to look at all the types inside an assembly, and if it’s not obfuscated it allows you to decompile it into your language of choice and look at the code (you could decompile VB programs into C# for example).

  3. Please note that there are myriads of other tools lists out there, and if your are a web developer you’ll need some more tools for debugging HTML/JS. The above are the ones I consider essential to do .NET desktop/backend development when using open source libraries as Castle or NHibernate.

Filed under .NET, Coding, Tools
May 31, 2009

Castle Windsor XML Configuration Schema

0 Comments

While creating a Windsor XML configuration for a new project today I found myself looking too much at the reference to get started. I figured this may be because of the lack of a schema that would provide me Intellisense in Visual Studio. Shockingly I couldn’t find a xsd schema file for the Windsor configuration.

I then looked at some w3schools tutorials and figured out how to do a xsd schema myself and tried to remodel the Windsor configuration reference.

You can grab the xsd schema file here: windsor-configuration.xsd

I’ll post a little tutorial on how to load it inside Visual Studio later.

Filed under .NET, Tools
Jan 27, 2009

Microsoft Natural Keyboard 4000 Review

0 Comments

I’m a keyboard addict. I love keyboards and they love me.
I never managed to break one in any way because I have never used one long enough to break it. I consider my keyboard the most important tool as a programmer, and that’s why I constantly try to get the best available.

I guess that is over, I haven’t bought a new keyboard for over a year now.

My last 3 keyboard buys have all been the Microsoft Natural Ergonomic Keyboard 4000 so I have one for every workplace I happen to be at. My 2 computers at home have one, my desk at work has one, it’s just that great!

mk_otherviews_nek4k_01

I got introduced to Ergonomic keyboards through the Logitech Ergonomic Desktop Freedom Pro (or at least I think it was called that way) and used it long enough to really learn how to properly type. It was good compared to what I was using before (10 pound IBM bricks) and it was the first keyboard I actually bought myself (for the ridiculous amount of 280€ as a 16 year old). Unfortunately Logitech discontinued the ergo series and Microsoft’s old Natural keyboard was discontinued too so I switched back to normal keyboards for quite some time (trying out all sorts of fancy keyboards like the Fingerprint Keyboard etc) before I found the Microsoft Natural 4000.

At that point I haven’t used a ergonomic keyboard for some years so I was hesitant, but I got lured by the price. 40€ is nothing after having spent 100€ on the Logitech G15 (worst keyboard ever) and I was blown away by what I got!

Typing is so convenient on this keyboard, and my wrists feel a lot better after extended periods of work than they did before on the (ergonomic nightmare) G15 (we’re talking about magnitudes of >300% here).
The leather I rest my wrists on feels very comfortable and soft even after a year of extensive use.

The keyboard also comes with some sort of tilt-attachment that creates a reverse slope. It’s unusable if you want to play games, but for typing it is very comfortable to not have to bend your wrist to access keys.

Also notable is that the keyboard comes with a standard pgup/pgdown layout instead what makes working pretty easy once again (who designed the DELL keyboards should be crucified for the Pos1/End placement!).

Some shortcomings:

  • No Next/Previous Media functionality. Only Play/Pause and Volume control buttons.
  • No lock workstation button, I had to remap my Calculator key
  • Zoom wheel in the middle of the keyboard is pretty much useless.

Still, the best keyboard you can get.

Filed under Personal, Tools
Dec 4, 2008

Conditional breakpoints in Visual Studio

0 Comments

Sometimes you do something and you never really think about what you’re doing.
Like the following code:

public bool TestSomething(bool input)
{
    if (input == true)
    {
        return true;
    }
    else
    {
        return false;
    }
}

It’s so obvious, I never thought about what I was really doing there, let alone seen the mistake I made. I mean, without any knowledge about boolean evaluation you still should figure out how to get rid of the bracket porn and produce something like this:

public bool TestSomething(bool input)
{
    if (input == true)
        return true;
    return false;
}

But that’s only syntactic, the whole statement itself is still silly. The whole == true is completely redundant because you already check a boolean condition to evaluate it to a boolean.

So it boils down to:

public bool TestSomething(bool input)
{
    return input;
}

And that’s it. You just saved yourself 6 lines of code that where completely useless (and I guess the compiler is smart enough to optimize that anyway  Update: actually, this does make a difference. The compiler can’t figure this out and will produce more IL code because of this).

But once I did this I felt I lack the ability to put a breakpoint on the return false statement. And I eventually may have thought about going back to solution #2. But then I found this little thing in Visual Studio that made my day (and all major IDEs have that, only they hide it well):

image

When you right click a breakpoint you can add a Condition to it, so it will only break when that condition is met. I did so, and voila:

image

Without having to degrade my code I still could break only when false was returned.

So when I ran it the first break was in the third call:

image

So, thank god for such great tools like Visual Studio and ReSharper (R# hinted to me that I was doing something stupid in the first place)!

Filed under .NET, Coding, Tools
Nov 11, 2008

Come to the dark side – we have cookies

6 Comments

vibrantink

After looking at the default color settings of Visual Studio for the last 8 years of my life I finally decided to give Rob Conery’s Vibrant-Ink theme for Visual Studio a try.

I discovered this lovely little theme quite some time ago, but I really didn’t see any benefit from changing my settings to this, so I forgot about it.
Until recently I started to feel the pain of working 10+ hours on a mediocre screen.
Eye strain was quite bad, and when someone suggested the theme (again) at Stackoverflow I finally tried it.

And, I have to admit, not only does my VS now look way cooler. My eyes feel less tired after long hours of work.

I would definitely suggest trying the theme, it’s just incredible.

Get the theme over at Rob Conery’s Blog and maybe adjust it a bit like Andrew Stopford suggests. But still, stick with Consolas as your font!

Filed under Coding, Tools
Oct 23, 2008

When drivers don’t get along

3 Comments

Logitech VX Revolution

Just when I hoped driver issues are gone for good, I bought my new Logitech VX Revo because I was so upset with my Microsoft Presenter Mouse 8000 (worst mouse ever!).

After experiencing huge precision and lag issues with the Microsoft Presenter 8000 I wasn’t really happy to find my new Logitech totally laggy on the acceleration part.
I’m a huge fan of mouse acceleration, and that’s the main reason I wasn’t happy with Logitech mice, they accelerate differently than Microsoft ones.

But this wasn’t just different, the mouse accelerated absolutely insane:
I then found out that Logitech and Synaptics don’t come along too well. Synaptics and Logitech both try to hook into the same acceleration and so your mouse acceleration gets controlled by the Synaptics driver and your touchpad by the mouse driver. Adjusting the mouse speed worked separately, but still the acceleration was way out of line. So after a day of tinkering I finally gave in and uninstalled the touchpad drivers.

I tried to find a  solution to the whole SetPointSynaptics issue and it seems that there is no solution. Logitech blames Synaptics and vice versa. People just end up doing what I did, uninstalling the touchpad driver.

Logitech and Synaptics don’t work together.

And that means:

  • I can’t scroll on the touchpad (the scroll-area was part of the touchpad driver).
  • I can’t disable the touchpad when working with the mouse (driving me crazy all the time)
  • I miss all the neat stuff like gestures etc.

Soltution: Don’t get a Logitech mouse if you’re stuck with a Synaptics touchpad. It’s simply not worth the trouble.
And while at it, Microsoft should make the Touchpad driver that’s built into Windows better. I’d wish for Windows 7 to support gestures and scrolling out of the box, not having to rely on stupid drivers!

Filed under Personal, Tools
Oct 15, 2008

Handling dependencies

0 Comments

After playing around with Log4Net and the Castle MicroKernel, I suddenly discovered that not having those external dependencies under source control makes development quite difficult.

Whenever I update my dependencies, all other people on the team need to adjust theirs to match mine and vice versa. This is a minor annoyance while the team is small, once you grow and have people coming in and out of the team you’ll start to feel real pain!

If sucks even more if you’ve already shipped your application and get called a year later to change something. Trust me, digging up the right version of library X isn’t getting easier over time, and updating the application to a new version may either break the application or cause your customers to update too (both highly undesired!).

So, what’s the right solution to dependencies?
(No it’s not reinventing the wheel over and over again by writing everything by yourself)

Simple: Put the dependencies into a folder called /lib/ and reference them from there, set the “Copy To Output Directory” option to “Copy if newer”.
Then add this folder to your source control and you’re set. Whenever a new guy comes to the team and gets the project from source control, he’s guaranteed to be able to build it without having to run around some random site searching for referenced assemblies.

Filed under Coding, Subversion, Tools
Oct 13, 2008

Projects

dynamic css for .NET