• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

プリプロセッサ マクロとかコンパイラ フラグとか苦手です。
a-haがあったのでメモ。

##compiler flag編:-DNS_BLOCK_ASSERTIONS=1
NSAssertをリリースビルド時に無効して、そのフラグでNSLogも無効にしてしまおうという技です。2009年の記事ですが、参考に:

2009-12-03NSLogとNSAssertをリリース時に無効化する
http://iphone-dev.g.hatena.ne.jp/tokorom/20091203

Xcode 4.5ではこんな感じに設定してみました:
NS_BLOCK_ASSERTIONS_compiler flags.png

##preprocessing編:DNS_BLOCK_ASSERTIONS
動作的には上と同じ事なのですが、別の書き方。こっちのが文字数少ない分好きです。

Working with Assertions to Debug your Apps Posted on June 27, 2011
http://mobiledevelopertips.com/debugging/working-with-assertions.html

Xcode 4.5ではこんな感じに設定してみました:
NS_BLOCK_ASSERTIONS_preprocessing.png

ちなみに:

What's the “DNS_BLOCK_ASSERTIONS” (C compiler flag)?
http://stackoverflow.com/questions/2752574/whats-the-dns-block-assertions-c-compiler-flag

Just to clarify, -D defines a constant, and it is one of the confusing flags that doesn't have a space between it and it's parameter

日本語だとここもヒントになりました:

Xcodeでのプリプロセッサ定義
http://romly.com/archives/2009/10/define_by_project_setting.html

posted by satoko satoko on Tue 18 Sep 2012 at 15:19 with 8 comments

まだGDB初心者です。
忘れてしまったのでちゃんと書いておきます。

rails>>
print (CGRect) [myView frame]
print (CGSize) [myView frame].size
print (CGFloat) [myView frame].size.width
<<--

出典元:

GDB and Displaying Property values
http://www.iphonedevsdk.com/forum/iphone-sdk-development/37083-gdb-displaying-property-values.html

  • メソッド?として呼んでやる
  • CGRectにキャストする

というのがポイントなんですね。
ちなみにprintの代わりに、pでも下記でもOKです:

rails>>
p (CGRect)[view frame]
<<--

  • p:print
  • po:print object

これでおしまい

posted by satoko satoko on Wed 15 Feb 2012 at 14:10 with 0 comments

といっても、ほぼ全部二つのサイトの記事なんですが、いつもゴソゴソ探すのでまとめることにしました。

※ 要QuartzCore.framework

###Animating Interfaces with Core Animation: Part 1
惑星が軌道にそって動く+衛星がその周りを回るアプリ

http://nachbaur.com/blog/core-animation-part-1

###Animating Interfaces with Core Animation: Part 2
雲が左から右に流れていくアプリ

http://nachbaur.com/blog/core-animation-part-2

###Animating Interfaces with Core Animation: Part 3
押すとボタンがぶるんと震える(拡大して縮小する)アプリ

http://nachbaur.com/blog/core-animation-part-3

###Animating Interfaces with Core Animation: Part 4
軌跡にそって車を動かすアプリ

http://nachbaur.com/blog/core-animation-part-4

###Core Animation: Paths
軌道に沿って惑星が周り、さらにその軌道字体が3次元で回転するアプリ
(※Macアプリ)

http://watchingapple.com/2008/04/core-animation-paths/

###Core Animation: 3D Perspective
床と壁で3次元ぽく見せるアプリ
(※Macアプリ)

http://watchingapple.com/2008/04/core-animation-3d-perspective/

###Core Animation: Creating a Jack-in-the-box with CAKeyframeAnimation
びっくり箱、Jack in the boxアプリ
(※Macアプリ)

http://watchingapple.com/2008/04/core-animation-creating-a-jack-in-the-box-with-cakeyframeanimation/

###iPhone / iPad アプリのアニメーションをなめらかにするためのポイント3つ
アニメーションのパフォーマンス チューニングについてのポイント

http://blog.fenrir-inc.com/jp/2011/10/ios-animation-tuning.html

posted by satoko satoko on Fri 10 Feb 2012 at 15:06 with 0 comments

ウノウラボさんで面白いイベントをやってるので参加してきます。

**気分をかえてウノウで趣味の開発してみませんか? **

