Skip to content

Instantly share code, notes, and snippets.

@yaboong
yaboong / BCrypt.java
Created January 3, 2017 07:01 — forked from coderberry/BCrypt.java
BCrypt.java
// Copyright (c) 2006 Damien Miller <djm@mindrot.org>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
@yaboong
yaboong / CorisFilter.java
Created January 9, 2017 08:13 — forked from kdonald/CorisFilter.java
Basic Cross Origin Resource Sharing (CORS) support
package org.springframework.web.servlet.support;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.filter.OncePerRequestFilter;
@yaboong
yaboong / (01장) 기본기.scala
Created February 20, 2017 12:13 — forked from kwon37xi/(01장) 기본기.scala
쉽게 배워서 빨리 써먹는 Scala 프로그래밍 연습문제 풀이
/** Chapter 01 **/
/*
문제에 오역이 좀 있다. 아래에서 문제 자체를 검색해서 확인해 볼 것.
Java 7 이상에서 실행할 것.
https://www.google.co.kr/search?client=ubuntu&channel=fs&q=scala+for+the+impatient+exercise&ie=utf-8&oe=utf-8&gws_rd=cr&redir_esc=&ei=oqvrUb-1B6LwiQfjk4GQBg
Scala Doc : http://www.scala-lang.org/api/current/index.html
*/
package cc.yaboong.algorithms.sort;
import java.util.Arrays;
import java.util.Collections;
/**
* Created by yaboong on 2018. 2. 18..
*/
public class QuickSort {
public static void sort(Comparable[] a) {
package cc.yaboong.algorithms.sort;
import java.util.Arrays;
/**
* Created by yaboong on 2018. 2. 14..
*/
public class MergeSort {
// 병합하면서 정렬한다
private static void merge(Comparable[] a, Comparable[] aux, int lo, int mid, int hi){
import java.util.LinkedList;
/**
* Created by yaboong on 2018. 2. 19..
*/
public class Graph {
private final int V;
private LinkedList<Integer>[] adj;
public Graph(int V) {
@yaboong
yaboong / merge.java
Last active February 18, 2018 19:39
Test.java
merge
merge
merge
merge
import java.util.Arrays;
/**
* Created by yaboong on 2018. 1. 15..
*/
public class InsertionSort {
public static void insertionSort(Comparable[] arr){
int N = arr.length;
for(int i = 0; i < N; i++){
for(int j = i; j > 0; j--){
@yaboong
yaboong / SelectionSort.java
Created February 18, 2018 20:07
Selection Sort
import java.util.Arrays;
/**
* Created by yaboong on 2018. 1. 15..
*/
public class SelectionSort {
public static void selectionSort(Comparable[] arr){
int N = arr.length;
for (int i = 0; i < N; i++){
int min = i;
@yaboong
yaboong / BubbleSort.java
Created February 18, 2018 20:08
Bubble Sort
import java.util.Arrays;
/**
* Created by yaboong on 2018. 2. 14..
*/
public class BubbleSort {
public static void bubbleSort(int[] arr) {
int temp = 0;
for(int i = 0; i < arr.length; i++) {
for(int j= 1 ; j < arr.length-i; j++) {