Skip to content

Instantly share code, notes, and snippets.

View CH3COOH's full-sized avatar
🍣
is my favorite sushi

Kenji Wada CH3COOH

🍣
is my favorite sushi
View GitHub Profile
@CH3COOH
CH3COOH / gist:1705396
Created January 30, 2012 16:53
コードの最適化
using Microsoft.Phone.Controls;
namespace PhoneApp1 {
public partial class MainPage : PhoneApplicationPage {
// コンストラクター
public MainPage() {
InitializeComponent();
// コードの最適化が有効になっている場合は、
// このhogeは無かったものとして扱われる
@CH3COOH
CH3COOH / gist:3077002
Created July 9, 2012 14:55
UNIPA的な
<html>
<body>
<span id="form1:htmlMain" class="output002">教室変更情報詳細<br><br>日付:2012年4月26日 木曜日<br>時限:6限<br>科目:ワイヤレスシステム工学<br>教員:小林 岳彦<br>変更前教室:【千住】2号館2501教室<br>変更後教室:【千住】2号館2502教室<br>備考:4月26日(木)から前期終了まで<BR></span>
</body>
</html>
@CH3COOH
CH3COOH / gist:3088103
Created July 11, 2012 04:54
test.xmlから鳩山も含めて休講情報だけを取り出してみた。妥当性の検証が必要だけどチェックできない……
5,20120711,3,【千住】科学技術と企業経営,世良耕一,
5,20120711,6,【千住】企業と経営,世良耕一,
5,20120711,7,【千住】科学技術と企業経営,世良耕一,
5,20120712,2,【千住】グループスタディI,本橋光也,
5,20120712,3,【千住】流体の力学Iおよび演習,児山秀晴,
5,20120712,6,【千住】電気回路の基礎および演習,本橋光也,
5,20120713,1,【千住】オブジェクト指向プログラミングおよび演習,脇英世,
5,20120713,2,【千住】オブジェクト指向プログラミングおよび演習,脇英世,
5,20120713,7,【千住】基礎情報数学B(確率と情報),月本洋,
5,20120716,2,【千住】建築設備概論,射場本忠彦,
@CH3COOH
CH3COOH / gist:3374737
Created August 17, 2012 00:17
HsvFromRgb method
private HSV HsvFromRgb(double r, double g, double b)
{
var max = Math.Max(Math.Max(r, g), b);
var min = Math.Min(Math.Min(r, g), b);
var sub = max - min;
double h = 0, s = 0, v = 0;
// Calculate Hue
if (sub == 0)
@CH3COOH
CH3COOH / gist:3375180
Created August 17, 2012 01:47
Hsv to Rgb method
/// <summary>
/// RGBへ変換する
/// </summary>
/// <returns>RGBオブジェクト</returns>
public RGB ToRGB()
{
// まず、もしSが0.0と等しいなら、最終的な色は無色もしくは灰色である。
if (Saturation == 0)
{
return new RGB(Value, Value, Value);
@CH3COOH
CH3COOH / gist:3377542
Created August 17, 2012 09:51
Effect method with VB
Imports Softbuild.Media
Public NotInheritable Class MainPage
Inherits Page
Protected Overrides Async Sub OnNavigatedTo(e As Navigation.NavigationEventArgs)
Dim bmp As WriteableBitmap = New WriteableBitmap(320, 240)
Await bmp.EffectBakumatsuAsync()
End Sub
@CH3COOH
CH3COOH / gist:5030095
Created February 25, 2013 14:21
ブログまとめ読みビューアを作っているのですが、ここでピックアップしている以外で読みたい・読んでもらいたいブログがあったら教えてください!
list.Add(new SiteInfo(1, PublisherTypes.ShortStory, "SS宝庫", PublishTypes.RDF, "http://minnanohimatubushi.2chblog.jp/index.rdf", true));
list.Add(new SiteInfo(2, PublisherTypes.ShortStory, "インバリアント -SSまとめサイト-", PublishTypes.RDF, "http://feed.rssad.jp/rss/fc2/invariant0.blog130", true));
list.Add(new SiteInfo(3, PublisherTypes.Anime, "お絵かき速報!萌え絵上達法", PublishTypes.RDF, "http://mazikanon.blog102.fc2.com/?xml", true));
list.Add(new SiteInfo(4, PublisherTypes.Sports, "なんJ(まとめては)いかんのか?", PublishTypes.RDF, "http://blog.livedoor.jp/livejupiter2/index.rdf", true));
list.Add(new SiteInfo(5, PublisherTypes.News, "痛いニュース(ノ∀`)", PublishTypes.RDF, "http://blog.livedoor.jp/dqnplus/index.rdf", true));
list.Add(new SiteInfo(6, PublisherTypes.News, "哲学ニュースnwk", PublishTypes.RDF, "http://blog.livedoor.jp/nwknews/index.rdf", true));
list.Add(new SiteInfo(7, PublisherTypes.News, "ハムスター速報", PublishTypes.RDF, "http://hamusoku.com/index.rdf", true));
@CH3COOH
CH3COOH / gist:5220036
Created March 22, 2013 09:33
NSUrlConnectionクラスを使って文字列を非同期ダウンロードするコードを書いたら結構大変なことになった。
using System;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using System.Net;
using System.IO;
namespace WebRequestSample
{
@CH3COOH
CH3COOH / MainPage.xaml.cs
Created March 22, 2013 15:36
WindowsストアアプリでSQLiteを使う場合の例(レシピ069~070)
using SQLite; // ←これを追加
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
@CH3COOH
CH3COOH / SepiaEffect.cs
Created March 26, 2013 04:35
Xamarin.iOSでセピア調変換してみた
//
// SepiaEffect.cs
//
// Copyright (c) 2012 Kenji Wada, http://ch3cooh.jp/
//
// 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