Wild China
推荐一部影片《Wild China》,中文名:《美丽中国》,由BBC和CCTV合作拍摄。不同于我们常看到的官方版本的、从大处着眼的纪录片,本片从细微处出发,用细腻的画面(高清)和优美的音乐描绘出一个普通人所熟悉的人与自然间的和谐社会…
http://www.bbc.co.uk/sn/tvradio/programmes/wildchina/
http://www.imdb.com/title/tt0884762/
[ad]
推荐一部影片《Wild China》,中文名:《美丽中国》,由BBC和CCTV合作拍摄。不同于我们常看到的官方版本的、从大处着眼的纪录片,本片从细微处出发,用细腻的画面(高清)和优美的音乐描绘出一个普通人所熟悉的人与自然间的和谐社会…
http://www.bbc.co.uk/sn/tvradio/programmes/wildchina/
http://www.imdb.com/title/tt0884762/
[ad]
89年出生的她
来北京唱歌已经有四年的时间
上天给了她一副好嗓子
但也给了她一个不幸的家庭
让她经历了不同寻常的心酸
一个搞笑的小孩,到处都是国庆报道,看看下面的视频,放松一下
[ad]
PHProxy(http://sourceforge.net/projects/poxy/),是一款PHP代理程序,它的好处是:让你在受限网络环境下,访问被禁止的网站,它的典型使用情况如下:
当然不是每个人都可以使用它的,前提是:
Anonymous Proxies. HostMonster.Com does not allow the use of anonymous proxy scripts on its servers. They can be very abusive to the server resources, affecting all users on that server.
安装PHProxy后,我发现,用它来访问普通网站,是没有问题的,你无需修改它的代码,但是如果你用来访问被GFW墙掉的网站,就不行了。比如:http://www.twitter.com
为什么呢?因为PHProxy首先会将你访问的网站URL,缺省进行一次Base64编码,所以twitter的URL就变成了aHR0cDovL3d3dy50d2l0dGVyLmNvbQ==,然后才进行一次URLEncode编码,变成了aHR0cDovL3d3dy50d2l0dGVyLmNvbQ%3D%3D,而这个字符串大概已经上了GFW的黑名单,不信的话,你用Google搜索下:aHR0cDovL3d3dy50d2l0dGVyLmNvbQ%3D%3D,你的浏览器立刻被重置。
知道原因就简单了,我们只要修改PHProxy,在URL->Base64 Encoder->URL Encoder这个过程后,再加上一道自己定义的编码即可,比如,你把每个字符都加1,解码的时候,再反过来做即可。GFW只会把这些知名站点的URL的用缺省编码加入黑名单,不可能把你新方法加工后的字符串也加入黑名单,因为太多了。
下面做个实际的例子,比如我们可以在编码URL后,将前2位调换到尾部,解码的时候做相反的操作:
else if ($_flags['base64_encode'])
{
function encode_url($url)
{
$tmp = rawurlencode(base64_encode($url));
$head = substr($tmp, 0, 2);
$tail = substr($tmp, 2);
return $tail.$head;
// return rawurlencode(base64_encode($url)); }
function decode_url($url)
{
$head = substr($url, -2);
$tail = substr($url, 0, strlen($url) -2);
$url = $head.$tail;
return str_replace(array(‘&’, ‘&’), ‘&’, base64_decode(rawurldecode($url)));
}
}
上面的代码,我已经验证,可以逃过GFW的封锁。你可以用你自己的喜欢的方式,替换绿色的部分。
注:PHProxy还可以使用ROT13编码,但同样也被屏蔽了,请做同样的Hack。
[ad]
MySQL是个非常优秀的免费数据库,下面是我周末做Data Purge的部分记录,可以用做将来的参考之用:
硬件:AMD Opteron 265 1.8G(Cache 1M), RAM:1G, HD: 350G,算是配置比较差的一台服务器。请注意,下面所提到的数据和您的服务器性能有很大的关系。
// Delete Data
2009-09-03 19:45:45 Start…
Row Count: 46500394(46M)
DELETE FROM atedata WHERE DATE < ’2009-06-01 00:00:00′
Row Count: 22699749(22M)
2009-09-03 21:18:06 End…
从上面可以看出,删除数据是比较慢的操作,46M条的数据,删除到22M条,总共用了大概93分钟,大概255,921rows/min。删除操作所需时间主要和将要删除的数据量是成正比的,删除的记录数越多,所用的时间也越多。
// Optimize Table
2009-09-04 21:33:54 Start…
Row Count: 23051455(23M) – 7.1GiB
optimize table atedata
Row Count: 23051455(23M) – 3.4GiB
2009-09-04 22:15:37 End…
对于数据量比较大的表,比如超过1G,如果只是简单的用DELETE删除了数据,这些数据所占据的磁盘空间并没有被释放,在MySQL里我们称之为:Overhead。只有对表做了OPTIMIZE操作,才能真正的释放它。
从上面的数据可以看出,优化前,表大小是7.1G,优化后表大小为3.4G,表的记录数没有变化,用时42分钟,平均88MiB每分钟。该操作耗时大致和(Table Size – Overhead)的差成正比。对于那种比较大的表,千万不要删除了几百条记录就做Optimize操作,因为它太耗费时间了,我们可以累积到一定数量再做。
Optimize命令执行后,MySQL会生产一个临时的.TMD文件,MySQL的状态显示Repair by sorting,它其实就是优化后的表。这个过程很漫长,做完后,还有一步是重建索引,MySQL状态显示Repair with Keycache,结束的时候会有个.TMM的临时文件生成,它可能就是.MYI文件的拷贝,不过官方文档没有说明,只是猜测。
在创建索引文件的过程中(Repair with Keycache),它的耗时和表的索引多少有很大的关系,我没有验证,但我们可以猜测:索引越多,这个过程就越长。
由于在表很大的情况下,做类似DELETE、OPTIMIZE、ALTER等操作,都是非常的耗时间,所以我们在设计系统的时候就需要提前考虑到:
如果数据量不大的话,另当别论。
[ad]
如果你常用Twitter,想把tweets显示在你的网站或者Blog上,该怎么办?最简单的方式是用Twitter官方的一个JavaScript,可由于功夫网的缘故,在中国的用户无法使用它,如果你有自己的网站或者Blog,且位于墙外,下面的一段PHP代码可以达到你的目的:
// 读取Twitter的函数
function twitter_process($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_USERAGENT, 'super_man');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
$response_info = curl_getinfo($ch);
curl_close($ch);
switch(intval($response_info['http_code']))
{
case 200:
$json = json_decode($response);
if ($json)
return $json;
return $response;
case 401:
default:
// NOOP
}
}
// 显示tweets在你的网站
$o = twitter_process("http://twitter.com/statuses/user_timeline/charry.json?count=5");
for ($i = 0; $i < count($o); $i++)
{
$item = $o[$i];
echo "<li>";
echo $item->{‘text’};
echo " – ".$item->{‘created_at’};
echo "</li>";
}
[ad]
最近在看《家园》,一部描述地球,这个人类赖以生存的蓝色星球的纪录片。片中描述了人类文明的诞生与发展,导演用华丽的画面来控诉近几十年来人类对环境的破坏,而这些几乎不可逆转的破坏,使得我们的家园危机重重。
这是一部你值得关注的影片,据说北京最近有免费的公映,有机会的朋友可以去观摩一下,顺便给自己敲一个警钟。
有网友写影评如是:身为屠刀,我如何放下屠刀,请注意第一行字,别误解了作者。
另外:
我注意到一个和本片主题不太相关的内容:美国有农民300万,而生产的粮食可以养活20亿。不知道是否是真的如此,假如是:我们政府经常宣传的,7%的土地养活了22%的人口,实在是不值得一提。况且Google一下,似乎很多人对这个表述有所怀疑。
[ad]
My Profile: http://www.google.com/profiles/charry.tar.gz
Bad news is: I can’t access this special link with Chrome, I got the following:
[ad]
Rule is powerful tool to help you organize your email in Outlook, but sometimes, it still doesn’t meet your expectation, so anything else you could do? just wait Microsoft to add more features in next release of Outlook? I guess this isn’t what you expected. If you’re familiar with VBA, use Macro instead of Rule, because of the flexibility of VBA, you can hack it and custom it as you wish, I believe you’ll find out more advanced features of Outlook, even if you’re a newbie of VBA, it’s okay, VBA is not designed for geeks in the first place, you could get how to use it in several minutes, below is an example:
Sub BackupSentMail()
Set OutApp = CreateObject("Outlook.Application")
Set NmSpace = OutApp.GetNamespace("MAPI")
Set BackupSent = NmSpace.Folders("Sent").Folders("ALL")
Set DefaultSent = NmSpace.GetDefaultFolder(5)
For intX = DefaultSent.Items.Count To 1 Step -1
Set objMessage = DefaultSent.Items.Item(intX)
objMessage.Move BackupSent
Next
Set OutApp = Nothing
Set NmSpace = Nothing
Set BackupSent = Nothing
Set DefaultSent = Nothing
End Sub
Sub CustomMailMessageRule(Item As Outlook.MailItem)
Set OutApp = CreateObject("Outlook.Application")
Set NmSpace = OutApp.GetNamespace("MAPI")
Set folderOnlyToMe = NmSpace.Folders("Main").Folders("OnlyToMe")
Set folderTrash = NmSpace.Folders("Main").Folders("Trash")
Set folderSWS = NmSpace.Folders("SWS").Folders("ALL")
Set folderIntegration = NmSpace.Folders("Integration").Folders("ALL")
Set folderIntegrationDev = NmSpace.Folders("Integration").Folders("Dev.")
Set folderIncoming = NmSpace.Folders("Main").Folders("Incoming")
”””””””””””””””’
‘ Set Flag
”””””””””””””””’
‘ Sent by bosses
If Item.SenderName = "Gates, Bill" Or _
Item.SenderName = "Jackson, Michael" Or _
Item.SenderName = "Jong, John" Then
Item.FlagStatus = olFlagMarked
Item.FlagIcon = olOrangeFlagIcon
Item.Save
MsgBox Item.Subject, vbInformation, "Here comes a new msg"
End If
”””””””””””””””’
‘ Trash Filter
”””””””””””””””’
If Item.SenderEmailAddress = "hqadmin@antispam.charry.org" Or _
Item.SenderEmailAddress = "OPN_validation_system@antispam.charry.org" Or _
Item.SenderEmailAddress = "MES_AUTO_LOT_HOLD@antispam.charry.org" Or _
Item.SenderEmailAddress = "MTEPP_Detection_System@antispam.charry.org" Or _
Item.SenderEmailAddress = "szcpp113@antispam.charry.org" Or _
Item.SenderEmailAddress = "szcpp111@antispam.charry.org" Or _
Item.SenderEmailAddress = "szcpp233@antispam.charry.org" Or _
Item.SenderEmailAddress = "szcpp231@antispam.charry.org" Or _
Item.SenderEmailAddress = "yammer@yammer.com" Or _
Item.SenderEmailAddress = "Unfuse_units_detection_system@antispam.charry.org" Then
Item.Move folderTrash
GoTo CleanUp
End If
If Item.To = "fbdaemon@szasptgh101.amd.com" Then
Item.Move folderTrash
GoTo CleanUp
End If
‘ SVN_INTDEV
If InStr(Item.SenderEmailAddress, "@soulcutter.amd.com") > 0 Then
Item.Move folderTrash
GoTo CleanUp
End If
‘ EDA Daily Report
If Item.SenderEmailAddress = "The_Software_Services_Team@antispam.charry.org" Then
Item.Move NmSpace.Folders("Misc").Folders("EDA Report")
GoTo CleanUp
End If
‘ Title Filter
If InStr(Item.Subject, "ex-factory utilization report") > 0 Then
Item.Move folderTrash
GoTo CleanUp
End If
”””””””””””””””’
‘ Normal Filter
”””””””””””””””’
‘ to me
MyPos = InStr(Item.To, "Charry")
If MyPos > 0 Then
Item.Move folderOnlyToMe
GoTo CleanUp
End If
‘ cc me
MyPos = InStr(Item.CC, "Charry")
If MyPos > 0 Then
Item.Move folderOnlyToMe
GoTo CleanUp
End If
‘ to dl.suz_sws
MyPos = InStr(Item.To, "dl.suz_sws")
If MyPos > 0 Then
Item.Move folderSWS
GoTo CleanUp
End If
‘ cc dl.suz_sws
MyPos = InStr(Item.CC, "dl.suz_sws")
If MyPos > 0 Then
Item.Move folderSWS
GoTo CleanUp
End If
‘ GMail
If Item.To = "hi@antispamp.charry.org" Or Item.To = "charrywong@ggggggmail.com" Then
Item.Move NmSpace.Folders("Misc").Folders("charry.org")
GoTo CleanUp
End If
Item.Move folderIncoming
CleanUp:
Set OutApp = Nothing
Set NmSpace = Nothing
Set folderOnlyToMe = Nothing
Set folderTrash = Nothing
Set folderSWS = Nothing
Set folderIntegration = Nothing
End Sub
Sub CustomMeetingRequestRule(Item As Outlook.MeetingItem)
MsgBox "Meeting request arrived: " & Item.Subject
End Sub
How do we activate the code above? first of all, you should create a macro in Visual Basic Editor(press ALT+F11 to call this editor), afterwards, paste the code above to the editor and save, then you need to create a rule and make the rule applies to all emails(there’s a time span option in wizard, you could set the new rule for all email received before year 2099), then you’ll see an option to let you run a script when you received an email, the following steps are straightforward.
The code snippet I posted here is just a reference, Google VBA+Outlook, you will get more examples. Focus on the email itself rather than organizing email. See, you’re just one step away from an effective and efficient working way.
[ad]