memo 809 件

iPhone 保証規定

http://support.apple.com/ja_JP/manuals/#iphone

iPhone 4S - この製品についての 重要なお知らせ
10月 13, 2011 - 103 KB
http://manuals.info.apple.com/ja_JP/iphone_4s_important_product_information_guide_j.pdf

は「iPhone Warranty v3 070511」で「Apple は、保証サービスを、Appleまたはその Authorized Distributor が最初に Apple 製品を販売した国に限定することがあります」

iPhone 4 - この製品についての 重要なお知らせ
3月 11, 2011 - 147 KB
http://manuals.info.apple.com/ja_JP/iPhone_4_Important_Product_Information_Guide_J.pdf

は「iPhone JP Warranty v2.0」で「アップルは、アップルまたはアップルの正規代理店が最初にハードウェアを販売した国にサービスを限定することができます。」

iPhone 3GS - この製品についての 重要なお知らせ
3月 11, 2011 - 142 KB
http://manuals.info.apple.com/ja_JP/iPhone_3GS_Important_Product_Information_Guide_J.pdf

は「iPhone JP Warranty v1.9」で「アップルは、アップルまたはアップルの正規代理店が最初にハードウェアを販売した国にサービスを限定し、以下の方法により保証サービスを提供することができるものとします」

iPhone 3G - この製品についての 重要なお知らせ
9月 09, 2009 - 71 KB
http://manuals.info.apple.com/ja_JP/iPhone_3G_Important_Product_Information_Guide_J.pdf

は「iPhone JP Warranty v1.9」で「アップルは、アップルまたはアップルの正規代理店が最初にハードウェアを販売した国にサービスを限定し、以下の方法により保証サービスを提供することができるものとします」

ようするに保証規定はずっと「する場合がある」となっていたのを、運用上実際に制限を開始し始めた、ってことなのか…。

ついでに、

AppleCare Protection Plan for iPhone Terms and Conditions
Japanese (日本語)
http://images.apple.com/legal/applecare/docs/Japan_APP_iPhone_Japanese_v2.1.pdf

にも「アップルは、サービスの提供が可能な国をお客様が最初に対象機器を購入された国に限定させていただく場合があります」と。

Kindle Touch screen issue (?)

Disclaimer: This is my first E Ink experience. So it could be what E Ink should be.

I see some remaining characters when flipping pages with my new Kindle Touch.

For example, while I'm reading Big Data Now: Current Perspectives from O'Reilly Radar, I see slight remaining characters from previous page.

For example, I was reading this page,

kindle_touch_3

And then flip to next page. But you can still see _slight_ remaining characters from previous page. ("... years, there has been .... logs, tweet streams, ...")

kindle_touch_1

Though once screen refreshes (once every 6 pages/flips), the screen clears up.

kindle_touch_2

Is this what is expected with E Ink ? Is this happening on Nook Touch too ?

UPDATE (2011.11.28): According to this video (at 1:01:13), it seems to be "feature" not "issue". You can change this behavior if you think it's annoying. (I changed "Page Refresh" to "On" (to refresh every page turn).)

Language Switcher

Language Switcher adds key "AppleLanguage" to plist in ~/Library/Preferences/(applications plist).plist file.

If you add only "English" for Mail.app, it won't let users choose other encodings than UTF-8 and English encodings. If you want to use other encodings, you can _add_ language, for example "Japanese", to that key. (By keeping "English" first in the list, Mail.app UI will stay in English.)

Continental Airlines Refund service

08/05/2011 To: [email protected]
08/11/2011 To: [email protected] reminder
08/15/2011 http://www.continental.com/web/en-US/content/reservations/refunds/otherRefund.aspx
08/23/2011 To: [email protected]
08/25/2011 Approved (From: [email protected], [email protected] in signature)

Better not trust following page, instead use [email protected] for refund request.

http://www.continental.com/web/en-us/content/reservations/refunds/refunds.aspx
----
Contact Refund Services

E-mail:
[email protected]
----

(Updates: 9/6/2011)

Some more emails from Continental.

08/30/2011 Reply from Continental (From: [email protected], [email protected] in signature) to approv refund
08/30/2011 Reply from Continental (From: [email protected]) for refund request submit via web on 8/15 (not yet received voucher mentioned in the email)

So, it looks like this is what happened.

