
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.
Use the dir() function to return the list of the attributes and methods of the object. Syntax :dir({object})
If we have a code-point, we can check if it is a Unicode surrogate pair as follows: int cp = some_code_point;if(Character.charCount(cp) == 2) { // 2 means a surrogate pair
Port BindExceptions can occur if a port is already occupied by some other process and you try to use it again. Below is a simple example that demonstrates this and
To convert, e.g., the number 144 to the string ???144???, use the built-in type constructor??str()
Passing parameters to an SQL query written via @Query can be done via @Param or via positional parameters: // via @Param@Query(value = “SELECT p FROM Product p WHERE p.department=:department”)List fetchByDepartment(@Param(“department”)
I hate repetitive tasks. I am not a robot. However, the problem is that there are some tasks that can be quite repetitive or just take too many steps to
Use the int() type constructor to convert a string to number. Sample code: int(‘208’) == 208
Class annotations can be inspected via reflection as follows: Class clazz = Foo.class;Annotation[] clazzAnnotations = clazz.getAnnotations();
After a user has been created and is currently in use, a need might arise for the user account to be locked. MySQL provides a mechanism to alter the user
Calling a private constructor from outside its class can be done via Reflection as follows: public final class Users { private Users() {} // static members}Class usersClass = Users.class;Constructor emptyUsersCnstr

This is a neat trick I have learnt recently. When dealing with large lists of information, we, as developers, sometimes need to copy them, then add commas manually. Say, for
Using ThreadPoolExecutor from the concurrent.futures library, we can spin threads quickly and execute tasks in parallel. Wrap your time consuming method with the thread pool executor.. Without threading: for task
One of the widely wasted resources in the world today is: Memory. Due to inefficient programming, surprising (sometimes ???shocking???) amount of memory is wasted. We see this pattern repeated in several enterprise applications. To prove this case, we conducted a small study. We analyzed the famous spring boot pet clinic application to see how much memory it is wasting. This application has been designed by the community to show how the spring application framework can be used to build simple but powerful database-oriented applications.
Returning a stream of int zero-extending the char values from a String can be done via chars(): String str = “hello world”;IntStream chars = str.chars();
Often, file sizes are too big to back them up or share them with someone. You can create a compressed version that will save you disk space, transfer time, etc.
We can get all columns in all tables of a specific data type. The example below gets all INT columns in the entire database SELECT OBJECT_NAME(sys.columns.OBJECT_ID) as TableName, sys.columns.name as
You can run a Registry Query from the command prompt to ascertain if TLS 1.2 is enabled on a server or not. reg query “HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Client” reg query “HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Server”
Most of us are familiar with AUTO_INCREMENT, and have used it in at least one context. However, the following behavior is a little tricky, especially when we fail to observe — and
For setting database dialect in Spring Boot, rely on spring.jpa.properties.hibernate.dialect property in application.properties. For example, setting the MySQL5Dialect dialect can be done as below: spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect Related Articles How to Set
By default, developers work with time up to the level of seconds, i.e. HOURS, MINUTES and SECONDS. There could be instances in which we may want to work on the

In computer programming, whitespace is any character or series of characters that represent horizontal or vertical space in typography. Learn how to to check if a character is whitespace, as
See how to figure out whether or not a given TimeZone supports the Daylight Saving feature and if it is in use. Java supports this with the help of observesDaylightTime()
To convert a code-point (Unicode surrogate pair) into a string, rely on the following code: String str = “hello world”;int cp = str.codePointAt(some_position_in_str);String ch = String.valueOf(Character.toChars(cp));
You can use the yield keyword to hold and return the data to the caller. See below for an example. Public static IEnumerable ExampleMethod(){ List li = new List(); foreach
Dates are an important part of all record keeping activities. Due to globalization, it is important to understand how each country represents the date. Some countries start the date with
For building faster SQL queries, follow these hints. 1. Use Smaller batches Always try to delete data or update data in smaller batches. If you try to delete thousands of
With MySQL, we can find out the quarter by providing a date. In the example below, we will look at the current quarter with input as current date. Query: SELECT
Looping the characters of a string can be done via charAt() or toCharArray() as follows: String str = “hello world”;for (int i = 0; i
With the Skip and Take methods in LINQ, paging has become a lot easier. All we need to do is have a simple logic such as is outlined below. This
You may choose to validate the data that you enter in a table either, at the database level or at the application level. Application level is feasible only if the











