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 cropImage() { | |
// Use existing crop activity. | |
Intent intent = new Intent("com.android.camera.action.CROP"); | |
intent.setDataAndType(mImageCaptureUri, IMAGE_UNSPECIFIED); | |
// Specify image size | |
intent.putExtra("outputX", 100); | |
intent.putExtra("outputY", 100); | |
// Specify aspect ratio, 1:1 |
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 saveUserData() { | |
Log.d(TAG, "saveUserData()"); | |
// Getting the shared preferences editor | |
String mKey = getString(R.string.preference_name); | |
SharedPreferences mPrefs = getSharedPreferences(mKey, MODE_PRIVATE); |
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 loadUserData() { | |
// We can also use log.d to print to the LogCat | |
Log.d(TAG, "loadUserData()"); | |
// Load and update all profile views | |
// Get the shared preferences - create or retrieve the activity |
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
osw=new OutputStreamWriter(fOut); | |
BufferedWriter fbw = new BufferedWriter(osw); | |
try { | |
fbw.write(String.valueOf(smoothedInference)); | |
fbw.write(" "+String.valueOf(System.currentTimeMillis())); | |
fbw.newLine(); | |
fbw.close(); | |
} catch (IOException e) { | |
// TODO Auto-generated catch block | |
e.printStackTrace(); |
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
import glob, os | |
def rename(dir, pattern): | |
i=318 | |
for pathAndFilename in glob.iglob(os.path.join(dir, pattern)): | |
title, ext = os.path.splitext(os.path.basename(pathAndFilename)) | |
i+=1 | |
os.rename(pathAndFilename, os.path.join(dir, str(i) + '.png')) | |
rename(r'/svm/andrew/open', r'*.png') |