The Latest

Understanding UNCOMPRESSED_LENGTH in MySQL

In MySQL, once we use the COMPRESS method to compress a particular text, the LENGTH of the resultant text is not the same as that of the original text. However,

Date Settings Problem (Regional Settings)

Regional Settings, especially dates, are always a problem in code. For example, suppose your product is developed in the U.S. and deployed in the UK. DateTime.Parse would throw exceptions because String

Tip: Regional Date Settings Problems

Regional Settings, especially dates, are always a problem in code. For example, suppose your product is developed in the U.S. and deployed in the UK. DateTime.Parse?would throw exceptions because String

SQL Statistic Tests to Look Into

If you want to do statistics in SQL, the following tests will be very useful to look into: Pearson’s Correlation Kendall’s Tau Rank Correlation Simple Linear Regressions The Kruskal-Wallis Test

How to Set hibernate.format_sql in a Spring Boot Application

For formatting the SQL statements in a Spring Boot application, we can set hibernate.format_sql in the application.properties as follows: spring.jpa.properties.hibernate.format_sql= true Related Articles Set Up a Database Dialect in Spring

Understanding sql_mode in MySQL

In MySQL, the sql_mode can have values set, so that the behaviour of the SQL being executed henceforth behaves as per the mode set. Considering the following use case where

How to Call a Macro Every “n” Minutes

We write a lot of macros to automate many of our mundane repeated tasks. Taking it to the next level, we can call the macro in a pre-determined frequency and

How to Join (Combine) Fix File Paths

In order to join (combine) fix file paths we can use Path#resolve() and Path#resolveSibling():. // using Path#resolve()Path base1 = Paths.get(“D:/learning/books”); Path path1 = base1.resolve(“Java.pdf”);// using Path#resolveSibling()Path base2 = Paths.get(“D:/learning/books/Java.pdf”);Path path3

Shortcut to Zoom in Chrome

It’s easy to use shortcuts to zoom in Chrome. Just press the ctrl key and just scroll your mouse middle button up to zoom in and button down to zoom

Extract Digits from a String in Python

See how to extract digits from a string in Python using a regular expression. import reinputString = ‘QuinStreet2019Year’result = re.sub(“D”, “”, inputString) Related Posts Smart watch alerts woman to heart

How to Sort a Collection

An approach for sorting a Java collection can rely on Collections.sort() method as in the following example: List names = new ArrayList(); names.add(“John”); names.add(“Alicia”); names.add(“Tom”); Collections.sort(names); // sort ascending by

Join Paths in Python

Follow this example to see how to join paths in Python. root= “/root”str = os.path.join(root, “Y2019”, “2019.txt”) Related Posts How To Facetime AndroidA new of styling you html pagesUsing the

Connect to a Database in Spring Boot

Instructing Spring Boot to connect to a database can be done in application.properties via the JDBC URL, user and password as in the following example: spring.datasource.url=jdbc:mysql://localhost:3306/mydb?createDatabaseIfNotExist=truespring.datasource.username=rootspring.datasource.password=root Related Posts Comparing Analytics

Understanding MAX_USER_CONNECTIONS in MySQL

At times, you may want to restrict the number of connections made from a user to the database. This may be necessary to improve performance, reporting, etc. MySQL supports this

How to Convert a List to an Array

One way to convert a list to an array is shown below: List list = Arrays.asList(1, 2, 3);Integer[] array = new Integer[list.size()];array = list.toArray(array); Related Posts Explore the Top 4

Using CAST for Explicit Conversion in MySQL

MySQL allows you to explicitly convert a number to a string with the help of CAST function. The example below illustrates how to use it. SELECT 55.5 AS NUMBER, CAST(55.5

Reverse a String in Python

Python’s str string objects have no built-in .reverse() method like you might expect if you’re coming to Python from a different language. str = “devx”print(“reverse string is “, str[::-1]) Related

DevX

Passing a function instead of a function???s result to an another function in Python

Dear Editors,I sent an email to [email protected] on December 1 with an attached tip ???Passing a function instead of a function???s result to an another function in Python???.I used to use her email address a number of years ago. I would like to know if the tip was received and what is its status.My email is [email protected]. Thanks,Boris Eligulashvili Related Posts Apple watchOS 11 discontinues support for three modelsUsing a JDBC TemplateMore Secure and Productive Database and Code Development in Updated SQL CompleteKeys to success in

How to Trigger an Async Query

Query methods defined in repositories can be executed asynchronously. This means that the query method will return immediately upon invocation. The sample code below relies on @Async annotation and Future,

Using JSON as a Data Type

MySQL is a very robust database that supports JSON as a data type. This will be very useful for applications that need the JSON data type for certain types of

Concatenate Strings in a List

Use the join operator to concatenate strings in a list. str = [“devx”, “is”, “for”, “developers”] str = (” “.join(str)) Related Posts AI entrepreneur raises $13.8 million via LinkedInPayments Made

How to Selectively Expose CRUD Operations

In order to selectively expose CRUD operations, we need to define an intermediate interface, annotated as below: @NoRepositoryBeaninterface IntermediateRepository extends Repository { // add here the selected CRUD, for example

Types of Engines that Are Supported in MySQL

MySQL supports multiple types of storage engines. There are specific engines that are meant for specific needs. Understanding of these storage engines is beyond the scope of the current discussion.

How to Define a SynchronousQueue in Java

For defining a SynchronousQueue in Java, we need the BlockingQueue interface as follows: BlockingQueue queue = new SynchronousQueue(); Related Posts Tip: The sp_rename SQL Stored ProcedureInteresting Java.lang.Math ClassCocaine Smuggler Caught:

Working with Multiple Query Windows

Working with and comparing multiple queries at the same time can be a pain, at least for me. Two independent query windows take up more space on screen, or having

Get the Size of an Object in Python

Use getsizeof method to retrieve the size of an object in bytes. See below for an example: str = “devx” print(sys.getsizeof(str)) Related Posts Stanford Project Measures Nature’s ValueSmartwatch Sales Plummet

Finding the TAN of a Given Number

MySQL provides numerous mathematical calculations that can be computed with inbuilt functions. In order to find the TAN of a number, we can use the following: Query: SELECT TAN(400); Sample

How to Convert a List into a Set and Vice Versa

Converting List to Set: List list = Arrays.asList(1, 2, 3);Set set = new HashSet(list); Converting Set to List: Set set = Sets.newHashSet(1, 2, 3);List list = new ArrayList(set); Related Posts

How to Quickly Sort an Array

The quickest solution for sorting an array in Java relies on Arrays.sort() method as below: int[] arr = {5, 12, 3, 44, 55}; Arrays.sort(arr); Related Posts AI reshapes cloud infrastructure