28 August 2007

The BackgroundWorker's slip

Today I've faced a problem with the BackgroundWorker class. Or two problems..
First, the IsBackground property of its thread is set to true - that means that the thread will be terminated immediately when the process tends to close. That problem could be solved simply:

Thread.CurrentThread.IsBackground = false;

But the second.. the second is that the RunWorkerCompleted handler is called asynchronously, and will never be called if the thread is aborted due to the application's closing. That's why it is a bad idea to write to the log in such event handler - the log will never state whether the thread has been cancelled, crashed due to an error or finished successfully.

To solve these two problems I offer to implement own version of BackgroundWorker, that will have synchronous and asynchronous "OnComplete" calls, at least. And won't run background thread.

Will try to do that later and update the post.

15 August 2007

Session Manager addon

What do we need while surfing the web? Convenience.
What do we use to achieve convenience? We use lots of functional things provided by the browser, but one of the most important of them is the Bookmark feature. It gives user fast access to the web-pages user had an experience with earlier.

In my work I often use bookmarks, but not always one bookmark can reflect the entire "workspace" I need to establish. For that purpose the Firefox browser has a possibility to open all the bookmarks in the particular folder at once. That really works, but there are some problems:

  • All the bookmarks will be opened in the same window, that isn't always good, especially if the folder contains more than 5-6 bookmarks which don't fit into the tab-bar. It would be good to open those bookmarks in several windows.
  • All the bookmark-pages will be loaded from the "zero" point, that isn't always good too, because sometimes a web-page needs some session cookies to work properly.
To solve these two problems we can use so-called Session Manager add-on - the add-on that allows user to store the current state of the browser, and to recover it any time he/she wants.

After that add-on is installed into your Firefox, please don't forget to customize your tool-bar in order to show the session-manager's button.

8 August 2007

Local wiki based upon .NET: ScrewTurn

In the company I'm working for the time being wasn't any allusion to the documentation center. There weren't any guidelines, sole coding conventions, document templates etc. All the documents circulation was organized on e-mailing. Thus, I took upon myself to bring an order to the chaos. Luckily, our boss is farsighted enough to be interested in the feature like that.

So, I found the wiki that looked good and is implemented on the ASP.NET platform. Here you may find its home page. We have used it for a while and here are its advantages:

  • It's open and built on the .NET platform, thus we can change its behavior ever we want and to keep other .NET applications on the same server (IIS), on the same port.
  • It supports database storing in the different locations (through pluggable providers): file system, Microsoft SQL Server 2000/5, MySQL 5.
  • It's quite simple-looking.
  • It's quite simple-installing.
  • It has advanced discussions support.
  • Advanced backuping support.
  • It uses AJAX
But we found a few problems:
  • There is too little of user experience with this wiki.
  • As it's built on the .NET, we have less flexibility for hosting - it should be Windows-based and there is no room for other ones.
  • It has the markup language that is quite different from the wikipedia's for example, and it has much less features and possibilities than the mentioned one.
  • It's being developed by the small dev-group unlike the wikipedia. Thus, we have no confidence that the wiki will be alive and in development even in the nearest future.
That's why we at last decided to change to the MediaWiki. I'll try to describe it later.