2009年11月30日 星期一

如何為不同年齡的孩子選擇童話故事

Streaming DMA mappings

(以下應該算是讀書心得 與 我自己的想法,並不是Linux的實際行為,例如ARM就不完全這樣做,讓我很搞不懂到底是我理解錯了,還是ARM Linux的問題...)

Linux Device Driver, 3rd ed, Chapter 15: Memory Mapping and DMA

dma_map_single/dma_unmap_single: setup/undo transfer buffer for device DMA.
dma_sync_single_for_cpu/dma_sync_single_for_device: for temporarily uses of the buffer

主要是用來解決下面兩個問題:
cache coherence(CC): Cache與memory內容可能不一致。cpu給device的資料可能在cache中,則device可能會讀到memory上的舊資料;或 device已經改變memory了,但cpu卻讀到cache的舊資料
bounce buffer(BB): 可能因為某些原因,若device無法用所給的buffer address做DMA時,這個時候需要另外allocate一塊buffer取代原來的buffer做DMA,把原buffer的資料搬到新buffer上,完成後再把資料搬回去。

資料流的方向:
DMA_TO_DEVICE
DMA開始前,BB需要把原buffer copy 到新buffer;CC要"clean"(writeback) cache to memory
(dma_map_single, dma_sync_single_for_device)

DMA_FROM_DEVICE
DMA結束後,CC要invalidate cache;BB要把新buffer內DMA的結果copy到原buffer上
(dma_unmap_single, dma_sync_single_for_cpu)

DMA_BIDIRECTION
DMA開始前,BB需要把原buffer copy 到新buffer;CC要"clean"(writeback) cache to memory
DMA結束後,CC要invalidate cache;BB要把新buffer內DMA的結果copy到原buffer上
但實際上kernel會做"flush" cache -- writeback and invalidate
DMA開始前,BB需要把原buffer copy 到新buffer;CC要flush cache
DMA結束後,BB要把新buffer內DMA的結果copy到原buffer上

dma_map_single/dma_unmap_single可以用flush,但是dma_sync_single_for_device和dma_sync_single_for_cpu則不應該用flush

dma_sync_single_for_cpu
buffer要給CPU使用前,CC要invalidate cache;BB要把新buffer內DMA的結果copy到原buffer上

dma_sync_single_for_device
buffer還給device DMA前,BB需要把原buffer copy 到新buffer;CC要"clean"(writeback) cache to memory

用這四個function去區隔出CPU access與device access的時間



Linux Device Driver, 3rd ed, Chapter 15: Memory Mapping and DMA, page 445.

Bounce buffers are created when a driver attempts to perform DMA on an address that is not reachable by the peripheral device - a high-memory address, for example.
How about address not aligned as device required?

2009年11月24日 星期二

Linux CONFIG_XXX definition in C code

include/linux/autoconf.h

config with 'y' would be defined by
#define CONFIG_XXX 1

config with 'm' would be defined.
#define CONFIG_XXX_MODULE 1

If you are going to use the config macro in C code, be careful with config that could be build as module.

2009年11月20日 星期五

投資標的

Stock:Bond:Other
46:46:8

Stock
VWO(0.27), VT(0.3)
VT=VXUS,+PG+JNJ+KO

Bond
IEF(0.15), BWX(0.5) TIP(0.2) WIP(0.5)

Other
GLD, EMB


Stock
VWO(0.27), VT(0.3)
VIG(0.23),SDY/SCHE(0.25),

Bond
BND(0.12), IEF(0.15), BWX(0.5) TIP(0.2) WIP(0.5)
SPDR DB INTERNATIONAL GOVERNMENT INFLATION-PROTECTED BOND ETF WIP : NYSE Arca
SPDR BARCLAYS CAPITAL INTERNATIONAL TREASURY BOND ETF BWX (AAA-BBB)
ISHARES S&P/CITIGROUP 1-3 YEAR INTERNATIONAL TREASURY BOND FUND ISHG (AAA-A,BB, Not Rated)(0.35)
ISHARES S&P/CITIGROUP INTERNATIONAL TREASURY BOND FUND EX-US IGOV(0.35)(AAA-AA,BB,Not Raged)

