2015年12月31日 星期四

[python] Google Analytics oauth2client.client.CryptoUnavailableError: No crypto library available 解決方法


[python] Google Analytics oauth2client.client.CryptoUnavailableError: No crypto library available 解決方法


使用 Google Analytics 時遇到

    Traceback (most recent call last):
      File "GAFetcher/cron_ga_fetcher.py", line 31, in <module>
        credentials = SignedJwtAssertionCredentials(client_email, private_key,scope='https://www.googleapis.com/auth/analytics.readonly')
      File "/usr/lib/python2.6/site-packages/oauth2client/util.py", line 140, in positional_wrapper
        return wrapped(*args, **kwargs)
      File "/usr/lib/python2.6/site-packages/oauth2client/client.py", line 1630, in __init__
        _RequireCryptoOrDie()
      File "/usr/lib/python2.6/site-packages/oauth2client/client.py", line 1581, in _RequireCryptoOrDie
        raise CryptoUnavailableError('No crypto library available')
    oauth2client.client.CryptoUnavailableError: No crypto library available

已經 install 了 google-api-python-client
##install
pip install --upgrade google-api-python-client

使用 pip install  PyOpenSSL  可是不能安裝成功

# pip install PyOpenSSL

在centos 上 改採用  成功

# yum install pyOpenSSL

2015年12月30日 星期三

[Google Analytics] 出現 "User does not have any Google Analytics account." 解決 方案


"User does not have any Google Analytics account." 解決方法

使用Google Analytics 的 service account 方式,得到下面這個錯誤訊息。

<HttpError 403 when requesting https://www.googleapis.com/analytics/v3/data/realtime?metrics=rt%3AactiveUsers&alt=json&ids=ga%xx returned "User does not have any Google Analytics account.">

把 json 檔 的 client_email 加到 要使用的GA 的  profile 中的 使用者管理 即可



ref:
Analytics Google API Error 403: "User does not have any Google Analytics Account" - Stack Overflow
http://stackoverflow.com/questions/12837748/analytics-google-api-error-403-user-does-not-have-any-google-analytics-account
Add, modify, and delete users - Analytics Help
https://support.google.com/analytics/answer/1009702?hl=en#Add

[python] import uritemplate ImportError: No module named uritemplate 解決方法

    import uritemplate
ImportError: No module named uritemplate

使用  google api python client 的時候發現  google-api-python-client
安裝好了,但是執行程式時出現 ImportError: No module named uritemplate
$ pip install --upgrade google-api-python-client


後來採取這個方式  force reinstall  uritemplate

$ pip install --force-reinstall uritemplate.py

2015年12月29日 星期二

[docker] 使用 docker 安裝 phpmyadmin

[docker] 使用 docker 安裝 phpmyadmin 


