Sunday, December 31, 2023

AWS - Get quicksight embed url using JavaScript SDK V3

In the realm of data-driven solutions, AWS QuickSight offers a robust platform for crafting dynamic and insightful dashboards. Embedding these dashboards directly into your applications adds a layer of accessibility and convenience. This guide walks you through the process of obtaining a secure QuickSight embed URL using JavaScript SDK V3, suitable for both Node.js backend and Lambda functions. Before proceeding, ensure your QuickSight dashboard is created and shared with the intended audience.

Prerequisites:

Make sure you've completed the following preliminary steps:

Dashboard Setup:
    
Create your QuickSight dashboard and Share the dashboard with all users in your AWS account.
Open the published dashboard and choose Share at upper right. Then choose Share dashboard.



















Domain Whitelisting:

Whitelist the domain where you plan to embed the QuickSight dashboard

    









Friday, June 2, 2023

Docker - err: exec: "docker-credential-desktop": executable file not found in $PATH, out: ``

Introduction:

Docker has revolutionized the way we package, distribute, and deploy applications. However, like any other technology, it is not immune to errors and issues. One such error that I encountered recently while working with Docker on my Mac was the "error getting credentials - executable file not found" error. In this blog post, I will share my experience with this error and provide a solution that worked for me.

The Error:

When attempting to build a Docker image or perform a Docker login, I encountered the following error message:


openjdk:17: error getting credentials - err: exec: "docker-credential-desktop": executable file not found in $PATH, out: ``


Error saving credentials: error storing credentials - err: exec: "docker-credential-desktop": executable file not found in $PATH, out: `` 


Diagnosis:

The error message suggests that the Docker daemon was unable to locate the "docker-credential-desktop" executable file in the $PATH environment variable. This executable is responsible for retrieving Docker credentials and authentication.

Wednesday, April 19, 2023

React simple rich text editor using draft-js

This React Simple Rich Text Editor is created using the Draft.js library and includes button controls made with react-icons. It allows users to toggle between different inline styles like block, italic, and underline, as well as block types such as header-one, unordered-list-item, and ordered-list-item. The controls buttons are selected on text click, making it easy for users to format their text. 

The component requires two packages to be installed

yarn add draft-js react-icons

Thursday, February 23, 2023

Caused by: java.lang.UnsupportedOperationException: PermittedSubclasses requires ASM9

After attempting to upgrade Spring Boot from version 2.7.3 to version 3.0.2, I encountered this error. I spent a few hours searching on Google to try to figure out the cause of the error. Eventually, I realized that the error was related to the version of Gradle that I was using. At the time, I had been using Gradle version 7.3.3. However, once I updated to Gradle version 8.0.1, the error was successfully resolved.


I also updated distributionUrl in gradle-wrapper.properties as shown below
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip

Note - After above changes i removed .idea folder and restarted my intellij

Friday, February 3, 2023

Java thread synchronization

Do you know what is thread synchronization Java? Have you ever thought about how to use synchronized in Java? let us gain some knowledge about thread synchronization Java & try to find out the answer to what is thread synchronization in Java.

But before we start writing about thread synchronization Java & try to find out how to use synchronized in Java. Let us first try to understand the policy of synchronization from one daily life example.

Assume one daily life scenario.

Suppose in your school, there is one toilet for the gents. Now, at the same time, you & your friend need to access the toilet. In both cases, the matter is an urgent one. So, you are not ready to let him go. Neither of your friends is ready to let you go. As a result, there is a mess in front of the toilet.

So, what you will do in such a case? Or what your friend will do at that time?

So, you called the teacher to solve the situation that arise there. Your teacher will draw a solution & allow anyone to go to the toilet first. And as a teacher is a respected person both of you are ready with the solution. In this case, the teacher helps to solve the conflict.

The same thing happens in thread synchronization Java. When two different parts of the program try to access the same resources then this trouble arises. We will try to know more about it when we discuss what is thread synchronization in Java.

What Is Thread Synchronization in Java:

Java is an important programming language. Java is used in the corporate world as it helps to solve real-life problems very easily. Java is used for game development purposes. These along with an operation some more processes are going on. For implementing that situation, Java programming language used the thread concept. Thread is a special concept of the Java programming language. It helps to execute more operations a t same time.

Synchronization means collaborating two or more processes at the same time. The thread synchronization Java is quite like this. Now, sometimes when two or more processes are using the same resource then there will be a problem. This problem arises when we use thread in Java. Two or more parts of the code want to use the same resources. Then there is a mess at that point.

The main goal of thread synchronization in Java is to remove the problems related to resources. If two or more parts want to use the same resource, then one by one they will execute that. This means one part will use that resource, then it will be removed. After that, another part is going to use the resource & will be removed. This is a very problematic situation. To come out of this situation, we used the 'synchronized' keyword.

Synchronize is like the teacher at your school. It helps to remove the conflicts between two or more parts for using the same recourses. We will find out more about this when we implement the thread synchronized Java. Similarly, when you are stuck at Java coding you can use Java Assignment Help Services from codingzap.

Why Should We Use Thread Synchronization Java:

Now, after knowing about thread synchronization Java, we need to know why we should use it. This is a very important topic. Often, we find out that, the threads that are implemented in the program are not executing the same we want. In those cases, we need to use this method. As there is a problem related to the synchronization.

If we don't use synchronization, then there will be an issue related to the memory space. Also, the flow of the output of the program will not be similar as desired. There will be a thread interface problem if we don't use synchronization at the correct time. When we implement thread synchronization Java, it will be easy to understand.