Reit
VNQ(0.13)
SPDR DOW JONES INTERNATIONAL REAL ESTATE ETF RWX : NYSE Arca (0.59)
POWERSHARES EMERGING MARKETS SOVEREIGN DEBT PORTFOLIO PCY : NYSE Arca(0.5)

Commodity
GSG, DBC


The World's Cheapest ETF Model Portfolio Gets Cheaper
http://buffettism.blogspot.com/2010/08/sharethis-blog-worlds-cheapest-etf.html

市值超過十億美金的100檔ETFs-分類與績效比較
http://buffettism.blogspot.com/2009/06/100etfs_18.html

Vanguard Dividend Appreciation ETF (VIG)
https://www.etrade.wallst.com/v1/stocks/fund_portfolio/portfolio.asp?symbol=VIG
https://personal.vanguard.com/us/funds/snapshot?FundId=0920&FundIntExt=INT#hist=tab%3A2


Vanguard Emerging Markets ETF (VWO)
https://personal.vanguard.com/us/funds/snapshot?FundId=0964&FundIntExt=INT#hist=tab%3A2


資產配置初步— 配重的決定續2(Asset Allocation in Essence—Determine Allocation Weight)
http://greenhornfinancefootnote.blogspot.com/2008/07/2asset-allocation-in-essencedetermine.html
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0yN3_xonTahoRV8TRISI7AJ33WYf-OptuJrLmH1BvrBALfB5H0woyRIiL-czpAyIm6-XWedhU6QrM6blWHezMhf-NQG9dZL4_TG9RqC7rf7KO9JofajzsbOPk_2EzPsVMW2Rqq8f2h1c/s1600-h/AA32+Bond+ETF.JPG


ISHARES TR S&P CITINT TBD IGOV : NASDAQ
SPDR SERIES TRUST BRCLYS INTER ETF ITE : NYSE Arca
SPDR SERIES TRUST BRCLYS LG TRS ET TLO : NYSE Arca



The 10 Best U.S. Dividend Stocks
http://seekingalpha.com/article/165326-the-10-best-u-s-dividend-stocks?source=feed
http://buffettism.blogspot.com/2009/11/10-best-us-dividend-stocks.html
1. Johnson & Johnson (JNJ)
2. The Procter & Gamble Company (PG)
3. 3M Co. (MMM)
4. SYSCO Corporation (SYY)
5. Emerson Electric Co. (EMR)
6. Abbott Laboratories (ABT)
7. McDonald’s Corporation (MCD)
8. The Coca-Cola Company (KO)
9. Wal-Mart Stores (WMT)
10. Automatic Data Processing Inc. (ADP)



VANGUARD DIVIDEND GROWTH FD (VDIGX)
MORGAN STANLEY GLOBAL DIVIDEND GROWTH SECURITIES A (GLBAX) 有佣
FIDELITY STRATEGIC DIV AND INCOME (FSDIX)無佣

2009年11月17日 星期二

調鋼絲

http://bbs.nsysu.edu.tw/txtVersion/treasure/bicycle/M.861880797.A/M.1053249416.A.html

先去買個調鋼絲工具吧,park的不錯.
若某個地方偏右,則把該處左邊的鋼絲調緊,右邊的調鬆,反之亦然.
記得左邊鋼絲跟右邊的鋼絲鬆緊不要差太多,以免整個輪框偏一邊.
還有輪框應該是圓的,若輪框的某個地方左右鋼絲都調太緊或太鬆則會有失圓的現象.
還有鋼絲調太鬆或太緊都不好,太鬆則造成動力的抵銷,太緊又降低輪框的壽命.
剛調者可能一次調個半圈或四分之一圈就差不多了,
且能調到輪框不會左右擺動就不錯了.
而所謂調緊是指從輪框外側往輪軸的方向看時,順時鐘為轉緊,逆時鐘為轉鬆.

整胎

http://www.mobile01.com/topicdetail.php?f=268&t=1161017&m=f&p=1&img=0##13618980


換細胎~整胎最好做一下~

先把內胎充一點氣


再把輪胎像這樣翻一輪...( 整胎 )看看有沒夾到內胎