自從有了docker 考試考了一百了(誤

phpmyadmin 是套 php 撰寫的 mysql 管理工具,
使用docker 安裝不用什麼太麻煩的設定。
PMA_HOSTS 指定一下你要連的server 。


$ docker run -d -e PMA_HOSTS=192.168.1.1,192.168.1.2 -p 8080:8080 phpmyadmin/phpmyadmin

ref:

2015年12月25日 星期五

如何將網域(domain) 從 Godaddy 移往 NameSilo Domain Transfer 2015

如何將網域(domain) 從 Godaddy 移往 NameSilo Domain Transfer 2015 

GoDaddy 取消了大部分的 renewal coupon ,基本上找的到的都只有在促銷新產品的 promo code 。

因為他們提供了另外一個方案,GoDaddy Discount Domain Club 原價一個月 $ 9.99 的入會費,最少是繳12個月,也就是一年的年費是$ 118.8 (日前的文章都是 7.5*12 每個月從7.5 漲到 9.99 )
提供的基本優惠就是 domain 的價格,像是 .com 的價格從 $ 14.99 給了 44 % off ,變成了 $ 8.29 (不過每個domain還要加收 $ 0.18/yr ICANN fee www.icann.org)

也就是說,當你domain不多,又找不到coupon code的情況下一年續約 .com $15.17 。

對於不想特別找 coupon code的人,確實是可以直接續約了,因為 renewal coupon 已經少見了。

而 NameSilo 則提供了 一年  .com $ 8.99 的價格 ,不必再加收 ICANN fee 。
而 GoDaddy 就算加入了 Discount Domain Club ,加上 ICANN fee 8.29+0.18 也要 $8.47。

當然,NameSilo 還提供了 免費的 whois privacy (也就是別人沒辦法直接用 whois 去查徐到你的登記資料),這個在 GoDaddy 是要付費購買DOMAIN PRIVACY 服務的,一年價格是 $7.99/yr

Private Registration | Protect Your Information - GoDaddy
https://www.godaddy.com/domainaddon/private-registration.aspx

GoDaddy 加入 Discount Domain Club (DDC) 以後的價格 (2015.12.25)


NameSilo 提供的比較表 (2015.12.25)


怎麼從將網域(domain) 從 GoDaddy 移往 NameSilo domain transfer 

domain transfer 整個過程大概一個小時內就完成了,主要是幾個步驟。

      0. 先取消 whois domain private
  1.  在 GoDaddy unlock domain ,購買或是剛轉換的服務商的60天內不能做轉移。
  2.  在 GoDaddy 取得 Authorization Code ,在 manage 頁面找 按下 Email my code ,他會把 Authorization Code 寄到你的 whois 登記資料的信箱中。
  3. 在信箱取得  Authorization Code 大概十分鐘左右
  4. 這個時間可以先註冊 NameSilo的帳號,並且看一下 $1 的NameSilo  discount code
  5. 到 NameSilo Transfer 頁面填入你的域名,他會提示你填入 Authorization Code。
    Cheapest Domain Transfers-Transfer Domain Registration Cheap: NameSilo https://www.namesilo.com/transfer.php

    成功以後就可以填入你的付費資訊, $ 8.39 使用 $1 的 優惠碼,變成 $7.39。
     

  6. 網域進入了 pending transfer 狀態,等待個十分鐘,收一下信箱點下namesilo 寄來的信。再來就是到GoDaddy確認轉出。
  7. 回 GoDaddy 的介面找 Domains -> Transfers 看一下有沒有 pending Transfers Out 的 domain ,找到你的網域按下 accept 。
  8. 等待個五到十分鐘,在到 NameSilo 的介面看狀態,看看是否成功轉出。
    雖然說這裡寫 5days,但是,很快就完成了。
  9. 完成後就可以在 NameSilo 看到 completed transfers 







ref:
域名从GoDaddy迁移至NameSilo – 方室网志
最新域名转移教程-Godaddy至Namesilo详细图文教程 | 日记男孩的博客 http://www.xujiahua.com/4432.html
GoDaddy域名转出攻略-月光博客 http://www.williamlong.info/archives/4413.html
从Godaddy转移域名到便宜好用的Namesilo - Slyar Home https://www.slyar.com/blog/godaddy-transfer-domain-namesilo.html
GoDaddy域名转移到NameSilo(2015版) - 生活志 http://louishan.com/articles/domain-transfer-godaddy-to-namesilo-2015.html

域名转移:从 Godaddy 到 Namecheap https://hinine.com/domain-transfer-from-godaddy-to-namecheap/
[教學]如何從Godaddy轉出網址到其它域名註冊商? – 香腸炒魷魚
https://sofree.cc/godaddy-transfer-domain-tech/



[cloudflare] Auto Minify and Polish eliminate space html 清除空白與壓縮


使用 cloudflare 當做 CDN 時,若是發現,有一些 html 空白消失了。你可能開啟了 Performance Auto Minify and Polish 的功能,可以到 speed 的地方(或是 rule page rule ) 去更改 Performance 的選項,選擇是否要使用 Auto Minify and Polish。


Polish

Improve image load time.
Polish automatically applies both “lossless” and “lossy” image optimization to remove unnecessary bytes from images. On average, image sizes are reduced by 35%.

Auto Minify

Reduce the file size of source code on your website.
Note: Purge cache to have your change take effect immediately.

ref:
An All New (and Improved) AutoMinify
https://blog.cloudflare.com/an-all-new-and-improved-autominify/

2015年12月22日 星期二

[openshift] 更換 openshift app 的 gear


openshift 是 redhat 所提供的一個SaaS 平台。

HOSTING WITH OPENSHIFT ONLINE OpenShift Online is Red Hat's next-generation application hosting platform that makes it easy to run your web applications in the cloud for free.
OpenShift by Red Hat
https://www.openshift.com/

每一個 free plan account 可以建立三個 gear,gear 就是在 openshift SaaS 中的一個單元。
目前,OpenShift 是建構部屬在 AWS 上,可是使用他你無需關心流量。

每個gear有1G的 ram,支援多種語言,甚至有提供 haproxy 來做分流使用。

有時候會遇到開啟的geer遇到不明原因loading很高或是很卡,你要怎麼更換目前使用的geer呢?

0. 已經 git clone 過原本 app 的 repo

1. delete 原本的 app


2. 在同一個 account 中 create 另外一個新的 app



3. 建立完後,在原本的 git repo 中的 .git/config 把 remote origin 的部份改成新的app

[remote "origin"]
    #old
    #url = ssh://ooooxxxxx@oldname.rhcloud.com/~/git/python.git/
    #new add
    url = ssh://xxxxooooo@newname.rhcloud.com/~/git/python.git/
    fetch = +refs/heads/*:refs/remotes/origin/*


4. 在repo 端

git push origin master -f

5.  連上 newname.rhcloud.com 確認一下是否完成

也可使用

$ rhc app show -a [appname] --gears -l account

確認目前使用的gear id 是不是原本的已經不同。


如此並可在 openshift 上,使用新的狀況良好的gear。


OpenShift Online Monthly Plan Comparison
https://www.openshift.com/pricing/plan-comparison.html



Free Plan Bronze Plan Silver Plan
Base Price Free Free $20C$20€15/month
Application Idling 24 hours Never Never
Included Gears 3 small gears 3 small gears 3 small gears
Max Gears 3 16 16+
Scaling Yes (3 min / 3 max) Yes (3 min / 16 max) Yes (3 min / 16 max)
Gear Sizes small small ($0.02C$0.02€0,02/hour)
small.highcpu ($0.025C$0.025€0,025/hour)
medium ($0.05C$0.05€0,04/hour)
large ($0.10C$0.10€0,08/hour)
small ($0.02C$0.02€0,02/hour)
small.highcpu ($0.025C$0.025€0,025/hour)
medium ($0.05C$0.05€0,04/hour)
large ($0.10C$0.10€0,08/hour)
Storage 1GB per gear 1GB per gear; $1.00C$1.00€1,00/month per additional GB 6GB per gear; $1.00C$1.00€1,00/month per additional GB
SSL Shared For custom domains For custom domains
Teams Not included Up to 15 Up to 15
JBoss EAP 6 Included 3 gears free; $0.03C$0.03€0.02/hr per additional gear 3 gears free; $0.03C$0.03€0.02/hr per additional gear
Support From Community Community Red Hat & Community
Sign up Upgrade Upgrade

a

[CloudFlare] 查看你所使用的 CloudFlare CDN 節點 區域 /cdn-cgi/trace


若是網站使用了 cloudflare 的 CDN ,可以在域名的後方加上 /cdn-cgi/trace
可以取的相關的訊息。

colo 就是,連線的clinet 使用的 Cloudflare 節點區域。
範例的 colo=HKG 就是使用 Cloudflare 的香港節點。


https://www.reddit.com/cdn-cgi/trace

fl=23f95
h=www.reddit.com
ip=
ts=1450773728.071
visit_scheme=https
uag=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36 OPR/34.0.2036.25
colo=HKG
spdy=3.1
loc=TW

台灣現在使用 cloudflare的香港節點,之前有一陣子調整在NRT: Tokyo, JP 


CloudFlare加速最佳化設置 – HZSH Site
https://www.hzsh.us/173/cloudflare%E5%8A%A0%E9%80%9F%E6%9C%80%E4%BD%B3%E5%8C%96%E8%A8%AD%E7%BD%AE
Which CloudFlare data centre do I reach? – CloudFlare Support
https://support.cloudflare.com/hc/en-us/articles/200169986-Which-CloudFlare-data-centre-do-I-reach-

The CloudFlare global network | CloudFlare | The web performance & security company
https://www.cloudflare.com/network-map/

Here is a list of CloudFlare PoP location codes and the corresponding city that they're in. A map of our network locations can be found here: https://www.cloudflare.com/network-map
Location Code: City, (State,) Country
AKL: Auckland, NZ
AMS: Amsterdam, NL
ARN: Stockholm, SE
ATL: Atlanta, US
CDG: Paris, FR
DFW: Dallas, US
DOH: Doha, QA
DUB: Dublin, IE
DUS: Dusseldorf, DE
DXB: Dubai, AE
EWR: Newark, US
EZE: Buenos Aires, AR
FRA: Frankfurt, DE
GRU: São Paulo, BR
HKG: Hong Kong, HK
IAD: Ashburn, US
ICN: Seoul, KR
JNB: Johannesburg, ZA
KIX: Osaka, JP
KUL: Kuala Lumpur, MY
KWI: Kuwait City, KW
LAX: Los Angeles, US
LHR: London, GB
LIM: Lima, PE
MAD: Madrid, ES
MAN: Manchester, GB
MBA: Mombasa, KE
MCT, Muscat, OM
MDE: Medellín, CO
MIA: Miami, US
MLE: Melbourne, AU
MRS: Marseille, FR
MXP: Milan, IT
NRT: Tokyo, JP
ORD: Chicago, US
OTP: Bucharest, RO
PDX: Portland, US
PRG: Prague, CZ
SCL: Valparaíso, CL
SEA: Seattle, US
SFO: San Francisco, US
SIN: Singapore, SG
SJC: San Jose, US
SYD: Sydney, AU
TXL: Berlin, DE
VIE: Vienna, IT
WAW: Warsaw, PL
YYZ: Toronto, CA

2015年12月19日 星期六

[tech] 在 mac terminal 開啟 sublime text Launch Sublime Text 2 from the Mac OS X Terminal


安裝  Sublime Text 常常因為沒有加入 command line 指令,無法在 terminal 中使用 Sublime Text 。

透過簡單的 ln link, ln -- make links 去做一個soft link

 ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

開始一個新的 terminal ,或是 source ~/.bash_profile 。
就可以直接在 terminal 使用  subl file  來開啟檔案了 (subl . 開啟整個資料夾)。

Launch Sublime Text 2 from the Mac OS X Terminal
https://gist.github.com/artero/1236170

2015年12月18日 星期五

[python] python 推薦 twitter sdk api lib


使用 twitter rest api 有許多的 client lib tools
在 python 上,推薦使用  Python Twitter Tools

就如同他自己的介紹,

The Minimalist Twitter API for Python is a Python API for Twitter, everyone's favorite Web 2.0 Facebook-style status updater for people on the go.

Python Twitter Tools (command-line client and IRC bot)
http://mike.verdone.ca/twitter/
sixohsix/twitter
https://github.com/sixohsix/twitter

安裝

pip install twitter


使用

操作上可以直接觀看 github 上 Readme 的例子,主要的核心就是 twitter 這個 class。
https://github.com/sixohsix/twitter

方便與直覺之處就是,你大概直接看官方的api docs,就可以了解有什麼參數可以直接使用。

這是一種滿直覺的封裝方式,沒有太多自己特製的封裝,wrap一層後可以直接看官方手冊。


The Twitter class

The minimalist yet fully featured Twitter API class.
Get RESTful data by accessing members of this class. The result is decoded python objects (lists and dicts).
The Twitter API is documented at:
Examples:
from twitter import *

t = Twitter(
    auth=OAuth(token, token_key, con_secret, con_secret_key))

# Get your "home" timeline
t.statuses.home_timeline()

# Get a particular friend's timeline
t.statuses.user_timeline(screen_name="billybob")

# to pass in GET/POST parameters, such as `count`
t.statuses.home_timeline(count=5)

# to pass in the GET/POST parameter `id` you need to use `_id`
t.statuses.oembed(_id=1234567890)

# Update your status
t.statuses.update(
    status="Using @sixohsix's sweet Python Twitter Tools.")

# Send a direct message
t.direct_messages.new(
    user="billybob",
    text="I think yer swell!")

# Get the members of tamtar's list "Things That Are Rad"
t.lists.members(owner_screen_name="tamtar", slug="things-that-are-rad")

# An *optional* `_timeout` parameter can also be used for API
# calls which take much more time than normal or twitter stops
# responding for some reason:
t.users.lookup(
    screen_name=','.join(A_LIST_OF_100_SCREEN_NAMES), _timeout=1)

# Overriding Method: GET/POST
# you should not need to use this method as this library properly
# detects whether GET or POST should be used, Nevertheless
# to force a particular method, use `_method`
t.statuses.oembed(_id=1234567890, _method='GET')

# Send images along with your tweets:
# - first just read images from the web or from files the regular way:
with open("example.png", "rb") as imagefile:
    imagedata = imagefile.read()
# - then upload medias one by one on Twitter's dedicated server
#   and collect each one's id:
t_up = Twitter(domain='upload.twitter.com',
    auth=OAuth(token, token_key, con_secret, con_secret_key))
id_img1 = t_up.media.upload(media=imagedata)["media_id_string"]
id_img2 = t_up.media.upload(media=imagedata)["media_id_string"]
# - finally send your tweet with the list of media ids:
t.statuses.update(status="PTT ★", media_ids=",".join([id_img1, id_img2]))

# Or send a tweet with an image (or set a logo/banner similarily)
# using the old deprecated method that will probably disappear some day
params = {"media[]": imagedata, "status": "PTT ★"}
# Or for an image encoded as base64:
params = {"media[]": base64_image, "status": "PTT ★", "_base64": True}
t.statuses.update_with_media(**params)
Searching Twitter:
# Search for the latest tweets about #pycon
t.search.tweets(q="#pycon")

[python] 2.6 AttributeError: 'datetime.timedelta' object has no attribute 'total_seconds'

[python] 2.6 AttributeError: 'datetime.timedelta' object has no attribute 'total_seconds'

python 2.6 timedelta 並沒有 total_secondes

8.1. datetime — Basic date and time types — Python 2.7.11 documentation
https://docs.python.org/2/library/datetime.html#datetime.timedelta.total_seconds

查看 docs 後,可使用

 (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) /10**6


在看一個 parse twitter created_at 的例子

    created_at = datetime.strptime(s.get('created_at'), '%a %b %d %H:%M:%S +0000 %Y')
    #python 2.6
    #AttributeError: 'datetime.timedelta' object has no attribute 'total_seconds'

    #created_at_ts = (created_at - datetime(1970, 1, 1)).total_seconds()
    td = created_at - datetime(1970, 1, 1)
    created_at_ts=(td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6

如此一來,在 python 2.6 也可以使用 total_seconds 的替代方法。

2015年12月17日 星期四

[吳式太極拳] 推手的力量 鬆沉虛實 151212 (六)


練完拳趟子,就跟師兄請教推手。
以吳式太極拳的推手訓練裡面,都是由四隅手,四正手開始訓練。

在推手的過程中,師兄就指出,我的左手的力量,很多時候都是自己先抬起來,這樣導致力量是不連貫的,也就是說,已經斷勁了。

有一個簡單的測試,我們一直做四正手的第一手,我使用左手,當我是使用抬的力量,而不是撐的力量的時候,師兄一看就知道,就會把推過來,告訴我說,我是使用抬的力量,而不是用撐的力量。

而是一開啟就是用撐的力量,要沉肩墜肘,用丹田撐起。

還有一個要點就是,體會放鬆,體會把力量放過去,把力量放掉。
接手的時候,如果沒辦法一開始就是撐,可以一開始提一點,然後,在接觸的時候,把力量放過去,放掉,放在對方的身上。

一觸用撐的力量,把力量放掉鬆沉,虛前腳。

體會了這個虛實,我豁然開朗,師兄再次講明,這就是虛實的力量。
一般的力量可能是明顯的對稱力量或是左右擰轉力量,但是這個力量,還沒有虛實的力量來的這麼巧妙。

當下聽到有如醍醐罐頂茅塞頓開,感覺好像貫通了很多以前看過,但是沒感覺的道理。




隨筆
放鬆 把力量放掉放過去
一點點左手的差別
不是自己舉著力量
一開啟就使用撐的力量
不用提
本來以為是轉 後來發現是虛實
不能偏掉

2015年12月15日 星期二

[elasticsearch] Kibana 與 Grafana 的關係

Kibana 與 Grafana 都是 open source 開源的 dashboard 與 分析的軟體。
Grafana 是從 Kibana 所 fork 出來的軟體。(ref 1)


  • Kibana 
    • an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch
    • elastic/kibana  https://github.com/elastic/kibana
    • power by elastic

  • Grafana
    • Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & OpenTSDB 
    • grafana/grafana  https://github.com/grafana/grafana
    • for Graphite, InfluxDB & OpenTSDB 
    • http://grafana.org
    • fork from Kibana


ref

1. Why We Built Marvel | Hacker News
https://news.ycombinator.com/item?id=7143370

grafana is a fork of Kibana. Kibana is a visualization tool of data in Elasticsearch, and Marvel is based on Kibana.

2015年12月14日 星期一

雲林高鐵站 新站開幕 12月 高鐵買一送一


從07 年高鐵通車以來,這個遲來的高鐵雲林站,終於在 2015 年12月 1號 通車了。
身為旅外的第一大縣,鄉親們引領期盼的高鐵車站,終於來了。










高鐵買一送一活動


旅客憑2015/12/01~2015/12/15起站或訖站為苗栗/彰化/雲林站,且已完成乘車之指定票種,可在2016/01/31前到高鐵各車站售票窗口,憑原車票兌換2016/01/31前相同乘車區間的標準車廂對號座免費車票乙張。
未享優惠之標準車廂對號座全票、商務車廂8折全票、標準車廂自由座全票(含持用悠遊聯名卡搭乘者),及平日離峰96折與一般團體95折全票適用之。原票如為已享有敬老/愛心/兒童票等法定優待,或本公司其他方案之優惠者,恕不適用。

專案內容

旅客憑2015/12/01~2015/12/15起站或訖站為苗栗/彰化/雲林站,且已完成乘車之指定票種,可在2016/01/31前到高鐵各車站售票窗口,憑原車票兌換2016/01/31前相同乘車區間的標準車廂對號座免費車票乙張。

指定票種

未享優惠之標準車廂對號座全票、商務車廂8折全票、標準車廂自由座全票(含持用悠遊聯名卡搭乘者),及平日離峰96折與一般團體95折全票適用之。原票如為已享有敬老/愛心/兒童票等法定優待,或本公司其他方案之優惠者,恕不適用。

活動期間

2015/12/01~2015/12/15

兌換期間

2015/12/01~2016/1/31

免費車票使用期間

2015/12/01~2016/01/31(2015/12/31~2016/01/04元旦疏運期間不適用)

兌換地點

高鐵各車站售票窗口

注意事項

  • 票種符合,但無苗栗/彰化/雲林站實際進出閘門紀錄者,不適用本優惠專案。
  • 本優惠專案兌換之免費車票為標準車廂對號座,且一經兌換恕不受理變更。
  • 每張符合本優惠條件之車票,限換領一張相同乘車區間之免費車票(如起、訖站皆屬新增三站,仍僅限換領一張免費車票)。
  • 凡已購買2015/12/01~2015/12/15期間,起訖站含苗栗/彰化/雲林站優惠車票之旅客,如欲改用本優惠專案者,可至高鐵各車站窗口退票重購,免收手續費。
  • 除本優惠專案之特別規定外,其餘悉依本公司旅客運送契約相關規定辦理。
  • 本優惠專案內容如有異動,將另行公告。台灣高鐵公司保有調整或終止本專案之權利。

台灣高鐵 Taiwan High Speed Rail
http://www.thsrc.com.tw/tw/Article/ArticleContent/b2d2c399-9fa2-4232-88e1-d61cea1826b2

蓋了 可是後悔了

實際搭乘後,發現整個站體跟公共設施略嫌有點小。
公共廁所居然只有四個小便斗。

早上坐車,本來車是空的,然後,一過雲林,整車就被雲林鄉親給塞滿了。
不過實際乘車狀況,可能要等到買一送一活動完再來看看。











2015年12月9日 星期三

[python] python 中的 @classmethod vs @staticmethod decorator


python 中有兩個在class中的 decorator , classmethod 與 staticmethod。
使用這兩個decorator在 method上,就可以不用特別去實體化class,就可以調用這些方法。


那這兩個 classmethod vs staticmethod 有什麼主要的區別呢?
  • @classmethod
    • 不需要帶self 參數,但是第一個參數需要是 自己類別的 cls 參數。
  • @staticmethod
    • 不需要self 參數與自身類別的cls 參數,就像使用函數一樣。

詳細的例子可以對照 給出的例子
装饰器@staticmethod和@classmethod有什么区别? | Stackoverflow about Python 





ref.
Descriptor HowTo Guide — Python 2.7.11 documentation 
飘逸的python - @staticmethod和@classmethod的作用与区别 - mattkang - 博客频道 - CSDN.NET
Python 中的 classmethod 和 staticmethod 有什么具体用途? - Python - 知乎
[翻译]Python中staticmethod和classmethod的差异
装饰器@staticmethod和@classmethod有什么区别? | Stackoverflow about Python

2015年12月7日 星期一

[武術]吳式太極拳 24式功法 鷹王覓食 談推手的放鬆 at 151205(六) 151206(日)

24式功法 鷹王覓食  談推手的放鬆 

這週老師教了,二十四式功法裡面的鷹王覓食。

呼吸 放鬆 張開手腳單腳站立 ,
腳出,
手出劃弧收回。

然後換邊。

這兩天都與師兄研習推手的功夫。

第二天師兄指出了我身體的一個問題點,
右手接手時,肩膀並不會自己抬起,是一個放鬆的狀態。

可是同樣的情況,換成了左手,一接手就開始把肩往上抬去支撐住。
當下,你可能覺得你並沒有抬著。可是,透過一個簡單的小測試,就可以知道。

師兄把手墊在我的手下面,然後他把手拿開,右手幾乎是馬上往下掉。
左手卻會自己支持著。

也就是說
你以為你放鬆了 其實你手還舉著
一接觸,就舉著
可以藉由一隻手墊著 看看手會往下掉嗎?

還沒接觸前舉著自己稍微維持著,
接觸後,往對方身上放,然後五張弓,虛前腳 ,重心往移動,這樣就形成了一個很強的力量。


2015年12月4日 星期五

[elasticsearch][how to] 怎麼增加新的node到 cluster

[elasticsearch][how to] 怎麼加入新的node到 cluster 

這是系列的elasticsearch how to


  1. 複製 /etc/elasticsearch/elasticsearch.yml 到新的node上
  2. 更改 config ,類似像 node.name 這種專門為了個別node的設定
  3.  確保新的node上的 cluster.name 與要加入的 cluster 相同
  4.  開啟node  /etc/init.d/elasticserch start
    1. 可以把 /etc/elasticsearch/logging.yml 第一行的 log level 從 INFO 改成 DEBUG
    2.  藉由 tail -f /var/log/elasticsearch/<cluster_name>.log  來看新 node 加入的情況

確認nodes有加入嗎

  • 在現有cluster 上的機器使用  http://localhost:9200/_cat/nodes?v api
看看新的node有被加入嗎?

使用 unicast

預設的zen discovery 使用 broadcast 去尋找有相同 cluster.name的 cluster下入,可以改用 unicast 來給定特定節點加入。
這個hosts list只要給定某一些node就可以被加入了。



discovery.zen.ping.multicast.enabled: false 
discovery.zen.ping.unicast.hosts: ["host1", "host2:port"]



Important Configuration Changes

How to Start a Startup CS183B Y Combinator (YC) 創業課

How to Start a Startup CS183B

Everything we know about how to start a startup, for free, from some of the world experts. How to Start a Startup is a series of video lectures, initially given at Stanford in Fall 2014. Videos

久聞 YC(Y Combinator) 與Stanford開的 How to Start a Startup 的課程。
看來該是時候花上時間把它看完了。


How to Start a Startup | StartupClass.co
https://startupclass.co/courses/how-to-start-a-startup
How to Start a Startup
http://startupclass.samaltman.com/
课程视频 - YC创业课中文社区
http://startupclass.club/
How to Start a Startup
https://www.facebook.com/groups/HTSAS/
成长 - YC创业课(CS183B)学习笔记 - 知笔墨
http://zhibimo.com/books/xiaolai/growth
How to Start a Startup - YouTube
https://www.youtube.com/channel/UCxIJaCMEptJjxmmQgGFsnCg/videos

2015年11月29日 星期日

[python] list all objects attributes and method 列出物件所有屬性與方法


[python] list all objects attributes and method 列出物件所有屬性與方法 


使用 
obj.__dict__
可以列出所有的屬性跟方法與內容,回傳回來的會是一個dict。

for k,v in obj.__dict__.items():
    print k,v

或是使用

 dir(obj)

借出所有的 attributes 的keys

ex
=====
import tweepy
auth = tweepy.AppAuthHandler(consumer_key, consumer_secret)
api = tweepy.API(auth, wait_on_rate_limit=True,wait_on_rate_limit_notify=True)
if not api:
    print "Can't Authenticate"
    exit()

print 'lol'
q='#apple'
count='2'
tweets = api.search(q=q, count=count)
for t in tweets:
    print t.text
    print dir(t)

['__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__getstate__', '__hash__', '__init__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_api', '_json', 'author', 'contributors', 'coordinates', 'created_at', 'destroy', 'entities', 'favorite', 'favorite_count', 'favorited', 'geo', 'id', 'id_str', 'in_reply_to_screen_name', 'in_reply_to_status_id', 'in_reply_to_status_id_str', 'in_reply_to_user_id', 'in_reply_to_user_id_str', 'is_quote_status', 'lang', 'metadata', 'parse', 'parse_list', 'place', 'possibly_sensitive', 'retweet', 'retweet_count', 'retweeted', 'retweets', 'source', 'source_url', 'text', 'truncated', 'user']


2015年11月27日 星期五

DHH The day I became a millionaire 當我變成百萬富翁的那天



DHH  The day I became a millionaire  當我變成百萬富翁的那天

DHH 是我敬佩的一派新生活的佼佼者,生長在丹麥,因為要開發項目管理軟體Basecamp ,而順手完成了Ruby on Rails 這個網頁框架。這邊文章,主要講述DHH 的自我追尋與歷程,這是我很喜歡看他的書跟文章的地方。

其他由他們公司 37signals (後來改成最紅的項目管理軟體Basecamp同名) 的出版品


The day I became a millionaire — Medium
https://medium.com/@dhh/the-day-i-became-a-millionaire-55d7dc4d8293
Ruby on Rails發明人的告白:賣掉股票、變身百萬富翁的那天,我得到了什麼呢?
http://feed.wordcorp.net/blog/post/the-day-i-became-millionare 

"我能走到今天,是因為政府提供了生育補貼、幼教照顧、醫療保健、教育,以及資金協助。真要說什麼體悟的話,我發現真正讓我快樂的,其實是全心專注時所得到的寧靜與心流狀態(flow)。感覺就像我去把舞台上那百萬富翁的專屬布幕拉開了,才發現布幕後面最重要的東西,我早就擁有了。"

生長在那樣的地方,讓他有了生活的基本需求。
從這樣個過程中,他更加體認到兩件事情,

  • 第一個,就是只要保持基本的生活需求,其他的事情對於成功影響就小了。也就是,他沒有很好的環境都有追求成功的能力,那你呢?
(I got where I am thanks to government-sponsored maternity leave, child care, health care, education, and even cash assistance. I grew up in housing provided by AAB, a union-founded affordable housing association. 不過,是因為政府的社會福利保證了每個人追求夢想的基本需求。就像馬斯洛需求金字塔中提到的,最基本的需求,就是生存的需求。一個廉能的政府,有保證人過這樣生活的基本義務。)

  • 第二點,直到他真的成為百萬富翁後,他在自己承認並且欣賞這樣的事實。這個也就是他這篇文章所要講的。
從小的時候他就跟自己的兄弟玩著“What would you do if you won a million kroner?” game ,如果我成為百萬富翁,我將會做什麼?

在還沒有達成這麼目標之前,他總是能夠寫下很多的清單跟需求,他以為,他只要成為百萬富翁的那刻,一切一切就會得到滿足了。

Common fallacy of wealth: “I’ve never seen an unhappy person driving a Lamborghini”財富的謬誤:我從來沒有看過一個開藍寶堅尼而不開心的人。

他總想要的更多,得到更多的金錢來滿足自己的夢想清單。直到 2006年Amazon 的 Jeff Bezos 貝佐斯 對於 Basecamp 很感興趣,這個夢想終於實現。DHH 跟他的朋友各自賣出了一些股票給 Jeff Bezos 貝佐斯 ,並且各獲得了百萬美元。(雖然說 Basecamp 並不缺資金,這是 DHH 嚮往的 "公司" 型態,能夠做好一些事情,並且對世界做出改變,這樣足矣)

DHH 永遠記得他興奮的去檢查自己的銀行帳戶的情境,帳戶裡面的數字,就像做夢一樣。他終於美夢成真了。剛開始他興奮不已,他可以買下他的夢想清單上的東西跟完成一切他期望的事情。

另外一個好處,就是 "Never Having To Work Again." 永遠不必工作。像一直嚮往著悠閒的生活會隨之而來的永恆幸福。我自己想了很多,並且對些錢做了些計算,如果把他們投入在股票債券中的穩鏡投資組合,將會活的舒服跟舒適。如果不奢侈的揮霍,那麼將可以花到我手指都舉不起來的那一天。不斷的去思考有錢可以幹嘛幹嘛,在一整週內都感覺到滿滿的幸福。

隨之而來的是一種衝突,你會說現在有什麼不一樣了嗎?不,百萬富翁的這個事實依舊存在。
這一切都沒有錯,我可以在餐廳點餐而不用注意他的價格。這個感覺有點像是,有一部好電影,終於被炒翻,不會讓你失望,這一切終將遇見。"Expectations, not outcomes, govern the happiness of your perceived reality." 你的幸福感是由你的期望所決定,而不是由最後的果決定。

在剛開始的幾個月內,我很少去花那些錢。當然,我買了一個大螢幕的電視還有一些我可能看也看不玩的DVD。而這些我在之前也能夠做。一直到了那年年底,我才真正的揮霍的買了一台黃色的藍寶堅尼( A yellow Lamborghini )
















ref.
Ruby on Rails - 維基百科,自由的百科全書

2015年11月24日 星期二

[php][codeigniter] 不在codeigniter 資料夾內使用db model

如果有個程式,並不存放在 codeigniter 的資料夾內,但是要使用相關的db model與語法。

紅色兩行根據自己的目錄結構來擺放,主要是讓該php可以讀取到codeigniter的lib。


<?php
defined('DS') OR define('DS', DIRECTORY_SEPARATOR);
defined('EXT') OR define('EXT', '.php');
defined('ENVIRONMENT') OR define('ENVIRONMENT', 'development');
$dir_path = dirname(__FILE__) . DS;
defined('BASEPATH') OR define('BASEPATH', $dir_path . 'm/system' . DS);
defined('APPPATH') OR define('APPPATH', $dir_path . 'm/application' . DS);


function getDBConnector(){
    include_once(BASEPATH . "core/Common.php");
    include_once(BASEPATH . "core/Exceptions.php");
    require_once(BASEPATH . 'database/DB' . EXT);
    $conn = & DB();
    return $conn;
}  
$db = getDBConnector();
/*echo $db->get('vote_table')->result_array();
print_r($db->get('vote_table')->result_array());
*/
$query = $db->select('itemid, count(itemid) AS num')
              ->group_by('itemid')
              ->order_by('num', 'desc')
              ->get('vote_table', 24);
$r=$query->result();
print_r($r);
$votes=array();
?>

[php][codeigniter] stdClass how to get value 得到值

在使用 codeigniter 做,db query時,若是直接把 result 給 print_r 出來,會看到是stdClass。

stdClass object 可以使用 -> 去指定key 來取值。

例如
foreach ($r as $d ) {
  # code...
  echo 'item ';
  echo $d -> itemid ;
  echo $d -> num;
}

<?php
defined('DS') OR define('DS', DIRECTORY_SEPARATOR);
defined('EXT') OR define('EXT', '.php');
defined('ENVIRONMENT') OR define('ENVIRONMENT', 'development');
$dir_path = dirname(__FILE__) . DS;
defined('BASEPATH') OR define('BASEPATH', $dir_path . 'm/system' . DS);
defined('APPPATH') OR define('APPPATH', $dir_path . 'm/application' . DS);

function getDBConnector(){
    include_once(BASEPATH . "core/Common.php");
    include_once(BASEPATH . "core/Exceptions.php");
    require_once(BASEPATH . 'database/DB' . EXT);
    $conn = & DB();
    return $conn;
}  
$db = getDBConnector();
/*echo $db->get('vote_table')->result_array();
print_r($db->get('vote_table')->result_array());
*/
$query = $db->select('itemid, count(itemid) AS num')
              ->group_by('itemid')
              ->order_by('num', 'desc')
              ->get('vote_table', 24);
$r=$query->result();
?>


Array
(
   [0] => stdClass Object
(
  [itemid] => 14
  [num] => 1
)
)

2015年11月23日 星期一

[linux] apache 404 Page Not Found codeigniter on Ubuntu


使用 codeigniter 在撰寫 application 時,若是一直得到 404 Page Not Found 的訊息。
可以檢查


  • application 下的 .htaccess

是不是有寫rewrite 過

/var/www/ci
這樣網址可以直接打 http://localhost/ci/<view>

<IfModule mod_rewrite.c>
  RewriteEngine On
  # !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
  #  slashes.
  # If your page resides at
  #  http://www.example.com/mypage/test1
  # then use
  # RewriteBase /mypage/test1/
  RewriteBase /ci/
 #RewriteRule ^index.php/(.*)$ /$1 [R=302,L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond $1 !^(index\.php|images|robots\.txt|$)
  RewriteCond $1 !^(static|$)
  #RewriteRule ^(.*)$ index.php?/$1 [L]
  RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>
<IfModule !mod_rewrite.c>
  # If we don't have mod_rewrite installed, all 404's
  # can be sent to index.php, and everything works as normal.
  # Submitted by: ElliotHaughin
  ErrorDocument 404 /index.php
</IfModule>


  • /etc/apache2/apache2.conf


<Directory /var/www/ci>
    Options Indexes FollowSymLinks
    AllowOverride All
    #Require all granted
</Directory>     

2015年11月19日 星期四

[武術] 吳式太極拳 四隅推手 單練 大象搖頭 二十四式功法

 吳式太極拳 四隅推手 單練 

吳家太極拳有很多次第的訓練,其中一個基礎的訓練就是 四隅 推手

四隅顧名思義,就是四個斜向的推手,有別於四正手。

四隅推手單練

左腳左手先
左腳右手先

上步

右腳右手先
右腳左手先


大象搖頭 二十四式功法

大象搖頭 這個功法,就是在練習轉腰與鬆沉勁。





2015年11月18日 星期三

[mac] fatal error: 'assert.h' file not found #include

fatal error: 'assert.h' file not found
#include <assert.h> 問題

try 

xcode-select --install

[mac] brew update Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master


$brew update
error: Your local changes to the following files would be overwritten by merge:
README.md
Please, commit your changes or stash them before you can merge.
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

解決方式
cd $(brew --prefix)
git reset --hard HEAD
brew update

2.

cd /usr/local && git reset --hard FETCH_HEAD
or if it fails
cd /usr/local && sudo git reset --hard FETCH_HEAD

2015年11月17日 星期二

[linux] 使用 sed 印出 奇數行 或 偶數行 print odd or even line using sed

[linux] 使用 sed 印出 奇數行 或 偶數行 print odd or even line using sed

有時候想要只印出文件的奇數行或是偶數行,可以使用 sed來達成

印出奇數行

sed -n 'p;n' file

印出偶數行

sed -n 'n;p' file


[ted] 東尼‧羅賓斯 安東尼.羅賓(Tony Robbins)談論為我們行為背後的動機與原因 Asks Why We Do What We Do 中文全文

東尼‧羅賓斯 安東尼.羅賓(Tony Robbins)談論為我們行為背後的動機與原因 Asks Why We Do What We Do





掌聲) 謝謝,我必須要告訴你們,我同感挑戰與興奮 我興奮的原因是:我能有回報的機會 我的挑戰是:我所舉辦最短的座談會通常是五十小時 (笑聲) 我並非誇大其詞。我會在週末進行,而我所作的... 我所作的甚至不僅於此,顯然地,訓練人群... 但我更相信沈浸式學習。因為你是怎麼學語言的? 你並不是只靠學習原則來學語言的。 你身置其中並經常使用,直至為真

