devxlogo

We are an award-winning tech entrepreneurship website where trusted experts can provide value globally.

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.

devxlogo

Trusted for 26 years

Over 30K Articles

1M+ Readers

Expert-reviewed

10K+ Tech Terms

As seen in:

microsoft logo
business_insider_logo
wired_logo
berkley
arstechnica_logo
hackernoon

The Latest

RestoreDatabase – Restoring a SQL Server database

‘ Restore the specified database.’ Note: requires Imports System.Data.SqlClient” Example:’ Dim connString As String = “server=(local); user id=sa; password=; ‘ Database=master;”‘ Try’ RestoreDatabase(connString, “MyTestDB”, “D:MyTestDbBackup.bak”)’ Catch ex As Exception’ MessageBox.Show(ex.Message)’

Calculated columns that refer to relationships

The DataSet is a container of multiple DataTables, and it allows to create parent-child relationships between two tables, as shown below: ‘ create a relationship between the Categories and the

Choosing the Right swap() Implementation

wap() is one of those tricky algorithms that has several implementations, each of which offers its own advantages and disadvantages. In the following sections I will show why familiarity with

GetSystemUpTime – Retrieving the system’s up time

‘ Returns a TimeSpan for the interval of time the system has been up.’ EXAMPLE:’ Dim ts As TimeSpan = GetSystemUpTime()’ Console.WriteLine(String.Format(“The system’s up time is: {0} days, {1} ‘

DecodeBase64 – Decoding a string from base64

‘ Returns the input string decoded from base64Private Function DecodeBase64(ByVal input As String) As String Dim strBytes() As Byte = System.Convert.FromBase64String(input) Return System.Text.Encoding.UTF8.GetString(strBytes)End Function

EncodeBase64 – Encoding a string to base64

‘ Returns the input string encoded to base64Private Function EncodeBase64(ByVal input As String) As String Dim strBytes() As Byte = System.Text.Encoding.UTF8.GetBytes(input) Return System.Convert.ToBase64String(strBytes)End Function

Set Attributes in a Servlet Request

Usually, you set attributes in a session and the attributes are available through out the session. If you want to limit the scope of an attribute to just a request,

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

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

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

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

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,

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

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

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

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

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

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

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