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
import java.io.FileReader; | |
import java.io.BufferedReader; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.util.Map; | |
import java.util.Map.Entry; | |
import java.util.HashMap; | |
import java.util.Scanner; | |
class User { |
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 Test { | |
public static boolean endsWith(String src, String postfix) { | |
if (src.length() < postfix.length()) { | |
return false; | |
} | |
for (int i = 0; i < postfix.length(); i++) { | |
int idx = src.length() - postfix.length() + i; | |
char ch1 = src.charAt(idx); | |
char ch2 = postfix.charAt(i); |
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
import java.util.Scanner; | |
import java.util.List; | |
import java.util.ArrayList; | |
public class SumNumber { | |
public static void main(String [] args) { | |
Scanner sc = new Scanner(System.in); | |
List<Integer> values = new ArrayList<Integer>(); |
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
import java.util.Scanner; | |
public class ConvertNumber { | |
public static String convertNumber(String word) { | |
String convertedWord = ""; | |
for (int i = 0; i < word.length(); i++) { | |
char ch = word.charAt(i); | |
if (ch >= '0' && ch <= '9') { | |
ch = '$'; | |
} |
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
import java.util.Scanner; | |
import java.util.Map; | |
import java.util.HashMap; | |
class AddressBook { | |
private String name; | |
private String phone; | |
public AddressBook(String name, String phone) { | |
this.name = name; |
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
import java.util.Scanner; | |
import java.util.Map; | |
import java.util.HashMap; | |
class AddressBook { | |
private String name; | |
private String phone; | |
public AddressBook(String name, String phone) { | |
this.name = name; |
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
import java.util.Scanner; | |
public class AddressBook { | |
private String name; | |
private String phone; | |
public AddressBook(String name, String phone) { | |
//Implement this function | |
} |
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
import java.util.Scanner; | |
public class Test { | |
public static void main(String...args) { | |
Scanner sc = new Scanner(System.in); | |
byte bv = sc.nextByte(); | |
// 0b10000000 은 이진수로 1000 0000 을 의미합니다. | |
// & 연산을 통해서 첫번째 비트만 가져오는 것입니다. | |
System.out.printf("%d", (bv & 0b10000000) >> 7); // Byte의 가장 앞 bit를 출력하는 부분 |
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
import java.util.Scanner; | |
public class ShowByteBits { | |
public static void main(String [] args) { | |
Scanner sc = new Scanner(System.in); | |
byte bv = sc.nextByte(); | |
System.out.printf("%d", (bv & 0x80) >> 7); // Byte의 가장 앞 bit를 출력하는 부분 | |
// 이 사이에 나머지 6bit를 출력하게 만들면 됩니다. |
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
from flask import Flask | |
import redis | |
import kazoo | |
app = Flask(__name__) | |
from kazoo.client import KazooClient | |
import logging | |
zk = KazooClient(hosts='127.0.0.1:2181') |