我在這兒的原因的底線是,除了當個瘋狂的混蛋以外 是我真的正處於一個位置 我並不是來這邊激勵你們的。很顯然地,你們並不需要 很多時候那是大多人認為我會做的事情 但這卻是差最多的。真正發生的事情,是 人們告訴我:「我不需要任何激勵」 而我說:「噢!那可真是有趣!那不是我打算做的事情阿!」 我是「為什麼先生」,我想知道你行為背後的動機與原因。

你行為的動機是什麼? 是什麼驅使你,直至今日之斯?而非十年前的樣子 還是你不停在重複相同的模式?因為我相信 在內心啟動驅策的無形力量 是世界上最重要的事物 我在這裡,因為我相信情感是生命之力 在這裡的所有人都有偉大的心智 你知道嗎?我們大部份的人都有偉大的心智,對吧? 其他方面我不清楚,但是我們都知道如何思考 藉由我們的心智,我們能將任何事物合理化。 我們能讓任何事情發生!我們可以...我同意我在數天前所聽聞的 那個說大家都是為了自身利益而的工作的想法

但我們都知道,有時候這真是狗屁不通 你不會隨時隨地都為了你自身利益而工作 因為當你的情感到位時 就會以情感運作的方式來改變處理 對我們而言這是件多麼美妙的事,我們能有智慧的思考 關於世界的生命到底是怎麼回事,尤其 我們之中那些聰明人,能在腦中把這些事情完成 但我真的想知道的是,到底是什麼在驅策你

