
Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.
While it may seem logical to store a result in a variable just to use it as an argument to some function, sometimes it may be better to pass the
This is useful in a Web-based Photo Gallery kind of application, where you need to automatically generate multiple sizes of the same image. class ThumbnailGenerator { public void generateThumbnail (String
If you have a method into which you pass a String parameter that you compare with another string then: void foo( String str ){ String CONST_STR = “bar”; // DON’T
To create a file that your IE browser will recognize as XML, simply place these two lines at the top of your ASP page. IE will view it as an
A field gains focus when the user clicks inside the text box, and the focus is lost when the user clicks outside the box, anywhere on the page. You can
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
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 /
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
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
/** * 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,
The DataReader is the ADO.NET counterpart of the forward-only, read-only recordset in classic ADO. For this reason you never know how many rows the DataReader is about to return. In
This VB6 class contains three methods for querying the name and group of the current Windows NT user: IsAdmin (true if the user is an Administrator), IsNTGroupMember (true if the
‘ create and return a DataAdapter over an open SqlConnection’ and initialize its delete, insert, and update commands” CN is the SqlConnection object’ SQL is the SQL Select statement to
‘ create and return a DataAdapter over an open OleDbConnection’ and initialize its delete, insert, and update commands” CN is the OleDbConnection object’ SQL is the SQL Select statement to
‘ return a DataReader over a SqlConnection” CONNSTRING is the connection string’ SQL is the SQL Select statement to be executed” the connection will be automatically closed when the DataReader
‘ update a data source through a DataAdapter’ ‘ DA is the OleDbDataAdapter or SqlDataAdapter object’ DT is the DataTable to be updated’ if USETRANSACTIONS is True, all rows are
‘ return a DataReader over a generic Connection” CN is the OleDbConnect or SqlConnection object’ SQL is the SQL Select statement to be executed” if closed, the connection will be
‘ return a DataReader over an OleDbConnection” CONNSTRING is the connection string’ SQL is the SQL Select statement to be executed” the connection will be automatically closed when the DataReader
If you’re building a project with multiple similar forms, it’s nice to be able to cut-and-paste controls from one form to another. However, in VB6, you can’t do this for
This VB6 add-in provides you a handy project management console that helps you to track the bugs and pending tasks of the source code. You can mantain the list of
‘ get the text enclosed between two Delimiters” it advances Index after the close delimiter’ Returns “” and Index = -1 if not found’ search is case sensitive’ ‘ For
Here’s a quick-and-dirty method to determine whether a string contains only uppercase characters ‘ the string to test is in the SOURCE variableIf System.Text.RegularExpressions.Regex.IsMatch(source, “^[A-Z]+$”) Then Console.WriteLine(“Uppercase string”)End If If
Here’s a quick-and-dirty method to determine whether a string contains only lowercase characters ‘ the string to test is in the SOURCE variableIf System.Text.RegularExpressions.Regex.IsMatch(source, “^[a-z]+$”) Then Console.WriteLine(“Lowercase string”)End If If
When installed, this add-in adds an entry to the right-click menu in VB code window. You can then select or right-click on opening parenthesis or quotation mark or VB keyword,
ore than a year has now passed since I wrote my book (.NET Enterprise Design with Visual Basic .NET and SQL Server 2000[1]. The book discusses solutions to common design
‘ Returns True if a string contains only uppercase charactersFunction IsStringUpper(ByVal sText As String) As Boolean Dim c As Char For Each c In sText If Not Char.IsUpper(c) Then Return
‘ Returns a Hashtable whose keys are the unique words in a source string’ and whose elements are the number of occurrences of each word” Example:’ ‘ Dim de As
You can easily add a link in your ASP and ASP.NET pages that, when clicked, runs the default mail program (e.g. Outlook) and allows the user to send a message
‘ split a string, dealing correctly with quoted items” TEXT is the string to be split’ SEPARATOR is the separator char (default is comma)’ QUOTES is the character used to
‘ Returns True if a string contains only lowercase charactersFunction IsStringLower(ByVal sText As String) As Boolean Dim c As Char For Each c In sText If Not Char.IsLower(c) Then Return











