Archive for March, 2008

Efficient way to deal with the install packages

Do you need a convenient way to extract files from install packages (i.e.: Inno Setup, MSI, Nullsoft etc) without running them (and polluting your system) or resorting to command-line extraction?

Here’s the nice tool that I’ve been using for a couple of years already: Universal Extractor.

Universal Extractor in action

What do you do when the IoC container grows big?

Nicholas Blumhardt has just released version 1.1 of his wonderful Autofac IoC container. The details are available at autofac community forum. You can download both .NET 2.0 version and .NET 3.5 version. Note, that .NET 3.5 version is much more powerful because of extension methods and lambda expressions.

And after this milestone there’s some logical transformation of the project on the way.

Autofac users have expressed their concerns of the core IoC growing too heavy because of all the extensions and integrations being developed. Additionally, there’s always some tendency for the core to be tweaked in order to accomplish something with some extensions.

I believe that’s what has happened with the Castle project. It got heavy.

Nick has agreed to isolate the core from the non-BCL integrations and extras and move them to a separate autofac-contrib project. This separate project will have the same continuous integration support and openness to the contributions.

Additionally there is some consideration to streamline and solidify the framework experience around autofac-contrib while keeping up with the principles of efficient development and D.R.Y.

Think of solution structure that has been designed with the framework extensibility in mind. For example, with the ability to get single integration library by just firing of the build script with the required switches. Something like:

go net2 –D:include=”nmock2,nhibernate,startable,coreutils” integrate distrib

Another opportunity being considered is to design integrations/extras with the replace-ability in mind (so that, for example, it would be much easier to replace one ORM with another, while keeping the interfaces the same).

What do you think?

JetBrains Omea goes Open-Source

JetBrains has finally made the sources of “Omea” available.

Omea Reader

I’ve been using this extremely powerful information organizer for quite some time and found it to be really helpful. Primary usages for me are - getting news on RSS, working with NNTP newsgroups, saving and organizing interesting articles/posts. However, there’s much more that’s left behind for the simplicity reasons (i.e.: Outlook indexing, IM log indexing, numerous blogging and other integration plug-ins etc).

Unfortunately the product was not making enough money for the company (that’s what happens when you get tool “built by developers for developers” into the market with tight competition) and they decided to move to the Open-Source domain (GNU General Public License).

The sources could be downloaded from the SVN repository (use TortoiseSVN for this) and serve as a great reference material (this was a full-blown commercial project, after all). Here are just some of the highlights:

  • NAnt build scripts (with C# scripting)
  • MSBuild scripts (along with numerous custom tasks with sources)
  • Wix setup
  • Specs described with MindManager files
  • Help in multiple formats (from SWF tutorials to CHM and web help)
  • Performance and stress tests
  • Outlook, ICQ, NNTP, Excel, PDF, Task plugins in sources
  • Do you remember the “Unhandled Exception” dialog from R#? It is in the sources, too.

JetBrains Exception Dialog

PS: If you are a .NET developer and do not know about JetBrains products, R#, or TortoiseSVN, then you are not as efficient as you could’ve been (the full “software worth checking it out” list is also available).

Efficient spam bot protection

Wordpress blogging system comes with the “Akismet” learning spam filter for the comments. Unfortunately this filter has proved to be fallible and missed 1-2 spam comments out of every 100.

Almost two weeks ago I had to implement extremely simple spam bot protection in my weblog on top of the Akismet.

That’s the picture that I see every day since then:

Spambot protection results

Akismet filter is still working in case next-gen of spam bots will learn to check every single check box they see.

PS: I’m disappointed that spammers do not simply hook some fast evolutionary algorithms to the spam delivery tool (trained on “per publishing platform” basis). It would’ve been interesting to fight these.

From Web Services to IIS-hosted remoting: XPO performance improvement.

Switching from “XPO over Web Service” to “XPO over IIS hosted remoting” made select operations 20% faster for the average usage scenario in xLim. Adding Forms Authentication on top of the remoting didn’t have any significant impact.

Note, that in this test scenario the remote server was located on the ASP.NET Intermediate shared hosting plan in CrystalTech data center. Desktop Smart Client was located on the opposite side of the Earth. If we remove the distance factor (ping between these two points is 245ms on the average), then the speed improvement for this scenario is 26%.

No optimization to the HttpChannel code has been done. Although, probably bringing over the compression logics from WCF would yield better performance results (at the cost of CPU load).

Update: sample can be downloaded here.

Microsoft .NET BCL is quite inextensible.

Yesterday I had to change the data gateway for the xLim communications. “XPO with caching + WebServices + FormsAuth + Medium Trust” didn’t have great performance. So we were pushed towards “XPO with Caching + Full Trust + IIS hosted Binary Remoting + FormsAuth“.

Guess what? Microsoft does not have IIS hosted binary remoting that can work with Forms Authentication. You are supposed to use IIS protection and encryption instead (SSL, windows auth etc).

Well, shared site hosting plan for the current xLim implementation does not support these features (plus we already have Forms Auth security for the Web UI). So, in order to make HttpChannel deliver that cookie through to the Forms Auth, I had to waste a day rewriting the implementation by Microsoft.

If they had a couple of “protected” and “virtual” members in the right places, this would’ve required only 20 LOC modification.

Know thy dependencies and control them efficiently

Nick has upgraded the MVC extension of Autofac to support the latest drop of ASP.NET MVC.

Unfortunately, this broke the integration server, since (as deduced from looking at the license) we can not redistribute the MVC binaries in the trunk\Resources\MVC folder, as it is with other build dependencies.

Fixing that was a trivial thing - install the latest and drop the assemblies into the cache. However, that was still some manual operation that could’ve been avoided.

In any proper and efficient development environment Don’t Repeat Yourself (DRY) principle is not limited by the code, it goes beyond and makes everything related to the project delivery more efficient (where appropriate and efficient).

We can’t do this in this situation due to the legal restriction. And every user trying to build autofac extension from the sources will have to repeat these actions of mine - find the proper redistributable, download it, install and make sure the assemblies are in the GAC.

Now, how efficient is that?

In any big project one could have more of this small and repetitive operations that stack up to take away your time, distract you or cause problems. This could be a bottleneck in critical situations.

Here’s simple efficiency test for you: “How much time would it take you to release your solution on a fresh development machine?”

Current xLim implementation has approx 36. projects and 11 external dependencies, but requires only install of .NET SDK 3.5 and DXperience 7.3.5 to release and configure it (Web UI, Desktop Smart Client, Server, Automation engine and tools) from the sources (and TortoiseSVN to get the sources). These two can be downloaded from the web storage (it is better even to have dedicated ftp to store them in one place as well).

Given that, hot fix becomes “no-problem” even if you are far away from the office and only have notebook with Windows XP, Internet connection and one hour.

Update: there are more details on this atomic solution structure in: Organization of xLim solutions: development, svn and integration