Thread pools on the JVM should usually be divided into the following three categories:
- CPU-bound
- Blocking IO
- Non-blocking IO polling
Each of these categories has a different optimal configuration and usage pattern.
public class DumbViewHolder extends RecyclerView.ViewHolder { | |
TextView textTitle; | |
TextView textLocation; | |
TextView textDate; | |
ImageView mapIcon; | |
public DumbViewHolder(View itemView) { | |
super(itemView); | |
textTitle = (TextView) itemView.findViewById(R.id.text_title); | |
textLocation = (TextView) itemView.findViewById(R.id.text_location); |
package statemachine | |
import debug | |
import fail | |
import io.reactivex.Observable | |
import kotlinx.coroutines.experimental.channels.Channel | |
import kotlinx.coroutines.experimental.channels.produce | |
import kotlinx.coroutines.experimental.delay | |
import kotlinx.coroutines.experimental.launch | |
import kotlinx.coroutines.experimental.runBlocking |
-- When SQLite is compiled with the JSON1 extensions it provides builtin tools | |
-- for manipulating JSON data stored in the database. | |
-- This is a gist showing SQLite return query data as a JSON object. | |
-- https://www.sqlite.org/json1.html | |
-- An example table with some data | |
CREATE TABLE users ( | |
id INTEGER PRIMARY KEY NOT NULL, | |
full_name TEXT NOT NULL, | |
email TEXT NOT NULL, |
Docker on BTRFS is very buggy and can result in a fully-unusable system, in that it will completely butcher the underlying BTRFS filesystem in such a way that it uses far more disk space than it needs and can get into a state where it cannot even delete any image, requiring one to take drastic actions up to and including reformatting the entire affected BTRFS root file system.
According to the official Docker documentation:
btrfs requires a dedicated block storage device such as a physical disk. This block device must be formatted for Btrfs and mounted into /var/lib/docker/.
In my experience, you will still run into issues even if you use a dedicated partition. No, it seems it requires a standalone
/** | |
* Navigates only if this is safely possible; when this Fragment is still the current destination. | |
*/ | |
fun Fragment.navigateSafe( | |
@IdRes resId: Int, | |
args: Bundle? = null, | |
navOptions: NavOptions? = null, | |
navigatorExtras: Navigator.Extras? = null | |
) { | |
if (mayNavigate()) findNavController().navigate( |
import androidx.compose.runtime.* | |
import kotlinx.coroutines.CoroutineScope | |
@Stable | |
internal class Event<T>(val value: T) | |
class MutableEventQueue<T> | |
internal constructor(): EventQueue<T>() { | |
private val events = mutableListOf<Event<T>>() | |
private val nextEventAsState = mutableStateOf<Event<T>?>(null) |
/* | |
Copyright 2020 Cedric Kring. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, |
import android.graphics.Matrix | |
import android.os.Bundle | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.compose.animation.core.LinearEasing | |
import androidx.compose.animation.core.RepeatMode | |
import androidx.compose.animation.core.animateFloat | |
import androidx.compose.animation.core.infiniteRepeatable | |
import androidx.compose.animation.core.rememberInfiniteTransition | |
import androidx.compose.animation.core.tween |