devxlogo

The Latest

Convert a String to a Number in Python

Use the int() type constructor to convert a string to number. Sample code: int(‘208’) == 208 Related Posts IBM Expands OpenStack Cloud ServicesMapR Unveils a Kafka Alternative Called StreamsThe Surprising

Inspect Class Annotations

Class annotations can be inspected via reflection as follows: Class clazz = Foo.class;Annotation[] clazzAnnotations = clazz.getAnnotations(); Related Posts Types of Engines that Are Supported in MySQLBrookfield raises $2.4 billion for

Locking a User Account in MySQL

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

Call a Private Constructor

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

Using Multi Edit Mode

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

Multithreading in Python

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

Memory wasted by Spring Boot application

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.  Related Posts Yahoo integrates with AOL, enhancing online advertisingTROUBLESHOOTING TIMEOUT IN AWS ELASTIC BEANSTALKSynchronizationContext in C#Apple AirTags hit lowest price on AmazonWriting RESTful Web Services in Python with Flask

Transform a String into IntStream

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(); Related Posts Deutsche Bank shares

Performing File Compression in Java

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.

Get All Columns in All Tables of a Specific Data Type

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

Ascertain Whether or Not TLS 1.2 Is Enabled on a Server

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”

Set Up a Database Dialect in Spring Boot

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 Posts Optimizing AI Chatbots with

Using MICROSECOND in MySQL

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

Check if a Character Is Whitespace

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

Converting a Code-Point into a String

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)); Related Posts test 3

Formatting Global Dates in Java

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

3 More Hints for Building Faster SQL Queries

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

Finding the Current Quarter in MySQL

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

Loop the Characters of a String

Looping the characters of a string can be done via charAt() or toCharArray() as follows: String str = “hello world”;for (int i = 0; i

Extract Faces Using Amazon Rekognition

AmazonRekognitionClient amazonRekognitionClient = new AmazonRekognitionClient(Amazon.RegionEndpoint.);byte[] imageData = System.IO.File.ReadAllBytes(inputImageFile);DetectFacesRequest facesRequest = new DetectFacesRequest();facesRequest.Image = new Amazon.Rekognition.Model.Image{Bytes = new MemoryStream(imageData)};DetectFacesResponse facesResponse = amazonRekognitionClient.DetectFaces(facesRequest);//If faces are detected, extract themif (facesResponse.FaceDetails.Count > 0){foreach (var

Write A Guest Post to the DevX

 Hello Editor, I am Rooney Reeves working as a Business Development Executive at eTatvaSoft. I’m writing to become more actively involved with your publication and I’d love to contribute a guest post on your website. For my writing skill, You can check out some of my published article links as listed below:     https://readwrite.com/2019/03/20/iot-and-ar-are-found-revolutionizing-the-world-of-mobile-apps/     https://blogs.sap.com/2019/01/21/combining-iot-with-custom-mobile-apps-is-it-an-opportunity-or-a-roadblock/     https://codepen.io/lisadawson/post/why-is-angularjs-going-to-be-the-hot-favorite-among-web-developers     https://www.devsaran.com/blog/react-development-framework-taking-over-front-end-development     https://www.getelastic.com/6-digital-payment-trends-to-keep-an-eye-on I’ve been brainstorming some topics that I think your readers would get a ton of value. I’d like to pitch that topics which I think would be of interest to your readers. Here are the details: Topic 1: Angular 2 ??? Learn The Role Of Different Zones Topic 2: Laravel 5: Repositories and Services- How To Use Them? Topic 3: Angular 2- How To Protect Routes Using Guards If you don’t like the topics, we can always switch to something more suitable. I’ll make sure the piece overflows with information that can’t be found. What do you think? Would that be of interest? Related Posts Li-Cycle Restructuring Sparks Massive LayoffsHow To Screen Record On AndroidReport: Cloud Computing Adoption

Working with Multi-line Text

Starting with JDK 13, we can define multi-line strings using “”” as follows: String text = “””some textsome textsome text”””; Related Posts How To Reset Android PhoneSuper Micro launches x14

3 Hints for Achieving Faster SQL Queries

For faster SQL queries, follow these hints. Know your data:When you know your data, or the structure of where your data is coming from, you will know how to formulate