#Git Creating Repo: Should NOT Forget to Use .gitignore from beginning

I have a project haven’t used gitignore from the day we created. When we had to merge our codes, nothing goes right. This was really frustrating. We decided to do that manually which cost a lotta time.

Git Ignore Introduction:

.gitignore repo for different projects:

Advertisements

Installing Python3 and scikit-learn on Mac OSX 10.9.

bayareasportsfan4

Below is a brief outline of steps I used to install Python3 version 3.4.1 and scikit-learn version 0.15.1.

Note >> is used to indicate commands to type into terminal command line, and >>> is used to indicate commands typed into Python3 (or more accurately the Python3 interpreter).

  1. Install Python3:
    1. Go to https://www.python.org/download/
    2. Select Python 3.4.1 Mac OS X 64-bit/32-bit x86-64/i386 Installer (for Mac OS X 10.6 and later [2])
    3. Run Python.mpkg
    4. Python3 should install at /usr/local/bin/.
    5. Also, pip3 should install at /usr/local/.
  2. Install numpy:
    1. >>pip3 install numpy3
    2. Verify numpy installed
      1. >>python3
      2. >>>help(‘numpy’) then q to escape
        1. If you see the help for numpy, it’s installed.
  3. Install scipy
    1. Same steps as for numpy, but replace numpy with scipy.
  4. Install matplotlib
    1. I think this step is optional.  However, >>>help(‘sklearn’) gives a description that mentions matplotlib.
    2. Same steps as for numpy, but replace numpy with matplotlib.
  5. Install scikit-learn
    1. Same steps as for numpy…

View original post 23 more words

Install NumPy, SciPy, scikit-learn on Mac OS X for data miners

Shanshan Chen

Add on and summarized from blog http://penandpants.com/2012/02/24/install-python/

Outline: 1. install Xcode –> 2. install pip –> 3. install brew –> 4. install NumPy –> 5. install gfortran (important!) –> 6. install SciPy –> 7. install matplotlib (useful) –> 8. install scikit-learn –> 9. test

Preamble: Python 2.5 ~ above is preinstalled in the current Mac OS lion. To make sure, in terminal (search in spotlight), type python after $, you should be able to see the python version installed and prompted to the python interpretation environment. Else type “sudo easy_install python” to intall python2.

1. Download Xcode from app store and install it. After that, open installed Xcode, go to Preferences –>   Download–> Command Line Tools, click ‘install’ to install the commands which are not installed in the shell.

2. The following steps will all be done in terminal.  For this step, sudo easy_install pip.

3.

ruby -e "$(curl…

View original post 103 more words

#iOS: How to implement Equatable and Hashable Protocols

E.g.
class Week: Equatable, Hashable {
var weekFirstDay = Date.from(year: 2014, month: 12, day: 20)
var weekLastDay = Date.from(year: 2014, month: 12, day: 27)
    //implement a getter here
    var hashValue: Int {
        get {
            return “\(self.weekFirstDay)”.hashValue
        }
    }
    init(newWeekFirstDay: NSDate, newWeekLastDay: NSDate) {
self.weekFirstDay = newWeekFirstDay
self.weekLastDay = newWeekLastDay
println(“\(self.weekFirstDay), \(self.weekLastDay)”)
}
    init(newWeekFirstDay: NSDate) {
self.weekFirstDay = newWeekFirstDay
println(“\(self.weekFirstDay)”)
    }
}
//Equatable is implemented here
func == (lhs: Week, rhs: Week) -> Bool {
    if lhs.weekFirstDay == rhs.weekFirstDay {
        return true
    } else {
        return false
    }
}