- Markdown style
[](https://youtu.be/nTQUwghvy5Q)
- HTML style
<a href="http://www.youtube.com/watch?feature=player_embedded&v=nTQUwghvy5Q" target="_blank">
import android.Manifest | |
import android.app.AppOpsManager | |
import android.app.usage.StorageStats | |
import android.app.usage.StorageStatsManager | |
import android.content.Context | |
import android.content.Intent | |
import android.content.pm.PackageManager | |
import android.os.Build | |
import android.os.Bundle | |
import android.os.Process |
import kotlinx.serialization.json.JsonArray | |
import kotlinx.serialization.json.JsonElement | |
import kotlinx.serialization.json.JsonNull | |
import kotlinx.serialization.json.JsonObject | |
import kotlinx.serialization.json.JsonPrimitive | |
fun Any?.toJsonElement(): JsonElement { | |
return when (this) { | |
is Number -> JsonPrimitive(this) | |
is Boolean -> JsonPrimitive(this) |
import sys | |
import anthropic | |
from dotenv import load_dotenv | |
load_dotenv() | |
client = anthropic.Anthropic() | |
prompt_template = """ | |
Please review and edit the following text to ensure it is grammatically correct, clear, and concise. Aim to maintain a casual tone without being overly informal. Provide suggestions for improvement and explain any changes you make. Do not add double quotes in you rewrite answer. Answer in direct response. |
Program Konversi Suhu | |
===================== | |
Silakan pilih di bawah ini | |
1. Celcius ke Fahrenheit | |
2. Celcius ke Reamur | |
3. Celcius ke Kelvin | |
===================== | |
Masukkan Menu di atas [1,2,3] | |
1 |
fun <T, B> createJsonRpcService(service: Class<T>, | |
client: JsonRpcClient<B>, | |
resultDeserializer: Deserializer<B>, | |
logger: (String) -> Unit = {}): T { | |
val classLoader = service.classLoader | |
val interfaces = arrayOf<Class<*>>(service) | |
val invocationHandler = createInvocationHandler(service, client, resultDeserializer, logger) | |
@Suppress("UNCHECKED_CAST") |
To me, legacy code is simply code without tests. I’ve gotten some grief for this definition. What do tests have to do with whether code is bad? To me, the answer is straightforward, and it is a point that I elaborate throughout the book: Code without tests is bad code. It doesn’t matter how well written it is; it doesn’t matter how pretty or object-oriented or well-encapsulated it is. With tests, we can change the behavior of our code quickly and verifiably. Without them, we really don’t know if our code is getting better or worse.
Four Reasons to Change Software: For simplicity’s sake, let’s look at four primary reasons to change software.
import org.junit.Test; | |
import java.util.concurrent.TimeUnit; | |
import rx.Observable; | |
import rx.Scheduler; | |
import rx.functions.Func1; | |
import rx.observers.AssertableSubscriber; | |
import rx.schedulers.TestScheduler; |
Requirements:
Device should be a rooted (simulator’s are rooted by default)
adbd should be started as root. (Rub command: adb root
)
Now, send local push message using command:
import org.json.JSONObject; | |
import java.io.IOException; | |
import io.branch.referral.network.BranchRemoteInterface; | |
import okhttp3.MediaType; | |
import okhttp3.OkHttpClient; | |
import okhttp3.Request; | |
import okhttp3.RequestBody; | |
import okhttp3.Response; |