HANDLE handle = CreateEvent(NULL, TRUE, FALSE, NULL);
WaitForSingleObject(handle,4000);
Friday, January 4, 2008
Wednesday, December 5, 2007
To disable Intellisense in Visual Studio
rename
C:\p\msnet\VC\vcpackages\feacp.dll
or
C:\Program Files (x86)\Microsoft Visual Studio 8\VC\vcpackages\feacp.dll
C:\p\msnet\VC\vcpackages\feacp.dll
or
C:\Program Files (x86)\Microsoft Visual Studio 8\VC\vcpackages\feacp.dll
Saturday, November 24, 2007
Emacs survival kit
C-something = CTRL+something
M-something = ESC then something
C-x b : swith buffers
C-x o : other splitted window
C-SPACE : yank current line
C-w : delete selected block
M-x : grep
M-% : replace
C-g : quit all macro
C-x C-c : exit emacs
C-x C-f ~ : to know where is your .emacs
M-x whitespace-mode: show whitespaces and tabs:
Macros:
C-x ( start recording key strokes to build a keyboard macro.
C-x ) stop recording key strokes to for a keyboard macro.
C-x e execute the keyboard macro. Only one keyboard macro can be defined at a time. This is very powerful when used in conjunction with C-u
do for example: C-u 200 C-x e
;; show column numbers
(setq column-number-mode t)
(set-frame-font "DejaVu Sans Mono-8")
;; 1ASC-Liberation Mono-bold-normal-normal-*-*-*-*-*-m-0-iso10646-1
;; show matching parentesis when pressing % on a parenthesis
(global-set-key "%" 'match-paren)
(defun match-paren (arg)
"Go to the matching paren if on a paren; otherwise insert %."
(interactive "p")
(cond ((looking-at "\\s(") (forward-list 1) (backward-char 1))
((looking-at "\\s)") (forward-char 1) (backward-list 1))
(t (self-insert-command (or arg 1)))))
(interactive)
(let ((b (if mark-active (min (point) (mark)) (point-min)))
(e (if mark-active (max (point) (mark)) (point-max))))
(shell-command-on-region b e
"python -mjson.tool" (current-buffer) t)))
Debugging C++ under emacs22
(setq column-number-mode t)
(set-frame-font "DejaVu Sans Mono-09")
(set-frame-font "DejaVu Sans Mono-8")
;; 1ASC-Liberation Mono-bold-normal-normal-*-*-*-*-*-m-0-iso10646-1
;; 2 spaces for tabs
(setq-default indent-tabs-mode nil);
(setq default-tab-width 2);
;; don't back up tilde files
(setq make-backup-files nil)
;; show column numbers
(setq column-number-mode t)
;; show matching parentesis when pressing % on a parenthesis
(global-set-key "%" 'match-paren)
(defun match-paren (arg)
"Go to the matching paren if on a paren; otherwise insert %."
(interactive "p")
(cond ((looking-at "\\s(") (forward-list 1) (backward-char 1))
((looking-at "\\s)") (forward-char 1) (backward-list 1))
(t (self-insert-command (or arg 1)))))
json
(defun beautify-json ()(Just run M-x beautify-json on a buffer and it will reformat it)
(interactive)
(let ((b (if mark-active (min (point) (mark)) (point-min)))
(e (if mark-active (max (point) (mark)) (point-max))))
(shell-command-on-region b e
"python -mjson.tool" (current-buffer) t)))
to compile C++ using the F7 key
(global-set-key [f7] 'compile)
Vista
You cannot create a .emacs file simply on Vista (problem creating a file with a name starting with a dot). What I did is download one from the net.
- Replace in multiple files
- Call
diredto list files in dir, or callfind-name-diredif you need all subdirectories. (just select all files at this step "*") - Mark the files you want. You can mark all by doing CTRL G m m .You can mark by regex by typing 【% m】. (pom.xml for example)
- Type Q to call
dired-do-query-replace-regexp. - Type your find regex and replace string. 〔➤ common elisp regex pattern〕
- For each occurrence, type y to replace, n to skip. Type 【Ctrl+g】 to abort the whole operation.
- Type ! to replace all occurrences in current file without asking, N to skip all possible replacement for rest of the current file. (N is emacs 23 only)
- To do the replacement on all files without further asking, type Y. (Emacs 23 only)
- Call
ibufferto list all opened files. - Type 【* u】 to mark all unsaved files, type S to save all marked files, type D to close them all.
- M-x gdb
Left click on the light gray column on the C++ source to set breakpoints (gdb needs to be running)
Use icons at the top as debugger commands.
.- I tried "ddd". It is on top of gdb. It is OK, but it is an external editor, independent of emacs. The ddd window is an XWindow but it is very close to what you get with gdb+emacs.
Wednesday, November 7, 2007
Cell phones OS
To summarize:
Symbian: pretty much all Nokias, some SonyEricsson
Windows mobile: Taiwanese HTC, HP
Android: Linux embedded based, Google's cell phones OS
Proprietary: IPhone, SonyEricsson
Symbian: pretty much all Nokias, some SonyEricsson
Windows mobile: Taiwanese HTC, HP
Android: Linux embedded based, Google's cell phones OS
Proprietary: IPhone, SonyEricsson
Tuesday, October 30, 2007
new dynamic STL list
I always have to look back on how to do this, so here we go:
list<string> * myList = new list<string>();
list<string> * myList = new list<string>();
Monday, October 15, 2007
VIVO and Video input a VGA card ?
I wanted to watch the video that is going out of my FreeBox HD on my PC. I thought of using the sVideo output of the FreeBox HD, and use the Peritel of the FreeBox HD for the sound.
I know I can use streaming directly from Free, but on the direct streaming there is no TF1 or M6.
On some PC VGA cards, you have a sVideo or DVI plug. However these are almost always video OUT only. To be able to use your VGA card for acquisition, it has to be VIVO labelled (Video In, Video Out). Just FYI.
I know I can use streaming directly from Free, but on the direct streaming there is no TF1 or M6.
On some PC VGA cards, you have a sVideo or DVI plug. However these are almost always video OUT only. To be able to use your VGA card for acquisition, it has to be VIVO labelled (Video In, Video Out). Just FYI.
Wednesday, October 3, 2007
Subscribe to:
Posts (Atom)