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
# -*- coding: utf-8 -*- | |
class Env: | |
def __init__(self, bindings, parent=None): | |
self.bindings = bindings | |
self.parent = parent | |
@staticmethod | |
def init_env(): |
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 :chirp) | |
(setf chirp:*oauth-api-key* "Put" | |
chirp:*oauth-api-secret* "your" | |
chirp:*oauth-access-token* "credencials" | |
chirp:*oauth-access-secret* "here!") | |
(print (chirp:account/verify-credentials)) | |
(defun status-text-without-mention (status) |
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 '(:ningle :clack)) | |
(defvar *app* (make-instance 'ningle:<app>)) | |
(setf (ningle:route *app* "/") | |
"Hello :)") | |
(setf (ningle:route *app* "/error") | |
(lambda (params) | |
(declare (ignore params)) |
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
const commands = { | |
add: { | |
do(state, action) { | |
return { | |
num: state.num + action.x | |
}; | |
}, | |
undo(state, action) { | |
return { | |
num: state.num - action.x |
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
/* | |
* Dual-fisheye 形式の動画を横長の動画にして出力するプログラム | |
* | |
* コンパイル: | |
* $ g++ convert_dfe.cpp `pkg-config opencv --cflags --libs` -std=c++11 -O3 -o convert_dfe | |
* | |
* 使い方: | |
* $ convert_dfe 入力動画パス 出力動画パス | |
*/ |
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
use std::io::Write; | |
use std::process::{Command, Stdio}; | |
fn make_frame(width: usize, height: usize, time: usize) -> Vec<u8> { | |
let mut frame = Vec::with_capacity(4 * width * height); | |
for y in 0..height { | |
for x in 0..width { | |
frame.push((x % 256) as u8); | |
frame.push((y % 256) as u8); | |
frame.push((time % 256) as u8); |
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
// Basic instructions | |
const NOP = 0; | |
const MOVE = 5; | |
const MOVE_2_1 = 6; | |
const STORE_TO_M0 = 10; | |
const STORE_TO_M1 = 11; | |
const STORE_TO_C1 = 12; | |
const SET_MC1_ROOT = 15; | |
const SET_C1_ROOT = 16; | |
const RESOLVE = 20; |
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
% 知識 | |
food("中華料理"). | |
food("フランス料理"). | |
food("イタリア料理"). | |
place("新宿"). | |
place("渋谷"). | |
place("池袋"). | |
restaurant("川香苑 本店", "中華料理", "新宿", 3000). |
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
nextto(X, Y, List) :- iright(X, Y, List). | |
nextto(X, Y, List) :- iright(Y, X, List). | |
iright(Left, Right, [Left, Right | _]). | |
iright(Left, Right, [_ | Rest]) :- iright(Left, Right, Rest). | |
zebra(H, W, Z) :- | |
H = [house(norwegian, _, _, _, _), _, house(_, _, _, milk, _), _, _], | |
member(house(englishman, _, _, _, red), H), | |
member(house(spaniard, dog, _, _, _), H), | |
member(house(_, _, _, coffee, green), H), | |
member(house(ukrainian, _, _, tea, _), H), |
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
use std::rc::Rc; | |
use std::cell::RefCell; | |
use std::str::Chars; | |
type R<T> = Rc<RefCell<T>>; | |
#[derive(Debug, Clone)] | |
enum V { | |
Symbol(String), | |
Int(i64), |
OlderNewer