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
;; -*-lisp-*- | |
(in-package :stumpwm) | |
(defmacro define-ror (name command class) | |
`(defcommand ,name () () | |
,(concatenate 'string | |
"Start " command | |
" unless it is already running, in which case focus it.") | |
(run-or-raise ,command '(:class ,class)))) |
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
(in-package stumpwm) | |
(defcommand itsumono () () | |
"Start itumono with layout" | |
(restore-from-file "~/.stumpwmrc.d/logbook.layout") | |
(restore-window-placement-rules "~/.stumpwmrc.d/logbook.rule") | |
(run-shell-command "firefox-bin") | |
(run-shell-command "logbook") | |
(run-shell-command "mikutter")) |
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
(setq initial-frame-alist | |
'((width . 100) | |
(height . 39) | |
(top . 0) | |
(left . 0) | |
(font . "VL Gothic-10"))) | |
(setq default-frame-alist initial-frame-alist) | |
(show-paren-mode 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
#include <stdio.h> | |
void A(void) { | |
int i; | |
for (i=0; i<100; ++i) { | |
printf("%d %g %g\n", i, (i / 10 + 1) * 0.1, (i % 10 + 1) * 0.1); | |
} | |
} | |
void B(void) { |
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 nn (n) | |
(let ((*print-base* n)) | |
(loop for i from 1 below n | |
do (loop for j from 1 below n | |
do (format t "~2A " (* i j))) | |
do (terpri)))) |
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
(ql:quickload :cl-ppcre) | |
(defpackage :expand | |
(:use :cl :ppcre)) | |
(in-package :expand) | |
(defconstant +regex+ "\\$\\{(.*?)\\}") | |
(defun expand-string (string) |
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
(reduce #'+ (mapcar #'rest | |
'((LAND-OF-LISP . 3990) | |
(PAIP . 9660) | |
(ANSI-COMMON-LISP . 3570) | |
(ON-LISP . 3800) | |
(LET-OVER-LAMBDA . 3200)))) |
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 <iostream> | |
#include <vector> | |
#include <algorithm> | |
using std::vector; | |
using std::cout; | |
using std::endl; | |
int main() { | |
vector<int> a = {0, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 0}; | |
auto min = min_element(a.begin(), a.end(), [](int a, int b) { | |
return (a == 0) ? false : (b == 0) || a < b; |
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 <iostream> | |
#include <vector> | |
#include <algorithm> | |
using std::vector; | |
using std::cout; | |
using std::endl; | |
int main() { | |
vector<int> a = {5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5}; | |
auto min = min_element(a.begin(), a.end(), [](int a, int b) { | |
return ((a != 0) && (b == 0)) || a < b; |