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
package main | |
import ( | |
"bytes" | |
"flag" | |
"io" | |
"log" | |
"net/http" | |
"net/http/httputil" | |
"os" |
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
//! リバーシのプレイヤープログラム (AI) です. | |
//! 簡単な評価関数を用いた Alpha-beta 探索アルゴリズムを実装しています. | |
use std::cmp::max; | |
use std::io::{stdin, stdout, Write}; | |
use std::collections::BTreeMap; | |
/// Xor-shift 乱数生成アルゴリズムにより乱数を生成します. | |
struct Xor128 { | |
x: u32, |
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
def confirm(message) | |
loop do | |
print "#{message} [Y/n] : " | |
response = gets.chomp | |
case response | |
when 'y', 'Y', '' | |
return true | |
when 'n', 'N' | |
return false | |
end |
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
;;; My fixed version of emacs-crystal-mode on Emacs. | |
;;; * Removed debug messages by simply replacing all (message "") to (). | |
;;; * Improved flycheck configuration. | |
;;; crystal-mode.el --- Major mode for editing Ruby files | |
;; Copyright (C) 2015 Jason Pellerin | |
;; Authors: Jason Pellerin | |
;; URL: https://github.com/jpellerin/emacs-crystal-mode | |
;; Created: Tue Jun 23 2015 |
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 kill-ring-save-whole-if-region-inactive () | |
(interactive) | |
(if (region-active-p) | |
;; 選択中なら選択範囲をコピー | |
(kill-ring-save (region-beginning) (region-end)) | |
;; そうでないならバッファ全体をコピー | |
(kill-ring-save (point-min) (point-max)))) | |
(global-set-key (kbd "M-w") 'kill-ring-save-whole-if-region-inactive) |
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
fn copy_dir(src: &Path, dst: &Path) -> std::io::Result<()> { | |
if src.is_dir() { | |
for entry in try!(fs::read_dir(src)) { | |
let src = try!(entry).path(); | |
let dst = &dst.join(src.file_name().unwrap()); | |
if src.is_dir() { | |
fs::create_dir(&dst).unwrap(); | |
try!(copy_dir(&src, &dst)); | |
} else { | |
fs::copy(&src, &dst).unwrap(); |
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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] | |
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00, 00,00,00,00 |
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
// 内部ノードを持つinsert/eraseベースRBST | |
#define NDEBUG | |
#include <algorithm> | |
#include <cassert> | |
#include <ctime> | |
#include <iostream> | |
#include <string> | |
#include <tuple> | |
#include <vector> | |
#define dump(x) std::cerr << __LINE__ << ":\t" #x " = " << x << std::endl |
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
// ==UserScript== | |
// @name AOJ solved marker | |
// @namespace net.tubo028 | |
// @include http://judge.u-aizu.ac.jp/onlinejudge/description.jsp* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
(function(){ | |
var userid = "arsenic28"; |