10진수->2, 16, 8진수 변환

http://donggov.tistory.com/48

CREATE table

http://hyeonstorage.tistory.com/291

UPDATE, INSERT, UPDATE문

 UPDATE UPDATE  table SET        column = value [, column = value, ...] [ WHERE  condition]; 예)  UPDATE  employees       SET        department_id = 70       WHERE    employee_id = 113; WHERE 절을 생략하면 데이틀의 모든 행이 수정된다. 예)  UPDATE  copy_emp       SET        department_id = 110; 서브쿼리를 이용한 UPDATE UPDATE  copy_emp SET        department_id = (SELECT department_id                                       FROM     employees                                                           ...

File읽기, 쓰기, 처리하기

https://tec.lgcns.com/pages/viewpage.action?pageId=9682895 텍스트 파일 한 번에 모두 읽기 (Utility 타입) 대용량 파일일 때는 메모리가 부족할 수 있으므로 ' 텍스트 파일 라인 단위로 읽어서 처리 ' 방식을 사용 ? public static String read(String filePath) throws IOException {        StringBuilder  stringBuilder;      FileReader     fileReader     = null ;      BufferedReader bufferedReader = null ;      try {          stringBuilder  = new StringBuilder();          fileReader     = new FileReader(filePath);          bufferedReader = new BufferedReader(fileReader);          String line;          while ((line = bufferedReader.readLine()) != null ) ...

pk, fk, unique의 제약조건

http://egloos.zum.com/sweeper/v/3005563

자바 stack 사용하기

import java.util.Stack; public class StackExample {     public static void main(String[] args) {         Stack stack = new Stack<>();                  // 데이터 입력         stack.push(5);         stack.push(4);         stack.push(3);         stack.push(2);         stack.push(1);                  // 데이터 출력         System.out.println("마지막에 넣은 데이터부터 출력..");         System.out.println(stack.pop());         System.out.println(stack.pop());         System.out.println(stack.pop());         System.out.println(stack.pop()); ...

10진수<->2진수, 8진수, 16진수

자바 2진수, 8진수, 16진수 변환 시에는 Integer 클래스 API를 활용하면 편하다. (참고 :  https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html ) 10진수 -> 2진수, 8진수, 16진수 변환 1 2 3 4 5 6 7 8 int  num  =   77 ; String  a2  =  Integer.toBinaryString(num);   // 10진수 -> 2진수 String  a8 =  Integer.toOctalString(num);     // 10진수 -> 8진수 String  a16  =  Integer.toHexString(num);     // 10진수 -> 16진수 System . out . println ( "2 진수 : "   +  a2); System . out . println ( "8 진수 : "   +  a8); System . out . println ( "16 진수 : "   +  a16); cs 결과 1 2 3 2  진수 :  1001101 8  진수 :  115 16  진수 : 4d 2진수, 8진수, 16진수 -> 10진수로 변환 1 2 3 4 5 6 7 8 ...

MyLogger만들어서 print하기

public class MyLogger { private static boolean print = true; public static void Log(String str) { if(print) { System.out.println(str); } } public static void Log(String str, boolean flag) { if(print) { if(flag) System.out.println(str); } } }

동적프로그래밍(동전)

https://gist.github.com/developer-sdk/65e7f5491489a747040b1dd532cc7450

insert, update의 외래키 제약조건

http://tibang.tistory.com/entry/%EC%B0%B8%EC%A1%B0%ED%82%A4%EC%99%B8%EB%9E%98%ED%82%A4-FORIGN-KEY

String format 사용하기

http://blog.devez.net/100

최소공배수, 최대공약수

// 최소 공배수 계산 메서드   // 최소공배수는 엄청나게 큰 숫자가 나올 수도 있기에   // long형으로 다루어야 합니다.   public static long lcm(long a, long b) {     int gcd_value = gcd((int)a, (int)b);     if (gcd_value == 0) return 0; // 인수가 둘다 0일 때의 에러 처리     return Math.abs( (a * b) / gcd_value );   }   // 최대 공약수 계산 함수; 최소 공배수 계산에 필요함   // 최대 공약수는 그리 큰 숫자가 나오지 않기에 int형으로   public static int gcd(int a, int b) {     while (b != 0) {       int temp = a % b;       a = b;       b = temp;     }     return Math.abs(a);   } ============================================================================= 재귀함수로 최대공약수 구하기 public  static int getGcd ( int x ,  int y )      {          if ( x  %  y  ==   0 )   return  y ;          return  getGcd ( y ,  x ...