4월 8, 2018의 게시물 표시

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 ...

자릿수반환하기

public static int[] getNumbers(int number) { /*String[] strArr = String.valueOf(number).split(""); int[] result = new int[strArr.length]; for (int i = 0; i < strArr.length; i++) { result[i] = Integer.valueOf(strArr[i]); } return result;*/ List list = new ArrayList (); while(number!= 0) { list.add(number%10); number = number/10; } Collections.reverse(list); int[] result = new int[list.size()]; for (int i = 0; i < list.size(); i++) { result[i] = list.get(i); } return result; }

pattern 정규화 표현식 완전정복

http://highcode.tistory.com/6

정규식 pattern으로 확장자 골라내기

public boolean test(String str) { String allowPattern = ".+\\.(gul|ppt|xls|hwp|jpg|zip|tif|alz|bmp|pdf)$"; boolean result = false;         Pattern p = Pattern.compile(allowPattern);         Matcher m = p.matcher(str);         result = m.matches(); return result; }

oracle over함수 쓰임새

http://androphil.tistory.com/167 http://tibang.tistory.com/entry/%EC%98%A4%EB%9D%BC%ED%81%B4-%EB%B6%84%EC%84%9D-%ED%95%A8%EC%88%98-RANK-OVER-ROWNUMBER-OVER

math 함수 쓰기

Math함수 abs(double a) : 절대값 ceil(double a) : 값올림 floor(double a) : 값내림 round(double a):반올림 max(double a, double a) : 큰쪽반환 mins(double a, double b): 작은값 pow(double a, double b) : a의 b제곱 random() : 0~1사이 값을 랜덤으로 반환

not in, not exist의 차이 (null값이 있는 경우, not in은 null값을 없는값으로 침)

http://www.kkomzi.net/wordpress/128

sql like구문

http://makand.tistory.com/entry/SQL-LIKE-%EA%B5%AC%EB%AC%B8

between함수 사용하기

http://makand.tistory.com/entry/SQL-BETWEEN-%EA%B5%AC%EB%AC%B8

index를 효율적으로 선언하는방법( =, >= , between)

http://topboy.tistory.com/362

index를 타지 않는 경우

http://isstory83.tistory.com/131

Index 정리

http://hyun0412.tistory.com/entry/oracle-index-%EC%A0%95%EB%A6%AC

nvl, nvl2,

http://www.gurubee.net/lecture/1880

order by 와 distinct , having절, group by

http://www.gurubee.net/lecture/1032

union 설명(union, unionall, intersect, minus..)

http://preamtree.tistory.com/45

sql 서브쿼리

http://snowple.tistory.com/360

join 자세한설명_집합과비교(그림까지 같이 잘 나옴)

http://rapapa.net/?p=311

join(inner, left outer, right lefter) 설명

http://clairdelunes.tistory.com/22

IE 노테이션 관계(Relationship) 표기법

http://www.devtimes.com/115

문자열 반복하기 String메소드이용

ava 1.5이상에서  repeated = new String(new char[n]).replace("\0", s);  이런 식으로 하시면 됩니다. n은 문자열 s를 몇번 반복할건지에 대한 변수입니다. repeated = new String(new char[n]).replace("\0", s);

String 함수

startWith:  문자열이 지정한 문자로 시작하는지 판단 같으면 true반환 아니면 false를 반환한다.(대소문자구별) ? 1 2 3 String str = "apple" ; boolean startsWith = str.startsWith( "a" ); System.out.println( "startsWith: " + startsWith); 결과값:true endWith: 문자열 마지막에 지정한 문자가 있는지를 판단후 있으면 true, 없으면 false를 반환한다.(대소문자구별) ? 1 2 3 String str = "test" ; boolean endsWith = str.endsWith( "t" ); System.out.println( "endsWith: " + endsWith); 결과값:true equals: 두개의 String에 값만을 비교해서 같으면 true, 다르면 false를 반환한다.(대소비교) ? 1 2 3 4 String str1 = "java" ; String str2 = "java" ; boolean equals = str1.equals(str2); System.out.println( "equals: " + equals); 결과값:true indexOf: 지정한 문자가 문자열에 몇번째에 있는지를 반환한다. ? 1 2 3 String str = "abcdef" ; int indexOf = str.indexOf( "d" ); System.out.println( "indexOf: " + indexOf); 결과값...