2016年7月28日 星期四

[R][MAC]




1.When install package always shows
tar: Failed to set default locale 
2.Open Mac terminal:

defaults write org.R-project.R force.LANG en_US.UTF-8
3.Restart R
Done.

2016年7月11日 星期一

[git] set different user.name user.email in different repository

Go the the folder of your local repository

and type


git config user.name "xxxxxx"
git config user.email "xxxxx@www.com"


take a check 

cd .git
cat config

[MAC] Terminal hostname not mine.


it appears other's name who give you DNS.

go to terminal and check

xxxx $ hostname
xxxxxx

if the xxxx

$ sudo scutil --set HostName "xxxx's MacBook Air"

QUIT terminal, reopen again.

[octave] install octave 4.0.3 under mac osx EI 10.11, plot OK


ref: https://kiskeyix.org/articles/605

1.
install hombrew
install AquaTerm from sourceforge
brew tap homebrew/science
brew reinstall gnuplot --with-aquaterm
gnuplot # make sure it says "terminal set to aqua"
brew install lua51 # yes, you also need this old version of Lua
brew install octave

2.
vim ~/.octaverc
add below....

octave:1> graphics_toolkit('gnuplot')
octave:1> setenv('GNUTERM','aqua')

check again

octave:1> getenv("GNUTERM")
ans = aqua
octave:2>



=========================
For waring message when you plot
warning: could not match any font: *-normal-normal-10


use...

brew uninstall fontconfig

brew install fontconfig --universal


OK












2016年7月10日 星期日

[ML] logistic gradient accent and Andrew Ng gradient decent


ref:

http://www.csdn123.com/html/topnews201408/66/10366.htm


the gradient fun is l(n)

normally hope probability biggest, so use gradient Accent to find largest theta of l(n)

but

Andrew Ng set J(theta)=-(1/m)l(n), there has a "-", so become find the minimum , so
use gradient decent.


2016年7月9日 星期六

[python3.x] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position

Can't fix by root cause, but I try another way, reedit the file you hit.

1. open that file in vim, and you can see the  <0x92> in the file, remove and save. Done.
2. simply open file in sublime text 3 or TextEdit something, find some strange mark. remove it. Done.

ps. if you wondering what is the encoding of your file, go to sublime , show console and
     type-> view.encoding()

2016年7月5日 星期二

[mac] add path for adb,fastboot,.... to PATH

get mac version of adb , fastboot....

=> download Android Studio from google developer site.


copy those bin to folder whether you want.  ex: /Users/xxxxx/Documents/bin

and


vim ~/.bash_profile



PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:/Users/xxxxx/Documents/bin:${PATH}"
export PATH



save , and reopen the terminal.

Done.

[mac] Connect FTP from mac to ubuntu by vsftpd

[ubuntu side]

sudo apt-get install vsftpd



[mac side]

download filezilla client.

create a new ftp , use account and password to login.



ref:
http://yunol.com.tw/phpbb3/viewtopic.php?f=15&t=25132

2016年7月4日 星期一

[IDE]Sublime text 3 + Anconda ST3 => Autocomplete pandas dataframe setting


add following in to

Preferences->Setting-User

{

"auto_complete_triggers":
[
   {
       "characters": ".",
       "selector": "source"
   }
],
}


Preferences -> Package setting->Anconda->Setting-User


add at the tail.

{


    "anaconda_linting": false,
    "python_interpreter": "/Library/Frameworks/Python.framework/Versions/3.4/bin/python3",
    "auto_python_builder_enabled": false,
}

[IDE] Sublime text 3 + Anconda ,autocomplete quickly config

Sublime Text → Preferences → Settings—User

"auto_complete_triggers":
[
    {
        "characters": ".",
        "selector": "source"
    }
],

[MacOS] install python3.4 pandas , request, matplotlib

pip3.4 install pandas
pip3.4 install request
pip3.4 install matplotlib



SUPER EASY.....