Tuesday, September 4, 2012

Arduino: the size of data types

int: -32,768 to 32,767(minimum value of -2^15 and a maximum value of (2^15) - 1)
unsigned int 0 to 65,535 ((2^16) - 1)
long: -2,147,483,648 to 2,147,483,647 (32bit)
float: 32bits
double: 32bits (The same as float)

Monday, August 27, 2012

Color scheme for vim (not for gvim)

I was always wondering why some color scheme does work on gvim (MacVim) but not on vim launched from terminal. That's the reason.

Using GUI color settings in a terminal
http://vim.wikia.com/wiki/Using_GUI_color_settings_in_a_terminal

Tuesday, August 21, 2012

Updated: After Installed Mountain Lion

  1. Changed trackpad settings to "NORMAL"
    1. Enabled tap and click
    2. Fixed scrolling direction
    3. Enabled click and drag
      1. System Preference -> Accessibility -> Mouse & Trackpad -> Trackpad Options
  2. Enabled key repeat 
    1. Issue "defaults write -g ApplePressAndHoldEnabled -bool false"
  3. Made user's library directory visible from finder
    1. Issue "chflags nohidden /Users/USERNAME/Library"
  4. Installed
    1. MacVim
      1. Installed "ocean deep" color scheme
      2. Syntax highlight for arduino
      3. Made .vimrc 
    2. TextWrangler
    3. Xcode
      1. Added "command line tools" component
        1. Preferences -> Downloads -> Components
    4. VMware Fusion
      1. Installed Ubuntu 12.04 Desktop 64bit
        1. Updated installed packages
          1. $ sudo apt-get update
          2. $ sudo apt-get upgrade
        2. Installed C compiler
          1. $ sudo apt-get install build-essential
        3. Installed Oracle JAVA 7
          1. $ sudp add-apt-repository ppa:webupd8team/java
          2. $ sudo apt-get update
          3. $ sudo apt-get install oracle-java7-installer
          4. $ java -version
            Ref: http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
        4. Installed Netbeans
          1. Download package, and the run install script
            http://netbeans.org
        5. Installed Arduino programming environment
          1. $ sudo apt-get install arduino-core arduino 
      2. Installed Windows 7
        1. Windows Update - Required packages
        2. Windows Update - Recommended packages
          *CAUTION* VMware Fusion got freeze while patching
    5. Adobe Acrobat Pro 9.0
      1. Patched manually! There was no automatic update option on 9.0...
        After all the patches were done (Ver. 9.5.2) the Acrobat got "Check for update" option in "Help" menu.
    6. The unarchiver
    7. MplayerX
    8. Caffeine
    9. Reeder
    10. Microsoft Office
    11. iWorks
    12. ScanSnap Manager


Sunday, August 19, 2012

Vim: set path to working directory

Add the following to .vim


" Add the current file's directory to the path if not already present.
BufRead *
  \ let s:tempPath=escape(escape(expand("%:p:h"), ' '), '\ ') |
  \ exec "set path+=".s:tempPath

Ref: Set working directory to the current file

With previous make and javac binding, you can compile and execute Java code from vim with
  :mak
  :!java FILENAME