Sent 8/5 -> Reply 8/25 (email to [email protected])
Sent 8/15 -> Reply 8/30 (submit via web)
Sent 8/23 -> Reply 8/30 (email to [email protected])

It does seem that either way works at the end of the day. (Though [email protected] doesn't return any acceptance, while web UI and [email protected] does. So, I still recommend web UI or [email protected] over [email protected])

this page include other resources which are not secure

Google Chrome での「SSLで保護されてないコンテンツがあります」的な警告には二種類あって、"the behavior of the page" が守られない可能性がある場合と "the look of the page" が守られない可能性がある場合とがある。前者は error 扱いで、後者は warning 扱い。

http://src.chromium.org/viewvc/chrome/trunk/src/chrome/app/generated_resources.grd?view=markup

(IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_ERROR とIDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_WARNING の違い)

コメントによると前者は script など動的なコンテンツなんかがSSLされてない場合で、後者は画像、CSS など静的なコンテンツがSSLされてない場合のようだ。

chrome1.png

chrome2.png

TCP-MD5 on FreeBSD

FreeBSD 8.2-STABLE で TCP MD5 の設定

/etc/ipsec.conf
add  192.0.2.1 192.0.2.2tcp 0x1000 -A tcp-md5 "secret";
add 2001:db8::1 2001:db8::2 tcp 0x1000 -A tcp-md5 "secret";
みたいなファイルを作って、ipsec_enable="YES" を /etc/rc.conf に書いておく。すると、setsockopt TCP_MD5SIG みたいにされたパケットには TCP-MD5 がつくようになる。(ちなみに OpenBGPd の設定ファイルの中で設定しても無駄)

なお、受信した TCP-MD5 の検証はまだ実装されてない。(参考)

Home made .mobi for Whispersync

(Amazon から購入した mobi じゃない)自家製 mobi で Whispersync するための細工のメモ。(ePub を mobi にする方法はたくさんあるからググって探すといいと思う。)

Whispersync するための必要条件は次の2つ。
  • EXTH 113 (ASIN) を正しいASINにセット
  • EXTH 501 (cdetype) を 'EBOK' にセット

これを実現するための手順は以下の通り。
  1. mobiperl-win-0.0.43.zip を https://dev.mobileread.com/dist/tompe/mobiperl/ からダウンロードする (このページには Mac 用もあるって書いてあるし、そもそも Perl なんだからどこでも動きそうなものだが、面倒だから試してない。)

  2. ダウンロードした ZIP ファイルを展開すると以下のファイル(と tar ファイル)が出てくる。(必要なのは mobi2mobi.exe だけだけど)

    html2mobi.exe
    lit2mobi.exe
    mobi2html.exe
    mobi2mobi.exe
    mobils.exe
    opf2mobi.exe

  3. .mobi ファイルを mobi2mobi.exe を同じフォルダにコピーする。(万が一のためにオリジナルのファイルは別途保存しておく)

  4. Amazon.com や Amazon.co.jp で ASIN を調べる。"Product Details" のところに書かれているASINを見るか、URLに含まれているASINを使う。今回の対象の本は以下の通りで、ASINはB0043D2E5E。

    JUNOS High Availability
    http://www.amazon.com/dp/B0043D2E5E

  5. コマンドプロンプトを開き以下の通り実行する。

    > mobi2mobi --outfile JUNOS_High_Availability.mobi --exthtype 113 --exthdata "B0043D2E5E" JUNOS_High_Availability.mobi
    > mobi2mobi --outfile JUNOS_High_Availability.mobi --exthtype 501 --exthdata "EBOK" JUNOS_High_Availability.mobi

    もし EXTH フィールドが無いなどのエラーが出る場合はこちら。(こっちは変更じゃなくて追加)

    > mobi2mobi --outfile JUNOS_High_Availability.mobi --addexthtype 113 --exthdata "B0043D2E5E" JUNOS_High_Availability.mobi
    > mobi2mobi --outfile JUNOS_High_Availability.mobi --addexthtype 501 --exthdata "EBOK" JUNOS_High_Availability.mobi

  6. できあがった .mobi ファイルを各デバイスのKindleのフォルダへ持っていく。

    • Android: (といっても、Honeycomb 3.1 デバイスしか持ってないから、他の Android でどうなのかよく分からないけど)とりあえず手元の Kindle for Android では普通に /sdcard/kindle へ上で作った .mobi ファイルを置くだけでファイルを認識した上で Whispersync してくれた。(ファイルを開いて少し読み進み、再度 Library へ戻ると一瞬「Saved furthest location」って表示されるはず。)
    • Mac: ~/Library/Application\ Support/Kindle/My Kindle Content に置いた。"Tools - Sync to Furthest Page Read" を選択(もしくはツールバーにある矢印二つのアイコンをクリック)すると、Sync してることが分かるはず。
    • iPhone: (諸般の事情で iOS 4.3.2 で試してます) Kindle for iPhone にファイルを送り込む方法としては iTunes 経由が一番標準的だろう。(Appタブの下方にある「ファイル共有」から) でもこれだと Whispersync が動かない。(矢印二つアイコンがグレーになっててタップできない) なので代わりに iPhone Explorer を使う。コピーする先は iPhone - Apps - Kindle - Library - eBooks。ここに上で作った .mobi を置いてやればちゃんと Whispersync も動く。(iTunes は Kindle - Documents に置いちゃうらしい。)

  7. 以上でたとえば Oreilly から購入した本でも Mac/iPhone/iPad/Android/Kindle で読んだ場所、ブックマークを共有しながら読み進められる。

以下は mobi2mobi.exe を実行してる様子。
mobi2mobi3.pngmobi2mobi2.pngmobi2mobi1.png

PGP/GPG鍵の失効

古い鍵対を失効させた。
% gpg --list-keys [email protected]
pub 4096R/X0000XX0 2010-09-15
uid John Doe <[email protected]>
uid John Doe <[email protected]>
uid John Doe <[email protected]>
sub 2048R/0000X00X 2010-09-15 [expires: 2013-09-14]

pub 1024R/000000XX 1998-10-22
uid Doe John <[email protected]>
uid Doe John <[email protected]>
uid Doe John (since 2009.08.24) <[email protected]>
上が鍵が新しい鍵で、下が失効させたい古い鍵。(使う機会は少なかったけど、しかし、13年前に作った鍵なのか…。PGP 2.6.3i だったなぁ、その当時は。)

失効証明書を作成しインポート。
% gpg -o 000000XX.revoke.asc --gen-revoke 000000XX

sec 1024R/000000XX 1998-10-22 Doe John <[email protected]>

Create a revocation certificate for this key? (y/N) y

You need a passphrase to unlock the secret key for
user: "Doe John <[email protected]>"
1024-bit RSA key, ID 000000XX, created 1998-10-22

Enter passphrase:
ASCII armored output forced.
Revocation certificate created.

Please move it to a medium which you can hide away; if Mallory gets
access to this certificate he can use it to make your key unusable.
It is smart to print this certificate and store it away, just in case
your media become unreadable. But have some caution: The print system of
your machine might store the data and make it available to others!

% gpg --import 000000XX.revoke.asc
gpg: key 000000XX: "Doe John <[email protected]>" revocation certificate imported
gpg: Total number processed: 1
gpg: new key revocations: 1
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 1 signed: 22 trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: depth: 1 valid: 22 signed: 4 trust: 0-, 3q, 1n, 16m, 2f, 0u
gpg: depth: 2 valid: 2 signed: 0 trust: 1-, 0q, 0n, 1m, 0f, 0u
gpg: next trustdb check due at 2017-11-30

無事に失効した。
% gpg --list-keys [email protected]
pub 4096R/X0000XX0 2010-09-15
uid John Doe <[email protected]>
uid John Doe <[email protected]>
uid John Doe <[email protected]>
sub 2048R/0000X00X 2010-09-15 [expires: 2013-09-14]

pub 1024R/000000XX 1998-10-22 [revoked: 2011-07-12]
uid Doe John <[email protected]>
uid Doe John <[email protected]>
uid Doe John (since 2009.08.24) <[email protected]>

失効した鍵対を鍵サーバーへ送信。
% gpg --send-keys 000000XX
gpg: sending key 000000XX to hkp server pgp.nic.ad.jp

% gpg --search-keys [email protected]
gpg: searching for "[email protected]" from hkp server pgp.nic.ad.jp
(1) John Doe <[email protected]>
John Doe <[email protected]>
John Doe <[email protected]>
4096 bit RSA key X0000XX0, created: 2010-09-15
(2) Doe John <[email protected]>
Doe John <[email protected]>
Doe John (since 2009.08.24) <[email protected]>
1024 bit RSA key 000000XX, created: 1998-10-22 (revoked)
Enter number(s), N)ext, or Q)uit > q

