CanvasChanger from SVG (Web App Ver.)を公開しました
Illustrator(R)、Inkscapeなどの画像処理ソフトで作成したSVG画像を、HTML5 Canvasに一発変換するWebアプリを公開しました。
「CanvasChanger from SVG」
http://canvaschanger.project0884.com/
*See Also
Client App Ver. (ja)
Client App Ver. (en)
[Silverlight] ButtonコントロールにMouseLeftButtonDown, MouseLeftButtonUpイベントハンドラを追加する
SilverlightのButtonコントロールはデフォルトではMouseLeftButtonDown, MouseLeftButtonUpイベントを検知することができない。
MouseLeftButtonDown, MouseLeftButtonUpイベントハンドラを追加する場合は、以下の例のようにAddHandlerを使って追加する。
(C#)
Button1.AddHandler(Button.MouseLeftButtonDownEvent, new MouseButtonEventHandler(Button1_MouseLeftButtonDown), true);
Button1.AddHandler(Button.MouseLeftButtonUpEvent, new MouseButtonEventHandler(Button1_MouseLeftButtonUp), true);
*Button1: Buttonコントロール
*Button1_MouseLeftButtonDown: MouseLeftButtonDownイベントハンドラ
*Button1_MouseLeftButtonUp: MouseLeftButtonUpイベントハンドラ
Japan Clickable Map SVG
都道府県ごとのクリックが可能なInline SVG製の日本地図テンプレートをGitHubに公開しました。
Japan Clickable Map SVG
https://github.com/wakabayashiyu/japan-clickable-map-svg
Japan Clickable Map Silverlight
都道府県ごとのクリックが可能なSilverlight製の日本地図テンプレートをGitHubに公開しました。
Japan Clickable Map Silverlight
https://github.com/wakabayashiyu/japan-clickable-map-silverlight
[Silverlight] コードビハインドでデータバインディングを行う
// BindingModeを「OneTime」にする場合 // ※バインディングソースとなるクラスはpublicにする public class Person { public int Age { get; set; } } private Person _bindingSource = new Person() { Age = 20 }; private void LayoutRoot_Loaded(object sender, RoutedEventArgs e) { System.Windows.Data.Binding b = new System.Windows.Data.Binding("Age"); b.Source = this._bindingSource; b.Mode = System.Windows.Data.BindingMode.OneTime; this.TextBox1.SetBinding(TextBox.TextProperty, b); } // BindingModeを「OneWay」にする場合 // バインディングソースとなるクラスにINotifyPropertyChangedを継承させる // ↓ // PropertyChangedイベントを実装する // ※バインディングソースとなるクラスはpublicにする public class Person : System.ComponentModel.INotifyPropertyChanged { private int _age = 20; public int Age { get { return this._age; } set { this._age = value; this.OnPropertyChanged("Age"); } } public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; public void OnPropertyChanged(string propertyName) { if (this.PropertyChanged != null) { this.PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); } } } private Person _bindingSource = new Person() { Age = 20 }; private void LayoutRoot_Loaded(object sender, RoutedEventArgs e) { System.Windows.Data.Binding b = new System.Windows.Data.Binding("Age"); b.Source = this._bindingSource; b.Mode = System.Windows.Data.BindingMode.OneWay; // XAMLに配置したテキストボックスのTextプロパティにバインドする this.TextBox1.SetBinding(TextBox.TextProperty, b); } // XAMLに配置したボタンのクリックイベントハンドラ private void Button1_Click(object sender, RoutedEventArgs e) { // バインディングソースの値が変わると、バインドしたテキストボックスのTextプロパティも変わる this._bindingSource.Age = this._bindingSource.Age + 1; }
[PHP] Base64形式の文字列エンコードとデコード
// encode
string str1 = base64_encode(“string”);
// decode
string str2 = base64_decode(“string”);
[JavaScript] オブジェクトのプロパティ名と値を取得
var result; for (var prop in obj) { // [プロパティ名] : [値] / [プロパティ名] : [値] / ... result += prop + ' : ' + obj[prop] + ' / '; } alert(result);
[Facebook] フィードのtype別 データ内容のサンプル
// Graph APIで取得したフィードをPHP var_dumpで出力 // "..." の部分は内容を省略 //// type = "status" //// object(stdClass)#2 (2) { ["data"]=>array(7) { [0]=>object(stdClass)#3 (9) { ["id"]=>string(31) "..." ["from"]=>object(stdClass)#4 (2) { ["name"]=>string(29) "..." ["id"]=>string(15) "..." } ["message"]=>string(12) "..." ["actions"]=>array(2) { [0]=>object(stdClass)#5 (2) { ["name"]=>string(7) "Comment" ["link"]=>string(61) "http://www.facebook.com/.../posts/..." } [1]=>object(stdClass)#6 (2) { ["name"]=>string(4) "Like" ["link"]=>string(61) "http://www.facebook.com/.../posts/..." } } ["privacy"]=>object(stdClass)#7 (2) { ["description"]=>string(6) "Public" ["value"]=>string(8) "EVERYONE" } ["type"]=>string(6) "status" ["created_time"]=>string(24) "2012-02-16T04:23:22+0000" ["updated_time"]=>string(24) "2012-02-16T04:23:22+0000" ["comments"]=>object(stdClass)#8 (1) { ["count"]=>int(0) } } ... } ["paging"]=>object(stdClass)#47 (2) { ["previous"]=>string(202) "https://graph.facebook.com/me/home?access_token=...&since=1329366202&__previous=1" ["next"]=>string(189) "https://graph.facebook.com/me/home?access_token=...&until=1328255870" } } //// type = "link" //// object(stdClass)#2 (2) { ["data"]=>array(7) { ... [1]=>object(stdClass)#9 (15) { ["id"]=>string(31) "..." ["from"]=>object(stdClass)#10 (2) { ["name"]=>string(29) "..." ["id"]=>string(15) "..." } ["message"]=>string(41) "..." ["picture"]=>string(161) "http://external.ak.fbcdn.net/safe_image.php?...&url=....jpg" ["link"]=>string(23) "http://www....co.jp/" ["name"]=>string(12) "..." ["caption"]=>string(15) "www.....co.jp" ["description"]=>string(284) "..." ["icon"]=>string(59) "http://static.ak.fbcdn.net/rsrc.php/....gif" ["actions"]=>array(2) { [0]=>object(stdClass)#11 (2) { ["name"]=>string(7) "Comment" ["link"]=>string(61) "http://www.facebook.com/.../posts/..." } [1]=>object(stdClass)#12 (2) { ["name"]=>string(4) "Like" ["link"]=>string(61) "http://www.facebook.com/.../posts/..." } } ["privacy"]=>object(stdClass)#13 (2) { ["description"]=>string(6) "Public" ["value"]=>string(8) "EVERYONE" } ["type"]=>string(4) "link" ["created_time"]=>string(24) "2012-02-16T04:23:15+0000" ["updated_time"]=>string(24) "2012-02-16T04:23:15+0000" ["comments"]=>object(stdClass)#14 (1) { ["count"]=>int(0) } } ... } ["paging"]=>object(stdClass)#47 (2) { ["previous"]=>string(202) "https://graph.facebook.com/me/home?access_token=...&since=1329366202&__previous=1" ["next"]=>string(189) "https://graph.facebook.com/me/home?access_token=...&until=1328255870" } } //// type = "photo" //// object(stdClass)#2 (2) { ["data"]=> array(7) { ... [2]=>object(stdClass)#15 (13) { ["id"]=>string(31) "..." ["from"]=>object(stdClass)#16 (2) { ["name"]=>string(29) "..." ["id"]=>string(15) "..." } ["message"]=>string(15) "..." ["picture"]=>string(106) "http://photos-h.ak.fbcdn.net/hphotos-ak-snc7/....jpg" ["link"]=>string(105) "http://www.facebook.com/photo.php?..." ["icon"]=>string(59) "http://static.ak.fbcdn.net/rsrc.php/....gif" ["actions"]=>array(2) { [0]=>object(stdClass)#17 (2) { ["name"]=>string(7) "Comment" ["link"]=>string(61) "http://www.facebook.com/.../posts/..." } [1]=>object(stdClass)#18 (2) { ["name"]=>string(4) "Like" ["link"]=>string(61) "http://www.facebook.com/.../posts/..." } } ["privacy"]=>object(stdClass)#19 (2) { ["description"]=>string(6) "Public" ["value"]=>string(8) "EVERYONE" } ["type"]=>string(5) "photo" ["object_id"]=>string(15) "..." ["created_time"]=>string(24) "2012-02-16T04:19:32+0000" ["updated_time"]=>string(24) "2012-02-16T04:19:32+0000" ["comments"]=>object(stdClass)#20 (1) { ["count"]=>int(0) } } ... } ["paging"]=>object(stdClass)#47 (2) { ["previous"]=>string(202) "https://graph.facebook.com/me/home?access_token=...&since=1329366202&__previous=1" ["next"]=>string(189) "https://graph.facebook.com/me/home?access_token=...&until=1328255870" } } //// type = "video" ※動画ファイルをアップロードした場合 //// object(stdClass)#2 (2) { ["data"]=>array(7) { ... [3]=>object(stdClass)#21 (17) { ["id"]=>string(31) "..." ["from"]=>object(stdClass)#22 (2) { ["name"]=>string(29) "..." ["id"]=>string(15) "..." } ["message"]=>string(6) "..." ["picture"]=>string(97) "http://vthumb.ak.fbcdn.net/hvthumb-ak-snc7/....jpg" ["link"]=>string(51) "http://www.facebook.com/photo.php?v=..." ["source"]=>string(185) "http://video.l3.fbcdn.net/cfs-l3-snc6/....mp4?..." ["name"]=>string(12) "..." ["properties"]=>array(1) { [0]=>object(stdClass)#23 (2) { ["name"]=>string(6) "Length" ["text"]=>string(4) "0:29" } } ["icon"]=>string(59) "http://static.ak.fbcdn.net/rsrc.php/....gif" ["actions"]=>array(2) { [0]=>object(stdClass)#24 (2) { ["name"]=>string(7) "Comment" ["link"]=>string(61) "http://www.facebook.com/.../posts/..." } [1]=>object(stdClass)#25 (2) { ["name"]=>string(4) "Like" ["link"]=>string(61) "http://www.facebook.com/.../posts/..." } } ["privacy"]=>object(stdClass)#26 (2) { ["description"]=>string(6) "Public" ["value"]=>string(8) "EVERYONE" } ["type"]=>string(5) "video" ["object_id"]=>string(15) "..." ["application"]=>object(stdClass)#27 (4) { ["name"]=>string(5) "Video" ["canvas_name"]=>string(5) "video" ["namespace"]=>string(5) "video" ["id"]=>string(10) "..." } ["created_time"]=>string(24) "2012-02-16T02:35:39+0000" ["updated_time"]=>string(24) "2012-02-16T02:35:39+0000" ["comments"]=>object(stdClass)#28 (1) { ["count"]=>int(0) } } ... } ["paging"]=>object(stdClass)#47 (2) { ["previous"]=>string(202) "https://graph.facebook.com/me/home?access_token=...&since=1329366202&__previous=1" ["next"]=>string(189) "https://graph.facebook.com/me/home?access_token=...&until=1328255870" } } //// type = "video" ※Youtube動画ページのリンクを投稿した場合 //// object(stdClass)#2 (2) { ["data"]=>array(7) { ... [4]=>object(stdClass)#29 (16) { ["id"]=>string(31) "..." ["from"]=>object(stdClass)#30 (2) { ["name"]=>string(29) "..." ["id"]=>string(15) "..." } ["message"]=>string(42) "http://www.youtube.com/watch?v=..." ["picture"]=>string(139) "http://external.ak.fbcdn.net/safe_image.php?...&url=....jpg" ["link"]=>string(42) "http://www.youtube.com/watch?v=..." ["source"]=>string(68) "http://www.youtube.com/..." ["name"]=>string(66) "..." ["caption"]=>string(15) "www.youtube.com" ["description"]=>string(113) "..." ["icon"]=>string(59) "http://static.ak.fbcdn.net/rsrc.php/....gif" ["actions"]=>array(2) { [0]=>object(stdClass)#31 (2) { ["name"]=>string(7) "Comment" ["link"]=>string(61) "http://www.facebook.com/.../posts/..." } [1]=>object(stdClass)#32 (2) { ["name"]=>string(4) "Like" ["link"]=>string(61) "http://www.facebook.com/.../posts/..." } } ["privacy"]=>object(stdClass)#33 (2) { ["description"]=>string(6) "Public" ["value"]=>string(8) "EVERYONE" } ["type"]=>string(5) "video" ["created_time"]=>string(24) "2012-02-16T02:33:51+0000" ["updated_time"]=>string(24) "2012-02-16T02:33:51+0000" ["comments"]=>object(stdClass)#34 (1) { ["count"]=>int(0) } } ... } ["paging"]=>object(stdClass)#47 (2) { ["previous"]=>string(202) "https://graph.facebook.com/me/home?access_token=...&since=1329366202&__previous=1" ["next"]=>string(189) "https://graph.facebook.com/me/home?access_token=...&until=1328255870" } }
ソーシャルメディアAPIリファレンスを公開しました
FacebookやGoogle+などのソーシャルメディアが公開しているAPIの使い方をまとめた、リファレンスを公開しました。
ソーシャルメディアAPIリファレンス
http://socialmedia.project0884.com/
ソーシャルメディアのAPIを初めて使う方にも、わかりやすいリファレンスを目指しています。
ご意見、ご感想などございましたら、お気軽にご連絡ください。
WordPressにページング機能を追加
ページング用のWordPressプラグイン「WP-PageNavi」を追加する。
[手順]
WordPressの管理画面から
1. [プラグイン] – [新規追加] を選択する。
2. 「WP-PageNavi」でプラグインの検索をする。
3. 検索結果にから、「WP-PageNavi」のインストールを実行する。
4. [プラグイン] – [プラグイン] を選択し、「WP-PageNavi」が有効であることを確認する。
5. [外観] – [テーマ編集] を選択する。
6. 「footer.php」を開き、任意の場所に <?php wp_pagenavi(); ?> を追加して保存する。