This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// main thread | |
m_KillThreadEvent.SetEvent(); | |
while (TRUE) { | |
DWORD result; | |
MSG msg; | |
result = ::MsgWaitForMultipleObjects(1, &m_hPositioning, FALSE, INFINITE, QS_ALLINPUT); | |
if (result == (WAIT_OBJECT_0)) { | |
break; | |
} else if (result == ((DWORD)0xFFFFFFFF)) { | |
DWORD e = GetLastError(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LARGE_INTEGER BeginTime ; | |
LARGE_INTEGER EndTime ; | |
LARGE_INTEGER Frequency ; | |
QueryPerformanceFrequency(&Frequency); | |
QueryPerformanceCounter(&BeginTime) ; | |
//fragment to test | |
QueryPerformanceCounter(&EndTime) ; | |
cout.precision(10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# STL GDB evaluators/views/utilities - 1.03 | |
# | |
# The new GDB commands: | |
# are entirely non instrumental | |
# do not depend on any "inline"(s) - e.g. size(), [], etc | |
# are extremely tolerant to debugger settings | |
# | |
# This file should be "included" in .gdbinit as following: | |
# source stl-views.gdb or just paste it into your .gdbinit file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
//define pixelformat of windows bitmap, notice the unusual ordering of colors | |
typedef struct { | |
unsigned char B; | |
unsigned char G; | |
unsigned char R; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* from genromfs.c */ | |
#define ALIGNUP16(x) (((x)+15)&~15) | |
/* from zfs */ | |
#define P2ALIGN(x, align) ((x) & -(align)) | |
#define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1) | |
#define P2ROUNDUP(x, align) (-(-(x) & -(align))) | |
#define P2PHASE(x, align) ((x) & ((align) - 1)) | |
#define P2NPHASE(x, align) (-(x) & ((align) - 1)) | |
#define ISP2(x) (((x) & ((x) - 1)) == 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before backup: | |
dpkg --get-selections > packages.txt | |
while restoring: | |
dpkg --clear-selections | |
dpkg --set-selections < packages.txt | |
aptitude install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC=gcc | |
CFLAGS=-O3 -funroll-loops -c | |
LDFLAGS=-O2 | |
LDLIBS=-lm | |
SOURCES=MyBot.c YourCode.c ants.c | |
HEADERS=ants.h | |
OBJECTS=$(addsuffix .o, $(basename ${SOURCES})) | |
EXECUTABLE=MyBot | |
all: $(EXECUTABLE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun copy-current-line-position-to-clipboard () | |
"Copy current line in file to clipboard as '</path/to/file>:<line-number>'" | |
(interactive) | |
(let ((path-with-line-number | |
(concat (buffer-file-name) ":" (number-to-string (line-number-at-pos))))) | |
(x-select-text path-with-line-number) | |
(message (concat path-with-line-number " copied to clipboard")))) | |
(define-key global-map (kbd "M-l") 'copy-current-line-position-to-clipboard) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global alias.lg "log --color --graph --pretty=format:'%C(auto)%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
http://fredkschott.com/post/2014/02/git-log-is-so-2005/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -q http://londo.ganneff.de/apt.key -O- | apt-key add - | |
echo "deb http://londo.ganneff.de wheezy main" > /etc/apt/sources.list.d/emacs.list | |
aptitude update | |
aptitude install emacs-snapshot |
OlderNewer