This file contains 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
fun main() { | |
val list = 0..<20 | |
// https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/windowed.html | |
println(list.windowed(4,4)) | |
// [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11], [12, 13, 14, 15], [16, 17, 18, 19]] | |
} |
This file contains 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
import org.json.JSONObject | |
import java.net.HttpURLConnection | |
import java.net.URL | |
import java.text.SimpleDateFormat | |
import java.util.* | |
fun main() { | |
fetchConnpassEventList().sortedBy { it.startedAt }.forEach { | |
val output = "${it.startedAt.format()}\t=HYPERLINK(\"${it.eventUrl}\",\"${it.title}\")" | |
println(output) |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.google.android.apps.gddquiz" | |
android:versionCode="1" | |
android:versionName="1.0"> | |
<uses-sdk android:minSdkVersion="4" /> | |
<application | |
android:icon="@drawable/icon" | |
android:label="@string/app_name"> |
This file contains 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
// import は省略 | |
public class MainActivity extends Activity { | |
TextView mTextView; | |
Button mButton; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
mTextView = (TextView) findViewById(R.id.hello); |
This file contains 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
package com.google.android.apps.gddquiz; | |
interface IQuizService { | |
String getCode(); | |
} |
This file contains 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
@ExperimentalComposeUiApi | |
@Composable | |
fun QrHistoryScreen( | |
viewModel: QrHistoryViewModel, | |
) { | |
val list by viewModel.qrHistoryFlow.collectAsState() | |
val query by viewModel.query.collectAsState() | |
viewModel.onLoad() |
This file contains 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
package coroutine.flow | |
import kotlinx.coroutines.* | |
import kotlinx.coroutines.channels.awaitClose | |
import kotlinx.coroutines.channels.sendBlocking | |
import kotlinx.coroutines.flow.Flow | |
import kotlinx.coroutines.flow.callbackFlow | |
import kotlinx.coroutines.flow.collect | |
@ExperimentalCoroutinesApi |
This file contains 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/bash | |
set -ex | |
aapt2=`$ANDROID_HOME/build-tools/30.0.2/aapt2` | |
# aabからversionNameを得る | |
# https://www.nuomiphp.com/eplan/ja/5f10e6a5ac168365ea739083.html | |
#unzip -p app/build/outputs/bundle/release/app-release.aab base/manifest/AndroidManifest.xml > AndroidManifest.xml | |
unzip -p app/build/outputs/bundle/debug/app-debug.aab base/manifest/AndroidManifest.xml > AndroidManifest.xml | |
zip proto_version.apk AndroidManifest.xml |
This file contains 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 Rect.rotateRect(degree:Float): Rect { | |
val rectF = this.toRectF() | |
val matrix = Matrix() | |
matrix.setRotate(degree, rectF.centerX(), rectF.centerY()) | |
matrix.mapRect(rectF) | |
return rectF.toRect() | |
} |
This file contains 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
// kotlin 1.3.31 | |
// MyClass.java | |
package inline; | |
import kotlin.Metadata; | |
import org.jetbrains.annotations.NotNull; | |
import org.jetbrains.annotations.Nullable; | |
@Metadata( |
NewerOlder