整胎 的功效~1:防夾到胎壁 2:讓內胎更服貼外胎(因為把內胎放入外胎有時會積在一起)


正常的情況


就我遇過~ 胎ok但胎會變形的原因
1:內胎放入外胎有時會"積"在一起太嚴重,充氣後.....就變形囉
2:外胎夾到胎壁.....就變形囉
3:可能外胎有瑕疵 ( 如外胎過度磨損或外胎纖維斷裂 ).....就變形囉

2009年11月15日 星期日

[綠角] 對於長期投資的莫名恐懼 系列

對於長期投資的莫名恐懼(Unfounded Fear for Long-Term Investing)
http://greenhornfinancefootnote.blogspot.com/2009/11/unfounded-fear-for-long-term-investing.html

對於長期投資的莫名恐懼(Unfounded Fear for Long-Term Investing)續1
http://greenhornfinancefootnote.blogspot.com/2009/11/unfounded-fear-for-long-term-investing1.html

對於長期投資的莫名恐懼(Unfounded Fear for Long-Term Investing)續2
http://greenhornfinancefootnote.blogspot.com/2009/11/unfounded-fear-for-long-term-investing2.html

對於長期投資的莫名恐懼(Unfounded Fear for Long-Term Investing)續3
http://greenhornfinancefootnote.blogspot.com/2009/11/unfounded-fear-for-long-term-investing3.html

對於長期投資的莫名恐懼(Unfounded Fear for Long-Term Investing)續4
http://greenhornfinancefootnote.blogspot.com/2009/11/unfounded-fear-for-long-term-investing4.html

2009年11月12日 星期四

etrade匯款

Wire money into my account
https://us.etrade.com/e/t/estation/help?id=1901000000#Wire

If your financial institution is located outside the United States:

* The amount you want to wire in U.S. dollars
* The receiving institution information:

The Bank of New York
One Wall Street
New York, NY 10286
Swift Code: irvtus3n
Routing Number: 021000018
FBO: E*TRADE Clearing LLC
Account Number: 890 034 6256

* Your eight-digit E*TRADE Securities account number (add the letters "ET" before your account number, for example ET12345678)
* Your name and address
* Please note that international wires usually take 2-7 business days to process.


RichXXX大大的親身經歷
我是在中國信託匯的
中國信託的匯款手續費是 900 元, 中間行匯費是 US$18.-(可能會變動)

受款人資料
帳號(A/C No.) : 8900346256
戶名: E*Trade Securities
國家: USA

受款銀行
銀行代碼(SWIFT/Bank Code): irvtus3n
銀行名稱(Bank Name): The Bank of New York
地址(Address): One Wall Street New York, NY 10286
城市/國家(City/Country): New York/USA

附言寫:
NAME: 你的護照中文名稱, 和你的表單上是一樣的
Account NO: ET12345678 (12345678是你的 E*Trade 帳號號碼)
ADDR: 你在 E*Trade 留的英文地址


知道怎麼把錢匯過去,也要知道怎麼把錢匯回來吧。但是很奇怪的一點是,它(etrade)沒有直接提供link,而是從FAQ找的這個link的。總覺得它不想我把錢提走,所以藏來藏去的...
Know all the ways I can withdraw money
https://us.etrade.com/e/t/estation/contexthelp?id=1903000000&traxui=TRAXUI#Know

Wire Request
https://us.etrade.com/e/t/xferwire/WireXfrAuthentication
我有employee stock plan account,但 要匯款回來的是securities account,可能是這樣所以失敗原來是employee ID填錯了...
Erroneous Employee ID and/or Company ticker match: The employee Id and/or company ticker entered does not match our records please re-enter.

現在這樣是就可以wire回來了(Note: TaiwanXXX)

可是用Security code卻還要Account Holder's Social Security Number...這..這..這..這不是為難我嗎?
這樣也不知道該怎麼匯回來了
Security code需要Social Security, 沒有就不能用