Google maps "My Places" の移行

Google maps の「My Places」の移行
  1. http://maps.google.com/ へ行く
  2. 古いGoogleアカウントでログインする
  3. "My Places" をクリック
  4. コピーしたい地図のリンクをクリック
  5. 右上のリンクボタンから "Paste link in email or IM" のリンクをコピーする
    link.png
  6. 別のブラウザタブ(or ウィンドウ)にリンクをペーストし末尾に「&output=kml」を追加し Enter
  7. KMLファイルがどこかへダウンロードされる
  8. 別のブラウザで http://maps.google.com/ を開き、新しいGoogleアカウントでログインする
  9. "My Places" で「CREATE NEW MAP」をクリック
  10. "Title" のすぐ上にある "Import" をクリック
  11. 上でダウンロードされた KML ファイルを選択し "Upload from File"
  12. 保存したらできあがり

LACP

メモ

tcpdump の場合
00:04:4e:2b:b4:00 > 01:80:c2:00:00:02, ethertype Slow Protocols (0x8809), length 124: LACPv1, length 110
Actor Information TLV (0x01), length 20
System 00:04:4e:2b:b4:00, System Priority 32768, Key 1, Port 258, Port Priority 32768
State Flags [Activity, Timeout, Aggregation, Synchronization, Collecting, Distributing]
0x0000: 0004 4e2b b400 0001 8000 0102 3f00 0000
0x0010: 0214
Partner Information TLV (0x02), length 20
System 00:23:9c:b4:6f:f0, System Priority 127, Key 1, Port 1, Port Priority 127
State Flags [Activity, Timeout, Aggregation, Synchronization, Collecting, Distributing]
0x0000: 0023 9cb4 6ff0 0001 007f 0001 3f00 0000
0x0010: 0310
Collector Information TLV (0x03), length 16
Max Delay 32768
0x0000: 0000 0000 0000 0000 0000 0000 0000
Terminator TLV (0x00), length 0 (=52)
0x0000: 0000 0000 0000 0000 0000 0000 0000 0000
0x0010: 0000 0000 0000 0000 0000 0000 0000 0000
0x0020: 0000 0000 0000 0000 0000 0000 0000 0000

