<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>PUBLICROOTS | mtFlash</title>
<link>http://publicroots.com/fmt/</link>
<description></description>
<language>ja</language>
<copyright>Copyright 2014</copyright>
<lastBuildDate>Thu, 03 Oct 2013 21:29:52 +0900</lastBuildDate>
<generator>http://www.movabletype.org/?v=3.151</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs> 

<item>
<title>ocamera - ジェスチャ操作でフィルタを調整できる直感的なカメラアプリ</title>
<description><![CDATA[<p>ジェスチャーベースで、直感的にカメラフィルターを操作できる。<br />
究極にシンプルなカメラアプリ作りました。<br />
是非インストールしてみてください！</p>

<p>ocamera(ゼロカメラ)<br />
<a href="http://ocamera.jp" target="_blank">http://ocamera.jp</a></p>

<p>直感的な操作性で、思いのままにフィルタを調整！<br />
写真を撮る行為そのものを楽しめるカメラらしいカメラアプリです。</p>

<p><a href="https://itunes.apple.com/jp/app/ocamera-jesucha-cao-zuodefirutawo/id708986664?l=ja&ls=1&mt=8" target="_blank">itunesからインストール</a></p>]]></description>
<link>http://publicroots.com/fmt/archives/000383.html</link>
<guid>http://publicroots.com/fmt/archives/000383.html</guid>
<category>iPhone</category>
<pubDate>Thu, 03 Oct 2013 21:29:52 +0900</pubDate>
</item>
<item>
<title>[Objective-C] CIFilter</title>
<description><![CDATA[<p>iOS5から使えるようになったCIFilterを使った簡単な画像加工</p>

<pre>
// ソース画像を準備<br>
UIImage *source = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] <br>pathForResource:@"IMG_0001" ofType:@"JPG"]];<br>
CIImage *filteredImage = [[CIImage alloc] initWithCGImage:source.CGImage];<br>

<p>// CIFilterを作成し、ソース画像とエフェクトのパラメータをセットする<br />
CIFilter *filter = [CIFilter filterWithName:@"CIVignette"]; <br />
[filter setValue:[NSNumber numberWithFloat:1.0] forKey:@"inputIntensity"];<br />
[filter setValue:[NSNumber numberWithFloat:2.0] forKey:@"inputRadius"];<br />
[filter setValue:filteredImage forKey:@"inputImage"];<br />
// 結果を取り出す<br />
filteredImage = filter.outputImage;</p>

<p>/*<br />
 // CIFilterはチェーンが可能。コメント外すとCIVignetteが二重にかかる<br />
 [filter setValue:filteredImage forKey:@"inputImage"];<br />
 filteredImage = filter.outputImage;<br />
 */</p>

<p>// CIImageをUIImageに変換する<br />
CIContext *ciContext = [CIContext contextWithOptions:nil];<br />
CGImageRef imageRef = [ciContext createCGImage:filteredImage fromRect:[filteredImage extent]];<br />
UIImage *outputImage  = [UIImage imageWithCGImage:imageRef scale:1.0f orientation:UIImageOrientationUp];<br />
CGImageRelease(imageRef);</p>

<p>// 表示<br />
UIImageView *imageView = [[UIImageView alloc] initWithFrame:self.view.bounds];<br />
imageView.contentMode = UIViewContentModeScaleAspectFit;<br />
[imageView setImage:outputImage];</p>

<p>[self.view addSubview:imageView];<br />
</pre></p>