さて、そういうこともあり、週末会社があいている時間を利用していろいろな人と一緒に、内容はばらばらでも開発してみたいよねという話を社内でしてみたところ意外と盛り上がり、うまいこと許可もとれたので、一日だけ皆さんの開発場所としてウノウを提供させていただこうと思います。

追記

ということで、参加してきました。

懇親会の様子

いわゆる勉強会とは違って、みんな黙々と作業をしているのが新鮮でした。
以下箇条書きでメモ・感想など。

  • 元同僚のonk氏がRailsを勉強しに着ていた
  • スクレイピングの人といろいろ話ができて面白かった
  • Mackbook Air人気
  • 「VistaからXPにアップグレード」
  • デバイスを作るのはやっぱり面白そうだ
  • 下北沢(うちの隣の駅)の会社のCTOさんと会った
  • KLabは「クラブ」
  • 手羽先は蟹に通じるものがある(食べてると沈黙する)
  • 宗教論争(エディタ、80桁制約、タブの数、Mac/Win and so on...)

全然関係ないけれど、ツインスパークさんと同じ建物なんですねー。

posted by genki genki on Sat 16 Feb 2008 at 10:06 with 0 comments

Webサービスの開発を行うに当たって、様々な開発環境が
考えられます。
僕の場合は、Windows環境からVMWare Playerを使い、
適当なLinux環境(debian etch)に接続して
Webサービスの開発を行っています。

移動することが多いので、
VMWareのゲストOSとの接続方式は、NATを使っています。
そうすることで、ホストOSがどこに移動しても、
例えネットワークに接続されていなかったとしても、
いつも通りに開発を行うことができます。

然しながら、一つ難点があって、ホストOSのIPアドレス
が変化したときなどに、VMWareのNAT Serviceを再起動する
必要があるのですが、WindowsのGUIからこれを行うのは
なかなか面倒です。

そこで、バッチファイルを使って、簡単にVMWare NAT Serviceだけ
再起動する方法を紹介します。

restart_vmnat.bat

pre>>
net stop "VMWare NAT Service"
net start "VMWare NAT Service"
<<--

このように、netコマンドを使って"VMWare NAT Service"
を再起動しています。

posted by genki genki on Wed 13 Feb 2008 at 01:14 with 1 comment
新しいscriptとして、`script/performance/request`というものが 新たに加わったみたいです。 pre>> h% ./script/performance/request --help USAGE: ./script/performance/request [options] [session script path] -n, --times [0000] How many requests to process. Defaults to 100. -b, --benchmark Benchmark instead of profiling --open [CMD] Command to open profile results. Defaults to "open %s &" -h, --help Show this help <<-- ふむふむ。ベンチマーク系のスクリプトのようですね。 紹介してる記事を見つけました。 [**New in Rails: a request profiler for profiling your app**](http://blog.codefront.net/2007/10/26/new-in-rails-a-request-profiler-for-profiling-your-app/) >Jeremy Kemper (aka bitsweat) committed a very useful tool into the Rails trunk not too long ago: a request profiler! It’s a human-friendly wrapper script around the ruby-prof library, a nice ruby code profiler, that lets you run multiple requests against a URI in your application and get a detailed code profile report in text and HTML. おーなるほど。前回のRails勉強会で紹介した ruby-prof を human-friendlyにしてくれるツールですか。これは面白そうですね。 試してみようと思って触ってみたら、上のサイトで紹介されてる ものと、Rails 2.0で入ったものは若干インターフェイスが違う模様。 DHHが書いてる [こっちの情報](http://weblog.rubyonrails.com/2007/12/7/rails-2-0-it-s-done) が最新のようです(以下に抜粋)
**Action Pack: New request profiler** Figuring out where your bottlenecks are with real usage can be tough, but we just made it a whole lot easier with the new request profiler that can follow an entire usage script and report on the aggregate findings. You use it like this: $ cat login_session.rb get_with_redirect '/' say "GET / => #{path}" post_with_redirect '/sessions', :username => 'john', :password => 'doe' say "POST /sessions => #{path}" $ ./script/performance/request -n 10 login_session.rb And you get a thorough breakdown in HTML and text on where time was spent and you’ll have a good idea on where to look for speeding up the application. なにやらIntegrationTestのコードのようなものを記述したスクリプト を用意して、そのpathを渡せば良いみたいです。
posted by genki genki on Sat 8 Dec 2007 at 21:53 with 0 comments