Wireshark の場合
Ethernet II, Src: Cisco_2b:b4:00 (00:04:4e:2b:b4:00), Dst: Slow-Protocols (01:80:c2:00:00:02)
Destination: Slow-Protocols (01:80:c2:00:00:02)
Address: Slow-Protocols (01:80:c2:00:00:02)
.... ...1 .... .... .... .... = IG bit: Group address (multicast/broadcast)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
Source: Cisco_2b:b4:00 (00:04:4e:2b:b4:00)
Address: Cisco_2b:b4:00 (00:04:4e:2b:b4:00)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
Type: Slow Protocols (0x8809)
Link Aggregation Control Protocol
Slow Protocols subtype: LACP (0x01)
LACP Version Number: 0x01
Actor Information: 0x01
Actor Information Length: 0x14
Actor System Priority: 32768
Actor System: Cisco_2b:b4:00 (00:04:4e:2b:b4:00)
Actor Key: 1
Actor Port Priority: 32768
Actor Port: 258
Actor State: 0x3f (Activity, Timeout, Aggregation, Synchronization, Collecting, Distributing)
.... ...1 = LACP Activity: Yes
.... ..1. = LACP Timeout: Yes
.... .1.. = Aggregation: Yes
.... 1... = Synchronization: Yes
...1 .... = Collecting: Yes
..1. .... = Distributing: Yes
.0.. .... = Defaulted: No
0... .... = Expired: No
Reserved: 000000
Partner Information: 0x02
Partner Information Length: 0x14
Partner System Priority: 127
Partner System: JuniperN_b4:6f:f0 (00:23:9c:b4:6f:f0)
Partner Key: 1
Partner Port Priority: 127
Partner Port: 1
Partner State: 0x3f (Activity, Timeout, Aggregation, Synchronization, Collecting, Distributing)
.... ...1 = LACP Activity: Yes
.... ..1. = LACP Timeout: Yes
.... .1.. = Aggregation: Yes
.... 1... = Synchronization: Yes
...1 .... = Collecting: Yes
..1. .... = Distributing: Yes
.0.. .... = Defaulted: No
0... .... = Expired: No
Reserved: 000000
Collector Information: 0x03
Collector Information Length: 0x10
Collector Max Delay: 32768
Reserved: 000000000000000000000000
Terminator Information: 0x00
Terminator Length: 0x00
Reserved: 000000000000000000000000000000000000000000000000...

