How to make a microservice with Quarkus

What is Quarkus Quarkus is a full-stack, Kubernetes-native Java framework that was developed by Red Hat. It first appeared in early 2019, aimed at optimizing Java specifically for containers and enabling it to become an effective platform in serverless environments. The motivation behind Quarkus was to breathe new life into the Java ecosystem for modern cloud-native applications. It seeks to overcome the traditional shortcomings of Java, like slow startup time and high memory consumption, which are particularly notable in containerized environments....

September 16, 2023 · 6 min · 1198 words · Me

How to route transmission to VPN container?

Intro When you have a NAS at home, it feel bad if you don’t keep it running for something even if you don’t use it. It is the major backup to store the photos we shoot with our iphones. However, it is just basic use and hosting a media center with it sounds more cool. I used to use transmission-openvpn and it works perfectly, however, my VPN expires and I decided to use proton free tier....

September 16, 2023 · 4 min · 750 words · Me

Mastering the Art of Car Dealership Negotiations

Navigating the realm of negotiation, especially with car dealers, feels like threading a needle in the dark. Dealers hold most of the cards, thanks to the imbalance of information. They decide what to reveal, while we, as buyers, have to piece together a strategy from fragments. But fret not! With patience, strategy, and a keen eye for details, you can level the playing field. 🚫 Rule #1: Resist the Urge to Commit Ever been offered a tempting discount right off the bat?...

September 16, 2023 · 3 min · 458 words · Me

Neural Network in Numpy

This is to implement backpropagation algorithm in numpy which would help me to further understand how this works. import pandas as pd import numpy as np from pdb import set_trace from sklearn import datasets Design the network structure Each layer contains the weights/bias and activation union structures = [ {"input_dim": 2, "output_dim": 25, "activation": "relu"}, {"input_dim": 25, "output_dim": 50, "activation": "relu"}, {"input_dim": 50, "output_dim": 50, "activation": "relu"}, {"input_dim": 50, "output_dim": 25, "activation": "relu"}, {"input_dim": 25, "output_dim": 1, "activation": "sigmoid"}, ] Initiate the parameters The weights can be random number and bias are preferred to be small postive values in order to pass the relu in the beginning....

September 16, 2023 · 4 min · 829 words · Me

Sneak peek at the asynchronous Java

Java 19 is here with the preview of loom project. Loom project is the one helps Java become asynchronous and come back to the table to compete with other asynchronous language such as Golang. But why do we need Java to be asynchronous? Blocking It is all because we don’t want to be blocked. And the best example must be how you do your driver license renewal at the DMV. I remember I work up at 5:30 in the morning and drove to the DMV where there was already a line of 50 people....

September 16, 2023 · 3 min · 623 words · Me

The elegant consensus algorithm - Multi-Paxos - in Java gRPC

Introduction Paxos is a distributed consensus algorithm developed by Lamport. It is proved optimal and many systems are built based on it like chubby and zookeeper. But this article is not going to discuss Lamport’s orginal paper but focus on the engineering implementations. My colleague highly recommended Ongaro’s lecture of Paxos and said it is the best source of learning Paxos. I cannot agree more after studying it. That being said, I will briefly talk about Paxos and Multi-Paxos and dive into the engineering implementations....

September 16, 2023 · 6 min · 1122 words · Me

Why I don't like WSL

If you are not using Java or Intellij Idea for your project, you could stop reading. Couple months ago, I am very excited with WSL2 and it works perfectly for me to work on some Java projects in Intellij Idea. Somehow everything is upside down and obviously after some updates of windows though I still stick with win10. Long story short! Intellij Idea is really slow with WSL regarding the version....

September 16, 2023 · 2 min · 281 words · Me