Skip to content

Instantly share code, notes, and snippets.

@misodengaku
misodengaku / gist:3886249
Created October 13, 2012 21:46
タイ語かどうか判定するアレ
/// <summary>
/// タイ語かどうか判定
/// </summary>
/// <param name="inStr">判定する文字列</param>
/// <returns>タイ語が含まれていたらtrue</returns>
private bool isContainThaiChar(string inStr)
{
char[] thaiChar = {'ก', 'ข', 'ฃ', 'ค', 'ฅ', 'ฆ', 'ง', 'จ', 'ฉ', 'ช', 'ซ', 'ฌ', 'ญ', 'ฎ', 'ฏ', 'ฐ', 'ฑ', 'ฒ', 'ณ', 'ด', 'ต', 'ถ', 'ท', 'ธ', 'น', 'บ', 'ป', 'ผ', 'ฝ', 'พ', 'ฟ', 'ภ', 'ม', 'ย', 'ร', 'ฤ', 'ล', 'ฦ', 'ว', 'ศ', 'ษ', 'ส', 'ห', 'ฬ', 'อ', 'ฮ', 'ฯ', 'ะ', 'า', '฿', 'เ', 'แ', 'โ', 'ใ', 'ไ', 'ๅ', 'ๆ', '๏', '๐', '๑', '๒', '๓', '๔', '๕', '๖', '๗', '๘', '๙', '๚', '๛'};
foreach (var item in thaiChar)
{
@misodengaku
misodengaku / gist:4059480
Created November 12, 2012 13:46
WP7でHyperlink混じりのTextBlockみたいなアレ
private void button1_Click(object sender, RoutedEventArgs e)
{
string sample = "トトリちゃんかわいい http://totori.dip.jp @misodengaku ";
var f = sample.Split(new char[] { ' '});
var para = new Paragraph();
foreach (var item in f)
{
if (item.StartsWith("http")) //Webページ開く(判定雑すぎ)
{
var link = new Hyperlink(); //Hyperlinkオブジェクト作成
@misodengaku
misodengaku / gist:4079391
Created November 15, 2012 16:03
トトリちゃん画像収集用のアレ
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace TotoriDownloader
{
class Program
@misodengaku
misodengaku / gist:4139561
Created November 24, 2012 12:56
グリーンマイル
アメリカ南部の死刑囚舎房を舞台に、不思議な力を持つ死刑囚と看守たちとの心の交流を描く。
1935年、死刑囚舎房で看守を務めていたポールのもとに、ある死刑囚が送られてくる。
彼との交流を深めていった看守たちは、やがて彼の罪を疑問視するようになるが・・・。
@misodengaku
misodengaku / gist:4269055
Created December 12, 2012 16:09
例のアレ
--- merge_chr_from_cst2.cpp Thu Dec 13 01:04:24 2012
+++ cst.cpp Thu Dec 13 01:04:26 2012
@@ -8,11 +8,16 @@
// Damnit
-#include "as-util.h"
+#define ZLIB_WINAPI
#include "zlib.h"
-
@misodengaku
misodengaku / gist:4345124
Created December 20, 2012 12:49
WGC.exeで変換したBMPをマージするスクリプト(HSP) 出力形式はBMP、「α値を強制除去」、「出力画像を上下反転」にチェックを入れて変換実行
#define offset_x 1195//差分画像の位置
#define offset_y 82//なぜ変数にしなかったか
picload "元"
buffer 1
picload "差分(目とか)"
x = ginfo_winx
y = ginfo_winy
screen 2//プレビュー用 bufferだのredrawだのお好きに
@misodengaku
misodengaku / gist:4522863
Created January 13, 2013 07:42
NTwainのサンプル丸コピペ
using NTwain;
using NTwain.Data;
using NTwain.Values;
using System;
using System.Windows.Forms;
namespace scantest
{
public partial class Form1 : Form
{
@misodengaku
misodengaku / gist:4529633
Created January 14, 2013 12:05
Krile2用トトリタブ設定
(text:"ロロナ" | (text:"トトリ" & text!:"トリプル") | text:"メルル" | text:"totori" | text:"meruru" | text:"rorona")
@misodengaku
misodengaku / gist:4745221
Created February 9, 2013 12:57
柿連打テスト
/***********************************************************************/
/* */
/* FILE :Kakiren2.c */
/* DATE :Fri, Feb 08, 2013 */
/* DESCRIPTION :Main Program */
/* CPU TYPE :H8/3694F */
/* */
/* This file is generated by Renesas Project Generator (Ver.4.16). */
/* */
/***********************************************************************/
@misodengaku
misodengaku / EntryPoint.cs
Last active December 14, 2015 02:48
Krile2に含まれるSookIkemenプロジェクトのEntryPoint.csを書き換える感じで。 汚い上に判定アレだが気にするな
/*
* Original source by Krile2.
*
*
* Krile License Agreement (The MIT/X11 License)
* Krile : Copyright (c) 2011 Karno.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.