devxlogo

The Latest

URLEncodeEx – Apply URL encoding rules

‘ Applies URL encoding rules to the specified Text and returns the result’ (similar to Server.URLEncode)Public Function URLEncodeEx(ByVal Text As String) As String Dim abytTokens() As Byte Dim lngTotal As

URLDecodeEx – Decodes an encoded URL

‘ Decodes URL encoding applied to the specified Text and returns the resultPublic Function URLDecodeEx(ByVal Text As String) As String Dim abytTokens() As Byte Dim lngTotal As Long Dim lngCount

GetIEStartPage – Read IE start page

‘ Get the IE start page’ Note: requires the GetRegistryValue routine, you can find it in the CodeBank’ Example:’ MsgBox GetIEStartPagePublic Function GetIEStartPage() As String Const HKEY_CURRENT_USER = &H80000001 GetIEStartPage

HTMLDecodeEx – Decodes HTML encoded strings

‘ Decodes HTML encoding applied to the specified Text and returns the result’ Optionally specify if we encoded a HREF link and the character’ used for encoding – the default

Get the canonical name of a file

In many cases you may need the canonical (or absolute) name of a file, for example when you need to compare two relative file names (relative to the current directory

Borland Eyeing the Chasm Between Java and .NET

ugust 8, 2001?If one envisions Sun Microsystems and Microsoft as, oh, I don’t know, peevish comic book villains, each sticking dogmatically by their own proprietary weaponry in the fight for

Use StringBuffer for Speedy Servlet Output

Servlets often need to display a lot of HTML. One way to do this is with println() commands and String concatenation. However, String concatenation is an expensive process. It is

Avoid Instantiability of Utility Classes

There are times when almost every programmer comes up with a class that consists only of public static methods. Usually these are some kind of utility classes, which do not

Appending Data to an Existing File

There is a constructor in the java.io.FileOutputStream class which can be used to append data to an existing file. Usage:public FileOutputStream(String name, boolean append) throwsFileNotFoundExceptionwhere:name – the file nameappend –

Determine if the Current Running Application is Active or Not

‘ API declaration’Private Declare Function GetForegroundWindow Lib Related Posts Collaborative Peer Code Review with GitColonyUsing CQRS for Event SourcingHow To Facetime iPhone To AndroidUse ProtocolBuffer Serialization to Increase EfficiencyFormatting Global

How to Make a Swing Component Appear and Disappear

Here’s a very short bit of code that will make a StatusBar hide or show, accordingly: public void viewStatusBar() { /* Hide or show the statusbar */ StatusBarPane().setVisible(!(StatusBarPane().isVisible()));} Just have

Encapsulate Member Objects

Objects frequently contain member objects that need to be exposed.Often, these are not correctly encapsulated, which could lead to problems that are difficult to track down.Consider a Circus object, which

Communicating With XML Files

Start a new VB project. Add a form (or use the default one). Then, add these four buttons on the form: create (cmdCreateFile), read (cmdRead), append (cmdAppend), and delete (cmdDelete).

Avoid Hungarian Notation in Public Interfaces

Most coding standards recommend the use of Hungarian variable naming, which uses prefixes to indicate the variable’s type. However, these naming conventions usually should not be used in a component’s

Getting MAPI entryID’s From Outlook Folders

This tip is useful if you do Outlook automation with user created Outlook folders. These folders cannot be accessed by the GetDefaultFolder method usually employed in automation techniques. This snippet

HTML Doc Add-in

This handy add-in creates code headers in VB source and HTML documentation for VB projects. When you run HTML Doc the first time, it will create all these headers with

Create Your Own VB Add-Ins

Why should you createAdd-Ins? We programmers always feel that we are short of several features whileworking with Microsoft tools, it seems that Microsoft hasn’t yet developed thetool we needed. In

Use Refresh, not DoEvents

The DoEvent statement should be used only to give other portions of your program to be reactive to the end user’s actions. Instead, many VB developers use it to force

Delete a folder and all its subfolders

The RmDir command can delete a directory only if it doesn’t contain files or sub-directories. If the directory you want to delete does contain other files or, worse, subdirectories it

Swap strings the fast way

Consider the usual way of swapping two strings: Dim s1 As String, s2 As StringDim tmp As String’ initialize the strings s1 = String$(1000, “-“)s2 = String$(1500, “+”)’ do the

Serializing and Deserializing Arrays

Suppose you want to store the movements of a chess game in a file so that when the program terminates, the users can resume it later from the same point.

Checking the Current CLASSPATH Programmatically

Often, it is helpful to find the current classpath. This can be done from within a Java program by using the following code: System.out.println(System.getProperty( Related Posts HTML Input Placeholder AttributeLabour

What Is a Thunk?

The term thunk dates back to the days of the antediluvian Algol programming language and has stuck since then. A thunk is an invisible and parameter-less function or procedure that

DLLs and Dynamic Memory Allocation

Dynamic linking — either in the form of shared libraries in Unix or Windows DLLs — is not defined by standard C++. However, this is a widely used feature among