自分用XCode4キーボードショートカット
XCode のキーボードショートカット
4になって大幅に変わったので修正
普段はemacsを使っているので、emacsと同じキーバインドは省略
ショートカット | 効果 | emacs |
---|---|---|
Cmd + ↑ | 文章の一番上へ | ^x [ |
Cmd + ↓ | 文章の一番下へ | ^x ] |
^ + Cmd + ↑ | ヘッダーファイル(h)⇔ソースファイル(m) の相互移動 | M-x ff-find-otherfile RET |
^ + Cmd + ← | 前のバッファに移動 | c-x c-left |
^ + Cmd + → | 次のバッファに移動 | c-x c-right |
Cmd + RET | Assistant Editorの消去 | c-x 0 |
Cmd + Opt + RET | Assistant Editorの表示(画面の縦分割) | c-x 3 |
Cmd + / | コメントアウト/解除 | M-;(transient-mark-mode)とかcomment-region, uncomment-region |
Cmd + Opt + | エディタの分割をグラフィカルに決定?説明しづらいので押してみてください | |
Cmd + Opt + > | ウインドウ内を移動 | C-x o |
Cmd + Opt + , | アシスタントエディタでも同じファイルを開く | C-x o |
Ctrl + . | コード入力候補ウインドウ表示 |
自分用App StoreにiPad アプリを上げるときのチェックリスト
とりあえず今回チェックしたポイント
抜けがあれば後々修正する予定
プログラムは完成している気分
2011/2/24 Reject されてしまったのでもう一度見直す。
ちなみにAppleからのReject理由を書いたメールは無し。
アプリ名Padocu で上げる
plistのチェック
- Localization native deelopment region : Janan(英語又はマルチランゲージならEnglish なんでJapaneseじゃないんだろ...)
- Bundle identifier : jp.mksc.padocu
- Bundle display name : Padocu
- Icon file : 値無し
- Icon files :
- Bundle version : 1.0
- Supported interface orientations (全方向サポート iPadでは必須?)
- Item 0 : Portrait (bottom home button)
- Item 1 : Portrait (top home button)
- Item 2 : Landscape (left home button)
- Item 3 : Landscape (right home button)
- Application uses Wi-Fi : true (起動直後からネットワークが必要なので)
- Required device capabilities
- wifi (起動直後からネットワークが必要なので)
2011/2/24 修正
アイコンが全部あるかチェック
http://developer.apple.com/library/ios/#qa/qa2010/qa1686.html
に
Include the following in your application's Resources group in the Xcode project:
Table 2 : iPad-only apps icon requirements.
Image Size (px) File Name Used For Required Status Notes 512x512 iTunesArtwork Ad Hoc iTunes Optional but recommended File should be in png format, but name it without the .png extension 72x72 Icon-72.png App Store and Home screen on iPad Required 50x50 Icon-Small-50.png Spotlight on iPad Optional but recommended 29x29 Icon-Small.png Settings on iPad Recommended if you have a Settings bundle, otherwise optional but recommended
と書いてあるのに 72x72 のIconをIcon.pngで上げたのがちょっと臭い
後、Settings画面も使ってるので
- Icon-72.png (72x72)
- Icon-Small-50.png (50x50)
- Icon-Small.png (29x29)
- Default-Landscape.png
- Default-Portrait.png
を用意する
xcodeproj
- ビルド
その他用意するもの
iTunes Connect
- App Name : Padocu
- SKU Number : jp.mksc.padocu
- Bundle ID : jp.mksc.padocu(Provisioning Portal でこの名前にしてある)
- Version number : 1.0 上の Bundle version と合わせる必要あり
Ruby Version Manager(RVM) を使って Mac OSX Snow Leopard にRuby 1.9 をインストールする
前回の失敗を踏まえてRuby Version Manager(RVM)をつかってMacにRuby 1.9の導入を試みる
RVMはgem を使ってもインストールすることが出来るようだが、いまいちやり方が分からなかったのでgitを使ってソースを取ってくる
$ git clone git://github.com/wayneeseguin/rvm.git
$ cd rvm/
$ ./install
.bashrcの最後のほうに以下を追加
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
でターミナルを再起動
$ rvm -v rvm 1.1.6 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/] $ rvm info system: system: uname: "Darwin mksc-no-mac-pro-2.local 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386" bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)" zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)" rvm: version: "rvm 1.1.6 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]" homes: gem: "not set" ruby: "not set" binaries: ruby: "/opt/local/bin/ruby" irb: "/opt/local/bin/irb" gem: "/opt/local/bin/gem" rake: "/opt/local/bin/rake" environment: PATH: "/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/shimizu/bin:/Users/shimizu/.rvm/bin:/Users/shimizu/.rvm/bin" GEM_HOME: "" GEM_PATH: "" MY_RUBY_HOME: "" IRBRC: "" RUBYOPT: "" gemset: ""
インストールは成功している模様
サポートしている環境を一覧する
$ rvm list known_strings
ruby-head
ruby-1.9.2-rc2
ruby-1.9.2-rc1
ruby-1.9.2-preview3
ruby-1.9.2-preview1
ruby-1.9.2-p0
ruby-1.9.2-head
ruby-1.9.1-p429
ruby-1.9.1-p378
ruby-1.9.1-p243
ruby-1.9.1-head
ruby-1.8.7-p302
ruby-1.8.7-head
ruby-1.8.6-p399
ruby-1.8.6-head
ree-1.8.7-head
ree-1.8.7
ree-1.8.6-head
ree-1.8.6
rbx-head
rbx-1.1.1
rbx-1.1.0
rbx-1.0.1
maglev-head
maglev-24864
macruby-nightly
macruby-head
macruby-0.8
jruby-head
jruby-1.5.6
jruby-1.4.0
jruby-1.3.1
jruby-1.2.0
ironruby-head
ironruby-1.0-rc2
ironruby-0.9.3
goruby
Rubyのページの一番普通にDLできるバージョンが1.9.2-p0 なのでそれをインストールする
$ rvm install 1.9.2-p0 /Users/shimizu/.rvm/rubies/ruby-1.9.2-p0, this may take a while depending on your cpu(s)... ruby-1.9.2-p0 - #fetching ruby-1.9.2-p0 - #downloading ruby-1.9.2-p0, this may take a while depending on your connection... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 8296k 100 8296k 0 0 1743k 0 0:00:04 0:00:04 --:--:-- 2036k ruby-1.9.2-p0 - #extracting ruby-1.9.2-p0 to /Users/shimizu/.rvm/src/ruby-1.9.2-p0 ruby-1.9.2-p0 - #extracted to /Users/shimizu/.rvm/src/ruby-1.9.2-p0 ruby-1.9.2-p0 - #configuring ruby-1.9.2-p0 - #compiling ruby-1.9.2-p0 - #installing ruby-1.9.2-p0 - updating #rubygems for /Users/shimizu/.rvm/gems/ruby-1.9.2-p0@global ruby-1.9.2-p0 - updating #rubygems for /Users/shimizu/.rvm/gems/ruby-1.9.2-p0 ruby-1.9.2-p0 - adjusting #shebangs for (gem). ruby-1.9.2-p0 - #importing default gemsets (/Users/shimizu/.rvm/gemsets/) Install of ruby-1.9.2-p0 - #complete
$ rvm info system: system: uname: "Darwin mksc-no-mac-pro-2.local 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386" bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)" zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)" rvm: version: "rvm 1.1.6 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]" homes: gem: "not set" ruby: "not set" binaries: ruby: "/opt/local/bin/ruby" irb: "/opt/local/bin/irb" gem: "/opt/local/bin/gem" rake: "/opt/local/bin/rake" environment: PATH: "/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/shimizu/bin:/Users/shimizu/.rvm/bin:/Users/shimizu/.rvm/bin" GEM_HOME: "" GEM_PATH: "" MY_RUBY_HOME: "" IRBRC: "" RUBYOPT: "" gemset: "" $ which ruby /opt/local/bin/ruby $ ruby -v ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-darwin10] $ rvm use 1.9.2 Using /Users/shimizu/.rvm/gems/ruby-1.9.2-p0$ rvm info ruby-1.9.2-p0: system: uname: "Darwin mksc-no-mac-pro-2.local 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386" bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)" zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)" rvm: version: "rvm 1.1.6 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]" ruby: interpreter: "ruby" version: "1.9.2p0" date: "2010-08-18" platform: "x86_64-darwin10.5.0" patchlevel: "2010-08-18 revision 29036" full_version: "ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.5.0]" homes: gem: "/Users/shimizu/.rvm/gems/ruby-1.9.2-p0" ruby: "/Users/shimizu/.rvm/rubies/ruby-1.9.2-p0" binaries: ruby: "/Users/shimizu/.rvm/rubies/ruby-1.9.2-p0/bin/ruby" irb: "/Users/shimizu/.rvm/rubies/ruby-1.9.2-p0/bin/irb" gem: "/Users/shimizu/.rvm/rubies/ruby-1.9.2-p0/bin/gem" rake: "/Users/shimizu/.rvm/gems/ruby-1.9.2-p0/bin/rake" environment: PATH: "/Users/shimizu/.rvm/gems/ruby-1.9.2-p0/bin:/Users/shimizu/.rvm/gems/ruby-1.9.2-p0@global/bin:/Users/shimizu/.rvm/rubies/ruby-1.9.2-p0/bin:/Users/shimizu/.rvm/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/shimizu/bin" GEM_HOME: "/Users/shimizu/.rvm/gems/ruby-1.9.2-p0" GEM_PATH: "/Users/shimizu/.rvm/gems/ruby-1.9.2-p0:/Users/shimizu/.rvm/gems/ruby-1.9.2-p0@global" MY_RUBY_HOME: "/Users/shimizu/.rvm/rubies/ruby-1.9.2-p0" IRBRC: "/Users/shimizu/.rvm/rubies/ruby-1.9.2-p0/.irbrc" RUBYOPT: "" gemset: "" $ ruby -v ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.5.0] $ gem -v 1.3.7 $ which gem /Users/shimizu/.rvm/rubies/ruby-1.9.2-p0/bin/gem
おお!できたっぽい。
今後メインを1.9.2-p0にしたいので .bashrcに
rvm use 1.9.2-p0 > /dev/null
を追加する。
railsのインストール。gem はユーザー配下にインストールされるので一般ユーザーでインストール
$ gem install rails
$ rails -v
Rails 3.0.3
iPhone OS のPDF表示APIのバグ
iPhoneOSのPDF表示APIを触っていたところバグに遭遇した。
再現コードはこんな感じ
CFURLRef url = CFURLCreateWithFileSystemPath(NULL, (CFStringRef)filePath_, kCFURLPOSIXPathStyle, 0); CGPDFDocumentRef doc = CGPDFDocumentCreateWithURL(url); CFRelease(url); if(!doc)return; CGPDFPageRef page = CGPDFDocumentGetPage(doc, 1); //ここで1ページ目を取得 NSLog(@"page address:0x%x", page); //Logを出しておく CGPDFPageRelease(page); //リリース CGPDFPageRef page2 = CGPDFDocumentGetPage(doc, 1); //ここで1ページ目をもう一回取得 //ここで出力した内容が上のログと同じアドレス //つまりRelease をしたにも関わらず、 //キャッシュしている同じアドレスを示す NSLog(@"page address:0x%x", page); //ここでpage2を使うと落ちる CGRect aRect = CGPDFPageGetBoxRect (page2, kCGPDFCropBox);
下記のページ
Life is beautiful: iPadアプリ作成日誌: PDF関連APIのバグについて
http://satoshi.blogs.com/life/2010/05/ipad%E3%82%A2%E3%83%97%E3%83%AA%E4%BD%9C%E6%88%90%E6%97%A5%E8%AA%8C-pdf%E9%96%A2%E9%80%A3api%E3%81%AE%E3%83%90%E3%82%B0%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6.html
でCGPDFPageRef をキャッシュしているみたいという事なので恐らく同じバグと思われる。
対策方法はやはり、CGPDFDocumentRefを毎回開放するという事みたい。
はてなダイアリー使いづらい→づらくない
ブログにRetweet 機能が無い事に気づいたので実装しようと思ったのだが駄目だった。
Retweetボタンの実装自体は簡単で、
<a href="http://twitter.com?status=書き込みたいコメントUTF8をBASE64エンコードした文字列">Retweet</a>
を記事に埋め込むだけで良いのだが、
実装しようとした所
各記事のフッダーHTMLを編集して<a> を書き込む
↓
はてなダイアリーでは各記事のスタイルを編集することはできず、HTMLを直接編集できるのはヘッダーとフッダーのみ
じゃあJQueryとかを使って、クライアントサイドで記事のフッダーに動的に<a> を追加する
↓
Javascriptは使えない
うぜー
毎回手作業で、Retweetボタンをタグ直打ちで書き込むと言う方法もあるが、同じコードは二度書かないというプログラミングの原則から外れているので却下。
というわけで方法は
せっかく調べたのでRetweetリンクでも貼っておく
この記事をRetweet
2011/2/27
追伸
いつの間にか対応してくれたみたい。
ヨカッタヨカッタ
ニコニコ動画に自動ログインする Greasemonkey スクリプト
ニコニコ動画の動画がWebサイト等で紹介されているときに、ログイン画面がいちいち出てきてうざいので、自動でログインするGreasemonkey のスクリプトを探していたら、
marvelous.zip さんのブログでちょうどそれっぽいのを発見した。
http://blog.livedoor.jp/marvelous_zip/archives/1159269.html
marvelous.zip さんのスクリプトだと、一回だけクリックしないといけないのでそこを改造して以下のスクリプトを作った
// ==UserScript== // @name niconico autologin // @namespace niconico_autologin // @description ニコニコ動画に自動でログインします。 // @include http://www.nicovideo.jp/watch/* // @include https://secure.nicovideo.jp/secure/login_form* // ==/UserScript== var email = "メールアドレス"; var pass = "パスワード"; if(document.getElementById("login") && ! document.getElementById("login").innerHTML.match("ログイン情報が間違っています")){ document.getElementById("mail").value = email; document.getElementById("password").value = pass; document.getElementById("login").submit(); } else{ if(document.URL.match(/^https\:\/\/secure\.nicovideo\.jp\/secure\/login_form\?/)){ document.getElementByID("mail").value = email; document.getElementByID("password").value = pass; document.getElementByID("login_submit").submit(); } else{ var as = document.getElementsByTagName("a"); for(i=0;i<as.length;i++){ if(as[i].href.match(/^https\:\/\/secure\.nicovideo\.jp\/secure\/login_form\?/)){ location.href = as[i].href; break; } } } }
便利!!
下に直接DLできるようにしておく(リンクが死んでたので直しました)
https://github.com/katsusuke/niconico-autologin/raw/master/niconico-autologin.user.js