QText 2.30

After more than a year, new version of QText is finally out of beta. That time was spent mostly on rearranging internals which is not really visible but I do have few changes that should make you want upgrade.

Probably most desired request was to be able to hide tabs. This is something that I postponed for quite a while, but time has come. Since QText tries to keep underlying files readable with any program, this change was done via flipping file’s hidden attribute.

Second big change is ability to detect changes in open files. It was implemented in different ways through-out beta until I finally settled on this implementation.

Additional improvement for those running QText in corporate environment is that, when QText is started without installation, no settings are saved to registry. Program should leave no traces on computer. Unfortunately this means that no settings can be saved but this is necessary trade-off.

Program can be downloaded as full installation and as zip archive (for no-trace setup).

Version Control

Over time I played with quite a few Version control systems. Here I will explain why I hate each one. :)

WinRAR

My first source control consisted of nothing more than compressing project’s files in different archives. It became one source control system by which I will judge every other. It was probably best $35 that I ever spent on any software.

Microsoft SourceSafe

First one that I ever saw was Source Safe. I kind of liked it but this was time of simpler (Visual Basic 6.0) projects. I never used it at home since it was simply too expensive for me.

IBM ClearCase

First real contact with version control was in form of ClearCase. To put it in context, it felt like I was little kid getting introduced to gravity via drop from 1000 meters (more than 3200 feet for those SI-challenged).

We had one guy in company who’s sole responsibility was handling views and other black magic. After some time I did became a sort of expert for client side installations and I sorted more problems with it than I care to remember. I figured that version control needs to be complicated on both client and server level.

Not to be misunderstood, in those rare occasions when moon and sun were in just right position and as long as you sticked to Unix command line instead of Windows client, it did work as expected.

SourceGear Vault

As I was playing with ClearCase at work, I started to desire something for my personal projects also. Answer was in SourceGear’s Vault. It was in-place replacement for SourceSafe and it was free for single developer.

Trouble with it was that I just got too used to ClearCase and it’s control of everything in directory. With Vault I had only source under control. Documents, installations and other files that my projects contained were still under mercy of WinRAR.

Microsoft Team Foundation Server 2005

After I parted my ways with Vault, I missed source control. I missed it enough to install Team Foundation Server. Installation was made in hell. It had bunch of requirements and each requirement had it’s own requirement. It was mission impossible. I did install it at least but I decided that cost and pains that it puts me through are just not worth it. I never actually used it’s source control. And I never will.

SVN

Since ClearCase was getting too expensive and too painful to maintain, my team switched to SVN. It took some time to get used to work without checkouts but we mostly managed it. Since we had something like 20 people working for first time with same repository, we probably did every single thing you should not do.

Experience with it was actually good most of times. Although, I would like to kill idiot who decided that “.svn” folder in EVERY directory is appropriate way of storing information…

Microsoft Team Foundation Server 2010

I simply could not believe that same team did both 2005 and 2010 edition. Those two products could not be more different. Installation of Team Foundation Server 2010 went without issues. If I forget whole issue with Visual Studio 2008, whole product just worked.

Files outside solution were issue - it was annoyingly hard to track any file that appeared outside of project. As I started to work with stuff that isn’t in Visual Studio 2010, two of us just got parted. I still miss integrated work item handling.

If I ever went back to Microsoft-only world, I would use this.

Mercurial

I have no idea how I came to try Mercurial but I am glad I did. It uses file based management (like SVN) but “.hg” folder is only place where it stores everything of it’s own. Installation is dead simple, usage even better (TortoiseHg). It has plenty of rough edges but it feels good so far.

I love the most simplicity of administration and low system requirements. My home server has total of 256 MB and Mercurial can work on it.

I used it only for couple of months now (and that is actually less than any other system excluding TFS 2005) but I feel like it was made for me. It is my current choice. Will it remain, only time will tell.

And it is only source control system where backup can be done as easy as with WinRAR. Actually, I do it with WinRAR… :)

P.S. This text represents nothing else than my personal and highly subjective views. As it comes, I do care a lot about them and I consider everything written here to be absolutely correct. :)

P.P.S. Yes, I know that WinRAR was not intended to be version control system.

Merging SQL Server Tables

In one of my existing databases I had to switch from integer key to GUID. Annoying aspect of it is handling referential integrity issues and, as soon as there are two tables, you can bet that there will be issues.

Process was half manual and simple one: just create new field (e.g. Guid) and give it default of NEWID. Database itself will do the rest for that field’s value.

In order to sort out references, you can go in similar fashion. For every foreign key field just create one with GUID (E.g. ItemId gets it’s friend ItemGuid). After that just synchronize fields with simple SQL:

UPDATE Codes
SET ItemGuid = (
    SELECT Guid
    FROM Items
    WHERE Items.Id = Codes.ItemId
)

In this case, we had referential link between Codes.ItemId and Items.Id. Our goal was to switch that to Codes.ItemGuid and Items.Guid. Where statement ensured just that.

Async and Await

On Microsoft’s PDC Anders Hejlsberg gave a talk about two new keywords in C# - async and await.

I will not get into them to much - those interested in more can start with taking a look at actual presentation. In essence, they give you new way of dealing with asynchronous tasks. You just point to system where asynchronous operation might occur and C# (or VB.NET) compiler will build all background code that it needs to handle this gracefully. For me it does same revolutionary thing as yield did for enumeration. Seeing this, I got pissed at Java.

Part of my time I spend as Java developer. And I get pissed at it all the time. Whether it is half-assed implementation of generics, absence of in-language support for yield, and in a year-or-so, I will extend this to absence of async and await.

True Java believer would say that all those things are just syntactic sugar - there is nothing magic in them that could not be written by hand. I consider this irrelevant. It is not point whether something can be written, to me most important is point how easily. If I use e.g. yield, there is almost no chance I will mess it up in three lines it takes to do it. When I write code for it in Java, this expands to few tenths of lines needed for state machine. Error chance and debugging time increases exponentially.

I value Java a lot. It is beautiful language at it’s core and it gave huge boost to development of all managed languages. However, it seems as Latin language to me. Nice and beautiful but there is just no significant development of it’s syntax. It takes more and more effort for me to switch between new modern languages (where I would include C#) and Java. I always find something missing…

P.S. Yes, this post is full of exaggeration, but I do not consider it too much off mark.

2032

Illustration

After annual maintenance of power grid in my neighborhood with few hours without power, my trusty file server went down. It wasn’t first time that it went down. It was first time it stayed down.

This was alix1d embedded PC with FreeNAS running on it so my first thoughts went to file corruption. And I was right, there was some file corruption, but nothing that simple fsck could not solve. However, boot process still had issues.

I will not detail everything that I tried. It is sufficient to say that I wasted whole day playing with this thing. As last resort I decided to reinstall system.

As I went into BIOS to set my boot device, I noticed that my BIOS password is missing. As I went through setting, everything seemed to be on default. And default is not state you wish your alix1d board to be in.

FreeNAS has some issues with ACPI on this board. It will just not boot if you have it turned on. And I had it turned on in my BIOS. Fixing was easy - just turn it OFF. All that wasted time amounted to issue I already knew.

Reason why BIOS settings were changed was simple CR2032 battery. It usually keeps BIOS settings nice and fresh but mine was dead. Any power outage would cause same issues. It was accident waiting to happen.

I checked old invoices and it happens that this system is only two years old. I find it quite peculiar that battery is already gone. There is something that is drinking battery like mad on this motherboard.

Anyhow, everything works perfectly with new battery. I only hope that I will remember this issue when everything fails again in two years. :)