以下、どっちがいいか。
void setScore(int score) {
this.score = score;
}
void setScore(int score) {
mScore = score;
}
もう、ええわ。
ありがとうございました。
Does Android team starts to abandon Hungarian Notation? : androiddev
以下、どっちがいいか。
void setScore(int score) {
this.score = score;
}
void setScore(int score) {
mScore = score;
}
もう、ええわ。
ありがとうございました。
Does Android team starts to abandon Hungarian Notation? : androiddev
実際に罫線で書いてみる。
┃┃┃┃┃┃┃┃┃┃┃┃┃┃┃┃┃┃┃┃
┃┣┫┃┃┃┃┃┣┫┣┫┃┃┃┃┃┣┫┃
┣┫┣┫┃┃┃┃┣┫┣┫┣┫┃┣┫┃┣┫
┃┃┃┃┃┃┃┃┣┫┃┃┃┃┃┃┃┃┣┫
┣┫┣┫┣┫┣┫┣┫┣┫┣┫┣┫┣┫┣┫
┃┃┃┣┫┃┃┃┃┃┣┫┃┣┫┃┃┣┫┃
┃┃┃┃┣┫┃┃┃┣┫┃┃┃┃┃┣┫┃┃
┃┣┫┃┃┃┣┫┃┃┃┃┃┣┫┃┃┣┫┃
┣┫┣┫┃┃┣┫┃┃┃┣┫┣┫┃┃┃┃┃
┣┫┃┃┃┃┃┣┫┃┃┃┃┃┃┃┃┣┫┃
書いてみて分かるのは、
「┣┫」と「┃」
の二種類の文字列の組み合わせだけで構成されているということ。
Kotlinで。
val n = 20
val l = 10
repeat(l) {
val ch = (0..n/2).shuffled().first()
val ci = n - (ch * 2)
val h = List(ch) { "┣┫" }
val i = List(ci) { "┃" }
val a = h.plus(i).shuffled()
println(a.joinToString(""))
}
一つの「きまりごと」を発見するとコードは劇的に短くなる。
分岐がないコードはスッキリする。
jitpack で配布しているライブラリに不必要な怪しい通信処理を入れて
Bintray -> jcenter() 経由で同じアーティファクトidで配布してる「Jake Whaarton」さん。
これは、神と呼ばれるJakeWarthonさんの偽物です。
Jake Wharthon → 本物
Jake Whaarton → 偽物
少し話題になってましたね。

A Confusing Dependency : androiddev
JitPackで配流しているライブラリと同じidのマルウェア入りアーティファクトがjcenterにあってそれが使われたという件。 / “A Confusing Dependency” https://t.co/cY3at8ZIzh
— FUJI Goro (@__gfx__) 2018年12月13日
すると、本物JakeさんのTwitterが!!

Jake Whaarton(@JakeWharton)さん | Twitter
なりすましてます、本物が偽物に。
この話を、解説しています。
Artifact integrity verification aside, not only should jcenter() always be last, but you need to put mavenCentral() before them. JCenter and Bintray keep proving they're not a trustworthy artifact host. Ideally you fetch nothing from them.https://t.co/5R6qS2cxQv
— Jake Whaarton (@JakeWharton) 2018年12月13日
アーティファクトの整合性の話は別にして、jcenter() を常に最後に置くだけでなく、mavenCentral() をそれらの前に置くことも必要です。
JCenter と Bintray は、信頼できるアーティファクトホストではありません。理想的なのはそれらから何も取得しないことです。
上から読んでいくリポジトリ群指定の最下位にオープンすぎる jcenter() を置くべし、と言っています。
repositories {
//...
mavenCentral()
jcenter()
}
しかし、ワロタ。
android - Why does the Google maven repository exist and when should I use it? - Stack Overflow
If your app is targeting API level 28 (Android 9.0) or above, you must include the following declaration within the
element of AndroidManifest.xml.
対策は以下。AndroidManifest.xml。
<application ...
....
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
Project Configuration | Maps SDK for Android | Google Developers
今回は、GoogleMap SDK vs API-28(9.0/Pie) だったけど、他でも出そうで、使えそう。
これ、
文法的なカラーリングが効かなくなる。

この記述以降が壊れる。
AttributeSet?

これって、以前からじゃなく、最近の話だよね?
直ってる。

TestSyntaxColors.kt