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

Handling Cumulative Totals in T-SQL

Suppose you have a table: select * from tblTestName Amount— ——A 10B 20c 40D 50E 30 The following single SELECT query can be used to calculate cumulative totals: –//////////////////////////////////////SELECT t1.Name,

Conditional Sorting in T-SQL

There may be certain situations where you have to sort character-based columns in a particular order.For example, Let us consider a table: –///////////////////////////////////SID Subject Marks— —— —–1 Physics 801 Chemistry

Use the Proper Combinations of New and Delete

The following code is bad: char* charpointer= new char[SOMECONSTANT];delete charpointer; // should have been delete [] charpointer; new and new[] are allowed to use different memory pools. The default new/delete

The Storage Type of Temporaries

A temporary object is destroyed at the end of the full expression in which it was created. Consider the following example: #include #include // for strlen()string s1, s2;int len=(s1+s2).c_str(); //

How to Set an Image as Background to a Frame

After all component settings, create an ImageIcon object with your desired image. Using this object, create a JLabel. Add the Jalbel to the lowest LayeredPane of the JFrame. Finally, add

Checking for Null After New (2)

Normally, you should not check for null after creating an object. MyObject o = new MyObject(); This check is not required in Java because ‘new’ is not allowed to return

Test for Alpha Characters Only, Part II

I have a much simpler form for the IsAlphaNum function: Public Function IsAlphaNum(ByVal sString _As String) As BooleanIf Not sString Like “*[!0-9A-Za-z]*” _Then IsAlphaNum = TrueEnd Function You can modify

Test for Alpha Characters Only

Although VB has an IsNumeric function, it has no IsAlpha function. Use this routine whenever you want to determine whether a character or string of characters is alphabetic (A-Z or

Sort and Reverse—Sort a ListView

This routine performs the standard column sorting on a ListView control found in many commercial applications, such as Windows Explorer and Outlook. Using this routine, the ListView sorts itself automatically

Using “Blank” Final Data Members

Blank finals are fields that are declared as final, but are not given an initialization value. Java allows the creation of blank finals, but, in all cases, the blank final

Counting Bits Efficiently

Sometimes you need to know the number of bits set in a word. I often see code to count the number set bits written as a loop, processing one bit

Using the Template Argument as the Superclass

When you need to add the same member function to several classes, you can use a template class, derived from its template argument. template class T : public P {public:

Finding the Time in Different Zones

These days, many enterprises exchange data using a request/response approach. This data typically contains the date and time information regarding when a request was generated/received or a response generated/received. If

Customizing Column Name and Width

SQL*Plus uses column names as default column headings while displaying query results. You can customize your own column heading and width with the help of following commands. To assign a

Improving Large Strings’ Performance

Certain applications make use of very long strings. For example, a single string may contain generated HTML pages, a chapter of a book, a textual database and so on. Usually,

Exception Restrictions when Overriding

When you extend a class and override a method, Java insists that the new method cannot be declared as throwing checked exceptions of classes other than those that were declared