プログラミング用フォントRicty 3.2.3をubuntu 14.04で生成

  • 2011年か2012年頃(かな?)に生成した.ttfを使いまわしていたのでいい加減そろそろ更新
  • ときどきしかしないので備忘録として
  1. 無ければfontforge入れておく
    $ sudo aptitude install fontforge
    
  2. 合成元のInconsolataもインストール
    $ sudo aptitude install fonts-inconsolata
    
  3. 合成元の「Migu 1M」もインストール
    http://mix-mplus-ipa.sourceforge.jp/migu/で「Migu 1M」の.zipをダンロードして解凍&.fontsフォルダに入れておく
    $ mv migu-1m-*.ttf ~/.fonts/
    
  4. 一応反映されるように以下実行
    $ fc-cache -fv
    
  5. Ricty取得
    $ git clone https://github.com/yascentur/Ricty.git
    $ cd Ricty/
    $ git checkout refs/tags/3.2.3
    
  6. Rictyを生成&インストール
    $ ./ricty_generator.sh auto
    $ mv Ricty*.ttf ~/.fonts/
    $ fc-cache -fv
    
これでフォントにRictyを選択できるはず

名曲「SVさ行ぐだ」

「SVさ行ぐだ」( http://slashdot.jp/comments.pl?sid=509112&cid=1832050 )
ハァ
予算もねぇ 時間もねぇ コードも全然書けてねえ
仕様がねぇ 設計もねぇ 部長は 毎日オーロオロ
朝起きて、出社して、5時間ちょっとの朝会議
人足りねぇ 技術もねぇ 休みは一月一度ある
オラこんな国いやだー オラこんな国いやだー SVへ出るだあ。
SVへ出たなら SI作って 一次受けで入札するだー
ハァ 
休憩ねえ 定時もねえ 終電以外は 見たごとねえ
社食もねぇ 組合もねぇ まったぐ技術者 俺一人
部長様と 管理者が 工程表にらんで神頼み
コメントねえ テストもねえ たまに来るのはアルバイト
オラこんな国いやだー オラこんな国いやだー SVへ出るだあ
SVへ出たなら 設計者ンなって Excel設計書 書くだ
ハァ
盆がねえ 正月ねえ 「ばけえしょん」ってのは何者だ?
有給は あるけれど 使った人は見たことねえ
保険もねぇ 健診もねぇ たまに来るのは霊柩車
新人ねえ 来るわけねえ おらの会社はブラックだ
オラこんな国いやだー オラこんな国いやだー SVへ出るだあ
SVへ出たなら 上流になって 外注に丸投げするだー
※SV : しりこん ばれぃ。 伝説の黄金郷のこと。東の大海の果てに
  あるといわれているが、そこから生きて帰ってきた者は誰もいない。

後世に残すべき名曲だと思います。はい。

android-x86-4.4-RC1

VirtualBoxで簡単に動かせただよ
  • シャットダウンはSettingsの一番下(のみ?)

Volley synchronous request / Volleyで同期的なリクエストをする方法

com.android.volley.toolbox.RequestFuture

RequestQueue queue = Volley.newRequestQueue(context);
RequestFuture<Hoge> future = RequestFuture.newFuture();
Request<Hoge> request = new FugaRequest(Request.Method.POST, url, future);
queue.add(request);
try {
    Hoge response = future.get();
} catch (InterruptedException e) {
    // TODO
} catch (ExecutionException e) {
    // TODO
}

ubuntu MTP Nexus 7

(メモ)

$ sudo add-apt-repository ppa:langdalepl/gvfs-mtp
$ sudo apt-get update
$ sudo apt-get upgrade

ubuntu再起動

$ sudo shutdown -r now

補足
(なおusb debuggingを止めないとMTPで繋がりませんので)

[ERROR] Error message file '/usr/share/mysql/english/errmsg.sys' had only 481 error messages, but it should contain at least 641 error messages. Check that the above file is the right version for this program!

他人ちのmysqldを再起動しようとしたら出たエラー(んでmysqldが起動しない)
「知らんがなー」と思いつつ、自分ち(某VPS)のerrmsg.sysをコピって他人ちの/usr/share/mysql/english/に置いたら正常起動した(変な汗かいた)
see also: http://shebangme.blogspot.jp/2010/04/mysql-error-message-file-had-only-480.html

Change the battery level of android emulator (AVD)

$ adb devices
List of devices attached 
emulator-5554 device
$ telnet localhost 5554
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Android Console: type 'help' for a list of commands
OK
help
Android console command help:

    help|h|?         print a list of commands
    event            simulate hardware events
    geo              Geo-location commands
    gsm              GSM related commands
    cdma             CDMA related commands
    kill             kill the emulator instance
    network          manage network settings
    power            power related commands
    quit|exit        quit control session
    redir            manage port redirections
    sms              SMS related commands
    avd              control virtual device execution
    window           manage emulator window
    qemu             QEMU-specific commands
    sensor           manage emulator sensors

try 'help <command>' for command-specific help
OK
power
allows to change battery and AC power status

available sub-commands:
    display          display battery and charger state
    ac               set AC charging state
    status           set battery status
    present          set battery present state
    health           set battery health state
    capacity         set battery capacity state

KO: missing sub-command
power capacity 77
OK

PHP SoapClient: Function ("hoge") is not a valid method for this service. / SoapServer: Procedure "hoge" not present

SoapClient

$client = new SoapClient("http://www.example.com/soap");
$client->hoge("fuga"); // <-exception occurred!
Exception Message
Function ("hoge") is not a valid method for this service.
but...

SoapServer

Of course, WSDL definitions are correct (Function 'hoge' is added).
$server = new SoapServer("http://www.example.com/soap");
$server->handle(); // <-exception occurred!
Exception Message
Procedure "hoge" not present

set soap.wsdl_cache_enabled to 0.

Add below, Both SoapClient and SoapServer.

SoapClient

ini_set("soap.wsdl_cache_enabled", 0);
$client = new SoapClient("http://www.example.com/soap");
$client->hoge("fuga"); // <-exception occurred!

SoapServer

ini_set("soap.wsdl_cache_enabled", 0);
$server = new SoapServer("http://www.example.com/soap");
$server->handle(); // <-exception occurred!

Intent com.android.camera.action.CROP ActivityNotFoundException

Intent intent = new Intent("com.android.camera.action.CROP");

    /* Not work. ActivityNotFoundException occurs. */
    //intent.setType("image/*");
    //intent.setData(uri);

    intent.setDataAndType(uri, "image/*"); // works!

    startActivityForResult(intent, REQUEST_CODE_IMAGE_CROP);
(マジ?)

日本でも使えますよ?Chromecastの設定用apkを入手する

Googleのスマホ連携用HDMIスティック「Chromecast」が直輸入、ただし…
ただし、現時点ではChromecast用アプリを国内のGoogle Play/iTunesアカウントから入手することができず、使用するのは難しい状態。どちらのアカウントでも「このアプリは日本では利用できない」という旨のメッセージが表示され、端末にアプリを導入することはできなかった。
そう、正規ルートだとChromecast設定用アプリを入手することは出来ない。けど、
■ Chromecastの設定APKは落ちている
こちらでも紹介されてるし、APKの直リンはここ
■ Chromecastマジで(・∀・)イイ!!
2013版のNexus 7をリモコンにしてベットに寝転びながら、YouTubeの登録チャンネルから配信された新しい動画をボケーッと観てる。

Nexus 7 2012とNexus 7 2013を比較

2012(16GBモデル) 2013(16GB/WiFiモデル)
androidバージョン 4.3 4.3
モデル番号 Nexus 7 Nexus 7
カーネルバージョン 3.1.10-g1e8b3d8 3.4.0-g6537a16
ビルド番号 JWR66Y JSS15Q
ディスプレイインチ 7.3 6.8
Density tvdpi(213dpi) xhdpi(320dpi)
解像度(px) 800x1280 1200x1920
解像度(dp) 601.5x962.4 600x960
Size large large
Aspect ratio notlong notlong
おまけ重さ 340g 290g(ちょい軽い!)
厚さ 10.45mm 8.65mm(ちょい薄い!)
バッテリー 4325mAH 3950mAH(え!?)
RAM 1GB 2GB
CPU 1.2GHz
(NVIDIA Tegra 3)
1.5 GHz
(Qualcomm Snapdragon S4 Pro)
お値段(Google Play) ¥19,800 ¥27,800

twitpic "Could not authenticate you (header rejected by twitter)."

twitpic
なんか知らないんだけどtwitpicっていうのを使っているサービスがあって、今更、例のtwitter API 1.1対応みたいなお仕事したんですが、twitpicのAPIを叩くと、
Could not authenticate you (header rejected by twitter).
って言われちゃう。
なのでtwitpicのAPIドキュメントのこれ↓
http://dev.twitpic.com/docs/2/upload/
をみたところ、
X-Verify-Credentials-Authorization (Required)
Header Example
1 OAuth realm="http://api.twitter.com/",
2 oauth_consumer_key="GDdmIQH6jhtmLUypg82g",
3 oauth_signature_method="HMAC-SHA1",
4 oauth_token="819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw",
5 oauth_timestamp="1272325550",
6 oauth_nonce="oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y",
7 oauth_version="1.0",
8 oauth_signature="U1obTfE7Rs9J1kafTGwufLJdspo%3D"  

X-Auth-Service-Provider (Required)
https://api.twitter.com/1/account/verify_credentials.json
って書いてあるんだけど、X-Auth-Service-Providerを
https://api.twitter.com/1.1/account/verify_credentials.json
にするのはもちろん、oauth_signatureを作っているURLも
https://api.twitter.com/1.1/statuses/update.json
とかにする必要があったです。はい。