September 2007 - Posts

VISTA: Windows Vista Service Pack 1 now available on MSFT Connect!

Thats right, start downloading because its now available on Microsoft Connect.

Build Tag: 6001-16659-070916-1443

Includes different languages (German, English, Japanese, French) and both x86/x64:-)

0xBA3D70C7     6001.16659.070916-1443_x86fre_Client_en-us-FB1CFRE_EN_DVD.iso

 

0x66C39C14      6001.16659.070916-1443_amd64fre_Client_en-us-FB1CXFRE_EN_DVD.iso

 

0x448B3564      6001.16659.070916-1443_amd64fre_ClientN_en-us-fb1cnxfre_en_dvd.iso

Office 2003 Service Pack 3 Released!

Just a quick note for those who are using Office 2003, MSFT have release SP3 which you can download at from the download center. Weighing in at 120Mb this includes all the previous service packs and several changes as specified below (again from the download page).

Some of the changes in Service Pack 3 modify the behavior of Office 2003, including changes that disable some features by default and increase control for computer administrators. Changes include:
  • Office 2003 can no longer open or save certain file formats. For more information, see Microsoft Knowledge Base Article 938810.
  • MAPI forms do not run in public folders and user folders. For more information, see Microsoft Knowledge Base Article 938816.
  • Office 2003 can now be configured to allow or deny specific COM components. For more information, see Microsoft Knowledge Base Article 938815.
  • Some COM components with unusual characteristics may not function as expected. For more information, see Microsoft Knowledge Base Article 938814.
  • Changes have been made to the behavior of Microsoft Office Document Imaging. For more information, see Microsoft Knowledge Base Article 938813.
  • Attachments with the .gadget extension can no longer be opened in Outlook. For more information, see Microsoft Knowledge Base Article 938811.
  • Access add-ins can no longer be configured for use by all users. For more information, see Microsoft Knowledge Base Article 938809.
  • The Fast Save setting in Microsoft Office Word has been removed. For more information, see Microsoft Knowledge Base Article 938808.
  • Documents saved in certain formats no longer contain the version number of Office. For more information, see Microsoft Knowledge Base Article 938807.
  • Certain macros in older Excel file formats have increased security. For more information, see Microsoft Knowledge Base Article 938806.
Highly recommended download and slipstream Office 2003 Service Pack 3 into the installer for easier installation later.

Colin McRae passes away in a helicopter accident.

Sad news today that Colin McRae - undoubtable one of the worlds greatest Rally drivers, has passed away today.
An AS350B2 Squirrel helicopter registered to McRae crashed 1 mile north of Lanark, Scotland on 15 September 2007, which is close to the McRae family home. McRae is known to be a keen helicopter pilot, and his agent Jean-Eric Freudiger says he and his 5 year old son Johnny were killed in the crash, in which Strathclyde police confirm there were no survivors. Wikipedia
Read more in The Age Article. I remember watching him in the 95 rally ( I was in Grade 5 at the time ) racing his Subaru and telling myself thats the type of car I want to get. Sure enough the first car I bought was a Subaru (WRX) about eight years later but full credit to Colin for leading the way. Like many, his game franchise was another addiction of mine having bought every Colin McRae since the original.

SQL: Clean a SqlServer Database of tables and Stored Procedures Script

Here's a quick script I wrote to assist in cleaning up a SQL Server database of all tables and Stored Procedures.

WARNING:
THIS *WILL* REMOVE everything in the currently selected database, so USE WITH *EXTREME* CAUTION for heaven's sake! Dont blame me if you blow your company's database without a backup!


Replace [DATABASE_NAME] with whichever DB you would like to clean. This takes on from my previously posted tip about using the undocumented sp_MSforeachtable stored procedure to drop tables post. This is only tested in SQL Server 2005 & 2008, should work in 2000.
------------------------------------------------------
-- Database Cleaner-up-er for SQL Server 2005
------------------------------------------------------
--  Version:	1.0.0
--  Date:	15/09/2007
--  Author:	Thushan Fernando (thushan [ at ] wsoftware [dot ] biz)
--  URL:	http://blogs.developerfusion.co.uk/blogs/thushan/archive/2007/09/15/3320.aspx	
--	
--  Cleans a database removing all tables and stored
--  procedures.
--  
--  THIS WILL DELETE / DESTROY ALL TABLES AND STORED
--  PROCEDURES. YOU HAVE BEEN WARNED HOMEY!!!
-------------------------------------------------------

USE [DATABASE_NAME]

GO
-- INIT
SET NOCOUNT ON

-- VARIABLES
DECLARE @COMMAND varchar(255)	-- Command to execute
DECLARE @COUNTER int			-- Counter used to iterate
DECLARE @spName varchar(255)	-- Stored procedure name

-- DELETE ALL THE TABLES
-- First disable any constraints on that table
EXEC sp_MSforeachtable @command1 = "ALTER TABLE ? NOCHECK CONSTRAINT ALL"

-- Drop the table
EXEC sp_MSforeachtable @command1 = "DROP TABLE ?"

-- CREATE A TEMPORARY TABLE
CREATE TABLE #StoredProcedures
(ID int IDENTITY (1,1),
 ProcName varchar(128) NOT NULL)

-- INSERT OUR LIST OF STORED PROCEDURES
INSERT INTO #StoredProcedures (ProcName)
	SELECT ROUTINE_NAME 
		FROM INFORMATION_SCHEMA.ROUTINES
	WHERE ROUTINE_NAME NOT LIKE 'dt_%' AND ROUTINE_TYPE = 'PROCEDURE'