https://us.etrade.com/e/t/xferwire/abalookuppage
Note: Names on the sending and receiving accounts must be the same, even for joint accounts. You may check the registered name(s) on the Change My Info page. If you are wiring funds to an account that is not registered in the same name, please first mail us a notarized Letter of Authorization that is signed by all registered account holders.
問了客服,notarized Letter of Authorization (NLOA) 沒有特定格式,只要填明wire instruction就可以,或者說 從etrade轉出去不提供form啦!! 真的需要的話可以參考轉入的看看轉出怎麼填
Account Transfer Form
https://content.etrade.com/etrade/estation/pdf/Acct_Trans.pdf#xml=http://search1w4m3.etrade.com:8222/inquiraapp/ui.jsp?ui_mode=answer&prior_transaction_id=87317&iq_action=6&answer_id=16777220&highlight_info=16777243,140,161&turl=https%3A%2F%2Fcontent.etrade.com%2Fetrade%2Festation%2Fpdf%2FAcct_Trans.pdf
只是每次要轉就得寄一次。

2009年11月10日 星期二

[etrade]必須要居住在美國才能買基金?

Message from etrade

After reviewing your account, I see that you have a foreign address. Mutual funds are not permitted for investors located outside the US. This is both an E*TRADE requirement as well as a requirement of the mutual fund companies. Their funds are not registered with the appropriate authorities to be sold outside the US. If you live in the US in the future, you will be able to invest in mutual funds at that time.



http://greenhornfinancefootnote.blogspot.com/2007/05/blog-post_936.html?showComment=1195179180000#c7506260630406398277

子飛提到...
我在etrade下單,因為是國際帳戶,所以不讓我買美國國內的開放型基金,因為上述基金是要本人在美國,開國內帳戶才能買,我想請教的是您在firstrade開的是國際帳戶嗎?還是您還在美國時就已經開好得戶頭?

(............)

綠角 提到...
子飛 Firstrade的國際帳戶可以購買美國的基金


message from etrade:
To purchase shares of a U.S.-based mutual fund, you must have a physical address in the United States and have a W-9 Form on file with us to certify your Social Security number or Tax-Identification Number. You can review any individual fund prospectus by bringing up a quote for the fund on our website or visiting the fund company website directly to view eligibility information for the fund.


Vanguard 500 Index Fund Investor Shares (VFINX)
https://personal.vanguard.com/us/funds/snapshot?FundId=0040&FundIntExt=INT -> [View prospectus and reports], page 42, Account Registration Form
Vanguard funds are registered for sale to U.S. residents only.
You must provide your U.S. address on this form.


Download a Fidelity Account® Application
https://scs.fidelity.com/accounts/services/content/fidaccount_details.shtml?tab=MostRequested&source=aong
This account is intended for U.S. residents only with a valid U.S. address. Non-U.S residents should visit our International Investment site.

2009年11月4日 星期三

定期定額 Dollar cost averaging

[wiki] Dollar cost averaging
http://en.wikipedia.org/wiki/Dollar_cost_averaging

Dollar cost averaging is also called DCA and constant dollar plan in the US, pound-cost averaging in the UK, and by the currency-neutral terms unit cost averaging and cost average effect

定時定額申購 Dollar-cost averaging
http://fund.bot.com.tw/z/glossary/glexp_4448.asp.htm

etrade叫Automatic Investment Plan (AIP)
https://us.etrade.com/e/t/pict/automaticinvestment#
firstrade叫Periodic Investment Plan (PIP)
http://www.firstrade.com/public/en_us/productsservices/investmentchoices/mutualfunds/

2009年11月3日 星期二

Individual Retirement Account (IRA)

[wiki] Individual Retirement Account
http://en.wikipedia.org/wiki/Individual_Retirement_Account

retirement plan account that provides some tax advantages for retirement savings in the United States


我看晨星
http://greenhornfinancefootnote.blogspot.com/2007/05/blog-post_2374.html
還有,他們常會提到IRA、401K這些稅務優惠退休帳戶,這些對我們是沒用的論述。


我對Ultra ProShares的看法(2X Volatility Does Not Mean 2X Return)
http://greenhornfinancefootnote.blogspot.com/2008/02/ultra-proshares2x-volatility-does-not.html
 在禁止保證金帳戶裡用於放空:UltraShort ETF可被用於延稅的投資組合(如IRA、Roth IRA、401(k)等等),這些帳戶是不允許進行保證金交易的。有了UltraShort ETF,你就可以透過投資一支基金放空股票


