Moved my blog

2013/07/18 Comments off

This is my last post on wordpress.com.

I moved here: http://draptik.github.io/

Categories: Uncategorized

IT book recommendations

2012/12/15 Comments off

I now have a list of IT book recommendations at GitHub.

Categories: development, IT, software Tags: ,

Why I switched from Ubuntu to Arch Linux

2012/10/16 2 comments

Ubuntu is a great GNU/Linux distribution. I have been using it since 2004, and except for one LTS (long term support) upgrade a couple years back everything was fine. That LTS upgrade a couple years back screwed up the X system, leaving me with the bash shell. Don’t get me wrong: I enjoy dabling with my Linux system, but an LTS upgrade should be safe.

Well, this was years ago.

After upgrading from Ubuntu 11.10 to 12.04 the same thing happened again: No X system.

I have a cheap Nvidia card with dual head setup (dual head means you can plug in 2 monitors). Worked fine with Ubuntu since 2009. So I upgraded to Ubuntu 12.04. And I’m back to: No X system.

I was not amused.

It was not a hardware problem: The old OS (Ubuntu 11.10) worked fine. It was not the fault of Nvidia. I am talking about a video card for 20-50 bucks! Not one of those high-end video cards.

Instead of switching to another deb or rpm based system I decided to switch to one of those “rolling” distributions like Gentoo or Arch. I picked the later and have so far not regrated the decision.

Arch Linux is my home production system of choice.

Categories: linux Tags: , , , ,

Impressions during developing my first application with Mono and Gtk# (GtkSharp)

2012/09/30 Comments off

Why Mono? Why Gtk?

Over the past couple of years I have been developing C# ASP.NET enterprise applications. So I am quite comfortable with the Microsoft stack.

That answers the first question: Mono gives me C# and the .NET stack.

On the other hand I have been using linux as a desktop environment on my home machine for over a decade. I am comfortable with using linux as my primary OS.

That answers the second question: Mono gives me access to Gtk, the graphics library of gnome, which is the default “desktop” in many linux distributions.

The App

I want to synchronize different Git repositories semi-automatically using a Gui.

  • Default behaviour of the automation can be loaded via a Json file.
  • Each entry describes a repository set to be synchronized.

The app is located at https://github.com/draptik/RepoSync

I also published a small demo application for gtk# and treeview: https://github.com/draptik/GtkSharpTreeViewDemo

Impressions

Monodevelop vs Visual Studio

I’ll keep it brief: If you’re used to Visual Studio and ReSharper, Monodevelop does not come close. On the other hand Monodevelop is a full C# IDE which works with linux. And Monodevelop can be used cross-plattform.

Gtk# API

The Gtk# API is not your typical .NET library. You will very soon notice that the origins are C/C++. This takes some getting used to if you have a .NET background.

Typically there are no return values. Instead Gtk# methods very often use the “out” keyword in .NET because that comes closer to the C++ implementation using pointers.

Here is an example:

## Mono Gtk# Code
bool someBool = false;
if (listStore.GetIterFirst (out iter)) {
do {
someBool = (bool) listStore.GetValue (iter, 0);
} while (someBool && listStore.IterNext (ref iter));
}
return someBool;

## Pseudo-C# Code
return listStore.ToList().Any(s => s.MyBoolProp);

From the .NET side, I don’t like the Gtk# API. I prefer methods having return values. I guess it is a matter of tast. If it would really bother me, I would write some wrappers around… ;-)

PS1 prompt

2012/08/20 Comments off

Here’s my current PS1 prompt for bash with optional git support: https://gist.github.com/3324534

Categories: IT, linux Tags: ,

GNU/Emacs: Desktop Save with “Lazy Loading”

2012/03/27 Comments off

When using desktop-save-mode (
http://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html)

using desktop-restore-eager is a must:

(custom-set-variables
‘(desktop-save-mode t)
‘(desktop-restore-eager 5)
)

desktop-save-mode will load your last session. Setting desktop-restore-eager to 5 will only try to load and render the last 5 buffers while loading your saved buffers.

Converting a Mercurial repository to Git

2012/02/07 Comments off

Note to self:

Converting Hg repos to git using hg-fast-export.

Installation:

$ sudo aptitude install hg-fast-export

Usage:

$ cd new_git_dir

$ git init

$ hg-fast-export -r <hg-repo>

Works with:

git version 1.7.5.4

hg version 2.1

Follow

Get every new post delivered to your Inbox.