The Latest

Displaying Date Time with Reference to Time

There are lot of .NET helper assemblies that help you represent datetime in more readable formats, such as yesterday, 5 minutes ago, and so on. One of the libraries that

Converting a Date to a Certain String Format

The format() method from SimpleDateFormat class helps to convert a Date object into certain format String objects by using the supplied pattern string. Date today = new Date();SimpleDateFormat dateFormat =

Using the HASHBYTES Function in SQL

The HASHBYTES?function returns the MD2, MD4, MD5, SHA, SHA1, or SHA2 hash of a string. The next example returns a SHA1 hash value of it the string that was input.

How to Kill a Long-Running Process

You can use HttpResponse’s IsClientConnected property to figure out if the connection is still alive. Based on the value, you can kill a long-running process if the client is not

Knowing the Sign of a Given Number in MySQL

For a given number, it may be necessary to know the sign of the number for computation purposes. If it is positive, zero or negative, you may have respective case

Concat a Series of Strings in SQL Server 2017

SQL Server 2017 provides the CONCAT_WS function that allows you to concat a series of strings with a separator. Related Posts Germany Considers Limiting Chinese 5G TechUnderstandng Objects.deepEqualsiFOREX Keeps You

Pull Web Page Results into Excel

Go to Data Menu, choose the “From Web” option under the “Get External Data” section. Put a valid web page address, and click on “Import” button at the bottom. It

Know if LIKE Results are True or False

MySQL is capable of returning the result of a LIKE directly in the result set itself. For example, if you use a wildcard character in a query such as below,

Usage of Ordinal in Enum

The ordinal() method on the enum returns the constant. In other words, you can assume this to be the same as index and similar to arrays the index starts with

Object Casting in Java

In Java, objects can be cast explicitly and implicitly: implicit casting happens when the source type extends or implements the target type (casting to a superclass or interface). explicit casting

Creating Temp Files Using Java

At times, you need to create temporary files to perform certain actions. The following code segment illustrates the same: import java.io.*;public class CreateTempFile{ public static void main(String args[]) { CreateTempFile

Calculate the Difference Between Two LocalDates

Use LocalDate and ChronoUnit: LocalDate date1 = LocalDate.of(2018, 8, 10); LocalDate date2 = LocalDate.of(2018, 8, 30); As long as the method between of the ChronoUnit enumerator takes 2 Temporals as

Get all the IP Addresses to Which a Device is Exposed

At times, your device can be exposed using multiple interface cards. The following code sample will help identify various interfaces and the related IP configuration available on them. import java.net.*;import

Convert an Array of Strings to a List

The java.util.Arrays class has an asList method to convert the argument array into a list. This will be handy when there are large amounts of information that you need to

Using Spliterator to Split the Contents of a List

Instead of just traversing a list, this is a newer way of splitting and then iterating the list: import java.util.Arrays;import java.util.List;import java.util.Spliterator;public class UsingSpliterator{ public static void main(String args[]) {

Build HTML Tables with Tableizer

Tableizer is an external app that is great for building HTML tables out of data, using existing Calc or Excel spreadsheet templates. You only need paste your cells into the

The Right Way to Do Insensitive String Comparison

We often do String.ToUpper()?on two strings to compare them. This introduces additional overhead on string allocation. It is better to use OrdinalIgnoreCase?instead, as shown below: bool CompareResult = firstString.Equals(secondString, StringComparison.OrdinalIgnoreCase);

Understanding Collections.reverse() in Java

A list with a set of values can be reversed using the reverse() method. import java.util.*; public class ReverseACollection{ public static void main(String[] args) { List dataList = new ArrayList();

Using Single Quotes in Java

The difference is visible when you use the single quote with the + sign. The char value is converted to the ascii value and then summed up. However, you have

How to Add MetaData

To be sure that you are seen on Google, and other search engine, searches, you should make sure that you have provided meta data about your website. Also, to make

Find Indices on a Table in MySQL

The following statement shows the indices on a table in MySQL. SHOW INDEX FROM ‘LogMaster’ Related Posts Adding a New Column in a Specific PositionStackanetes Combines OpenStack and KubernetesAsus Zenbook

Using StringJoiner to Join Strings

If you have multiple strings, you can use StringJoiner to join them efficiently. import java.util.StringJoiner;public class UsingStringJoiner{ public static void main(String args[]) { UsingStringJoiner usingStringJoiner = new UsingStringJoiner(); usingStringJoiner.proceed(); }