資產配置初步—再平衡的執行策略續2(Asset Allocation in Essence—Rebalancing Strategies)
http://greenhornfinancefootnote.blogspot.com/2008/09/2asset-allocation-in-essencerebalancing.html
是沒錯,在美國可以使用401k或IRA來避免掉稅的問題,但是通常401K或IRA的限制較多,且401K等TSA帳號大部份沒有index fund可供選擇。因此如果要能夠自由選擇投資標的,大概只能用個人一般帳號了,這些提供再平衡策略的作者不知道是否有考慮到稅務的問題,如果要考慮稅的問題,那我個人覺得大概是每年投投資一次,且再平衡的間隔一定要超過一年(366天至少),這樣才能確保是使用(15%)的稅率。
不然就只能開傳統IRA帳戶並且自已操作。但這樣就有59歲半才能提領的限制。在金錢使用上就較沒有彈性了。


Ask Mr. Firstrade 專欄
http://greenhornfinancefootnote.blogspot.com/2008/02/ask-mr-firstrade.html
問:IRA帳戶受益人(Beneficiary)是否一定要有社會安全碼(SSN)?

答: 是的,這是美國國稅局IRS的規定。IRA因為屬於稅益帳戶,功能是幫助美國居民節稅,因此受益人必須填寫有美國SSN的人。其實若您真的擔心您的資產若發生意外海外親人該如何處置,其實最好的方式是一份妥當的Will遺書。只要請證人簽字公證,相信那會是在法院最有力的文件。

W-8BEN Form

Message from etrade:

