This file contains 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
{ | |
"page":1, | |
"results":[ | |
{ | |
"poster_path":"\/fYzpM9GmpBlIC893fNjoWCwE24H.jpg", | |
"adult":false, | |
"overview":"Thirty years after defeating the Galactic Empire, Han Solo and his allies face a new threat from the evil Kylo Ren and his army of Stormtroopers.", | |
"release_date":"2015-12-18", | |
"genre_ids":[ | |
28, |
This file contains 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
public class SimpleObserver extends ContentObserver { | |
private static final String LOG_TAG = SimpleObserver.class.getSimpleName(); | |
public SimpleObserver(Handler handler) { | |
super(handler); | |
} | |
@Override | |
public void onChange(boolean selfChange) { | |
this.onChange(selfChange, null); |
This file contains 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
// hello 你好 | |
// hello 浣犲ソ | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; |
This file contains 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
static class MyHandler extends Handler { | |
private final WeakReference<MyActivity> mRef; | |
MyHandler(MyActivity activity) { | |
mRef = new WeakReference<HomeActivity>(activity); | |
} | |
@Override | |
public void handleMessage(Message msg) { | |
MyActivity activity = mRef.get(); |
This file contains 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
public class Singleton { | |
private Singleton() {} | |
private static class Holder { | |
private static final Singleton INSTANCE = new Singleton(); | |
} | |
public static Singleton getInstance() { | |
return Holder.INSTANCE; | |
} |
This file contains 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
abstract class EnumConverter<in V, E: Enum<E>>( | |
private val valueMap: Map<V, E> | |
) { | |
fun fromValue(value: V): E? = valueMap[value] | |
fun fromValue(value: V?, default: E): E = valueMap[value] ?: default | |
} | |
inline fun <V, reified E: Enum<E>> buildValueMap(keySelector: (E) -> V): Map<V, E> = | |
enumValues<E>().associateBy(keySelector) |
This file contains 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
version: '3.7' | |
services: | |
es01: | |
image: docker.elastic.co/elasticsearch/elasticsearch:7.0.1 | |
container_name: es01 | |
environment: | |
- node.name=es01 | |
- cluster.name=docker-es-cluster | |
- discovery.type=single-node | |
- bootstrap.memory_lock=true |