Archive for October, 2009

Compute hash of a file

Computing the hash value of a file is quite strait forward. I use the routine below. It opens the file, specifies the hash-algorithm to use and returns the hash of the file. If you rather use MD5 hashes, just change hashAlgorithm into MD5CryptoServiceProvider. Public Function ComputeFileHash(ByVal fileName As String) As String   Dim hashAlgorithm As [...]

More »

Icon Finder, the Google for icons

Here’s a very useful tool: http://www.iconfinder.net/ It allows you to search for icon, and it returns a lot of high quality images. Recommended!

More »

How to: Get the name of the running SQL-server instance

Here’s a script to retrieve the name of the currently running SQL Server instance: SELECT @@SERVERNAME AS ‘ServerName’ Resultset: ServerName ————————— DEV-SQL (1 row(s) affected)

More »

SQL-server: Get current database name

It can sometimes be handy to know in which database you are working. To get the name of the current database you can use a simple script: SELECT DB_NAME() AS DataBaseName Resultset: DatabaseName ———————— NorthWind (1 row(s) affected)

More »

Am I running as a 32 or 64-bit application?

Here’s an easy way to determine if a .NET application is running as either 32 or 64-bit  application. VB Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)   If IntPtr.Size = 8 Then     Response.Write("64-bit")   ElseIf IntPtr.Size = 4 Then     Response.Write("32-bit")   End If End Sub C# protected void [...]

More »

1,000 free icons

As a developer you’re probably familiar with the FamFamFam icon collection. It has certainly served me well over the years. But even though FamFamFam is great, there’s always room for improvement. That’s why you should check out the new FatCow collection, comprised of no less than 1,000 icons in both 16×16 and 32×32 high quality [...]

More »

Purge OpenX statistics tables

OpenX is a great tool for displaying ads on your website. But there is a small issue I’ve been wanting to address: statistics data. OpenX gathers a lot of data about clicks and impressions of your banners. While this can be very helpful, it also puts a strain on the database. And as I use [...]

More »

Error message 401.2.: Unauthorized: Logon failed due to server configuration. (IIS7)

After installing Windows 7 my ASP.NET application displayed an Access is deniederror. The complete error message was: Error message 401.2.: Unauthorized: Logon failed due to server configuration.  Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server.  Contact the Web [...]

More »