2012 年二月 一 二 三 四 五 六 日 « 一 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 近期评论
- wlx [微博 ] 发表在《google彻底被封?》
- snake 发表在《google彻底被封?》
- Andrew Pelt 发表在《debian testing上安装oracle 10g》
- tiplip 发表在《webmap.cn使用的WEBGIS技术》
- 求助Evolution问题!! 发表在《evolution crashed in gutsy alpha》
分类目录
标签
anjuta apache backup breezy c++ compile convert dapper debian dns edgy evolution feisty firefox flash gnome gobang GRASS gutsy humor intrepid Linux mailman MapServer mysql openoffice Oracle php phpbb postfix PostGIS postgresql qgis sarge scim skype subversion svn tomcat ubuntu utf8 westdc Windows wordpress 中文
Category Archives: Program
Continuous Integration: 持续集成
原文见:http://www.martinfowler.com/articles/continuousIntegration.html 这儿还有一篇中文的说明:http://bbs.scmlife.com/viewthread.php?tid=5500 我是在研究trac的plugin的时候,发现有一个plugin看不懂,不知道是干什么的,就搜索了一下。
gnome thumbnails的生成
在$HOME/.thumbnails/目录下有一系列的缩略图文件,以供系统调用。 其生成规律: md5(“file:///home/….”) 大小是128×96的PNG图片 不过,为了更好的cache,提高速度,这儿有讨论,拟把md5的hash拆分成目录。 http://lists.freedesktop.org/archives/xdg/2007-August/008749.html
gtkmm中断开一个信号
其实也很简单,就是在文档中没有看到。 Easy enough: sigc::connection c = widget.signal_whatever().connect(sigc::mem_fun(whatever, whatever)); Then keep hold of c until you want to disconnect, and when you do, call c.disconnect(). Works in libsigc++ 1.2 as well, with the appropriate changes: SigC::Connection c = widget.signal_whatever().connect(SigC::slot(whatever, whatever)); c.disconnect(); … Continue reading
遍历TreeStore
如何遍历TreeStore? gtkmm的邮件列表上有一个简单的例子,但是经过测试,发现只能遍历到第二层枝。 Gtk::TreeModel::Children child=refTreeModel->children();//只能获取到第一级分类 Gtk::TreeModel::Children::iterator iter ; for( iter = child.begin() ; iter != child.end() ; iter++ ) { if ((*iter)[columns.id]==t[i].parent_id) { row=*(refTreeModel->append(iter->children())); break; } } 最终通过递归实现全部遍历,代码如下。 void CategoryView::getrow(Gtk::TreeModel::Children child,unsigned int pid, Gtk::TreeModel::Row& row) { Gtk::TreeModel::Children::iterator iter; for( iter = … Continue reading
c++中的string转换
如何转换string到其他类型?如何从其他类型转换到string? 代码1:toString template <class T> std::string toString(const T& a) { std::ostringstream ost; ost << a; return ost.str(); } 代码2:fromString template<typename T>T fromString( const std::string& s) { std::istringstream is(s); T t; is >> t; return t; } 使用方法: int d = … Continue reading
使用FileChooserDialog打开多文件
单文件比较简单, 看到这个函数的原型是这样的: Glib::SListHandle<Glib::ustring> Gtk::FileChooser::get_filenames ( ) const 因此,就以为要使用这样的变量来进行声明: Glib::SListHandle<Glib::ustring> filenames =dialog.get_filenames(); for(int i=0;i<filenames.size();i++) { //Notice that this is a std::string, not a Glib::ustring. //std::string filename = dialog.get_filename(); std::cout << “File selected: ” << filenames[i] << std::endl; } 结果发现编译不通过,再仔细看看,Glib::SListHandle并没有重载[]操作符。 再网络上搜索后发现有人和我的问题相同: That … Continue reading
在ubuntu gutsy下编译codeblocks svn版本
本来一直用的是feisty下的一个源: deb http://lgp203.free.fr/ubuntu/ feisty main 但是自从svn4413版本后就出现问题了,执行codeblocks提示错误: codeblocks: /usr/lib/libwx_gtk2u_aui-2.8.so.0: version `WXU_2.8.5′ not found (required by codeblocks) 因此,决定自己编译SVN版本,首先下载: svn co svn://svn.berlios.de/codeblocks/trunk codeblocks 编译前首先要作一些准备工作: sudo aptitude install debhelper fakeroot wx-common 然后修改codeblocks/debian/control文件,使其中的一些依赖替换为当前gutsy里的版本: Build-Depends: debhelper, autotools-dev, libc6-dev, libstdc++6-4.1-dev, libwxgtk2.8-dev, wx-common, zip 然后就可以编译了: cd codeblocks ./bootstrap … Continue reading
转换vbb 3.0.3到phpbb3
集思学院已经用了很长时间的vbb3.0.3,现在有些功能在我们的服务器已经出问题了,而且不想再跟vbb了,因为数字流域论坛已经转换到phpbb了,为了以后维护方便,决定从vbb3.0.3转换到phpbb 3 rc1。(估计RC2版本就要出来了,BUG已经很少了) 因为之前已经写了一个webwiz到phpbb的转换程序,所以再写vbb3到phpbb3的转换程序,比上次要轻松不少,但webwiz的设计思想就是来源于phpbb,所以很多库结构都非常像,而vbb的结构和phpbb有较大差异,在调试过程中还是耗费了大量的时间,回头来看,大约耗费了有一个礼拜的时间。感觉我都能提供有偿论坛转换服务了,哈哈。 转换过程: 首先要进行数据库的UTF8转换。之前论坛采用的是gb2312编码,但论坛上有台湾的注册用户,原来也能显示繁体中文,所以应该采用的是gbk或gb18030的编码。 在进行数据库的备份之前,要在原来的vb论坛后台把附件的存贮方式修改为文件方式,上传头像的存贮方式也修改为文件方式,而customprofilepic我没有找到对应的phpbb设置,所以这一块就直接丢弃了。 然后导出数据库: mysql -uroot –add-drop-table –default-character-set=latin1 cngis > cngis.sql 进行编码的转换: iconv -c -f gb18030 -t utf8 cngis.sql > cngisutf8.sql 然后修改此sql文件,替换所有的latin1为utf8,并在文件的开始处添加: SET NAMES utf8; SET CHARACTER_SET_CLIENT=utf8; SET CHARACTER_SET_RESULTS=utf8; 然后新建一个数据库cngisutf8,作为我们的测试数据库并尝试导入此sql文件。 mysql -uroot cngisutf8 < cngisutf8.sql 若在导入过程中没有错误,那么恭喜你,你太幸运了。 … Continue reading