Monday, July 31, 2006

Snippet://Regex/URL

https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?

Tuesday, July 18, 2006

MMC cannot open the file "blah blah"

My laptop running Windows 2003 R2 server developed a problem where I can't use any of the admin tools snap-ins lije Services or Event Viewer or IIS or SQL Server Console. The error I get is:

MMC cannot open the file C:\WINNT\system32\eventvwr.msc. This may be because the files do not exist, is not an MMC console, or was created by a later version of MMC. This may also be because you do not have sufficient access rights to the file.


After a bit of Googling, the solution was simple:
RUN: regsvr32 C:\Windows\system32\msxml3.dll (as admin)

Saturday, July 15, 2006

Snippet://SQL Server/Change Password

To change a password in SQL Server, use the following stored procedure

sp_password [ [ @old = ] 'old_password' , ]
{ [ @new =] 'new_password' }
[ , [ @loginame = ] 'login' ]

Friday, July 14, 2006

ColdFusion SQL Anamolies

Below are a list of anamolies (whatever that mean) regarding use of SQL in ColdFusion. Knowing these anamolies will make your life easier while developing ColdFusion. I didn't know them and wasted a whole day trying to figure out why my code didn't work.


  • ColdFusion doesn't have null. It only has empty string. SQL has both. When CF reads a null SQL field the result is an empty string. When CF reads a empty string SQL field the result is an empty string too.

  • Putting SQL in variable and running can be useful for debugging. But single quotes cause problems. Use preservesinglequotes(#QueryString#) function to fix this.

  • Convert SQL Date to string before retrieving by ColdFusion SELECT CONVERT(VarChar(10), MyDate, 10) From Mytable

  • For Null aggregate, use SELECT TotalCost = Total + ISNULL(ExtraCost, 0.00)

  • You do a query SELECT * FROM tablename and you want your code to automatically know the column names. Use the ColumnList variable of the query. PS there are also hidden query variables for RecordCount, CurrentRow and ExecutionTime

  • Say I've got a record set of 20 items and I want to access column foo in row 10. Here is the code to do that as an array. RecordSet.foo[10]

  • Check if table exists
    select name from sysobjects

Monday, July 10, 2006

ColdFusion MX

Buh Humbug!

I've been working on a project for past 3 months where in phrase 2 of the project I had to design and develop an ASP.NET 2.0 solution. After 2 months of development work, I requested the client IT department to migrate the solution to the staging environment for system testing.

This is when they got back to me saying they changed the corporate standard from ASP.NET to ColdFusion about a month ago, so all new projects need to be in ColdFusion. And umm.. didn't I get the memo.

Now I need to redo 2 months worth of work from ASP.NET to ColdFusion while learning ColdFusion at the same time.

Buh Humbug!

Tuesday, July 04, 2006

The Network Is The Computer

Today I had a discussion about Scott McNealy and his 'way ahead of time' vision about 'the Network is the Computer'. Later, I googled what his latest vision is. Looks like its still the same. But now he can prove it.

Recently, he critisized Apple's iPod in The Register. McNealy said,
There's a pendulum thing where stuff is on the client side and then goes back into the network where it belongs. The answering machine put voicemail by the desk, and then it went back into the network. Your iPod is like your home answering machine. I guarantee you it will be hard to sell an iPod five or seven years from now when every cell phone can access your entire music library wherever you are.


Scott is way off base here. Five or seven years! Motorola's already selling cell phone with iPod technology in it. Nokia N91 has 4GB drive to store mp3. Sony has W900 with memorystick to store mp3. 3G can stream song and movies and TV. Five or seven years! It's already happening. OMG Scott lost his soothsayer tongue!

Saturday, July 01, 2006

Crappy Free Apple Quicktime Movie Player

I just reformatted my laptop and reinstalled all my software. This is a ritual I perform after every semester (meaning twice a year). It lets me purge all the crap I installed during the semester in order to work on assignments. And also have the latest updates to all software. However, todays ones didn't go smoothly. Apple's to blame.

Apple just released a new version of Quicktime 7.1 for iTunes. The new update doesn't work with Windows 2003 R2. The error message during installation is
Error in Installation (QT error -3). It breaks iTunes and all other software dependant upon it such as Adobe AfterEffect.

Yeah, nothing like having something $2000 worth of software/hardware crippled by a free movie player...


After surfing the internet, I found the following solution which fixed the problem:

* Install iTunes 6 bundled w/ QT 7.1
* Watch it fail w/ the -3 install code
* Try the unistall, it'll fail
* Remove the QuickTime folder
* Delete the "QuickTime.qts and QuicktimeVR.qtx" from \system32
* For good measure, delete all QuickTime registry entries
* Use the QT 7.04 standalone installer, it'll work now
* Use iTunes and sigh deeply that this didn't work two hours ago.

QT 7.04 can ve found at Apple Quicktime 7.04