A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
#! /usr/bin/env python2.7 | |
#encoding:utf-8 | |
#@description:一个python守护进程的例子 | |
#@tags:python,daemon | |
import sys | |
import os | |
import time | |
import atexit | |
from signal import SIGTERM |
curl -XPUT 'http://localhost:9200/testindex' -d '{ | |
"settings": | |
{ | |
"number_of_shards": 1, | |
"number_of_replicas": 0 | |
} | |
} | |
' | |
curl -XPUT 'http://localhost:9200/testindex/posting/_mapping' -d ' |
First, install nginx for mac with "brew install nginx". | |
Then follow homebrew's instructions to know where the config file is. | |
1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self | |
2. Copy it somewhere (use full path in the example below for server.* files) | |
3. sudo nginx -s reload | |
4. Access https://localhost/ | |
Edit /usr/local/etc/nginx/nginx.conf: |
Prereq:
apt-get install zsh
apt-get install git-core
Getting zsh to work in ubuntu is weird, since sh
does not understand the source
command. So, you do this to install zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
;; Exercise 1.7. | |
;; The good-enough? test used in computing square roots will not be very effective for | |
;; finding the square roots of very small numbers. Also, in real computers, arithmetic operations are almost | |
;; always performed with limited precision. This makes our test inadequate for very large numbers. Explain | |
;; these statements, with examples showing how the test fails for small and large numbers. An alternative | |
;; strategy for implementing good-enough? is to watch how guess changes from one iteration to the | |
;; next and to stop when the change is a very small fraction of the guess. Design a square-root procedure | |
;; that uses this kind of end test. Does this work better for small and large numbers? | |
; The problem with the good-enough? procedure for small numbers is that there radicant is much smaller than |