import com.sun.net.httpserver.Filter;
import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpHandlers;
import com.sun.net.httpserver.HttpServer;
If you're not familiar with BRIN, check these easy-to-follow articles: https://www.crunchydata.com/blog/postgres-indexing-when-does-brin-win https://medium.com/geekculture/postgres-brin-index-large-data-performance-with-minimal-storage-4db6b...
Start a postgres instance and connect to it with psql
or your favorite tool. And then follow the steps below.
- Create a table and fill in with dummy date:
-
Add driver class
// https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.7.3'
-
Mariadb installation Ref
-
Upgrade gradle/maven wrapper, here gradle
Ref
Make sure execute this program on success build../gradlew wrapper --gradle-version 5.6.4 --distribution-type all
-
spring-boot-gradle-plugin changes,
-
bootRepackage to bootJar or bootWar
resilience4j.circuitbreaker.metrics.enabled=true
resilience4j.circuitbreaker.metrics.legacy.enabled=true
# following properties can be added for individual circuit breakers (CB-name is one of the circuit breaker, replace it)
resilience4j.circuitbreaker.instances.<CB-name>.sliding-window-type=TIME_BASED
resilience4j.circuitbreaker.instances.<CB-name>.sliding-window-size=100
resilience4j.circuitbreaker.instances.<CB-name>.minimum-number-of-calls=100
resilience4j.circuitbreaker.instances.<CB-name>.failure-rate-threshold=10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PascalTriangle { | |
// Ref: https://leetcode.com/submissions/detail/293484403/ | |
// if you do not see "hello" as output in console, it means 2311 is prime number: | |
// Ref: https://www.youtube.com/watch?v=D7AHbyAlgIA&list=PL5KkMZvBpo5CdoOxa3dqll2n6KsXqerYO&index=11 | |
// https://en.wikipedia.org/wiki/AKS_primality_test | |
public static void main(String[] args) throws Exception { | |
List<BigInteger> generate = generate(2311); | |
System.out.println(generate); | |
for (int i = 0; i < generate.size(); i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZigZag-Encoding | |
--------------- | |
Maps negative values to positive values while going back and | |
forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...) | |
(i >> bitlength-1) ^ (i << 1) | |
with "i" being the number to be encoded, "^" being | |
XOR-operation and ">>" would be arithemtic shifting-operation |
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.google.gson.reflect.TypeToken;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install zsh; | |
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"; | |
cd $ZSH/custom/plugins; | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git && git clone https://github.com/zsh-users/zsh-autosuggestions && git clone https://github.com/zsh-users/zsh-completions; | |
# from now on your default shell is zsh, customize by editing ~/.zshrc file | |
brew tap homebrew/cask-fonts; | |
brew install --cask font-hack-nerd-font; | |
brew install coreutils | |
cd ~/Desktop; |
NewerOlder