October 11, 2002

DevX - Software Development Resource

Debugging Variables Made Easy

At one time or another, all ASP progrmmers have used RESPONSE.WRITE to write out a variable on the screen, ensuring that the variable is passing correctly or has the correct

DevX - Software Development Resource

More Efficient LPad Function for Large Padding Lengths

function LPad(ContentToSize,PadLength,PadChar) { return GetRepeatedCharString(PadChar, PadLength -ContentToSize.length) + ContentToSize;}function GetRepeatedCharString(Char, Size) { if (Size < 1) return ""; else if (Size == 1) return Char; else return GetRepeatedCharString(Char, Size /

DevX - Software Development Resource

Generate a Script-name Independent HTML Form

This tip is useful for large, server-side scripts containing lots of functions/procedures that generate HTML forms. Say you’ve hardcoded the script name (for the same script) in the ACTION tag

DevX - Software Development Resource

Find the Encryption Algorithm Used in SSL Requests

Servlet 2.3 provides an API that finds the algorithm used a Web app’s SSL requests. The attribute “javax.servlet.request.cipher_suite” is provided to get the information.Here’s the code: String cipherAttribute = “javax.servlet.request.cipher_suite”;String

DevX - Software Development Resource

How to Trim a Method in Javascript

/** * Function that will remove the leading and trailing spaces. */function trim(str){ return( rtrim(ltrim(str)));}/** * Function that will remove the trailing spaces. */function rtrim(str){ re = /(s+)$/; return str.replace(re,