-- Get the number of StoredProc's in the database
SELECT @COUNTER = MAX(ID) FROM #StoredProcedures

-- Iterate through the items
WHILE @COUNTER > 0
	BEGIN
		-- Get the name of the Object
		SELECT @spName = ProcName	FROM #StoredProcedures WHERE ID = @COUNTER

		-- Make the command  to execute
		SELECT @COMMAND = 'DROP PROCEDURE ' + @spName
		
		-- Execute the command
		EXEC(@COMMAND)

		-- Reduce the counter
		SET @COUNTER = @COUNTER - 1
	END

-- Cleanup the temporary table
DROP TABLE #StoredProcedures

SET NOCOUNT OFF
GO
There's probably a better way of doing this - asside from DROP DATABASE [DATABASE_NAME] (har-har!), but IWFM!!!

HOWTO: Drop all tables in a SqlServer database automajically with hidden stored proc sp_MSforeachtable!!!

Sometimes you just want to start fresh, clean slate, forget the mistakes of the past and just start out brand new. By this I mean for your SqlServer database - not real life or anything... although... How to do that when you dont have Enterprise Manager or SQL Server ManagerĀ  handy?

Easy! By using the special hidden MSforeachtable stored proc to retrieve the tables in the database and execute a command for each entry.

*BUT* BE WARNED!!! THIS IS NOT REVERSABLE. SO BE CAREFUL!
 -- EXEC sp_MSforeachtable @command1 = "DROP TABLE ?"
That will remove all the Tables in the database. You may need to run it a couple of times if there are any foreign Key's blocking a table from being removed. You can also use the MSforeachtable to iterate through tables and re-index or check how much space they are taking:
-- EXEC sp_MSforeachtable @command1 = "sp_spaceused '?'"
-- EXEC sp_MSforeachtable @command1 = "sp_MStablespace '?'"
Funky dory aye?

HOWTO: Changing the default browser in Visual Studio.NET

I've grown fond of Opera the last few years, it seems like even though i've firmly planted myself into the shoe's of Firefox I'm finding the continuously growing memory foot print a little hard to swallow at times (having to constantly restart Firefox isnt ideal no matter how much RAM you have), especially when your working with several Visual Studio instances. So I've resorted to using Opera, a lightweight finely tuned browser when working on a recent PHP->ASP.NET port for a project at work.

Question is, how *do* you make it the default browser in Visual Studio.NET? Its not as intuitive as you would have figured, but dead easy:
  • Right click on a ASPX page in your solution and select "Browse With..."
  • Click Add and find the browser you want (or if its already in the list ignore this step).
  • Select "Set as Default"
  • Thats it, click Browse and you'll be fine and dandy.
Sweet!

Steve Goabs Apologises for iPhone price reduction.

Nice way to start the morning, an open letter from the Saint to many, Steve Goabs of Apple Inc apologising for dropping the price of their "breakthrough product" (which doesnt support MMS or 3G) 2 months after release.

I guess all those fanboi's complaining had some effect. All those who queued for hours, travelled so many KM's to be the first to own an iPhone. Sucks if you *scored* an iPhone off eBay though. 1/3 of the price shaven off after 2 months... I cant count the number of times the prices have dropped after a few weeks of a product being released. Its how the world of electronics work, if you cant deal with it, dont bother buying it so early on in the game.

The new iPod Touch's however do look good.

LINUX: /bin/rm: Argument list too long - and how to work around it!

Came across an interesting problem today. My MailQueue was overloaded causing sendmail to go nuts apon a system reboot. (Load was insanely high!) so I figured i'd delete the pending mail in the following locations:
/var/spool/mqueue
/var/spool/mqueue-client

Delete em:
# rm  ./*
But alas I was greeted by:
/bin/rm: Argument list too long.
Say what? Just *how* many files are we talking about here?
# ls -l |wc -l
32832
Even worse for the other folder! Swwaaahoooiiiieeeh? Unfortunately telling the rm application to remove that many files are a little out of its boundaries, so how to fix it? Simple, take the find command and pipe it to rm instead like so (this also works if the there are spaces in the filenames):
# find . -print0 | xargs -0 rm
If you want to filter it (so only say 'dfl81*' files are deleted):
# find . -name 'dfl81*' -print0 | xargs -0 rm
I still havent looked at why there were so many emails in the queue. My guess would be the SVK mirror'ing I do from home to pickup changes in Mercury (our uni's SVN Repo).

COOL TOOL: TeraCopy transfering files across networks or local drives.

One of the most fustrating things about transfering files across the network in Windows is that if something breaks  or fails, the transfer process is stalled and you have to either copy that folder/file again or see what got copied and try and work from there. Then came along such tools as Advanced LAN Pump, which we could use to schedule or queue files to be transfered. When I first rolled out Gigabit around the house I used ALPump to measure how much throughput I got - ~55Mbs which is nice, the limitations being the HDD on the server! But a few months back I came across a better tool that hooks into Windows called TeraCopy.

Great thing about TeraCopy is that it replaces the standard File Copy handler in Windows (this is both a good and bad thing) which means if your transferring a bunch of files, TeraCopy will queue them for you so your HDD's or Network connection doesnt get throttled. Whats more, the author provides a 'Free for Home Users' copy which will suite most users. It will even queue files from local disks, or portable drives which helps with long transfers (HDD->USB Drive etc). Unlike Advanced LAN Pump though, TeraCopy seems to dynamically change the buffersize to accomodate for the files sizes.



If you do alot of transfering of files - especially useful in LANs - give it a go!

Ooops, I spent it as TerraCopy in the title:(