Skip to content

Instantly share code, notes, and snippets.

View zaki50's full-sized avatar

Makoto Yamazaki zaki50

View GitHub Profile
@zaki50
zaki50 / RCS620S_port_selectable.diff
Created October 30, 2011 09:11
arduino-RCS620S.zip が使用するシリアルポートを変更可能にする修正です。
diff --git a/firmware/RCS620S/RCS620S.h b/firmware/RCS620S/RCS620S.h
index 9792859..f2a17c0 100644
--- a/firmware/RCS620S/RCS620S.h
+++ b/firmware/RCS620S/RCS620S.h
@@ -16,6 +16,15 @@
#define RCS620S_MAX_CARD_RESPONSE_LEN 254
#define RCS620S_MAX_RW_RESPONSE_LEN 265
+
+/*
@zaki50
zaki50 / parts.txt
Created November 5, 2011 02:30
まごろくさんにとりあえず買っておくとよいと言われたパーツ一覧
 1.1/4Wカーボン抵抗 全部入り(73種類0Ω付)
  価格:¥5,700 × 数量:1 = 合計:¥5,700
 2.絶縁型ラジアルリードタイプ積層セラミックコンデンサー0.01μF50V±10%5mmピッチ(10個入)
  価格:¥100 × 数量:3 = 合計:¥300
(1パックの場合は¥100円/100パック以上の場合は単価¥36円)
 3.電解コンデンサー100μF25V85℃(ルビコンYK)
  価格:¥10 × 数量:10 = 合計:¥100
 4.低損失三端子レギュレーター[3.3V1A]TA48033S
  価格:¥100 × 数量:10 = 合計:¥1,000
 5.三端子レギュレーター [5V1A] NJM7805FA(5個入)
@zaki50
zaki50 / cpuinfo_of_vono7elf.txt
Created January 31, 2012 00:54
/proc/cpuinfo of Vono 7 Elf
root@android:/ # cat /proc/cpuinfo
Processor : ARMv7 Processor rev 2 (v7l)
BogoMIPS : 1001.88
Features : swp half thumb fastmult vfp edsp neon vfpv3
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc08
CPU revision : 2
@zaki50
zaki50 / errordialog_template_swt
Created February 9, 2012 23:57
SWT でエラーダイアログを出すコードのための eclipse の code template
${:import(org.eclipse.swt.widgets.MessageBox)}final MessageBox ${message:newName(org.eclipse.swt.widgets.MessageBox)} = new MessageBox(getShell(), SWT.NULL | SWT.ICON_ERROR);
${message:newName(org.eclipse.swt.widgets.MessageBox)}.setMessage("${cursor}");
${message:newName(org.eclipse.swt.widgets.MessageBox)}.open();
@zaki50
zaki50 / gist:1947002
Created March 1, 2012 03:22
setOnClickListener を生成するテンプレート
${:import(android.view.View,android.view.View.OnClickListener)}setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
${cursor}
}
});
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ProjectNamePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ProjectNamePage.java
index 3db3353..cdd65c9 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ProjectNamePage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ProjectNamePage.java
@@ -37,6 +37,7 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
@zaki50
zaki50 / RelativePath.java
Created June 16, 2012 08:09
Compute relative path from a directory to other file or directory. a derivative of https://gist.github.com/2940215
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
public class RelativePath {
public static String relativePath(String origin, String target) {
try {
origin = (new File(origin)).getCanonicalPath();
@zaki50
zaki50 / RelativePath.java
Created June 16, 2012 08:14 — forked from sgk/RelativePath.java
Compute relative path from a directory to other file or directory.
/*
* by Shigeru KANEMOTO at SWITCHSCIENCE.
*/
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
@zaki50
zaki50 / SquareView.java
Created June 24, 2012 12:33
高さと幅がおなじになるView
package org.zakky.square;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
public class SquareView extends View {
public SquareView(Context context, AttributeSet attrs, int defStyle) {
@zaki50
zaki50 / 15-16.diff
Created July 3, 2012 07:51
diff of android API15 to API16
This file has been truncated, but you can view the full file.
diff -Nur android-15/android/accessibilityservice/AccessibilityService.java android-16/android/accessibilityservice/AccessibilityService.java
--- android-15/android/accessibilityservice/AccessibilityService.java 2012-06-18 20:00:41.000000000 +0900
+++ android-16/android/accessibilityservice/AccessibilityService.java 2012-06-28 08:41:07.000000000 +0900
@@ -17,8 +17,10 @@
package android.accessibilityservice;
import android.app.Service;
+import android.content.Context;
import android.content.Intent;
import android.os.IBinder;