This file contains hidden or 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
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")); | |
startActivity(browserIntent); |
This file contains hidden or 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
// http://stackoverflow.com/questions/2785485/is-there-a-unique-android-device-id | |
final TelephonyManager tm = (TelephonyManager) getBaseContext().getSystemService(Context.TELEPHONY_SERVICE); | |
final String tmDevice, tmSerial, tmPhone, androidId; | |
tmDevice = "" + tm.getDeviceId(); | |
tmSerial = "" + tm.getSimSerialNumber(); | |
androidId = "" + android.provider.Settings.Secure.getString(getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); | |
UUID deviceUuid = new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() << 32) | tmSerial.hashCode()); | |
String deviceId = deviceUuid.toString(); |
This file contains hidden or 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
function calcdpi() { | |
echo "sqrt($1^2+$2^2)/$3" | bc | |
} |
This file contains hidden or 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
# ant clean && ant debug && adbInstallAll | |
adbInstallAll() { | |
adb devices | \ | |
sed '1d;/^$/d;' | \ | |
awk '{print $1}' | \ | |
while read device; | |
do | |
adb -s $device install -r bin/*-debug.apk | |
done |
This file contains hidden or 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
set_console_title() { | |
PROMPT_COMMAND='echo -ne "\033]0;"'$1'"\007"'; | |
} |
This file contains hidden or 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
<target name="docs"> | |
<javadoc | |
sourcepath="src/" | |
destdir="docs/" | |
/> | |
</target> |
This file contains hidden or 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
<ProgressBar | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
style="@android:style/Widget.ProgressBar.Horizontal" | |
android:progressDrawable="@drawable/progress_horizontal" | |
/> |
This file contains hidden or 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
// calling activity | |
Intent i= new Intent(context, QRActivity.class); | |
i.putExtra("url", url); | |
startActivity(i); | |
// callee activity | |
Bundle extras = getIntent().getExtras(); | |
if (extras != null) { | |
mUrl = extras.getString("url"); |
This file contains hidden or 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
# python -m doctest singleton.py | |
class Singleton(object): | |
""" | |
>>> s = Singleton() | |
>>> s #doctest: +ELLIPSIS | |
<hidden.Singleton object at 0x...> | |
>>> p = Singleton() | |
>>> p == s | |
True | |
""" |
OlderNewer