Skip to content

Instantly share code, notes, and snippets.

@noqisofon
noqisofon / shown.rb
Created November 11, 2010 02:39
git log とかからログファイルを作る感じのスクリプト。
#!C:/bin/ruby/bin/ruby
# -*- encoding: shift_jis -*-
require 'optparse'
opt = OptionParser.new
OPTS = {}
opt.version = "0.0.3"
@noqisofon
noqisofon / gist:671897
Created November 11, 2010 02:43
XML テキスト表現から XmlReader オブジェクトを作成する C# スニペット?
XmlReader createXMLReader(string text_representation) {
XmlReaderSettings settings = new XmlReaderSettings();
settings.NameTable = new NameTable();
XmlNamespaceManager manager = new XmlNamespaceManager( settings.NameTable );
XmlParserContext context = new XmlParserContext( settings.NameTable,
manager,
"ja",
XmlSpace.Default
);
@noqisofon
noqisofon / demoUDPSocket.si
Created November 11, 2010 02:46
silicone(架空のオレオレ言語)で書かれた、UDPSocket クラスを使ったデモ。
using std;
using std.io;
using std.text;
using net.socket;
let port : int = 52292;
let udp_sender : UDPSocket = new UDPSocket( port );
try {
@noqisofon
noqisofon / file-cat-demo.si
Created November 11, 2010 02:52
ファイルを表示するだけの silicone(ry スクリプト。
using std;
using std.io;
let ( stream : FileOutputStream = FileOutputStream.open( "sample.txt" ) ) {
stream.each_line ( line : string ) => {
console.puts line.chomp
};
} ensure {
stream.close();
@noqisofon
noqisofon / udp-receive-demo.si
Created November 11, 2010 03:35
silicone(ryで書かれた、UDPSocket クラスを使ったデモその 2。
using std;
using std.io;
using std.text;
using net.socket;
let udp_receiver : UDPSocket = new UDPSocket( 11000 );
let remote_endpoint : IPEndPoint = new IPEndPoint( IPAddress.ANY, 0 );
try {
@noqisofon
noqisofon / NotifyIconDemoForm.cs
Created November 11, 2010 04:21
正しい気がするシステムトレイに常駐するプログラムのスケルトン。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace sample.demo.notifyicon {
@noqisofon
noqisofon / UDPServerForm.cs
Created November 11, 2010 07:46
へにょへにょな UDP 受信側窓クラス。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Windows.Forms;
@noqisofon
noqisofon / UDPClientForm.cs
Created November 11, 2010 08:44
ふにょふにょな UDP 送信窓クラス。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Windows.Forms;
@noqisofon
noqisofon / notifyicon_demo_append_notify_icon.c
Created November 11, 2010 12:37
タスクトレイに常駐プログラムを追加する感じ。
typedef char gchar;
typedef HWND widget_t;
typedef HICON icon_t;
typedef NOTIFYICONDATA notify_icon_t;
void notifyicon_demo_append_notify_icon(widget_t window, icon_t tasktray_icon)
@noqisofon
noqisofon / XMLDocumentConvertor.cs
Created November 12, 2010 02:40
XML 文字列表現から XmlDocument を作成するクラス。
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace meserv.util {
/// <summary>