Skip to content

Instantly share code, notes, and snippets.

View enif-lee's full-sized avatar
😁

enif.lee enif-lee

😁
View GitHub Profile
@enif-lee
enif-lee / settings.json
Last active February 4, 2017 15:29
Settings json file for java developer
{
"editor.tabSize": 3,
"editor.insertSpaces": false,
"editor.renderWhitespace": "boundary",
"editor.detectIndentation": false,
"editor.wrappingColumn": 1000,
"workbench.welcome.enabled": true,
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"explorer.openEditors.visible": 0
}
using System;
namespace Samples
{
/// <summary>
/// 동기적으로 재시도를 해야하는 경우 사용되는 retry 함수입니다.
/// </summary>
public class Retry
{
/// <summary>
public class LogUtil {
static int log2 (int number) {
int logCount = 0;
while(number>>=1 > 0) logCount++;
return logCount;
}
}
void move(int from, int to){
printf("\nMove from %d to %d", from, to);
}
// n개의 원반을 from 에서 by를 거쳐 to로 옮긴다.
void hanoi(int n, int from, int by, int to){
if (n == 1)
move(from, to);
else{
hanoi(n - 1, from, to, by); // 1번 N-1개의 원반을 기둥3을 거쳐 2로 옮긴다.
class TestTimeout
{
static void Main(string[] args)
{
new Timeout(
start: () =>
{
Thread.Sleep(10000);
Console.WriteLine("it's working!");
},
public class LogUtil {
static int log2 (int number) {
int logCount = 0;
if(65536 <= number) { logCount += 16; number >>= 16; }
if(256 <= number) { logCount += 8; number >>= 8; }
if(16 <= number) { logCount += 4; number >>= 4; }
if(4 <= number) { logCount += 2; number >>= 2; }
return logCount + (2 <= number ? 1 : 0);
}
}
package problem.boj;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Scanner;
/**
* Created by Jinseoung on 2017-01-01.
*/
package problem.boj;
import java.util.Scanner;
/**
* Created by Jinseoung on 2017-01-01.
*/
public class ValueToAnagram {
static Scanner sc = new Scanner(ClassLoader.getSystemResourceAsStream("problem/boj/ValueToAnagram.testcase"));
package problem.boj;
import java.util.Scanner;
/**
* Created by Jinseoung on 2017-01-01.
*/
public class AnagramDistance {
static Scanner sc = new Scanner(ClassLoader.getSystemResourceAsStream("problem/boj/AnagramDistance.testcase"));
package problem.boj;
import java.util.Scanner;
/**
* Created by Jinseoung on 2017-01-01.
*/
public class Anagram {
static boolean isAnagram (String s1, String s2) {