<?xml version="1.0" encoding="utf-8" ?>


<?xml-stylesheet href="/hogem/rssxsl" type="text/xsl" media="screen"?>


<rdf:RDF
	xmlns="http://purl.org/rss/1.0/"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xml:lang="ja">
<channel rdf:about="http://fragments.g.hatena.ne.jp/hogem/rss">
	<title>うまい棒の断片</title>
	<link>http://fragments.g.hatena.ne.jp/hogem/</link>
	<description>うまい棒の断片</description>

	<dc:creator>hogem</dc:creator>
	<items>
	<rdf:Seq>
		<rdf:li rdf:resource="http://fragments.g.hatena.ne.jp/hogem/20100826/1282839443"/>
		<rdf:li rdf:resource="http://fragments.g.hatena.ne.jp/hogem/20091124/1259077522"/>
		<rdf:li rdf:resource="http://fragments.g.hatena.ne.jp/hogem/20091122/1258904524"/>
		<rdf:li rdf:resource="http://fragments.g.hatena.ne.jp/hogem/20090613/1244904809"/>
	</rdf:Seq>
	</items>
</channel>
<item rdf:about="http://fragments.g.hatena.ne.jp/hogem/20100826/1282839443">
	<title>[objective-c]Cocoa Foundation memo</title>
	<link>http://fragments.g.hatena.ne.jp/hogem/20100826/1282839443</link>
	<description> メソッド呼び出し [Class(or instance) methodo: arg1] 変態記法 NSRange 文字列の位置と長さ NSPoint 座標 NSString イミュータブルな文字列。@&quot;hoge&quot; 。 (id) stringWithFormat: printf的な。&quot;%@&quot; はobjective-cオブジェク</description>

	<content:encoded><![CDATA[
		<div class="section">
			<ul>
				<li> メソッド呼び出し</li>
			</ul>
			<p>[Class(or instance) methodo: arg1]</p>
			<p>変態記法</p>
			<ul>
				<li> NSRange</li>
			</ul>
			<p>文字列の位置と長さ</p>
			<ul>
				<li> NSPoint</li>
			</ul>
			<p>座標</p>
			<ul>
				<li> NSString</li>
			</ul>
			<p>イミュータブルな文字列。@"hoge" 。</p>
			<ul>
				<li> (id) stringWithFormat:</li>
			</ul>
			<p>printf的な。"%@" はobjective-cオブジェクト。</p>
<pre class="syntax-highlight">
NSString *foo;
foo = [NSString stringWithFormat: @<span class="synConstant">&quot;foo bar baz </span><span class="synSpecial">%d</span><span class="synConstant">&quot;</span>, <span class="synConstant">100</span>];
</pre>

			<ul>
				<li> (BOOL) isEqualToString:</li>
			</ul>
			<p>文字列の比較</p>
			<ul>
				<li> (NSComparisonResult) compare:</li>
			</ul>
			<p>文字列の比較。戻り値がbooleanじゃなくてオブジェクト。(左が大きかったら1とか)</p>
			<ul>
				<ul>
					<li> option</li>
				</ul>
			</ul>
			<p>ignorecase したいときは</p>
<pre class="syntax-highlight">
<span class="synStatement">if</span> ( [foo compare: bar options: NSCaseInsensitiveSearch]
== NSOrderdSame) {
NSLog(@<span class="synConstant">&quot;hogehoge&quot;</span>);
}
</pre>

			<ul>
				<li> (BOOL) hasPrefix:</li>
				<li> (BOOL) hasSuffix:</li>
			</ul>
			<ul>
				<li> NSMutableString</li>
			</ul>
			<p>ミュータタブルな文字列</p>
			<p>appendしたりdeleteしたり。</p>
			<ul>
				<li> (id) stringWithCapacity</li>
			</ul>
			<p>文字列の箱作成メソッド。引数の数字はよくわからん。</p>
			<p>ヒントらしいけど、最大値とかいうわけでもないし。</p>
<pre class="syntax-highlight">
NSMutableString *foo;
foo = [NSMutableString stringWithCapacity:<span class="synConstant">100</span>];
</pre>

			<ul>
				<li> (void) appendString</li>
				<li> (void) appendFormat</li>
				<li> (void) deleteCharactersInRange: (NSRange) range;</li>
			</ul>
			<ul>
				<li> NSArray</li>
			</ul>
			<p>イミュータブルな配列。格納できるのはobjective-cなオブジェクトのみ。</p>
			<p>int、floatとかは無理。(やってみたらセグフォした)</p>
			<p>最後の要素にはnilを。</p>
<pre class="syntax-highlight">
NSArray *array;
array = [NSArray arrayWithObjects: @<span class="synConstant">&quot;foo&quot;</span>, @<span class="synConstant">&quot;bar&quot;</span>, @<span class="synConstant">&quot;baz&quot;</span>, nil];
</pre>

			<ul>
				<li> (unsinged) count</li>
			</ul>
			<p>数を返すメソッド。</p>
			<ul>
				<li> (id) objectAtIndex</li>
			</ul>
			<p>普通の配列でいう foo[10] みたいなことをやる</p>
<pre class="syntax-highlight">
<span class="synType">int</span> i;
<span class="synStatement">for</span> (i = <span class="synConstant">0</span>; i &amp;#<span class="synConstant">60</span>; [array count]; i++) {
NSLog(@<span class="synConstant">&quot;array[</span><span class="synSpecial">%d</span><span class="synConstant">] =&amp;#62; %@&quot;</span>, i, [array objectAtIndex: i];
<span class="synError">}</span>
</pre>

			<ul>
				<li> NSMutableArray</li>
			</ul>
			<p>ミュータブルな配列。追加/削除可能</p>
			<ul>
				<li> (id) arrayWithCapacity</li>
			</ul>
			<p>stringWithCapacityと同様に引数の数値が謎。</p>
			<ul>
				<li> イテレータ</li>
			</ul>
			<p>めんどくさ</p>
			<ul>
				<li> (NSEnumerator *) objectEnumerator;</li>
				<li> (id) nextObject</li>
			</ul>
<pre class="syntax-highlight">
NSEnumerator *enumerator;
enumerator = [array objectEnumerator];
id foo;
<span class="synStatement">while</span> (foo = [enumerator nextObject]) {
NSLog(<span class="synConstant">&quot;hogehoge %@&quot;</span>, foo);
}
</pre>

			<ul>
				<li> objective-2.0 以降 (leopard以降)</li>
			</ul>
			<p>LLっぽいforで。</p>
<pre class="syntax-highlight">
<span class="synStatement">for</span> (NSString *foo in array) {
NSLog(@<span class="synConstant">&quot;hoge %@&quot;</span>, foo);
}
</pre>

			<ul>
				<li> NSDictionary</li>
			</ul>
			<p>連想配列、いわゆるハッシュ。値もキーもobjective-cオブジェクト。</p>
			<ul>
				<li> dictionaryWithObjectsAndKeys</li>
			</ul>
			<p>長いわ。値、キーっていう順番がしっくりこない。</p>
			<ul>
				<li> (id) objecForKey:</li>
			</ul>
<pre class="syntax-highlight">
NSDictionary *foo;
foo = [NSDictionary dictionaryWithObjectsAndKeys:
[MyClass new], @<span class="synConstant">&quot;hoge&quot;</span>]
MyClass *bar = [foo objectForKey: @<span class="synConstant">&quot;hoge&quot;</span>];
</pre>

		</div>
]]></content:encoded>

	<dc:creator>hogem</dc:creator>
	<dc:date>2010-08-27T01:17:23+09:00</dc:date>
	<dc:subject>objective-c</dc:subject>
</item>
<item rdf:about="http://fragments.g.hatena.ne.jp/hogem/20091124/1259077522">
	<title>[perl]perlでgzip圧縮/展開</title>
	<link>http://fragments.g.hatena.ne.jp/hogem/20091124/1259077522</link>
	<description> perldoc Compress::Zlib $dest = Compress::Zlib::memGzip($buffer) ; $dest = Compress::Zlib::memGunzip($buffer) ; </description>

	<content:encoded><![CDATA[
		<div class="section">
			<ul>
				<li> perldoc Compress::Zlib</li>
			</ul>
<pre class="syntax-highlight">
<span class="synIdentifier">$dest</span> = Compress::Zlib::memGzip(<span class="synIdentifier">$buffer</span>) ;
<span class="synIdentifier">$dest</span> = Compress::Zlib::memGunzip(<span class="synIdentifier">$buffer</span>) ;
</pre>

		</div>
]]></content:encoded>

	<dc:creator>hogem</dc:creator>
	<dc:date>2009-11-25T00:45:22+09:00</dc:date>
	<dc:subject>perl</dc:subject>
</item>
<item rdf:about="http://fragments.g.hatena.ne.jp/hogem/20091122/1258904524">
	<title>[bash]bashでcd後に自動でls</title>
	<link>http://fragments.g.hatena.ne.jp/hogem/20091122/1258904524</link>
	<description> .bashrcとかに書く。 function cd() { builtin cd $@ ls -a } zshはchpwd()にlsって書くだけ？ </description>

	<content:encoded><![CDATA[
		<div class="section">
			<p>.bashrcとかに書く。</p>
<pre class="syntax-highlight">
function cd() {
  builtin cd $@
  ls -a
}
</pre>

			<p>zshはchpwd()にlsって書くだけ？</p>
		</div>
]]></content:encoded>

	<dc:creator>hogem</dc:creator>
	<dc:date>2009-11-23T00:42:04+09:00</dc:date>
	<dc:subject>bash</dc:subject>
</item>
<item rdf:about="http://fragments.g.hatena.ne.jp/hogem/20090613/1244904809">
	<title>[postgresql]postgresqlのSQLのexplain</title>
	<link>http://fragments.g.hatena.ne.jp/hogem/20090613/1244904809</link>
	<description> http://www.postgresql.jp/document/pg837doc/html/sql-explain.html postgresqlにもあったのか。 </description>

	<content:encoded><![CDATA[
		<div class="section">
			<ul>
				<li> <a href="http://www.postgresql.jp/document/pg837doc/html/sql-explain.html" target="_blank">http://www.postgresql.jp/document/pg837doc/html/sql-explain.html</a></li>
			</ul>
			<p>postgresqlにもあったのか。</p>
		</div>
]]></content:encoded>

	<dc:creator>hogem</dc:creator>
	<dc:date>2009-06-13T23:53:29+09:00</dc:date>
	<dc:subject>postgresql</dc:subject>
</item>
</rdf:RDF>

