jinroh's Fourier series visualization in js is really excellent, but I had a hard time understanding the code. This is my attempt at commenting the jinroh's code for my own understanding, and hopefully for the benefit of others.
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 | |
#sample | |
am start -a android.intent.action.CALL -d tel://000-0000 | |
am start -a android.intent.action.SEND -d "some message" -t text/plain | |
am start -a android.intent.action.VIEW -d geo:0,0?q=Tokyo | |
am start -n com.android.browser/.BrowserActivity |
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
private String serializeBundle(final Bundle bundle) { | |
String base64 = null; | |
final Parcel parcel = Parcel.obtain(); | |
try { | |
parcel.writeBundle(bundle); | |
final ByteArrayOutputStream bos = new ByteArrayOutputStream(); | |
final GZIPOutputStream zos = new GZIPOutputStream(new BufferedOutputStream(bos)); | |
zos.write(parcel.marshall()); | |
zos.close(); | |
base64 = Base64.encodeToString(bos.toByteArray(), 0); |
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
function deepClone(o) { | |
var origObjs = {}; | |
var objCache = {}; | |
var nextObjId = 0; | |
var propName = "__clone_prop_" + Math.random(); | |
recurseClone = function(o) { | |
// base case | |
switch(typeof(o)) { | |
case 'undefined': |
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
to_monitor=/sdcard/fsrec | |
while [[ true ]] | |
do | |
cur_contents=`ls ${to_monitor}` | |
if [[ $cur_contents != $prev_contents ]] ; then | |
echo '++++++' | |
echo "$cur_contents" | |
echo '++++++' | |
fi | |
prev_contents=$cur_contents |
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
/* Functions to set up the view's size and position */ | |
private int[] getViewPos() { | |
int[] loc = {0, 0}; | |
this.getLocationOnScreen(loc); | |
return loc; | |
} | |
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
for im in *.png; do | |
im_jpg=${im/.png/.jpg} | |
convert $im $im_jpg | |
done |
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 | |
#Modify this with your IP range | |
MY_IP_RANGE="192\.168\.1" | |
#You usually wouldn't have to modify this | |
PORT_BASE=5555 | |
#List the devices on the screen for your viewing pleasure | |
adb devices |
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
private void goHome() { | |
Intent home = new Intent(Intent.ACTION_MAIN); | |
home.addCategory(Intent.CATEGORY_HOME); | |
home.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |
startActivity(home); | |
} |
OlderNewer