February 21, 2007

Improved JavaScript Error Handling

To supress JavaScript error messages, simply place this snippet in the Head section of your Web page: &ltSCRIPT language=”JavaScript”&gtfunction dontshowerrormessages() {return true;}window.onerror=dontshowerrormessages; An even better method is to use the following code: function betterhandler(description,pagename,lineno){ alert( ‘An Error occurred! ‘ +’ Description: ‘+description +’ Page Name: ‘+pagename +’ At Line :

Using CreateProcess Instead of _tspawnl to Spawn Programs

If you use _tspawnl when spawning a new process, all the handles from the creating process are inherited by the created process. This can have undesirable side effects?especially if it’s not what you intended. For example, if the created process inherits an open file handle, the creating process may have

Using the ElementPath Capability in SQL Reporting Service 2005

When you use an XML data provider as a data source in SSRS, the query text generally consists of mainly of SOAPAction or MethodName tags. This also allows you to add an ElementPath tag which precisely filters the data you need to build a report. However, this method increases your

Building Absolute/Relative URIs

This tip show you how to build absolute/relative URIs by using the java.net.URI methods. Building an absolute URI: try{ URI uri_absolute=new URI(“http://www.java.sun.com/”); URI uri_relative=new URI(“index.html”); URI uri_absolute_result=uri_absolute.resolve(uri_relative); System.out.println(uri_absolute_result); }catch(URISyntaxException e) {System.out.println(e.getMessage());} The result: http://www.java.sun.com/index.html Building a relative URI: try{ URI uri=new URI(“/docs/imagini/mare/”); URI uri_relative=new URI(“eforie/discoteca.jpg”); URI uri_relative_result=uri.resolve(uri_relative); System.out.println(uri_relative_result); }catch(URISyntaxException e)

Build Date Generators and Manipulate Date and Time Data in SQL

ometimes you need to generate sequences of date and/or time values. For example, take a data warehouse that has a multidimensional structure and stores the measures and dimensions in fact and dimension tables. Since one of the dimensions is almost always the time dimension, you would need to generate the