The Latest

DevX

The Beans Class

The standard Java library contains a host of valuable methods. Many of these are hidden away, such as Beans.isInstanceOf.This method belongs to the java.beans.Beans class. However, it’s an object version

DevX

Implement Property File Attributes in Real Time

Say you need to change the behavior of your Java application depending on some parameters read from a properties or ini file (like batchMode, debugMode, etc.). You want to turn

DevX

Loading from the Classpath

If your application includes .properties files or images and you want to load them without hard-coding their location, store the files in the class path. Classes are stored in archive

DevX

Do Not Use CreateThread() when Using C-Runtime Functions

When writing multithreaded applications in the Windows Environment, you have two options for creating new threads: the C-runtime function _beginthread (and _beginthreadex) or the WIN32 API CreateThread(). If the thread

DevX

A Power Function for Integers

Need a quick and dirty way to exponentiate integers? Or perhaps you are working on a number library of your own. This will work in all cases. templateTYPE power(TYPE x,

DevX

Validating the Data Type in a T-SQL Query

Using the ISNUMERIC() and ISDATE() functions, you can check the required column’s data type validity. If the column passes the data type validity check, it will return a 1. If

DevX

How to Fail in One Easy Step

t’s daunting to come up with a topic of interest to a large group of readers?and then to write about it well. I know it’s impossible to please everyone, but

DevX

Peek Into the Future of XSLT 2.0

xtensible Stylesheet Transformations, or XSLT, has received decidedly mixed reviews from developers. Although XSLT has many evangelists it has its detractors as well. Because of some concepts, such as static

DevX

Using the Volatile Keyword to Avoid Failures

When compiling a program, the compiler adds some optimizations that may cause your application to misbehave. For example consider the following code: // To avoid threads waiting on the critical

DevX

Using the Const_cast Operator

The const_cast operator takes the form: const_cast (expr) It is used to add or remove the “const-ness” or “volatile-ness” from a type. Consider a function, f, which takes a non-const

DevX

Select Case Enhancement

I have found the need to do multiple tests on dissimilar variables and objects with any failing test causing an action. Multiple embedded If…Then…ElseIf…EndIf statements are awful to look at

DevX

Sort Arrays Faster

When an array is declared as a type where each element occupies a lot of memory (such as a complex user-defined type), sorting the array can become unacceptably slow. To

DevX

Override the Err Object

Believe it or not, you can override VB Related Posts Unleashing Hyundai Ioniq 6 N: Electrifying PowerhouseFirst Date with Visual Studio 2015Biden administration considers downgrading marijuana classificationUse ngSwitch Directive to

DevX

Use Argument Arrays with CallByName

VB6 introduced a new built-in function, CallByName(), as a member of VBA.Interaction. It lets you reference an object Related Posts Get the Size of a File in FTP with C#Cisco

DevX

Use the Format Function for Regional Settings

Although the GetLocaleInfo API can retrieve just about any regional setting you need, VB Related Posts Getting to Know the Available Drives in the SystemRegulating Risky Marine Geoengineering TechniquesGo, Big

DevX

Copy an Array Faster, Redux

Simple is usually best. VB4 introduced direct assignment to Byte arrays, and VB5 later expanded that capability to include other array types as well. This code does the same thing

DevX

Lock Windows 2000 Instantly

Locking an NT workstation has never been easy. Windows 2000 has a new function, LockWorkStation, that can lock the machine instantly with a single API call: Private Declare Function LockWorkStation

DevX

Magine, a transposition algorithm

One of the cryptic methods that Nostrodamus used to conceal his writings from the authorities of the day was to transpose (mix up) names and words. For example, one name

DevX

GetSystemType – Retrieving the computer type

‘ Returns the system type, for example “X86-based PC” or “Power PC”‘ Requires a reference to System.Management and the respective ImportsFunction GetSystemType() As String Dim mos As New ManagementObjectSearcher _

DevX

GetPhysicalMemory – Retrieving the physical memory amount

‘ Returns the physical memory amount, in bytes’ Requires a reference to System.Management and the respective ImportsFunction GetPhysicalMemory() As Long Dim mos As New ManagementObjectSearcher _ (“SELECT * FROM Win32_ComputerSystem”)

DevX

GetDomainRole – Retrieving the domain role

Enum DomainRole As Integer StandaloneWorkstation = 0 MemberWorkstation = 1 StandaloneServer = 2 MemberServer = 3 BackupDomainController = 4 PrimaryDomainController = 5End Enum’ Returns the domain role’ Requires a reference

DevX

GetDomainName – Retrieving the domain name

‘ Returns the domain name’ Requires a reference to System.Management and the respective ImportsFunction GetDomainName() As String Dim mos As New ManagementObjectSearcher _ (“SELECT * FROM Win32_ComputerSystem”) Dim mo As

DevX

GetComputerModel – Retrieving the computer model

‘ Returns the computer model’ Requires a reference to System.Management and the respective ImportsFunction GetComputerModel() As String Dim mos As New ManagementObjectSearcher _ (“SELECT * FROM Win32_ComputerSystem”) Dim mo As

DevX

Compare Word Documents Through ActiveX in Visual Basic

ere’s a genuine “real-world” problem: a particular company has a Web-based intranet for their document and content management. This system stores many hundreds of documents. Some of these are on