hit counter

Timeline

My development logbook

Output From “brew Install Python3“. Need to Check Why Symlink Step Failed

Output from brew install python3. Need to check why symlink step failed

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$ brew install python3
==> Installing python3 dependency: sqlite
==> Downloading http://sqlite.org/sqlite-autoconf-3071300.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/sqlite/3.7.13 --enable-dynamic-extensions
==> make install
/usr/local/Cellar/sqlite/3.7.13: 9 files, 1.8M, built in 54 seconds
==> Installing python3
==> Downloading http://python.org/ftp/python/3.2.3/Python-3.2.3.tar.bz2
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/python3/3.2.3 --enable-shared
==> make
==> make install
==> Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.27.tar.gz
######################################################################## 100.0%
==> /usr/local/Cellar/python3/3.2.3/bin/python3.2 setup.py install
==> Caveats
A "distutils.cfg" has been written, specifing the install-scripts folder as: 
  /usr/local/share/python3

If you install Python packages via "python3 setup.py install", easy_install3,
pip-3.2, any provided scripts will go into the install-scripts folder above, so
you may want to add it to your PATH.

Distribute has been installed, so easy_install is available.
To update distribute itself outside of Homebrew:
  /usr/local/share/python3/easy_install3 pip 
  /usr/local/share/python3/pip-3.2 install --upgrade distribute

See: https://github.com/mxcl/homebrew/wiki/Homebrew-and-Python
Error: The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link python3'
==> Summary
/usr/local/Cellar/python3/3.2.3: 4216 files, 79M, built in 3.3 minutes

The Importance of the Idea of ‘Map’

The importance of the idea of ‘map’: you stop thinking about control structure. And you start to think about operation on the aggregate, the list.

How to Dismiss a Modal View Controller Which Is Created by a Segue in Storyboard?

A way to dismiss a modal view controller is to link the button to an IBAction like this:

1
2
3
- (IBAction)cancelAddItem:(UIBarButtonItem *)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

But it does not work in storyboard anymore.

This is the solution:

1
2
3
- (IBAction)cancelAddItem:(UIBarButtonItem *)sender {
    [self dismissModalViewControllerAnimated:YES];
}

Calculate Cash Flows in Python

Q: Bob began setting aside $5,000 per year in an equity fund at the age of 25. He has turned 30, and has just made another deposit into the fund. The fund has returned 4% annually. How much does Bob have in his account today?

A:

1
2
3
4
5
6
# contribution at age
>>> [(i, 5000)for i in range(25, 30+1)]
[(25, 5000), (26, 5000), (27, 5000), (28, 5000), (29, 5000), (30, 5000)]

>>> sum([5000*pow(1.05, i-25) for i in range(25, 30+1)])
34009.5640625