摘要: 前言:上午无事,离午饭还有1小时的时间,弄篇文章。近日,被分配到一个工作,就是给之前一个同事写的tool加个UI,并且增加一些新的功能。之前的形式是一个功能的lib,一个前台的console。。从我陆续开始动手开始,UI设计我也就替代了,但是之前这位仁兄写的tool已经严重阻碍了我的新功能的开发,而且还有bug,近日已经遇到了2个。简单说一下这个tool的功能:就是dump生成文件里的resource,大家都知道resource是PE里最复杂的功能,其格式内容有字符串,图片,音视频,XML等。当然,我们的这个tool目前只有dump string的功能,能dump native和managed
阅读全文
摘要: 这几天铺天盖地的新闻都是Steve Jobs的死讯,我也是昨天早晨手机看新闻的时候惊闻,当时意识到Apple会不会因此而衰败。新的IPhone5没有按期而至,仅仅是多了个4S,当然这个已经被炒到7000RMB向上,估计早批拿到真货的中国人肯定的破万了。当然在4S发布之后在公布S Jobs的消息,也是为了稳定股价以及新品发布吧,估计老Jobs已经早死了几日无人知而已。虽然老乔死了,他的生平肯定会被拿来炒作赚钱的,他的传记,语录,故事会相应出版,唉。我也相应的看了一些语录,我觉得有两个字印象深刻:梦想。我们有梦想吗?我相信是有的,小时候大人最爱问的就是,XX,你长大了想当什么呀?“我想当老师,专门
阅读全文
摘要: 偷懒间做了两道题,供大家把玩吧。我的解法不见得最好,但是是可以work的。大家有解法可以贴到评论里,我们可以切磋下。1.If p is the perimeter of a right angle triangle with integral length sides, {a,b,c}, there are exactly three solutions for p = 120. click{20,48,52}, {24,45,51}, {30,40,50}For which value of p <=1000, is the number of solutions maximised?
阅读全文
摘要: 在之前我看的写出优雅简明代码的论题集 -- Csharp(C#)篇[1]后续的评论中,看到了这么个结论:“这点是却实,using如果出现异常不回收资源,使用using特别要注意这个问题”其实上面的群论很清晰,using会展成一个try-finally,会在finally里显示调用object的Dispose()方法。在这我想问的是:你既然都知道会展成什么,他凭什么就不会回收资源呢?难道不知道没有实现IDisposable的事不能using的吗?先从msdn上捞了一段IDisposable的模板,改了改代码,原来的太复杂,为了凸出重点,我酌情给了删减:using System;public cl
阅读全文
摘要: The HD2 Android NAND method is finally published. As soon as I can I download the release and try it.Do exactly same as this post said http://forum.xda-developers.com/showthread.php?t=893948After installed android on my HD2 rom, I feel there is no obvious different between SD card method and NAND me
阅读全文
摘要: 今天看《算法导论》看到两个如题的两个习题,遂做之。没有做参数检查以及异常处理,线程安全等。class DoubleStackQueue { private System.Collections.Stack stackA, stackB; public DoubleStackQueue() { stackA = new System.Collections.Stack(); stackB = new System.Collections.Stack(); } public void Enqueue(object obj) { stackA.Push(obj); } public object D
阅读全文
摘要: Let us see how lucky this guy is.Best wishes to them.===================================================================================I met my husband 11 years ago. I was carrying my guitar into my dorm room on freshman move-in day at the University of Southern Maine. I saw him eyeing my guitar wi
阅读全文
摘要: Words before this article Abstract: about WUA What is WUA?How to use WUA?WUA API reference in MSDN End Words before this article I want to write series of articles about my current job. Short of time and energy , a little lazy, the idea is surround me last long. I finally make my decision today t
阅读全文
摘要: 这是一个老生常谈的问题,但是我昨天又遇到了。敝人不才,实在想象不出C#里怎么能在直接写汇编,直接操作寄存器,直接调用系统中断。。。。。。我回答:由于。net是虚拟了没有CPU的虚拟机,所以不能直接操作寄存器,所以也就不能直接nested汇编。我理解的嵌入就应该是C里的asm(C++里的_asm) 首先看看什么样才是嵌入,查了一下词典,是镶入,好了,不picky了,直接进入正题。 查了一下园子,有如下一些可参考的帖子: 《C#内嵌汇编代码的讨论》 《在.net程序中嵌入asm汇编代码》 《C#调用汇编dll (载)》 《一个C#内联汇编的类 》 诸如此类的,他们的方案大概分为两类: 1.将汇编写
阅读全文
摘要: Paper test in interview: Use below functions to finish a function that multiply one integer 10 times. Console.WriteLine() Console,ReadKey() String.Format() Int32.TryParse() To show result like: Please input an integer: good! Please input an integer: 6.4313 Please input an integer: 67 0 * 67 =01 * 6
阅读全文