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.
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
Many applications can benefit from using lazy processes or running routines in the background inside a single VB application. Designing a TaskThat was the fifty cent tour of what the
‘ convert from decimal to hexadecimal’ if you pass the Digits argument, the result is truncated to that number of ‘ digits” you should always specify Digits if passing negative
Function IsValidEmail(ByVal Value As String, Optional ByVal MaxLength As _ Integer = 255, Optional ByVal IsRequired As Boolean = True) As Boolean If Value Is Nothing OrElse Value.Length = 0
‘ Keep the first argument in the range [lowLimit, highLimit]’ If the value is adjusted, the fourth (optional) argument is set to True” This function works will all basic data
‘ Return the position of the argument in a list of values’ or zero if the argument isn’t included in the list’ It works for both regular values and for
‘ convert from hexadecimal to decimalFunction HexToDec(ByVal value As String) As Long ‘ we just need a call to the Convert.ToInt64 static method Return Convert.ToInt64(value, 16)End Function
// this Command will return the server Names running on local NetworkExec Master..xp_CmdShell ‘osql -L’OUTPUT Eg:Servers: Server1 Server2 Server3 Server4 Server5
Include the following definition: #include The function definition goes like: JNIEXPORT jboolean JNICALL MethodName( JNIEnv *env,/*env variable: must*/ jstring functionId,/*String variable*/ jobject objectId/*Object variable*/){ const char *str = env->GetStringUTFChars( functionId,
There are several cases where you may write algorithms only to find missing numbers in a sequence. There is an efficient way to do this. Let’s say you have a
You can read a key from a particular path in registry by using the RegQueryValueEx function. The following piece of code reads a particular key under HKEY_LOCAL_MACHINESoftwareDevx: void GetKeyValue(char *key,
Here’s the code: public class IncreaseCounter { public static void displayURL(String url) { boolean windows = isWindowsPlatform(); String cmd = null; try { if (windows) { // cmd = ‘rundll32
‘ Returns the date that Rosh Hashanah begins’ for the requested year. It is important to note that’ Rosh Hashanah is based on the Lunar cycle so the Holiday’ actually
ava is no longer the new kid on the block. Its original promises are no longer “wait and see” propositions. We have waited. We have seen. And though I could
In other words, you don’t want anyone to be able to pass the object of your class “by Value” to a function.To achieve this, override the copy constructor of your
Threads can hang indefinitely if one thread is Entered in a critical section but returned without Leaving it. There is a simple solution to make sure that this doesn’t happen.
The following is a way to programatically set the text in the combo box without adding to the list box portion.When using a combo box, if the style is CBS_DROPDOWN,
Exception handling can be a real chore
The C++ language provides a single global namespace. This can cause problems with global name clashes. For instance, consider these two C++ header files: // file1.hfloat f ( float, int
‘ convert from any base to decimal’ BASE can be in the range 2-36Function Any2Dec(ByVal otherBaseNumber As String, ByVal base As Integer) As Long Dim digits As String Dim digitValue
‘ convert a positive number to any base’ BASE can be in the range 2-36Function Dec2Any(ByVal number As Long, ByVal base As Short) As String Dim index As Integer Dim
The Convert class offers a few static methods that let you easily and quickly convert a binary, octal, or hexadecimal number(stored in a String) into the equivalent Byte, Short, Integer,











