-u Use the unified output format.
-r When comparing directories, recursively compareany subdirectories found.
-N
--new-file
In directory comparison, if a file is found in only one directory, treat it as present but empty in the
other directory.
일반적으로 GNU 프로젝트의 패치로 사용하는 옵션이라고 한다.
-u는 unified 포맷 출력
-r은 디렉토리 비교
-N은 새 파일이 있을시 없는쪽은 비어있는 파일로 간주하고 비교함
간단하게 전부 내용이 추가된걸로 표시된다. 이러한 옵션 없이 diff하면 아래와 같이 빈 파일이 출력된다.
Only in linux-2.6.17.14_stm22_0039_STFAE: .config2
DESCRIPTION
In the simplest case, diff compares the contents of the two files from-file and to-file. A file name of - stands
for text read from the standard input. As a special case, diff - - compares a copy of standard input to itself.
If from-file is a directory and to-file is not, diff compares the file in from-file whose file name is that of
to-file, and vice versa. The non-directory file must not be -.
If both from-file and to-file are directories, diff compares corresponding files in both directories, in alpha-
betical order; this comparison is not recursive unless the -r or --recursive option is given. diff never com-
pares the actual contents of a directory as if it were a file. The file that is fully specified may not be stan-
dard input, because standard input is nameless and the notion of ‘‘file with the same name’’ does not apply.
diff options begin with -, so normally from-file and to-file may not begin with -. However, -- as an argument by
itself treats the remaining arguments as file names even if they begin with -.
Options
Below is a summary of all of the options that GNU diff accepts. Most options have two equivalent names, one of
which is a single letter preceded by -, and the other of which is a long name preceded by --. Multiple single
letter options (unless they take an argument) can be combined into a single command line word: -ac is equivalent
to -a -c. Long named options can be abbreviated to any unique prefix of their name. Brackets ([ and ]) indicate
that an option takes an optional argument.
-lines Show lines (an integer) lines of context. This option does not specify an output format by itself; it has
no effect unless it is combined with -c or -u. This option is obsolete. For proper operation, patch typ-
ically needs at least two lines of context.
-a Treat all files as text and compare them line-by-line, even if they do not seem to be text.
-b Ignore changes in amount of white space.
-B Ignore changes that just insert or delete blank lines.
--brief
Report only whether the files differ, not the details of the differences.
-c Use the context output format.
-C lines
--context[=lines]
Use the context output format, showing lines (an integer) lines of context, or three if lines is not
given. For proper operation, patch typically needs at least two lines of context.
--changed-group-format=format
Use format to output a line group containing differing lines from both files in if-then-else format.
-d Change the algorithm to perhaps find a smaller set of changes. This makes diff slower (sometimes much
slower).
-D name
Make merged if-then-else format output, conditional on the preprocessor macro name.
-e
--ed Make output that is a valid ed script.
--exclude=pattern
When comparing directories, ignore files and subdirectories whose basenames match pattern.
--exclude-from=file
When comparing directories, ignore files and subdirectories whose basenames match any pattern contained in
file.
--expand-tabs
Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files.
-f Make output that looks vaguely like an ed script but has changes in the order they appear in the file.
-F regexp
In context and unified format, for each hunk of differences, show some of the last preceding line that
matches regexp.
--forward-ed
Make output that looks vaguely like an ed script but has changes in the order they appear in the file.
-h This option currently has no effect; it is present for Unix compatibility.
-H Use heuristics to speed handling of large files that have numerous scattered small changes.
--horizon-lines=lines
Do not discard the last lines lines of the common prefix and the first lines lines of the common suffix.
-i Ignore changes in case; consider upper- and lower-case letters equivalent.
-I regexp
Ignore changes that just insert or delete lines that match regexp.
--ifdef=name
Make merged if-then-else format output, conditional on the preprocessor macro name.
--ignore-all-space
Ignore white space when comparing lines.
--ignore-blank-lines
Ignore changes that just insert or delete blank lines.
--ignore-case
Ignore changes in case; consider upper- and lower-case to be the same.
--ignore-matching-lines=regexp
Ignore changes that just insert or delete lines that match regexp.
--ignore-space-change
Ignore changes in amount of white space.
--initial-tab
Output a tab rather than a space before the text of a line in normal or context format. This causes the
alignment of tabs in the line to look normal.
-l Pass the output through pr to paginate it.
-L label
--label=label
Use label instead of the file name in the context format and unified format headers.
--left-column
Print only the left column of two common lines in side by side format.
--line-format=format
Use format to output all input lines in in-then-else format.
--minimal
Change the algorithm to perhaps find a smaller set of changes. This makes diff slower (sometimes much
slower).
-n Output RCS-format diffs; like -f except that each command specifies the number of lines affected.
-N --new-file In directory comparison, if a file is found in only one directory, treat it as present but empty in the other directory.
--new-group-format=format
Use format to output a group of lines taken from just the second file in if-then-else format.
--new-line-format=format
Use format to output a line taken from just the second file in if-then-else format.
--old-group-format=format
Use format to output a group of lines taken from just the first file in if-then-else format.
--old-line-format=format
Use format to output a line taken from just the first file in if-then-else format.
-p Show which C function each change is in.
-P When comparing directories, if a file appears only in the second directory of the two, treat it as present
but empty in the other.
--paginate
Pass the output through pr to paginate it.
-q Report only whether the files differ, not the details of the differences.
-r When comparing directories, recursively compare any subdirectories found.
--rcs Output RCS-format diffs; like -f except that each command specifies the number of lines affected.
--recursive
When comparing directories, recursively compare any subdirectories found.
--report-identical-files
-s Report when two files are the same.
-S file
When comparing directories, start with the file file. This is used for resuming an aborted comparison.
--from-file=file
Compare file to all operands. file can be a directory.
--to-file=file
Compare all operands to file. file can be a directory.
--sdiff-merge-assist
Print extra information to help sdiff. sdiff uses this option when it runs diff. This option is not
intended for users to use directly.
--show-c-function
Show which C function each change is in.
--show-function-line=regexp
In context and unified format, for each hunk of differences, show some of the last preceding line that
matches regexp.
--side-by-side
Use the side by side output format.
--speed-large-files
Use heuristics to speed handling of large files that have numerous scattered small changes.
--starting-file=file
When comparing directories, start with the file file. This is used for resuming an aborted comparison.
--suppress-common-lines
Do not print common lines in side by side format.
-t Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files.
-T Output a tab rather than a space before the text of a line in normal or context format. This causes the
alignment of tabs in the line to look normal.
--text Treat all files as text and compare them line-by-line, even if they do not appear to be text.
-u Use the unified output format.
--unchanged-group-format=format
Use format to output a group of common lines taken from both files in if-then-else format.
--unchanged-line-format=format
--suppress-common-lines
Do not print common lines in side by side format.
-t Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files.
-T Output a tab rather than a space before the text of a line in normal or context format. This causes the
alignment of tabs in the line to look normal.
--text Treat all files as text and compare them line-by-line, even if they do not appear to be text.
-u Use the unified output format.
--unchanged-group-format=format
Use format to output a group of common lines taken from both files in if-then-else format.
--unchanged-line-format=format
Use format to output a line common to both files in if-then-else format.
--unidirectional-new-file
When comparing directories, if a file appears only in the second directory of the two, treat it as present
but empty in the other.
-U lines
--unified[=lines]
Use the unified output format, showing lines (an integer) lines of context, or three if lines is not
given. For proper operation, patch typically needs at least two lines of context.
-v
--version
Output the version number of diff.
-w Ignore white space when comparing lines.
-W columns
--width=columns
Use an output width of columns in side by side format.
-x pattern
When comparing directories, ignore files and subdirectories whose basenames match pattern.
-X file
When comparing directories, ignore files and subdirectories whose basenames match any pattern contained in
file.
-y Use the side by side output format.
SEE ALSO
cmp(1), comm(1), diff3(1), ed(1), patch(1), pr(1), sdiff(1).
DIAGNOSTICS
An exit status of 0 means no differences were found, 1 means some differences were found, and 2 means trouble.
디씨갤에서 그런 글이 있었다고 하길래 한번 구글신님에게 문의를 했더니
클리앙에 이런 문서가 나온다..
Egregory ^^; [03/07 06:19] :: 변수선언하고, if, while,for , 함수 쓰는거 한두시간안에 떼고 테트리스 일주일 내로 못짜면, 적성이 맞지 않는 겁니다..
대부분의 언어는, 객체화 관련된 부분을 제외하고 지금 얘기한 부분은 반나절이면 떼는 겁니다. 오후에 델파이 몇번 건드려보고 다음날 저녁까지 화일 40개 짜리 프로젝트 해가지고
오는 ... 머 이런 거죠..
Egregory ^^; [03/07 06:23] ::
물론 자료구조등도 다 만들어보고 개념도 알면 좋습니다.
그러나 테트리스같은 간단한 게임을 구현못한다...면 선천적으로 코딩에 재주가
없는 겁니다. 테트리스같은 게임이 무슨 알고리즘이 존재하겠습니까?
if하고 while에 함수도 아닌 서브루틴만 알고 짜도 대충은 합니다..
초보들에게 시켜보면 일주일이면 대충 짭니다. 적성이 없는 경우는 몇년을
줘도 못합니다.
코딩의 기본은 몇가지만 주어진 상황에서 줄줄줄 자기가 만들어내는 겁니다.
책은 백날 봐도 기법과 테크닉만 나올뿐, 짜는 요령에 대해서는 소용없습니다..
Egregory ^^; [03/07 06:25] ::
님처럼 반드시 필요하신 경우는,
아주 얇은 책과 두꺼운 책 두권을 권해드립니다.
얇은 책 한두시간 훑어보고 곧바로 짭니다. 모르는것 함수목록은 두꺼운 책 참조하시고요..
테트리스같은 초급 게임또한 시퀀스에 따른 변수 처리의 모든 것을 다 가지고
있습니다. 게임이기에 기본적인 IO 가 전부 필요하고요...
허미.. 그런데 반박하는 리플도 없고 ㅠ.ㅠ
나 그냥.. 프로그래밍 접을까 ㅠ.ㅠ
근데... kmug나 osx 프로그래밍 쪽에 동일 닉으로 활동하는 사람이 있긴한데..
GPS 프로그래밍도 해보겠다는 내용도 있고, 이거 뭥미 -ㅁ-! 죠낸 잘하는 사람인데 설마~ ㄱ-
후회를 하지 않으면 발전하지 않았다는 걸 위안 삼아
오늘도 한걸음 한걸음 나아간다고 생각하고는 있지만..
머랄까... 전에 할 수 있었던걸 그 때 해보지 않고
지금에 와서야 하면서 그 때를 떠올릴까...
문득, 학교에서 배우는 교과과정이 너무 부실하다는 느낌이 든다.
숙제를 위한 숙제
그리고 서열을 세우기 위한 학점 시스템
숙제는 왜이리 많고
요구를 하는 제2외국어는 왜이리 많은지..
물론 기업에서 요구하는(이 가정 조차 잘못된거겠지만) 인재를 기르는데 있어
전원 인턴채용후 능력을 보고 뽑을수도 없으니, 간단하게 수치화 할 수 있는 부분으로 하는건
어느정도 이해는 되지만, 그것을 넘어서지 못하고 그 수준에서 머물러 있는 대학 교육이란건
과연 존재할 이유가 있는지 의문이 든다.
지금에 있어서 대학교란, 아버지 세대의 고등학교 수준이랄까..
그 이상의 것을 가면 대단한거(그 당시 대학교?) 고등학교 정도는 나와주어야 한다는 정도
아니.. 이제 대학교는 중학교 3학년 정도고, 대학원과 여학연수가 고등학교 수준이 되어가려나?
배워야 할 내용은 점점 많아 지는 시대에,
배울 시간은 부족하고, 점점 나이가 많은 어른이가 될뿐이고
먼저 어른이 되어 버린 사람들은 자신의 기준에 어른이 될 나이의 후세를 아이로 규정 짓는다.
글쎄.. 정답이 있으랴마는..
확실히, 교육이 잘못되었다는 것이 느껴진다.
누군가를 깔아 뭉개고 올라가기 위한 서열 위주의 교육
그리고 "왜?"가 빠진 암기식 교육
컨베이어에 실려나오듯 쿡쿡 찍혀 나오는 양산형 지식과 양산형 인재. 그리고 양산형 인간
결국은 개인이 먼저 몸부림을 치면서 껍질을 깨고 나와야
사회를 바꿀수 있지 않을까..
결론 : 너무 조급해 하지 말자.
교육은 10년을 바라보고 하는데, 국가/나라/세계를 바로 잡는데 그렇게 조급해서야 하겠는가
Sysfs is a virtual file system provided by Linux 2.6. Sysfs exports information about devices and drivers from the kernel device model to userspace, and is also used for configuration. It's similar to sysctl mechanism found in BSD systems, but implemented as a file system instead of a separate mechanism.
Sysfs is designed to export the information present in the device tree which would then no longer clutter up procfs.
Sysfs and userspace
Sysfs is used by several utilities to access information about hardware and its driver (kernel modules) such as udev or HAL. Scripts have been written to access information previously obtained via procfs, and some scripts configure device drivers and devices via their attributes.
2.6 kernel 부터 지원되는 녀석으로, proc filesystem에 지원되지 않는 것들을 지원하기 위한 것이다.
mount 하기 위해서는(되어있지 않았다면)
$ mount -t sysfs sysfs /sys
를 실행해주면 /sys에 마운트 된다.
그리고 sysfs의 정보를 읽기 위해서는 udevinfo를 이용하여 쿼리를 날려주면 된다.
$ ifconfig <interface> [hw <HW> <address>]
<HW>=Hardware Type.
List of possible hardware types:
loop (Local Loopback) slip (Serial Line IP) cslip (VJ Serial Line IP)
slip6 (6-bit Serial Line IP) cslip6 (VJ 6-bit Serial Line IP) adaptive (Adaptive Serial Line IP)
strip (Metricom Starmode IP) ash (Ash) ether (Ethernet)
tr (16/4 Mbps Token Ring) tr (16/4 Mbps Token Ring (New)) ax25 (AMPR AX.25)
netrom (AMPR NET/ROM) rose (AMPR ROSE) tunnel (IPIP Tunnel)
ppp (Point-to-Point Protocol) hdlc ((Cisco)-HDLC) lapb (LAPB)
arcnet (ARCnet) dlci (Frame Relay DLCI) frad (Frame Relay Access Device)
sit (IPv6-in-IPv4) fddi (Fiber Distributed Data Interface) hippi (HIPPI)
irda (IrLAP) ec (Econet) x25 (generic X.25)
eui64 (Generic EUI-64)
※ MAC을 변경하기 위해서는 nic device가 down 되어 있어야 하며, root권한이어야 함.
$ ifconfig eth0 hw ether 00:00:00:00:00:00
SIOCSIFHWADDR: Operation not permitted
$ sudo ifconfig eth0 hw ether 00:00:00:00:00:00
[sudo] password for user:
SIOCSIFHWADDR: Device or resource busy - you may need to down the interface
프로젝트 나탈을 보면서 생각이 드는건 왜이리 삐뚜러진 생각뿐일까..
예전에 AMD 2800+ 싱글 코어에서 640x480 해상도를 MFC를 통해 DirectX를 사용하지 않고 뿌리는 것도
버벅대는 편이라, 저런건 상상도 못했던 일인데.. 과연 가능한 일일까? 라는 의구심이 먼저 든다.
개념적으로는, 스테레오 카메라를 이용하면 거리 측정이 가능해지 므로, 동영상에서 처럼
앞 뒤 움직임 감지가 가능해지지만, 영상이 두개인 만큼, 처리량도 두배가 되므로 그리 좋은 선택은 아니라고 본다.
그렇다고 해서 하나의 카메마를 이용한다고 하면, 대신 해상도가 올라가야 앞뒤 이동으로 인한 피사체의 크기 변화로
거리 측정이 가능해질테니(물론 손이 뒤에 있는데 영상에 찍힐리는 없으니 이런 걸 유추해서 거리 측정하려나?)
이래저래 저해상도인 320x240 영상으로 처리하기에는 상당히 무리가 있어 보이기도 한다.
(상당히 세세한 손동작인 핸들 꺽는걸 인식이 구라가 아니라는 가정하에)
혹시.. 핸들이 손이 아니라 몸이 꺽이는 각도로 인식한거였다! 라는 반전이라면 글쎄?!
손의 각도와 몸의 각도로 인식하는듯 보이는 포뮬러 레이싱 영상
0:46 이후에 매우 빠른 속도로 1초도 안걸려서 기어를 조작하는데,
이 정도 속도를 받아들여 줄수 있는 웹캠은.. 졸라 비쌀듯?
(30fps 로도 blur가 발생해서 인식힘들지 않을까 싶다. 그런 이유로 60fps 급 이상의 카메라가 동원해야 하지 않을까 생각된다)
아부지는 열심히 타이어 갈아 낀다고 드릴질하는데 손의 위치를 따라 앞뒤 거리를 잰다.
물론 Inverse Kinetics를 이용하면, 손의 위치와 어깨의 위치 그리고 팔 길이를 이용하여
현재 영상에서 가능한 팔의 위치를 받아 낼수도 있긴 하겠지만,
그럴려면 생각보다 높은 해상도의 카메라가 있어야 하지 않을까?
웹캠으로 상당히 고해상도인 640x480 급의 카메라 정도는 되어야 할테고
위의 가정에 의해 60fps 정도의 속도를 지녀야 한다.
그럼 640*480*24bit*60fps = 55,296,000byte/s 압축되지 않은 순수한 RGB로는 55MBps(bps 아님!) 이고
YUV로 압축되서 할 경우 2/3으로 압축되므로 36,864,000byte/s 37MBps 의 전송속도가 필요하다.
480Mbps 라는 USB2.0의 경우 이론상 한계 속도는 60MBps 인데, 단일로 거의 풀 대역을 다 사용하게 된다.
(말이 그렇지 누가 480Mbps 나온다고 믿고 있겠어 ㄱ-)
아무튼 저게 듀얼이면 2배이니.. cpu는 폭팔 직전으로 받는데만도 버벅댈꺼고..
USB대신 AGP 등으로 직접 연결되지 않으면 처리하기 힘든 사이즈가 될 듯하다.
물론 화면에 뿌리지 않고 순수하게 데이터만 받고 처리해서 좌표만 넘겨주면 되니
상당부분 위의 가정에서 줄어 들지 모르지만... 흐음...
앵글 움직일때 배경이라던가 사람들이 이질감이 있는것 봐서는 크로마키로 합성한 것은 거의 확실해 보이는데
현재 시스템에서는 저러한 성능은 촘... 솔찍히 구라같다 -ㅁ-!
저런 관절인식을 on-chip 으로 하드웨어 프로그래밍 할 수 도 없으니 결국에는cpu 성능만 쪽쪽 빨아 먹을텐데
저런 그래픽의 게임이 가능할려나?