而我想要邀請你做的是 在我今天的演講之後,探索一下為何今天身置於此 有兩個原因。其一:因為可以奉獻更多。其二 我們希望能不只更了解其他人 而或許可以更欣賞其他人,創造某種連結 來阻止某些挑戰 我們今日在社會所面對的挑戰 這些挑戰只會越來越大 隨著連結我們的科技 讓我們產生更多交集,而這樣的交集 並不會總是產生這樣的觀點:「大家現在都更了解了解彼此 且大家都更欣賞彼此。」

所以, 基本上我著迷三十年了,而我著迷的事物一直是: 「是什麼造成人們生活品質的不同?」 「是什麼造成他們表現的不同?」 因為我就是靠這個賺錢的 所以我現在必須要產出成果 這是我做了三十年的事情。我會接到電話 那頭是在國家電視台上精疲力竭的運動員 他們領先五竿 而他們現在沒辦法回到賽道上 我就要馬上作點事情來產出成果 否則就沒差了。我會接到電話 那頭是想自殺的小孩 我就要馬上作點事情。在二十九年內 我很感激能告訴各位,在二十九年內,我成功救回了每一個 這並不表示我能一直維持不敗紀錄,但我過去還沒失手過 原因就是我了解他們的這些人性需求,也就是我想告訴你們的

