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: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
@CH3COOH
CH3COOH / MessageBox.cs
Last active December 16, 2015 14:29
MessageBox.Show for Xamarin.iOS description: http://blog.ch3cooh.jp/entry/20130425/1366875327
using System;
using System.Drawing;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using System.Collections.Generic;
namespace MonoTouch.UIKit
{
public enum MessageBoxResult
{
@CH3COOH
CH3COOH / gist:5520429
Last active December 17, 2015 00:19
Send SMS using Skype4COM for C# Detailed description: http://ch3cooh.jp/other/skype-api/send-msm-using-skypeapi/
using System;
using System.Diagnostics;
using System.Windows.Forms;
namespace SkypeAPISample
{
public partial class Form1 : Form
{
public Form1()
{
@CH3COOH
CH3COOH / gist:5599790
Last active December 17, 2015 11:09
Localization strings. for example; https://itunes.apple.com/ja/app/id635224999?mt=8
Last update: 2013/5/29
Order by
・English
・Japanese
・Chinese (hant)
・Chinese (hans)
・Korean
・French