This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.jwetherell.motion_detection.image; | |
import java.io.ByteArrayOutputStream; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.graphics.Color; | |
import android.graphics.Matrix; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//go to https://github.com/easternHong/vb-android-app-quality | |
//get the config file and put them into app/config/.. | |
apply plugin: 'pmd' | |
apply plugin: 'findbugs' | |
apply plugin: 'checkstyle' | |
task findbugs(type: FindBugs) { | |
description 'Run findbugs' | |
group 'verification' | |
classes = fileTree('build/intermediates/classes/debug/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Utility method to convert a byte array to a hexadecimal string. | |
* | |
* @param bytes Bytes to convert | |
* @return String, containing hexadecimal representation. | |
*/ | |
public static String ByteArrayToHexString(byte[] bytes) { | |
final char[] hexArray = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; | |
char[] hexChars = new char[bytes.length * 2]; // Each byte has two hex characters (nibbles) | |
int v; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var FindProxyForURL = function(init, profiles) { | |
return function(url, host) { | |
"use strict"; | |
var result = init, scheme = url.substr(0, url.indexOf(":")); | |
do { | |
result = profiles[result]; | |
if (typeof result === "function") result = result(url, host, scheme); | |
} while (typeof result !== "string" || result.charCodeAt(0) === 43); | |
return result; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var FindProxyForURL = function(init, profiles) { | |
return function(url, host) { | |
"use strict"; | |
var result = init, scheme = url.substr(0, url.indexOf(":")); | |
do { | |
result = profiles[result]; | |
if (typeof result === "function") result = result(url, host, scheme); | |
} while (typeof result !== "string" || result.charCodeAt(0) === 43); | |
return result; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Message | |
public static class MsgHeader { | |
public MsgHeader() { | |
msgId = -1; | |
} | |
@Index(0) | |
public int msgId; | |
public byte[] toBytes() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* <p>Operates on classes without using reflection.</p> | |
* <p/> | |
* <p>This class handles invalid {@code null} inputs as best it can. | |
* Each method documents its behaviour in more detail.</p> | |
* <p/> | |
* <p>The notion of a {@code canonical name} includes the human | |
* readable name for the type, for example {@code int[]}. The | |
* non-canonical method variants work with the JVM names, such as | |
* {@code [I}. </p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd /home/hunt/AndroidStudioProjects/EFamily/EFamily | |
branch='' | |
printf "please input branch :" | |
read branch | |
git co ${branch} | |
#echo ${branch} | |
time=`date +"%02m%d%H"` | |
build=`date +"%m%d%H"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onLayout(boolean changed, int l, int t, int r, int b) { | |
int row, col, left, top; | |
for (int i=0; i < getChildCount(); i++) { | |
row = i / mColumnCount; | |
col = i % mColumnCount; | |
View child = getChildAt(i); | |
left = col * child.getMeasuredWidth(); | |
top = row * child.getMeasuredHeight(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://github.com/devunwired/custom-view-examples/tree/master/app/src/main/java/com/example/customview/widget | |
@Override | |
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | |
setMeasuredDimension(measure(widthMeasureSpec, true), measure(heightMeasureSpec, false)); | |
} | |
private int measure(int measureSpec, boolean isWidth) { | |
int result; | |
int mode = MeasureSpec.getMode(measureSpec); | |
int size = MeasureSpec.getSize(measureSpec); |
NewerOlder