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

正規表現で指定したタグ以外を取り除く

指定したタグ以外を取り除く Regex reg = new Regex( "</?(?!table|link|p|br|tr|th|td|a{1}(?!\\w+))\\w+(\\s+.*?)?>", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled );

色ソート

static void Main() { var c1 = Color.FromArgb( 0x21, 0xc1, 0x3a, 0x72 ); var c2 = Color.FromArgb( 0x71, 0xcc, 0xcc, 0xcc ); var c3 = Color.FromArgb( 0x21, 0xe4, 0x91, 0x59 ); var c4 = Color.FromArgb( 0xFF, 0xe4, 0x91, 0x60 ); Dictionary<string, double> rLi</string,>…

.netで圧縮

なぜMicrosoftは.netでzip圧縮のサポートをしないのかよくわからないけど。標準(?)で使えるのもを幾つか。 ZipPackage ただ、これは本来のzip圧縮とは少々異なり実用には耐えられない。 変なファイルが出来るとか、圧縮率が悪いとか。暗号化とか。 using ( v…

svnのフォルダのタイムスタンプを擬似的に合わせてみる

SVNをチェックアウトしたらフォルダのタイムスタンプが全部現在時刻だったので。 ちょっと調べてわかんなかったのでなんちゃって補正してみた。 static void Main( string[] args ) { if (args.Length != 1) { Console.WriteLine( "usage: cfp.exe <folder path>" ); retu</folder>…

トランザクション NTFS (TxF)

実装サンプル http://msdn.microsoft.com/en-us/library/cc303707.aspxVista以降で試してみたい。

他プロセスのボタンClick

public const int BM_CLICK = 0x00F5; [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )] static extern IntPtr FindWindowEx( IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow ); [DllImport( "u…

GPU

AMD Display Library (ADL) SDK http://developer.amd.com/sdks/ADLSDK/Pages/default.aspxnvidia CUDA Tool kit http://developer.nvidia.com/cuda-downloads http://www.nvidia.co.jp/object/cuda_home_new_jp.html nvcpl.dll

windows vista+7 volume control

ISimpleAudioVolume IAudioEndpointVolume

Array Copy

1,2次元配列のコピー拡張的な何か。配列のCopyToってなんで戻り値で返してくれないんだろうっていつも思ってる。 static class ArrayExtension { public static T[] CreateDeepClone<T>( this T[] source ) { if ( !typeof( T ).IsValueType ) { throw new A</t>…