カテゴリー: Programing
UbuntuにPythonコマンドが無い場合
WSL上のUbuntuにpythonコマンドがありませんでした。 $ ls -l /usr/bin/python lrwxrwxrwx 1 root root 9 3月 13 2020 /usr/bin/python3 … &8220;UbuntuにPythonコマンドが無い場合&8221; の続きを読む
AndroidStudioのエミュレーターが調子悪くなったら
AndroidStudioのエミュレーターが調子悪くなりました。 AndroidStudioのメニューアイコンから再起動しようと思っても何も反応せず、パソコンを再起動しても変わりませんでした。 この場合は、次のようにして … &8220;AndroidStudioのエミュレーターが調子悪くなったら&8221; の続きを読む
[Kotlin] JavaからKotlinを呼び出す
※翻訳がわかりにくい場合は原文を読んでください。 KotlinコードはJavaから簡単に呼び出すことができます。 プロパティ Kotlinプロパティは、次のJava要素にコンパイルされます。 get接頭辞を前置することに … &8220;[Kotlin] JavaからKotlinを呼び出す&8221; の続きを読む
[Swift] GCD関連 [Swift4対応]
キューの作成 (Swift2まで) let queue1 = dispatch_queue_create("arrayQ", DISPATCH_QUEUE_SERIAL) let queue2 = d … &8220;[Swift] GCD関連 [Swift4対応]&8221; の続きを読む
[Swift][Error]Argument labels ‘(_:)’ do not match any available overloads
・エラーメッセージ Argument labels ‘(_:)’ do not match any available overloads ・エラー例 let num = 3 var nsnum = NSNumber(n … &8220;[Swift][Error]Argument labels &8216;(_:)&8217; do not match any available overloads&8221; の続きを読む
[Swift] Swift3で対象範囲を指定して配列内の要素を削除する
ArrayクラスのremoveSubrangeメソッドを使うと以下のように削除することが出来ます。 var t = [“zero”, “one”, “two”, “three”, “four”] t.removeSubr … &8220;[Swift] Swift3で対象範囲を指定して配列内の要素を削除する&8221; の続きを読む
[Swift] Swift3でArrayにremoveObjectを実装する
NSArrayにはremoveObjectというインデックスではなくオブジェクトを指定して配列内の該当する要素を削除するメソッドがあります。 同じものがSwiftのArrayにもあるかと思ったのですが無く困ってましたが、 … &8220;[Swift] Swift3でArrayにremoveObjectを実装する&8221; の続きを読む
[Swift][Error] Value of type ‘[*]’ has no member ‘*’
・エラーメッセージ Value of type ‘[]’ has no member ‘’ ・エラー例 var x:[Int] = [1,2,3] if x.containsObject(2) { print(“x co … &8220;[Swift][Error] Value of type &8216;[]&8217; has no member &8216;&8217;&8221; の続きを読む
[Swift][Error] Cannot assign value of type ‘[AnyObject]’ to type *
・エラーメッセージ Cannot assign value of type ‘[AnyObject]’ to type ・エラー例 var x:[Int] var y:[AnyObject] = [1,2,3] x … &8220;[Swift][Error] Cannot assign value of type &8216;[AnyObject]&8217; to type &8221; の続きを読む
[Swift][Error] Can’t convert value of type * to expected argument type *
・エラーメッセージ Can’t convert value of type to expected argument type ・エラー例 var y:Double var x:Int = 10 y = 10 + … &8220;[Swift][Error] Can&8217;t convert value of type to expected argument type &8221; の続きを読む