联系
主题 [当前:121 ~ 132, 总共: 132]
Knight's Tale » 技术
Some bad C++ programming habits which may lead to Memory Leak Error
2010-06-07 22:56
There are some bad programming habits in my experience which can lead to Memory Leak: Use inherit class structure. But you never writing virtual destructions method for your base class. use "new" to create one object, but forgetting ……
继续阅读
Visual Assist for Visual Studio 2010
2010-06-06 19:14
为你的Visual Studio 2010 使用无限期VC助手的方法 1. 从官网下载Visual Assist原始安装文件 http://www.wholetomato.com/downloads/getBuild.asp?VA_X_Setup1822.vsix 2. 下载破解文件:<a href="http://d.downl……
继续阅读
Non-Memory Leak version Singleton pattern implementation with C++
2010-06-03 10:53
I wrote a single pattern with C++ implementation[1] article the day before yesterday. However, this version has one fatal problem: it has Memory L……
继续阅读
Never call virtual functions during construction
2010-06-02 16:21
I read <Effective C++> at one time, and I know there is a criterion which is "Never call virtual functions during construction and destruction". But as we all know, genuine knowledge comes from practice. We will never have in-depth understanding of k……
继续阅读
error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2'
2010-06-02 16:01
Normally, _ITERATOR_DEBUG_LEVEL is set automatically by choosing either the Debug or Release build mode. So when you meet this error, it may well be that your projects in your solution have different build modes ( one is Debug and the other is release ) .……
继续阅读
Don't use "memset" function for you "std::string" objects! (Memory Leaks Error)
2010-06-02 15:47
Today I meet a memory leaks error in my program and I always cannot find the place where memory leaks happen. Though I use MS Memory Leaks Detect Tricks, it does……
继续阅读
Summary on "const" in C++
2010-06-01 22:27
"const" is a very common key word in C++ programming language. I use lots of "const" in my previous project and now I want to write some summary about the usage of it. I suppose there is a Class "A". const with "Pointer" const ……
继续阅读
关于#include 与 #include" " 的区别
2009-09-26 13:10
C/C++ code使用尖括号的话,编译时会先在系统include目录里搜索,如果找不到才会在源代码所在目录搜索;使用双引号则相反,会先在源代码目录里搜索。这就意味着,当系统里(如/usr/include/里)有一个叫做math.h的头文件,而你的源代码目录里也有一个你自己写的math.h头文件,那么使用尖括号时用的就是系统里的;而使用双引号的话则会使用你自己写的那个。 所以建议: 使用系统里提供的头文件时使用尖括号 使用自己编写的头文件时使用双引号。 Linux环境下的C++头文件搜索路径方式……
继续阅读
逆置单链表,求单链表中间元素,删除指定结点
2009-09-25 21:03
本程序实现单链表的一些稍微高级一点的操作: 查找单链表倒数第n个元素的值 查找单链表中间元素的值(中间值可能有两个) 一个单向的链表,知道只有一个指向某个节点的指针p,并且假设这个节点不是尾节点,试编程实现删除此节点 具体算法是: 4、在查找单链表倒数第n个元素时,有三种方法 第一种是规尺法,即利用两个步长为n的指针,同时前进直至第一个指针到达终点,那么第二个指针所指的对象就是想要得到的值,时间复杂度为O(……
继续阅读
Scalable Parallel PROGRAMMING with CUDA
2009-04-30 00:00
# 基于CUDA的可扩展并行编程模型研究 # **摘 要** 随着GPU处理能力和可编程性的不断提高,其应用也慢慢的从图形领域延伸到了需要强大计算能力的高性能计算领域。面对迅猛发展的多核以及GPU,传统的串行编程已经无法满足日益增长的计算能力。因此,不管是学术界还是工业界,都在寻找一个合适的并行编程模型来解决如何充分有效地利用GPU和CPU资源进行并行计算的难题。CUDA伴随着统一渲染架构的推出的一种通用的GPU编程模型,它绕过了图形流水线,直接对GPU的硬件核心做了一层多线程封装,根据其提供的多线程……
继续阅读
Updating the Ray Tracing project
2009-04-25 00:00
These two days I updated the Ray Tracing project by adding some new models and functions. I just want to make it look more nice than the previous version. You can see my last version of RayTracing here [:Approximately Realistic Rendering using Ray Tracing]……
继续阅读
Approximately Realistic Rendering using Ray Tracing
2009-03-28 00:00
It’s really a pity that I havnt’ done any things for almost three months. :( However, I focus on the realistic and the real time rendering on graphics these days. And luckily, I have implemented a nice demo for this realistic rendering purpose using ray tr……
继续阅读