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
public static String msToString(long ms) { | |
long totalSecs = ms/1000; | |
long hours = (totalSecs / 3600); | |
long mins = (totalSecs / 60) % 60; | |
long secs = totalSecs % 60; | |
String hrsString = (hours == 0) | |
? "00" | |
: ((hours < 10) | |
? "0" + hours | |
: "" + hours); |
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
int const PIN_FRONT = 3; | |
int const PIN_BELLY = 5; | |
int const PIN_DEFAULT = 8; | |
int const INPUT_PIN = 2; | |
//input reading stuff | |
int inputReading = LOW; | |
int previousRead; | |
long time = 0; // the last time the output pin was toggled |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> | |
<!-- view background color --> | |
<solid android:color="@color/transparent"> | |
</solid> | |
<!-- view border color and width --> | |
<stroke android:width="100dp" android:color="@color/white"> | |
</stroke> | |
<!-- If you want to add some padding --> | |
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp"> |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="ring"> | |
<!-- view background color --> | |
<solid android:color="@color/transparent"> | |
</solid> | |
<!-- view border color and width --> | |
<stroke android:width="56dp" android:color="@color/white"> | |
</stroke> | |
<!-- If you want to add some padding --> | |
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp"> |
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
// Immutable -- returns an unmodifiable List instead | |
public class SafeStates { | |
private final String[] states = new String[] { "Alabama", "Alaska", ... }; | |
private final List statesAsList | |
= new AbstractList() { | |
public Object get(int n) { | |
return states[n]; | |
} |
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
adb shell 'pm list packages -f' |
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
git status | grep .properties | awk '{print $2}' | xargs git checkout |
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
100% — FF | |
95% — F2 | |
90% — E6 | |
85% — D9 | |
80% — CC | |
75% — BF | |
70% — B3 | |
65% — A6 | |
60% — 99 | |
55% — 8C |