Passing Data From API Between Components in Angular

When developing single-page applications, one of the most common patterns you encounter is cross-component communication. One specific case I recently had to deal with is this: the page has two components: One for displaying the search for and the other for showing the search result. Here is how to application works: As you can see, … Read more

[Java Concurrency] 03: Callable

In the previous article, you’ve already known about the Runnable interface. To execute a task, you can simply create a class implement Runnable and pass an instance of that class in a thread. Runnable instances don’t provide a return value, you may need a different solution if your use case requires capturing return values. Introducing … Read more

[Java Concurrency] 02: Runnable

One of the methods to run tasks in multiple thead is to pass Runnable instance to thread and call that start() method. Runnable is a Functional interface that has only one method that returns void. If you prefer the lambda syntax, you can write the above code like so: However, for tasks with more than … Read more

[Java Concurrency] 01: Thread & Process

What is a thread? Thread is the smallest execution unit that can be schedule by the operating system. A process is a running program. When you start a program, you create a process.In one process, there can be more than one thread. Threads in a process share an environment created by the process. System vs … Read more

Configure HAProxy to Accept Preflight Requests (CORS)

Recently I developed an API with Spring Boot. All the tests on the local environment went well with Postman. However, when deploying to prod through HAProxy, I got this CORS error: There are also other errors regarding missing headers, origin… There are some solutions available, such as adding code to my Spring Boot code base. … Read more