본문 바로가기

Language78

[jQuery] input창 안에 태그 삽입하기 (stackoverflow badge) [구글 검색어]how to make badges in input [참고]https://stackoverflow.com/questions/45542228/how-to-make-badges-in-input-like-that-of-stack-overflow-tags-in-bootstraphttps://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/ 2018. 1. 15.
[Java] 문자열 입출력 (Scanner) [Java] 문자열 입출력 (Scanner) C에서 printf, scanf를 자주 이용한다. java에서는 Scanner클래스를 이용하여 입력을 쉽게 받을 수 있다. 우선, 출력은 간단해서 기억이 잘 날 것이다.System.out.println()을 이용한다. 1. Scanner를 사용한다. (좀 더 최근에 나온 객체)2. System.in.read() 함수 + BufferReader 혼용해서 사용한다. 1. Scanner 이용하기Scanner scan = new Scanner (System.in);String a = scan.nextLine(); // Enter 단위로 문자열을 읽는다.String b = scan.next(); // 공백 단위로 문자열을 읽는다. 2. System.in.read() 함.. 2017. 10. 14.
[Python] Except / File [Python] Except / FileExcept - except 12345678910111213141516171819#-*- coding: utf-8 -*-'''''' try: num1 = input("젯수 입력:") num2 = input("피젯수 입력:") print num2,"를", num1, "으로 나눈값:", num2/num1except ZeroDivisionError as zde: print "어떤수를 0으로 나눌수는 없습니다.", zdeexcept Exception as e: print "알수 없는 에러 발생!", eelse: print "오류없이 수행되었습니다."finally: print "오류발생과 상관없이 반드시 실행이 보장되는 블럭입니다." print "프로그램을 마무리 합니다.".. 2017. 8. 17.
[Python] Decorator [Python] Decorator Decorator - Decorator : 기존 코드에 여러 기능을 덧댈 수 있는 함수 - annotation을 이용하여 사용한다. - def 함수명(func):def wrapper(): 의 형태를 갖추고 있다.12345678910111213141516171819202122232425262728#-*- coding: utf-8 -*-''' - decorator 학습하기'''def helloBye(func): def wrapper(): print "hello" # helloBye 의 인자로 전달된 함수를 호출 func() print "bye" return wrapper @helloByedef f1(): print u"f1() 함수를 수행했습니다." def f2(): pri.. 2017. 8. 16.