06 2015 档案

摘要:题目描述:Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in th... 阅读全文
posted @ 2015-06-23 11:27 Sawyer Ford 阅读(161) 评论(0) 推荐(0)
摘要:题目描述:Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit ... 阅读全文
posted @ 2015-06-23 10:41 Sawyer Ford 阅读(190) 评论(0) 推荐(0)
摘要:题目描述:Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive in... 阅读全文
posted @ 2015-06-23 09:32 Sawyer Ford 阅读(236) 评论(0) 推荐(0)
摘要:题目描述:Divide two integers without using multiplication, division and mod operator.If it is overflow, return INT_MAX. 提示中谈到Binary Search,由此可想到解决方案。solu... 阅读全文
posted @ 2015-06-16 21:19 Sawyer Ford 阅读(169) 评论(0) 推荐(0)
摘要:更新回调(Update Callback)涉及到一个类:osg::NodeCallback。这个类重载了函数调用操作符。当回调动作发生时,将会执行这一操作符的内容。 如果节点绑定了更新回调函数,那么在每一帧系统遍历到此节点时,回调函数都会被调用。 下面给出一个例子:#include #inc... 阅读全文
posted @ 2015-06-09 11:06 Sawyer Ford 阅读(647) 评论(0) 推荐(0)
摘要:本文所有内容来自《OpenSceneGraph三维渲染引擎设计与实践》一书。 本文主要讨论的是OSG中节点的访问。 对于节点的访问是从节点接收一个访问器开始的,用户执行某个节点的accept()函数,将一个具体的访问器对象传递给节点。 第二步,节点反过来执行访问器的apply()函数,并将... 阅读全文
posted @ 2015-06-09 10:13 Sawyer Ford 阅读(2866) 评论(1) 推荐(0)
摘要:《Effective C++》在资源管理一节提到了智能指针,智能指针中最著名的当属auto_ptr和shared_ptr。本文主要研究两者的实现。auto_ptr的实现:template class auto_ptr{private: T *ptr;public: explicit ... 阅读全文
posted @ 2015-06-03 16:37 Sawyer Ford 阅读(356) 评论(0) 推荐(0)
摘要:罗列一些QT学习资料1. http://www.qter.org/ 包含很多教程,包括著名的《学习之路》系列。2.http://www.qtcn.org/bbs/index-htm-m-bbs.html 非常好的qt论坛,里面的人很热心。3.http://www.devbean.net/ca... 阅读全文
posted @ 2015-06-02 16:19 Sawyer Ford 阅读(217) 评论(0) 推荐(0)
摘要:类中3个重要的成员函数,标准形式如下:class A{public: A(); A(const A&); A& operator=(const A&); ~A();}; 以后会补充 阅读全文
posted @ 2015-06-01 09:51 Sawyer Ford 阅读(165) 评论(0) 推荐(0)