所以,當我接到這些關於表現的電話時,這是一回事 你怎麼改變呢? 同時,我也在尋找,看看到底是什麼 在塑造這個人奉獻的能力 能作超越他們本身的事情。所以也許真正的問題是, 你知道的,我看著生命,說,有兩個重要的課題 其一是:成就背後是有科學的 幾乎每件事情都被作到了登峰造極的地步 第一個課題是:「你怎麼把無形的力量化為有形?」對吧 你怎麼讓你自己夢寐以求的事物成真? 不管是你的生意、對社會的貢獻、或是金錢? 不管對你來說是什麼 - 你的身體、你的家庭

但另外一個生命的課題,精通的人就少之又少了,就是自我實現的藝術 因為科學是簡單的,對吧? 你知道規則,寫好程式碼,跟隨... 然後就得到結果。只要你知道這遊戲的方式 你就,你知道的,你就會加碼,對吧! 但自我實現就是藝術了! 原因是,自我實現是欣賞 是奉獻。靠自己,你只能感覺到那些。 所以,我有個有趣的實驗室來回答這個問題。 這個問題中的問題,也就是這些人生命的差異到底在哪? 若你看著這些人 這些人是你所奉獻一切的人。就像是他們所聲稱 他們所需要的所有資源,你給他們的不只是百元電腦 而給他們最好的電腦。你給他們愛 給他們歡樂,你撫慰他們 而這些人經常,你知道的,至少我確定他們其中的一些 在餘生中帶著這些愛、教育、金錢 與其他背景,在戒護所中進出,揮霍餘生 之後你遇見經歷了極大痛苦的人 心理上、性上、心靈上、感情受創 雖然不總是如此,但經常是這樣,他們會變成 對社會貢獻最多的那群人之一

所以我們真的必須要問我們自己的問題是,到底是什麼? 到底是什麼在塑造我們?我們活在一個治療文化中 我們之中大部分的人都不會這樣作,但是我們的文化就是治療文化 而我這樣說的意思表示我相信我們都是過去的積累。 每個在這個房間的人,如果相信治療文化的理論 你就不會在這個房間裡了 但是,大部分的社會都認為一生中發生的事情是命定的 過去等同未來,當然是這樣若你這樣認為 但在這房間的人都知道 我們必須提醒我們自己 因為你有智識,知道一些事,你知道要作什麼 但沒有使用、沒有運用

所以我們真的要提醒我們自己 下決定才是最終的力量。就真的是這樣。 現在,當你問別人 「你曾經沒辦法達成某事嗎?」 「有多少人在生命中曾經 沒辦法達成重要的事情?」有的說「有」

群眾:「有」

東尼‧羅賓斯:謝謝你們的高度互動。 (笑聲)

但如果你問別人,為什麼你不去成就某件事情? 例如在你手下做事的人,或是工作夥伴 或甚至是你自己,當你沒辦法達成目標時 人們會給自己沒辦法達成的原因是什麼 他們會告訴你什麼?因為沒有...就是知道得不夠 沒有...知識。沒有...錢。 沒有...時間。沒有...技術。你知道的。 沒有對的經理人,沒有...

高爾:最高法院!(笑聲)

東尼‧羅賓斯:還有... (掌聲) 還有... (掌聲) 這些東西,包含最高法院在內,有什麼共同點? (笑聲) 這些事物都能聲稱你缺少資源,且可能是真確的! 你可能沒錢,也可能沒有最高法院 但是這不是關鍵因素! (掌聲) 糾正我!如果我錯了! 關鍵因素從來都不是資源,而是善用資源的能力! 我的意思是,讓我更精確的說 如果你有情感,人類的情感, 就像前日我從你身上體驗的一樣強烈 與我所經驗過的情感一樣深刻,而你曾用這樣的情感溝通過 我相信你一定能贏過他! (掌聲)

但是,對我來說告訴他應該作甚麼是多麼簡單的事情! (笑聲) 羅賓,你這笨蛋。但我知道當我們當時看這場辯論時 有情感阻絕了人們的能力 讓他無法得到他該有的智慧與能力 而在那天這場合讓一些人偶然碰上了 因為我知道一切人,他們本來想投你,但後來卻沒有 我對此不太高興。但,情緒在那裡,就在那裡! 有多少人知道我在說什麼?說:「有」

群眾:「有」

東尼‧羅賓斯:所以,就是情緒了。而如果我們有了正確的情緒 我們就能讓作成任何事情。我們能撐過去 如果你夠有創意、夠有玩興、夠有趣 你能跟所有人打成一片嗎?能不能?

群眾:能

東尼‧羅賓斯:如果你沒有錢,但你夠有創意與決心 你會找到方法,所以這就是終極的資源 但這不是大家告訴我們的,對吧? 大家告訴我們的是一堆不同的故事。 他們說如果我們沒有資源,但終究 如果你看看投影片,請抬頭,如果你願意的話 他們說,他們還沒完成的原因到底總共有哪些? 請換下一張。他打破了我的模式,那混蛋! (笑聲) 但我告訴你,我還是感謝他的活力 (笑聲)

決定你的資源的是什麼?我們說過決定會影響命運 這是我的重點。如果決定會影響命運,那會影響的 就是三個決定?你要把焦點放在哪邊? 現在,如果你要決定你要把焦點放在哪邊 在這秒鐘,不管有意識還是無意識地,當你決定要決定的那一分鐘 你就必須給你決定要聚焦的事物一個意義 而這個意義就會產生情緒 這是結束還是開始呢?神是在處罰我? 還是犒賞我呢?還是這就像是丟骰子一樣不確定? 之後某種情緒,就會創造我們的下一步或是行動

所以,想想你的人生 塑造你命運的決定 聽起來很沈重,但在過去五到十年 或十五年,你所下的決定造成了什麼樣的結果? 或是,若你當時的決定不同呢? 你的生命會完全不同嗎?有多少人能想出來? 說實在的,誰知道會比較好還是壞?說:「有」

群眾:「有」

東尼‧羅賓斯:所以這就是底線,或許這就是我們該開始下功夫的地方 或許是你過去碰見的人生摯愛 或是個生涯上的決定。我知道我在這兒看過的Google天才 我的意思是,我了解他們的決定 一開始是想要把他們的科技售出。如果他們做了這個決定 而不是建立他們自己的王國呢?世界會有什麼不同? 他們的人生會有什麼不同?他們的影響呢? 我們世界的歷史就是這些決定 當一個女人起身而說:「不,我不會坐到公車後頭」(譯按:指黑人女性拒絕移坐而引起種族意識抬頭的故事) 他並不只影響了他的生命。這個決定影響了我們的文化。 或是當有人站在坦克車前方,或是處於 藍斯·阿姆斯壯(Lance Armstrong)的處境,有人告訴你 「你得了睪丸癌」這對於任何男性都很難承受 尤其如果你是單車車手的話 (笑聲) 你腦子裡有了它,肺裡也有了它 但他決定聚焦的事物是什麼? 與大多數人不同。意思是什麼? 不是結束,而是開始。下一步我要作什麼? 他火力全開贏了七座冠軍。他之前從沒贏過 在他得癌症之前,但因為他有情緒調適的能力 心理的力量。那就是人與人之間的不同 我在我之前相處過約三百萬人中所見過的差異

因為這是我的實驗範圍。在過去的二十九年間我有過機會與 來自八十個國家的三百萬人互動 過了一陣子後,模式就很明顯了。 你看見南美與非洲 在某些方面上有所連結,對吧(指地圖上可以拼在一起,Gore於其影片中用過的段落)?其他人說 :「噢!那聽起來真荒謬!」簡單,那麼,是什麼決定蘭斯的? 是什麼決定你的?兩股無形的力量。很快談談。其一:狀態 我們都有過這樣的時刻 若你有過這樣的時刻:你在做了某事後,做完之後 你開始覺得,我真不敢相信我這麼說了 我真不敢相信我這麼做了,那真是有夠笨,有誰有過這種經驗的 說:「有」

群眾:「有」

東尼‧羅賓斯:你可曾作過些事情,做完之後你說:「這就是我!」 (笑聲) 對吧?這不是你的能力,這是你的狀態。 你的世界觀是長期型塑你的事物 你的世界觀是過濾器。形塑我們的東西 那就是讓人下決定的東西 當我們想影響他人,我們必須要知道 他們已經受了什麼影響 我相信這包含三部份 首先,你的目標是什麼?你追求的是什麼? 我相信,這跟你的欲望不同。 你可以有欲望或是目標。有多少人設立過目標 有過欲望或是想法的?大概就是這些吧? 有多少人有過?說:「有」

群眾:「有」

東尼‧羅賓斯:所以,我們有需求,我相信有六種人類需求 其次,一旦你知道驅策你的目標是什麼 而你真實的發現目標,不需要形成目標,發現就好 那你就會找到你的地圖是什麼 那就是你的信仰體系,告訴你如何得到那些需求 有些人覺得滿足那些需求要毀滅世界 有些人覺得要建造一些事物、創造一些事物,或是愛某人 所以你要選擇你的驅策力。很快帶過,六大需求。

