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

Use MySQL for Calculations

At times, when you want to compute the result of a mathematical formula, you can use MySQL to do the task. It is a great tool for this. Here are

Check Whether or Not an IP Is Valid in C#

See below for a short function that validates a given IP address: public static Boolean ValidateIP(string inputIP){var ipParts = inputIP.Split(‘.’);return Int32.Parse(ipParts [0]) < 256 &&Int32.Parse(ipParts [1]) < 256&Int32.Parse(ipParts [2]) <

User Creation and Scenarios

Please understand that this USER named SRIDHAR is created without a password and is also dangerous. CREATE USER SRIDHAR Alternatively, you can use the code below to create with a

Selectively Expose CRUD Methods

When a repository interface should not be instantiated at runtime, it should be marked with @NoRepositoryBean annotation as follows: @NoRepositoryBeaninterface BaseRepository extends Repository { // CRUD methods that will not

Tip: T-SQL Performance–The * Operator

It is best to avoid using the * operator in your queries, use explicit column names instead. SQL Server scans through all column names and replaces the * operator with

T-SQL Performance Tip: The * Operator

It is best to avoid using the * operator in your queries, use explicit column names instead. SQL Server scans through all column names and replaces the * operator with

Split a Concatenated String with a Delimiter

Here is how to split a concatenated string with a delimiter and remove empty entries. public static void Test() { string concatenatedString = “,ONE,,TWO,,,THREE,,”; char[] charSeparator = new char[] {‘,’};

Understanding NULL in MySQL

NULL is a unique value. It represents a value that is not defined and that is not really equal to BLANK (”). While using it in queries, we need to

Avoid Jackson Lazy Init Exceptions

First, add the following dependency to your project (Maven): com.fasterxml.jackson.datatype jackson-datatype-hibernate5 ${jackson.version} Further, add the following bean: @Beanpublic Module datatypeHibernateModule() { return new Hibernate5Module();}

Tip: T-SQL Performance–Owner or Schema Name

In order to improve your queries’ performance, you should always include the owner or schema name of an object by including its prefix before an object. Otherwise, the SQL Server

T-SQL Performance Tip: Owner or Schema Name

In order to improve your queries’ performance, you should always include the owner or schema name of an object by including its prefix before an object. Otherwise, the SQL Server

Finding the Mime Type of a File

Finding the MIME type of a file is useful when you want to perform certain actions. PS: I have placed a file named nature.jpg in the folder /home/sridhar before executing

Convert Hex to RGB in C#

The .NET System.Globalizaton’s NumberStyles has a parameter called AllowHexSpecifier that helps us to replace a hexString with RGB color. public static Color HexToColor(string hexString){ //replace # occurences if (hexString.IndexOf(‘#’) !=

Using REGEX Case Sensitively

Consider a table with data as below. + — — — + — — — — — — + — — — — — — +| ID | FIRSTNAME |

How to Annotate Class with Lombok

The first approach consists of annotating the class as below: @ToString@EqualsAndHashCode@Getter@Setter@RequiredArgsConstructorpublic class Foo { …} A shortcut for @ToString, @EqualsAndHashCode, @Getter on all fields, @Setter on all non-final fields, and

T-SQL FORCEPLAN

The SQL Server query optimizer processes a JOIN?in the same order as the tables appear in the FROM?clause, when FORCEPLAN?is ON. SET FORCEPLAN ON | OFF

Understanding Checksum Table in MySQL

CHECKSUM is a concept that is used to verify if the related files/contents are not tampered with or corrupted. On similar lines, MySQL provides CHECKSUM TABLE to verify the CHECKSUM

Use BitConverter Class to Convert a Byte Array

BitConverter’s ToString?method can be used to convert a byte array to a string. See below for an example: byte[] byteArray = ?string convertedString = BitConverter.ToString(byteArray).Replace(“-“,””);

Understanding the Unary Operator in Java

Java uses the symbol tilde (~) to represent the operator. The following examples are clearly illustrative of the use and outcome of this operator. Code sample: public class JavaUnary{public static

Validate Field Length

See how to validate the length of a field in Java via javax.validation.constraints.Size. We can do it as follows: @NotNull@Size(min=3, message=”Name must be at least 3 characters long”)private String name;

Set ARITHIGNORE to On

Setting ARITHIGNORE?helps to control whether error messages will be returned from overflow or divide-by-zero errors occurring during a query. SET ARITHIGNORE ON | OFF

Using the FileTime Class in Java

FileTime is a class in Java that helps you retrieve time-related information regarding files. One such method that we will see below is to get the modified time of a

Change Date to ISO8601 Date Format in C#

To change the date format in C#, just use the ToUniverstalTime and the overload formatting as below: String isoFormat = inputDateTime.ToUniversalTime().ToString(“s”) + “Z”;

Renaming a User in MySQL

There are instances in which a user is created according to current requirements. However, as the design progress and requirements freezes or changes, there is a possible need to change

Working with Long Integer Literals

Literals of type long are expressed by adding an L suffix. For example: 0L // The decimal number zero (type ‘long’)1L // The decimal number one (type ‘long’)2147483648L // The value

Explore a Few Math Functions in SQL Server

There are a number of math functions in T-SQL. Here are a few of them: SELECT SQRT(49) –Gives 7, Square RootSELECT PI() –Gives 3.14 …. PISELECT ROUND(15.30, 0) –Gives 15.

Setting Up a PROXY User in MySQL

In MySQL, a user is allowed to have a PROXY user. This means that a user can behave the same way as the original user with the same permissions as

Calculate the Distance Between Two Coordinates in C#

We can use the GetDistinaceTo?method of the GetCoordinates?class to determine the distance between two coordinates in C#. See below for an example: Using System.Device.Location;//double distance = 0.0;var aCoordinate = new

Disabling Binary Logs in MySQL

Logs often come in handy for problem resolution. However, there are times when there are too many logs that are not useful from the developer’s perspective. One such log is