$ paths=( $(find . -regex '.*/AndroidManifest.xml') )
$ echo ${paths[0]} # element 0
$ echo ${paths[1]} # element 1
$ echo ${paths[@]} # flatmap
def tags = "git -C ${rootDir} tag".execute().text.trim() | |
def numTags = tags.tokenize('\n').size() | |
// Fetch the version according to git latest tag and "how far are we from last tag" | |
def longVersionName = "git -C ${rootDir} describe --tags --long".execute().text.trim() | |
def (fullVersionTag, versionBuild, gitSha) = longVersionName.tokenize('-') | |
def(versionMajor, versionMinor, versionPatch) = fullVersionTag.tokenize('.') | |
// Set the version name | |
versionName "$versionMajor.$versionMinor.$versionPatch" |
/** | |
* Compare two {@code double} values | |
* @param a some <i>double</i> value | |
* @param b some other <i>double</i> value | |
* @return {@code true} if the two values are equal | |
*/ | |
public static boolean equals (final double a, final double b) { | |
if (a==b) return true; | |
return Math.abs(a - b) < EPSILON; //EPSILON = 0.0000001d | |
} |
import com.google.auto.value.AutoValue; | |
/** | |
* | |
*/ | |
@AutoValue | |
public abstract class PseudoEnum { | |
public static PseudoEnum MONDAY() { | |
return new AutoValue_PseudoEnum(0); |
apply plugin: 'com.android.application' | |
apply plugin: 'kotlin-android' | |
apply plugin: 'me.tatarka.retrolambda' | |
buildscript { | |
ext.kotlin_version = '1.0.0-beta-4584' | |
ext.android_support_lib_version = '23.1.1' | |
ext.retrolambda_version = '3.2.4' | |
repositories { | |
jcenter() |
package com.github.mitchwongho.android.beacon.database.rx; | |
import android.content.Context; | |
import android.support.annotation.NonNull; | |
import io.realm.Realm; | |
import io.realm.RealmChangeListener; | |
import io.realm.RealmObject; | |
import io.realm.RealmResults; | |
import rx.Observable; |
# Setting Up ExpressVPN (OpenVPN) On OSMC | |
## References | |
- [Brian Hornsby' Kodi OpenVPN plugin](http://brianhornsby.com/blog/how-to-setup-your-vpn-client) | |
- [Install and Configure OpenVPN on OSMC/Kodi](https://nerddrivel.com/2016/03/25/install-and-configure-openvpn-on-osmckodi/) | |
- [ExpressVPN - High speed, ultra secure, and easy to use. Instant setup.](https://www.expressvpn.com/) | |
- [[HOWTO] OSMC/Rasp Pi as OpenVPN client](https://discourse.osmc.tv/t/howto-osmc-rasp-pi-as-openvpn-client/1844/71) | |
## Steps |
package com.mitchwongho.test.observablerealms; | |
import android.os.Bundle; | |
import android.support.annotation.NonNull; | |
import android.support.v7.app.AppCompatActivity; | |
import android.util.Log; | |
import com.mitchwongho.test.observablerealms.realms.Person; | |
import java.util.concurrent.TimeUnit; |
package com.mitchwongho.test.observablerealms.realms; | |
import android.support.annotation.NonNull; | |
import java.util.UUID; | |
import io.realm.RealmObject; | |
import io.realm.annotations.PrimaryKey; | |
/** |