This file contains hidden or 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
template< typename F > | |
void tenTimes(F f) | |
{ | |
for (auto i = 0; i < 10; ++i) { | |
f(); | |
} | |
} | |
int main() | |
{ |
This file contains hidden or 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
;; eval | |
;; http://www.serendip.ws/archives/1817 | |
;; ↑eval の定義を apply の定義よりも先に行っていたために、eval の定義の中で使っていた apply 手続きが Gauche のシステムの apply 手続きを利用していたために動作しなかったらしい。 | |
;; apply の定義を eval の定義よりも先に行うようにしたところ、正常に動作するようになった。 | |
;; 基盤の apply への参照を apply-in-underlying-scheme へ退避させる(こうすることで、基盤の apply に apply-in-underlying-scheme という名前でアクセスできる)。 | |
(define apply-in-underlying-scheme apply) | |
;; apply | |
(define (apply procedure arguments) |
This file contains hidden or 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
# Your keymap | |
# | |
# Atom keymaps work similarly to style sheets. Just as style sheets use | |
# selectors to apply styles to elements, Atom keymaps use selectors to associate | |
# keystrokes with events in specific contexts. Unlike style sheets however, | |
# each selector can only be declared once. | |
# | |
# You can create a new keybinding in this file by typing "key" and then hitting | |
# tab. | |
# Here's an example taken from Atom's built-in keymap: |
This file contains hidden or 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
;; http://daretoku-unix.blogspot.jp/2015/01/y.html | |
(define fact | |
((lambda (h) ;; Yc | |
((lambda (f) ;; | | |
(h (lambda (x) ;; | | |
((f f) x)))) ;; | | |
(lambda (f) ;; | | |
(h (lambda (x) ;; | | |
((f f) x)))))) ;; - | |
(lambda (f) ;; fact% |
This file contains hidden or 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
int currentStep = 0; | |
constexpr int NUM_STEP = 16; | |
// d3 d4 d5 = 74hc138 in a b c | |
const uint8_t LED_BIT_TABLE[NUM_STEP][3] = { | |
{0, 0, 0}, | |
{1, 0, 0}, | |
{0, 1, 0}, | |
{1, 1, 0}, |
This file contains hidden or 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
/* | |
* shiromono-chan.ino | |
* Small syncing utility for traktor->hardware | |
* | |
* Instructions | |
* 1. Write this program to Arduino Uno | |
* 2. Burn "Midi Firmware for Arduino Uno (Moco)" to Arduino Uno's USB chip http://morecatlab.akiba.coocan.jp/lab/index.php/aruino/midi-firmware-for-arduino-uno-moco/?lang=en | |
* 3. Connect to your Computer | |
* 4. Start Traktor | |
* 5. Go to Preferences->"MIDI Clock" and enable clocking |
This file contains hidden or 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 example-list '(0 1 2 3 4 5)) | |
example-list | |
; gosh> (1 2 3 4 5) | |
;; 最初からある関数を呼ぶ | |
(filter zero? example-list) | |
; gosh> (0) | |
;; 関数をdefineするとこんなかんじ | |
(define (largerThan2 x) |
This file contains hidden or 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
function hilightItalic() { | |
var body = DocumentApp.getActiveDocument().getBody(); | |
var editText = body.editAsText(); | |
var text = editText.getText(); | |
for (var i = 0; i < text.length; ++i) { | |
if (editText.isItalic(i)) { | |
editText.setForegroundColor(i, i, '#ff0000'); | |
} | |
} |
This file contains hidden or 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
// gcc hoge.cpp `guile-config link` -o runrepl | |
#include <libguile.h> | |
static void inner_main(void *closure, int argc, char **argv) | |
{ | |
scm_shell(argc, argv); | |
} | |
int main(int argc, char **argv) | |
{ |
This file contains hidden or 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
(require 'irony) | |
(require 'company-irony-c-headers) | |
(add-hook 'c-mode-hook 'irony-mode) | |
(add-hook 'c++-mode-hook 'irony-mode) | |
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options) | |
(defun c-mode-company-conf () | |
(set (make-local-variable 'company-backends) | |
'((company-irony |