라벨이 잡다한인 게시물 표시

블로거에 마크다운으로 글 작성하기

http://dillinger.io/ 저기서 마크다운으로 작성한 다음에 HTML로 바꿔서 적으면 된다 테스트 : Untitled Document.md Hello World Hello world Hello world apple banana italic bold npm start show me the money black sheep wall function sayHello ( ) { console .log( 'hello world' ); } sayHello(); for ( int i = 0 ; i < n; ++i) { puts ( "Hello World" ); } <addr> 뭔가 애매하게 되는데 만족스럽다.

vim 단축키 / 명령어 모음

http://gyuha.tistory.com/157

Stack Overflow에서 쓰는 코드표시 스타일

<pre style="background-color: #eeeeee; border: 0px; color: #111111; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;">여기에 코드를 씁니다.</code></pre> 여기에 코드를 씁니다.

우분투 부팅이나 드라이브 연결 됐을때 자동으로 mount 되게 하는 방법

/etc/fstab 파일을 수정한다. <file system> <moutn point> <type> <options> <dump> <pass> 형식 외장하드의 경우 언제 연결 되도 일정한 곳에 mount 되게 하기 위해서 file system에 UUID를 사용하는것이 좋은듯 하다. UUID는 ls -ail /dev/disk/by-uuid 하면 볼 수 있다. (LABEL도 가능하다고 한다) sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL로 보고 맞춰서 하자. 예)UUID=136c242f-ce81-528e-a921-682c6fad9f26    /home    ext4    defaults    1     2 자세한것은 man fstab

파이썬 재귀 최대깊이 지정 sys.setrecursionlimit( limit )

https://docs.python.org/2/library/sys.html#sys.setrecursionlimit https://www.acmicpc.net/problem/1012 파이썬 써본지 얼마 안되서 DFS를 구현하는 문제를 풀었는데 알고리즘상에 문제가 없어보이는데 자꾸 오답이 나왔다. 무슨 문젠가 몇시간 동안 고민했는데 이유는 재귀깊이 한계치가 작아서였다. import sys sys.setrecursionlimit(10**6) 을 추가해줬더니 정답처리 됐다. import sys sys.setrecursionlimit( 10 * * 6 ) bat = [] dx = [ 0 , 1 , 0 , - 1 ] dy = [ 1 , 0 , - 1 , 0 ] M = N = K = 0 def dfs ( x , y ): bat[x][y] = 0 for k in range ( 4 ): i = x + dx[k] j = y + dy[k] if (i >= M or i < 0 or j >= N or j < 0 ): continue if (bat[i][j] == 1 ): dfs(i,j) return for t in range ( input ()): (M,N,K) = map ( int , raw_input ().split()) cnt = 0 bat = [[ 0 for j in range (N + 1 )] for i in range (M + 1 )] for i in range (K): (a,b) = map ( int , raw_input ().split()) bat[a][b] = 1 for i in range (M): for j in range (N): if...

아파치서버에서 특정 페이지 접속이 잘 안될 때

특정 페이지 접속이 계속 잘 되지 않았는데 단순히 페이지 html 이름을 바꿨더니 정상적으로 작동한다. 이유는 알 수 없다.

안드로이드 상단 타이틀바 없애는 방법

manifest에서 android:theme="@android:style/Theme.NoTitleBar"

안드로이드 WebView에서 키보드 입력 할 때 resize 되게 하면 zoom이 되는 현상 해결방법

<meta name="viewport" content="width=device-width, initial-scale=1"> 에 content 부분에 user-scalable=no 추가하면 된다.

부팅 할 때 네트워크 연결 안되면 오래 기다리는 문제

/etc/init/failsafe.conf  에서 sleep 부분의 숫자를 바꾸거나 주석처리하면 된다.

인터넷에서 사용가능한 Syntax highlighter

http://markup.su/highlighter/

Valgrind - 메모리 누수를 잡아주는 툴

http://www.valgrind.org/ C나 C++로 프로그래밍을 하다보면 동적할당을 해놓고는 해제를 해주지 않는 경우가 더러 생긴다. Valgrind를 사용하면 이러한 메모리 누수를 체크할 수 있다.

코드블락에서 C++11 사용하기

Settings - Compiler 에서 Have g++ follow the C++11 ISO C++ language standard [-std=c++11] 체크

algorithm >> next_permutation

해당하는 구간의 순열을 알아서 만들어준다. 자세한것은 http://www.cplusplus.com/reference/algorithm/next_permutation/ 내부구현은 http://stackoverflow.com/questions/11483060/stdnext-permutation-implementation-explanation 이런식이라고 한다. next_permutation을 활용한 소스 https://www.acmicpc.net/problem/1007 # include <cstdio> # include <algorithm> # include <cmath> # include <vector> using namespace std; struct Point{ int x; int y; Point (){ x=0;y=0; } Point (int _x, int _y){ x=_x; y=_y; } Point operator + (Point p){ Point ans; ans.x = x + p.x; ans.y = y + p.y; return ans; } Point operator - (Point p){ Point ans; ans.x = x-p.x; ans.y = y-p.y; return ans; } void init (){ x=0; y=0; } double scalar (){ return sqrt((double)x*x+(double)y*y); } }; void pointInit (Point point[]){ for(int i=0;i<22;++i)point[i...