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
/* PoP 3 Markov Chain in C# */ | |
/* 2003/02/17: suchi -- */ | |
using System; | |
using System.IO; | |
using System.Collections; | |
using System.Text.RegularExpressions; | |
class Prefix { | |
const int MULTIPLIER = 31; // for hashcode |
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
copy(vs.begin(), vs.end(), ostream_iterator<string>(cout, "\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
if ['2.3.8', '2.3.9', '2.3.10', '2.3.11'].include?(Rails.version) && Gem.available?('mongrel', Gem::Requirement.new('~>1.1.5')) && self.class.const_defined?(:Mongrel) | |
# Pulled right from latest rack. Old looked like this in 1.1.0 version. | |
# | |
# def [](k) | |
# super(@names[k] ||= @names[k.downcase]) | |
# end | |
# | |
module Rack | |
module Utils |
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 ShiawaseDojo Permlinker | |
// @namespace SDP | |
// @description ShiawaseDojo Permlinker | |
// @include http://www.htb.co.jp/announcers/mami/* | |
// ==/UserScript== | |
d=document,e=d.querySelectorAll('.entry-date'),a=d.querySelectorAll('a[name*="entry_"]');for(i=0;i<a.length;i++){a[i].appendChild(e[i]);a[i].href='#'+a[i].name}void(0) |
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> | |
#define _USE_MATH_DEFINES 1 | |
#include <math.h> | |
int main() | |
{ | |
int n = 1; | |
double d = M_PI; | |
printf("%d %f\n", d, 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
#include <stdio.h> | |
#define _C(c) c | |
#define C_C(c) _C(c) | |
#define C__(c) C_C(_C(c)) | |
#define CCC(CC_,_CC) C__(CC_) C_C(_CC) | |
#define C_CC(CCCC, _CCC) CCC(CCCC,_CCC) | |
#define C_CC_CC(CCC_CC) C_CC(C_C(CCC_CC), "World\n") | |
#define C_CCCC(_C_) C_CC_CC(_C_) | |
#define CC_CC_(_C_C) C_CCCC(_C_C) |
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> | |
#define _C(c) c | |
#define C_C(c) _C(c) | |
#define DOOOO | |
#define DDDOOOO(DD) DOOOO | |
#define OOODDDD(OD) OD | |
#define ODODODOD(_ODD) _ODD | |
#define C__(c) C_C(_C(c)) | |
#define CCCCOOOOOOO(C___) DDDOOOO(C___) |
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
rem Chrome Killer | |
taskkill /FI "IMAGENAME eq chrome*" |
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 FreeStyleWiki PermLinker | |
// @namespace http://www.suchi.org/ | |
// @version 0.2 | |
// @description add permlink dagger | |
// ==/UserScript== | |
var a = document.querySelectorAll('h2>a,h3>a,h4>a'); | |
for(i = 0; i < a.length; i++) { | |
h = a[i].parentNode; | |
dag = d.createElement('a'); |
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
// Amazonの注文履歴をTSV形式で出力するスクリプト | |
// | |
// 2015-01-01 時点での DOM 構造に対応, GoogleCrome, Opera でテスト済。 | |
// formatEntry関数を書き換えれば自由な書式で出力できます。 | |
// | |
// 参考: | |
// - Amazonの注文履歴をCSV形式にして出力するスクリプト | |
// https://gist.github.com/arcatdmz/8500521 | |
// - Amazon で使った金額の合計を出す奴 (2014 年バージョン) | |
// https://gist.github.com/polamjag/866a8af775c44b3c1a6d |