Thursday, November 10, 2016

Monday, April 4, 2016

Android Studio Shortcut

Keyboard Commands

The following tables list keyboard shortcuts for common operations.
Note: This section lists Android Studio keyboard shortcuts for the default keymap. To change the default keymap on Windows and Linux, go to File > Settings > Keymap. If you're using Mac OS X, update your keymap to use the Mac OS X 10.5+ version keymaps under Android Studio > Preferences > Keymap.
Table 1. Programming key commands
ActionAndroid Studio Key Command
Command look-up (autocomplete command name)CTRL + SHIFT + A
Project quick fixALT + ENTER
Reformat codeCTRL + ALT + L (Win)
OPTION + CMD + L (Mac)
Show docs for selected APICTRL + Q (Win)
F1 (Mac)
Show parameters for selected methodCTRL + P
Generate methodALT + Insert (Win)
CMD + N (Mac)
Jump to sourceF4 (Win)
CMD + down-arrow (Mac)
Delete lineCTRL + Y (Win)
CMD + Backspace (Mac)
Search by symbol nameCTRL + ALT + SHIFT + N (Win)
OPTION + CMD + O (Mac)
Table 2. Project and editor key commands
ActionAndroid Studio Key Command
BuildCTRL + F9 (Win)
CMD + F9 (Mac)
Build and runSHIFT + F10 (Win)
CTRL + R (Mac)
Toggle project visibilityALT + 1 (Win)
CMD + 1 (Mac)
Navigate open tabsALT + left-arrow; ALT + right-arrow (Win)
CTRL + left-arrow; CTRL + right-arrow (Mac)

Thursday, February 18, 2016

[Excel] Change the columns index from letter to number

When you open a spreadsheet by defautl the columns are indexed by letters: 

But if you want to change the format and put the index in numbers, here's how:
  • Open your spreadsheet
  • Click on the orb button
  • Click on Excel Options and move to the Formula tab.
  • Go to the "Working with formulas" section
  • Check the "R1C1 reference style"
  • Note that: Upon hovering your mouse cursor on it, you shall get all the information about this feature.
  • Click on OK

Tuesday, February 16, 2016

How to initialize Android program to be portrait or landscape

If you want to disable orientation changes of the phone then you may use this code in the manifest
<activity android:name=".class_name"
//if you want your screen in portrait
android:screenOrientation="portrait" >
//if you want you screen in landscape mode
android:screenOrientation="landscape" >
and if you want your phone to change orientation but prevent the process from restarting then you can use the onConfigurationChanged method in your class:
@Override
public void onConfigurationChanged(Configuration newConfig) {
   // ignore orientation change
   if (newConfig.orientation != Configuration.ORIENTATION_LANDSCAPE) {
       super.onConfigurationChanged(newConfig);
   }
}

Sunday, February 14, 2016

How to copy database file from android

Using Android Studio, click the android device button located in the toolbox menu
Then navigating to the storage folder under the name of your device (on the left panel)
The data is stored in one of the folder that your app pointed to (check your code for this location)

Thursday, November 26, 2015

Linux Screen Cmd

https://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/

Tuesday, November 24, 2015

How to copy file from remote machine to local machine

User command (Similar like the following):

Use pscp command copy data from remote machine to local machine:
pscp -r yyang57@hydra27.eecs.utk.edu:"./Videos/aa.a" D:\


Use scp command copy local data to remote machine:
scp User30.csv  User31.csv  User32.csv  User33.csv  User34.csv  User35.csv  User36.csv  User37.csv  User38.csv  User39.csv User40.csv  User41.csv  User42.csv  User43.csv  User44.csv  User45.csv  User46.csv  User47.csv  User48.csv  User49.csv User 50.csv yyang57@hydra26.eecs.utk.edu:./SVMMeasure/Dataset/