본문 바로가기

개발 개발

ffmpeg 인덱스 재생성 for single play (no fix): mplayer -idx myvideo.avi fix it: mencoder -oac copy -ovc copy infile.avi -o outfile.avi in case of serious damage use ffmpeg which is more fault tolerant: ffmpeg -i infile.avi -acodec copy -vcodec copy -o outfile.avi save index: mplayer -idx myvideo.avi -saveidx myvideo.idx use saved index: mplayer myvideo.avi -loadidx myvideo.idx 더보기
UPnP - Microsoft 싸이트 설명 더보기
java에서 타 프로그램 실행후 바로 종료 할려면.. But first I had to go through a buttload of pain using JNI, which I THOUGHT would be the best bet. Then I realized where the solution lies. The first app that uses this update utility I'm writing will be a program that presents a popup menu in the Windows system tray and allows you to open URLs and documents and launch programs from it. Well, the main app calls RUNDLL32.EXE, a Windows program th.. 더보기
Java 메모리와 관련하여 출처 : http://kin.naver.com/qna/detail.nhn?d1id=1&dirId=1040201&docId=119242753&qb=bWF4TWVtb3J5KCk=&enc=utf8&section=kin&rank=2&search_sort=0&spq=0&pid=gldVtv331y0sss1cZ9Rssv--259433&sid=TgQq-6koBE4AAChyBo4 메모리와 관련하여 1. 객체를 사용하고 나서 null 할당하는건 코드만 더럽히는 짓이다 vs 꼭꼭 null 처리해주는 좋은습관! 2. null 을 할당하는것은 별 의미없다 vs 이건 정말 중요하다 3. null 을 할당한다면 언제 할당해야 하느냐? 이런것들은 자바를 사용하는 개발자들 사이에서 오랫동안 논란이 되어왔고 아직도 논란이 되고 있는 부.. 더보기
MySQL Backup/Restore 출처 : http://maxnim.blogspot.com/2011/02/mysql-backuprestore.html MySQL 백업은 의외로 쉽고 단순하다. mysqldump라는 프로그램을 이용하면 되는데 보통 cron을 이용해서 자동으로 백업파일을 만든 뒤 FTP나 NFS를 이용해서 백업 서버로 복사하는 방법을 많이 사용한다. http://www.devshed.com/c/a/MySQL/Backing-up-and-restoring-your-MySQL-Database/ * Backup with drop table SQL # mysqldump -u [username] -p [password] [database_name] > backup.sql # mysqldump --add-drop-table -u [use.. 더보기
[JAVA] 나쁜 코드 사례 원문 출처: http://www.odi.ch/prog/design/newbies.php#31 번역 출처: http://jnylove.tistory.com/192 # String concatenation - very bad code String s = ""; for (Person p : persons) { s += ", " + p.getName(); } s = s.substring(2); //remove first comma 이건 정말 멍청한 짓이다. loop 안에서 String의 concatenation을 반복하는 것은 쓰잘데기 없는 array copy와 garbage를 남발하는 것이다. 게다가, 마지막에 콤마를 제거하는 연산을 한 번 더 해줘야 한다. - better code StringBuilder .. 더보기
byte <-> ArrayList ArrayList -> Byte[] -> ArrayList 이걸 원하시죠? API로 바로 설명드립니다. ArrayList arrayList 는 있다고 가정.. Byte[] bytes = (Byte[]) arrayList.toArray(); // ArrayList -> Byte[] arrayList = new ArrayList(Arrays.asList(bytes )); // Byte[] -> ArrayList 만약 프리미티브 byte[]로 전환하고자 하신다면, Bytes[X].byteValue() 를 X값을 루프를 돌면서 복사해주면됩니다. 더보기
Locale 변경하기 android/build/target/product/core.mk PRODUCT_LOCALES := \ ko_KR \ en_US 더보기