
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.
Java 9 has added the concept of module via Java Platform Module System. In order to obtain the names of packages from a module we can do it as follows:

You can get the language ID with the following Select statement: SET LANGUAGE ‘French’SELECT @@LANGID AS ‘Language ID’
Use the “@ts-ignore” comment before the code and the compiler will ignore errors. // @ts-ignoreimport mathUnit from ‘mathjs/lib/type/unit’
The Math package is feature-rich and some of the methods are illustrated below. public class MathPkg{public static void main(String args[]){MathPkg mathPkg = new MathPkg();mathPkg.proceed();}private void proceed(){int positiveNum = 5;int negativeNum
It is difficult to maintain correctness in mutable objects, as multiple threads could be trying to change the state of the same object. This can lead to some threads seeing

Using dm_db_index_physical_stats?returns size and fragmentation information for the data and indexes of the specified table or view in SQL Server. USE master; GO — If Student.Name does not exist in
Use the GetTempPath?method to retrieve the temp file path in a machine. Please note that it also varies from one operating system to other. string tempFilePath = System.IO.Path.GetTempPath();
Swapping two numbers without using a new variable is always a good approach. This helps your application to be memory and performance oriented. public class Swap2Numbers{ int firstNum = 10;
Before Java 8, this was obtained as a String[] via TimeZone class: String[] zoneIds = TimeZone.getAvailableIDs(); Java 8 comes with a new approach via java.time.ZoneId class: Set zoneIds = ZoneId.getAvailableZoneIds();
You can write results of a SELECT query into a text file in the following way: master..xp_cmdshell ‘osql -S SERVERNAME -U USERNAME -P PASSWORD -Q “SELECT * FROM TABLE” -d
See an easy way to enumerate all the values. public enum WorkTypes{Remote = 0,Office = 1,Exempted = 2}foreach (WorkTypes workType in Enum.GetValues(typeof(WorkTypes)))Console.WriteLine(workType);

Starting with JDK 8, you can avoid NullPointerException by returning an Optional. For example, instead of returning null, this method returns an empty Optional: public Optional fetchShoppingCart(long id) { ShoppingCart

One good way to quickly diagnose System slowdowns is to make use of the sp_who2 SQL function in the following way: EXEC sp_who2 This helps identify High CPU Usage, Blocking
You might be interested to know where the current code flow is. The getMethodName() method in the getStackTrace(), if used as illustrated below, is really helpful. As always, specific use
Use the System.Environment namespace’s GetFolderPath?method to retrieve the path of a special folder. It can also create the folder if it does not exist. System.Environment.GetFolderPath(Environment.SpecialFolder.Recent, Environment.SpecialFolderOption.None))
Learn how to use the findAny method in java.util.Stream. This returns an Optional describing an element, or an empty Optional if Stream is empty. Also, remember that the same stream
In Java, characters as cannot appear in a regular expression without being escaped. For this, rely on the Pattern.quote() method as in the following example: public static boolean contains(String t1, String
You can identify tables that store a GUID (Globally Unique Identifier) value with the following script: SELECT [table] = s.name + N’.’ + t.nameFROM sys.tables AS tINNER JOIN sys.schemas AS
import java.util.*;public class FindJavaVersion{ public static void main(String args[]) { FindJavaVersion findJavaVersion = new FindJavaVersion(); findJavaVersion.printDetails(); } private void printDetails() { Properties systemProperties = System.getProperties(); System.out.println(“Java version: ” + systemProperties.get(“java.version”));
ASP.NET core has inbuilt methods to return few standard response codes. Here is an example. [HttpGet] public IActionResult CustomStatusCode() { //code return BadRequest; //sends status code 400 } ? Visit
ASP.NET core has inbuilt methods to return few standard response codes. Here is an example. [HttpGet] public IActionResult CustomStatusCode() { //code return BadRequest; //sends status code 400 }
Using sys.dm_db_missing_index_group_stats?returns summary information about groups of missing indexes, excluding spatial indexes. An example follows: SELECT TOP 5 * FROM sys.dm_db_missing_index_group_stats ORDER BY avg_total_user_cost * avg_user_impact * (user_seeks + user_scans)
TODOs are a quick way to jot down action items while coding. It can also sometimes become cumbersome to locate all TODOs for further action. Visual Studio provides a way
A typical mechanism of converting to a string, traversing and counting has a lot of processing to complete. Instead, the code below shows a combination of methods in Math package
The Microsoft.AspNetCore.Http.StatusCodes?enum has many response codes. Please see below for an example to return one of the values from the enum: [HttpGet]public IActionResult CustomStatusCode (){ //code”return StatusCode(Microsoft.AspNetCore.Http.StatusCodes.Status405MethodNotAllowed);}
Set up HickariCP number of connections in SpringBoot, in application.properties: spring.datasource.hikari.maximumPoolSize=8spring.datasource.hikari.minimumIdle=8
Getting to know the available drive types in the system is essential for certain activities in Java. The following code snippet lists the available drive types in the system: */import
Starting with JDK 12, the “switch” statement is extended so that it can be used as either a statement or an expression. A sample: switch (day) { case MONDAY, FRIDAY,
The DATALENGTH SQL returns the length of columns in a table. SELECT length = DATALENGTH(ColumnName) FROM TableName ORDER BY ColumnName

Visual Studio allows you to communicate with fellow developers about a piece of code. It lets you add a compiler directive “warning” to your code, which shows up in the











