1 |
$ git clone https://github.com/atom/electron-quick-start |
1 |
$ cd electron-quick-start |
1 |
$ npm install && npm start |
1 |
$ git clone https://github.com/atom/electron-quick-start |
1 |
$ cd electron-quick-start |
1 |
$ npm install && npm start |
npmではプロジェクトのルートディレクトリにおいたpackage.jsonでモジュール(ライブラリ)のインストール管理をするため「プロジェクトの初期化」と「package.jsonの作成」は同義。
1 |
$ npm init |
npmで管理するプロジェクトの情報はpackage.jsonに書き込まれる。
package.jsonはテキストエディタで編集可能であるが、初回は対話式コマンドで作成するのが簡便。
1 |
$ npm install <module name> |
1 |
$ npm install electron -g |
1 |
$ npm install electron-prebuilt -g |
The prebuilt Electron binaryのパッケージ名変更のおしらせ
http://electron.atom.io/blog/2016/08/16/npm-install-electron
1 |
$ npm install electron-packager -g |
1 2 3 4 5 6 7 8 9 10 11 |
$ npm install electron-build -g npm ERR! Darwin 15.3.0 npm ERR! argv "/Users/JaneDoe/.nodebrew/node/v5.6.0/bin/node" "/Users/JaneDoe/.nodebrew/current/bin/npm" "install" "electron-build" "-g" npm ERR! node v5.6.0 npm ERR! npm v3.6.0 npm ERR! code E404 npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/electron-build npm ERR! 404 npm ERR! 404 'electron-build' is not in the npm registry. .... |
難しいエラーメッセージが羅列されているが、要は指定された名前のパッケージが存在しない。パッケージ名のtypoを疑おう!
上記のエラーは "buit" を "build" とtypo。
SwiftによるVisualFormat形式のオートレイアウトのコード例
UINavigationControllerにおける実装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
// VisualFormatから参照するキーワードの辞書 let viewDictionary:Dictionary = ["MyContent": self.myContentView] let constraintFormatH:[NSLayoutConstraint] = NSLayoutConstraint.constraintsWithVisualFormat( "H:|-[MyContent]-|", options: NSLayoutFormatOptions(rawValue: 0), metrics:nil, views:viewDictionary) self.view.addConstraints(constraintFormatH) // NavigationBarの高さ:20 // ToolBarの高さ:64 let constraintFormatV:[NSLayoutConstraint] = NSLayoutConstraint.constraintsWithVisualFormat( "V:|-(20)-[MyContent]-(64)-|", options: NSLayoutFormatOptions(rawValue: 0), metrics:nil, views:viewDictionary) self.view.addConstraints(constraintFormatV) |
1 2 |
$ find . -type f -name '*.c' -print0 | xargs -0 nkf --overwrite -w -Lu |
-w
: UTF-8-w8
: UTF-8-s
: Shift_JIS-e
: EUC-j
: JIS(ISO-2022-JP)-Lu
: UNIX形式(LF)に変換-Lw
: Win形式(CRLF)に変換-Lm
: 旧Mac形式(CR)に変換-type f
: ファイル-type d
: ディレクトリ(フォルダ)-print0
: [findコマンド] NUL文字(0x00)-0
: [xargコマンド] NUL文字(0x00)いろいろな IDE, プログラミング言語の .gitignore
集
Visual Studio 201x のシミュレーターに表示される数値
Android.mkに以下の行を追加する
1 |
LOCAL_LDLIBS := -llog |
1 |
#include <android/log.h> |
1 |
__android_log_write(ANDROID_LOG_DEBUG, "MY_APP", "DEBUG POINT 1"); |
1 |
__android_log_print(ANDROID_LOG_DEBUG, "MY_APP", "DEBUG VALUE %d", i); |
1 |
$ ~/ndk/android-ndk-rxx/ndk-build clean |
1 |
$ ~/ndk/android-ndk-rxx/ndk-build NDK_BUILD=1 |
"logcat" でみる。
View ⇒ Tool Windows ⇒ Android Monitor ⌘ + 6
1 2 3 4 5 6 7 8 9 10 |
public class MyJniLib { // static initializer でネイティブライブラリをロードする static { System.loadLibrary("myJniLib"); } // ネイティブメソッドの定義 // Javaコードから、このネイティブメソッドを呼ぶとC/C++の関数が呼び出される public native int helloJni(); } |
1 |
$ javah -classpath <classpath> -o <header filename> <fully qualified classname> |
1 |
$ javah -classpath ../../build/intermediates/classes/debug jp.chihayafuru.lib.MyJniLib |