讓我告訴你這些分別是什麼。其一:確定性。 現在所談的這些不是目標也不是渴望,是放諸四海皆準的 每個人都需要能夠避免痛苦的確定性 或至少能舒服的確定性。那要怎麼獲得呢? 控制他人?培養技能?放棄?抽根煙? 如果你能完全確定,很諷刺的 即便我們都需要 你若不確定你的健康、你的子女 你的金錢,你就不會想那麼多 你不確定天花板會不會掉下來 你不會聽任何講者說話 但當我們都以不同的方式獲得確定性,若我們得到完全的確定性後 我們會得到什麼?你若感覺確定時,你覺得如何? 你知道什麼會發生?何時會發生? 會如何發生?那你感覺會怎樣。 你會覺得無聊至極!所以,天阿,以她無窮盡的智慧。(譯按:玩笑話,因為應為男性「他」) (笑聲) 給我們第二個人類需求吧,也就是不確定性 我們需要變化,我們需要驚喜 在座多少人喜歡驚喜?說:「有」

群眾:「有」

東尼‧羅賓斯:胡說!你喜歡的是你想要的驚喜。 (笑聲) 你不想要的驚喜你稱之為問題,但你需要他們 所以,變化性是很重要的,你有租過你已經看過的 電影或是片子嗎?有人作過這種事嗎?真他媽的! (笑聲) 好,為什麼你會這樣作?因為你確信那不錯 因為你以前讀過、以前看過,但是你希望 因為過了好一陣子,你已經忘記了,而這就是變化的需求。

第三個需要:重要性。我們都需要感到 被重視、特別、獨一無二。你可以藉由賺更多錢達成 或是更具有靈性 你可以讓自己 有更多刺青或耳環,甚或在一般人不想知道的地方 不管代價為何,最快的方式是 如果你沒有背景、沒有文化、沒有信仰或資源 或是其他運用資源的能力,那就是暴力了。如果我拿把槍指著你的頭 而我又跟你住同一個社區,我馬上就有了重要性 0-10分,有多高呢?10分!我有多麼重要阿! 你要怎麼對我回應?10分!有多少不確定性? 誰知道接下來會發生什麼?蠻刺激的。 像是爬進洞穴後做做看這種事情 一路爬進去。完全是變化性與不確定性。 所以是重要的,是吧?如果你想冒生命的險 那就為什麼暴力總是在我們的周遭,且會一直持續下去 除非我們整個種族產生有意識的改變 現在,你可以有百萬種方式來得到重要性 但若要變得重要,你必須要獨一無二、與眾不同。

我們真的需要的是:愛與連結。也就是第四種需要。 我們都需要。大部分的人會定下來就是為了連結 因為愛太可怕了。不想要受傷 在這裡有在親密關係中受過傷的人嗎?說:「有」 (笑聲) 如果你不舉手,你也會有其他問題的!來吧! (笑聲) 如果你還要再被傷過一次 你難道不為今天來到了這個正向聚會而開心嗎? (笑聲) 事實是:我們需要它。我們可以經由親密實踐它。 或是經由友情、經由祈禱、經由在大自然中漫步 若什麼對你都沒效,養隻狗吧。別養貓。養隻狗。 因為只要你離開兩分鐘,感覺就像是你 已經離開了六個月一樣,即使你五分鐘後就出現了,對吧? (笑聲)

現在,這前四個需求,每個人都會找到滿足的方法 即使你欺騙自己,或是需要分裂個性 但是最後的兩個需求。前面的四個需求我們稱作 個性需求,我這樣稱呼 最後的兩個需求是靈性需求 這是實現感的來源。你沒辦法從前四個 得到實現感。你可以經由抽煙、喝酒、或是其他各式方法 來滿足前四者。但是最後的兩個:第五個 你必須要成長。我們都知道答案。 如果你不成長,那會怎麼樣呢?如果一段關係不成長? 如果一個事業不成長?如果你不成長? 不管你有多少錢 你有多少朋友,有多人愛你 你都會覺得像置身地獄一般。而我們成長的原因,我相信 是因為這樣我們才能給予他人有價值的事物

因為第六個需求是超出我們自己的奉獻 因為我們都知道,即便聽來已陳腔濫調 生活的秘密在於給予。我們都知道生命不是只是關於自己 而是關於群體。我們的文化知道,這房間裡的大家都知道。 而這是很刺激的。當你看到尼可拉斯(Nicholas)在台上談論 他的百元電腦,最熱情、刺激的事情是 他是個天才,但他聽到了呼召。 你可以感覺到他的不同,而那是美麗的。 而這樣的呼召可以感動他人,在我自己的生命中 我的生命當我在11歲時被感動,因為 感恩節:沒錢、沒食物,而我們將不會餓死 但我的父親完全搞砸了。我的母親讓他知道 他這次有多慘。有人來到了門前 給了我們食物。我的爸爸做了三個決定 簡短來說,我知道那些決定為何。他的焦點是:「這是慈善。 意義為何?我很沒用。我要作什麼? 我要離開這個家庭。」而他也真的離開了。那是我人生中 最為痛苦的經驗之一。我的三個決定則給了我不同的路走 我告訴我自己。「聚焦在有食物了」你知道,這是多麼了不起的概念 (笑聲)

其次,這是改變我生命的東西 這是形塑我生而為人的事物:「這是有人給我的禮物, 我甚至不知道他是誰。」我的父親總是說, 「沒人在乎」但突然間,有個我不認識的人 他們什麼都不要求,就只是給了我的家庭食物 看顧我們。這讓我相信了這個:「陌生人在乎我 對我來說的意義是什麼?而我的決定是, 如果陌生人在乎我與我的家庭,我也在乎他們。 我要作什麼呢?我要作點事 造成一些改變與不同。所以當我十七歲時,有天 我在感恩節時出門。這是我多年來的目標 有足夠的金錢來餵飽兩個家庭 最有趣的事情是我在我人生中作到了,這是最感人的一刻。 次年,我作到了四個家庭。我沒有告訴任何人我在做的事。 再次年,八個。我作這個並不是為了任何考績。 但八個之後,我想,媽的,我可以找人來幫忙。 (笑聲)

所以當然,我出去後我做了什麼呢? 我讓我的朋友加入這個計畫,開了公司 然後我有了十一個公司並建立了基金會 現在,十八年後,我很榮幸可以告訴各位,去年 藉由我們的基金會,我們餵養了在三十五個國家的兩百萬個人 都在假期期間:感恩節、聖誕節... (掌聲) 在世界各地各個不同的國家 真的很奇妙 (掌聲) 謝謝各位 (掌聲) 我告訴你們這事兒的目的不是為了自吹自擂。我告訴你們因為我身而為人 而引以為榮。因為當人體驗過為人群奉獻之後 每當有機會奉獻他們就會起而行,而非只是作而言

所以最後,我快用完我的時間了。形塑你的目標 人與人之間的不同是,我們有相同的需求 但是你是確定性需求特高的人嗎?那是你最重視的事物嗎? 或是不確定性呢?在這裡的這個人不可能是個對確定性需求特高的人 當他爬過那些洞穴時你就知道他不是了。你被重要性或是 愛所驅使嗎?我們都需要這六項,但是不管主要引領 你的系統為何,都會把你帶向不同的方向 當你往其中一個方向發展,你就有了目標或是命運 其二是規劃地圖,把他想成操作系統 他會告訴你怎麼到達目標,有人的地圖是: 「即便我為他人而死,我也要拯救生命」 他們是救火員,有人的是: 「我要藉著殺人來達成」他們試著滿足 相同重要性的需求,是吧?他們想要榮耀神 或是他們的家庭。但是他們有著不同的地圖。

而總共有七種不同的信仰。我沒辦法一一帶過 因為我要作結了。最後則是情緒 我會說地圖中的其中一塊像是時間。有人對於長時間的定義 是一百年,有人的則是三秒鐘 就像我的一樣 (笑聲) 最後我所提及的,向各位所提及的 如果你有目標,而且也有了地圖,那讓我們這樣說 我不能用Google因為我喜歡Macs,而他們在Mac上相關的應用 還不好,所以如果你用的是MapQuuest,有多少人有在使用 MapQuest的過程中犯過這個嚴重錯誤? (笑聲) 你用了這個東西而沒有抵達目的。想像 如果你的信念保證你永遠都無法抵達目的地? (笑聲)

最後一件事情是情緒 現在,我要告訴你關於情緒的事情是,情緒大概有6000種 我們在英語中都有相關對應的詞彙 若以語言的方式表現情緒,大概是這樣 也因此,這些情緒會被語言所改變。但如果你的主要情緒... 如果我有時間,我找了兩萬人或是一千人 我讓他們在平均一週內寫下他們所有所經歷過的情緒 他們多久我就讓他們寫多久 在其中一端他們寫下賦予他們力量的情緒 另一端則寫下剝奪他們力量的情緒 猜猜看這些人會經歷多少情緒?少於十二個。 而超過一半以上都讓這些人覺得糟透了。所以他們會有五或是六個 好的情緒,對吧?像是他們覺得:「快樂、快樂 興奮、不妙、挫折、挫折、受打擊、沮喪。」 有多少人認識那種不管發生什麼事情 都能不爽的人?有多少人認識這樣的人? (笑聲) 或者,也有那種不管發生什麼事情,都快樂、興奮的人 有多少人認識這種人?來吧!

當九一一發生時-讓我以這作結-我在夏威夷。 我與從四十五個國家來的兩千人在一起,我們正在為了 一個計畫翻譯,翻譯成為四種語言 計畫延續時間是一週。前一晚,我們稱為 「精通情緒」我起身,在無計畫的情況下我說 我們放了一堆煙火,且我說了很多瘋狂有趣的東西 然後在結尾我說,我計畫好要說這個 但我從不知道我要說什麼,忽然間我說 「人到底什麼時候真的開始活?當他們面對死亡的時候」 當我全部都說完後 如果你要離開這個島,如果九天後 你就要死了,你會打電話給誰,你會說什麼 你會作什麼?有個女人,那晚就是九一一發生的那晚 有個女人來了座談會,而當她來的時候 她的前男友被綁架並殺害了 她的朋友、她的新男友都想娶她,而她拒絕了

他說:「如果你想去夏威夷參加那活動,我們間就完了」 她說:「那就完了」當我當晚結束活動時,她打給了他 並留下個簡訊-這是真實故事-在世界貿易中心頂端 他所工作的地方,她說:「心愛的,我愛你,我只想讓你知道 我想嫁給你,我以前做的事情很笨。」她睡著了 因為對我來來說當時是凌晨三點,當他回電時 他從世貿中心頂樓說:「親愛的,我沒辦法告訴你這對我來說的意義。」 他說:「我不知道要怎麼告訴你 但是你給了我最棒的禮物,因為我就要死去了。」 而她把這段錄音放給當時在房間的我們聽。 她之後上了賴瑞‧金(Larry King)的專訪,他說:「你可能在想 這怎麼可能發生在你身上兩次。而他說 我能告訴你的是,這一定是神給你的訊息。 心愛的。從現在起,每一天都要付出你的全部,愛你的所有 別讓任何事物阻止你。」當她說完時,有個人站起來 他說:「我是從巴基斯坦來的(Pakistan),我是個回教徒。」 我想握著你的手說 我很抱歉,但是很老實的說,這是報復。我沒辦法把剩下的告訴你 因為我沒時間了 (笑聲) 最後十秒 (掌聲)

