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.
This code checks if a given string is a palindrome. Public Function IsPalindrome(strToCheck As String) As BooleanDim iForward As IntegerDim iBack As IntegerDim iMid As IntegerDim bPalindrome As BooleanIsPalindrome =
Instead of depending on the compiler to instantiate your template, youshould explicitly instantiate them using the following statement: template class vector; // for class instantiationtemplate int& vector::operator[] (int); // for
Beginning with SQL Server 2000, Microsoft added support for SQL-XML interoperability. They did this by expanding some statements that we all know
Memory is precious in Palm OS, so you can’t afford any memory leaks in programs. Therefore, it’s very essential to detect any memory leaks. To do this put breakpoints in
Beginning with SQL Server 2000, Microsoft added support to retrieve data from SQL Server databases by using an URL address. To do this, you must create a virtual root, that
Everybody knows that the WM_PAINT message is passed to a window whenever it needs to be painted. Usually, we code all of our painting instruction in the handler of WM_PAINT,
In order to increase the efficiency of your linear searching, add the item you are searching at the end of the list (either an array or linked list) and write
The C++ runtime library includes a heap manager (subroutines responsible for maintaining the heap). The heap manager does bookkeeping to keep track of which parts of the heap have been
This is a simple way to find out the word count in a comma delimited string: declare @mystring varchar(200)set @mystring=”vb,asp,sqlserver,html”select (len(@mystring)-len(replace(@mystring,’,’,”))+1) The following code will parse the delimited string: –variable
Debugging a multi-threaded program in Visual C++ may be difficult, especially when switching between multiple threads using the Debug/Threads menu. One efficient way to distinguish threads during debugging is to
If you find yourself constantly commenting and uncommenting bits of code during development, this tip could come in handy. Normally, you’d do something like this: #define /* #undef */ _FOObool
CRect, Csize, and CPoint classes all have default constructors. It would follow that they should initialize all members to zero, but they don’t! Because of this, the following function has
Normally, the Right() Function VB returns only the Length specified from the End. If you want to extract the Right portion from any index of the String you have to
Sometimes, while performing String operations, you may want to extract part of the string from the main string–from the StartPosition to the EndPosition specified. The problem with the Mid() is
Where NOT to use “_”:1. SQL stringsWhy? Because, during debugging, you may have to modify a SQL string because you need to add a field, or remove a field, correct
Instead of working with text as strings and using the mid, left, and right functions, it’s better to convert the string to an ANSI bytearray. This can be done with
Static blocks or static initializers don’t exist within a method body.The static block code executes only once when the class is loaded. The static block is mainly used to load
The following are the http properties for the HttpURLConnection:1) http.proxyHost (default: ) – defines the Proxy through which the request should be routed. 2) http.proxyPort (default: 80 if http.proxyHost specified)-
A common operation in many applications requires you to concatenate a list of objects (usually strings) and separate them by commas, or some other character for display (the opposite of
Stack trace is a collection of methods and objects that lists from the origin of the exception to the point where the nested call begins. class StackTrace{ StackTrace() { divideByzero();
In Java, a class can have zero or more blocks outside any methods that are labeled static and are surrounded by curly braces. These blocks, also known as static initializers,
The java.lang.Class provides the forName() method which allows you to load a class dynamically. The argument to this method is the fully qualified name, i.e., the complete name of a
ith the help of today’s Web integration and GUI tools, it’s now much easier to build reports without any programming. SQL provides GROUP BY and ORDER BY clauses, to collate
While any Windows user could pop up the Calculator accessory to perform any type of math calculations, it would be great if you could offer him or her the capability
Here’s a simple but effective trick to ensure that the column of a ListView control is wide enough to display the entire string you’re assigning to the column title or
A little-known feature of the RichTextBox control allows you to insert an OLE object in the text being edited. However, you can do so only programmatically, by adding an element
If you have Internet Explorer 5 or later version, you can use an API call to download a file from the Internet withouth displaying any message box. The following code
When building an ActiveX control, you can set a default property or method using the Procedure Attributes dialog box, after clicking on the Advanced button. However, if your default property
‘ Clear the Run History’ Notes:’ 1) This routine requires the DeleteRegistryKey and CreateRegistryKey ‘ routines,’ you can find them in the CodeBank’ 2) The MRU list is kept available
inked lists are perhaps the most widely used data structure. Yet writing a linked list from scratch is an arduous task. In a previous 10-Minute Solution, you learned how to











