Anniversaty Update(Build.14393)でAdaptive Toastにいくつか新機能が提供されているようです。
いままでの機能に加え、
- タイルと同じようにレイアウトの自由度が上がった
- Heroイメージを設定できるようになった
- 設定できるテキストの位置が増えた
- コンテキストメニューが拡張された
という具合です。あいかわらずNotificationチームはBlogでのみ情報提供な感じなんですかね…
Anniversaty Update(Build.14393)でAdaptive Toastにいくつか新機能が提供されているようです。
いままでの機能に加え、
という具合です。あいかわらずNotificationチームはBlogでのみ情報提供な感じなんですかね…
Teclastって中国メーカのTBook10ってタブレットがあって、Surface Bookみたいに2-in-1な感じでドックできる専用キーボードがあるんです。けどこれ、なんか不具合があったとかなんとかで発売が延期されてて海外のショップで在庫ある!っていって、問い合わせたらやっぱりないです。みたいなところばっかりでいったい本当にあるんだろうか…と思っていたんですが
日本で買えるところがあったので注文しました!8/22 2:00現在すでに在庫切れになってますが、前も在庫なしだったのでもしかするとそのうち復活するのかも。一応日本のサイトだからちゃんと在庫もってるはず……
MSDNの中に14393の変更点一覧があるんですけどいつも見失うのでリンクを書いておくだけのエントリです。
Aristeaで使えるフィルタ式のパーサとかとかそのへんをライブラリにまとめなおしました。Freesiaといいます。
ごくごく一部のテスタのみなさまにはFreesia版でじっくりテストを進めているところです。ですので、現時点でストアに公開されているやつはまだFreesia版ではないです。 Freesiaが導入されると、フィルタ式にLambda式とLinq likeなメソッド呼び出しがサポートされるようになります。つまり、次のようなフィルタが書けるようになります。
// 動画を含むツイートだけをとりだし extended_entities.media.any(x => x.type == 'video')
いままでだと、配列にたいするcontainsしか処理できなかったんですけど、これでLINQ的なのが呼べるので柔軟さがかなりあがりました。 たぶん、そのうちリリースするとおもいます。
UWPでOnSuspendingでファイルを保存するとかどうしても長いことかかることをしたいときにExtendedExecutionSessionというのでサスペンド時間を延長できます。結構便利なので頭の隅に置いておくといいと思います。
で、表題の件ですが、ExtendedExecutionSessionでサスペンド時間を延長して、その中でながーーーい処理をしているときにアプリがリジュームしてきて、さらにExtendedExecutionSessionのRevokedイベントで何もせず、ずっと長い処理を実行し続けて15秒ぐらい経過するとOnResumeに失敗してアプリが死にます。
ちゃんとまとめます。
GetDeferralしてからCompleteするまではOnResumeの実行がブロックされる。ようです。まぁいわれてみればその通りなんですが…。
OnResumeが来たときExtendedExecutionSessionのRevokedイベントが呼ばれます。なのでちゃんとOnResumeは検出できるわけです。 つまり、ここでいったんdeferralを終了してあげるとブロックされていたResume処理が実行されるのでアプリがりじゅーむできずに死ぬことはなくなります。が、サスペンド処理は適当にいい感じにする必要はあります。
とりあえずこういう感じで実装してそれなりに動いているようですが、これでいいのかよ感はあります。
var completed = false; extendedSession = new ExtendedExecutionSession(); extendedSession.Reason = ExtendedExecutionReason.SavingData; extendedSession.Revoked = (o, args) => { lock (this) { if (completed) return; completed = true; } deferral.Complete(); extendedSession?.Dispose(); extendedSession = null; });
WebAuthenticationBroker便利ですね。特定のURLになったらログイン完了とみなしてURL返してくれる素敵クラスです。
ところでこれ、特定のURLがhttpじゃない何かの時にWebAuthenticationOptions.UseTitle
つけると例外が無慈悲に飛んできます。5分も悩みました。
いまGoogle I/O 2016に参加してその帰りの飛行機の中です。United Airlinesの機内Wifiがつかえたのでせっかくだからいろいろ試してみました。
このエントリを書いた時点でこのあたりにいます。
まず、United_Wi-FiというSSIDに接続します。すると、172.19.248.0/23なIPが割り当てられます。まぁ乗客が300人程度なので512個あれば足りるはずですね。
とりあえずDNSひいてみたかんじ。
$ nslookup google.com Non-authoritative answer: Server: ns.unitedwifi.com Address: 172.19.248.1 DNS request timed out. timeout was 2 seconds. Name: google.com Address: 172.217.3.14 $ nslookup twitter.com Non-authoritative answer: Server: ns.unitedwifi.com Address: 172.19.248.1 Name: twitter.com Addresses: 199.16.156.70 199.16.156.6 199.16.156.102 199.16.156.230
正しい結果が得られるようです。なるほど。
Webページをリクエストしてみると、全部に対して302 foundが得られるみたいです。
$ curl google.com -v * Rebuilt URL to: google.com/ * timeout on name lookup is not supported * Trying 172.217.3.14... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to google.com (172.217.3.14) port 80 (#0) > GET / HTTP/1.1 > Host: google.com > User-Agent: curl/7.46.0 > Accept: */* > < HTTP/1.1 302 Found < Server: squid/3.4.6 < Mime-Version: 1.0 < Date: Sat, 21 May 2016 21:06:13 GMT < Content-Type: text/html < Content-Length: 0 < Location: http://www.unitedwifi.com < X-Squid-Error: 403 Access Denied < X-Cache: MISS from bc01 < Via: 1.1 bc01 (squid/3.4.6) < Connection: close < 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 * Closing connection 0 $ curl twitter.com -v * Rebuilt URL to: twitter.com/ * timeout on name lookup is not supported * Trying 199.16.156.70... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0* Connected to twitter.com (199.16.156.70) port 80 (#0) > GET / HTTP/1.1 > Host: twitter.com > User-Agent: curl/7.46.0 > Accept: */* > < HTTP/1.1 302 Found < Server: squid/3.4.6 < Mime-Version: 1.0 < Date: Sat, 21 May 2016 21:07:31 GMT < Content-Type: text/html < Content-Length: 0 < Location: http://www.unitedwifi.com < X-Squid-Error: 403 Access Denied < X-Cache: MISS from bc01 < Via: 1.1 bc01 (squid/3.4.6) < Connection: close < 0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0 * Closing connection 0
C:\>ping 172.19.248.1 Pinging 172.19.248.1 with 32 bytes of data: Reply from 172.19.248.1: bytes=32 time=8ms TTL=64 Reply from 172.19.248.1: bytes=32 time=12ms TTL=64 Reply from 172.19.248.1: bytes=32 time=6ms TTL=64 Reply from 172.19.248.1: bytes=32 time=16ms TTL=64 Ping statistics for 172.19.248.1: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 6ms, Maximum = 16ms, Average = 10ms
302 Foundで示されているURLへアクセスすると20ドル払えといわれます。
まぁせっかくなので払うとすべてのURLに302 Foundを返すあれがなくなってこうなりました。
$ curl twitter.com -v * Rebuilt URL to: twitter.com/ * timeout on name lookup is not supported * Trying 199.16.156.38... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0* Connected to twitter.com (199.16.156.38) port 80 (#0) > GET / HTTP/1.1 > Host: twitter.com > User-Agent: curl/7.46.0 > Accept: */* > < HTTP/1.1 301 Moved Permanently < content-length: 0 < date: Sat, 21 May 2016 21:12:52 GMT < location: https://twitter.com/ < server: tsa_b < x-connection-hash: 8cf7ac5f78c055ca55106e70cb0b3426 < x-response-time: 3 < Connection: Keep-Alive < Set-Cookie: guest_id=v1%3A146386517242165290; Domain=.twitter.com; Path=/; Expires=Mon, 21-May-2018 21:12:52 UTC < 0 0 0 0 0 0 0 0 --:--:-- 0:00:06 --:--:-- 0 * Connection #0 to host twitter.com left intact
衛星経由なのでPINGはかなり遅め。まぁしかたない。
>ping 8.8.8.8 Pinging 8.8.8.8 with 32 bytes of data: Request timed out. Reply from 8.8.8.8: bytes=32 time=745ms TTL=51 Reply from 8.8.8.8: bytes=32 time=799ms TTL=51 Reply from 8.8.8.8: bytes=32 time=921ms TTL=51 Ping statistics for 8.8.8.8: Packets: Sent = 4, Received = 3, Lost = 1 (25% loss), Approximate round trip times in milli-seconds: Minimum = 745ms, Maximum = 921ms, Average = 821ms
速度は…まぁTwitterぐらいならできるんじゃないですかね