Skip to content

Instantly share code, notes, and snippets.

# 使用例
# wnd = Window.new("calc") # ハンドラwnd生成
# wnd.post(:wm_command,32781)
class Window
attr_reader :handler
require 'dl/win32'
MESSAGE_TYPE = {
:wm_command => 273,
:wm_keydown => 256,
:wm_keyup => 257,
# まだ途中
#
# description:
# * タスク自動化に使う
# * たとえば以下のような状況で使う
# * Aフォルダには1sごとにキャプチャ画像が増えていく
# * Aフォルダのファイルは随時ネットワーク上にコピー
# * Aフォルダのファイルは縮小化してBフォルダにコピー
# * BフォルダにできたファイルのパスはEXCELに記録する
#
// Ubiquityで使う
// すべての検索結果について、,url,title,docの組をとってくる
gglob: function(key){
var results = [];
$.ajax({
url: "http://www.google.co.jp/search",
data: {q: key},
async: false,
success: function(data,textStatus){
// サーチごとに
-- ルーチン同士の呼び出し関係を解析するコード
-- * Parsecを使う
-- * ファイルinを読み込んで行ごとに分解して表示
-- * 表示するのはcallの行のみ
-- * showを一部実装
-- 同じフォルダにApplicativeParsec.hsを用意する
import ApplicativeParsec
import Data.Maybe
void setup(){
size(300,300);
noLoop();
}
void draw(){
println("__START__");
String[] s = loadStrings("c:/usr/tmp/in");
PFont f = createFont(PFont.list()[0],20);
textFont(f);
# 指定のパス下にあるファイルから/w+を取り出して
# 単語\t絶対パス\t行番号
# のファイルを生成する
require "digest/md5"
paths = ["C:/usr/examples"]
exts = %w{ps1}
$verbose = false
# [単語\t絶対パス\t行番号]のファイルから単語検索する
require "digest/md5"
wanna_search = ARGV[1]
ext = ARGV[0]
context = (ARGV[2] || 1).to_i
max_output = (ARGV[3] || 10).to_i
unless wanna_search && ext
STDERR.puts "args error"
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
</head>
<body>
hello
<div id="output">output</div>
<script>
$(function(){
$.get("file:///C:/usr/tmp/in",function(e){
-- foo.txtを読み込んで行番号をつけて表示
-- ※同ディレクトリにApplicativeParsec.hsが要る
import ApplicativeParsec
p :: CharParser () [PLine]
p = many line
eol = string "\n"
letters = many1 letter
// バルーン表示メモ
// 以下抜粋
void InitializeComponent(void)
{
// notifyIcon1
this->notifyIcon1->BalloonTipIcon = System::Windows::Forms::ToolTipIcon::Warning;
this->notifyIcon1->BalloonTipText = L"ここが内容";
this->notifyIcon1->BalloonTipTitle = L"タイトル";
this->notifyIcon1->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"notifyIcon1.Icon"))); // ■アイコンがないとバルーンも表示されない
this->notifyIcon1->Text = L"notifyIcon1";