devxlogo

The Latest

Quickly View All TODOs in Visual Studio

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

Counting Digits in a Given Number

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

Return Response Codes from ASP.NET Action Result Using StatusCodes Enum

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);} Related Posts Working

Set Up HickariCP Number of Connections in SpringBoot

Set up HickariCP number of connections in SpringBoot, in application.properties: spring.datasource.hikari.maximumPoolSize=8spring.datasource.hikari.minimumIdle=8 Related Posts IBM Launches Spark-Based Cloud Development EnvironmentHow to Convert a List into a Set and Vice VersaReport: IBM

Finding the Available Drive Types in the System

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

Boost the Switch Statement in JDK 12

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,

Using the DATALENGTH SQL Function

The DATALENGTH SQL returns the length of columns in a table. SELECT length = DATALENGTH(ColumnName) FROM TableName ORDER BY ColumnName Related Posts Roblox: Everything You Need to KnowSicily suffers severe

Quickly Tell Team Something About Code

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

Eclipse MAT – Incoming References, Outgoing References

Eclipse Memory Analyzer (MAT) is a powerful tool for heap dump analysis. It has several great features to debug memory problems effectively. ‘Incoming references’ and ‘outgoing references’ is one such

Using Error: Class Names and YourClassName

Using error: Class names, ‘YourClassName’, is only accepted if annotation processing is explicitly requested. There are likely instances that you have come across this error and found it very difficult

Creating a Specific Date in Java

To create a new date, you will need a Calendar instance and then you can set the Calendar instance to the date you need. Calendar calendar = Calendar.getInstance(); The line

Try to avoid -XX:+UseGCLogFileRotation

Developers take advantage of the JVM argument -XX:+UseGCLogFileRotation to rotate GC log files. Example: “-XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/home/GCEASY/gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=20M” As per above example, JVM will rotate GC log file whenever its size reaches 20MB. It will generate files up to 5 files, with extensions gc.log.0, gc.log.1, gc.log.2, gc.log.3, gc.log.4. Related Posts Report: Demand for Data Scientists Is Tapering OffUnlocking the Power of Diversity in Quantum: A Path to InnovationUnderstanding the Feature-rich Methods of Math PackageThe XML

Compress and Decompress SQL Functions

Compress: Compresses input data and returns the binary data of type VARBINARY(MAX) Decompress: Decompresses compressed input binary data and returns the binary data of type VARBINARY(MAX) Here is small example

Using the Hover Effect on an HTML Element

We use the hover attribute to set the hover effect in Web pages within CSS. For example: div {color:#000;}div :hover{color:#f00;} You can apply the transaction property on top of this with

Formatting Output in Java

Proper formatting of output is essential. There are times when the details presented are not formatted. The code snippet below displays details in a formatted manner that is a better

Cast an Int Value to an Enum Value in C#

Oftentimes, the input is an integer that has to be converted to the appropriate enum value. All we have to do is cast the integer value as below: EnumName e

Using a Java File with an Empty Main Method

This is sort of like cheating the Java runtime. Ideally, I believe, starting Java 1.6, you cannot execute Java programs without a standard main method. Prior to that, only the

Logging HikariCP Activity in Spring Boot

See how to log HikariCP activity in Spring Boot. In the application.properties employ the following: logging.level.com.zaxxer.hikari.HikariConfig=DEBUGlogging.level.com.zaxxer.hikari=TRACE Related Posts Exposing Internal Methods to Other Assemblies in .NETBiased AI in Recruitment Raises

Create a GUID in Visual Studio

There are many cases in which we need to create GUIDs. You can now create them using Visual Studio tools. Go to Tools – Create Guid. This will bring up

Knowing the Privileges of the Current User in MySQL

MySQL has user management and user privileges can be created and modified by the database administrators???or users with administration rights. In my environment, this is the result of the command:

Reading All Lines of a File from Classpath in Java 8

Reading all lines of a file from classpath in Java 8 and display on screen: Files.lines(Paths.get(ClassLoader.getSystemResource(“filename.extension”) .toURI())).forEach(System.out::println); Related Posts Unleashing 5G Potential: Revolutionizing Global Telecom MarketUsing the Insert on Duplicate

Transfer Data with JSON in SQL Server

You can transfer data with JSON in SQL Server. Based on an SQL query, you can output the results into JSON format. Here is a small example: DECLARE @JSONOutput NVARCHAR(MAX)

Convert a Byte Array to a Hexadecimal String

The BitConvertor class can convert a byte array to a string in C#, as shown below: string convertedValue = BitConverter.ToString(byteArray).Replace(“-“,””); Related Posts Access Dilemma: Techopedia’s Security RoadblockUse the Preload Resource

Understanding the Unique Keyword in MySQL

At times, we need a certain combination of column values to be unique in a table. With MySQL, this can be achieved using the UNIQUE keyword. There can be a

Select All Elements Quickly in CSS

Use the asterisk (*) symbol as a prefix to select all elements of a selector object and then write your CSS styles on top of it. For example: *div would

Using the Serialver Tool

Java provides a mechanism to know the serialization properties of a given class. Command: serialver -show The above command will bring up a window titled Serial Version Inspector with fields