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

Effective Usage of Variables in Loops

For effective usage of variables in loops, it is advised to create variables outside of loops and use them in the loops. This helps save lot of memory and makes

Find Duplicates in Your Table

To find duplicates, use a query similar to the following: Select * from TABLE1 a where id ( select max(id) from TABLE1 b where a.Field=b.Field);

Calling Date.setTime()

account.changePassword(oldPassword, newPassword);Date lastModified = getLastModified();lastModified.setTime(System.currentTimeMillis()); The above code updates the last modified date of the password and wants to avoid creating a new Object, but uses instead the setTime method

Using the STRING_SPLIT Function in SQL Server

SQL Server 2016 provides a way to split a string that is concatenated with a separator. For example: SELECT VALUE FROM STRING_SPLIT(“John|Mary|Dohe”, “|”) would return the values John, Mary and

Understanding the GRANTS for the Current User in MySQL

The command “SHOW GRANTS” will display the privileges that the current user has. Command: SHOW GRANTSSample output:+——————————————————————————————————————+|Grants for dbuser@% |+——————————————————————————————————————+| GRANT ALL PRIVILEGES ON *.* TO ‘dbuser’@’%’ IDENTIFIED BY PASSWORD

Handy Function to Test for Email Validity

Use this nifty function to check the validity of an email address. CREATE FUNCTION [dbo].[fnCheckEmail](@Email VARCHAR(255)) RETURNS BIT AS BEGIN DECLARE @ValidEMail BIT IF @Email IS NOT NULL SET @Email

Seamless Upgrade to Angular 5

In this article we’re going to explore Angular 5 up-gradation and Changes that would be encountered during the migration. Take a look at the features that make Angular 5 a great option for your development projects.

Setting the Log Level in Java

We have been using logging in Java and different code requires different levels of logging. Hence these Levels will come in handy. Code sample: import java.util.logging.Logger;import java.util.logging.Level;public class JavaLogger{ public

Assuming Char Represents One Character

Do not assume char represents only one character: “uD83DuDC31”.length() == 2 The escape sequence represents the Unicode code point 0x1F431 in UTF-16 as 2 chars. So even though this is

Creating a JSON Object Using Java

JSON is being widely adapted by the industry for easier transformation of data. Using the json-simple-1.1.1.jar in the classpath will provide you with the basics of JSON and its functionality.

Load JavaScript Asynchronously on a Web Page

By default, JavaScript script files are loaded synchronously in the page execution and thus are bound to slow down the page. You can asynchronously load the scripts by simply adding

A Better Way to Achieve Random File Access

RandomAccessFile raf = new RandomAccessFile(f, ???r???);for (???) { raf.seek(pos); byte b = raf.readByte();} Despite its name, the java.io.RandomAccessFile class is not very convenient for accessing files in a random-access manner,

How to Avoid Cloning in Java

Cloning is the easiest way of copying a class. With this, however, you also have all properties being passed on to the cloned class, which probably is a security hassle.

How to Restrict Input Text to Characters in a Text Box

Use the KeyPress event to check for the keys pressed. See below for an example: private void textFirstName_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if ( !( char.IsLetter(e.KeyChar) ) ) { e.Handled

Understanding the Collection.removeIf Method

Collection.removeIf is a very powerful method that acts on a condition. In the code sample below, there is a list which has few elements in it and the condition is

How to Include All Values in a Date Range

Sometimes when doing a search for data between date ranges, some of the data is omitted because the search doesn’t include the whole last day’s values. Here is a small

Explore the Difference Between ID and Class

These two selectors often confuse beginners. In CSS, the difference between them is that the class is represented by a dot “.”, while ID is represented by a hash “#”.

Understanding the Current Stack Under Execution

Most of the time, you probably want to understand the flow to solve certain problems. Java provides an easy approach to knowing the current stack. Code snippet: public class DumpStack{

Format the Console.Write Responses

We use string.format to format the data written to the console using the console.write or console.writeline commands. However, it isn’t indented well to make it readable. C# allows you to