股息排名 | 个股名称 | 最近的季度股息 | 占巴菲特投资组合的比重 | 市值(亿美元) | 市盈率 |
1 | 葛兰素史克公司(GSK) | 5% | 0.1% | 1066 | 20.7 |
2 | 康菲石油(COP) | 4% | 4.2% | 917 | 8.4 |
3 | 赛诺菲(SNY) | 4% | 0.3% | 889 | 19.6 |
4 | M&T银行(MTB) | 3.9% | 0.9% | 90 | 10.2 |
5 | 通用电气(GE) | 3.7% | 0.3% | 1715 | 12.6 |
6 | 强生(JNJ) | 3.6% | 5.4% | 1758 | 15.3 |
7 | 宝洁(PG) | 3.3% | 9.3% | 1754 | 16.2 |
8 | 卡夫食品(KFT) | 3.3% | 5.7% | 616 | 20.2 |
9 | UPS(UPS) | 3.2% | 0.2% | 485 | 16.2 |
10 | Gannett(GCI) (媒体股) | 3.2% | 0.05% | 24 | 4.5 |
Friday, September 30, 2011
巴菲特所持10只高股息股票
新浪财经讯 北京时间9月30日下午消息,据外电报道,根据“股神”巴菲特麾下伯克希尔-哈撒韦公司最新披露的季度监管文件显示,财经网站TheStreet.com列出了巴菲特所持的10只高股息股票。
Friday, September 23, 2011
Mac OS Lion: New Wi-Fi Diagnostics tool & Troubleshooting Solutions
Inside Mac OS X 10.7 Lion: New Wi-Fi Diagnostics tool
http://www.appleinsider.com/articles/11/03/15/inside_mac_os_x_1
WiFi Dropping in OS X Lion? Here are Some Wireless Troubleshooting Solutions
http://osxdaily.com/2011/07/22/wifi-dropping-in-os-x-lion-fixes
http://www.appleinsider.com/articles/11/03/15/inside_mac_os_x_1
WiFi Dropping in OS X Lion? Here are Some Wireless Troubleshooting Solutions
http://osxdaily.com/2011/07/22/wifi-dropping-in-os-x-lion-fixes
Wednesday, September 14, 2011
How to delete database data file
1.DBCC SHRINKFILE('logical_file_name', EMPTYFILE).
2.After that, the file dropped with no problems.
2.After that, the file dropped with no problems.
Monday, September 12, 2011
成功人的特質
1. 目標具體
“我想掉5磅”的目標比“我想減肥”就要好得多。
2. 開始時間具體
不要定個目標就立刻把它忘了。
3. 追蹤進展
時刻檢查自己離目標還有多遠。
4. 既樂觀主義又現實
5. 希望做到更好,而不是只做好
很多人相信能力天生無法逾越,其實潛能是能不斷開發的。
6. 持之以恆
7. 意志力
意志力可以磨練。做一些自己平常不挑戰自己的事情,如:放棄零食,每天100個仰臥起坐,學習新技能。開始覺得犯懶了吧?不行!再堅持堅持!
8. 認清事實不好高騖遠
比如,意志力磨練一個一個來,不要一鍋端想一口吃成大胖子。
9. 多看“我想做的事”少看“我不想做的事”
因為人性就是看到“Don't push the button”的時候你就會想去push the button。戒菸的時候老想著戒菸只會不停給自己誘惑,不如多想想你用來代替吸煙的那個活動。
“我想掉5磅”的目標比“我想減肥”就要好得多。
2. 開始時間具體
不要定個目標就立刻把它忘了。
3. 追蹤進展
時刻檢查自己離目標還有多遠。
4. 既樂觀主義又現實
5. 希望做到更好,而不是只做好
很多人相信能力天生無法逾越,其實潛能是能不斷開發的。
6. 持之以恆
7. 意志力
意志力可以磨練。做一些自己平常不挑戰自己的事情,如:放棄零食,每天100個仰臥起坐,學習新技能。開始覺得犯懶了吧?不行!再堅持堅持!
8. 認清事實不好高騖遠
比如,意志力磨練一個一個來,不要一鍋端想一口吃成大胖子。
9. 多看“我想做的事”少看“我不想做的事”
因為人性就是看到“Don't push the button”的時候你就會想去push the button。戒菸的時候老想著戒菸只會不停給自己誘惑,不如多想想你用來代替吸煙的那個活動。
Sunday, August 21, 2011
How to move TempDB to another drive.
Open Query Analyzer and connect to your server. Run this script to get the names of the files used for TempDB.
Results will be something like:
name fileid filename filegroup size
——- —— ————————————————————– ———- ——-
tempdev 1 C:Program FilesMicrosoft SQL ServerMSSQLdatatempdb.mdf PRIMARY 16000 KB
templog 2 C:Program FilesMicrosoft SQL ServerMSSQLdatatemplog.ldf NULL 1024 KB
along with other information related to the database. The names of the files are usually tempdev and demplog by default. These names will be used in next statement.
=========================================
Run following code, to move mdf and ldf files.
The definition of the TempDB is changed. However, no changes are made to TempDB till SQL Server restarts. Please stop and restart SQL Server and it will create TempDB files in new locations.
USE TempDB
GO
EXEC sp_helpfile
GO
Results will be something like:
name fileid filename filegroup size
——- —— ————————————————————– ———- ——-
tempdev 1 C:Program FilesMicrosoft SQL ServerMSSQLdatatempdb.mdf PRIMARY 16000 KB
templog 2 C:Program FilesMicrosoft SQL ServerMSSQLdatatemplog.ldf NULL 1024 KB
along with other information related to the database. The names of the files are usually tempdev and demplog by default. These names will be used in next statement.
=========================================
Run following code, to move mdf and ldf files.
USE master
GO
ALTER DATABASE TempDB MODIFY FILE
(NAME = tempdev, FILENAME = 'd:datatempdb.mdf')
GO
ALTER DATABASE TempDB MODIFY FILE
(NAME = templog, FILENAME = 'e:datatemplog.ldf')
GO
The definition of the TempDB is changed. However, no changes are made to TempDB till SQL Server restarts. Please stop and restart SQL Server and it will create TempDB files in new locations.
Friday, August 19, 2011
股票止损点的设定
Investor's Business Daily(http://www.investors.com/)的创办人O'Nile在他的How to Make Money in Stocks (http://www.amazon.com/How-Make-Money-Stocks-Winning/dp/0071373616/ref=pd_bbs_1?ie=UTF8&s=books&qid=1195145200&sr=8-1) 的书里提到,他用8%的止损,当股票收益超过20%的时候,他套利,除非该股票在半年内(我可能记错)的收益就已经达到了20%,这种情况,他会继续持 有。这个8%是目前比较常用的止损。为什么是8%呢,这跟O'Nile的20%套利有关。好的Trader每次进货前都要评估他的这次交易的Risk Reward Ratio。一般至少都要1:2,这样才能保证输两单,只要赚一单回来就不赔钱了。O'Nile的20%基本上是8%的两倍。
另外还有一个基本规则,被一个叫Turtle Trading的Group采用,就是说Never risk more than 2% of your total capital。简单的说你有100,000,那你每单所允许的最大损失就不能超过2,000。
好了,加上我们上面说的8%的止损,那么我们就得到你每只股票最多能投入多少钱:2000/0.08 = 25,000。这是最基本的风险保护了。
8%呢,有个问题,有的股票波动非常大,每天的波幅可能都会有8%,这就使得8%的止损很容易被触发。而有的股票呢,波动非常小,每天的波幅可能只 有1%,这又使得8%的止损过大。专业一点的Trader呢,会用一个叫Average True Range(ATR)的东东来定止损。什么是Average True Range呢,简单得讲,就是计算一定时间段(通常是10天)的股票每天的波动幅度,然后平均一下,这就是10 days average range,所谓的True Range呢,是把跳空的情况也计算在内了,这样得到的平均交易区间就比较精确。实际使用中当然这个ATR还要乘上,比如说2,这样的理由是股票不可能一 天的波幅超过它平均波幅的两倍。根据这个方法,假设我们有只股票的ATR10的值为0.18,那么ATR10 * 2就是0.36,你最多能在这个股票上投资2000/0.36 = 5555.55。
以上是最基本的风险控制了,每次买入股票,切记切记,第一件事就是设定止损。关于设定止损,我会另有介绍,解释两个注意点。
那么再高级点的呢,我就不详细说了,没有经验的不建议使用。
1. Swing Low,最简单的例子是用三天前的最低价做stop。理由嘛,我既然看涨,那么就应该涨,如果错了,那就早点割吧。
2. Moving Average,这个就是为什么50日,200日等等均线很重要的原因,很多长期投资的都会将止损设在这附近,这个这个,我是MM,我就猛砸,砸过这两根线去,肯定有收获。嗯,其他MM可能不干,所以砸也是有风险的。
3. 特定时间内的最大Range。比如你通常持有股票的时间为20天,那你就用该股票前20天内最大的Range,当然要计算跳空的部分。
4. Risk Reward Ratio,这个解释很麻烦,总之,要找个Risk低的点,通常是个Narrow Range,就是说很小的蜡烛,然后,这个这个。
5. 时间止损。比如持有不超过一周,又比如,两周内如果收益低于多少多少。
6. Parabolic SAR。这个自己看。http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:parabolic_sar
source: http://www.hutong9.net/forum.php?mod=viewthread&tid=30816
Wednesday, August 17, 2011
使用程序分析IIS日志文件
不过,目前的日志分析工具并不是很完善,有些功能并不具备,特别是针对某个URL地址进行攻击的分析并不多,下面是一个VB Script程序,保存为VBS程序后可以在服务器上运行,用于分析和检测IIS日志里针对某个URL地址进行攻击的IP地址。
分析出来的IP如果出现异常,可以通过程序,将其批量添加到IIS的屏蔽IP列表里,下面是网上找到的一段VBScript代码,将其改名为vbs后,把上面那段程序的IP导入,即可批量屏蔽攻击者的IP地址。
'代码开始
targeturl = "/archives/2761.html" '受攻击网站的URL地址。
logfilepath = "C:\LogFiles\W3SVC\ex110813.log" '受攻击网站的日志路径。
On Error Resume Next
Set fileobj = CreateObject("scripting.filesystemobject")
Set fileobj2 = CreateObject("scripting.filesystemobject")
Set myfile = fileobj2.opentextfile(logfilepath, 1, False)
Do While myfile.atendofstream <> True
myline = myfile.readline()
myline2 = Split(myline, " ")
newip = myline2(9)
myurl = myline2(5)
If targeturl = myurl Then
writelog newip
End If
Loop
myfile.Close
Set fileobj2 = Nothing
Msgbox "结束."
Sub writelog(errmes)
ipfilename = "blockip.txt"
Set logfile = fileobj.opentextfile(ipfilename, 8, True)
logfile.writeline errmes
logfile.Close
Set logfile = Nothing
End Sub
'代码结束
targeturl = "/archives/2761.html" '受攻击网站的URL地址。
logfilepath = "C:\LogFiles\W3SVC\ex110813.log" '受攻击网站的日志路径。
On Error Resume Next
Set fileobj = CreateObject("scripting.filesystemobject")
Set fileobj2 = CreateObject("scripting.filesystemobject")
Set myfile = fileobj2.opentextfile(logfilepath, 1, False)
Do While myfile.atendofstream <> True
myline = myfile.readline()
myline2 = Split(myline, " ")
newip = myline2(9)
myurl = myline2(5)
If targeturl = myurl Then
writelog newip
End If
Loop
myfile.Close
Set fileobj2 = Nothing
Msgbox "结束."
Sub writelog(errmes)
ipfilename = "blockip.txt"
Set logfile = fileobj.opentextfile(ipfilename, 8, True)
logfile.writeline errmes
logfile.Close
Set logfile = Nothing
End Sub
'代码结束
'代码开始
'/*=========================================================================
' * Intro VBScript使用ADSI为IIS批量添加屏蔽或允许访问的IP
' * FileName VBScript-ADSI-IIS-Add-Deny-Grant-IP-Change-MetaBase.xml.vbs
' *==========================================================================*/
'AddDenyIP2All "192.168.1.106,255.255.255.0"
'AddDenyIP "123456","127.0.0.1"
'AddDenyIP2All "14.113.226.116"
'添加要屏蔽的IP或一组计算机,到一个指定站点上
Sub AddDenyIP(strWebNo, strDenyIp)
On Error Resume Next
Set SecObj = GetObject("IIS://LocalHost/W3SVC/" & strWebNo & "/Root")
Set MyIPSec = SecObj.IPSecurity
MyIPSec.GrantByDefault = True
IPList = MyIPSec.IPDeny
i = UBound(IPList) + 1
ReDim Preserve IPList(i)
IPList(i) = strDenyIp
MyIPSec.IPDeny = IPList
SecObj.IPSecurity = MyIPSec
SecObj.Setinfo
End Sub
'添加要屏蔽的IP或一组计算机,到IIS公共配置,以应用到所有站点
'如果之前对有些站点单独做过屏蔽IP设置,在些设置不会生效,得在总的网站上设置一下,然后覆盖所有子结点
Sub AddDenyIP2All(strDenyIp)
On Error Resume Next
Set SecObj = GetObject("IIS://LocalHost/W3SVC")
Set MyIPSec = SecObj.IPSecurity
MyIPSec.GrantByDefault = True
IPList = MyIPSec.IPDeny
i = UBound(IPList) + 1
ReDim Preserve IPList(i)
IPList(i) = strDenyIp
MyIPSec.IPDeny = IPList
SecObj.IPSecurity = MyIPSec
SecObj.Setinfo
End Sub
'添加允许的IP或一组计算机,到一个指定站点上
Sub AddGrantIP(strWebNo, strGrantIp)
On Error Resume Next
Set SecObj = GetObject("IIS://LocalHost/W3SVC/" & strWebNo & "/Root")
Set MyIPSec = SecObj.IPSecurity
MyIPSec.GrantByDefault = False
IPList = MyIPSec.IPGrant
i = UBound(IPList) + 1
ReDim Preserve IPList(i)
IPList(i) = strGrantIp
MyIPSec.IPGrant = IPList
SecObj.IPSecurity = MyIPSec
SecObj.Setinfo
End Sub
'添加允许的IP或一组计算机,到IIS公共配置,以应用到所有站点
'如果之前对有些站点单独做过屏蔽IP设置,在些设置不会生效,得在总的网站上设置一下,然后覆盖所有子结点
Sub AddGrantIP2All(strGrantIp)
On Error Resume Next
Set SecObj = GetObject("IIS://LocalHost/W3SVC")
Set MyIPSec = SecObj.IPSecurity
MyIPSec.GrantByDefault = False
IPList = MyIPSec.IPGrant
i = UBound(IPList) + 1
ReDim Preserve IPList(i)
IPList(i) = strGrantIp
MyIPSec.IPGrant = IPList
SecObj.IPSecurity = MyIPSec
SecObj.Setinfo
End Sub
'显示IIS公共配置里禁止访问的IP
Sub ListDenyIP()
Set SecObj = GetObject("IIS://LocalHost/W3SVC")
Set MyIPSec = SecObj.IPSecurity
IPList = MyIPSec.IPDeny 'IPGrant/IPDeny
WScript.Echo Join(IPList, vbCrLf)
' For i = 0 To UBound(IPList)
' WScript.Echo i + 1 & "-->" & IPList(i)
' Next
End Sub
source: http://www.williamlong.info/archives/2771.html
'/*=========================================================================
' * Intro VBScript使用ADSI为IIS批量添加屏蔽或允许访问的IP
' * FileName VBScript-ADSI-IIS-Add-Deny-Grant-IP-Change-MetaBase.xml.vbs
' *==========================================================================*/
'AddDenyIP2All "192.168.1.106,255.255.255.0"
'AddDenyIP "123456","127.0.0.1"
'AddDenyIP2All "14.113.226.116"
'添加要屏蔽的IP或一组计算机,到一个指定站点上
Sub AddDenyIP(strWebNo, strDenyIp)
On Error Resume Next
Set SecObj = GetObject("IIS://LocalHost/W3SVC/" & strWebNo & "/Root")
Set MyIPSec = SecObj.IPSecurity
MyIPSec.GrantByDefault = True
IPList = MyIPSec.IPDeny
i = UBound(IPList) + 1
ReDim Preserve IPList(i)
IPList(i) = strDenyIp
MyIPSec.IPDeny = IPList
SecObj.IPSecurity = MyIPSec
SecObj.Setinfo
End Sub
'添加要屏蔽的IP或一组计算机,到IIS公共配置,以应用到所有站点
'如果之前对有些站点单独做过屏蔽IP设置,在些设置不会生效,得在总的网站上设置一下,然后覆盖所有子结点
Sub AddDenyIP2All(strDenyIp)
On Error Resume Next
Set SecObj = GetObject("IIS://LocalHost/W3SVC")
Set MyIPSec = SecObj.IPSecurity
MyIPSec.GrantByDefault = True
IPList = MyIPSec.IPDeny
i = UBound(IPList) + 1
ReDim Preserve IPList(i)
IPList(i) = strDenyIp
MyIPSec.IPDeny = IPList
SecObj.IPSecurity = MyIPSec
SecObj.Setinfo
End Sub
'添加允许的IP或一组计算机,到一个指定站点上
Sub AddGrantIP(strWebNo, strGrantIp)
On Error Resume Next
Set SecObj = GetObject("IIS://LocalHost/W3SVC/" & strWebNo & "/Root")
Set MyIPSec = SecObj.IPSecurity
MyIPSec.GrantByDefault = False
IPList = MyIPSec.IPGrant
i = UBound(IPList) + 1
ReDim Preserve IPList(i)
IPList(i) = strGrantIp
MyIPSec.IPGrant = IPList
SecObj.IPSecurity = MyIPSec
SecObj.Setinfo
End Sub
'添加允许的IP或一组计算机,到IIS公共配置,以应用到所有站点
'如果之前对有些站点单独做过屏蔽IP设置,在些设置不会生效,得在总的网站上设置一下,然后覆盖所有子结点
Sub AddGrantIP2All(strGrantIp)
On Error Resume Next
Set SecObj = GetObject("IIS://LocalHost/W3SVC")
Set MyIPSec = SecObj.IPSecurity
MyIPSec.GrantByDefault = False
IPList = MyIPSec.IPGrant
i = UBound(IPList) + 1
ReDim Preserve IPList(i)
IPList(i) = strGrantIp
MyIPSec.IPGrant = IPList
SecObj.IPSecurity = MyIPSec
SecObj.Setinfo
End Sub
'显示IIS公共配置里禁止访问的IP
Sub ListDenyIP()
Set SecObj = GetObject("IIS://LocalHost/W3SVC")
Set MyIPSec = SecObj.IPSecurity
IPList = MyIPSec.IPDeny 'IPGrant/IPDeny
WScript.Echo Join(IPList, vbCrLf)
' For i = 0 To UBound(IPList)
' WScript.Echo i + 1 & "-->" & IPList(i)
' Next
End Sub
source: http://www.williamlong.info/archives/2771.html
Subscribe to:
Posts (Atom)