Skip to content

Instantly share code, notes, and snippets.

View onacit's full-sized avatar

Jin Kwon onacit

  • VROONG
  • Seoul, Korea
View GitHub Profile
package g_79ff0bed607bef315c4353b374e1319e;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import static java.util.Objects.requireNonNull;
/**
* A program solves <a href="https://en.wikipedia.org/wiki/Tower_of_Hanoi">Tower of Hanoi</a>.
@onacit
onacit / ValueRanges.java
Last active December 16, 2023 09:12
java.time
package p_9386c3c805d7da9ebb7b7814daf688b3;
import java.io.IOException;
import java.time.DateTimeException;
import java.time.chrono.Chronology;
import java.time.temporal.ChronoField;
import java.time.temporal.ValueRange;
import java.util.function.BiConsumer;
public class ValueRanges {
@onacit
onacit / MyersBriggsTypeIndicator.java
Last active October 9, 2021 05:31
Myers–Briggs Type Indicator
package p_4cb92ba58cd8e8ab40d7e734e1f86ce1;
import javax.validation.constraints.NotNull;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import static java.util.Objects.requireNonNull;
@onacit
onacit / StemAndLeafDiagram.java
Last active September 19, 2020 08:16
The STEM-AND-LEAF diagram from The Cartoon Guide to Statistics by Larry Gonick & Woollcott Smith
package p_fd0b04b007e395a7fcfc5066898d422d;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
@onacit
onacit / ListOldBranchesFromBitBucket.py
Last active December 8, 2021 05:30
Lists old branches from BitBucket
import datetime
from datetime import timedelta
import getpass
import json
try:
import requests
except ImportError:
sys.exit("run pip install requests")
from requests.auth import HTTPBasicAuth
import sys
@onacit
onacit / CaesarCipher.java
Last active June 8, 2020 13:34
Caesar cipher
import java.util.Arrays;
import java.util.Objects;
public final class CaesarCipher {
/**
* Creates a new instance with specified shift.
*
* @param shift the shift
*/
class NumberCodec {
}
@onacit
onacit / Ieee754Binary16.java
Last active February 24, 2020 12:44
Half-precision floating-point in Java
package p_459caefadb7cee1b2aaa275bcb3013fc;
import static java.lang.Float.floatToIntBits;
import static java.lang.Float.intBitsToFloat;
import static java.lang.Math.pow;
import static java.lang.Math.scalb;
public class Ieee754Binary16 {//implements Comparable<Half> {
// -----------------------------------------------------------------------------------------------------------------
@onacit
onacit / Half.java
Created February 8, 2020 12:45
Half-precision floating-point in Java
public class Half {
}