2010-01-01から1ヶ月間の記事一覧

自分の環境で使えるヒープの大きさを取得する

エキスパートCプログラミングに書いてあるのとほぼ同じだけど、1MB単位で測る。 あと、メモリが少ない環境の場合はKB単位で測ったほうがいい。 #include <stdio.h> #include <stdlib.h> #define SIZE_KB (1<<10) #define SIZE_MB (1<<20) int main(int argc, char **argv) { int</stdlib.h></stdio.h>…

Googleのトップページをずっと成人式仕様にするGreasemonkeyスクリプト(2)

XPath使って書き直し。 // ==UserScript== // @name seizin // @namespace http://d.hatena.ne.jp/f96q/ // @include http://www.google.co.jp/ // ==/UserScript== (function () { var r = document.evaluate("//img[@alt='Google']", document, null, XPat…

迷路探索

人材獲得作戦・4 試験問題ほかの迷路探索を解いてみた。BFS知らなかったので調べてから。 #include <stdio.h> #include <vector> #include <queue> struct Pos { int x, y; }; struct MValue { int d; bool visit; }; struct Map { int width, height; std::vector<std::vector<struct MValue> > data; struct P</std::vector<struct></queue></vector></stdio.h>…

YouTubeを常に高画質モードで再生するGreasemonkeyスクリプト

インストール // ==UserScript== // @name youtube fmt18 // @namespace http://d.hatena.ne.jp/f96q/ // @include http://www.youtube.com/* // ==/UserScript== window.addEventListener("load", function () { (location.href.match(/http:\/\/www.youtub…

メモ

#include <iostream> #include <typeinfo> int main(int argc, char **argv) { int a = 30; int &i = a; std::cout << typeid (i).name() << std::endl; }</typeinfo></iostream>

Googleのトップページの上のリンクにlivedoor Readerを追加するGreasemonkeyスクリプト

posの数値を変えて位置を変えられます。インストール // ==UserScript== // @name add ldr // @namespace http://d.hatena.ne.jp/f96q/ // @include http://www.google.co.jp/ // ==/UserScript== (function () { var pos = 5; var ldr = document.createEle…

Googleのトップページをずっと成人式仕様にするGreasemonkeyスクリプト

インストール // ==UserScript== // @name seizin // @namespace http://d.hatena.ne.jp/f96q/ // @include http://www.google.co.jp/ // ==/UserScript== (function () { var img = document.getElementsByTagName("img"); for (var i = 0; i < img.length;…

ふぁぼったーのを見えるようにするGreasemonkeyスクリプト

既に既出だったりしますが。あとAutoPagerizeに対応してません。インストール // ==UserScript== // @name change censored // @namespace http://d.hatena.ne.jp/f96q/ // @include http://favotter.matope.com/* // ==/UserScript== (function () { var sp…

Twitterでフォローしてる人を取得

apiで取得しようとすると100人ぐらいで取得できなくなるので、作った。 ユーザー名とパスワード入れて使う。 スクレイピングもっと効率的なやり方あるだろうし。 ページ変わると動かなくなるのであまり推奨できない。 あとrubyのマーシャルデータで保存。 #!…

TwitterIRCGatewayの設定

2010-02-12追記TIGのコマンドコンソールに入る /join Console@tig 設定のとこに入る config 設定されてるもの一覧 show 設定する set EnableTypeMap true ルートに戻る exit TypableMapconfigの所で set EnableTypableMap true TypableMapの文字列の色を赤に…

リリース

某爆弾を爆発されるゲームぽいものを作りました。ここにからどうぞ。