最後十秒,我只要十秒。我無意不尊重。只要十秒。 我想告訴你的是,我把這個人帶到舞台上。 跟一個從紐約來的,在世貿中心工作的人一起帶到台上。 因為在場大約有兩百個紐約人,超過五十個人 失去了他們整個公司、朋友、從他們的 Palm Pilots上劃掉紀錄-其中一個金融交易員,一個鋼鐵般堅強的女性,咆哮著 她從通訊錄上劃去了三十個死去的朋友 而我告訴他們的是:「我們要聚焦的是什麼?」 這個的意義為何?以及我們接下來要作什麼?

我讓這群人聚焦 如果你今天沒有失去一些人,你的焦點就會是 如何去服務另外一些人,有人是... 然後有個女人站了起來,她非常生氣,尖叫、大吼著 然後我發現她不是從紐約來的,她不是美國人 她不認識在場的任何一位,我說:「你總是生氣嗎?」 他說:「是的」罪人總會有罪,而傷心的人總會傷心 於是我把這兩個人抓在一起,並進行我所謂的間接談判 在受佔領土地上有家庭的猶太人,他在紐約 如果他當天要上班那他已經死了,而這個人 他想成為一個恐怖份子,且清楚表態 而整合的過程被我們拍下來了 我很樂意寄給你們看,你們就可以清楚看見 當真正發生時的狀況,而不是只聽我的口述說明 但這兩人不只和解了 更交換了他們對於這個世界的信念與道德觀 他們齊心協力,目前已共事了數年 在許多的清真寺與猶太廟堂中,傳達 如何創造和平的概念。他寫了一本書,叫做 「我的聖戰。我的和平之路。」所以,轉化真的是有可能的。

所以我邀請各位:拓展你的網路,這裡的網路是 需要、信仰、與控制你的情緒 為了兩個原因:因為你給的更多,成就就更多 我們都想要,不只是成就,更是給予 因為那才是真正讓你有實現感的事物。其次 你可以欣賞,不只是了解,心智 性靈,更欣賞到底是什麼驅策著人們 這是我們世界改變的唯一之道。願神保佑你們。 謝謝。我希望這能有所幫助。 (掌聲)


安東尼羅賓是個使用NLP的激勵大師,這場在 2006 TED 的talk 非常值得每隔一段時間來思考。
東尼‧羅賓斯(Tony Robbins)談論為我們行為背後的動機與原因。 | TED Talk | TED.com https://www.ted.com/talks/tony_robbins_asks_why_we_do_what_we_do/

[ted] Why We Do What We Do - Tony Robbins English full text  英文全文
http://peichengnote.blogspot.com/2015/11/ted-why-we-do-what-we-do-tony-robbins.html

[ted] Why We Do What We Do - Tony Robbins English full text

東尼‧羅賓斯 安東尼.羅賓(Tony Robbins)談論為我們行為背後的動機與原因 Asks Why We Do What We Do 英文全文

Thank you. I have to tell you I'm both challenged and excited. My excitement is: I get a chance to give something back. My challenge is: the shortest seminar I usually do is 50 hours.

(Laughter)

I'm not exaggerating. I do weekends -- I do more, obviously, I also coach people -- but I'm into immersion, because how did you learn language? Not just by learning principles, you got in it and you did it so often that it became real.

The bottom line of why I'm here, besides being a crazy mofo, is that -- I'm not here to motivate you, you don't need that, obviously. Often that's what people think I do, and it's the furthest thing from it. What happens, though, is people say to me, "I don't need any motivation." But that's not what I do. I'm the "why" guy. I want to know why you do what you do.

What is your motive for action? What is it that drives you in your life today? Not 10 years ago. Are you running the same pattern? Because I believe that the invisible force of internal drive, activated, is the most important thing. I'm here because I believe emotion is the force of life. All of us here have great minds. Most of us here have great minds, right? We all know how to think. With our minds we can rationalize anything. We can make anything happen.

I agree with what was described a few days ago, that people work in their self-interest. But we know that that's bullshit at times. You don't work in your self-interest all the time, because when emotion comes into it, the wiring changes in the way it functions. So it's wonderful to think intellectually about how the life of the world is, especially those who are very smart can play this game in our head. But I really want to know what's driving you.

What I would like to invite you to do by the end of this talk is explore where you are today, for two reasons. One: so that you can contribute more. And two: that hopefully we can not just understand other people more, but appreciate them more, and create the kinds of connections that can stop some of the challenges that we face today. They're only going to get magnified by the very technology that connects us, because it's making us intersect. That intersection doesn't always create a view of "everybody now understands everybody, and everybody appreciates everybody."

I've had an obsession basically for 30 years, "What makes the difference in the quality of people's lives? What in their performance?" I got hired to produce the result now. I've done it for 30 years. I get the phone call when the athlete is burning down on national television, and they were ahead by five strokes and now they can't get back on the course. I've got to do something right now or nothing matters. I get the phone call when the child is going to commit suicide, I've got to do something. In 29 years, I'm very grateful to tell you I've never lost one. It doesn't mean I won't some day, but I haven't yet. The reason is an understanding of these human needs.

When I get those calls about performance, that's one thing. How do you make a change? I'm also looking to see what is shaping the person's ability to contribute, to do something beyond themselves. Maybe the real question is, I look at life and say there's two master lessons. One is: there's the science of achievement, which almost everyone here has mastered amazingly. "How do you take the invisible and make it visible," How do you make your dreams happen? Your business, your contribution to society, money -- whatever, your body, your family.

The other lesson that is rarely mastered is the art of fulfillment. Because science is easy, right? We know the rules, you write the code and you get the results. Once you know the game, you just up the ante, don't you? But when it comes to fulfillment -- that's an art. The reason is, it's about appreciation and contribution. You can only feel so much by yourself.

I've had an interesting laboratory to try to answer the real question how somebody's life changes if you look at them like those people that you've given everything to? Like all the resources they say they need. You gave not a 100-dollar computer, but the best computer. You gave them love, joy, were there to comfort them. Those people very often -- you know some of them -- end up the rest of their life with all this love, education, money and background going in and out of rehab. Some people have been through ultimate pain, psychologically, sexually, spiritually, emotionally abused -- and not always, but often, they become some of the people that contribute the most to society.

The question we've got to ask ourselves really is, what is it? What is it that shapes us? We live in a therapy culture. Most of us don't do that, but the culture's a therapy culture, the mindset that we are our past. And you wouldn't be in this room if you bought that, but most of society thinks biography is destiny. The past equals the future. Of course it does if you live there. But what we know and what we have to remind ourselves -- because you can know something intellectually and then not use it, not apply it.

We've got to remind ourselves that decision is the ultimate power. When you ask people, have you failed to achieve something significant in your life?

Say, "Aye." Audience: Aye.

TR: Thanks for the interaction on a high level there. But if you ask people, why didn't you achieve something? Somebody who's working for you, or a partner, or even yourself. When you fail to achieve, what's the reason people say? What do they tell you? Didn't have the knowledge, didn't have the money, didn't have the time, didn't have the technology. I didn't have the right manager.

Al Gore: Supreme Court. TR: The Supreme Court.

(Laughter)

(Applause) (Cheering)

(Applause continues)

TR: And --

(Applause)

What do all those, including the Supreme Court, have in common?

(Laughter)

They are a claim to you missing resources, and they may be accurate. You may not have the money, or the Supreme Court, but that is not the defining factor.

(Applause) (Laughter)

And you correct me if I'm wrong. The defining factor is never resources; it's resourcefulness. And what I mean specifically, rather than just some phrase, is if you have emotion, human emotion, something that I experienced from you the day before yesterday at a level that is as profound as I've ever experienced and I believe with that emotion you would have beat his ass and won.

Audience: Yeah!

(Applause) (Cheering)

How easy for me to tell him what he should do.

(Laughter)

Idiot, Robbins. But I know when we watched the debate at that time, there were emotions that blocked people's ability to get this man's intellect and capacity. And the way that it came across to some people on that day -- because I know people that wanted to vote in your direction and didn't, and I was upset. But there was emotion there. Do you know what I'm talking about?

Say, "Aye." Audience: Aye.

TR: So, emotion is it. And if we get the right emotion, we can get ourselves to do anything. If you're creative, playful, fun enough, can you get through to anybody, yes or no?

If you don't have the money, but you're creative and determined, you find the way. This is the ultimate resource. But this is not the story that people tell us. They tell us a bunch of different stories. They tell us we don't have the resources, but ultimately, if you take a look here, they say, what are all the reasons they haven't accomplished that? He's broken my pattern, that son-of-a-bitch.

(Laughter)

But I appreciated the energy, I'll tell you that.

(Laughter)

What determines your resources? We've said decisions shape destiny, which is my focus here. If decisions shape destiny, what determines it is three decisions. What will you focus on? You have to decide what you're going to focus on. Consciously or unconsciously. the minute you decide to focus, you must give it a meaning, and that meaning produces emotion. Is this the end or the beginning? Is God punishing me or rewarding me, or is this the roll of the dice? An emotion creates what we're going to do, or the action.

So, think about your own life, the decisions that have shaped your destiny. And that sounds really heavy, but in the last five or 10 years, have there been some decisions that if you'd made a different decision, your life would be completely different? How many can think about it? Better or worse. Say, "Aye."

Audience: Aye.

So the bottom line is, maybe it was where to go to work, and you met the love of your life there, a career decision. I know the Google geniuses I saw here -- I mean, I understand that their decision was to sell their technology. What if they made that decision versus to build their own culture? How would the world or their lives be different, their impact? The history of our world is these decisions. When a woman stands up and says, "No, I won't go to the back of the bus." She didn't just affect her life. That decision shaped our culture. Or someone standing in front of a tank. Or being in a position like Lance Armstrong, "You've got testicular cancer." That's pretty tough for any male, especially if you ride a bike.

(Laughter)

You've got it in your brain; you've got it in your lungs. But what was his decision of what to focus on? Different than most people. What did it mean? It wasn't the end; it was the beginning. He goes off and wins seven championships he never once won before the cancer, because he got emotional fitness, psychological strength. That's the difference in human beings that I've seen of the three million I've been around.

In my lab, I've had three million people from 80 countries over the last 29 years. And after a while, patterns become obvious. You see that South America and Africa may be connected in a certain way, right? Others say, "Oh, that sounds ridiculous." It's simple. So, what shaped Lance? What shapes you? Two invisible forces. Very quickly. One: state. We all have had times, you did something, and after, you thought to yourself, "I can't believe I said or did that, that was so stupid." Who's been there? Say, "Aye." Audience: Aye.

