Your tech-expert for enterprise. SaaS. security. finance. tools.

The leading provider of technical information, tools, and services for tech-interested professionals.

The Latest

Understanding INSERT IGNORE in MySQL

Usually, if there is an error during the INSERT command execution, the error is thrown and the execution stopped. MySQL supports something named IGNORE along with INSERT, which captures the

How to Use FetchMode.JOIN to Fetch Collection

By annotating an associated collection with FetchMode.JOIN we force it to be loaded EAGER: @OneToMany(fetch = FetchType.LAZY)@Fetch(FetchMode.JOIN)private List = new ArrayList(); Or: @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = “foo_id”) @Fetch(FetchMode.JOIN) private

Using the STRING_AGG SQL Server 2017 Function

The STRING_AGG?SQL Server 2017 function performs grouped string concatenation. Here is an example: SELECT STRING_AGG(value, ‘ ‘) AS Result FROM (VALUES(‘Hannes’),(‘du’),(‘Preez’)) AS I(value); This returns: Hannes du Preez in the

How is HeapHero different?

 There are excellent Heap dump analysis tools like Eclipse MAT, Jprofiler, … These tools are handy when you want to debug/troubleshoot OutOfMemoryError. However, we HeapHero as following unique capabilities which aren’t available in those tools:  1. How much memory wasted?    HeapHero tells you how much memory your application is wasting because of inefficient programming practices by the developers. Today memory is wasted because of reasons like: a. Duplication of stringsb. overallocation, and underutilization of data structuresc. Boxed numbersd. Several more reasons.  You can see HeapHereo reporting how much memory is wasted even in a vanilla pet clinic spring boot application. Other tools don’t provide this vital metric.  2. First cloud application for heap dump analysis  Today’s memory profiling tools need to be installed on your Desktop/Laptops. They can’t run on the cloud. HeapHero can run on  a. Public cloud (AWS, Azure,..)b. Your private data centerc. Local machine Your entire organization can install one instance of HeapHero in a central server, and everyone in the organization can upload and analyze the heap dump from this one server.  3. CI/CD pipeline Integration   As part of CI/CD pipeline, several organizations do static code analysis using tools like coverity, vera code… . Using HeapHero, you can do runtime code analysis. HeapHeroprovides REST API. This API returns JSON response, which contains key metrics related to your application’s memory utilization. You can invoke this API from CI/CD pipeline and see whether your code quality is improving or regressing between each code commit.  4. Instant RCA in production  Debugging OutOfMemoryError in production is a tedious/challenging exercise. You can automate the end-end analysis of OutOfMemoryError using HeapHero. Say if your application’s memory consumption goes beyond certain limits or experience OutOfMemoryError, you can capture heap dumps and do heap dump analysis instantly using our REST API and generate instant root cause analysis report. Production troubleshooting tools like ycrash leverages HeapHero REST API to do this analysis for you.  5. Analyzing heap dumps from remote location  Heap dump files are large in size (several GB). To troubleshoot the heap dump, you have to transmit the heap dump file from your production server to your local machine. From your local machine, you have to upload the heap dump file to your tool. Sometimes heap dump might be stored/archived in remote server, AWS S3 storage,… In those circumstances, you will have to download the heap dump from that remote location and then once again upload it to the tool. HeapHero simplifies this process for you. You can pass the heap dump’s remote location URL as input to the HeapHero API or to web interface  directly. HeapHero will download the heap dump from this remote location to analyze for you.  6. Report Sharing & Team collaboration  Sharing Heap Dumps amongst team is a cumbersome process. Finding a proper location to store the heap dump file is the first challenge. The team member with whom you are sharing this report should have the heap dump analysis tool installed on his local machine. So that he can open the heap dump file with the tool you are sharing to see the analysis report. HeapHero simplifies this process. HeapHero gives you a hyperlink like this. This hyperlink can be embedded in your emails, JIRA, and circulated amongst your team. When your team member clicks on this hyperlink, he can see the entire heap dump analysis report on his browser.  HeapHero also lets you export you heap dump as PDF file. This PDF file can also be circulated amongst your team members. 7. Analyze large size heap dumps  Several memory profilers are good at analyzing heap dumps of smaller size. But they struggle to analyze large size heap dumps. HeapHero is geared to analyze heap dumps easily.  Author bioEvery single day, millions & millions of people in North America???bank, travel, and commerce???use the applications that Ram Lakshmanan has architected. Ram is an acclaimed speaker in major conferences on scalability, availability, and performance topics. Recently, he has founded a startup, which specializes in troubleshooting performance problems.

Using REPEAT in MySQL

MySQL provides a REPEAT command that can be used when you want to repeat a particular string, a defined number of times. Consider the example below: SELECT CONCAT(‘S’,REPEAT(“E”,2)) Here, we

How to Cache Query Results

If em is the EntityManager, then the following query results will be cached: Query query = em .createQuery(“SELECT u FROM User u”); query.setHint(“eclipselink.cache-usage”, “CheckCacheThenDatabase”);

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

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)

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”)

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

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);

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])

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

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))

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.

No more posts to show

Topics

Enterprise

Tools

SaaS

Small Business

Security

Technology