Setting up a my new macOS Sierra

Install Brew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Generate SSH Key and add to Github profile
ssh-keygen -t rsa -C "my_email@example.com"
Install Sequel Pro

Installing R on OSX


Install Homebrew (if you still don't have it) 
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 

Install R 
brew tap homebrew/science 
brew install r

When running r, I got the following error message:

dyld: Library not loaded: /usr/local/opt/gcc/lib/gcc/6/libgfortran.3.dylib
  Referenced from: /usr/local/Cellar/r/3.3.1/R.framework/Versions/3.3/Resources/lib/libR.dylib
  Reason: image not found

Trace/BPT trap: 5


To fix this error, I had to do this:
brew reinstall gcc --with-fortran

Fastest Factorial Function in Python


from functools import reduce
from operator import mul

def fastest_factorial(n):
     return reduce(mul, range(1, n+1), 1)

Tutorial: virtualenvwrapper

0) Make sure you have pip & virtualenv

sudo easy_install pip
sudo pip install virtualenv

1) Install virtualenvwrapper

sudo pip install virtualenvwrapper

2) Add the following lines in your shell startup file (.bashrc or .profile file).

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh
### or ###
source /usr/bin/virtualenvwrapper.sh
### if you installed virtualenvwrapper in that directory
### you can use sudo find / -name virtualenvwrapper.sh
### to locate virtualenvwrapper if you installed it somewhere else
 

About

Search

PISIKA Copyright © 2009