Saturday, December 29, 2007

VarArgs in Java 5

Introduced in Tiger (Java 1.5.0), variable arguments enables Java methods to accept a variable (0..*) number of arguments thus allowing users greater flexibility in passing calling methods, previously dealt with using arrays.

The last parameter in the list is defined with a "type ... variable_name" syntax (note the ellipsis).

private static int sum(int ... numbers) {
  int accum = 0;
  for (int i=0; i<numbers.length; i++) {
    accum += numbers[i];
  return accum;

Implicit variable declaration in .NET 3.5

In C# 3 and Visual Basic 9, you can declare variables without having to specify the type of the variable. This isn't the same as the variant type in Visual Basic, but rather the compiler's ability to determine the type of the variable from the initialization value.

Here's how it works:
var i = 3; //C#
Dim i = 3 'VB

Using implicit declaration of variables requires you to specify a non-null value since a null only represents the generic object type.

EDIT: You can get the implicit declarations feature in LINQ projects (CTP) with Visual Studio 2005.

Friday, December 28, 2007

Google's 403 for View as HTML

Google is probably having to deal with a load on it's servers this holiday season and so they're restricting access to their "View as HTML" feature. The message displayed is:

We're sorry...

... but your query looks similar to automated requests from a computer virus or spyware application. To protect our users, we can't process your request right now.

We'll restore your access as quickly as possible, so try again soon. In the meantime, if you suspect that your computer or network has been infected, you might want to run a virus checker or spyware remover to make sure that your systems are free of viruses and other spurious software.

We apologize for the inconvenience, and hope we'll see you again on Google.

MacOS X's .DS_Store files

I noticed a couple of .DS_Store files appearing in some of the archives that I've been receiving and recognized them as MacOS X files used for display, much like the Windows thumbs.db (created to store thumbnails of files - check the "Do not cache thumbnails" in Tools > Folder Options > View). I looked up more info and here's what I came across:

Under Macintosh OSX .DS_Store holds the information which controls the way a folder will be opened; i.e., the shape and size of the window, the position of the window on the desktop and whether file, folder or icon view has been selected. If you were to delete the .DS_Store the folder would revert to the system default next time it is opened and a new blank .DS_Store would appear (invisibly).

You can disable the creation of .DS_Store files by MacOS X by running this command from the terminal window: defaults write DSDontWriteNetworkStores true

Tuesday, December 25, 2007

NetBeans 6.0 bug

Although I'm a fan of NetBeans because it's a simple IDE that runs with limited memory too, I must admit that it is quite buggy. One of the features of NetBeans is that it locks the GUI code so you can't accidentally break the GUI builder. I've tried Borland's JBuilder and breaking the GUI builder with custom code was one of the problems I came across. However, when NetBeans breaks itself, I can't get into the code to change it, which is one of the complaints that I have with the IDE. I wish it had a "hack-the-code" option where I could at least change the variable names - all I did was delete a menubar and add a new menubar... when I went into code view, it still had the old menubar and used the old menubar for the frame - the new one was an unused variable!

Anyway, I guess it's back to Wordpad for me.

Monday, December 24, 2007

Column-oriented vs Relational

Column-oriented databases are the next big thing for data warehouses, having passed through object databases for specialized applications. For a while, InterSystems Cache enjoyed the spotlight as a high performance object database. Now, Vertica is the hottest thing the database world has to offer as a column-oriented database.

Column-oriented databases store column-data as a contiguous sequence, as opposed to relational databases which store row-data in contiguous allocation units. This makes it simpler to make schema changes, and offered better performance for OLAP applications. Relational databases still are the best solution for general purpose OLTP applications so it isn't the end for them yet, although they were architected almost three decades ago.

Sunday, December 23, 2007

VS2008 Express

The Visual Studio 2008 Express offline installer is a corrupt image being offered for download from the Microsoft website. A lot of people have complained about the "Program too big to fit in memory" error so it's yet another bug from infamous Microsoft. It's a free product so no one really cares at this stage, unless they are paying for bandwidth.

Thursday, December 20, 2007

Regex for doesn't contain

^((?!my string).)*$ Is the regular expression for does not contain "my string". Wondering how someone can come up with that? Check out the reference at:

There's a basic and advanced regular expression reference section so check out both!b

Wednesday, December 19, 2007

Sun Java on Fedora Core 8

There's been a successful install of Sun Java 1.6.0 on Fedora Core 8 with instructions posted at:

I haven't been able to try it yet, but I'll do so soon.

Tuesday, December 18, 2007

Microsoft's 2008 Platform

Microsoft is releasing Microsoft Windows 2008, Microsoft Visual Studio 2008 and Microsoft SQL Server 2008 at an event on February 27, 2008 7am. It's a pretty major event since it marks the next leap since the 2005 release.

The best feature of the new platform is LINQ, which enables developers to treat data as entities rather than relational tables. It's like taking NHibernate to the next level and integrating it with the programming language.

Monday, December 17, 2007

Sun pushing for NetBeans

Sun is bringing it's IDEs to an end and would be helping it's customers move to NetBeans for development. It's actually a pretty good idea since most of the Java world is pretty much standardizing on either Eclipse or NetBeans. With more of the community shifting to Eclipse, the only reason NetBeans would remain alive is if there are sufficient users working with it.

IP Address Lookup

You can easily get the geographical location for an IP address at . It even displays a nice little map, though you shouldn't expect it to be accurate enough to go on a hunt for a hacker with your GPS tracker ;-)

Oracle iSqlPlus

Oracle has a pretty good web based tool for executing queries against the database called iSqlPlus. It is quite similar to Sql*Plus, but is better suited for testers than DBAs. In Sql*Plus, users complained about long lines that would get wrapped, thus messing up the output. Since iSqlPlus works within your browser, it builds an HTML table containing query results with a width just enough to display all the results. It also keeps a history of previously executed statements for the sesson, so you can easily execute a previously executed query.

For a default install of Oracle, you'll generally find iSqlPlus installed at http://localhost:5560/isqlplus . Do add your comments to this post if you've had a chance to use both.

Sunday, December 16, 2007


The proxy based estimation method is based on drawing upon previous experience with a similar project to get a rough estimate of the time required for building software. Unlike the wideband delphi method, it relies less on expertise and more on historical data. This technique is commonly applied when comparing projects within a similar domain.

Wideband Delphi

The wideband delphi software estimation technique is actually a process where a group of experts arrive at a consensus based on the Work Breakdown Structure. It's simplicity is one of it's greatest strengths and it relies heavily on the experience of the experts called in to make the decision. If there are large differences in the estimates, they resolve it through further discussion and finally come up with the final numbers.

Wednesday, December 12, 2007


NCover is a pretty good code coverage tool for .NET. You can use it to determine which parts of your code aren't tested by unit tests, thus letting you know if you need to write more tests.

A common problem identified by code coverage tools is that you have blocks of code that you wouldn't encounter under regular circumstances, such as Exception blocks that are intended to catch unforseen errors or error conditions that occur rarely. Due to insufficient testing for those blocks, you could be releasing some untested code that could result in a bug.

NCover can be run with pretty much any kind of tests - you just need to provide them as parameters to the command line NCover tool or browse to find the executable for the graphical tool so you aren't limited to any single testing framework, such as NUnit.

Sunday, December 9, 2007

Sun Java on Fedora 8 has an issue

Fedora 8 has a buggy libxcb package due to which we get the following error when using Sun Java...

java:scb-slib-c:so:scb_slib_unlock:Assertion 'c->xlib.lock' failed.

You can, however, use the default Java that ships with Fedora 8.

Saturday, December 8, 2007

Upgrade to FC8

Fedora Core 7 was pretty cool when it was released. I showed all the guys and girls at work how it could do better on fancy effects than Windows Vista when you turned on the Desktop Effects and used Gnome. When the launch of Fedora 8 was announced, I just had to go and get myself one of those. I started off by upgrading my desktop at work from Fedora Core 7 to Fedora Core 8 and it seems to do a pretty good job on some counts. I had to upgrade KDE-SVN for it to work, which was just a matter of typing a "yum update kdesvn". The OpenOffice icons from my taskbar are now missing but the documents that I had placed on my desktop now have thumbnails displayed. There's lots more to it, but I guess I'll write more as I come across it.

Friday, December 7, 2007


Microsoft has a Windows Server Update Service (WSUS) utility that we can use to download updates and get them installed within the network. It can download updates for different versions Microsoft Windows Operating System. The domain clients have to be setup via Group Policy. For workgroup clients, you would have to make registry changes; see:

To manually search and download Windows updates, you can also use the Microsoft Windows Update Catalog via your browser. Unfortunately, it doesn't list available updates so you can't browse - all it's got is a search box where you can type the update that you're looking for.