Skip to content

Instantly share code, notes, and snippets.

View sssurvey's full-sized avatar
Javaing

Haomin sssurvey

Javaing
View GitHub Profile
@sssurvey
sssurvey / RoleOfNothing.kt
Last active October 14, 2021 02:25
The role of "Nothing" when dealing with generics and its use
interface Base<out A> {
fun someMethod(operation: (A) -> String): String
}
class Impl1<A>(val a: A): Base<A> { // could be a none empty node in linked list
override fun someMethod(operation: (A) -> String): String {
return "impl1 hahaha ${operation.invoke(a)}"
}
@sssurvey
sssurvey / Javascript.js
Created August 14, 2019 20:36
hide soft keyboard on Android WebView 1
function hide_soft_keyboard(input_box) {
input_box.addEventListener("click", function() {
input_box.blur(); // very important call
input_box.focus();// very important call x2
});
}
# Python 3 !!
# folder structures:
'''
haominshi@MacBook-Pro-de-Haomin:~/Desktop$ tree diff
diff
├── Android_xml_content.txt
├── Android_xml_key.txt
├── Android_xml_key_stylized.txt
├── android_string_sorted.txt
├── android_string_sorted_final.txt