- Android は 1.0 からずっとJava6。Goのような言語になる感じもしない
- Java6は1ラインでかけないことが多い。Java8ならできるけど、Java8はいつでるかわからない。
- Kotlinなら今でも1ラインでかける
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # cleanup-versions - ローカルの言語/ツールバージョンを一覧化し、未使用分を対話的に削除 | |
| # | |
| # Usage: | |
| # cleanup-versions # 一覧表示のみ(安全) | |
| # cleanup-versions --clean # 未使用バージョンの対話的削除(1つずつ確認) | |
| # cleanup-versions --clean-all # 未使用バージョンを一括削除 | |
| # | |
| # Environment: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // databindingの @Nullable を @NonNull に置換 | |
| // FIXME: DataBinding3.0.0で@NonNull,@Nullableが付与してくれるようになったが、修正範囲が大きいため、一時的に@Nullableを@NonNullとして扱うように・・・ | |
| task replaceJava { | |
| doLast { | |
| println ':replaceJava#Batabinding' | |
| def dir = "build/generated/source/kapt" | |
| def pack = "jp/xxx/databinding" | |
| for (String type : ["developDebug", "developRelease", "productionRelease", "productionDebug"]) { | |
| try { | |
| ant.replaceregexp(match: '@Nullable', replace: '@NonNull', flags: 'g', byline: true) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2011-08-01"> | |
| <Items> | |
| <Item> | |
| <ASIN>B00SKQWBFS</ASIN> | |
| </Item> | |
| </Items> | |
| </ItemSearchResponse> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private fun doRequest(url: String) { | |
| // API呼び出し | |
| val request = Request.Builder().url(url).build(); | |
| val client = OkHttpClient() | |
| client.newCall(request).enqueue(object : Callback { | |
| override fun onResponse(response: com.squareup.okhttp.Response) { | |
| val xml = response.body().string() | |
| try { | |
| // XMLのパース(XPath) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| create_imagesets() { | |
| for file in * ; do | |
| if [ -f $file ] ; then | |
| file_base=${file%.*} | |
| imageset_base=${file_base%~iphone} | |
| imageset_base=${file_base%~ipad} | |
| imageset_base=${imageset_base%@2x} | |
| dir=$imageset_base".imageset" |