h1, | |
h2, | |
h3, | |
h4, | |
h5, | |
h6, | |
p, | |
blockquote { | |
margin: 0; | |
padding: 0; |
Arvind Narayanan on Enterprise Software (Twitter Thread)
My university just announced that it’s dumping Blackboard, and there was much rejoicing. Why is Blackboard universally reviled? There’s a standard story of why "enterprise software" sucks. If you’ll bear with me, I think this is best appreciated by talking about… baby clothes!
There are two types of baby outfits. The first is targeted at people buying gifts. It's irresistible on the rack. It has no fewer than 18 buttons. At least 3 people are needed to get a screaming baby into it. It's worn once, so you can send a photo to the gifter, then discarded.
Other baby outfits are meant for parents. They’re marked "Easy On, Easy Off" or some such, and they really mean it. Zippers aren't easy enough so they fasten using MAGNETS. A busy parent (i.e. a parent) can change an outfit in 5 seconds, one handed, before rushing to work.
The point is, some produc
/** | |
* Use the number of seconds/10 since Jan 2020 as the versionCode. | |
* This lets us upload a new build at most every 10 seconds for the | |
* next 680 years. https://stackoverflow.com/a/38643838/1799007 | |
*/ | |
def generatedVersionCode = (int)(((new Date().getTime()/1000) - 1580319970) / 10) | |
**/ |
- Get favicons for a given url using this Duck Duck Go Tool: http://icons.duckduckgo.com/ip2/www.google.com.ico
- Here's another one
dependencies { | |
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0" | |
} |
class MyActivity : AppCompatActivity() { | |
private val model: MyViewModel by viewModels() | |
override fun onCreate(savedInstanceState: Bundle?) { | |
model.getUsers().observe(this, Observer<List<User>>{ users -> | |
// update UI | |
}) | |
} | |
} |
fun createWithFactory( | |
create: () -> ViewModel | |
): ViewModelProvider.Factory { | |
return object : ViewModelProvider.Factory { | |
override fun <T : ViewModel?> create(modelClass: Class<T>): T { | |
@Suppress("UNCHECKED_CAST")// Casting T as ViewModel | |
return create.invoke() as T | |
} | |
} | |
} |
private val model: MyViewModel by activityViewModels { | |
createWithFactory { | |
MyViewModel(repo = MyRepository()) | |
} | |
} |
/** | |
* Get a [ViewModel] in an [ComponentActivity]. | |
*/ | |
@MainThread | |
inline fun <reified VM : ViewModel> ComponentActivity.viewModelBuilder( | |
noinline viewModelInitializer: () -> VM | |
): Lazy<VM> { | |
return ViewModelLazy( | |
viewModelClass = VM::class, | |
storeProducer = { viewModelStore }, |