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
| { | |
| "location": "Ho Chi Minh City", | |
| "forecast": [ | |
| { | |
| "date": "2024-09-25", | |
| "temperature": { | |
| "high": 33, | |
| "low": 26 | |
| }, | |
| "conditions": "Partly Cloudy", |
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
| @file:Suppress("BlockingMethodInNonBlockingContext") | |
| package features.file.download | |
| import android.content.Context | |
| import androidx.hilt.Assisted | |
| import androidx.hilt.work.WorkerInject | |
| import androidx.lifecycle.Observer | |
| import androidx.work.Constraints | |
| import androidx.work.CoroutineWorker |
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
| Academic/Background | |
| ------------------------------------------------------------------------------------------------------------ | |
| Software Architecture, Perspectives on an emerging discipline - Mary Shaw, David Garlan | |
| Introduction / Practice within Business | |
| ------------------------------------------------------------------------------------------------------------ | |
| Software Architecture in Practice - Len Bass, Paul Clements, Rick Kazman | |
| In depth handbook for reaching requirements | |
| ------------------------------------------------------------------------------------------------------------ |
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
| package mobi.toan.etc | |
| import android.text.SpannableStringBuilder | |
| import android.text.Spanned.SPAN_INCLUSIVE_EXCLUSIVE | |
| import java.util.* | |
| /** | |
| Kotlin's version of Thuss from Jake Wharton | |
| **/ |
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
| fun main(args: Array<String>) { | |
| val result = mutableListOf<Pair<Long, Long>>() | |
| repeat(100) { | |
| result.add(task()) | |
| } | |
| println("====================") | |
| println("LIST TIME (ns) || SEQUENCE TIME (ns)") | |
| result.forEach { | |
| println(" ${it.first} || ${it.second} || delta ${it.first - it.second} ") | |
| } |
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
| /** | |
| * Executes the given [block] and returns elapsed time in nanoseconds. | |
| */ | |
| public inline fun measureNanoTime(block: () -> Unit): Long { | |
| val start = System.nanoTime() | |
| block() | |
| return System.nanoTime() - start | |
| } |
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
| fun main(args: Array<String>) { | |
| val seq = listOf("a", "ba", "cda", "def") | |
| val listFilter1 = seq.filter { | |
| it.length > 1 | |
| } | |
| println(listFilter1) // [ba, cda, def] | |
| val listFilter2 = listFilter1.filter { | |
| it.length > 2 |
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
| fun main(args: Array<String>) { | |
| val seq = sequenceOf("a", "ba", "cda", "def") | |
| val filter1 = seq.filter { | |
| it.length > 1 | |
| } | |
| println(filter1) // kotlin.sequences.FilteringSequence@28a418fc | |
| val filter2 = filter1.filter { | |
| it.length > 2 |
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
| adb shell settings put global window_animation_scale 0.0 | |
| adb shell settings put global transition_animation_scale 0.0 | |
| adb shell settings put global animator_duration_scale 0.0 | |
| adb shell settings put secure show_ime_with_hard_keyboard 0 | |
| adb shell am broadcast -a com.android.intent.action.SET_LOCALE --es com.android.intent.extra.LOCALE EN |
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
| fun f(x: Int): Int { | |
| var cur = x + 1 | |
| while (cur % 10 == 0) cur /= 10 | |
| return cur | |
| } |
NewerOlder