This file contains hidden or 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
| #!/usr/bin/env python3 | |
| """ | |
| PostgreSQL Database Transfer Tool | |
| This script transfers data from a source PostgreSQL database to a destination database | |
| with support for upsert operations (insert or update) and table selection. | |
| """ | |
| import argparse | |
| import json |
This file contains hidden or 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
| apt-get update && apt-get upgrade -y && apt-get install -y curl && apt-get clean | |
| # Create aliases in here that you may want to use in the devcontainer | |
| echo alias ll=\'ls -l\' >> ~/.bashrc |
This file contains hidden or 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 LuckyNumber { | |
| static int luckyNumber = 21; | |
| public static LuckyNumber getInstance() { | |
| return null; | |
| } | |
| public static void main(String[] args) { | |
| System.out.println(LuckyNumber.getInstance().luckyNumber); | |
| System.out.println(LuckyNumber.getInstance().getInstance()); | |
| } | |
| } |
This file contains hidden or 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 static long parallelArraySynchronised() { | |
| final long[] sum = {0}; | |
| CountDownLatch countDownLatch = new CountDownLatch(NUMBER_OF_PROCESSORS); | |
| long totalPerThread = LIMIT / NUMBER_OF_PROCESSORS; | |
| for (int i = 0; i < NUMBER_OF_PROCESSORS; i++) { | |
| final int finalI = i; | |
| executors.execute(() -> { | |
| for (int j = (int) (totalPerThread * finalI); j < (totalPerThread * (finalI + 1)); j++) { | |
| synchronized (Java8PerfTest.class) { | |
| sum[0] += j; |