no more than a memo

Unity Wrap Debug Class

Debug.cs

I just wanted to clear other “Debug.Log”

referrel
http://forum.unity3d.com/threads/38720-Debug.Log-and-needless-spam

Markdown-insert-headers and gist.el

~/.emacs.d/init/markdown-mode.el

I’ve changed keybinds/markdown-insert-header for using the ^T command prefix in tmux

post using gist.el

1
2
3
4
$ git config --global github.user  #{github-user}
$ git config --global github.token #{github-api-token}
# emacs
M-x gist-region(-private)

Test

test is test

Add to_fraction for floats (test.rb) download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class Float
  def number_decimal_places
    self.to_s.length-2
  end
  def to_fraction
    higher = 10**self.number_decimal_places
    lower = self*higher
    gcden = greatest_common_divisor(higher, lower)

    return (lower/gcden).round, (higher/gcden).round
  end

  private
  def greatest_common_divisor(a, b)
    while a%b != 0
      a,b = b.round,(a%b).round
    end
    return b
  end
end

open with Google Chrome

MacBookのHD交換

HDの残り容量が少なくなってきたので、120Gのものから500Gのものに交換しました。


IMG_0023.JPG

Making a CGRect


Making CGRect.png

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

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

出力

HelloWorld[52159:20b] {{0, 0}, {320, 480}}

^NSStringFrom.* Functions

NSStringFromから続くFunctionは非常に便利です。特にCGRect, CGPoint, CGSizeを出力したい場合も展開して出力するのは面倒です。


UIKit Function Reference — デベロッパドキュメント.jpg

UINavigationBarを見えなくする-iPhone App

UINavigationBarを見えなくする。


iPhone シミュレータ-2.png

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

`self.navigationController.navigationBar.frame = CGRectZero;`

OCUnitのTestCase作成

OCUnitとはObjective-C用のUnitTest用Frameworkです。

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