<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[\x6d\x65\x6d\x6f\x6e]]></title>
  <link href="http://blog.seiji.me/atom.xml" rel="self"/>
  <link href="http://blog.seiji.me/"/>
  <updated>2012-05-18T10:58:59+09:00</updated>
  <id>http://blog.seiji.me/</id>
  <author>
    <name><![CDATA[Seiji Toyama]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[git commit Logの文字化け対応 - Jenkins]]></title>
    <link href="http://blog.seiji.me/blog/2012/05/18/genkins-encoding-commitlog/"/>
    <updated>2012-05-18T10:47:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2012/05/18/genkins-encoding-commitlog</id>
    <content type="html"><![CDATA[

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
<span class='line-number'>21</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>$ vi  ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
</span><span class='line'>&lt;?xml version="1.0" encoding="UTF-8"?>
</span><span class='line'>&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
</span><span class='line'>&lt;plist version="1.0">
</span><span class='line'>  &lt;dict>
</span><span class='line'>    &lt;key>Label&lt;/key>
</span><span class='line'>    &lt;string>homebrew.mxcl.jenkins&lt;/string>
</span><span class='line'>    &lt;key>ProgramArguments&lt;/key>
</span><span class='line'>    &lt;array>
</span><span class='line'>      &lt;string>/usr/bin/java&lt;/string>
</span><span class='line'>      &lt;string>-Xmx512m&lt;/string> 
</span><span class='line'>      &lt;string>-Dfile.encoding=UTF-8&lt;/string>
</span><span class='line'>      &lt;string>-jar&lt;/string>
</span><span class='line'>      &lt;string>/usr/local/lib/jenkins.war&lt;/string>
</span><span class='line'>    &lt;/array>
</span><span class='line'>    &lt;key>RunAtLoad&lt;/key>
</span><span class='line'>    &lt;true/>
</span><span class='line'>    &lt;key>KeepAlive&lt;/key>
</span><span class='line'>    &lt;true/>
</span><span class='line'>  &lt;/dict>
</span><span class='line'>&lt;/plist></span></code></pre></td></tr></table></div></figure>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[display http header Using tshark]]></title>
    <link href="http://blog.seiji.me/blog/2012/05/15/display-http-header-using-tshark/"/>
    <updated>2012-05-15T20:28:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2012/05/15/display-http-header-using-tshark</id>
    <content type="html"><![CDATA[

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
<span class='line-number'>21</span>
<span class='line-number'>22</span>
<span class='line-number'>23</span>
<span class='line-number'>24</span>
<span class='line-number'>25</span>
<span class='line-number'>26</span>
<span class='line-number'>27</span>
<span class='line-number'>28</span>
<span class='line-number'>29</span>
<span class='line-number'>30</span>
<span class='line-number'>31</span>
<span class='line-number'>32</span>
<span class='line-number'>33</span>
<span class='line-number'>34</span>
<span class='line-number'>35</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>$ sudo tshark -V -R "http.request" -i lo0 port 80 
</span><span class='line'>>>
</span><span class='line'>    [Calculated window size: 81660]
</span><span class='line'>    [Window size scaling factor: 2]
</span><span class='line'>    Checksum: 0xfe28 [validation disabled]
</span><span class='line'>        [Good Checksum: False]
</span><span class='line'>        [Bad Checksum: False]
</span><span class='line'>    Options: (12 bytes)
</span><span class='line'>        No-Operation (NOP)
</span><span class='line'>        No-Operation (NOP)
</span><span class='line'>        Timestamps: TSval 664148220, TSecr 664148220
</span><span class='line'>            Kind: Timestamp (8)
</span><span class='line'>            Length: 10
</span><span class='line'>            Timestamp value: 664148220
</span><span class='line'>            Timestamp echo reply: 664148220
</span><span class='line'>[2 Reassembled TCP Segments (132 bytes): #16(132), #20(0)]
</span><span class='line'>    [Frame: 16, payload: 0-131 (132 bytes)]
</span><span class='line'>    [Frame: 20 (no data)]
</span><span class='line'>    [Segment count: 2]
</span><span class='line'>    [Reassembled TCP length: 132]
</span><span class='line'>Hypertext Transfer Protocol
</span><span class='line'>    POST /data/post HTTP/1.1\r\n
</span><span class='line'>        [Expert Info (Chat/Sequence): POST /data/post HTTP/1.1\r\n]
</span><span class='line'>            [Message: POST /data/post HTTP/1.1\r\n]
</span><span class='line'>            [Severity level: Chat]
</span><span class='line'>            [Group: Sequence]
</span><span class='line'>        Request Method: POST
</span><span class='line'>        Request URI: /data/post
</span><span class='line'>        Request Version: HTTP/1.1
</span><span class='line'>    Accept: */*\r\n
</span><span class='line'>    User-Agent: Ruby\r\n
</span><span class='line'>    Content-Type: multipart/form-data; boundary=myboundary\r\n
</span><span class='line'>    Host: localhost\r\n
</span><span class='line'>    \r\n
</span><span class='line'>    [Full request URI: http://localhost/data/post]</span></code></pre></td></tr></table></div></figure>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Ranking in Redis Sorted Set]]></title>
    <link href="http://blog.seiji.me/blog/2012/05/14/ranking-with-redis/"/>
    <updated>2012-05-14T15:36:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2012/05/14/ranking-with-redis</id>
    <content type="html"><![CDATA[<h2>Precondition</h2>

<p>Rows : 1,000,000</p>

<p>Score: rand(1..100)</p>

<h2>RedisのSorted Setを使用し、Top10と自分を含む前後5人のランキングを表示する</h2>

<div><script src='https://gist.github.com/2692190.js?file='></script>
<noscript><pre><code>#!/usr/bin/env ruby
require 'redis'

class UserNotFoundException &lt; Exception; end
class UserRanking 
  KEY=&quot;ranking&quot;

  def initialize(user_id)
    @redis= Redis.new

    @user_id= user_id
    @myscore= (@redis.zscore KEY, user_id).to_i
    if @myscore &gt; 0
      @myindex= @redis.zrevrank KEY, user_id
      @myrank= get_rank(@myscore)      
      puts &lt;&lt;&quot;EOS&quot;
UserID: #{@user_id}
Score : #{@myscore}
Rank  : #{@myrank}  
EOS
    else
      raise UserNotFoundException, &quot;User not found&quot;
    end    
  end
  
  def get_rank(score)
    score= score.to_i
    (@redis.zcount KEY, score+1, Float::INFINITY) + 1
  end

  def display(ranking, scores={})
    if ranking
      ranking.each_slice(2).with_index do |(uid, score), i|
        rank= scores[score] || 0
        if rank &lt; 1
          rank= get_rank(score)
          scores[score]= rank
        end
        str= &quot;%7d %11s: %3d&quot; % [rank, uid, score]
        str &lt;&lt; &quot; &lt;--- &quot; if uid == @user_id
        puts str
      end
    end
  end

  def top10()
    puts &quot;[Top10]&quot;
    ranking= @redis.zrevrange( KEY, 0, 9,  {withscores: true})
    display ranking, {ranking[1] =&gt; 1}
  end

  def near10() 
    puts &quot;[Near10]&quot;
    scores= {@myscore =&gt; @myrank}
    range= 5
    first= (@myindex - range &gt; 0) ? @myindex-range : 0
    ranking= @redis.zrevrange(KEY, first, @myindex + range, {withscores: true})
    display ranking, scores 
  end
end

if $0 == __FILE__
  # write this
  user_id= ARGV[0] || &quot;User0234567&quot;
  ranking = UserRanking.new(user_id)
  ranking.top10()
  ranking.near10()
end
</code></pre></noscript></div>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Jenkins-Unity Build execute shell for iPhone]]></title>
    <link href="http://blog.seiji.me/blog/2012/05/11/jenkins-unity-build-execute-shell-for-iphone/"/>
    <updated>2012-05-11T11:35:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2012/05/11/jenkins-unity-build-execute-shell-for-iphone</id>
    <content type="html"><![CDATA[<p>Unity3D Plugin, Xcode Plugin, TestFlight Pluginも試したけど、結局shell scriptに落ち着いた。</p>

<div><script src='https://gist.github.com/2657122.js?file='></script>
<noscript><pre><code>UNITY_APP_PATH=/Applications/Unity3.4/Unity.app/Contents/MacOS/Unity
UNITY_PROJECT_PATH=$WORKSPACE/Unity
UNITY_EDITOR_LOG_PATH=~/Library/Logs/Unity/Editor.log
XCODE_PROJECT_PATH=$WORKSPACE/Unity-iPhone

KEYCHAIN_LOCATION=~/Library/Keychains/login.keychain
XCODE_PROJECT_CONFIG_PATH=$XCODE_PROJECT_PATH/Unity-iPhone.xcodeproj

### EDIT AREA START
UNITY_BATCH_EXECUTE_METHOD=XXXXX

IOS_PROVISIONING_FILE_PATH=XXXXX
IOS_P12_FILE_PATH=XXXXX
iOS_P12_PASSWORD=XXXXX
OSX_ADMIN_PASSWORD=XXXXX
CONFIGURATION=Debug # Debug, Release
IDENTITY=XXXXX
PRODUCT_NAME=XXXXX

API_TOKEN=XXXXX
TEAM_TOKEN=XXXXX
DISTRIBUTION_LISTS=XXXXX
### EDIT AREA END

PROFILE_UUID=`grep &quot;UUID&quot; ${IOS_PROVISIONING_FILE_PATH} -A 1 --binary-files=text 2&gt;/dev/null |grep string|sed -e 's/^[[:blank:]]&lt;string&gt;//' -e 's/&lt;\/string&gt;//'`

$UNITY_APP_PATH -batchmode -quit -projectPath &quot;${UNITY_PROJECT_PATH}&quot; -executeMethod $UNITY_BATCH_EXECUTE_METHOD
if [ $? -eq 1 ]; then
     cat $UNITY_EDITOR_LOG_PATH
      exit 1
      fi

### xcodebuild
# unlock keychain
security unlock-keychain -p $OSX_ADMIN_PASSWORD &quot;${KEYCHAIN_LOCATION}&quot;
# import
security import &quot;${IOS_P12_FILE_PATH}&quot; -f pkcs12 -P &quot;${iOS_P12_PASSWORD}&quot; -k &quot;${KEYCHAIN_LOCATION}&quot; -T /usr/bin/codesign

cp $IOS_PROVISIONING_FILE_PATH ~/Library/MobileDevice/Provisioning\ Profiles/$PROFILE_UUID.mobileprovision

# .dSYM
BUILD_OPT_MAKE_DSYM=&quot;GCC_GENERATE_DEBUGGING_SYMBOLS=YES DEBUG_INFORMATION_FORMAT=dwarf-with-dsym DEPLOYMENT_POSTPROCESSING=YES STRIP_INSTALLED_PRODUCT=YES SEPARATE_STRIP=YES COPY_PHASE_STRIP=NO&quot;
# clean (optional)
xcodebuild clean -configuration $CONFIGURATION -project &quot;${XCODE_PROJECT_CONFIG_PATH}&quot;
# build
xcodebuild \
      -project &quot;${XCODE_PROJECT_CONFIG_PATH}&quot; \
      -configuration &quot;${CONFIGURATION}&quot; \
      -target &quot;Unity-iPhone&quot; \
      CODE_SIGN_IDENTITY=&quot;${IDENTITY}&quot; \
      OTHER_CODE_SIGN_FLAGS=&quot;--keychain ${KEYCHAIN_LOCATION}&quot; \
      $BUILD_OPT_MAKE_DSYM

### create ipa
TARGET_APP_PATH=$XCODE_PROJECT_PATH/build/$PRODUCT_NAME.app
IPA_FILE_PATH=$XCODE_PROJECT_PATH/build/$PRODUCT_NAME-$BUILD_NUMBER.ipa

/usr/bin/xcrun \
     -sdk iphoneos \
     PackageApplication \
     -v &quot;${TARGET_APP_PATH}&quot; \
     -o &quot;${IPA_FILE_PATH}&quot; \
     --sign &quot;${IDENTITY}&quot; \
     --embed &quot;${IOS_PROVISIONING_FILE_PATH}&quot;

TARGET_DSYM=$PRODUCT_NAME.app.dSYM
DSYM_ZIP_PATH=$XCODE_PROJECT_PATH/build/$PRODUCT_NAME.app.dSYM-$BUILD_NUMBER.zip
cd $XCODE_PROJECT_PATH/build/
zip -r $DSYM_ZIP_PATH $TARGET_DSYM

### post testflight
curl http://testflightapp.com/api/builds.json \
 -F file=@$IPA_FILE_PATH \
 -F dsym=@DSYM_ZIP_PATH \
 -F api_token=$API_TOKEN \
 -F team_token=$TEAM_TOKEN \
 -F notes=&quot;env:development&quot; \
 -F notify=True \
 -F distribution_lists=$DISTRIBUTION_LISTS
</code></pre></noscript></div>


<p>referrel
<a href="http://ameblo.jp/principia-ca/entry-11010391965.html">【研究課題レポート抜粋】Jenkins+Unityで構築するスマフォアプリビルドサーバー</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[reinstall rvm]]></title>
    <link href="http://blog.seiji.me/blog/2012/03/07/reinstall-rvm/"/>
    <updated>2012-03-07T15:41:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2012/03/07/reinstall-rvm</id>
    <content type="html"><![CDATA[<h2>reinstall rvm</h2>

<div><script src='https://gist.github.com/1991442.js?file='></script>
<noscript><pre><code>mv ~/.rvm ~/.rvm_org
bash -s stable &lt; &lt;(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
rvm reload

rvm pkg install readline
rvm pkg install openssl
rvm pkg install zlib
rvm pkg install iconv

rvm install ruby-1.9.3 --with-openssl-dir=~$HOME/.rvm/usr --with-iconv-dir=$HOME/.rvm/usr 
rvm install macruby-head # this may take a while
rvm --default use 1.9.3
</code></pre></noscript></div>


<h2>fsevent/fsevent_watch.c:1:10: fatal error: &#8216;stdio.h&#8217; file not found</h2>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>$ vi Gemfile
</span><span class='line'>>>
</span><span class='line'>- gem 'rb-fsevent',
</span><span class='line'>+ gem 'rb-fsevent', :git => 'git://github.com/ttilley/rb-fsevent.git', :branch => 'pre-compiled-gem-one-off'</span></code></pre></td></tr></table></div></figure>


<p>referrel<br/>
<a href="https://github.com/thibaudgg/rb-fsevent/issues/20#issuecomment-1814363">https://github.com/thibaudgg/rb-fsevent/issues/20#issuecomment-1814363</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Insert DateTime in UTC time]]></title>
    <link href="http://blog.seiji.me/blog/2012/03/04/emacs-insert-datetime/"/>
    <updated>2012-03-04T00:51:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2012/03/04/emacs-insert-datetime</id>
    <content type="html"><![CDATA[<h3>xxx.el</h3>

<div><script src='https://gist.github.com/1966782.js?file='></script>
<noscript><pre><code>(defun insert-datetime ()
  (interactive)
  (insert (format-time-string &quot;%Y-%m-%d %H:%M:%SZ&quot; nil &quot;Z&quot;)))
</code></pre></noscript></div>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Xcode-4.3 mismatched ubiquitykvstore identifier value in TestFlight]]></title>
    <link href="http://blog.seiji.me/blog/2012/02/29/testflight-xcode-4-dot-3-mismatched-ubiquitykvstore-identifier-value/"/>
    <updated>2012-02-29T00:51:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2012/02/29/testflight-xcode-4-dot-3-mismatched-ubiquitykvstore-identifier-value</id>
    <content type="html"><![CDATA[

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>Mismatched ubiquity.kvstore-identifier value</span></code></pre></td></tr></table></div></figure>


<p><img src="http://img.seiji.me/blog/2012/02/28.png" /></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Upgrade to XCode 4.3]]></title>
    <link href="http://blog.seiji.me/blog/2012/02/28/update-to-xcode4-dot-3/"/>
    <updated>2012-02-28T01:45:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2012/02/28/update-to-xcode4-dot-3</id>
    <content type="html"><![CDATA[

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>// Install OSX 10.7.3
</span><span class='line'>// Install Xcode4.3
</span><span class='line'>// open Xcode4.3 to remove /Developper
</span><span class='line'>$ sudo /Developer/Library/uninstall-devtools --mode=all
</span><span class='line'>$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
</span><span class='line'>$ xcode-select -print-path
</span><span class='line'>/Applications/Xcode.app/Contents/Developer
</span><span class='line'>$ xcodebuild -version
</span><span class='line'>Xcode 4.3
</span><span class='line'>Build version 4E109</span></code></pre></td></tr></table></div></figure>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[arrange existing xcodeproj]]></title>
    <link href="http://blog.seiji.me/blog/2012/02/12/arrange-existing-xcodeproj/"/>
    <updated>2012-02-12T00:15:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2012/02/12/arrange-existing-xcodeproj</id>
    <content type="html"><![CDATA[<p>arranged existing xcode project using Xcode::Project.</p>

<!-- more -->


<div><script src='https://gist.github.com/1787566.js?file='></script>
<noscript><pre><code># -*- coding: utf-8 -*-
#
require 'rubygems'
require 'xcodeproj'

ADD_FRAMEWORKS = %w{
AddressBook
AVFoundation
GameKit
libicucore.A.dylib
libsqlite3.dylib
libxml2.dylib
libz.1.2.5.dylib
MessageUI
MobileCoreServices
Security
StoreKit
CoreTelephony
}

module Xcodeproj
  class Project
    def get_group(name) 
      self.groups.find { |g| g.name == name } || self.groups.new({ 'name' =&gt; name })
    end

    def add_system_framework(fname)
      name, path = nil, nil;
      if (fname =~ /^lib/)
        name, path = fname, &quot;usr/lib/#{fname}&quot;
      else
        name, path = &quot;#{fname}.framework&quot;, &quot;System/Library/Frameworks/#{fname}.framework&quot;
      end
      self.files.new({ 
                       'name' =&gt; name,
                       'path' =&gt; path,
                       'sourceTree' =&gt; 'SDKROOT',
                     })
    end

    def arrange_frameworks
      group = get_group('Frameworks')
      frameworks_build_phases_list = [] 
      self.targets.each do |target|
        target.frameworks_build_phases.each do |phase|
          frameworks_build_phases_list.push(phase)
        end
      end

      self.files.sort{|a,b| a.name &lt;=&gt; b.name }.each do |file|
        path = file.path
        if (path =~ /^System\/Library\/Frameworks/ or path =~ /^usr\/lib/)
          file.group = group
        end
      end
      ADD_FRAMEWORKS.each do |fname|
        if (group.files.find {|f|
              cname = (f.name =~ /framework$/) ? &quot;#{fname}.framework&quot; :  fname
              f.name == cname
            })
        else
          framework = add_system_framework(fname)
          framework.group = group
          frameworks_build_phases_list.each do |buildPhase|
            buildPhase.files &lt;&lt; framework.buildFiles.new
          end
        end
      end
    end

    def self.arrange_project(path)
      xcodeproj_path = nil
      Dir.glob(&quot;#{path}/*.xcodeproj&quot;).each do |file|
        xcodeproj_path = file
      end
      return if !xcodeproj_path

      project = Xcodeproj::Project.new(xcodeproj_path)
      project.arrange_frameworks()
      project.save_as(xcodeproj_path)      
      project
    end
    private    
  end
end


if $0 == __FILE__
  Xcodeproj::Project.arrange_project(&quot;/tmp/Test&quot;)
end





</code></pre></noscript></div>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[create xcodeproj using Xcode::Project]]></title>
    <link href="http://blog.seiji.me/blog/2012/02/10/create-xcodeproj-using-xcode-project/"/>
    <updated>2012-02-10T13:24:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2012/02/10/create-xcodeproj-using-xcode-project</id>
    <content type="html"><![CDATA[<p>this is required macruby</p>

<!--more-->


<div><script src='https://gist.github.com/1786572.js?file='></script>
<noscript><pre><code># -*- coding: utf-8 -*-
#
require 'rubygems'
require 'xcodeproj'

FRAMEWORKS = %w{
AudioToolbox
CFNetwork
CoreGraphics
CoreLocation
Foundation
MediaPlayer
OpenAL
OpenGLES
QuartzCore
UIKit
libiconv.2.dylib
}

module Xcodeproj
  class Project
    def get_group(name) 
      self.groups.find { |g| g.name == name } || self.groups.new({ 'name' =&gt; name })
    end

    def add_system_framework(fname)
      name, path = nil, nil;
      if (fname =~ /^lib/)
        name, path = fname, &quot;usr/lib/#{fname}&quot;
      else
        name, path = &quot;#{fname}.framework&quot;, &quot;System/Library/Frameworks/#{fname}.framework&quot;
      end
      self.files.new({ 
                       'name' =&gt; name,
                       'path' =&gt; path,
                       'sourceTree' =&gt; 'SDKROOT'
                     })
    end
    
    def add_frameworks
      group = get_group('Frameworks')
      FRAMEWORKS.each do |fname|
        framework = add_system_framework(fname)  
        framework.group = group
      end
      self.main_group &lt;&lt; group
    end

    def self.create_project(path)
      project = Xcodeproj::Project.new
      project.main_group &lt;&lt; project.get_group('Classes')
      project.add_frameworks()

      products = project.get_group('Products')
      project.main_group &lt;&lt; products
      project.root_object.products = products
 
      project.root_object.attributes['buildConfigurationList'] = 
        project.objects.add(Xcodeproj::Project::XCConfigurationList, {
                           'defaultConfigurationIsVisible' =&gt; '0',
                           'defaultConfigurationName' =&gt; 'Release',
                           'buildConfigurations' =&gt; 
                           [
                            project.objects.add(Xcodeproj::Project::XCBuildConfiguration, {
                                               'name' =&gt; 'Debug',
                                               'buildSettings' =&gt; build_settings(:ios, :debug)
                                             }),
                            project.objects.add(Xcodeproj::Project::XCBuildConfiguration, {
                                               'name' =&gt; 'Release',
                                               'buildSettings' =&gt; build_settings(:ios, :release)
                                             })
                           ].map(&amp;:uuid)
                         }).uuid
      project.save_as(path + &quot;/#{File.basename(path)}.xcodeproj&quot;)      
      project
    end
    private    
    COMMON_BUILD_SETTINGS = {
      :all =&gt; {
        'ALWAYS_SEARCH_USER_PATHS' =&gt; 'NO',
        'GCC_C_LANGUAGE_STANDARD' =&gt; 'gnu99',
        'INSTALL_PATH' =&gt; &quot;$(BUILT_PRODUCTS_DIR)&quot;,
        'GCC_WARN_ABOUT_MISSING_PROTOTYPES' =&gt; 'YES',
        'GCC_WARN_ABOUT_RETURN_TYPE' =&gt; 'YES',
        'GCC_WARN_UNUSED_VARIABLE' =&gt; 'YES',
        'OTHER_LDFLAGS' =&gt; ''
      },
      :debug =&gt; {
        'GCC_DYNAMIC_NO_PIC' =&gt; 'NO',
        'GCC_PREPROCESSOR_DEFINITIONS' =&gt; [&quot;DEBUG=1&quot;, &quot;$(inherited)&quot;],
        'GCC_SYMBOLS_PRIVATE_EXTERN' =&gt; 'NO',
        'GCC_OPTIMIZATION_LEVEL' =&gt; '0'
      },
      :ios =&gt; {
        'ARCHS' =&gt; &quot;$(ARCHS_STANDARD_32_BIT)&quot;,
        'GCC_VERSION' =&gt; 'com.apple.compilers.llvmgcc42',
        'IPHONEOS_DEPLOYMENT_TARGET' =&gt; '4.3',
        'PUBLIC_HEADERS_FOLDER_PATH' =&gt; &quot;$(TARGET_NAME)&quot;,
        'SDKROOT' =&gt; 'iphoneos'
      },
    }
    def self.build_settings(platform, scheme)
      settings = COMMON_BUILD_SETTINGS[:all].merge(COMMON_BUILD_SETTINGS[platform])
      settings['COPY_PHASE_STRIP'] = scheme == :debug ? 'NO' : 'YES'
      if scheme == :debug
        settings.merge!(COMMON_BUILD_SETTINGS[:debug])
      else
        settings['VALIDATE_PRODUCT'] = 'YES' if platform == :ios
      end
      settings
    end    
  end
end


if $0 == __FILE__
  Xcodeproj::Project.create_project(&quot;/tmp/Test&quot;)
end





</code></pre></noscript></div>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[stackframe and elapsed time]]></title>
    <link href="http://blog.seiji.me/blog/2012/02/07/stackframe-and-elapsed-time/"/>
    <updated>2012-02-07T11:16:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2012/02/07/stackframe-and-elapsed-time</id>
    <content type="html"><![CDATA[<p>print realtimeSinceStartup and StackFrame[1] for logging</p>

<div><script src='https://gist.github.com/1756668.js?file='></script>
<noscript><pre><code>string message = Time.realtimeSinceStartup.ToString() + &quot; : [Elapsed]&quot;;
StackFrame CallStack = new StackFrame(1, true);
string SourceFile = CallStack.GetFileName();
int SourceLine = CallStack.GetFileLineNumber();
message += &quot;\n - File: &quot; + SourceFile + &quot; Line: &quot; + SourceLine.ToString();

Debug.Debug(message);

</code></pre></noscript></div>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[build for ios using Unity Editor command line]]></title>
    <link href="http://blog.seiji.me/blog/2012/02/04/build-for-ios-using-unity-editor-command-line/"/>
    <updated>2012-02-04T13:09:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2012/02/04/build-for-ios-using-unity-editor-command-line</id>
    <content type="html"><![CDATA[<div><script src='https://gist.github.com/1735284.js?file='></script>
<noscript><pre><code>;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.


/Applications/Unity/Unity.app/Contents/MacOS/Unity \
  -batchmode \
  -quit \
  -projectPath $PROJECT_PATH \
  -executeMethod CommandBuild.BuildiOS


using UnityEngine;
using UnityEditor;

public class CommandBuild
{
    public static void BuildiOS
    {
        BuildOptions opt = BuildOptions.SymlinkLibraries| BuildOptions.Development|BuildOptions.ConnectWithProfiler|BuildOptions.AllowDebugging;
        BuildPipeline.BuildPlayer({&quot;Assets/Scenes/Main.unity&quot;},&quot;iOS&quot;,BuildTarget.iPhone,opt); 
    }
}


</code></pre></noscript></div>


<p>referrel<br/>
<a href="http://unity3d.com/support/documentation/Manual/Command%20Line%20Arguments.html">Unity/documentation/Manual/Command Line Arguments</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Unity wrap Debug class]]></title>
    <link href="http://blog.seiji.me/blog/2012/01/25/unity-wrap-debug-class/"/>
    <updated>2012-01-25T12:34:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2012/01/25/unity-wrap-debug-class</id>
    <content type="html"><![CDATA[<h3>Debug.cs</h3>

<p>I just wanted to clear other &#8220;Debug.Log&#8221;</p>

<div><script src='https://gist.github.com/1674536.js?file=Debug.cs'></script>
<noscript><pre><code>using UnityEngine;
using System.Collections;
using System;
using System.IO;
using System.Text.RegularExpressions;
using UnityEngineInternal;

public static class Debug 
{
    public static bool isDebugBuild = true;

    public static void Log (object message)
    {
        if (isDebugBuild)
            UnityEngine.Debug.Log (message + hr);

    }
    public static void Log (object message, UnityEngine.Object context)
    {
        if (isDebugBuild)
            UnityEngine.Debug.Log (message, context);
    }

    public static void LogError (object message)
    {
        if (isDebugBuild)
            UnityEngine.Debug.LogError (message);
    }

    public static void LogError (object message, UnityEngine.Object context)
    {
        if (isDebugBuild)
            UnityEngine.Debug.LogError (message, context);
    }

    public static void LogWarning (object message)
    {
        if (isDebugBuild)
            UnityEngine.Debug.LogWarning (message.ToString ());
    }

    public static void LogWarning (object message, UnityEngine.Object context)
    {
        if (isDebugBuild)
            UnityEngine.Debug.LogWarning (message.ToString (), context);
    }
}
</code></pre></noscript></div>


<p>referrel<br/>
<a href="http://forum.unity3d.com/threads/38720-Debug.Log-and-needless-spam">http://forum.unity3d.com/threads/38720-Debug.Log-and-needless-spam</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[markdown-insert-headers and gist.el]]></title>
    <link href="http://blog.seiji.me/blog/2012/01/15/markdown-mode-markdown-insert-header/"/>
    <updated>2012-01-15T15:21:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2012/01/15/markdown-mode-markdown-insert-header</id>
    <content type="html"><![CDATA[<h3>~/.emacs.d/init/markdown-mode.el</h3>

<p>I&#8217;ve changed keybinds/markdown-insert-header for using the ^T command prefix in tmux</p>

<div><script src='https://gist.github.com/1614694.js?file=init-markdown.el'></script>
<noscript><pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;meta charset='utf-8'&gt;
    &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;chrome=1&quot;&gt;
        &lt;title&gt;404 - GitHub&lt;/title&gt;
    &lt;link rel=&quot;search&quot; type=&quot;application/opensearchdescription+xml&quot; href=&quot;/opensearch.xml&quot; title=&quot;GitHub&quot; /&gt;
    &lt;link rel=&quot;fluid-icon&quot; href=&quot;https://github.com/fluidicon.png&quot; title=&quot;GitHub&quot; /&gt;

    
    

    

    &lt;link href=&quot;https://a248.e.akamai.net/assets.github.com/stylesheets/bundles/github-182944099c59274f5fb79ea97c47f923a5864f79.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
    

    &lt;script src=&quot;https://a248.e.akamai.net/assets.github.com/javascripts/bundles/jquery-2bdf48207f435863de9c5786265d27d992c7f6c0.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;https://a248.e.akamai.net/assets.github.com/javascripts/bundles/github-68d680d89cf702cc67c2ebb0b261548622d05ce3.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
    

    
  &lt;/head&gt;


  &lt;body class=&quot;logged_out    env-production &quot;&gt;
    


    

      &lt;div id=&quot;header&quot; class=&quot;true clearfix&quot;&gt;
        &lt;div class=&quot;container clearfix&quot;&gt;
          &lt;a class=&quot;site-logo&quot; href=&quot;https://github.com&quot;&gt;
            &lt;!--[if IE]&gt;
            &lt;img alt=&quot;GitHub&quot; class=&quot;github-logo&quot; src=&quot;https://a248.e.akamai.net/assets.github.com/images/modules/header/logov7.png?1323882770&quot; /&gt;
            &lt;img alt=&quot;GitHub&quot; class=&quot;github-logo-hover&quot; src=&quot;https://a248.e.akamai.net/assets.github.com/images/modules/header/logov7-hover.png?1324325405&quot; /&gt;
            &lt;![endif]--&gt;
            &lt;img alt=&quot;GitHub&quot; class=&quot;github-logo-4x&quot; height=&quot;30&quot; src=&quot;https://a248.e.akamai.net/assets.github.com/images/modules/header/logov7@4x.png?1323882770&quot; /&gt;
            &lt;img alt=&quot;GitHub&quot; class=&quot;github-logo-4x-hover&quot; height=&quot;30&quot; src=&quot;https://a248.e.akamai.net/assets.github.com/images/modules/header/logov7@4x-hover.png?1324325405&quot; /&gt;
          &lt;/a&gt;

                  &lt;!--
      make sure to use fully qualified URLs here since this nav
      is used on error pages on other domains
    --&gt;
    &lt;ul class=&quot;top-nav logged_out&quot;&gt;
        &lt;li class=&quot;pricing&quot;&gt;&lt;a href=&quot;https://github.com/plans&quot;&gt;Signup and Pricing&lt;/a&gt;&lt;/li&gt;
        &lt;li class=&quot;explore&quot;&gt;&lt;a href=&quot;https://github.com/explore&quot;&gt;Explore GitHub&lt;/a&gt;&lt;/li&gt;
      &lt;li class=&quot;features&quot;&gt;&lt;a href=&quot;https://github.com/features&quot;&gt;Features&lt;/a&gt;&lt;/li&gt;
        &lt;li class=&quot;blog&quot;&gt;&lt;a href=&quot;https://github.com/blog&quot;&gt;Blog&lt;/a&gt;&lt;/li&gt;
      &lt;li class=&quot;login&quot;&gt;&lt;a href=&quot;https://github.com/login?return_to=%2Fgist%2F1614694%2Finit-markdown.el&quot;&gt;Login&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;



          
        &lt;/div&gt;
      &lt;/div&gt;

      

        &lt;div class=&quot;site&quot;&gt;
          &lt;div class=&quot;container&quot;&gt;
            

&lt;style type=&quot;text/css&quot;&gt;
    #header{
        border-bottom: 0;
    }
    .site{
        padding: 0;
        margin-top: -20px;
    }
    * {
        margin: 0px;
        padding: 0px;
    }
    #parallax_field{
        overflow: hidden;
        position: absolute;
        left: 0;
        top: 0;
        height: 370px;
        width: 100%;
    }
    #parallax_field #parallax_bg {
        position: absolute;
        top: -20px;
        left: -20px;
        width: 110%;
        height: 425px;
        z-index: 1;
    }
    #parallax_illustration {
        display:block;
        width: 940px;
        height: 370px;
        position: relative;
        overflow: hidden;
    }
    #parallax_illustration #parallax_error_text {
        position: absolute;
        top: 72px;
        left: 72px;
        z-index: 10;
    }
    #parallax_illustration #parallax_octocat {
        position: absolute;
        top: 94px;
        left: 356px;
        z-index: 9;
    }
    #parallax_illustration #parallax_speeder {
        position: absolute;
        top: 150px;
        left: 432px;
        z-index: 8;
    }
    #parallax_illustration #parallax_octocatshadow {
        position: absolute;
        top: 297px;
        left: 371px;
        z-index: 7;
    }
    #parallax_illustration #parallax_speedershadow {
        position: absolute;
        top: 263px;
        left: 442px;
        z-index: 6;
    }
    #parallax_illustration #parallax_building_1 {
        position: absolute;
        top: 73px;
        left: 467px;
        z-index: 5;
    }
    #parallax_illustration #parallax_building_2 {
        position: absolute;
        top: 113px;
        left: 762px;
        z-index: 4;
    }
    #footer {
        margin-top: 0px;
        z-index: 12;
    }
&lt;/style&gt;


&lt;div id=&quot;parallax_field&quot;&gt;
    &lt;img alt=&quot;building&quot; class=&quot;js-plaxify&quot; data-invert=&quot;true&quot; data-xrange=&quot;0&quot; data-yrange=&quot;20&quot; height=&quot;415&quot; id=&quot;parallax_bg&quot; src=&quot;https://a248.e.akamai.net/assets.github.com/images/modules/404/parallax_bg.jpg?1302750674&quot; width=&quot;940&quot; /&gt;
&lt;/div&gt;
&lt;div id=&quot;parallax_illustration&quot;&gt;
  &lt;img alt=&quot;404 | &amp;ldquo;This is not the web page you are looking for&amp;rdquo;&quot; class=&quot;js-plaxify&quot; data-xrange=&quot;20&quot; data-yrange=&quot;10&quot; height=&quot;249&quot; id=&quot;parallax_error_text&quot; src=&quot;https://a248.e.akamai.net/assets.github.com/images/modules/404/parallax_errortext.png?1302750674&quot; width=&quot;271&quot; /&gt;
  &lt;img alt=&quot;Octobi Wan Catnobi&quot; class=&quot;js-plaxify&quot; data-xrange=&quot;10&quot; data-yrange=&quot;10&quot; height=&quot;230&quot; id=&quot;parallax_octocat&quot; src=&quot;https://a248.e.akamai.net/assets.github.com/images/modules/404/parallax_octocat.png?1302750674&quot; width=&quot;188&quot; /&gt;
  &lt;img alt=&quot;land speeder&quot; class=&quot;js-plaxify&quot; data-xrange=&quot;10&quot; data-yrange=&quot;10&quot; height=&quot;156&quot; id=&quot;parallax_speeder&quot; src=&quot;https://a248.e.akamai.net/assets.github.com/images/modules/404/parallax_speeder.png?1302750674&quot; width=&quot;440&quot; /&gt;
  &lt;img alt=&quot;Octobi Wan Catnobi's shadow&quot; class=&quot;js-plaxify&quot; data-xrange=&quot;10&quot; data-yrange=&quot;10&quot; height=&quot;49&quot; id=&quot;parallax_octocatshadow&quot; src=&quot;https://a248.e.akamai.net/assets.github.com/images/modules/404/parallax_octocatshadow.png?1302750674&quot; width=&quot;166&quot; /&gt;
  &lt;img alt=&quot;land speeder's shadow&quot; class=&quot;js-plaxify&quot; data-xrange=&quot;10&quot; data-yrange=&quot;10&quot; height=&quot;75&quot; id=&quot;parallax_speedershadow&quot; src=&quot;https://a248.e.akamai.net/assets.github.com/images/modules/404/parallax_speedershadow.png?1302750674&quot; width=&quot;430&quot; /&gt;
  &lt;img alt=&quot;building&quot; class=&quot;js-plaxify&quot; data-invert=&quot;true&quot; data-xrange=&quot;50&quot; data-yrange=&quot;20&quot; height=&quot;123&quot; id=&quot;parallax_building_1&quot; src=&quot;https://a248.e.akamai.net/assets.github.com/images/modules/404/parallax_building_1.png?1302750674&quot; width=&quot;304&quot; /&gt;
  &lt;img alt=&quot;building&quot; class=&quot;js-plaxify&quot; data-invert=&quot;true&quot; data-xrange=&quot;75&quot; data-yrange=&quot;30&quot; height=&quot;50&quot; id=&quot;parallax_building_2&quot; src=&quot;https://a248.e.akamai.net/assets.github.com/images/modules/404/parallax_building_2.png?1302750674&quot; width=&quot;116&quot; /&gt;
&lt;/div&gt;

          &lt;/div&gt;
          &lt;div class=&quot;context-overlay&quot;&gt;&lt;/div&gt;
        &lt;/div&gt;

      &lt;!-- footer --&gt;
      &lt;div id=&quot;footer&quot; &gt;
        
  &lt;div class=&quot;upper_footer&quot;&gt;
     &lt;div class=&quot;container clearfix&quot;&gt;

       &lt;!--[if IE]&gt;&lt;h4 id=&quot;blacktocat_ie&quot;&gt;GitHub Links&lt;/h4&gt;&lt;![endif]--&gt;
       &lt;![if !IE]&gt;&lt;h4 id=&quot;blacktocat&quot;&gt;GitHub Links&lt;/h4&gt;&lt;![endif]&gt;

       &lt;ul class=&quot;footer_nav&quot;&gt;
         &lt;h4&gt;GitHub&lt;/h4&gt;
         &lt;li&gt;&lt;a href=&quot;https://github.com/about&quot;&gt;About&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;https://github.com/blog&quot;&gt;Blog&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;https://github.com/features&quot;&gt;Features&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;https://github.com/contact&quot;&gt;Contact &amp;amp; Support&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;https://github.com/training&quot;&gt;Training&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;http://enterprise.github.com/&quot;&gt;GitHub Enterprise&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;http://status.github.com/&quot;&gt;Site Status&lt;/a&gt;&lt;/li&gt;
       &lt;/ul&gt;

       &lt;ul class=&quot;footer_nav&quot;&gt;
         &lt;h4&gt;Tools&lt;/h4&gt;
         &lt;li&gt;&lt;a href=&quot;http://get.gaug.es/&quot;&gt;Gauges: Analyze web traffic&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;http://speakerdeck.com&quot;&gt;Speaker Deck: Presentations&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;https://gist.github.com&quot;&gt;Gist: Code snippets&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;http://mac.github.com/&quot;&gt;GitHub for Mac&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;http://mobile.github.com/&quot;&gt;Issues for iPhone&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;http://jobs.github.com/&quot;&gt;Job Board&lt;/a&gt;&lt;/li&gt;
       &lt;/ul&gt;

       &lt;ul class=&quot;footer_nav&quot;&gt;
         &lt;h4&gt;Extras&lt;/h4&gt;
         &lt;li&gt;&lt;a href=&quot;http://shop.github.com/&quot;&gt;GitHub Shop&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;http://octodex.github.com/&quot;&gt;The Octodex&lt;/a&gt;&lt;/li&gt;
       &lt;/ul&gt;

       &lt;ul class=&quot;footer_nav&quot;&gt;
         &lt;h4&gt;Documentation&lt;/h4&gt;
         &lt;li&gt;&lt;a href=&quot;http://help.github.com/&quot;&gt;GitHub Help&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;http://developer.github.com/&quot;&gt;Developer API&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;http://github.github.com/github-flavored-markdown/&quot;&gt;GitHub Flavored Markdown&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;http://pages.github.com/&quot;&gt;GitHub Pages&lt;/a&gt;&lt;/li&gt;
       &lt;/ul&gt;

     &lt;/div&gt;&lt;!-- /.site --&gt;
  &lt;/div&gt;&lt;!-- /.upper_footer --&gt;

&lt;div class=&quot;lower_footer&quot;&gt;
  &lt;div class=&quot;container clearfix&quot;&gt;
    &lt;!--[if IE]&gt;&lt;div id=&quot;legal_ie&quot;&gt;&lt;![endif]--&gt;
    &lt;![if !IE]&gt;&lt;div id=&quot;legal&quot;&gt;&lt;![endif]&gt;
      &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;https://github.com/site/terms&quot;&gt;Terms of Service&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;https://github.com/site/privacy&quot;&gt;Privacy&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;https://github.com/security&quot;&gt;Security&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;

      &lt;p&gt;&amp;copy; 2012 &lt;span id=&quot;_rrt&quot; title=&quot;0.01583s from fe5.rs.github.com&quot;&gt;GitHub&lt;/span&gt; Inc. All rights reserved.&lt;/p&gt;
    &lt;/div&gt;&lt;!-- /#legal or /#legal_ie--&gt;

      &lt;div class=&quot;sponsor&quot;&gt;
        &lt;a href=&quot;http://www.rackspace.com&quot; class=&quot;logo&quot;&gt;
          &lt;img alt=&quot;Dedicated Server&quot; height=&quot;36&quot; src=&quot;https://a248.e.akamai.net/assets.github.com/images/modules/footer/rackspace_logo.png?v2&quot; width=&quot;38&quot; /&gt;
        &lt;/a&gt;
        Powered by the &lt;a href=&quot;http://www.rackspace.com &quot;&gt;Dedicated
        Servers&lt;/a&gt; and&lt;br/&gt; &lt;a href=&quot;http://www.rackspacecloud.com&quot;&gt;Cloud
        Computing&lt;/a&gt; of Rackspace Hosting&lt;span&gt;&amp;reg;&lt;/span&gt;
      &lt;/div&gt;
  &lt;/div&gt;&lt;!-- /.site --&gt;
&lt;/div&gt;&lt;!-- /.lower_footer --&gt;

      &lt;/div&gt;&lt;!-- /#footer --&gt;

    

&lt;div id=&quot;keyboard_shortcuts_pane&quot; class=&quot;instapaper_ignore readability-extra&quot; style=&quot;display:none&quot;&gt;
  &lt;h2&gt;Keyboard Shortcuts &lt;small&gt;&lt;a href=&quot;#&quot; class=&quot;js-see-all-keyboard-shortcuts&quot;&gt;(see all)&lt;/a&gt;&lt;/small&gt;&lt;/h2&gt;

  &lt;div class=&quot;columns threecols&quot;&gt;
    &lt;div class=&quot;column first&quot;&gt;
      &lt;h3&gt;Site wide shortcuts&lt;/h3&gt;
      &lt;dl class=&quot;keyboard-mappings&quot;&gt;
        &lt;dt&gt;s&lt;/dt&gt;
        &lt;dd&gt;Focus site search&lt;/dd&gt;
      &lt;/dl&gt;
      &lt;dl class=&quot;keyboard-mappings&quot;&gt;
        &lt;dt&gt;?&lt;/dt&gt;
        &lt;dd&gt;Bring up this help dialog&lt;/dd&gt;
      &lt;/dl&gt;
    &lt;/div&gt;&lt;!-- /.column.first --&gt;

    &lt;div class=&quot;column middle&quot; style='display:none'&gt;
      &lt;h3&gt;Commit list&lt;/h3&gt;
      &lt;dl class=&quot;keyboard-mappings&quot;&gt;
        &lt;dt&gt;j&lt;/dt&gt;
        &lt;dd&gt;Move selection down&lt;/dd&gt;
      &lt;/dl&gt;
      &lt;dl class=&quot;keyboard-mappings&quot;&gt;
        &lt;dt&gt;k&lt;/dt&gt;
        &lt;dd&gt;Move selection up&lt;/dd&gt;
      &lt;/dl&gt;
      &lt;dl class=&quot;keyboard-mappings&quot;&gt;
        &lt;dt&gt;c &lt;em&gt;or&lt;/em&gt; o &lt;em&gt;or&lt;/em&gt; enter&lt;/dt&gt;
        &lt;dd&gt;Open commit&lt;/dd&gt;
      &lt;/dl&gt;
      &lt;dl class=&quot;keyboard-mappings&quot;&gt;
        &lt;dt&gt;y&lt;/dt&gt;
        &lt;dd&gt;Expand URL to its canonical form&lt;/dd&gt;
      &lt;/dl&gt;
    &lt;/div&gt;&lt;!-- /.column.first --&gt;

    &lt;div class=&quot;column last&quot; style='display:none'&gt;
      &lt;h3&gt;Pull request list&lt;/h3&gt;
      &lt;dl class=&quot;keyboard-mappings&quot;&gt;
        &lt;dt&gt;j&lt;/dt&gt;
        &lt;dd&gt;Move selection down&lt;/dd&gt;
      &lt;/dl&gt;
      &lt;dl class=&quot;keyboard-mappings&quot;&gt;
        &lt;dt&gt;k&lt;/dt&gt;
        &lt;dd&gt;Move selection up&lt;/dd&gt;
      &lt;/dl&gt;
      &lt;dl class=&quot;keyboard-mappings&quot;&gt;
        &lt;dt&gt;o &lt;em&gt;or&lt;/em&gt; enter&lt;/dt&gt;
        &lt;dd&gt;Open issue&lt;/dd&gt;
      &lt;/dl&gt;
    &lt;/div&gt;&lt;!-- /.columns.last --&gt;

  &lt;/div&gt;&lt;!-- /.columns.equacols --&gt;

  &lt;div style='display:none'&gt;
    &lt;div class=&quot;rule&quot;&gt;&lt;/div&gt;

    &lt;h3&gt;Issues&lt;/h3&gt;

    &lt;div class=&quot;columns threecols&quot;&gt;
      &lt;div class=&quot;column first&quot;&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;j&lt;/dt&gt;
          &lt;dd&gt;Move selection down&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;k&lt;/dt&gt;
          &lt;dd&gt;Move selection up&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;x&lt;/dt&gt;
          &lt;dd&gt;Toggle selection&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;o &lt;em&gt;or&lt;/em&gt; enter&lt;/dt&gt;
          &lt;dd&gt;Open issue&lt;/dd&gt;
        &lt;/dl&gt;
      &lt;/div&gt;&lt;!-- /.column.first --&gt;
      &lt;div class=&quot;column middle&quot;&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;I&lt;/dt&gt;
          &lt;dd&gt;Mark selection as read&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;U&lt;/dt&gt;
          &lt;dd&gt;Mark selection as unread&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;e&lt;/dt&gt;
          &lt;dd&gt;Close selection&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;y&lt;/dt&gt;
          &lt;dd&gt;Remove selection from view&lt;/dd&gt;
        &lt;/dl&gt;
      &lt;/div&gt;&lt;!-- /.column.middle --&gt;
      &lt;div class=&quot;column last&quot;&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;c&lt;/dt&gt;
          &lt;dd&gt;Create issue&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;l&lt;/dt&gt;
          &lt;dd&gt;Create label&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;i&lt;/dt&gt;
          &lt;dd&gt;Back to inbox&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;u&lt;/dt&gt;
          &lt;dd&gt;Back to issues&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;/&lt;/dt&gt;
          &lt;dd&gt;Focus issues search&lt;/dd&gt;
        &lt;/dl&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  &lt;div style='display:none'&gt;
    &lt;div class=&quot;rule&quot;&gt;&lt;/div&gt;

    &lt;h3&gt;Issues Dashboard&lt;/h3&gt;

    &lt;div class=&quot;columns threecols&quot;&gt;
      &lt;div class=&quot;column first&quot;&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;j&lt;/dt&gt;
          &lt;dd&gt;Move selection down&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;k&lt;/dt&gt;
          &lt;dd&gt;Move selection up&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;o &lt;em&gt;or&lt;/em&gt; enter&lt;/dt&gt;
          &lt;dd&gt;Open issue&lt;/dd&gt;
        &lt;/dl&gt;
      &lt;/div&gt;&lt;!-- /.column.first --&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  &lt;div style='display:none'&gt;
    &lt;div class=&quot;rule&quot;&gt;&lt;/div&gt;

    &lt;h3&gt;Network Graph&lt;/h3&gt;
    &lt;div class=&quot;columns equacols&quot;&gt;
      &lt;div class=&quot;column first&quot;&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;&lt;span class=&quot;badmono&quot;&gt;←&lt;/span&gt; &lt;em&gt;or&lt;/em&gt; h&lt;/dt&gt;
          &lt;dd&gt;Scroll left&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;&lt;span class=&quot;badmono&quot;&gt;→&lt;/span&gt; &lt;em&gt;or&lt;/em&gt; l&lt;/dt&gt;
          &lt;dd&gt;Scroll right&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;&lt;span class=&quot;badmono&quot;&gt;↑&lt;/span&gt; &lt;em&gt;or&lt;/em&gt; k&lt;/dt&gt;
          &lt;dd&gt;Scroll up&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;&lt;span class=&quot;badmono&quot;&gt;↓&lt;/span&gt; &lt;em&gt;or&lt;/em&gt; j&lt;/dt&gt;
          &lt;dd&gt;Scroll down&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;t&lt;/dt&gt;
          &lt;dd&gt;Toggle visibility of head labels&lt;/dd&gt;
        &lt;/dl&gt;
      &lt;/div&gt;&lt;!-- /.column.first --&gt;
      &lt;div class=&quot;column last&quot;&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;shift &lt;span class=&quot;badmono&quot;&gt;←&lt;/span&gt; &lt;em&gt;or&lt;/em&gt; shift h&lt;/dt&gt;
          &lt;dd&gt;Scroll all the way left&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;shift &lt;span class=&quot;badmono&quot;&gt;→&lt;/span&gt; &lt;em&gt;or&lt;/em&gt; shift l&lt;/dt&gt;
          &lt;dd&gt;Scroll all the way right&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;shift &lt;span class=&quot;badmono&quot;&gt;↑&lt;/span&gt; &lt;em&gt;or&lt;/em&gt; shift k&lt;/dt&gt;
          &lt;dd&gt;Scroll all the way up&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;shift &lt;span class=&quot;badmono&quot;&gt;↓&lt;/span&gt; &lt;em&gt;or&lt;/em&gt; shift j&lt;/dt&gt;
          &lt;dd&gt;Scroll all the way down&lt;/dd&gt;
        &lt;/dl&gt;
      &lt;/div&gt;&lt;!-- /.column.last --&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  &lt;div style='display:none'&gt;
    &lt;div class=&quot;rule&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;columns threecols&quot;&gt;
      &lt;div class=&quot;column first&quot; style='display:none'&gt;
        &lt;h3&gt;Source Code Browsing&lt;/h3&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;t&lt;/dt&gt;
          &lt;dd&gt;Activates the file finder&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;l&lt;/dt&gt;
          &lt;dd&gt;Jump to line&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;w&lt;/dt&gt;
          &lt;dd&gt;Switch branch/tag&lt;/dd&gt;
        &lt;/dl&gt;
        &lt;dl class=&quot;keyboard-mappings&quot;&gt;
          &lt;dt&gt;y&lt;/dt&gt;
          &lt;dd&gt;Expand URL to its canonical form&lt;/dd&gt;
        &lt;/dl&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

    &lt;div id=&quot;markdown-help&quot; class=&quot;instapaper_ignore readability-extra&quot;&gt;
  &lt;h2&gt;Markdown Cheat Sheet&lt;/h2&gt;

  &lt;div class=&quot;cheatsheet-content&quot;&gt;

  &lt;div class=&quot;mod&quot;&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;h3&gt;Format Text&lt;/h3&gt;
      &lt;p&gt;Headers&lt;/p&gt;
      &lt;pre&gt;
# This is an &amp;lt;h1&amp;gt; tag
## This is an &amp;lt;h2&amp;gt; tag
###### This is an &amp;lt;h6&amp;gt; tag&lt;/pre&gt;
     &lt;p&gt;Text styles&lt;/p&gt;
     &lt;pre&gt;
*This text will be italic*
_This will also be italic_
**This text will be bold**
__This will also be bold__

*You **can** combine them*
&lt;/pre&gt;
    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;h3&gt;Lists&lt;/h3&gt;
      &lt;p&gt;Unordered&lt;/p&gt;
      &lt;pre&gt;
* Item 1
* Item 2
  * Item 2a
  * Item 2b&lt;/pre&gt;
     &lt;p&gt;Ordered&lt;/p&gt;
     &lt;pre&gt;
1. Item 1
2. Item 2
3. Item 3
   * Item 3a
   * Item 3b&lt;/pre&gt;
    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;h3&gt;Miscellaneous&lt;/h3&gt;
      &lt;p&gt;Images&lt;/p&gt;
      &lt;pre&gt;
![GitHub Logo](/images/logo.png)
Format: ![Alt Text](url)
&lt;/pre&gt;
     &lt;p&gt;Links&lt;/p&gt;
     &lt;pre&gt;
http://github.com - automatic!
[GitHub](http://github.com)&lt;/pre&gt;
&lt;p&gt;Blockquotes&lt;/p&gt;
     &lt;pre&gt;
As Kanye West said:

&gt; We're living the future so
&gt; the present is our past.
&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;rule&quot;&gt;&lt;/div&gt;

  &lt;h3&gt;Code Examples in Markdown&lt;/h3&gt;
  &lt;div class=&quot;col&quot;&gt;
      &lt;p&gt;Syntax highlighting with &lt;a href=&quot;http://github.github.com/github-flavored-markdown/&quot; title=&quot;GitHub Flavored Markdown&quot; target=&quot;_blank&quot;&gt;GFM&lt;/a&gt;&lt;/p&gt;
      &lt;pre&gt;
```javascript
function fancyAlert(arg) {
  if(arg) {
    $.facebox({div:'#foo'})
  }
}
```&lt;/pre&gt;
    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;p&gt;Or, indent your code 4 spaces&lt;/p&gt;
      &lt;pre&gt;
Here is a Python code example
without syntax highlighting:

    def foo:
      if not bar:
        return true&lt;/pre&gt;
    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;p&gt;Inline code for comments&lt;/p&gt;
      &lt;pre&gt;
I think you should use an
`&amp;lt;addr&amp;gt;` element here instead.&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;


    &lt;div class=&quot;ajax-error-message&quot;&gt;
      &lt;p&gt;&lt;span class=&quot;icon&quot;&gt;&lt;/span&gt; Something went wrong with that request. Please try again. &lt;a href=&quot;javascript:;&quot; class=&quot;ajax-error-dismiss&quot;&gt;Dismiss&lt;/a&gt;&lt;/p&gt;
    &lt;/div&gt;

    
    
    
  &lt;/body&gt;
&lt;/html&gt;
</code></pre></noscript></div>


<h3>post using gist.el</h3>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>$ git config --global github.user  #{github-user}
</span><span class='line'>$ git config --global github.token #{github-api-token}
</span><span class='line'># emacs
</span><span class='line'>M-x gist-region(-private)</span></code></pre></td></tr></table></div></figure>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[4ビットマイコン (大人の科学マガジンvol24)]]></title>
    <link href="http://blog.seiji.me/blog/2009/10/02/460/"/>
    <updated>2009-10-02T00:00:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2009/10/02/460</id>
    <content type="html"><![CDATA[<p>4ビットマイコン (大人の科学マガジンvol24)を買った。</p>


<p>
    <br />
<a href="http://www.flickr.com/photos/31821868@N05/3974639920" title="View 'photo' on Flickr.com"><img src="http://farm3.static.flickr.com/2547/3974639920_20c26c4388.jpg" alt="photo" border="0" width="375" height="500" /></a>
    <br />
</p>


<!--more-->


<p>
    <br />
    <a href="http://www.flickr.com/photos/31821868@N05/3974634926" title="View 'photo' on Flickr.com"><img src="http://farm3.static.flickr.com/2472/3974634926_d853a3f064.jpg" alt="photo" border="0" width="500" height="375" /></a><br />
こんな感じで入ってる。
</p>


<p>
    <br />
    <a href="http://www.flickr.com/photos/31821868@N05/3974804984" title="View 'photo' on Flickr.com"><img src="http://farm3.static.flickr.com/2449/3974804984_dba5c064aa.jpg" alt="photo" border="0" width="500" height="375" /></a><br />
簡単に組み立てできる。
</p>


<ul>
    <li>プログラムメモリ:40byte</li>
    <li>データメモリ:8byte</li>
    <li>レジスタ: 8個</li>
    <li>入力: キーパッド</li>
    <li>出力: 2進LED, 数字LED, スピーカー</li>
</ul>


<p>各アドレスに値を入れたり、プログラムを実行したり、電子音を鳴らしたりできる。なかなかおもしろい。</p>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[MacBookのHD交換]]></title>
    <link href="http://blog.seiji.me/blog/2008/12/28/437/"/>
    <updated>2008-12-28T00:00:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2008/12/28/437</id>
    <content type="html"><![CDATA[<p>HDの残り容量が少なくなってきたので、120Gのものから500Gのものに交換しました。</p>


<p>
    <br />
    <img src="http://img.seiji.me/blog/2008/12/img-0023.jpg" alt="IMG_0023.JPG" border="0" width="200" height="266" />
    <br />
</p>


<!--more-->


<p>
秋葉原のドスパラでWestern Digitalの<a href="http://www.wdc.com/jp/products/Products.asp?DriveID=506">WD5000BEVT</a>が8,980円で売っていたので買ってきました。
</p>




<p>ディスクユーティリティで復元を行い、HDを付け替え。
起動に時間がかかりましたが、問題なく交換できました。</p>




<h4>Before</h4>


<p>

<br />
<img src="http://img.seiji.me/blog/2008/12/before.jpg" alt="before.jpg" border="0" width="380" height="189" />
<br />

</p>




<h4>After</h4>


<p>
<br />
<img src="http://img.seiji.me/blog/2008/12/smb-1.jpg" alt="smb-1.jpg" border="0" width="380" height="206" />
<br />

</p>




<p>MacBookのHD交換はすぐ交換できるので楽です。</p>


<p>これでしばらくは容量を気にしなくてもよさそうです。</p>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Making a CGRect]]></title>
    <link href="http://blog.seiji.me/blog/2008/12/26/421/"/>
    <updated>2008-12-26T00:00:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2008/12/26/421</id>
    <content type="html"><![CDATA[<p>
    <br />
<img src="http://img.seiji.me/blog/2008/12/making-cgrect1.png" alt="Making CGRect.png" border="0" width="210" height="181" />
    <br />

</p>


<p>CGRectには様々な作成方法があります。それをまとめておきます。
</p>


<p>下のようなCGRectを作成したいと思います。
</p>


<h4>出力</h4>


<pre class="console"><code>HelloWorld[52159:20b] {{0, 0}, {320, 480}}
</code></pre>


<br />




<!--more-->


<h4>作成方法1</h4>


<pre><code>CGRect rect = CGRectMake(0, 0, 320, 480);
</code></pre>




<h4>作成方法2</h4>


<pre><code>CGRect rect = {{0,0}, {320, 480}};
</code></pre>




<h4>作成方法3</h4>


<pre><code>CGSize size = CGSizeMake(320, 480);
CGRect rect = {{0,0}, size};
</code></pre>




<h4>作成方法4</h4>


<pre><code>CGPoint point = CGPointMake(0, 0);
CGSize size = CGSizeMake(320, 480);
CGRect rect = {point, size};
</code></pre>




<h4>作成方法5</h4>


<pre><code>CGSize size = CGSizeMake(320, 480);
CGRect rect = {{0}, size};
</code></pre>




<h4>作成方法6</h4>


<pre><code>CGSize size = CGSizeMake(320, 480);
CGRect rect = {{}, size};
</code></pre>




<p>他にもいろいろあるかとは思いますが、構造で定義できるのは便利ですね。</p>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[^NSStringFrom.* functions]]></title>
    <link href="http://blog.seiji.me/blog/2008/12/25/405/"/>
    <updated>2008-12-25T00:00:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2008/12/25/405</id>
    <content type="html"><![CDATA[<p>NSStringFromから続くFunctionは非常に便利です。特にCGRect, CGPoint, CGSizeを出力したい場合も展開して出力するのは面倒です。</p>


<p>
    <br />
<img src="http://img.seiji.me/blog/2008/12/uikit-function-reference.jpg" alt="UIKit Function Reference — デベロッパドキュメント.jpg" border="0" width="224" height="193" />
    <br />

</p>




<!--more-->


<p> NSStringFromCGRect, NSStringFromClassを使い次のように出力してみます。</p>


<pre><code>// CGRect
NSLog(@"%@", NSStringFromCGRect([self.view bounds]));
// Class
NSLog(@"%@", NSStringFromClass([[[UIApplication sharedApplication] delegate] class]));
</code></pre>


<h4>出力</h4>


<pre class="console"><code>2008-12-25 19:44:29.628 HelloWorld[39711:20b] {{0, 0}, {320, 460}}
2008-12-25 19:44:29.629 HelloWorld[39711:20b] HelloWorldAppDelegate</code></pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[UINavigationBarを見えなくする-iPhone App]]></title>
    <link href="http://blog.seiji.me/blog/2008/12/25/399/"/>
    <updated>2008-12-25T00:00:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2008/12/25/399</id>
    <content type="html"><![CDATA[<p>UINavigationBarを見えなくする。</p>


<p>
    <br />
<img src="http://img.seiji.me/blog/2008/12/iphone-2.png" alt="iPhone シミュレータ-2.png" border="0" width="230" height="183" />
    <br />
</p>




<p>UINavigationControllerを使いたいんだけど、UINavigationBarが邪魔な時。下の一行を追加すればよいです。</p>


<pre>`self.navigationController.navigationBar.frame = CGRectZero;`</pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[OCUnitのTestCase作成]]></title>
    <link href="http://blog.seiji.me/blog/2008/12/18/389/"/>
    <updated>2008-12-18T00:00:00+09:00</updated>
    <id>http://blog.seiji.me/blog/2008/12/18/389</id>
    <content type="html"><![CDATA[<p>OCUnitとはObjective-C用のUnitTest用Frameworkです。
</p>


<p>今回はこのOCUnitを試してみたいと思います。-setUp, -tearDownなどJUnitなどのxUnitを使用した経験がある方なら非常に親しみやすいと言えます。</p>




<!--more-->


<p>以下は全てX-Code上で行います。</p>


<h3>UnitTest対象</h3>

<p>UnitTestの対象として例えば以下のようなクラスを作成します。</p>


<h4>Person.h</h4>


<pre><code>#import <foundation/Foundation.h>

@interface Person : NSObject {
    NSString *displayName;
}
@property (copy) NSString *displayName;

- (id)initWithName:(NSString *)displayName;

@end
</code></pre>


<h4>Person.m</h4>


<pre><code>#import "Person.h"

@implementation Person

@synthesize displayName;

- (id)initWithName:(NSString *)aName {
    if ((self = [super init])!= nil) {
        self.displayName = aName;
    }
    return self;
}

- (void) dealloc {
    [displayName release];
    [super dealloc];
}

@end</code></pre>


<h3>新規ターゲットの作成</h3>

<ol>
    <li>ターゲットを選択し、新規ターゲットの作成を選択</li>
    <li>Cocoa &gt;&gt; Unit Test Bundleを選択し、次へ</li>
    <li>名前を例えばUnitTestsにして完了</li>
</ol>


<h3>ターゲットUnitTestsの情報の変更</h3>

<ol>
    <li>ビルド &gt;&gt; リンク &gt;&gt;他のリンクフラグのCocoaをFoundationに変更する</li>
    <li>ビルド &gt;&gt; ユーザー定義 で以下の項目以外を削除する。
        <ul>
            <li>GCC_C_LANGUAGE_STANDARD</li>
            <li>GCC_WARN_ABOUT_RETURN_TYPE</li>
            <li>GCC_WARN_UNUSED_VARIABLE</li>
        </ul>
    </li>
</ol>


<h3>Person.mのターゲット修正</h3>

<ol>
    <li>Person.mのターゲットの中にUnitTestsを追加する</li>
</ol>


<h3>新規TestCaseの作成</h3>

<ol>
    <li>ファイル &gt;&gt 新規ファイルを選択</li>
    <li>Cocoa Touch Classes &gt;&gt; NSObject subclassを選択し、次へ</li>
    <li>名前を例えばPersonTest、ターゲットをUnitTestsにして完了</li>
</ol>


<h3>TestCaseの実装</h3>

<h4>PersonTest.h</h4>


<pre><code>#import <senTestingKit/SenTestingKit.h>

@class Person;
@interface PersonTest : SenTestCase {
    Person *person;
}

@end</code></pre>


<h4>PersonTest.m</h4>


<pre><code>#import "PersonTest.h"
#import "Person.h"

@implementation PersonTest

- (void)setUp {
    person = [[Person alloc] init];
}

- (void)testCreatePerson {
    STAssertNotNil(person, @"Couldn't create Person");
}

- (void)testSetDisplayName {
    NSString *displayName = @"Seiji";
    person.displayName = displayName;
    STAssertEqualObjects(displayName, person.displayName, @"Couldn't set person.displayName");
}

- (void)tearDown {
    [person release];
}

@end</code></pre>


<h3>TestCaseの実行</h3>

<p>UnitTestsを選択し、Buildを行うことでTestCaseが実行される。想定結果が違うものであればBuildの時点でErrorが表示されることになります。</p>


<h6>References</h6>


<ul>
    <li><a href="http://developer.apple.com/tools/unittest.html">Test Driving Your Code with OCUnit</a></li>
    <li><a href="http://www.stanford.edu/class/cs193p/cgi-bin/index.php">Lecture 19 - Unit Testing, Objective-C Runtime Fun and Localization</a></li>
</ul>

]]></content>
  </entry>
  
</feed>