Google Bookmarks to Google Bookmarks

Google Account から Google Apps Account へ Google Bookmarks のデータを移行するにあたって結構苦労したからメモしておく。

そもそもが Google Bookmarks には HTML ファイルに export する機能はあるのに、その HTML を import する機能が無い。WTF?これもわりと放置気味プロダクトであるが故なのだろうか。

それはともかく、import にはそれでもいくつか方法がある。
  • Firefox (for Windows) + Google Toolbar のブックマークインポート機能を使う
  • 最近(っても少し経ってるけど)実装された Delicious からのインポート機能を使う
  • リバースエンジニアの末発見された微妙な API ( https://www.google.com/bookmarks/mark?op=upload )を使う
(実際には、上の2つは3番目の API を使ってるんだけど)

で、とりあえず一つ目を試そうと Firefox4 on Mac で Google Toolbar をインストールしようとしたら Firefox のバージョンが合わないとか言われたから、わざわざ 3.6.x (for Mac)をダウンロードして再度試したら、今度は「この拡張機能はこのOSでは使えません」とか言われてインストールできず。仕方なくわざわざ VMware Fusion 内の WindowsXP に Firefox 3.6.x をインストールし、Google Toolbar を入れた上で、ようやく古いアカウントの Google Bookmarks から export ( https://www.google.com/bookmarks/bookmarks.html )したHTMLファイルを、まずは Firefox の Bookmark へ読み込み、ついに Google Toolbar の「ブックマーク - Firefox からのインポート」を試した。しかし。まったくもってダメダメだった。一番最悪なのは、あるブックマークにタグを複数付けてた場合(例:tag1 と tag2)、Google Toolbar 経由でインポートしたブックマークのタグは "tag1 tag2" という二つのタグが空白でつなげられた一つのタグになってしまったところだ。これじゃまったく意味がないので速攻あきらめた。

次に、二番目の方法を試した。古いアカウントの Google Bookmarks から export し、そのHTMLファイルを Delicious に作った一時的なアカウントへ import (「Settings - Import / Upload Bookmarks」)、その上で新しいアカウントの Google Bookmarks から「Import Delicious Bookmarks」( https://www.google.com/bookmarks/deliciousimport )を実行した。ぱっと見うまくいったように見えたが、よーく見るとタグがやけに少ない。ちゃんと見てみると、どうやらブックマークあたり高々一つのタグしかついてない。Delicious 側を確認すると、どうやら Google Bookmarks 側で複数タグをつけてても、Delicious 側には一つしか import されてないようだった。これじゃ意味がない。

なんかだんだん面倒になってきたけど、もうひと踏ん張り検索をしてみたら、gbookmark2delicious というスクリプトを見つけた。こいつは Google Bookmarks の内容を Delicious へ同期してくれるらしい。これなら上記のタグがコピーされない問題も解決されてるかも!と思い、早速ダウンロードして実行したところ、Voilà! 無事複数タグもきちんとコピーされ、もとの Google Bookmarks の完全なコピーが Delicious 側にできた(と思ってた)。喜んで新しい Google Bookmarks から「Import Delicious Bookmarks」を実行したところほぼ完璧に Google Bookmarks の移行ができたように見えた。

しかし、よーく見ると、二つ問題があった。
  1. ブックマークの作成日時が全部同じ (当日)
  2. "delicious-export" という余計なタグがすべてのブックマークについてる (これは import 時に Google Bookmarks 側で付けてる)
  3. ("Unlabeled" というタグがついてたけど、これは Delicious 側で削除できた)

まず一つ目の問題は、そもそも gbookmark2delicious でブックマークをコピーする段階で日付の情報がコピーされてないのが原因だった。Google Bookmarks と Delicious 両方から export したHTMLファイルを眺めると、どうやらAタグに ADD_DATE という attribute (Epoch時間)をつけてやれば、作成日付情報もちゃんと移行できそうだった。gbookmark2delicious にちょこっと書き足して ADD_DATE attribute を Google Bookmarks から Delicious へコピーする(ただし、Google Bookmarks は micro second までの時間を使ってたから、下6桁を削除して秒単位までの数字をコピーした)ようにした上で再度実行したところ、今度こそ作成日時も正しく Delicious へコピーされた。で、多少どきどきしながら新しい Google Bookmarks アカウントで Delicious の import を実行したところ無事日時も正しくコピーされた。

この段階で、"delicious-export" という余計なタグが全部のブックマークについてること以外は、古いアカウントからの完璧なコピーができた。あとは、たんにそのタグを削除すればいんだろうと思い、「Manage labels」から "delicious-export" をさくっと削除して「できたできた」と悦に入ってたら、最後の落とし穴があった。なんとすべてのブックマークの日時がその時間になってしまった。つまり Google Bookmarks のブックマークについてる日時は作成日時じゃなくて変更日時なようだ。"delicious-export" を削除する、という変更をおこなうことによってすべてのブックマークの日時も変わってしまった。これじゃ一つ目の問題を解決した意味がぜんぜん無い。

いい加減心が折れそうになったけど、もう少しだけ検索したところ、今度は Delicious Export to Google Bookmarks UploaderGoogle Bookmarks API Guide を見つける。(ここで、Google Bookmarks の「Import Delicious Bookmarks」もこの API を使ってることを理解する) これがうまく動くようだったら「Import Delicious Bookmarks」を使わないで済むので "delicious-export" のタグの問題が発生しないんじゃないかと期待したが、そもそもこの JavaScript では日時はまったく考慮されてなかったので問題外だった。とはいえ、gbookmark2delicious の時と同じようにちょっと追加すればうまくいくんじゃないかと期待して、そもそもどういう値を追加すればいいのか調べるため、「Import Delicious Bookmarks」の最中に出てくる import を確認する画面(これからインポートするブックマークとタグのリストが表示されてる画面)のソースを覗いてみた。

すると、JSCON形式のブックマークのリスト(タイトル、URL、コメント、タグ、日時)を https://www.google.com/bookmarks/mark?op=upload に POST するような JavaScript のコードになってることが一目瞭然だった。しかも、タグの項にはにっくき "delicious-export" もばっちり含まれている。これだ!と思い、一旦 JavaScript のソースをファイルに保存、タグの項から "delicious-export" を削除した上でそのソースを再度ブラウザで読み込むと…、今度こそ本当に Voilà!完全なコピーの形で新しいアカウントへ Google Bookmarks をコピーできた。

簡単に(っても煩雑だけど)まとめると、
  1. gbookmark2delicious で古いアカウントから Delicious へコピーする (ただし、日時をコピーするのに一行追加が必要)
  2. "Unlabeled" というタグを Delicious 上で削除する
  3. 新しいアカウントで Google Bookmarks へログイン、「Import Delicious Bookmarks」を実行
  4. import の確認をする画面でソースを確認、そのまま一旦テキストファイルに保存する
  5. ソースをテキストエディタで開き "delicious-export" というタグを削除する (あと、.js ファイルの読み込みが相対パスになってるから、URL形式に変えとく)
  6. ブラウザでソースを開くと、自動的に再度 import を確認する画面へ遷移する

という感じで、古いGoogleアカウントから新しいGoogleアカウントへの Google Bookmarks のデータの完全なコピーができた。

どう考えても Google Bookmarks がこのまま存続していくとは思えない :-p

Closure ?

メモ

Ruby

def f
i = 0
return lambda {
i += 1
}
end

x = f
puts x.call()
puts x.call()
puts x.call()

Python 2.x

def f():
i = [0]
def g():
i[0] += 1
return i[0]
return g
x = f()
print x()
print x()
print x()

Python 3.x

def f():
i = 0
def g():
nonlocal i
i += 1
return i
return g

x = f()
print(x())
print(x())
print(x())

ちなみに、ジェネレータのおまけ

def f():
i = 0
while True:
i += 1
yield i

g = f()
print g.next()
print g.next()
print g.next()

PRIMORDIAL! v3.1 と戻し方

メモ

8.2.3.6 20110414 -> CWM_BLOB_V4
8.2.3.9 20110423 -> CWM_BLOB_V5
8.2.3.13 20110520
8.2.6.9 ?
8.4.4.5 20110527 (Honeycomb 3.1)

The Complete Guide: How To Fully Back Up And Restore Your Android Phone Using Nandroid Backup
http://androidfc.com/tips-tricks/the-complete-guide-how-to-fully-back-up-and-restore-your-android-phone-using-nandroid-backup/

How to set up ADB (Android Debug Bridge) in Mac OSX
http://esausilva.com/2010/10/02/how-to-set-up-adb-android-debug-bridge-in-mac-osx/

STOCK (8.2.3.9/8.2.3.13/8.4.4.5) to 3.1 (Primordial 3.1)
http://forum.xda-developers.com/showthread.php?t=1106587

AsusTransformer Root + CWM recovery
http://androidroot.mobi/asus-eee-pad-transformer-tf101-root-cwm-recovery/

Root Your Asus Eee Pad Transformer (TF101)
http://www.techhackz.com/2011/06/root-your-asus-eee-pad-transformer.html

http://forum.xda-developers.com/showpost.php?p=14250184&postcount=1
Instructions:
1. Copy ROM to sdcard
2. Verify the MD5 of the zip on the sdcard, DO NOT FLASH IF THIS DOESN'T MATCH THE MD5 UNDER THE DOWNLOAD LINK!
3. Boot into clockworkmod recovery
4. Take a nandroid backup (optional but highly recommended)
5. Install the ROM
6. Reboot and wait... The first boot may take a while...

http://forum.xda-developers.com/showpost.php?p=14352646&postcount=22
REVERT TO STOCK RECOVERY:
1) Download 8239usrecovery.zip from http://forum.xda-developers.com/showpost.php?p=14113508&postcount=14
2) Place zip on a microSD and insert into device
3) Boot into CWM, flash 8239USrecovery.zip from CWM and reboot

