This file contains hidden or 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
class CombinedLiveData<T, K, S>(source1: LiveData<T>, source2: LiveData<K>, private val combine: (data1: T?, data2: K?) -> S) : MediatorLiveData<S>() { | |
private var data1: T? = null | |
private var data2: K? = null | |
init { | |
super.addSource(source1) { | |
data1 = it | |
value = combine(data1, data2) | |
} |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/utsname.h> | |
int main(int argc, char *argv[]) { | |
struct utsname *_system_ = malloc(sizeof(struct utsname)); | |
uname(_system_); | |
if(argc==2 && | |
(strcmp(argv[1], "version")==0 | |
|| strcmp(argv[1],"VERSION" ) == 0)) |