iOSのUpdateでAUX-Lightningの3rd Party製品が利用できなくなった!!

以下のものを使っていましたが、なんとiOSのupdateで利用できなくなってしまいました。
 
ライトニングのイヤホンジャック・USB 2in1ケーブルを買ってみた - rochefort’s blog
 
 
数秒間は認識しますが、すぐに「このアクセサリは使用できません」というメッセージが表示され、認識しなくなります。

どうやら

MFi (Made For iPhone/iPad/iPod) 認証というものが原因のようで、10.3以降有効になったようです。
MFi Program - Apple Developer
要はAppleの承認が必要。
 

4$または販売価格の10%

というなかなか強気の価格。
安全性に問題があるような3rd party製品ならともかく、AUX(イヤホンジャック) - Lightningのアダプタごときでこれはいかがなものかという気がします。
しかも、iOSのupdateでこれまで使えていたものが使えなくなるという。。。  

仕方ないので

純正品をApple Storeで購入。
 
現時点では、AmazonでMFi取得済み製品は純正のものより高いです。
これで1500円ぐらい。

Testing(CodeEval)

文字列の差を求める問題。

CHALLENGE DESCRIPTION:

In many teams, there is a person who tests a project, finds bugs and errors, and prioritizes them. Now, you have the unique opportunity to try yourself as a tester and test a product. Here, you have two strings - the first one is provided by developers, and the second one is mentioned in design. You have to find and count the number of bugs, and also prioritize them for fixing using the following statuses: ‘Low’, ‘Medium’, ‘High’, ‘Critical’ or ‘Done’.

INPUT SAMPLE:

The first argument is a path to a file. Each line includes a test case with two strings separated by a pipeline ‘|’. The first string is the one the developers provided to you for testing, and the second one is from design.

Heelo Codevval | Hello Codeeval
hELLO cODEEVAL | Hello Codeeval
Hello Codeeval | Hello Codeeval

OUTPUT SAMPLE:

Write a program that counts the number of bugs and prioritizes them for fixing using the following statuses:
‘Low’ - 2 or fewer bugs;
‘Medium’ - 4 or fewer bugs;
‘High’ - 6 or fewer bugs;
‘Critical’ - more than 6 bugs;
‘Done’ - all is done;

Low
Critical
Done

CONSTRAINTS:

  1. Strings are of the same length from 5 to 40 characters.
  2. Upper and lower case matters.
  3. The number of test cases is 40.

My Code

#!/usr/bin/env ruby -w

def test(actual, expected)
  wrong_count = 0
  expected.size.times { |i| wrong_count += 1 unless actual[i] == expected[i] }
  case
  when wrong_count == 0 then "Done"
  when wrong_count <= 2 then "Low"
  when wrong_count <= 4 then "Medium"
  when wrong_count <= 6 then "High"
  else "Critical"
  end
end

ARGF.each_line do |line|
  actual, expected = line.chomp.split(" | ").map { |l| l.split("") }
  puts test(actual, expected)
end

gem-search を完全一致で検索できるように修正

rubygemのダウンロード件数を表示するツール。
rochefort/gem-search: search gems with using rubygems.org API

Rubygems APIの仕様のため、部分一致検索しかできなくて不便だなと以前から思っていたので
完全一致で検索できるように修正しました。(gem search は正規表現で検索可能)
-e オプションでできるようにしています。

$ gem-search -e rails
Searching .
NAME                                                DL(ver)   DL(all) HOMEPAGE
-------------------------------------------------- -------- --------- ------------------------------------------------------------
rails (5.0.2)                                        605263  93503475 http://rubyonrails.org