笔记暂存4

cphj 2010-05-14 05:21:40
Free Mind map 是我最喜欢的思维导图工具。它是一款轻量级的免费桌面软件。我喜欢它,因为它是我用过的最简单的思维导图工具。Free Mind map也遵守GPL协议,对于每个人都是免费的。你可以使用它的键盘快捷键快速创建导图。文件的扩展名是.mm,你也可以把你的扩展名为.mm的文件和Free Mind map软件一起和其他人共享你的导图,并且每个人都可以编辑它。
...全文
89 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
cphj 2010-06-04
  • 打赏
  • 举报
回复
修复删除最后一个animal下标越界的错误

=== Nano/Ecology.cpp ===
@@ -43,7 +43,7 @@

void Ecology::DrawMotive(HDC hdc)
{
- for (size_t i=0; i<animals.size(); i++)
+ for (size_t i=0; i<animals.size();)
{
if (!animals[i].IsAlive())
{
@@ -51,7 +51,14 @@
animals[i] = animals[animals.size() - 1];
animals.pop_back();
}
+ else
+ {
+ i++;
+ }
+ }

+ for (size_t i=0; i<animals.size(); i++)
+ {
animals[i].Accelerate(width / 2, height / 2);

SetPixel(hdc, long(animals[i].pos.v[0]), long(animals[i].pos.v[1]), RGB(0, 0, 0));
cphj 2010-05-25
  • 打赏
  • 举报
回复
const string reverse(const string & s)
{
if (s.empty())
return s;
else
return reverse(s.substr(1)) + s.substr(0, 1);
}
cphj 2010-05-25
  • 打赏
  • 举报
回复
#ifndef UTILITY_H
#define UTILITY_H

#include <string>
#include <sstream>
using std::string;
using std::stringstream;

template <typename T> const string str(const T & t) // 转换任意类型为string
{
stringstream ss;
ss << t;
string s;
ss >> s;
return s;
}

#endif

15,440

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