Skip to content

Instantly share code, notes, and snippets.

View zaki50's full-sized avatar

Makoto Yamazaki zaki50

View GitHub Profile
@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}"
@zaki50
zaki50 / volley_with_spdy.diff
Created May 23, 2013 18:43
adamrocker さんの volley サンプル https://github.com/adamrocker/volley を元に OkHttp を組み込んで SPDY でアクセスするための差分。 変更後のものは https://github.com/zaki50/volley/tree/with-OkHttp にあります。
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
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.backupagentsample"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
@zaki50
zaki50 / .profile
Last active December 16, 2015 11:38
adb を USB から wifi接続に切り替えるコマンド。 USB接続されてる端末が複数台あるときは ADB_OPTS="-s hogehoge" wifiadb で指定。
wifiadb()
{
addr=$(adb $ADB_OPTS shell ip -f inet -o addr show dev wlan0 | awk 'BEGIN { FS="[ /]+"} {print $4;}')
if [ x"$addr" = x"" ]; then
return 1;
fi
echo "addr: ${addr}"
adb $ADB_OPTS tcpip 5555
adb connect ${addr}:5555
unset addr
@zaki50
zaki50 / gist:5062831
Created March 1, 2013 06:30
NAN == NAN is false
#include <stdio.h>
#include <math.h>
int
main(int argc, char* argv[])
{
printf("%s\n", NAN == NAN ? "true" : "false");
return 0;
}
@zaki50
zaki50 / set_IgnoreCompilerWarnings_to_gen.diff
Created February 11, 2013 04:44
プロジェクト作成時などに、 gen フォルダはデフォルトで警告無視となるようにします。 Eclipse JUNO 以降でのみ効果あり。
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java
index 19a7101..d7409da 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java
@@ -210,6 +210,8 @@ public class NewProjectCreator {
private static final String LAYOUT_TEMPLATE = "layout.template"; //$NON-NLS-1$
private static final String MAIN_LAYOUT_XML = "main.xml"; //$NON-NLS-1$
+ private static final String KEY_IGNORE_WARNINGS = "ignore_optional_problems"; //$NON-NLS-1$
+
@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 / Main.java
Created November 26, 2012 15:46
親クラスの型パラメータに指定されている方の情報を取得するコード
package org.zakky.typeparameter;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
abstract class Base<K, V> {
}
class Sub<V> extends Base<String, V> {
@zaki50
zaki50 / mymaybe.hs
Created November 17, 2012 05:55
おれおれMaybe
data MyMaybe a = MyJust a | MyNothing
instance Monad MyMaybe where
-- (>>=) :: (MyMaybe a) -> (a -> MyMaybe b) -> MyMaybe b
-- return :: a -> MyMaybe a
(>>=) MyNothing _ = MyNothing
(>>=) (MyJust x) f = f x
return = MyJust