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

DateDiff_BIG Function

SQL Server 2016 introduces the DATEDIFF_BIG function that allows you to obtain date differences between larger date ranges. DateDiff_Big returns bigint. Here is a small example: SELECT DATEDIFF_BIG(SECOND, ‘19000101’, ‘20180403’)

Object Arrays are so Flexible

/*** @returns [1]: Location, [2]: Customer, [3]: Incident*/Object[] getDetails(int id) {… This sort of passing back values from a method is error prone; it is recommended to declare a small

Using Swagger to Document Your ASP.NET Web APIs

Web APIs are pretty useful to share data. One of the most common problems faced while consuming APIs is the lack of documentation and testable features. Swagger bridges that gap

Understanding the DAYOFWEEK Function in MySQL

You can easily find the day of the week for a given date in MySQL. The day starts with 1 (Sunday), 2 (Monday) and so on. Command: SELECT DAYOFWEEK(‘2018-02-20’); Expected

Display the Contents of a Stored Procedure

A trigger is a stored procedure that runs automatically when various events happen (update, insert, delete, etc.) To display the contents of a Trigger, use a query similar to the

Relying on the Default TimeZone

Calendar calendar = new GregorianCalendar();calendar.setTime(date);calendar.set(Calendar.HOUR_OF_DAY, 0);calendar.set(Calendar.MINUTE, 0);calendar.set(Calendar.SECOND, 0);Date startOfDay = calendar.getTime(); The code above calculates the start of the day (0h00). The first mistake is the missing millisecond field of

Find the TLS Version a Vendor Supports

Transport Layer Security (TLS) is a security protocol that allows for secure Internet communication. TLS has various versions and you will need to know whether a particular vendor supports the

Understanding Memory Availability and Usage

There are times when we might be interested in knowing the memory usage of our application. The Runtime class in Java has various methods to help with that. This data

Open Last Closed Browser Tabs in Chrome

At times, our machines restart due to a patch or when the browser crashes and we are not able to bookmark or remember the windows that were open. This can

Replacing Strings in Your Output

declare @SQL VARCHAR(MAX) = ‘String to Replace’set @SQL = REPLACE(@SQL, ‘)’, ‘Replacement String’)select @SQL

Modifying Setters In Java

The code below eliminates spaces at the beginning or end of a name entered by the user, it tries to remove the spaces inside the setter method of a bean.

Commands to Backup and Restore Data onto a New Database

Command to backup: mysqldump databaseName backupFilename.sql Where mysqldump?is the command, databaseName?is the name of the database and backupFilename?is the name of the file in which the data will be backed

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