FLASH ORIGINAL 8239 ASUS FIRMWARE:
1) Download the original ASUS 8239 firmware from: http://dlcdnet.asus.com/pub/ASUS/EeePAD/TF101/UpdateLauncher_US_epad_user_8239.zip
2) Extract the 'ASUS/' folder from that zip onto a microSD card, and insert the microSD into the device
3) You should get a notification that an ASUS update is available. Just click it and it will reboot and load the stock rom.

Google Captcha

そういえば先日Googleで普通に検索してたらこんなメッセージが出てCAPTCHAを入力させられた。会社のNAT経由だったから、他の人が何かしてたのかな?

Google_Unusual_Traffic.png

Book2PDF

02/07 04:25pm EST ウェブから無料3冊お試しを申し込み (@スキャン)
02/07 11:50pm EST @スキャンから受付の返信 (送付先住所が分かる)
02/08 11:57am EST Amazon.co.jp で注文 (2冊はAmazonから発送。1冊は東大宮から。)
02/08 12:14pm EST @スキャンへ書籍の発送時期を連絡
02/08 09:31pm EST @スキャンから確認の返信
02/09 00:23am EST Amazon から1冊発送の連絡
02/09 02:46am EST 東大宮から1冊発送の連絡
02/09 11:43am EST Amazon から残り1冊発送の連絡
02/10 03:45am EST @スキャンからPDF化完了の通知
02/10 11:19am EST http://firestorage.jp/からZIPファイルをダウンロード (200MB/約10分)

