MD5的全稱是Message-Digest Algorithm 5,在90年代初由MIT的計算機科學實驗室和RSA Data Security Inc 發明,由 MD2/MD3/MD4 發展而來的。MD5的實際應用是對一段Message(字節串)產生fingerprint(數字指紋,MD5值就是指經MD5計算得到的這種數字指紋。),可以防止被“篡改”。舉個例子,天天安全網提供下載的MD5校驗值軟件WinMD5.zip,其MD5值是1e07ab3591d25583eff5129293dc98d2,但你下載該軟件后計算MD5發現其值卻是81395f50b94bb4891a4ce4ffb6ccf64b,那說明該ZIP已經被他人修改過,那還用不用該軟件那你可自己琢磨著看啦。
MD5廣泛用于加密和解密技術上,在很多操作系統中,用戶的密碼是以MD5值(或類似的其它算法)的方式保存的,用戶登錄的時候,系統是把用戶輸入的密碼計算成MD5值,然后再去和系統中保存的MD5值進行比較,來驗證該用戶的合法性。
MD5校驗值軟件WinMD5.zip漢化版使用極其簡單,運行該軟件后,
把需要計算MD5值的文件用鼠標拖到正在處理的框里邊,下面將直接顯
示其MD5值以及所測試的文件名稱,可以保留多個文件測試的MD5值,
選定所需要復制的MD5值,用CTRL+C就可以復制到其它地方了。
posted @
2010-07-14 11:11 margin 閱讀(190) |
評論 (0) |
編輯 收藏
http://www.codeguru.com/forum/showthread.php?t=431298This problem arises when A 64-bit pointer was truncated to a 32-bit int or 32-bit long.
This warning is only issued when
/Wp64 is used.
From MSDN
Quote:
Error Message 'variable' : pointer truncation from 'type' to 'type'
This warning detects 64-bit portability issues. For example, if code is compiled on a 64-bit platform, the value of a pointer (64 bits) will be truncated if it is assigned to an int (32 bits).
|
See
/Wp64
Quote:
Detects 64-bit portability problems on types that are also marked with the __w64 keyword. /Wp64
/Wp64 is off by default in the Visual C++ 32-bit compiler and on by default in the Visual C++ 64-bit compiler.
Variables of the following types are tested on a 32-bit operating system as if they were being used on a 64-bit operating system:
If you regularly compile your application with a 64-bit compiler, you may want to disable /Wp64 in your 32-bit compilations, as the 64-bit compiler will detect all issues. For more information about targeting a Windows 64-bit operating system, see 64-Bit Programming with Visual C++.
To set this compiler option in the Visual Studio development environment
- Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.
- Click the C/C++ folder.
- Click the General property page.
- Modify the Detect 64-bit Portability Issues property.
To set this compiler option programmatically
- use Detect64BitPortabilityProblems.
|
Also, Have a look
Rules for Using Pointers.
Quote:
Rules for Using Pointers
Porting your code to compile for both 32- and 64-bit Microsoft® Windows® is straightforward. You need only follow a few simple rules about casting pointers, and use the new data types in your code. The rules for pointer manipulation are as follows.
- Do not cast pointers to int, long, ULONG, or DWORD. If you must cast a pointer to test some bits, set or clear bits, or otherwise manipulate its contents, use the UINT_PTR or INT_PTR type. These types are integral types that scale to the size of a pointer for both 32- and 64-bit Windows (for example, ULONG for 32-bit Windows and _int64 for 64-bit Windows). For example, assume you are porting the following code:
ImageBase = (PVOID)((ULONG)ImageBase | 1);
As a part of the porting process, you would change the code as follows:
ImageBase = (PVOID)((ULONG_PTR)ImageBase | 1);
Use UINT_PTR and INT_PTR where appropriate (and if you are uncertain whether they are required, there is no harm in using them just in case). Do not cast your pointers to the types ULONG, LONG, INT, UINT, or DWORD.
Note that HANDLE is defined as a void*, so typecasting a HANDLE value to a ULONG value to test, set, or clear the low-order 2 bits is an error on 64-bit Windows.
- Use the PtrToLong or PtrToUlong function to truncate pointers. If you must truncate a pointer to a 32-bit value, use the PtrToLong or PtrToUlong function (defined in Basetsd.h). These functions disable the pointer truncation warning for the duration of the call.
Use these functions carefully. After you convert a pointer variable using one of these functions, never use it as a pointer again. These functions truncate the upper 32 bits of an address, which are usually needed to access the memory originally referenced by pointer. Using these functions without careful consideration will result in fragile code.
- Be careful using OUT parameters. For example, suppose you have a function defined as follows:
void func( OUT PULONG *PointerToUlong );
Do not call this function as follows:
ULONG ul;
PULONG lp;
func((PULONG *)&ul);
lp = (PULONG)ul;
Instead, use the following call:
PULONG lp;
func(&lp);
Typecasting &ul to PULONG* prevents a compiler error, but the function will write a 64-bit pointer value into the memory at &ul. This code works on 32-bit Windows, but will cause data corruption on 64-bit Windows—and it will be subtle, hard-to-find corruption. The bottom line: Do not play tricks with the C code—straightforward and simple is better.
- Be careful with polymorphic interfaces. Do not create functions that accept DWORD parameters for polymorphic data. If the data can be a pointer or an integral value, use the UINT_PTR or PVOID type.
For example, do not create a function that accepts an array of exception parameters typed as DWORD values. The array should be an array of DWORD_PTR values. Therefore, the array elements can hold addresses or 32-bit integral values. (The general rule is that if the original type is DWORD and it needs to be pointer width, convert it to a DWORD_PTR value. That is why there are corresponding pointer-precision types.) If you have code that uses DWORD, ULONG, or other 32-bit types in a polymorphic way (that is, you really want the parameter or structure member to hold an address), use UINT_PTR in place of the current type.
- Use the new window class functions. If you have window or class private data that contains pointers, your code will need to use the following new functions:
- GetClassLongPtr
- GetWindowLongPtr
- SetClassLongPtr
- SetWindowLongPtr
These functions can be used on both 32- and 64-bit Windows, but they are required on 64-bit Windows. Prepare for the transition by using these functions now.
Additionally, you must access pointers or handles in class private data using the new functions on 64-bit Windows. To aid you in finding these cases, the following indexes are not defined in Winuser.h during a 64-bit compile:
- GWL_WNDPROC
- GWL_HINSTANCE
- GWL_HWDPARENT
- GWL_USERDATA
Instead, Winuser.h defines the following new indexes:
- GWLP_WNDPROC
- GWLP_HINSTANCE
- GWLP_HWNDPARENT
- GWLP_USERDATA
- GWLP_ID
For example, the following code does not compile:
SetWindowLong(hWnd, GWL_WNDPROC, (LONG)MyWndProc); It should be changed as follows:
SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)MyWndProc); When setting the cbWndExtra member of the WNDCLASS structure, be sure to reserve enough space for pointers. For example, if you are currently reserving sizeof(DWORD) bytes for a pointer value, reserve sizeof(DWORD_PTR) bytes.
- Access all window and class data using FIELD_OFFSET. It is common to access window data using hard-coded offsets. This technique is not portable to 64-bit Windows. To make your code portable, access your window and class data using the FIELD_OFFSET macro. Do not assume that the second pointer has an offset of 4.
- The LPARAM, WPARAM, and LRESULT types change size with the platform. When compiling 64-bit code, these types expand to 64 bits, because they typically hold pointers or integral types. Do not mix these values with DWORD, ULONG, UINT, INT, int, or long values. Examine how you use these types and ensure that you do not inadvertently truncate values.
|
posted @
2010-07-07 16:28 margin 閱讀(2200) |
評論 (2) |
編輯 收藏
其實, Vim與其它編輯器一個很大的區別在于, 它可以完成復雜的編輯與格式化功能. 在這些領域還少有軟件能與它分庭抗禮, 但是, 與所有的靈活性的代價一樣, 你需要用自己的雙手來實現它. 這在事實上造成了用戶在使用Vim過程中的幾個自然階段.
一開始是notepad, word, edit壟斷你的大腦, 這些東西根深蒂固, 揮之不去Vim的使用對你而言是一場噩夢, 它降低而不是提高了你的工作效率. 對三種工作模式的不解甚至使你認為它是一個充滿BUG或者至少是一個古怪的與當今友好用戶界面設計嚴重脫節的軟件. 事實上, 這些起初看起來古怪的特性是Vim(或者是vi)的作者和它的用戶們在自己漫長的文字編輯和程序設計生涯中總結出來的最快速最實在的操作, 在幾乎等于計算機本身歷史的成長期中, 歷經無數嚴厲苛刻的計算機用戶的批評與檢驗, 無用的特性或糟糕的設計在Vim用戶群面前根本就沒有生存的余地. Vim細心而謹慎的作者們也不允許自己精心設計的軟件里有這樣東西.第二個階段你開始熟悉一些基本的操作, 這些操作足以應付你日常的工作, 你使用這些操作時根本就不假思索. 但這些階段你仍然很少去碰Vim那晦澀的在線幫助文檔. 它在你心里只是notepad, edit一個勉強合格的替代品.
第三個階段, 精益求精的你不滿足于無休無止的簡單操作, 冗長而乏味,有沒有更好的辦法可以四兩拔斤. 于是, 從UNIX參考手冊上, 從同事口中, 你漸漸叩開:help xxx的大門. 開始探索里面充滿魔力的咒語. 從雜耍般的帶有表演性質的技巧開始, 這些技巧令人眩目但少有實用性. 不過這卻是你擁有魔力的第一步. 接下來, 你開始認識到這些咒語背后的真經, 開始偷偷修改一些奇怪的符號, 于是, 奇跡產生了, 魔力不但仍然有效, 而且真實地作用于你現實中的文字編輯生活. 你在第二階段由于熟練操作而塵封已久的大腦突然開始運作. 但這個過程并非是達到某個臨界狀態后的一路坦途, 不斷的挫折, 新的挑戰, 看似Mission Impossible的任務.永遠伴隨著任何一個人的任何一個學習過程. 這是你使用Vim的最后一個階段, 也是最漫長最有挑戰性同時也充滿無數奇趣的階段. 這個階段里你開始定制一些希奇古怪的顏色. 開始以敲入i18n來輸入internationalization, 開始讓Vim替你糾正經常把the 誤敲成teh的毛病, 開始讓Vim與系統里各種精悍而強大的兄弟工具進行合作, 開始寫越來越長的script, 每一次的文本編輯體驗都妙趣橫生高潮跌起. 你的頭腦因為要用Vim完成高效的編輯而高度緊張. 你開始在Vim郵件列表里提一些確實是問題的問題. 也開始發現你在Vim里做了以前在SHELL里做的幾乎一切事. 事實上你已經成了一個無可救藥的Vim骨灰級玩家.
posted @
2010-06-17 14:13 margin 閱讀(345) |
評論 (1) |
編輯 收藏
http://maxwolf-net.spaces.live.com/blog/cns!E725DE93EB25C562!582.entry
Experts-exchange注冊
當我在電腦或者IT方面有問題的時候,用google搜索相應關鍵詞,每次總有個experts-exchange.com的網站能排在前面,與我的問題匹配度非常高,就好像別人在這網站上替鵝問過一樣。
了解下才知道,這個網站是專門針對計算機方面的問題求解型網站,當會員在上面咨詢一個問題后,會有專家來解答,96年就有了,骨灰級的,目前有幾百萬的會員,估計什么疑難雜癥,奇形怪狀的問題上面都能找到。
不過比較惡心的是,這個網站是收費的,要想看答案,至少要注冊試用帳號。更惡心的是,注冊試用帳號還要輸入信用卡號。特別惡心的是,在試過亂編信用卡帳號總是注冊失敗,不得已用自己的信用卡后,結果網站說此卡不支持,不給注冊。
問題急待解決,而且好像就這網站才有答案,實在沒辦法,只好查查怎么繞過,果然有很多文章提供一些方法包括禁用cookies配合Firefox不登錄直接看答案等等等,可惜我試過都不行了。。
無奈下,偶然發現experts-exchange有一個不公開的注冊鏈接,免費的且不需要信用卡號。于是立刻注冊,看到答案并解決了問題,很是爽。 地址如下,推薦注冊下下,保不準哪天碰到惡心的問題解決不了,搜到這個網站卻因為登錄問題而干著急。。
http://www.experts-exchange.com/registerFree2.jsp
-----------------
雖然注冊了,但是沒有積分好像還是看不到solution。不過總比沒有好!
posted @
2010-05-10 18:56 margin 閱讀(180) |
評論 (0) |
編輯 收藏
用 winsows2003 + symantec norton + vmware server 2.0做的一個server,非常不穩定!
經常會3389不上,而能ping同也能telnet到3389端口上去,無奈得只能重啟。后來看系統日志基本上是每分鐘都是ID = 333的錯誤
初步懷疑是vmware和norton沖突了導致的,萬惡的norton啊!
不明真相的群眾: 怪norton干嘛,卸了vmware吧。
答: 卸了vmware沒法工作了。
不明真相的群眾: 那就把norton卸了吧...
答: 哎~如果norton都能卸了,那我就沒有必要裝vmware了。
人世間最糾結的事情莫過于此....
posted @
2010-04-26 18:33 margin 閱讀(219) |
評論 (2) |
編輯 收藏
今天郁悶了很久,最后在網上搜索了一把,居然發現python的文檔中已經把這個東西寫成了例子,暴汗!
posted @
2010-03-18 23:16 margin 閱讀(616) |
評論 (1) |
編輯 收藏
一直都覺得linux下的效率會更高,我也有這方面的需求。這個問題讓我困擾了很久,今天看到一個帖子,覺得這個老外說得很地道....
http://www.webmasterworld.com/forum112/24.htm
posted @
2010-03-09 13:20 margin 閱讀(629) |
評論 (1) |
編輯 收藏
大四的日子里是迷茫 而且忙碌的一段歲月,那段歲月中有些人和有些事讓我收益終生。
那段歲月里,某些同學由于成績優秀。得到了很多人羨慕的東西,第一次二八現象如此血淋淋的展示在我面前。當我明白這個事實的時候,似乎已經為時已晚。我明白自己前面只有一條路可以選擇,那就是考研。也許正因為這是唯一的選擇,所以我的迷茫顯得簡單得許多。本校還是外校就是唯一選擇后的迷茫,本校的痛苦、穩定和外校的美好,風險是權衡的關鍵。但是其實也沒有做過多的考慮,由于某些原因我還是只能選擇了本校,選擇了忍耐....
在考研的過程中,不得不提的一個同學就是鄭磊。雖然四年來一直不算太要好,但是考研的事情讓我們兩走得比較近。鄭磊同學出生軍人家庭,有些雷厲風行的作風,在三年的同窗時光,我們兩一直找不到有啥可說的話題。不過在程序方面,班里比較強的也就是他,所以有時還會有點交流,不過也僅此而已。考研的那段時間里,中飯和晚飯是我們交流的時光,我的很多迷茫和困惑都可以和他交流。他用他自己的理解為我打開了人生的另一扇窗。平心而論,他不是一個非常聰明的人,但是深入了解之后,我意識到此人不屑于小聰明,他擁有大智慧。他很明確的告訴我,在大一的時候我就對自己說,我不適合這個專業,我對程序有很濃厚的興趣。我希望考驗,我希望考到計算機專業去深造。他用三年時間做到一個算機專業學生應具備的素質,他等待的就是讓他涅槃重生的機會。他十分明確自己的目標,并將該目標細分成若干個步驟,用三年的時間將這寫步驟全部的實現。以至于最后選擇考驗的學校和專業都是他做過詳細的研究和思考后,作出的決定。記得有一次,大四上學期的期末考試因為過幾天就是考研考試,在大家不敢相信的眼神中,開考半小時后,他毅然決然的交了張白卷上去。事后,我還打趣的說,你的本科終于完整了。這份做事的計劃和執行力,在現在看來我內心仍然欽佩不已!就是與他一起復習,我才以第一名的成績考上研究生,考完的那一刻我對自己第一次從計劃到執行的獲得非常的滿足感。考完我對他說:謝謝你的鞭策和鼓勵,我才能堅持下來。沒想到他笑著回答:我又何嘗不是呢?我又問他接下來有什么打算,沒想到他的回答更讓我吃驚:找工作唄,成績還沒有下來做好最壞的打算。此人在一個階段為一個目標而努力,在人事后,心態卻如此豁達。最后成績下來,該君去了清華....
今天回憶起這段往事,主要是最近MM也遇到了這方面的問題。跟我相比,她面對的迷茫不是成功與失敗,更多的是幸福的煩惱。她的優秀導致她會成為哪些20%的人。在她面前的選擇太多,以至于我的經驗完全對她無效了。也許我永遠無法體會那些20%的人所面對的東西,但是也許有些東西也許永遠都不會改變。從我與鄭磊的接觸過程中,我明白了幾個人生的關鍵詞:計劃、執行力、直面問題的勇氣、堅持的毅力、豁達的心態。我想擁有這些品質的人,即使你真的沒有達到你的目標,你的人生已經非常精彩。
我們之間的感情難道不正是這樣嗎?
posted @
2009-12-05 21:52 margin 閱讀(140) |
評論 (0) |
編輯 收藏
最近一直比較煩吧~~錢包在旅游時弄丟了,一堆雜事需要善后。
幸虧得到表哥表嫂的救助,哎~~人都丟到上海去了,上海給我的影響又更加負面了點!
最近工作上在申請設備的時候遇到了很多阻力,申請下來的服務器是win 2003 serv的版本,與我需要的xp環境不符合。溝通了一下發現困難比較大!那就用別的辦法解決吧,哈哈,在困境中我又想到了強大的VMWare,哼哼,不讓裝xp更好,那我就可以嘗試一下用VMWare來實現“云”了!
下面給出一下VMWare部分產品的簡單介紹
VMware Workstation 最熟悉的產品,無需多說
VMware Player VMware Workstation 的簡化版,不能安裝系統 ,免費
VMware Server VMware GSX Server 升級到4.0后,改名為此版本,并免費,需要OS
VMware ESX Server 不需要OS的強大Server,接過VMware GSX Server 的槍
VMware ESXi VMware ESX Server 的免費版
VMware vCenter Server 管理VMware ESX Server 的東東
VMware Infrastructure 3 眾多產品合集
VMware vSphere 4 VMware Infrastructure 3 的升級版,強調云計算
VMware Converter Standalone 一個能轉化vmx格式的好工具
以上信息接是我自己的理解,并不準確。
昨天,我老婆下樓把腳崴了,腫了好大。哎~我晚飯都沒心思吃,念天地之悠悠,獨愴然之淚下!幸好在周圍同學的幫助下,送往醫院。檢查后,萬幸無大礙。不過可惜無法出席俄語競賽的慶功會和繼續陪同俄教育部某高官的翻譯工作。
一場大病雖來得不是時候,但是于我卻有重新寵信之利。然鄙人雖感恩戴德,卻絲毫不敢有高興之心!
病人的心情是脆弱的,這個階段更是需要倍加的包容和呵護!
總之一句話:望陛下能以蒼生為重,珍惜龍體。為國為民,早日康復!
posted @
2009-11-18 22:18 margin 閱讀(93) |
評論 (0) |
編輯 收藏
最近在做一個項目,需要借助VMWare的幫助。于是到官網上下了VIX,說實在的VIX的bug還是蠻多的,而且還沒有直接支持python的接口(最后用COM搞定的)。按理應該被我bs一把,但是不得不說,人家把該做的都做了而且還在不斷努力更新中(vix目前貌似最新的是1.7的版本吧)沒得話說,頂啊!
前一周基本都泡在VMWare的社區上,搜索各種各樣的問題的帖子。
上一周一直在寫代碼,把host的接口,架構和VM的調用都實現了。
就在我最興奮的那一刻,我突然發現貌似VIX不支持多線程(可能是COM的原因,反正沒有找到官方的說明),我瞬間崩潰了.... 郁悶了好一陣,在苦想了一個晚上后,還是決定修改原有的架構。考慮用多進程的方式解決吧!但是用了多進程后,反而架構上耦合更加松了,甚至目前的架構已經為未來的平行擴展做好了準備! 真是柳暗花明又一村啊!
目前已經做好的有:接口,架構, VM調用,自升級,應該還差“保存”這一方面的工作就oK了!
Host完成后,guest部分的代碼也要開始著手進行了。
ps.周末去了趟西沖,海邊就是很爽!
posted @
2009-10-26 00:24 margin 閱讀(163) |
評論 (0) |
編輯 收藏