Skip to content

Instantly share code, notes, and snippets.

Avatar

Makoto Yamazaki zaki50

View GitHub Profile
@zaki50
zaki50 / RealmUtil.java
Last active Jan 31, 2018
create `io.realm` package and then put following `RealmUtil` class into the package. `Log.d("RealmCount", RealmUtil.dumpRealmCount());` dumps the information.
View RealmUtil.java
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 {
@zaki50
zaki50 / AndroidManifest.xml
Last active Jan 21, 2018
ためしに PrintService を作ってみた
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.zakky.myprintservice"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="19" />
View GradleDaemon_dump.txt
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 / output_of_mount.txt
Created Dec 24, 2010
OBBファイルをマウントした際の mount のオプションとか
View output_of_mount.txt
/dev/block/loop0 /mnt/obb/443968eabe370a269a4f820df69824bb vfat ro,dirsync,nosuid,nodev,uid=10030,fmask=0227,dmask=0227,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
View gist:4b217a4bcdba9392bf7e534f4f1ef880
compileOptions {
encoding = "UTF-8"
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
View gist:3526d0f6681b9d0bcb79
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
View gist:7366567
Kitkat での実行結果がこんなでつらい
D/hoge ( 8203): "あ".getBytes(Shift_JIS).length = 1
D/hoge ( 8203): "あい".getBytes(Shift_JIS).length = 3
D/hoge ( 8203): "あいう".getBytes(Shift_JIS).length = 6
D/hoge ( 8203): "あいうえ".getBytes(Shift_JIS).length = 8
D/hoge ( 8203): "あいうえお".getBytes(Shift_JIS).length = 10
@zaki50
zaki50 / use_footnotetext.diff
Created Sep 12, 2013
ReVIEW で表の中だと \footnote がうまく動かないのでその対処のための下調べ。 footnotetext を true にすれば脚注が \footnote ではなく \footnotemark と \footnotetext で生成されるようになる。これは表の中でも使えるがハイパーリンクにならないという欠点があったのでハイパーリンクになるようにしてみた。 最終的には footnotetext が false の時に、表の中にで使われている脚注だけ特別にハイパーリンク付きの \footnotetext と \footnotemark にするように実装したい
View use_footnotetext.diff
diff --git a/bin/review-compile b/bin/review-compile
index afea0d0..f0d3b6e 100755
--- a/bin/review-compile
+++ b/bin/review-compile
@@ -58,7 +58,7 @@ def _main
"mathml" => nil, # for HTML
"language" => "ja", # for HTML
"deprecated-blocklines" => nil,
- "footnotetext" => false,
+ "footnotetext" => true,
@zaki50
zaki50 / toAppCompat.diff
Created Jul 25, 2013
雛形のプロジェクトを ActionBarCompat 対応してみた。AndroidAnnotations で問題出るかもしれないので様子見。
View toAppCompat.diff
diff --git a/MyTemplate/build.gradle b/MyTemplate/build.gradle
index 98a1b61..ef8ce25 100644
--- a/MyTemplate/build.gradle
+++ b/MyTemplate/build.gradle
@@ -18,8 +18,8 @@ dependencies {
compile "com.squareup.dagger:dagger:${daggerVersion}"
compile "com.android.support:support-v4:${supportV4Version}"
+ compile "com.android.support:appcompat-v7:${appCompatVersion}"
compile "com.google.android.gms:play-services:${playServicesVersion}"
@zaki50
zaki50 / volley_with_spdy.diff
Created May 23, 2013
adamrocker さんの volley サンプル https://github.com/adamrocker/volley を元に OkHttp を組み込んで SPDY でアクセスするための差分。 変更後のものは https://github.com/zaki50/volley/tree/with-OkHttp にあります。
View volley_with_spdy.diff
diff --git a/VolleySample/libs/okhttp-1.0.2.jar b/VolleySample/libs/okhttp-1.0.2.jar
new file mode 100644
index 0000000..7592cdf
Binary files /dev/null and b/VolleySample/libs/okhttp-1.0.2.jar differ
diff --git a/VolleySample/libs/volley.jar b/VolleySample/libs/volley.jar
index 31c143c..762e993 100644
Binary files a/VolleySample/libs/volley.jar and b/VolleySample/libs/volley.jar differ
diff --git a/VolleySample/src/com/adamrocker/volleysample/MainActivity.java b/VolleySample/src/com/adamrocker/volleysample/MainActivity.java
index b2c1dd5..c2118c5 100644
--- a/VolleySample/src/com/adamrocker/volleysample/MainActivity.java
You can’t perform that action at this time.