Skip to content

Instantly share code, notes, and snippets.

View zaki50's full-sized avatar

Makoto Yamazaki zaki50

View GitHub Profile
2017-08-08 21:30:12
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.141-b15 mixed mode):
"Attach Listener" #207 daemon prio=9 os_prio=31 tid=0x00007f9dcb89d800 nid=0x5907 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"process reaper" #89 daemon prio=10 os_prio=31 tid=0x00007f9dcaa17800 nid=0x9f0b waiting on condition [0x0000700005e4f000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000739227228> (a java.util.concurrent.SynchronousQueue$TransferStack)
@zaki50
zaki50 / RealmUtil.java
Last active January 31, 2018 21:28
create `io.realm` package and then put following `RealmUtil` class into the package. `Log.d("RealmCount", RealmUtil.dumpRealmCount());` dumps the information.
package io.realm;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.EnumMap;
import java.util.Map;
public class RealmUtil {
compileOptions {
encoding = "UTF-8"
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
package com.example.realm_template.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
public class User extends RealmObject {
@PrimaryKey
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="foo">His name is <xliff:g id="name" example="Andy Rubin">%1$s</xliff:g>.</string>
</resources>
@zaki50
zaki50 / gist:03c6b3f213881e6c5e16
Last active September 7, 2015 00:13
Data Binding を使うと Espresso 標準の withText(String) の Matcher が使い物にならなくなるので Data Binding 使用時にも使える withText(String) の実装。Data Binding は Stringではない CharSequence をセットするのが原因。
private static Matcher<View> withText(final String expectedText) {
return new BoundedMatcher<View, TextView>(TextView.class) {
@Override
public void describeTo(Description description) {
description.appendText("with string : ");
description.appendValue(expectedText);
}
@Override
public boolean matchesSafely(TextView textView) {
diff -Nur appcampat-v7-22.2.1/android/support/v7/app/ActionBar.java appcampat-v7-23.0.0/android/support/v7/app/ActionBar.java
--- appcampat-v7-22.2.1/android/support/v7/app/ActionBar.java 2015-07-17 03:08:30.000000000 +0900
+++ appcampat-v7-23.0.0/android/support/v7/app/ActionBar.java 2015-06-23 08:43:44.000000000 +0900
@@ -46,45 +46,38 @@
* A primary toolbar within the activity that may display the activity title, application-level
* navigation affordances, and other interactive items.
*
- * <p>Beginning with Android 3.0 (API level 11), the action bar appears at the top of an
- * activity's window when the activity uses the system's {@link
- * android.R.style#Theme_Holo Holo} theme (or one of its descendant themes), which is the default.
diff -Nur support-v4-22.2.1/android/support/v4/animation/AnimatorCompatHelper.java support-v4-23.0.0/android/support/v4/animation/AnimatorCompatHelper.java
--- support-v4-22.2.1/android/support/v4/animation/AnimatorCompatHelper.java 2015-07-17 03:08:30.000000000 +0900
+++ support-v4-23.0.0/android/support/v4/animation/AnimatorCompatHelper.java 2015-06-23 08:43:44.000000000 +0900
@@ -17,6 +17,7 @@
package android.support.v4.animation;
import android.os.Build;
+import android.view.View;
abstract public class AnimatorCompatHelper {
package com.example;
import android.support.annotation.IntDef;
import android.util.SparseArray;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import static com.example.Size.ValidSize.SIZE_L;
import static com.example.Size.ValidSize.SIZE_M;
repositories {
maven {
url 'https://github.com/zaki50/bundles_maven_repo/raw/master/maven_repo'
}
}
dependencies {
compile 'com.neenbedankt.bundles:bundles:1.0.3'
compile 'com.neenbedankt.bundles:frozen:1.0.3'