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
QVector<QRgb> | |
MainWindow::convolveImage(QImage* img, | |
QVector<double>; kernel, | |
short kernel_size) | |
{ | |
int width = img->width(); | |
int height = img->height(); | |
int len = width * height; | |
QVector<QRgb> imvec = vectorOfImagePixels(img); |
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
sub gcd { | |
my ($m, $n) = @_; | |
until ($n == 0) { | |
($m, $n) = ($n, $m % $n); | |
} | |
return $m; | |
} |
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
#!/usr/bin/perl -w | |
use strict; | |
sub gcd { | |
my ($m, $n) = @_; | |
if ($n == 0) { | |
return $m; | |
} | |
return gcd($n, $m % $n); |
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
[ -f ~/Dropbox/config/user.init.d/`hostname`.sh ] && \ | |
. ~/Dropbox/config/user.init.d/`hostname`.sh |
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
touch ~/Dropbox/config/user.init.d/`hostname`.sh | |
chmod +x ~/Dropbox/config/user.init.d/`hostname`.sh |
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
(define-key global-map (kbd "C-M-j") | |
(defun insert-surrounding-parentheses (&optional arg) | |
(interactive "p") | |
(dotimes (i arg) (insert "()") | |
(backward-char 1)))) | |
(define-key global-map (kbd "C-M-k") | |
(defun insert-surrounding-braces (&optional arg) | |
(interactive "p") | |
(dotimes (i arg) (insert "{}") |
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
(defmacro esc/define-displaced-yank (funcname data) | |
"Create a defun of name FUNCNAME that yanks and moves according | |
to DATA. DATA is of the form (STR, MOVE). STR is the string to | |
yank and MOVE is the number of chars to move backward. | |
Note that negative values of MOVE are valid." | |
(let ((funsymbol (intern (format "esc/yank-displaced-%s" funcname))) | |
(docstring (format "(insert \"%s\") and (backward-char %d). | |
This command can be prefixed, and will iterate N times." | |
(car data) (or (cadr data) 1))) |
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 new-lecture () | |
"Used to insert a new block and today's date." | |
(interactive) | |
(end-of-buffer) | |
(newline-and-indent) | |
(newline-and-indent) | |
(re-search-backward "\\* Lecture ") | |
(end-of-line) | |
(backward-word) | |
(kill-line) |
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
(fset 'demonstration | |
[?\C-r ?L ?e ?c ?t ?u ?r ?e ? ?\C-m ?\C-e ?\M-b ?\C-k ?\C-y ?\M-> ?\C-n ?\C-n ?* ?\S- ?L ?e ?c ?t ?u ?r ?e ? ?\C-y ?\C-\' ?i ?n ?c ?r ?e return ?\C-j ?\C-\' ?d ?a ?t ?e return ?\C-j ?\C-j]) |
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 w3m-first-or-subsequent-google-result () | |
"Move point to the first (or subsequent) google result. | |
See also \\[w3m-prev-google-result]." | |
(interactive) | |
(w3m-find-a-google-result)) | |
(defun w3m-prev-google-result () | |
"Move point to the previous google result. | |
Complimentary function to \\[w3m-first-or-subsequent-google-result]." | |
(interactive) |
OlderNewer