2011년 10월 21일 금요일
2011년 10월 13일 목요일
자기혁명 -박경철-
요즘 어느 인터넷 서점을 가도 상위에 있는 그 책!
2011년 대한민국을 살아가는 청년들에게 무엇을 향해야 하는지, 어떻게 해야 하는지 길을 터주는 책이다.
이 몇 줄안되는 감상문 조차 몇번이고 다시 생각하고 다시 가다듬게 한다.
청년이란 말이 어울리지 않는 나이가 되어 버렸지만, 마음속에 잠자고 있던 청년의 열정을 다시 일깨워 줬다.
출퇴근 틈틈히 읽느라 4일이나 걸렸지만, 그 4일간의 시간덕에 앞으로의 30년을 바라볼 수 있게 되었다.
이 감사하는 마음을 어떻게 표현할 방법이 없어, 이렇게 몇 자 적어 창작의 고통을 미약하나마 공감해 본다.
2011년 10월 6일 목요일
ssh client에 있는 Xserver를 DISPLAY에 설정하기
ssh접속하는 경우에, DISPLAY를 자동으로 설정하게 하여서 추가적인 작업없이 Xserver를 바로 사용할 수 있게 하는 script. .bash_profile에 넣어두면 된다.
This bash script set "DISPLAY" environment variable automatically with your ssh client IP address. Put this line in ".bash_profile" if you want to run this whenever you login with ssh connection.
export DISPLAY=`echo $SSH_CLIENT |cut -d ' ' -f 1`:0.0
This bash script set "DISPLAY" environment variable automatically with your ssh client IP address. Put this line in ".bash_profile" if you want to run this whenever you login with ssh connection.
2011년 10월 5일 수요일
Eclipse Helios + CDT에서 tab as space설정
Window ->Preferences -> C/C++ -> Code Style
Profile에 있는 Edit...버튼
Profile name변경
Indentation탭 -> General settings에 있는 Tab policy에서 Spaces only선택
Open Window -> Preferences -> C/C++ -> Code Style dialog
Press "Edit..." button at the right of profile.
Edit profile name
Indentation tab -> General settings -> Tab policy : Select "Spaces only"
Profile에 있는 Edit...버튼
Profile name변경
Indentation탭 -> General settings에 있는 Tab policy에서 Spaces only선택
Open Window -> Preferences -> C/C++ -> Code Style dialog
Press "Edit..." button at the right of profile.
Edit profile name
Indentation tab -> General settings -> Tab policy : Select "Spaces only"
2011년 7월 28일 목요일
vim search pattern tips
1. regex 중 matching pattern reuse
1) %s/abcd\(.*\)z/aaaa\1a/g
--> "abcd"로 시작해서 "z"로 끝나는 문자열을 "aaaa"로 시작해서 "a"로 끝나는 문자열로 바꾼다.
--> 예) abcd1234z --> aaaa1234a, abcdefghi..z --> aaaaefghi..a
2) %s/abcd\(.*{1,10}\)123\(.*\)0/1234\1abc\2z/g
--> "abcd*123*0" 형태의 문자열을 "1234*abc*z"형태로 바꾼다.
--> 예) abcdefg1234560 --> 1234efgabc456z
1) %s/abcd\(.*\)z/aaaa\1a/g
--> "abcd"로 시작해서 "z"로 끝나는 문자열을 "aaaa"로 시작해서 "a"로 끝나는 문자열로 바꾼다.
--> 예) abcd1234z --> aaaa1234a, abcdefghi..z --> aaaaefghi..a
2) %s/abcd\(.*{1,10}\)123\(.*\)0/1234\1abc\2z/g
--> "abcd*123*0" 형태의 문자열을 "1234*abc*z"형태로 바꾼다.
--> 예) abcdefg1234560 --> 1234efgabc456z
2011년 7월 12일 화요일
bash : 특정 process status 표시하기
한줄 command로 특정 process status를 표시하는 방법.
$ ps -ef |grep [process_bin] |grep -v grep \
|cut -d ' ' -f 2 |xargs -i cat /proc/{}/status
|cut -d ' ' -f 2 |xargs -i cat /proc/{}/status
* cut 명령어 부분은 ps -ef의 표시 방법에 따라서 적절하게 변경해야 한다.
* grep명령어 부분은 grep [P]rocess_bin 과 같이 "[]"를 이용해서 하나로 쓸 수 있다.
ps | grep 사용하면서 grep process표시하지 않도록 하기
http://www.cyberciti.biz/tips/grepping-ps-output-without-getting-grep.html
example)
example)
$ ps -ef |grep [L]libraryLauncher
2011년 6월 20일 월요일
2011년 5월 16일 월요일
git for survival #2
1. Clone a specific branch(s)
$ git init
$ git remote add -t [branch0] -t [branch1] ... [remote_name] [git_url]
$ git fetch
$ git checkout -b [local_branch_name] [remote_name]/[remote_branch]
$ git remote add -t [branch0] -t [branch1] ... [remote_name] [git_url]
$ git fetch
$ git checkout -b [local_branch_name] [remote_name]/[remote_branch]
2011년 4월 29일 금요일
Print out template class info in C++
Use __PRETTY_FUNCTION__ in any where you want to print out.
This code will print out :
MyClass<T>::MyClass() [with T = int]
template <class T>
class MyClass {
public:
MyClass() { cout << __PRETTY_FUNCTION__ << endl; }
};
MyClass<int> myInstance;
...
class MyClass {
public:
MyClass() { cout << __PRETTY_FUNCTION__ << endl; }
};
MyClass<int> myInstance;
...
This code will print out :
MyClass<T>::MyClass() [with T = int]
라벨:
c++,
debug,
dev tip,
template class
2011년 4월 11일 월요일
슈퍼 자본주의
자본주의에 먹힌 민주주의
왜 임금은 제자리 인지, 왜 CEO들은 천문학적인 연봉을 받는지, 왜 부의 편중은 더 심해지는지...
현재의 사회, 경제, 정치 상황에 대해서 그 원인을 알려주고, 이러한 상황에서 민주주의의 역할은 무엇인지 알려주는 책이다.
현대의 정치, 경제, 사회의 상황 하에서 누구에게 어떤 역할과 무엇 요구해야 하는지 그 대상을 정확하게 가려낼 눈을 제시하고 있다.
정치인, 기업, 그리고 정치 경제적 주체로서의 자신이 어떻게 서로 연관되어 있는지 알기 위해서 꼭 읽어봐야 할 책!
2011년 3월 31일 목요일
linux time print out in C
format : YYYY-MM-DD HH:mm:ss:ms
#include <time.h>
#include <sys/time.h>
...
struct timeval tv;
struct tm *lt;
gettimeofday(&tv, 0);
lt = localtime(&(tv.tv_sec));
fprintf(stderr, " >> %4d-%02d-%02d %02d:%02d:%02d.%03d \n", 1900 + lt->tm_year, lt->tm_mon, lt->tm_mday, lt->tm_hour, lt->tm_min, lt->tm_sec, int(tv.tv_usec/1000.));
#include <sys/time.h>
...
struct timeval tv;
struct tm *lt;
gettimeofday(&tv, 0);
lt = localtime(&(tv.tv_sec));
fprintf(stderr, " >> %4d-%02d-%02d %02d:%02d:%02d.%03d \n", 1900 + lt->tm_year, lt->tm_mon, lt->tm_mday, lt->tm_hour, lt->tm_min, lt->tm_sec, int(tv.tv_usec/1000.));
라벨:
dev tip,
gettimeofday,
timer
2011년 3월 29일 화요일
2011년 3월 28일 월요일
sed for survival
1. What is sed?
1) stream editor
(1) input --(edited)--> output
2. Essential command
1) s : substitution
(1) 4 parts of command
a. s : command
b. /../../ : delimiter
c. ^fjdkal : regular expression pattern search pattern
d. fdjj : replacement string
(2) Use '/' as a delimiter
a. '\' : sed 's\/user\/local\/bin/common\/bin' <old >new
b. '_' : sed 's_/user_/local_/bin_/common_/bin' <old >new
c. ':' : sed 's:/user:/local:/bin/common:/bin' <old >new
d. '|' : sed 's|/user/local/bin|common/bin' <old > new
(3) Use '&' as matched string
a. add parenthesis to a pattern : sed 's/abc/(&)/' <old <new
- '&' means pattern, in this command, "abc"
2) '-e' command
(1) Combines multiple commands into a single process.
3) Substitute flags
(1) /g : global replacement, as in vi
3. Others
1) File names
(1) any argument that doesn't start with sed option, it is the file name.
2) -f : use sed command file
(1) sed -f sedcommands <old >new
3) '\' : to divide sed command into multiple lines.
4) Bourne shall(bash) quote : using ' to quote commands in multiple lines.
5) Restricting to a line number
(1) by number : sed '3 s/[0-9][0-9]*//' <old <new
a. remove the first number in the 3rd line.
(2) by pattern : sed '/^#/ s/[0-9][0-9]*//' <old <new
a. remove the first number which is starting with '#'.
1) stream editor
(1) input --(edited)--> output
2. Essential command
1) s : substitution
(1) 4 parts of command
a. s : command
b. /../../ : delimiter
c. ^fjdkal : regular expression pattern search pattern
d. fdjj : replacement string
(2) Use '/' as a delimiter
a. '\' : sed 's\/user\/local\/bin/common\/bin' <old >new
b. '_' : sed 's_/user_/local_/bin_/common_/bin' <old >new
c. ':' : sed 's:/user:/local:/bin/common:/bin' <old >new
d. '|' : sed 's|/user/local/bin|common/bin' <old > new
(3) Use '&' as matched string
a. add parenthesis to a pattern : sed 's/abc/(&)/' <old <new
- '&' means pattern, in this command, "abc"
2) '-e' command
(1) Combines multiple commands into a single process.
3) Substitute flags
(1) /g : global replacement, as in vi
3. Others
1) File names
(1) any argument that doesn't start with sed option, it is the file name.
2) -f : use sed command file
(1) sed -f sedcommands <old >new
3) '\' : to divide sed command into multiple lines.
4) Bourne shall(bash) quote : using ' to quote commands in multiple lines.
5) Restricting to a line number
(1) by number : sed '3 s/[0-9][0-9]*//' <old <new
a. remove the first number in the 3rd line.
(2) by pattern : sed '/^#/ s/[0-9][0-9]*//' <old <new
a. remove the first number which is starting with '#'.
Regular expression for survival
0. A truth for the regular expression
Regular expression is used to matching pattern in a line. (Not laid on multiple lines.)
1. The Structure of a regular expression
1) Anchors
(1) ^ : begin of a line
(2) $ : end of a line
(3) \< ... \> : word level matching.
2) Character sets
(1) . : any char except the EOL char.
(2) [...] : any char in brackets.
a. range : [a-z], [0-9], [A-Za-z0-9_]
b. order : "^T[a-z][aeiou] " : Tha, The, Thi, ...
(3) [^...] : negate pattern. except chars in brackets.
(4) \( ... \) : remembered pattern. use it with "\1 ~ \9"
3) Modifiers : follows a character set. if not, not a modifier.
(1) * : 0 or more copies
(2) {a,b} : # of copies between a and b.
Regular expression is used to matching pattern in a line. (Not laid on multiple lines.)
1. The Structure of a regular expression
1) Anchors
(1) ^ : begin of a line
(2) $ : end of a line
(3) \< ... \> : word level matching.
2) Character sets
(1) . : any char except the EOL char.
(2) [...] : any char in brackets.
a. range : [a-z], [0-9], [A-Za-z0-9_]
b. order : "^T[a-z][aeiou] " : Tha, The, Thi, ...
(3) [^...] : negate pattern. except chars in brackets.
(4) \( ... \) : remembered pattern. use it with "\1 ~ \9"
3) Modifiers : follows a character set. if not, not a modifier.
(1) * : 0 or more copies
(2) {a,b} : # of copies between a and b.
라벨:
dev tip,
regex,
regular expression
2011년 2월 9일 수요일
iTunes gift card 구매 대행 (South Korea)
이전에 대행 해주시던 분이 당분간 귀국하시는 바람에 새로 알게된 까페.
http://cafe.naver.com/buyappleitunes.cafe
2011-02-10 까지 행사중~!
http://cafe.naver.com/buyappleitunes.cafe
2011-02-10 까지 행사중~!
2011년 1월 19일 수요일
읽을 책 목록 20110119
어디사세요? *
행복은 혼자오지 않는다 *
대한민국 불공정 경제학 *
예수평전
행복의 지도
프리
생각의 속도로 실행하라
게으름에 대한 찬양
소유의 역습, 그리드 락
행복은 혼자오지 않는다 *
대한민국 불공정 경제학 *
예수평전
행복의 지도
프리
생각의 속도로 실행하라
게으름에 대한 찬양
소유의 역습, 그리드 락
Twitter favorite 정리 20110119
TV의 미래 - 퍼스널 TV
http://digxtal.egloos.com/2705436
3D carousel in JS
http://www.professorcloud.com/mainsite/carousel.htm
Async JS program
http://www.infoq.com/articles/surviving-asynchronous-programming-in-javascript
Javascript effects by css
http://speckyboy.com/2011/01/03/32-javascript-alternatives-with-pure-css-updated/
2010년 Top list
http://www.fimoculous.com/year-review-2010.cfm
올해의 책 No 5 (2010년)
http://inuit.co.kr/2038
iAD 개발용 툴 (Apple official)
http://developer.apple.com/iad/iadproducer/
Javascript 속도 향상을 위한 내용들이 있는 링크
http://blog.reybango.com/2010/12/15/what-to-read-to-get-up-to-speed-in-javascript/
HTML5 canvas tutorial
http://www.html5canvastutorials.com/
유용한 CSS tip & trick 100가지
http://sixrevisions.com/css/100-exceedingly-useful-css-tips-and-tricks/
아가들용 iPad app 스크린샷
http://p.xguru.net/69
개발자용 cheat sheet
http://devcheatsheet.com/
20년간 배운 20가지 programming교훈
http://www.dcs-media.com/Archive/20-20-top-20-programming-lessons-ive-learned-in-
20-years-FH
Programming windows phone 7
http://blogs.msdn.com/b/microsoft_press/archive/2010/10/28/free-ebook-programming-windows-phone-7-by-charles-petzold.aspx
http://digxtal.egloos.com/2705436
3D carousel in JS
http://www.professorcloud.com/mainsite/carousel.htm
Async JS program
http://www.infoq.com/articles/surviving-asynchronous-programming-in-javascript
Javascript effects by css
http://speckyboy.com/2011/01/03/32-javascript-alternatives-with-pure-css-updated/
2010년 Top list
http://www.fimoculous.com/year-review-2010.cfm
올해의 책 No 5 (2010년)
http://inuit.co.kr/2038
iAD 개발용 툴 (Apple official)
http://developer.apple.com/iad/iadproducer/
Javascript 속도 향상을 위한 내용들이 있는 링크
http://blog.reybango.com/2010/12/15/what-to-read-to-get-up-to-speed-in-javascript/
HTML5 canvas tutorial
http://www.html5canvastutorials.com/
유용한 CSS tip & trick 100가지
http://sixrevisions.com/css/100-exceedingly-useful-css-tips-and-tricks/
아가들용 iPad app 스크린샷
http://p.xguru.net/69
개발자용 cheat sheet
http://devcheatsheet.com/
20년간 배운 20가지 programming교훈
http://www.dcs-media.com/Archive/20-20-top-20-programming-lessons-ive-learned-in-
20-years-FH
Programming windows phone 7
http://blogs.msdn.com/b/microsoft_press/archive/2010/10/28/free-ebook-programming-windows-phone-7-by-charles-petzold.aspx
피드 구독하기:
글 (Atom)