Skip to content

Instantly share code, notes, and snippets.

import java.util.Scanner;
/**
* Created by yaboong on 2018. 2. 26..
*/
public class ToOne {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
import java.util.Scanner;
public class TwoByNTiling11726 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
long d[] = new long[N+1];
d[0] = 1;
@yaboong
yaboong / CountingSort.java
Created March 20, 2018 10:26
Counting Sort
import java.util.Arrays;
import java.util.Collections;
/**
* Created by yaboong on 2018. 3. 20..
*/
public class CountingSort {
public static void main(String[] args) {
Integer[] a = {1, 0, 3, 1, 3, 1};
@yaboong
yaboong / CountingSortBig.java
Last active March 20, 2018 10:57
Counting Sort for Big Integers
import java.util.*;
/**
* Created by yaboong on 2018. 3. 20..
*/
public class CountingSortBig {
public static void main(String[] args) {
Integer[] a = {Integer.MAX_VALUE - 1000, Integer.MAX_VALUE, Integer.MAX_VALUE-100};
a = sort(a);
@yaboong
yaboong / count_project_code_lines.py
Created March 29, 2018 16:19
프로젝트 전체 코드 라인수 카운트 해보기
import glob
import operator
# 조사할 디렉토리 경로
ROOT_DIR = '/Users/yaboong/DevWorkspace/eclipse-workspace/sagenet/src/main'
# 조사할 확장자 목록
extensions = [
'*.java',
'*.xml',
@yaboong
yaboong / Dockerfile
Created July 29, 2018 17:05 — forked from yefim/Dockerrun.aws.json
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
# Example Dockerfile
FROM hello-world
@yaboong
yaboong / build.gradle
Created June 5, 2019 01:47 — forked from arcezd/build.gradle
Build Gradle to read yaml properties [Gradle 2.13]
import org.yaml.snakeyaml.DumperOptions
import org.yaml.snakeyaml.Yaml
buildscript{
ext{
springBootVersion = '1.5.7.RELEASE'
}
repositories{
mavenCentral()
}
public static void sort(Integer[] a, int len) {
if (len <= 1) {
return;
}
boolean swapped = false;
for (int i=1; i<len; i++) {
if (a[i-1] > a[i]) {
swap(a, i, i-1);
swapped = true;
public static void sort(Integer[] a) {
int swapCount;
do {
swapCount = 0;
for (int i=1; i<a.length; i++) {
if (a[i-1] > a[i]) {
swap(a, i-1, i);
swapCount++;
}
}
@yaboong
yaboong / gist:45feed8ead1290ca3a5845395bd57531
Created February 26, 2020 09:43
MacOS X nginx SSL Proxy Setup

#Installing nginx on OS X

brew install nginx
sudo cp -v /usr/local/opt/nginx/*.plist /Library/LaunchDaemons/
sudo chown root:wheel /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
mkdir -p /usr/local/etc/nginx/logs
mkdir -p /usr/local/etc/nginx/sites-available
mkdir -p /usr/local/etc/nginx/sites-enabled
mkdir -p /usr/local/etc/nginx/conf.d
mkdir -p /usr/local/etc/nginx/ssl