Abstract
When developing web sites there are many times that session state has to be saved between pages. Here is a way to store all of your session variables in a single string and give access to all variables across all pages.

EggHeadCafe article: Cross Browser Modal Dialog Box. A model dialog box is one that maintains focus when you click on the window that opens it - i.e. you have to choose an option before you can continue using the site.

Tuesday, December 21, 2004

The GIMP 2.2 is now out. Download for Windows: http://gimp-win.sf.net/. The GIMP is a tool for working with and manipulating images and is open source. Not the most intuitive tool but very powerful, and is extended via plugins. Since the GIF patent expired you can generate GIF images (not available in version 2.0 and earlier). The file open/save dialog is a lot better in this version than the last version (2.0) and contains an image preview. Works on many platforms.

A good free tool for working with graphics. If you already have Photoshop or another professional package, then this may not offer any more over it. Help is a community project - not the same quality as what you may get with a commercial product, but covers the basics.

Paint.NET 2.0 (developed by Washington State University with Microsoft mentorship) is also out. A Paintbrush replacement tool, requires .NET Framework and Windows XP. 7.71mb download (28.7mb with Framework).

Use Paint.NET for basic manipulation of bitmap images and GIMP for more complex work.

Thursday, December 16, 2004

When using SUM on a field ('bitcolumn') with the data type 'bit', you may not get the expected result - i.e. you would expect it to return the count of all the rows that have this field set to true (1).

SELECT SUM(bitcolumn)

However, it returns an error: The sum or average aggregate operation cannot take a bit data type as an argument.

You can however, use CAST to convert 'bit' to 'int', and perform SUM on the result.

SELECT SUM(CAST(bitcolumn As int))

This can however result in NULL returned as a value, when you want 0 instead. To always get a number as the result, you can also use COUNT combined with CAST and NULLIF. The key is that COUNT does not include any rows with NULL set on the field you are querying. CAST converts to 'int' and NULLIF converts the 0's to NULL's. COUNT therefor only includes the row count you want (where the field value is 1).

Generic Url Creator (GUC) is a Firefox extension that creates a URL from the text you select (i.e. use to lookup definitions, or perform a search). You can edit the list via the use of regular expressions.

Wednesday, December 15, 2004

A useful Firefox extension that allows you to save web pages (or snippets from a web page). You can also search the snippets as well. ScrapBook Homepage. Good for when you find some code on a web site and want to quickly save it.

Daniel Glazman (NVU developer) has written a post on what he thinks of the current state of CSS and what should happen in the future: Calling for a new CSS revolution. An interesting read.

What would the web be like now if Microsoft continued to work on Internet Explorer? I'm sure it would have been a lot better (less hacks for CSS in IE, better looking sites). Instead, Longhorn/Smart Clients is part of their future strategy and could go any way (new hardware and OS would be required, but you would be tied to Windows and would therefor be more expensive). Richer applications, but to the detriment of competition (i.e. Novell/IBM/Sun - who are investing in Linux and thin-clients) and the environment (old PC's going into landfills).

Friday, December 10, 2004

Google has a beta feature that offers suggestions as you type: http://www.google.com/webhp?complete=1. Works the same way as typing a name into the To box when composing an email in GMail. What is good about it is that it does it so quickly (considering the amount of data they hold) and lists how many matches to each suggestion.

The good thing with Google is that new features they add are browser friendly (i.e. work in Firefox, Safari, Mozilla and Opera - so don't just test against Internet Explorer). It looks like they probably use web services extensively via JavaScript and XMLHttpRequest (Mozilla/Firefox/Opera/Safari) or Microsoft.XMLHTTP/Msxml2.XMLHTTP (Internet Explorer).

There is a free eBook (i.e. PDF document) available on SharpDevelop. While SharpDevelop does not do ASP.NET, it has a decent code editor with syntax highlighting and code-completion. So useful for building libraries (i.e. a data access layer or common function library) for use within a web application. It also does not have version control (had CVS support in the past, but that was dropped).

With enough demand (and hopefully more developers), SharpDevelop may get ASP.NET and source control in the future - which are essential if it really wants to compete with Visual Studio. At the moment the only decent tool for ASP.NET development is Visual Studio (which is sometimes out of people's budget, especially if they work for non-profit or budget sensitive organisations) - and that likes to reformat your code. Dreamweaver does ASP.NET - but no support for code-behind or code-completion (except for tags - even then, only the ones part of ASP.NET, not custom ones).

There is a tool available for reporting sites that have issues with Firefox (and other Mozilla based browsers) - telling user to use Internet Explorer, blocking access, or with rendering/dhtml problems. There is a web-based form and an extension available to do this.

Friday, December 03, 2004

When searching for data in a column, you may want to perform an OR AND or exact term on a user supplied string. When you use LIKE, the column needs to contain the whole text string, which is not always what you want. One way round this is to use a stored procedure as outline by Jeff Smith (Dr. Cross Join) a member of SQLTeam.com - Search Logic For Multiple Search Terms

NVU 0.6, the free WYSIWYG html editor is now available for download. Still a long way to go before it is near Dreamweaver in terms of functionality. Has a few bugs as well (reformats code, does not work well with server side (ASP,PHP) code, adds DOCTYPE declaration (which you can't change) even when you don't want one (i.e. when editing an include file, or a template file used within a CMS), no XHTML support). Hopefully 1.0 will be a lot better (but will probably be a lot better by 2.0)

Site manager has improved, but could be better (i.e. context-menu, handling of other file types - cannot open ASP/ASP.NET files with it, no ability to add association (or use built in Windows associations). Perhaps it could be better if there were more working on the project (Daniel Glazman seems to be the only one (that I know of) actively working on it)?

Wednesday, December 01, 2004

A function (with overloads, for char or string deliminator) for converting an ArrayList to a string (with defined deliminator). When calling with ArrayListToString(MyArrayList), default deliminator is ,.

The DetailsView control is a new control that will be in the next version of ASP.NET (Whidbey). This has been backported to ASP.NET 1.x as a custom control. NAnt is a tool for building .NET applications (get source, configure, compile, test, create documention and package for deployment). Building Web Applications with NAnt (ASP.NET)