Skip to content

Instantly share code, notes, and snippets.

View zaki50's full-sized avatar

Makoto Yamazaki zaki50

View GitHub Profile
@zaki50
zaki50 / skype_for_au.log
Created April 16, 2011 07:03
skype for au(com.skype.android.kddi) での結果
$ cd /data/data/com.skype.android.kddi/files
$ cat shared.xml
shared.xml: No such file or directory
$ cat ★skypeid★/main.db
★skypeid★/main.db: No such file or directory
$
@zaki50
zaki50 / install-all.sh
Created May 20, 2011 06:04
install-all.sh
#!/bin/sh
# 対象アプリのパッケージ名。 org.zakky.memopad とか
pkgname="$1"
# 対象アプリの apk。 bin/MemoPad.apk とか
apkpath="$2"
for i in $(adb devices |grep -v "List of devices" | awk '{print $1;}'); do adb -s $i shell pm uninstall -k "$pkgname"; adb -s $i install "$apkpath"; done
package org.zakky.queue;
import android.app.Activity;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import java.util.List;
@zaki50
zaki50 / gist:1034022
Created June 19, 2011 09:51
XLarge判定
(context.getResources().getConfiguration().screenLayout
& Configuration.SCREENLAYOUT_SIZE_MASK)
== Configuration.SCREENLAYOUT_SIZE_XLARGE
@zaki50
zaki50 / gist:1034403
Created June 19, 2011 15:18
config_xperia_arc.txt
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.32.9
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_GENERIC_GPIO=y
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_HARDIRQS=y
@zaki50
zaki50 / rpn
Created June 26, 2011 06:23
Main.java
package org.zakky.rpn;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Stack;
public class Main {
public static void main(String[] args) throws Exception {
final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
package org.zakky.rpn;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Stack;
import java.util.concurrent.TimeUnit;
public class Main {
@zaki50
zaki50 / gist:1061801
Created July 2, 2011 23:57
random_dithering.java
final int p = pixels[i];
final int r = Color.red(p);
final int g = Color.green(p);
final int b = Color.blue(p);
final int y = g * 587 / 1000 + r * 299 / 1000 + b * 114 / 1000;
int yb = (y < rand.nextInt(256)) ? 0 : 255;
@zaki50
zaki50 / gist:1062685
Created July 3, 2011 22:39
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 Google Inc.
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 / gist:1142068
Created August 12, 2011 13:49
copyOf.java
public static <T> T[] copyOf(T[] orig) {
if (orig == null) {
return null;
}
@SuppressWarnings("unchecked")
T[] newArray = (T[]) Array.newInstance(orig.getClass().getComponentType(), orig.length);
System.arraycopy(orig, 0, newArray, 0, orig.length);
return newArray;
}