14 December 2007

PowerCollections: Introduction

If you're still not aware of the Wintellect PowerCollections, now is the time. This library was designed to extend the standard class library with new containers and pre-written algorithms. A list of the containers with short descriptions follows:

  • Bag<T> - is a collection that contains items of type T. It's like a set, but allows duplicate values.
  • BigList<T> - provides a list of indexed items, like the standard List class. However, BigList is optimized for efficient operations on large lists, especially for insertions, deletions, copies, and concatenations.
  • Deque<T> - is an implementation of so-called Double Ended Queue. That means, in a Deque, items can be added to the beginning or end equally efficiently, regardless of the number of items in the Deque. However, a Deque is a little bit slower than a List when being indexed to read elements.
  • MultiDictionary<TKey, TValue> - is a class that associates values with a key. Unlike a standard Dictionary, a key can have multiple values (Enumeration) associated with it.
  • OrderedBag<T> - is a collection that contains items of type T in a sort order, and allows duplicate values in it.
  • OrderedDictionary<TKey, TValue> - is a collection that maps items of type TKey to items of type TValue. Only one value (which can be null) per key is allowed. The inner structure is a balanced binary (sorted) tree. Unlike Dictionary, keys of this collection are compared through the compare function, not by hash.
  • OrderedMultiDictionary<TKey, TValue> - is a collection like OrderedDictionary, but allows more than one value per a key. All these values are stored in sorted order as well as keys.
  • OrderedSet<T> - a collection that stores items of type T in sorted order, and doesn't allow duplicates.
  • Set<T> - is a collection that just stores unique items of type T. Items are compared through the Comparable interface or the Equal method.
Here is at least one container that was implemented not merely to benefit in its unique functions or conceptual features, but because of performance. I'm talking about the BigList vs List competition. I'm gonna test their performance in the coming article.

9 November 2007

XForms standard

Recently I ran across the XForms term and became interested in.
I found out that the term means a new standard to be used in the web, and to be included in the XHTML 2.0 standard. The XForms approach allows developers to use the MVC pattern without any additional coding/scripting taking into account dynamic control-data loading (AJAX-like). This aims to simplify the web-forms development by far, and (that is more important) to give users a cutting-edge standard that doesn't seem to be differently interpreted by companies alike Microsoft.

I've found a good article describing this standard, not too far:
http://en.wikipedia.org/wiki/XForms

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.

9 June 2007

Adobe Apollo Applications examples

Here you may see all that stuff. I really enjoyed the Fresh application which is kind of skinnable RSS-reader (a real desktop application, a little bit slow though).

I ought to add that the "real desktop application" is an illusion created by its visual representation. At the bottom there is pure HTML and Javascript. I think it is kind of Adobe's implementation, I haven't found any difference though. To the point, it seems the Apollo is good at showing standard web-pages (with font anti-aliasing and slow-rendering scroll)

17 May 2007

jQuery rocks

Just to make a note - it would be convenient to use the jQuery library next time I need to write more or less complicated javascript code block. It simplifies document node access, manipulating with DOM, gives an ability to implement queer visual effects with one line of code.

List of useful links goes below:

One more note - there are lots of plugins for the javascript library. Just use Google Search :-).