Skip to content

Instantly share code, notes, and snippets.

View zaki50's full-sized avatar

Makoto Yamazaki zaki50

View GitHub Profile
@zaki50
zaki50 / SplineInterpolator.java
Created December 8, 2012 07:22
与えられた座標を3次スプライン補間します。
/*
* Copyright (C) 2012 Makoto Yamazaki <zaki@uphyca.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@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 {
@zaki50
zaki50 / AndroidManifest.xml
Last active January 21, 2018 21:32
ためしに PrintService を作ってみた
<?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" />
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 December 24, 2010 09:15
OBBファイルをマウントした際の mount のオプションとか
/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
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
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 September 12, 2013 10:23
ReVIEW で表の中だと \footnote がうまく動かないのでその対処のための下調べ。 footnotetext を true にすれば脚注が \footnote ではなく \footnotemark と \footnotetext で生成されるようになる。これは表の中でも使えるがハイパーリンクにならないという欠点があったのでハイパーリンクになるようにしてみた。 最終的には footnotetext が false の時に、表の中にで使われている脚注だけ特別にハイパーリンク付きの \footnotetext と \footnotemark にするように実装したい
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 July 25, 2013 02:03
雛形のプロジェクトを ActionBarCompat 対応してみた。AndroidAnnotations で問題出るかもしれないので様子見。
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}"