ある本が欲しいと思い立ってから手に入る(読める状態になる)まで約66時間(3日弱)。しかも今回はスキャンも無料お試しだから余分な手数料もまったくなし。便利だなぁ…。

FairPlay

Deauthorization reminded me what iTunes DRM is.

FairPlay
http://ja.wikipedia.org/wiki/FairPlay
  • Authorize up to 5 computers
  • Authorize (able to sync to) unlimited number of iPhone/iPod
  • Able to create 7 CDs
Good part is you can sync to unlimited number of iPhone/iPod. (This means "authorized computers" don't include iPhone/iPod)

Apple iTunes deauthorization

While I repeat restoring my MacBook Pro from Time Machie (when machine went broken, when I tried to swap laptop with my wife, etc.) I consumed 5 DRM slot of iTunes. (I guess I consumed one slot with old Windows box before.)

iTunes-deauthorization1.png

I don't have immediate plan to "authorize" another machine but just decided to deauthorize all of them. There is an instruction on how to do that.

About iTunes Store authorization and deauthorization
http://support.apple.com/kb/ht1420

So, I went to iTunes Store through iTunes.app and clicked "Deauthorize All".

iTunes-deauthorization2.png

And again, "Deauthorize all computers".

iTunes-deauthorization3.png

Bang. Now all of them are deauthorized.

iTunes-deauthorization4.png

And I authorized my current laptop again and things work just fine.

Note: You can do this only once in a year.