E*TRADE Securities has updated its Form W-8BEN process to conform with new Internal Revenue Service electronic documentation requirements. In order to ensure that all Form W-8`s will follow this new process we will require you to submit a new IRS Form W-8 to certify your foreign tax status for the account shown above. As a result your current Form W-8 on file will be treated as expiring as of December 31, 2009.

If you do not recertify by December 31, 2009, your account will be subject to a U.S. withholding tax of at least 28% to 30% on all trade gross proceeds, taxable dividends, interest payments, and other taxable payments starting on January 1, 2010. If U.S. tax is withheld, you will need to work with the Internal Revenue Service to obtain any refund.


"W-8BEN Certification of Foreign Status" at etrade.com/forms
http://etrade.com/forms#Tax

http://greenhornfinancefootnote.blogspot.com/2009/06/analysis-of-blackrock-global-allocation.html
W-8 Ben 提報美國IRA, 聲明你為非美國人,不然會有withholding tax 的問題,歐銀或台灣銀行便無此問題,各國的交易稅、所得稅與基金產業政策不同,


http://greenhornfinancefootnote.blogspot.com/2007/08/firstrade.html
另外有一點跟國內不太一樣的是,Firsttrade 本身無法清算,所以他們是委託 Ridge Clearing這一家公司做清算交割(不過你在跟First trade 確認一下,我印象最近好像改Penson這一家公司了),所以你匯的錢並不是匯到Firsttrade 而是清算公司。(scottrade 提到自己的一個優點就是其有清算的能力,所以匯款的帳戶名稱就是scotrade,而如果像firsttrade 倒掉的話,投資人就要找Ridge Clearing 要錢,雖然不會有太大風險,不過總是麻煩)

(...........)

請問綠角, W-8BEN 上 PART II Claim of Tax Treaty Benefits (if applicable) 是否需要勾選? 因為三個選項看起來沒有一樣是符合現況的???

(...........)

目前台灣與美國並沒有簽訂所得稅務條約 我們也不會有Tax treaty benefits 你說的沒錯 這欄空白即可

2009年11月2日 星期一

Giant Yukon 08/09年款的差異

1. 前叉塗裝: 08 XCM, 09 XCM v2
2. 前叉避震: 08年的前叉只能在停止間鎖死,塑膠旋紐;09年的前叉可在行進間鎖死,遷線至手把處切換 (可是也好像有人是旋紐)
3. 後上叉二合一處 的 焊點: 08年 的沒有黑色塞子,是用倒Y型焊接的;09年有一個黑色塞子,看來質感變差


GIANT】YUKON(AS840) 24段變速自行車 $8800
http://buy.yahoo.com.tw/gdsale/gdsale.asp?gdid=673394#
應該是08年款

疑問?這是YUKON哪一年的款式阿?
http://www.mobile01.com/topicdetail.php?f=315&t=712788&p=2#

(........)
車子是09年的,跟08年的差別就在前避震(右邊藍色那個)
改成可在行進間手動旋轉調整前避震的軟硬度
(........)
10800 就一定是09年款,
08年款價格是8800,
如果大大在車行用10800價格買到08年款, 記得留證據, 向巨大(捷安特公司名字)檢舉哦^^
(........)


請問G牌Yukon的08年式與09年式車架塗裝一模一樣嗎?(只有前叉不同嗎?)
http://www.mobile01.com/topicdetail.php?f=315&t=723067&p=1
前叉 -> 08年 XCM, 09年 XCM v2, 兩個都能鎖定, 你看錯了
焊點 -> 後上叉二合一處, 08年 的沒有黑色塞子, 是用倒Y型焊接的, 09年有一個黑色塞子, 看來質感變差
(........)
08和09年的前叉都可以鎖死~~
08年的前叉只能在停止間鎖死
09年的前叉可在行進間鎖死~而且旋鈕也不一樣
(........)


[分享+簽到]08年式 Giant Yukon 銀白色(圖多),歷代Yukon車主簽到簿~
http://www.mobile01.com/topicdetail.php?f=315&t=358946#
07年的Yukon跟08年的Yukon最大差別為外胎使用不同的規格及塗裝的改款
07:Kenda
08:Michelin country trail


(分享)yukon與iguana新車入荷
http://www.mobile01.com/topicdetail.php?f=268&t=355833&p=3
我身高183
體重......哎....我最害怕就是人家問我體重
1xx....x都有4以上數字留給大家去想像吧
17吋的我覺得真的太矮.....因為在踏的時候腳無法完全伸直
如果調太高雖然可以伸直....不過怕椅子下面那根斷掉(體重太重所以怕﹦﹦)
換19吋就覺得滿剛好的
騎車的時候覺得就可以完全出力

2009年11月1日 星期日

USB2.0 do_next_ping

Re: [linux-usb-devel] Scenario: usbtest test-14 failure: MUSBHDRC + Netchip2280
http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg52405.html

Thus, using the PING protocol involves the host switching between two modes: one where it must send a PING and one where it can send an OUT. The phrase "return to using a PING token until the endpoint indicates it has space" means that the host must switch from the second mode back to the first. "return" == return to the first mode. "using a PING token" == send a PING before doing another OUT != send a PING.

http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg52356.html
It says "return to using a PING token". As I mentioned above, that is
different from "send a PING".


EHCI r1.0, p.89
3 A Nyet response to an OUT means that the device has accepted the data, but cannot receive any more at this time. Host must (1)advance the transfer state and additionally, (2)transition the Ping State bit to Do Ping.

The Ping State bit has the following encoding:
Value:Meaning
0B: Do OUT The host controller will use an OUT PID during the next bus transaction to this endpoint.
1B: Do Ping The host controller will use a PING PID during the next bus transaction to this endpoint.

The defined ping protocol (see USB 2.0 Specification, Chapter 8) allows the host to be imprecise on the initialization of the ping protocol (i.e. start in Do OUT when we don't know whether there is space on the device or not).

The host controller manages the Ping State bit. System software sets the initial value in the queue head when it initializes a queue head. The host controller preserves the Ping State bit across all queue advancements. This means that when a new qTD is written into the queue head overlay area, the previous value of the Ping
State bit is preserved.
So, upon receiving NYET, one don't have to send Ping immediately. Ping can be deferred to the point before sending next OUT.

USB 2.0 Specification, 8.5.1 NAK Limiting via Ping Flow Control, p.217
If the endpoint instead responds to the OUT/DATA transaction with a NYET handshake, this means that the endpoint accepted the data but does not have room for another wMaxPacketSize data payload. The host controller must return to using a PING token until the endpoint indicates it has space.