Category Archives: Programming

Everything You Need To Know To Start Programming 64-Bit Windows Systems

Matt Pietrek

One of the pleasures of working on the bleeding edge of Windows® is poking around in a new technology to see how it works. I don’t really feel comfortable with an operating system until I have a little under-the-hood knowledge. So when the 64-bit editions of Windows XP and Windows Server™ 2003 appeared on the scene, I was all over them.

The nice thing about Win64 and the x64 CPU architecture is that they’re different enough from their predecessors to be interesting, while not requiring a huge learning curve. While we developers would like to think that moving to x64 is just a recompile away, the reality is that we’ll still spend far too much time in the debugger. A good working knowledge of the OS and CPU is invaluable.

In this article I’ll boil down my experiences with Win64 and the x64 architecture to the essentials that a hotshot Win32® programmer needs for the move to x64. I’ll assume that you know basic Win32 concepts, basic x86 concepts, and why your code should run on Win64. This frees me to focus on the good stuff. Think of this overview as a look at just the important differences relative to your knowledge of Win32 and the x86 architecture.

One nice thing about x64 systems is that you can use either Win32 or Win64 on the same machine without serious performance losses, unlike Itanium-based systems. And despite a few obscure differences between the Intel and AMD x64 implementations, the same x64-compatible build of Windows should run on either. You don’t need one version of Windows for AMD x64 systems and another for Intel x64 systems.

I’ve divided the discussion into three broad areas: OS implementation details, just enough x64 CPU architecture to get by, and developing for x64 with Visual C++®.

http://msdn.microsoft.com/msdnmag/issues/06/05/x64/default.aspx

Vision的第一次HW

第一次作业做两幅图像的fusion,用Laplacian Pyramid 的方法。自己写卷积函数,上采样下采样函数,还有Pyramid函数。搞不懂vison的老师为什么还要我们实现这么老的算法,上学期都已经学过Poisson Image Editing了,这学期反而退化去实现这个Pyramid算法,简直没有脾气。

输入两幅图像,还有mask图像:

 融合结果为下左,接着相加的结果为下右:

被程序给郁闷了

郁闷,不能release image

Unhandled exception at 0x7c901230 in Prog1.exe: User breakpoint

程序停在free.c的return HeapAlloc(_crtheap, 0, size);这一行

如果ignore,and continue,则会碰到

Insufficient memory (Out of memory) in function cvAlloc, .\cxalloc.cpp(111)

….

搞了快6个小时才发现,image循环的for loop写错了,写成了

for(int i = 0; i < src->widthStep; i ++)

这样image的数据就写出届了,搞得image的data crash了,因而不能release。还好现在都搞定了,只用了0.2s,删掉了4个字母。 

准备学习Emacs

以前一直都是用vim的,而且觉得vim的功能很强大,用起来也很方便,所以很排斥emacs。最近学习lisp,发现用vim写lisp程序还是不太方便。用vim写好的lisp程序还要另外打开lisp的编译器才能编译,有点不爽,决定看看emacs。不过就准备学习一下emacs的简单功能,学多了没时间也容易忘,呵呵。

A Tutorial Introduction to GNU Emacs
http://www2.lib.uchicago.edu/~keith//tcl-course/emacs-tutorial.html
A Emacs+Lisp Tutorial
http://xahlee.org/emacs/emacs.html