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(args: Array<String>) { | |
try { | |
print("Nilai 1: ") | |
val nilai1 = readLine()?.toInt() | |
print("Nilai 2: ") | |
val nilai2 = readLine()?.toInt() | |
println("1. Tambah") | |
println("2. Kurang") | |
println("3. Kali") |
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
class BookAgent(private val bookService: BookService) : Thread() { | |
override fun run() { | |
val uuid = UUID.randomUUID().toString() | |
for (n in 0..10) { | |
sleep(5000) | |
bookService.save( | |
BookDataRequestModel( | |
name = "Book $uuid version: $n", | |
excerpt = "excerpt", |
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
class DiffCallback : DiffUtil.Callback() { | |
private var oldList: List<Any> = emptyList() | |
private var newList: List<Any> = emptyList() | |
fun setList(oldList: List<Any>, newList: List<Any>) { | |
this.oldList = oldList | |
this.newList = newList | |
} |
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 | |
# COMMON KOTLIN | |
-dontnote kotlin.** | |
-dontwarn kotlin.** | |
-keepclassmembernames class kotlinx.** { | |
volatile <fields>; | |
} | |
-dontnote kotlinx.** | |
-keep class kotlinx.coroutines.** | |
# retrofit |
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
echo "========== Hook: Run Maven Test ==========" | |
# run maven test | |
mvn clean test | |
if [ $? -ne 0 ]; then | |
echo "========= Hook: Error While Testing The Code ==========" | |
exit 1 | |
fi |
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 java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
public class BalanceBrackets { | |
public static void main(String[] args) { | |
String message = "([])(){}(())()()"; | |
String message2 = "()()[{()})]"; | |
String message3 = "[(])"; |
OlderNewer