
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.
It may be required to move a file or file(s) based on a requirement. The following Java APIs help us achieve this. The code snippet below illustrates moving file a.png
Use the text-transform property with ‘capitalize’ value to capitalize the first letter of the words in an element., For example: div { text-transform: capitalize; }this is a statement that requires
You can not use the ALTER TABLE statement in SQL Server to rename a column in a table. You can however use the sp_rename stored procedure if you do not
Diagnosing and troubleshooting CPU problems in production that too in cloud environment can become tricky and tedious. Your application might have millions of lines of code, trying to identify exact line of code that is causing the CPU to spike up, might be equivalent of finding needle in the haystack. In this article let???s learn how to find that needle (i.e. CPU spiking line of code) in matter of seconds/minutes. To help readers better understand this troubleshooting technique, we built a sample application and deployed it in to AWS EC2 instance. Once this application was launched it caused CPU consumption to spike up to 199.1%. Now let???s walk you through the steps that we followed to troubleshoot this problem.
Some IDEs provide support for generating HTML from Javadocs automatically, but this can also be achieved using the command line: javadoc tool The most basic usage of the tool is
With Java version 8, there is an option to assign null value to an object of type Optional. For example: Optional optionalVar = Optional.ofNullable(null); //Optional.ofNullable() accepts a null value to
Java has a value NaN. The value has multiple faces and is returned under different circumstances. Below code samples will help us understand some of them. public class JavaNaN{public static
Considering the following table STOCKPRICE and its details. CREATE TABLE ‘STOCKPRICE’ (‘ID’ INT(11) NOT NULL,’NAME’ TEXT NOT NULL COLLATE ‘utf8_bin’,’PRICE’ INT(11) NOT NULL)COLLATE=’utf8_bin’ENGINE=InnoDB; Also, use the following to create sample
To format a date in an Angular template, use the date pipe. For example, the following code formats the date to short date format by default. {{ dateObject | date:’

The plus symbol can be used as three distinct operators in Java: as the unary Plus operator, if there is no operand before the + as the binary Addition operator,
You can generate a Random number in SQL with the following command: SELECT RAND() Random_Number This returns the following value 0.713666525097956
MySQL provides a NOW()?function that returns the current date and time when executed. Command: SELECT NOW() AS ‘CURRENT DATE AND TIME’; Expected output: +————————-+|CURRENT DATE AND TIME |+————————-+| 2018-03-20 19:22:17
Over a long period of time, we add lot of stuff knowingly or unknowingly to applications such as Microsoft Word. This results in slowing load times. To optimize this behaviour,
MySQL queries can help us work with null values in queries and behave as we need. IFNULL?is a suitable function and can be used where you want to treat null
Executable JAR files are the easiest way to assemble Java code into a single file which can be executed. Assuming that you have an executable JAR file with pathname ,
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
Imagine, you want to schedule activating a task few moments (3 seconds in this case) from now, and interval of 3 seconds. The following code will be helpful. import java.util.*;//We
Type shell:sendto in your run menu and press the enter key. This will open a folder in Windows Explorer. Just drag-and-drop your favourite shortcuts to this folder. And next time, you
Find the IP address of a server that you know, for example: google.com. Java, as usual, provides a very easy mechanism to retrieve the IP address of a server that
Dereferencing happens using the . operator: Object object = new Object();String text = object.toString(); // ‘object’ is dereferenced. Dereferencing pursues the memory address placed in a reference, to the place
With the ASCII function you can return a certain character’s ASCII value, as shown in the following example: SELECT ASCII(‘A’) AS A, ASCII(‘B’) AS B, ASCII(‘a’) AS a, ASCII(‘b’) AS
We often create console applications to write test code or to do quick experiments in Visual Studio because they are lightweight when compared to Windows/Web applications. Visual Studio 2015 provides
In Java, static keyword usage on variables means that memory is allocated and it will not be possible for the garbage collector to reclaim the memory until the application terminates.
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
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 =
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.
During the development lifecycle, we may decide on a name for a table and later want to rename it based on the usage of the table. Let’s assume that there
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