Or after you did something, you go, "That was me!"

(Laughter)

It wasn't your ability; it was your state. Your model of the world is what shapes you long term. Your model of the world is the filter. That's what's shaping us. It makes people make decisions. To influence somebody, we need to know what already influences them. It's made up of three parts. First, what's your target? What are you after? It's not your desires. You can get your desires or goals. Who has ever got a goal or desire and thought, is this all there is?

Say, "Aye." Audience: Aye.

It's needs we have. I believe there are six human needs. Second, once you know what the target that's driving you is and you uncover it for the truth -- you don't form it -- then you find out what's your map, what's the belief systems that tell you how to get those needs. Some people think the way to get them is to destroy the world, some people, to build, create something, love someone. There's the fuel you pick. So very quickly, six needs.

Let me tell you what they are. First one: certainty. These are not goals or desires, these are universal. Everyone needs certainty they can avoid pain and at least be comfortable. Now, how do you get it? Control everybody? Develop a skill? Give up? Smoke a cigarette? And if you got totally certain, ironically, even though we need that -- you're not certain about your health, or your children, or money. If you're not sure the ceiling will hold up, you won't listen to any speaker. While we go for certainty differently, if we get total certainty, we get what? What do you feel if you're certain? You know what will happen, when and how it will happen, what would you feel? Bored out of your minds. So, God, in Her infinite wisdom, gave us a second human need, which is uncertainty. We need variety. We need surprise. How many of you here love surprises? Say, "Aye."

Audience: Aye.

TR: Bullshit. You like the surprises you want. The ones you don't want, you call problems, but you need them. So, variety is important. Have you ever rented a video or a film that you've already seen? Who's done this? Get a fucking life.

(Laughter)

Why are you doing it? You're certain it's good because you read or saw it before, but you're hoping it's been long enough you've forgotten, and there's variety.

Third human need, critical: significance. We all need to feel important, special, unique. You can get it by making more money or being more spiritual. You can do it by getting yourself in a situation where you put more tattoos and earrings in places humans don't want to know. Whatever it takes. The fastest way to do this, if you have no background, no culture, no belief and resources or resourcefulness, is violence. If I put a gun to your head and I live in the 'hood, instantly I'm significant. Zero to 10. How high? 10. How certain am I that you're going to respond to me? 10. How much uncertainty? Who knows what's going to happen next? Kind of exciting. Like climbing up into a cave and doing that stuff all the way down there. Total variety and uncertainty. And it's significant, isn't it? So you want to risk your life for it. So that's why violence has always been around and will be around unless we have a consciousness change as a species. You can get significance a million ways, but to be significant, you've got to be unique and different.

Here's what we really need: connection and love, fourth need. We all want it; most settle for connection, love's too scary. Who here has been hurt in an intimate relationship? If you don't raise your hand, you've had other shit, too. And you're going to get hurt again. Aren't you glad you came to this positive visit? Here's what's true: we need it. We can do it through intimacy, friendship, prayer, through walking in nature. If nothing else works for you, don't get a cat, get a dog, because if you leave for two minutes, it's like you've been gone six months, when you come back 5 minutes later.

These first four needs, every human finds a way to meet. Even if you lie to yourself, you need to have split personalities. I call the first four needs the needs of the personality. The last two are the needs of the spirit. And this is where fulfillment comes. You won't get it from the first four. You'll figure a way, smoke, drink, do whatever, meet the first four. But number five, you must grow. We all know the answer. If you don't grow, you're what? If a relationship or business is not growing, if you're not growing, doesn't matter how much money or friends you have, how many love you, you feel like hell. And I believe the reason we grow is so we have something to give of value.

Because the sixth need is to contribute beyond ourselves. Because we all know, corny as that sounds, the secret to living is giving. We all know life is not about me, it's about we. This culture knows that, this room knows that. It's exciting. When you see Nicholas talking about his $100 computer, the most exciting thing is: here's a genius, but he's got a calling now. You can feel the difference in him, and it's beautiful. And that calling can touch other people.

My life was touched because when I was 11 years old, Thanksgiving, no money, no food, we were not going to starve, but my father was totally messed up, my mom was letting him know how bad he messed up, and somebody came to the door and delivered food. My father made three decisions, I know what they were, briefly. His focus was "This is charity. What does it mean? I'm worthless. What do I have to do? Leave my family," which he did. It was one of the most painful experiences of life. My three decisions gave me a different path. I set focus on "There's food." What a concept!

(Laughter)

But this is what changed my life, shaped me as a human being. Somebody's gift, I don't even know who it is. My father always said, "No one gives a shit." And now somebody I don't know, they're not asking for anything, just giving us food, looking out for us. It made me believe this: that strangers care. And that made me decide, if strangers care about me and my family, I care about them. I'm going to do something to make a difference. So when I was 17, I went out on Thanksgiving, it was my target for years to have enough money to feed two families. The most fun and moving thing I ever did in my life. Next year, I did four, then eight. I didn't tell anybody what I was doing, I wasn't doing it for brownie points. But after eight, I thought I could use some help.

So I went out, got my friends involved, then I grew companies, got 11, and I built the foundation. 18 years later, I'm proud to tell you last year we fed 2 million people in 35 countries through our foundation. All during the holidays, Thanksgiving, Christmas, in different countries around the world.

(Applause)

Thank you. I don't tell you that to brag, but because I'm proud of human beings because they get excited to contribute once they've had the chance to experience it, not talk about it.

So, finally -- I'm about out of time. The target that shapes you -- Here's what's different about people. We have the same needs. But are you a certainty freak, is that what you value most, or uncertainty? This man couldn't be a certainty freak if he climbed through those caves. Are you driven by significance or love? We all need all six, but what your lead system is tilts you in a different direction. And as you move in a direction, you have a destination or destiny. The second piece is the map. The operating system tells you how to get there, and some people's map is, "I'm going to save lives even if I die for other people," and they're a fireman, and somebody else says, "I'm going to kill people to do it." They're trying to meet the same needs of significance. They want to honor God or honor their family. But they have a different map.

And there are seven different beliefs; I can't go through them, because I'm done. The last piece is emotion. One of the parts of the map is like time. Some people's idea of a long time is 100 years. Somebody else's is three seconds, which is what I have. And the last one I've already mentioned that fell to you. If you've got a target and a map -- I can't use Google because I love Macs, and they haven't made it good for Macs yet. So if you use MapQuest -- how many have made this fatal mistake of using it? You use this thing and you don't get there. Imagine if your beliefs guarantee you can never get to where you want to go.

(Laughter)

The last thing is emotion. Here's what I'll tell you about emotion. There are 6,000 emotions that we have words for in the English language, which is just a linguistic representation that changes by language. But if your dominant emotions -- If I have 20,000 people or 1,000 and I have them write down all the emotions that they experience in an average week, and I give them as long as they need, and on one side they write empowering emotions, the other's disempowering, guess how many emotions they experience? Less than 12. And half of those make them feel like shit. They have six good feelings. Happy, happy, excited, oh shit, frustrated, frustrated, overwhelmed, depressed. How many of you know somebody who, no matter what happens, finds a way to get pissed off?

(Laughter)

Or no matter what happens, they find a way to be happy or excited. How many of you know somebody like this?

When 9/11 happened, I'll finish with this, I was in Hawaii. I was with 2,000 people from 45 countries, we were translating four languages simultaneously for a program I was conducting, for a week. The night before was called Emotional Mastery. I got up, had no plan for this, and I said -- we had fireworks, I do crazy shit, fun stuff, and at the end, I stopped. I had this plan, but I never know what I'm going to say. And all of a sudden, I said, "When do people really start to live? When they face death." And I went through this whole thing about, if you weren't going to get off this island, if nine days from now, you were going to die, who would you call, what would you say, what would you do? That night is when 9/11 happened.

One woman had come to the seminar, and when she came there, her previous boyfriend had been kidnapped and murdered. Her new boyfriend wanted to marry her, and she said no.

He said, "If you go to that Hawaii thing, it's over with us." She said, "It's over." When I finished that night, she called him and left a message at the top of the World Trade Center where he worked, saying, "I love you, I want you to know I want to marry you. It was stupid of me." She was asleep, because it was 3 a.m. for us, when he called her back, and said, "Honey, I can't tell you what this means. I don't know how to tell you this, but you gave me the greatest gift, because I'm going to die." And she played the recording for us in the room. She was on Larry King later. And he said, "You're probably wondering how on Earth this could happen to you twice. All I can say is this must be God's message to you. From now on, every day, give your all, love your all. Don't let anything ever stop you." She finishes, and a man stands up, and he says, "I'm from Pakistan, I'm a Muslim. I'd love to hold your hand and say I'm sorry, but frankly, this is retribution." I can't tell you the rest, because I'm out of time.

(Laughter)

Are you sure?

(Laughter)

10 seconds!

(Laughter and applause)

10 seconds, I want to be respectful. All I can tell you is, I brought this man on stage with a man from New York who worked in the World Trade Center, because I had about 200 New Yorkers there. More than 50 lost their entire companies, friends, marking off their Palm Pilots. One financial trader, woman made of steel, bawling -- 30 friends crossing off that all died. And I said, "What are we going to focus on? What does this mean and what are we going to do?"

And I got the group to focus on: if you didn't lose somebody today, your focus is going to be how to serve somebody else. Then one woman stood up and was so angry, screaming and yelling. I found out she wasn't from New York, she's not an American, doesn't know anybody here. I asked, "Do you always get angry?" She said, "Yes." Guilty people got guilty, sad people got sad. I took these two men and I did an indirect negotiation. Jewish man with family in the occupied territory, someone in New York who would have died if he was at work that day, and this man who wanted to be a terrorist, and I made it very clear. This integration is on a film, which I'd be happy to send you, instead of my verbalization, but the two of them not only came together and changed their beliefs and models of the world, but worked together to bring, for almost four years now, through various mosques and synagogues, the idea of how to create peace. And he wrote a book, called "My Jihad, My Way of Peace." So, transformation can happen.

My invitation to you is: explore your web, the web in here -- the needs, the beliefs, the emotions that are controlling you, for two reasons: so there's more of you to give, and achieve, too, but I mean give, because that's what's going to fill you up. And secondly, so you can appreciate -- not just understand, that's intellectual, that's the mind, but appreciate what's driving other people. It's the only way our world's going to change.

God bless you, thank you. I hope this was of service.

(Applause)
[ted] 東尼‧羅賓斯 安東尼.羅賓(Tony Robbins)談論為我們行為背後的動機與原因 Asks Why We Do What We Do 中文全文 - peicheng note http://peichengnote.blogspot.com/2015/11/ted-tony-robbins-asks-why-we-do-what-we.html