based on https://morningcoffee.io/stable-pagination.html.
In order for this to work I had to use uuidgen -t to generate time-based uuids otherwise the ordering would be messed up after 2-3 pages in.
sqlite3 pagination.dbbased on https://morningcoffee.io/stable-pagination.html.
In order for this to work I had to use uuidgen -t to generate time-based uuids otherwise the ordering would be messed up after 2-3 pages in.
sqlite3 pagination.db| @Composable | |
| fun ParallaxScreen(modifier: Modifier = Modifier) { | |
| val context = LocalContext.current | |
| val scope = rememberCoroutineScope() | |
| var data by remember { mutableStateOf<SensorData?>(null) } | |
| DisposableEffect(Unit) { | |
| val dataManager = SensorDataManager(context) | |
| dataManager.init() |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| class MainActivity : AppCompatActivity(R.layout.activity_main) { | |
| @Inject | |
| lateinit var viewModel: MainActivityViewModel | |
| private var isInitialised: Boolean = false | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) |
| class MainActivity : AppCompatActivity(R.layout.activity_main) { | |
| @Inject | |
| lateinit var viewModel: MainActivityViewModel | |
| @Inject | |
| lateinit eventChannel: ConflatedBroadcastChannel<MainActivityView.Event> | |
| private var isInitialised: Boolean = false |
| #!/bin/bash | |
| # Usage | |
| # chmod +x semverdiff.sh | |
| # Get diff between 1.0.0..1.0.1 | |
| # ./semverdiff 1.0.1 | |
| get_diff() { | |
| sed -n "/^## \[$1\]/,/^## /p" CHANGELOG.md | egrep "^(-|\s+)" | |
| } |
| import android.support.annotation.StringDef | |
| import android.text.Editable | |
| import android.text.TextWatcher | |
| import android.widget.EditText | |
| @StringDef(PHONE_9_MASK, PHONE_8_MASK, CPF_MASK, ZIP_CODE_PT_BR, MONTH_YEAR, CREDIT_CARD) | |
| @Retention(AnnotationRetention.SOURCE) | |
| annotation class MaskType | |
| const val PHONE_9_MASK = "(##) #####-####" |
| #!/bin/bash | |
| # Simple bash script runs adb to measure startup time of android apps | |
| trap ctrl_c INT | |
| time=() | |
| function ctrl_c() { | |
| total=0 |