<p>参考サイト<br />
http://qiita.com/items/6dc6e1d67cbd58cb2318<br />
http://d.hatena.ne.jp/shu223/20111117/1321496682<br />
http://hamken100.blogspot.jp/2011/12/ios5cifilter.html<br />
http://news.mynavi.jp/column/objc/071/index.html</p>]]></description>
<link>http://publicroots.com/fmt/archives/000382.html</link>
<guid>http://publicroots.com/fmt/archives/000382.html</guid>
<category>Objective-C</category>
<pubDate>Wed, 24 Apr 2013 00:49:06 +0900</pubDate>
</item>
<item>
<title>[Objective-C] 他クラスのメソッドを呼ぶ時</title>
<description><![CDATA[<p>action.mファイル<br />
<em>kekka *viewController = [[kekka alloc] initWithNibName:@"kekka" bundle:nil];</em></p>

<p>kekka.mファイル<br />
<em><br />
- (void)showNext<br />
{<br />
     NSLog(@"showNext");<br />
}</em></p>

<p>action.mからkekka.mのshowNextにアクセスする場合<br />
<em>[viewController showNext];</em><br />
とかきます。</p>]]></description>
<link>http://publicroots.com/fmt/archives/000381.html</link>
<guid>http://publicroots.com/fmt/archives/000381.html</guid>
<category>Objective-C</category>
<pubDate>Wed, 24 Apr 2013 00:40:14 +0900</pubDate>
</item>
<item>
<title>[Objective-C] CGRect、CGPoint、CGSize</title>
<description><![CDATA[<p><em>CGRect</em><br />
対象オブジェクトの位置とサイズの両方を管理するクラスです。<br />
生成するには、CGRectMakeを使用し、引数には「位置ｘ, 位置y, 幅, 高さ」の順で指定します。<br />
<pre>// CGRectの生成<br />
CGRect rect = CGRectMake(0, 0, 100, 80);<br />
// 位置x、位置y、幅、高さ全て0のCGRectを生成する<br />
CGRect rect = CGRectZero;<br />
</pre></p>

<p><em>CGPoint</em><br />
対象オブジェクトの位置を管理するクラスです。<br />
生成するには、CGPointMakeを使用し、引数には「位置x, 位置y」の順で指定します。<br />
<pre>// CGPointの生成<br />
CGPoint point = CGPointMake(200, 300);<br />
</pre></p>

<p><em>CGSize</em><br />
対象オブジェクトの位置を管理するクラスです。<br />
生成するには、CGPointMakeを使用し、引数には「位置x, 位置y」の順で指定します。<br />
<pre>// CGSizeの生成<br />
CGSize sz = CGSizeMake(100, 50);<br />
</pre></p>

<p>参考サイト<br />
http://iphone-tora.sakura.ne.jp/uikit_size.html</p>]]></description>
<link>http://publicroots.com/fmt/archives/000380.html</link>
<guid>http://publicroots.com/fmt/archives/000380.html</guid>
<category>Objective-C</category>
<pubDate>Mon, 07 Jan 2013 19:32:34 +0900</pubDate>
</item>
<item>
<title>[Objective-C] NSArray 配列</title>
<description><![CDATA[<pre>
// リストを作成する<br>
NSArray *nozomi = [[NSArray arrayWithObjects:@"東京", @"品川", @"新横浜", <br>
@"名古屋", @"京都", @"大阪", nil] retain];
</pre>

<p>// リストに含まれる要素数を取得する<br />
<em>int cnt = [nozomi count];</em><br />
　cnt → 6// リストの4番目の要素を取り出す</p>

<p><em>NSString *str = [nozomi objectAtIndex:3];</em><br />
　str → 名古屋// リストの最後の要素を取り出す</p>

<p><em>NSString *str = [nozomi lastObject];</em><br />
　str → 大阪// リストに「福岡」が含まれているか判定する</p>

<p><em>BOOL flg = [nozomi containsObject:@"福岡"]; </em><br />
　flg → NO</p>

<p>参考サイト<br />
http://iphone-tora.sakura.ne.jp/nsarray.html<br />
</p>]]></description>
<link>http://publicroots.com/fmt/archives/000379.html</link>
<guid>http://publicroots.com/fmt/archives/000379.html</guid>
<category>Objective-C</category>
<pubDate>Mon, 07 Jan 2013 18:45:46 +0900</pubDate>
</item>
<item>
<title>[Objective-C] NSLog ログ書出し</title>
<description><![CDATA[<p>文字列<br />
<pre>NSLog(@"hoge");</pre></p>

<p>配列<br />
<pre>NSArray *array = [NSArrayarrayWithObjects:@"one", @"two", @"three", nil];<br />
NSLog(@"%@", array);</pre></p>

<p>　%@　：Objective-Cのオブジェクト（NSStringとか）<br />
　%d　：整数（intとか）<br />
　%f　：浮動小数点（doubleとかfloatとか）<br />
　　　　%.3fと指定することで桁数を指定できる<br />
　%s　：言語の文字列（NULLターミネートされた文字列）</p>

<p>参考サイト<br />
http://appteam.blog114.fc2.com/blog-entry-172.html<br />
</p>]]></description>
<link>http://publicroots.com/fmt/archives/000378.html</link>
<guid>http://publicroots.com/fmt/archives/000378.html</guid>
<category>Objective-C</category>
<pubDate>Mon, 07 Jan 2013 18:37:48 +0900</pubDate>
</item>
<item>
<title>[Objective-C] 文字列（NSString）の処理</title>
<description><![CDATA[<p>方法1 : stringWithFormat:メソッドを使う<br />
<pre><br />
NSString*str1 =@"Hello";<br />
NSString*str2 =@"World";<br />
NSString*str3 = [NSStringstringWithFormat:@"%@ %@", str1, str2];<br />
NSLog(@"str3 = %@", str3);<br />
</pre><br />
実行結果<br />
2012-04-21 06:28:13.831 StringTest[32624:f803] str3 = Hello World<br />
　　　　<br />
方法2 : stringByAppendingString:メソッドを使う<br />
<pre><br />
NSString*str1 =@"Hello";<br />
NSString*str2 = [str1 stringByAppendingString:@" World"];<br />
NSLog(@"str2 = %@", str2);<br />
</pre>　　<br />
実行結果<br />
2012-04-21 06:27:37.572 StringTest[32572:f803] str2 = Hello World</p>

<p><br />
参考サイト<br />
http://akio0911.net/archives/11465</p>]]></description>
<link>http://publicroots.com/fmt/archives/000377.html</link>
<guid>http://publicroots.com/fmt/archives/000377.html</guid>
<category>Objective-C</category>
<pubDate>Mon, 07 Jan 2013 18:34:18 +0900</pubDate>
</item>
<item>
<title>[Objective-C] メソッドの定義と実行</title>
<description><![CDATA[<p>１．戻り値も引数もないメソッドの場合<br />
<pre><br />
//メソッドを定義<br />
- (void)hogeMethod;  <br />
{<br />
  //処理<br />
}<br />
[test hogeMethod];  //メソッド呼び出し<br />
</pre></p>

<p>２．戻り値があって引数がないメソッドの場合<br />
<pre><br />
//戻り値がNSString型のメソッドを定義<br />
- (NSString *)hogeMethod;  <br />
{<br />
  //処理<br />
}<br />
NSString *result = [test hogeMethod];<br />
</pre></p>

<p>３．引数が1つあって戻り値がないメソッドの場合<br />
<pre><br />
//引数がNSString型のメソッドを定義<br />
- (void)hogeMethod:(NSString *)argString;  <br />
{<br />
  //処理<br />
}<br />
[test hogeMethod:@"hogehoge"];  //hogehoged文字列を引数としてメソッド呼び出し<br />
</pre></p>

<p>４．引数が1つと戻り値があるメソッドの場合<br />
<pre><br />
//戻り値がNSString型、引数がNSString型のメソッドを定義<br />
- (NSString *)myMethod:(NSString *)argString;  <br />
{<br />
   //処理<br />
}<br />
NSString *result = [test myMethod:@"hogehoge"];<br />
</pre></p>

<p>５．引数が2つと戻り値があるメソッドの場合<br />
<pre><br />
//戻り値がNSString型、引数がNSString型とint型の2つあるメソッドを定義<br />
- (NSString *)myMethod:(NSString *)argString   myInt:(int)argInt;<br />
{<br />
  //処理<br />
}<br />
NSString *result = [test myMethod:@"hogehoge"myInt:123];　//メソッド呼び出し<br />
</pre></p>

<pre>
- (void)setWidth:(int)argWidth <br>
               height:(int)argHeight<br>
               depth:(int)argDepth;<br>
{<br>
  //処理<br>
}<br>
[test setWidth:5height:6depth:7]　//メソッド呼び出し
</pre>

<p>メソッド定義の最初の「-」はインスタンスメソッドの定義の場合に付加する。<br />
 先頭の記号が「+」の場合はクラスメソッドの定義となる。<br />
 例えば、クラスの初期化手続きで利用するallocメソッドやinitメソッドなどが代表的なクラスメソッド。</p>

<p>参考サイト<br />
http://opendevlog2.blogspot.jp/2012/03/objective-c.html</p>]]></description>
<link>http://publicroots.com/fmt/archives/000376.html</link>
<guid>http://publicroots.com/fmt/archives/000376.html</guid>
<category>Objective-C</category>
<pubDate>Mon, 07 Jan 2013 18:16:47 +0900</pubDate>
</item>
<item>
<title>[Objective-C] UIColor</title>
<description><![CDATA[<p><br />
<pre><br />
// 色の割合を指定して生成する場合<br />
UIColor *color = [UIColor colorWithRed:0.0 green:0.5 blue:1.0 alpha:1.0];<br />
// 定義済みの色を指定して生成する場合<br />
UIColor *color = [UIColor whiteColor];<br />
// 画像を指定してパターンを生成する場合<br />
UIImage *hogeImage = [UIImage imageNamed:@"hoge.png"];<br />
UIColor *color = [[UIColor alloc] initWithPatternImage:hogeImage];<br />
// 生成済みのUIColorに透過率のみ指定する場合<br />
UIColor *color = [UIColor blueColor];<br />
UIColor *acolor = [color colorWithAlphaComponent:0.5]; //透過率50%<br />
</pre></p>

<p>参考サイト<br />
http://iphone-tora.sakura.ne.jp/uicolor.html<br />
</p>]]></description>
<link>http://publicroots.com/fmt/archives/000375.html</link>
<guid>http://publicroots.com/fmt/archives/000375.html</guid>
<category>Objective-C</category>
<pubDate>Mon, 07 Jan 2013 18:14:14 +0900</pubDate>
</item>
<item>
<title>[Objective-C] UIFont</title>
<description><![CDATA[<p><br />
<pre><br />
// スタイル：ノーマル、サイズ：標準<br />
UIFont *font = [UIFont systemFontOfSize:[UIFont systemFontSize]];<br />
// スタイル：ノーマル、サイズ：24<br />
UIFont *font = [UIFont systemFontOfSize:24];<br />
// スタイル：斜体、サイズ：小さめ<br />
UIFont *font = [UIFont italicSystemFontOfSize:[UIFont smallSystemFontSize]];<br />
// スタイル：太字、サイズ：ボタン用サイズ<br />
UIFont *font = [UIFont boldSystemFontOfSize:[UIFont buttonFontSize]];<br />
// フォント名：AppleGothic、サイズ：標準<br />
UIFont *font = [UIFont fontWithName:@"AppleGothic" size:[UIFont systemFontSize]];<br />
// フォント名：Courier、サイズ：20<br />
UIFont *font = [UIFont fontWithName:@"Courier" size:[UIFont systemFontSize]];<br />
</pre></p>

<p>参考サイト<br />
http://iphone-tora.sakura.ne.jp/uifont.html<br />
</p>]]></description>
<link>http://publicroots.com/fmt/archives/000374.html</link>
<guid>http://publicroots.com/fmt/archives/000374.html</guid>
<category>Objective-C</category>
<pubDate>Mon, 07 Jan 2013 17:48:13 +0900</pubDate>
</item>
<item>
<title>[Objective-C] UIWebView</title>
<description><![CDATA[<pre>
// UIWebView例文
UIWebView *wv = [[UIWebView alloc] init];
wv.delegate = self;
wv.frame = CGRectMake(0, 0, 200, 300);
wv.scalesPageToFit = YES;
[self.view addSubview:wv];

<p>NSURL *url = [NSURL URLWithString:@"http://www.yahoo.co.jp"];<br />
NSURLRequest *req = [NSURLRequest requestWithURL:url];<br />
[wv loadRequest:req];</p>

<p>// ページ読込開始時にインジケータをくるくるさせる<br />
-(void)webViewDidStartLoad:(UIWebView*)webView{<br />
  [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;<br />
}</p>

<p>// ページ読込完了時にインジケータを非表示にする<br />
-(void)webViewDidFinishLoad:(UIWebView*)webView{<br />
  [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;<br />
}<br />
</pre></p>

<p>参考サイト<br />
http://iphone-tora.sakura.ne.jp/uiwebview.html<br />
</p>]]></description>
<link>http://publicroots.com/fmt/archives/000373.html</link>
<guid>http://publicroots.com/fmt/archives/000373.html</guid>
<category>Objective-C</category>
<pubDate>Mon, 07 Jan 2013 17:44:13 +0900</pubDate>
</item>
<item>
<title>[Objective-C] UIViewにaddSubviewしたものを削除する方法</title>
<description><![CDATA[<p><b>removeFromSuperview</b><br />
<pre><br />
[_label1 removeFromSuperview];<br />
[_label1 release];<br />
</pre></p>

<pre>
UIView *_sampleView = [[UIView alloc] init];<br>
// _sampleViewを追加する。<br>
[self.view addSubview: _sampleView];<br>
<br>
//削除<br>
[_sampleView removeFromSuperview];<br>
</pre>]]></description>
<link>http://publicroots.com/fmt/archives/000372.html</link>
<guid>http://publicroots.com/fmt/archives/000372.html</guid>
<category>Objective-C</category>
<pubDate>Mon, 07 Jan 2013 17:41:28 +0900</pubDate>
</item>
<item>
<title>[Objective-C] ON/OFF 切り替えスイッチ</title>
<description><![CDATA[<p><b>UISwitch</b><br />
<pre><br />
// スイッチ例文<br />
UISwitch *swich = [[[UISwitch alloc] init] autorelease];<br />
swich.center = CGPointMake(200, 300);<br />
swich.on = YES;<br />
// 値が変更された時にhogeメソッドを呼び出す<br />
[swich addTarget:self action:@selector(hoge:) forControlEvents:UIControlEventValueChanged];<br />
[self.view addSubview:swich];<br />
〜<br />
// 呼ばれるhogeメソッド<br />
-(void)hoge:(UISwitch*)switch{<br />
    // ここに何かの処理を記述する<br />
}<br />
</pre></p>

<p><b>UIButton</b><br />
<pre><br />
UIButton* mySwitch = [UIButton buttonWithType:UIButtonTypeCustom];<br />
// OFFの画像設定<br />
[mySwitch setBackgroundImage:[UIImage imageNamed:@"btn_off" forState:UIControlStateNormal]];<br />
// タップ中の画像設定<br />
[mySwitch setBackgroundImage:[UIImage imageNamed:@"btn_off" forState:UIControlStateHighlighted]];<br />
// ONの画像設定<br />
[mySwitch setBackgroundImage:[UIImage imageNamed:@"btn_on" forState:UIControlStateNormal | UIControlStateSelected]];<br />
// タップ中の画像設定<br />
[mySwitch setBackgroundImage:[UIImage imageNamed:@"btn_off" forState:UIControlStateHighlighted | UIControlStateSelected]];<br />
[mySwitch addTarget:self action:@selector(mySwitchDidTap:) forControlEvents:UIControlEventTouchDown];<br />
// 配置<br />
mySwitch.frame = CGRectMake(10, 10, 100, 44);<br />
[self.viwe addSubView:mySwitch];<br />
〜<br />
文字変更する場合は下記<br />
-(void)mySwitchDidTap:(UIButton *)sender<br />
{<br />
sender.selected = !sender.selected;<br />
if (sender.selected) {<br />
// ON に変わった場合の処理<br />
} else {<br />
// OFF に変わった場合の処理<br />
}<br />
}<br />
</pre></p>

<p>参考サイト<br />
http://iphone-tora.sakura.ne.jp/uiswitch.html<br />
http://qiita.com/items/215adc6afc1c504f9ed3</p>]]></description>
<link>http://publicroots.com/fmt/archives/000371.html</link>
<guid>http://publicroots.com/fmt/archives/000371.html</guid>
<category>Objective-C</category>
<pubDate>Mon, 07 Jan 2013 17:11:50 +0900</pubDate>
</item>
<item>
<title>Google Chart APIを使ってQRコードを自動生成</title>
<description><![CDATA[<p>Google Chart APIを使ってQRコードを自動生成できる。</p>

<p>コードはこれだけでOK<br />
<pre>＜img src="http://chart.apis.google.com/chart?cht=qr&chs=150x150&choe=Shift_JIS<br />
&chl=ここに指定URLを記述" /＞<br />
</pre></p>

<p>publicroots.comの場合<br />
<img src="http://chart.apis.google.com/chart?cht=qr&chs=150x150&choe=Shift_JIS&chl=http://publicroots.com/" /></p>

<p>参考サイト<br />
<a href="http://www.devolen.com/blog/google/qrcode_auto_operation_generation/" target="_blank">http://www.devolen.com/blog/google/qrcode_auto_operation_generation/</a></p>

<p><em>Google Chart API</em><br />
<a href="https://developers.google.com/chart/" target="_blank">https://developers.google.com/chart/</a></p>]]></description>
<link>http://publicroots.com/fmt/archives/000370.html</link>
<guid>http://publicroots.com/fmt/archives/000370.html</guid>
<category>Google</category>
<pubDate>Mon, 27 Aug 2012 14:37:07 +0900</pubDate>
</item>
<item>
<title>Chromeの音声入力 x-webkit-speech</title>
<description><![CDATA[<p>Chromeの音声入力を実際にちょっと触ってみたのでメモ。</p>

<p><em>html</em><br />
x-webkit-speech属性を使う。<br />
<pre><br />
〜<br />
＜body＞<br />
＜input type="text" id="utterance" x-webkit-speech /＞<br />
＜textarea id="results" style="width:400px;height:200px;"＞＜/textarea＞<br />
</body＞<br />
〜<br />
</pre></p>

<p><br />
<em>Javascript</em><br />
onwebkitspeechchangeイベントでハンドリングして、<br />
this.valueで文字情報を取得する。<br />
<pre><br />
$(document).ready(function(){<br />
　/*音声認識処理*/<br />
　var voicesharp = document.getElementById("utterance");<br />
　voicesharp.addEventListener('webkitspeechchange',input_change,false);<br />
});<br />
/*音声認識処理*/<br />
function input_change(e)<br />
{<br />
　var inputText = this.value;<br />
　console.log('event:' + inputText);<br />
　//alert(inputText);<br />
　<br />
　if (inputText.match(/テスト/)) {<br />
　　task01(inputText);<br />
　} else {<br />
　　task02(inputText);<br />
　}<br />
}<br />
function task01(_oktxt) {<br />
　//alert("task01");<br />
　console.log("action start");<br />
　$("#results").val(_oktxt);<br />
};	<br />
function task02(_errtxt) {<br />
　//alert("task02");<br />
　console.log("no action");<br />
　$("#results").val(_errtxt);<br />
};<br />
</pre></p>

<p>詳細はこちらから<br />
<a href="http://earlgreyx.wordpress.com/2011/05/03/html-speech-input-on-google-chrome/" target="_blank">http://earlgreyx.wordpress.com/2011/05/03/html-speech-input-on-google-chrome/</a></p>]]></description>
<link>http://publicroots.com/fmt/archives/000368.html</link>
<guid>http://publicroots.com/fmt/archives/000368.html</guid>
<category>html5</category>
<pubDate>Wed, 11 Apr 2012 19:11:19 +0900</pubDate>
</item>


</channel>
</rss>