posts - 101,  comments - 57,  trackbacks - 0
MD5
  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 阅读(179) | 评论 (0)编辑 收藏
http://www.codeguru.com/forum/showthread.php?t=431298

This 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:
  • int
  • long
  • pointer
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
  1. Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.
  2. Click the C/C++ folder.
  3. Click the General property page.
  4. 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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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 阅读(2166) | 评论 (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 阅读(330) | 评论 (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 阅读(170) | 评论 (0)编辑 收藏
          用 winsows2003 + symantec norton + vmware server 2.0做的一个server,非常不稳定!

          经常会3389不上,而能ping同也能telnet到3389端口上去,无奈得只能重启。后来看系统日志基本上是每分钟都是ID = 333的错误

Error Event ID:333An I/O operation initiated by the Registry failed unrecoverably. The Registry could not read in, or write out, or flush, one of the files that contain the system's image of the Registry.

          初步怀疑是vmware和norton冲突了导致的,万恶的norton啊!

          不明真相的群众: 怪norton干嘛,卸了vmware吧。
          答: 卸了vmware没法工作了。

          不明真相的群众: 那就把norton卸了吧...
          答: 哎~如果norton都能卸了,那我就没有必要装vmware了。
         
          
           人世间最纠结的事情莫过于此....
posted @ 2010-04-26 18:33 margin 阅读(206) | 评论 (2)编辑 收藏
       今天郁闷了很久,最后在网上搜索了一把,居然发现python的文档中已经把这个东西写成了例子,暴汗!
posted @ 2010-03-18 23:16 margin 阅读(585) | 评论 (1)编辑 收藏
         一直都觉得linux下的效率会更高,我也有这方面的需求。这个问题让我困扰了很久,今天看到一个帖子,觉得这个老外说得很地道....

引用The complexity of installing/running software usually far outweighs any small gains by choosing one platform over another.

What I mean -- if you are comfortable with Windows or Linux - stay with it. Don't switch from one to another just become someone tells you the one you're not using is faster/better.

In the long run, knowing how to manage one system extremely well is better than only knowing a little bit about all of them.

Specifically, if you know windows really well, keep running MySql on Windows. If you know Linux well, stay with that.

If you have performance problems then learn how to tweak all the settings on the platform and operating system you are using.

Then, if you need more speed - as much as this sounds simplistic, just throw more hardware at it.

It is a lot easier (and in the long run cheaper) to just throw more ram in the server, use a faster hard disk/controller, and use a faster CPU than to switch architectures.

Although not as elegant, because servers are cheap and every few months are getting faster and cheaper, the overall cost to throw more hardware at a decent performing system to make it faster is the simplest approach.

You do need to have your system reasonably under control. A badly configured system will not improve if you throw more at it - but otherwise this is actually a pragmatic approach that works for the vast majority of sites/


http://www.webmasterworld.com/forum112/24.htm
posted @ 2010-03-09 13:20 margin 阅读(554) | 评论 (1)编辑 收藏
         大四的日子里是迷茫 而且忙碌的一段岁月,那段岁月中有些人和有些事让我收益终生。

        那段岁月里,某些同学由于成绩优秀。得到了很多人羡慕的东西,第一次二八现象如此血淋淋的展示在我面前。当我明白这个事实的时候,似乎已经为时已晚。我明白自己前面只有一条路可以选择,那就是考研。也许正因为这是唯一的选择,所以我的迷茫显得简单得许多。本校还是外校就是唯一选择后的迷茫,本校的痛苦、稳定和外校的美好,风险是权衡的关键。但是其实也没有做过多的考虑,由于某些原因我还是只能选择了本校,选择了忍耐....

        在考研的过程中,不得不提的一个同学就是郑磊。虽然四年来一直不算太要好,但是考研的事情让我们两走得比较近。郑磊同学出生军人家庭,有些雷厉风行的作风,在三年的同窗时光,我们两一直找不到有啥可说的话题。不过在程序方面,班里比较强的也就是他,所以有时还会有点交流,不过也仅此而已。考研的那段时间里,中饭和晚饭是我们交流的时光,我的很多迷茫和困惑都可以和他交流。他用他自己的理解为我打开了人生的另一扇窗。平心而论,他不是一个非常聪明的人,但是深入了解之后,我意识到此人不屑于小聪明,他拥有大智慧。他很明确的告诉我,在大一的时候我就对自己说,我不适合这个专业,我对程序有很浓厚的兴趣。我希望考验,我希望考到计算机专业去深造。他用三年时间做到一个算机专业学生应具备的素质,他等待的就是让他涅槃重生的机会。他十分明确自己的目标,并将该目标细分成若干个步骤,用三年的时间将这写步骤全部的实现。以至于最后选择考验的学校和专业都是他做过详细的研究和思考后,作出的决定。记得有一次,大四上学期的期末考试因为过几天就是考研考试,在大家不敢相信的眼神中,开考半小时后,他毅然决然的交了张白卷上去。事后,我还打趣的说,你的本科终于完整了。这份做事的计划和执行力,在现在看来我内心仍然钦佩不已!就是与他一起复习,我才以第一名的成绩考上研究生,考完的那一刻我对自己第一次从计划到执行的获得非常的满足感。考完我对他说:谢谢你的鞭策和鼓励,我才能坚持下来。没想到他笑着回答:我又何尝不是呢?我又问他接下来有什么打算,没想到他的回答更让我吃惊:找工作呗,成绩还没有下来做好最坏的打算。此人在一个阶段为一个目标而努力,在人事后,心态却如此豁达。最后成绩下来,该君去了清华....

       今天回忆起这段往事,主要是最近MM也遇到了这方面的问题。跟我相比,她面对的迷茫不是成功与失败,更多的是幸福的烦恼。她的优秀导致她会成为哪些20%的人。在她面前的选择太多,以至于我的经验完全对她无效了。也许我永远无法体会那些20%的人所面对的东西,但是也许有些东西也许永远都不会改变。从我与郑磊的接触过程中,我明白了几个人生的关键词:计划、执行力、直面问题的勇气、坚持的毅力、豁达的心态。我想拥有这些品质的人,即使你真的没有达到你的目标,你的人生已经非常精彩。

       我们之间的感情难道不正是这样吗?

posted @ 2009-12-05 21:52 margin 阅读(128) | 评论 (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 阅读(81) | 评论 (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 阅读(149) | 评论 (0)编辑 收藏
仅列出标题
共10页: 1 2 3 4 5 6 7 8 9 Last 
<2010年9月>
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

常用链接

留言簿

随笔档案

文章分类

文章档案

收藏夹

常去的坛子

  • CVC电脑病毒论坛
  • 很多人说我是AV,我告诉他们:别瞧不起人,我们也能创造价值
  • 安全焦点
  • 黑客聚集的地方,一般是好酒最多的地方...
  • 看雪论坛
  • 国内最强的加密解密论坛,成醉其中经常夜不归宿
  • 驱动开发论坛
  • 厌倦了啤的朋友们,来我们来整点白的...痛痛快快的BSOD也好过隔鞋瘙痒!

我的朋友

  • Sen的blog
  • IDE方面资深的受害者...经常为一个变量的定义找不着北的痛苦程序员(深表同情)
  • 老罗的blog
  • 良师益友,千年水牛,引擎猛男,分析怪兽,墨镜酷哥,台球高手....

搜索

  •  

最新评论