Skip to content

Instantly share code, notes, and snippets.

@tsupo
tsupo / rmail2mbox.c
Created May 14, 2009 09:46
change RMAIL-formatted mail to mbox-formatted mail
/*
* change RMAIL-formatted mail to mbox-formatted mail
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char lineBuffer[200][BUFSIZ];
int line = 0;
@tsupo
tsupo / cut.c
Created May 14, 2009 09:43
cut
/*
* cut.c
*
* cut --- 行の中から指定フィールドを切り出す
*
* 形式
* (1) cut -c<フィールド> [filename ...]
* (2) cut -f<フィールド> [-d<セパレータ>] [-s]
* 機能
* (1) 空白文字(スペース)をフィールドの区切りとみなし、
@tsupo
tsupo / jsort.c
Created May 14, 2009 09:40
sort in Japanese text order
/*
* jsort.c
* ひらがな文字列のソート(辞書の順による)
*
* by H. Tsujimura 11 Jan 1995 / 15 May 2009
*
* 使用方法:
* jsort [-t区切り文字] [+位置] [ファイル名]
* 指定された区切り文字で区切られた、指定位置の文字列を
* 基準にソートを行なう
@tsupo
tsupo / pmDic.txt
Created May 14, 2009 09:27
sort in pokemon order
001 フシギダネ 固有名詞
002 フシギソウ 固有名詞
003 フシギバナ 固有名詞
004 ヒトカゲ 固有名詞
005 リザード 固有名詞
006 リザードン 固有名詞
007 ゼニガメ 固有名詞
008 カメール 固有名詞
009 カメックス 固有名詞
010 キャタピー 固有名詞
@tsupo
tsupo / rand.cpp
Created May 14, 2009 09:09
(初音ミクに歌ってもらうための)乱数歌詞を生成する
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
static char str[][5] = {
"あ", "い", "う", "え", "お", "か", "き", "く", "け", "こ",
"さ", "し", "す", "せ", "そ", "た", "ち", "つ", "て", "と",
"な", "に", "ぬ", "ね", "の", "は", "ひ", "ふ", "へ", "ほ",
"ま", "み", "む", "め", "も", "や", "ゆ", "よ", "ら", "り",
"る", "れ", "ろ", "わ", "を", "ん",
@tsupo
tsupo / 8551.user.js
Created May 12, 2009 13:45
autopagerize for IE-component-based browsers (based autopagerise 0.0.31 from http://userscripts.org/scripts/show/8551) related http://github.com/swdyh/autopagerize/tree/master
// ==UserScript==
// @name AutoPagerize for IE7 with Turnabout
// @namespace http://watcher.moe-nifty.com/
// @description loading next page and inserting into current page.
// @include http://*
// @include https://*
// @exclude https://mail.google.com/*
// ==/UserScript==
//
// auther: tsupo http://watcher.moe-nifty.com/
--- a/32521.user.js Wed Sep 10 18:50:36 2008
+++ b/32521.user.js Tue Jan 13 16:11:19 2009
@@ -14,8 +14,10 @@
(function() {
// Config
- var afterElementXPath = 'id("entrylist")/following-sibling::*[1]';
- var urlElementXPath = 'id("entrylink_url")//a';
+ // var afterElementXPath = 'id("entrylist")/following-sibling::*[1]';
+ var afterElementXPath = 'id("moreinfo_bottom")/following-sibling::*[1]';
@tsupo
tsupo / extedit.js
Created May 8, 2009 18:53
to use your favorite text-editor on Web forms
<script type="text/javascript">
/*
$Id: extedit.js,v 1.6.1.1 2004/04/05 07:04:05 tsupo Exp $
#Id: extedit.js,v 1.6 2004/03/28 17:41:49 ishinao Exp $
Author: ishinao <ishinao@ishinao.net>
Licence: GPL
extedit - Webブラウザの入力フォームで好きなエディタを使う
see http://mylog.ishinao.net/id/1177
*/
@tsupo
tsupo / repAmazon.js
Created May 8, 2009 18:46
replace image to 'no-image-exists' image of Amazon item, if not exists image of this item
/*
* Amazon の商品画像があればそのまま表示し、なければ「画像がありません画像」を
* 表示するスクリプト
*
* written by H.Tsujimura 2005, 2006, 2007
*/
/* img の onload に replaceImage を埋め込む必要があるバージョン */
/* → いずれ、この replaceImage は廃止し、replaceImageForAmazon に移行する */
function replaceImage(img,rep_img) {
@tsupo
tsupo / convIsbn.js
Created May 8, 2009 18:43
covert code between ISBN10 and ISBN13
/* convISBN.js : converter ISBN10 <-> ISBN13 */
/* Copyright (c) 2007 by H.Tsujimura <tsupo@na.rim.or.jp> */
/* Distributed by LGPL. */
/* this script written by H.Tsujimura 20 Jan 2007 */
function convISBN13toISBN10(str) {
var s;
var c;
var checkDigit = 0;
var result = "";