This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * android 起動時に以下のボタン押しっぱなし | |
| ** KEYCODE_MENU | |
| ** KEYCODE_S | |
| ** KEYCODE_DPAD_CENTER | |
| ** BTN_MOUSE | |
| ** KEYCODE_VOLUME_DOWN | |
| * frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | |
| public boolean detectSafeMode() { | |
| try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NULL終端されていない文字列が格納されたバッファがあり、文字列の長さが分かっているときに、 | |
| printf/printkで簡単に文字列を出力する方法。 | |
| 文字列バッファのポインタをstr | |
| 実際に格納されている文字列の長さをstrlen とする。 | |
| // strlen分だけstrから読み込む | |
| printf(“文字列の中身は=%.*s”, strlen, str); | |
| 動作確認:gcc 4.4.6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| IntelliJ IDEAで作成したプロジェクトに対して、Android testプロジェクトを作成しようとすると、 | |
| エラーが出て作成できない。 | |
| →android create test-projectコマンドでもだめ。 | |
| IntelliJ IDEA : 12.0.3 (Build #IC-123.155) | |
| [エラー内容] | |
| Found main project package: com.android.example.spinner | |
| Found main project activity: .SpinnerActivity | |
| Error: Unable to load the main project's project.properties |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // モバイルネットワークインターフェースのIPアドレスを取得する。 | |
| // 注意:インターフェース2つとか、もろもろの異常系は考慮していない | |
| private static final String LOCAL_LOOPBACK_ADDR = "127.0.0.1"; | |
| private static final String INVALID_ADDR = "0.0.0.0"; | |
| private static String getMobileIPAddress() { | |
| try { | |
| NetworkInterface ni = NetworkInterface.getByName("hso0"); // インターフェース名 | |
| if (ni == null) { | |
| Log.d(TAG, "Failed to get mobile interface."); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * 参考 | |
| http://git-scm.com/book/ja/Git-%E3%81%AE%E3%81%95%E3%81%BE%E3%81%96%E3%81%BE%E3%81%AA%E3%83%84%E3%83%BC%E3%83%AB-Git-%E3%81%AB%E3%82%88%E3%82%8B%E3%83%87%E3%83%90%E3%83%83%E3%82%B0#%E4%BA%8C%E5%88%86%E6%8E%A2%E7%B4%A2 | |
| http://cdn8.atwikiimg.com/git_jp/pub/git-manual-jp/Documentation/chunked/ch02.html | |
| * git bisect start <bad> <good> | |
| よければ git bisect good | |
| 悪ければ git bisect bad | |
| * マージコミットなどを無視するには、git bisect skip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ■スマートポインタ定義場所 | |
| ・frameworks/base/libs/utils/RefBase.cpp | |
| ・frameworks/base/include/utils/RefBase.h | |
| ・frameworks/base/include/utils/StrongPointer.h | |
| ■アクセサ | |
| * wp | |
| inline T* unsafe_get() const { return m_ptr; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * include/asm-generic/errno-base.h | |
| #define EPERM 1 /* Operation not permitted */ | |
| #define ENOENT 2 /* No such file or directory */ | |
| #define ESRCH 3 /* No such process */ | |
| #define EINTR 4 /* Interrupted system call */ | |
| #define EIO 5 /* I/O error */ | |
| #define ENXIO 6 /* No such device or address */ | |
| #define E2BIG 7 /* Argument list too long */ | |
| #define ENOEXEC 8 /* Exec format error */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| C言語では、論理否定演算子(!)は「真か偽」ではなく、常に1か0を返すことが保証されているらしい。 | |
| なので、以下の文は意味がある。 | |
| int value, x, y; | |
| int a = !!value; | |
| int b = !!(x & y); | |
| →aとbは、1か0になる。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <asm/current.h> | |
| pid_t pid = current->tgid; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| IEEE Standards associationのサイトで検索する | |
| [検索方法] | |
| http://standards.ieee.org/develop/regauth/oui/public.html | |
| 下の方の、"Search the Public OUI/'company_id' Listing" | |
| 調べたいMACアドレスの先頭の3オクテットを入れて、"Search!" |