假设有个文件里面记录的一系列的 int 值,现在我们想把这些数值存到一个 List 里面,结合 Item 5, 我们可能会写出下面的代码:ifstream dataFile("ints.data");list data(istream_iterator(dataFile), // Start of iterator istream_iterator()); // End of iterator这段代码可以编译,但运行时并不工作,它不会去调用 list 的构造函数,从而不会生成我们想要的这个 List。问题,出在 C++ 对代码的解析上。假设我... Read More
posted @ 2013-10-29 13:38 英超 Views(1292) Comments(0) Diggs(0) Edit
gentoo emerge unable to syncAuthor: TuboAfter setting SYNC to customized URL:SYNC="rsync://mirrors.stuhome.net/gentoo"emerge –sync always reports error:rsync: change_dir "/metadata" (in gentoo) failed: No such file or directoryAfter google, it turns out that the url which was cop Read More
posted @ 2013-10-28 20:57 英超 Views(570) Comments(0) Diggs(0) Edit
Table of Contents1 Item 4: Call empty instead of checking size() against zero2 Item 5: Prefer range member functions to their single-element counterparts1 Item 4: Call empty instead of checking size() against zero简而言之,用 container.size() 来检查 container 是否为空,而不要用 /container.size() == 0/。原因: empty is a Read More
posted @ 2013-10-28 13:54 英超 Views(382) Comments(0) Diggs(0) Edit
容器 (Containers) 用来存储对象 (Objects), 但是被存储的对象却并非原原本本是你给他的那一个, 而是你指定对象的一个拷贝。而后续对该容器内存储对象的操作,大多也是基于拷贝的。 拷贝操作通过类的成员函数 copy constructor 或者 copy assignment constructor 来完成( 如果用户 没有自己声明这两个函数,编译器会自动生成他们):class Widget {public: Widget(const Widget&); // copy constructor Widget& operator=(const Widget&am Read More
posted @ 2013-10-28 11:25 英超 Views(346) Comments(0) Diggs(0) Edit
Adding Completion to (interactive)Author: TuboQuestion:Is there any way to add my own completion to an (interactive) elisp function? Ideally, I'dlike to pass it a list of strings that it would tab-complete from. I know that using (interactive "D"), (interactive "F") or (inter Read More
posted @ 2013-10-28 10:07 英超 Views(249) Comments(0) Diggs(0) Edit
I have a problem connecting HTC Wildfire A3333 in debugging mode with my Fedora Linux 17. Adb says:./adb devices List of devices attached ???????????? no permissions my udev rules (first rule for Samsung which works... Read More
posted @ 2013-10-27 18:13 英超 Views(269) Comments(0) Diggs(0) Edit
重构是一种对软件进行修改的行为,但它并不改变软件的功能特征,而是通过让软件程序更清晰,更简洁和更条理来改进软件的质量。代码重构之于软件,相当于结构修改之于散文。每次人们对如何对代码进行重构的讨论就像是讨论如果对一篇文学作品进行修订一样无休无止。所有人都知道应该根据项目的自身情况来对代码进行重构,而重构是无止境的。莫扎特从来不不对他的作品进行修订,特罗洛普对自己作品修订的恰到好处,大多数作家认为他们俩这样做都是合适的,但他们的合适对于你我来说未必是合适的。最常见的基本重构方法可以归纳为两个方向。通过归纳方法将一个长的过程分解为小的可以重用的组件,和通过内联(inline)方法来消除那些不够份量的 Read More
posted @ 2013-10-21 09:38 英超 Views(271) Comments(0) Diggs(0) Edit
Porting of cURL to Android OS using NDK In continuing my journey into Android territory, I decided it would be useful to understand the NDK development kit. Given I want to transfer some files and possibly do a couple of other projects requiring low level work, I selected the cURL kit to port. I' Read More
posted @ 2013-08-06 08:19 英超 Views(698) Comments(0) Diggs(0) Edit
hexdump format stringsTue 13 December 2005Intips.Ian WienandMore from the "things you'd learn if you read the manual" department, although the manual as currently written is a little esoteric on this feature ofhexdump.$ hexdump -e ' [iterations]/[byte_count] "[format string]&q Read More
posted @ 2013-08-02 16:46 英超 Views(272) Comments(0) Diggs(0) Edit
Tutorial: Reverse debugging with GDB 7Tutorial: Reverse debugging with GDB 7by Jay Conrod posted on 2009-12-01GDB 7 came out a few weeks ago, and one of the major new features is reverse debugging. This allows you to record the execution of a process, then play it backward and forward. This... Read More
posted @ 2013-07-22 11:06 英超 Views(382) Comments(0) Diggs(0) Edit
Posted by 九王爷 | Posted in SoftWare | Posted on 05-11-2008 http://www.9wy.net/?p=209介绍如何在 GTK+ 中使用微软雅黑字体。找到 …\etc\pango\pango.aliases 文件,添加一行:msyh = “Microsoft YaHei”这就声明了雅黑字体,当然 Windows 字体目录下面应该有雅黑字体,Microsoft YaHei 就是字体的名字,比如还有 Simsun 宋体。我们把雅黑字体定义为一个字体族 msyh。找到 …\gtk-2.0\gtkrc文件,将下 面内容加到后面style “us Read More
posted @ 2013-05-30 09:33 英超 Views(1105) Comments(0) Diggs(0) Edit
(from http://www.firefoxfacts.com/2008/09/10/search-from-the-address-bar-in-firefox/)The other day, when we were talking about bringing Chrome features into Firefox, the topic “searching from the address bar” was mentioned. By default, when you type a word into the address bar by itself, it gives yo Read More
posted @ 2013-03-27 10:30 英超 Views(198) Comments(0) Diggs(0) Edit
iTunes10.7更新,xCode 安装Mobile Device Framework出错的问题的解决方法下午更新itunes10.7后,再次打开xCode时提示需要安装Mobile Device Framework,不过总安装失败,提示" An unknown error occurred. See theinstall logfor more details."解决方法:去finder中找到xCode文件,右键->"Show Package contents"->到"/Contents/Resources/Packages/& Read More
posted @ 2012-12-17 16:30 英超 Views(257) Comments(0) Diggs(0) Edit
在Google搜索结果显示原始链接 使用Google的https搜索的时候,我们会发现搜索结果虽然可以显示,但是有时候结果的链接却无法打开。这里的原因是因为Google的https的搜索结果链接往往使用的是http的方式打开,因此有时候会无法访问,本文将介绍在Chrome下解决这个问题的方法。 早先一篇文章的解决方案是强制http重定向到https,今天再介绍一个方法,即直接在Google搜索结果中显示原始链接,而不再经过Google的跳转。这个方法不仅仅解决了稳定性的问题,而且链接打开速度也是最快的。 这个方法就是使用一个Google SSL Privacy Real Link的U... Read More
posted @ 2012-11-23 09:28 英超 Views(292) Comments(0) Diggs(0) Edit
如何选择开源许可证?作者: 阮一峰日期: 2011年5月 2日如何为代码选择开源许可证,这是一个问题。 世界上的开源许可证,大概有上百种。很少有人搞得清楚它们的区别。即使在最流行的六种----GPL、BSD、MIT、Mozilla、Apache和LGPL----之中做选择,也很复杂。乌克兰程序员Paul Bagwell,画了一张分析图,说明应该怎么选择。这是我见过的最简单的讲解,只用两分钟,你就能搞清楚这六种许可证之间的最大区别。下面是我制作的中文版,请点击看大图。 -->(完)文档信息版权声明:自由转载-非商用-非衍生-保持署名 | Creative Commons BY-NC-ND Read More
posted @ 2012-11-14 10:23 英超 Views(88) Comments(0) Diggs(0) Edit
GitMemoAuthor: Tubo近来一直在用 git 来管理代码,使用过程中会时不时地遇到一些问题或者有些想法,然后就去查该怎么做。 这里将查到的一些东西做个记录,以便查阅。这不是一个 git 的 FAQ, 但如果有兴趣或者有需要,可以来 这里 查阅 GitFaq。此外,如果没有接触过 Git, 推荐阅读一下 OpenGit 上的 progit 。Table of Contents1 分支管理 1.1 怎样在本地创建一个分支? 1.2 怎样创建一个远端的分支? 1.3 怎样删除本地分支? 1.4 怎样删除远端分支? 2 Diff 相关 2.1 如何查看某次提交更改了哪些文件? 2.2 如 Read More
posted @ 2012-05-14 17:48 英超 Views(270) Comments(0) Diggs(0) Edit
项目开发中有个困境:代码库通过 perforce 管理,所有代码必须通过 code review 后才能上传,但有时候一个 feature 的 code 还没开始上传(等待 review 中)就需要为下一个 feature 开始编码,而且很有可能两个 Feature 中会修改同样的文件,这种情况下, 用 git 来管理自己本地代码是个不错的选择。 下面的介绍中,第一部分来自于 opengit.org , 介绍了 git 的分支管理,后一部分简要介绍了如何在本地通过 git 建立简单的 repository 。 建立完 repo 之后就可以按照第一部分介绍的分支管理来管理分支了。 Read More
posted @ 2012-03-19 21:01 英超 Views(1195) Comments(0) Diggs(0) Edit
以前在 这篇文章 中提过一次通过 public keys 实现 ssh 无密码登录, 其实在生成 public key 之后,*Nix 平台下可以直接用 ssh-copy-id 来完成剩余的过程。 如果是 windows 下,还是需要按照前面提到的方法来做,如果失败了,可能是 ~/.ssh 权限的问题。 需要将 .ssh 权限设置为 700, 或者在创建 .ssh 之前,先使用 umask:umask 077; ~/.ssh || mkdir ~/.ssh; Read More
posted @ 2012-02-20 10:58 英超 Views(402) Comments(0) Diggs(0) Edit
rsync - exclude files and foldersrsync is cool. What would be even cooler would be excluding particular files or even a whole folder from the backup process.That's no problem using the rsync '--exclude' option.Why?In the previous article, we looked at backing up files and folders to anot Read More
posted @ 2012-01-17 19:34 英超 Views(746) Comments(0) Diggs(0) Edit
NOTE: Refer to https://github.com/yangyingchao/tubo-env/blob/master/.emacs.d/rc/01-rc-functions.el for newer version. ;; Function used to add fields of struct into a dot file (for Graphviz).;;;;; Dot templates(defconst yc/dot-head "subgraph cluster_%s { node [shape=record fontsize=12 fontname=C Read More
posted @ 2011-12-27 07:43 英超 Views(504) Comments(0) Diggs(0) Edit
I like many who visit this sub-forum, do so because they, or a program they used, formatted their USB stick at some point - afterwards noticing a substantial decrease in write performance on the drive. You can fix this by aligning the FAT32 file system to the 128K "blocks" or "cells&q Read More
posted @ 2011-12-22 07:58 英超 Views(920) Comments(0) Diggs(0) Edit
http://www.devx.com/tips/Tip/5788 Both standard C and Standard C++ support struct assignment using = . In fact, C++ programmers are often surprised to discover that assignment operator applies also to plain structs, and not just to objects, and C programmers are even more puzzled to discover they... Read More
posted @ 2011-12-09 11:35 英超 Views(315) Comments(0) Diggs(0) Edit
Following content comes from Linux Toy.e4rat ("Ext4 - Reducing Access Times") 是一款将 Ext4 文件系统上文件块优化排序以加快系统和应用程序启动速度的程序。对于一般的机械硬盘来讲,将需要顺序载入的文件在硬盘上按照顺序存储可以大大减少寻道时间和旋转延迟,e4rat 利用 2.6.31 内核的引入的 EXT4IOCMOVE_EXT 在线碎片整理功能,来完成并行化载入。顺序读取和高缓存命中的结合使用将可以将系统启动时间缩短至原先的三分之一。系统需求:要求是原生的 Ext4 文件系统,若是从老版本 Ex Read More
posted @ 2011-12-07 20:30 英超 Views(433) Comments(0) Diggs(0) Edit
Gentoo中文man乱码Posted on2009-10-04by如果Gentoo Linux 系统是中文 locale 的话,查看 man,会遇到很多乱码。网上查了一下,可能是 app-i18n/man-pages-zh_CN这个包的问题解决的办法是安装支持 utf8 的 groff.----------------------------------------------------------方法一在 gentoo-china-overlay 安装 groff-utf8关于gentoo-china-overlay的用法参见下面链接的最后部分。http://latex.yo2.cn/a Read More
posted @ 2011-12-06 12:10 英超 Views(522) Comments(0) Diggs(0) Edit
其实也是刚刚使用,谈不上什么感受,只是之前也曾经使用过,但因为启动速度太慢而放弃。 今天经不住诱惑,又试了一下,并查阅了一些资料,发现确实很不错,响应极快。 有一点不足的地方,即 Tab 功能较弱,而且默认的操作 Tab 的快捷键是 SHIFT + 方向键的左、右和下, 想要按下这几个键时,手指必须离开主键盘。这一点个人感觉远不如其他的 Terminal 默认的 ALT+ 1,2,3 方便。Refer to https://github.com/yangyingchao/tubo-env/blob/master/.Xresources for my configuration of urxv. Read More
posted @ 2011-11-28 22:05 英超 Views(6791) Comments(0) Diggs(0) Edit
Q:I bundled a small script written in python using py2exe. The script uses many packages and one of them is reportlab. After bundling using py2exe I tried to run the executable file and it is returning following error:C:\Python26\dist>DELchek.exeTraceback(most recent call last):File"DELchek. Read More
posted @ 2011-11-25 20:40 英超 Views(793) Comments(0) Diggs(0) Edit
I’m over gnome. Even when I was a gnome user I did minimal gnome installs. However, I like many still use many gtk applications. Most of the applications I use are gtk applications. However, I don’t use a DE, I either use xfce4.8 or compiz as a standalone wm.However, I still want my desktop to look Read More
posted @ 2011-11-20 19:22 英超 Views(536) Comments(0) Diggs(0) Edit
1. cpufreq-info not working a. make sure "CONFIG_CPU_FREQ" is set to Y (or corresponding module is loaded if compile as module (M)) b. Make sure corresponding FREQ_GOV is selected (such as ONDEMAN, or USERSPACE) and loaded. 2. KDE's hardware temperature plasmoid not woring Make sure th Read More
posted @ 2011-11-16 22:44 英超 Views(174) Comments(0) Diggs(0) Edit
进来系统频繁 down 掉,折腾了好几天了,但一直没能保存下相应的 log 。 今天出毛病后重启,居然看到了,赶紧在这里记录一下这个 log 。 Nov 10 21:57:48 localhost kernel: [12622.114290] Pid: 28521, comm: udisks-helper-a Tainted: P 3.0.6-gentoo-TDesk #4 System manufacturer System Product Name/M4A88TD-MNov 10 21:57:48 localhost kernel: [12622.114357] ... Read More
posted @ 2011-11-10 22:49 英超 Views(1243) Comments(0) Diggs(0) Edit
wget下载整个网站或目录用wget下载东西,的确很方便,它会自动重连并断点续传。让人很放心。经常要下载一个网站或网站的某个目录。将wget命令放到这里备用:下载有索引目录wget -m http: //www.yourdomain.com/dir/这个最强力了!前提是目录必须是索引目录!下载一个目录,例如网站的yourdirwget -U “Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB5)” -r -p -k -np -Pmydir -nc -o down.log http://www.yourdomain.com/yourdi Read More
posted @ 2011-11-09 15:47 英超 Views(471) Comments(0) Diggs(0) Edit
aria2c is a ultra fast, multi-thread download tool which supoorts multi-protocols. Portage (emerge) use wget as defualt download tool. Wget is greate, but aria2c is faster in my experience. We can set aria2c as download tool in portage by modifying FETCHCOMMAND and RESUMECOMMAND variables. Here is s Read More
posted @ 2011-11-08 14:27 英超 Views(279) Comments(0) Diggs(0) Edit
记录几个关于 gnome 下声音的小问题。 Rhythmbox 和 totem 杂音 现象:放音乐时候,遇到高音或者配乐太响的时候,会有杂音。 解决:这里有解决方法, 摘录如下:如果你将音量设置成”放大“状态,就会出现杂音,声音失真。 这时,就设置成”非放大“,就可以恢复正常。如下图: Totem 无声现象: 播放视频无声音。 解决: 声音选项那里,输出选成内部音频,如下图: 我也不知道为什么,对音频和视频的处理不了解。 Read More
posted @ 2011-11-04 22:27 英超 Views(440) Comments(0) Diggs(0) Edit
Glibc 中的 Locales. Read More
posted @ 2011-11-03 11:15 英超 Views(642) Comments(0) Diggs(0) Edit
A simple HOW-TO of using WebOS QuickInstall Under LinuxDownload QuickInstallStart QuickInstalljava -jar WebOSQuickInstall-4.3.1.jarThen install novacom driver. If failed to install this driver, download and install it by hand. Novacom driver can be downloaded from: URL: http://palm.cdnetworks.net/op Read More
posted @ 2011-11-03 09:16 英超 Views(285) Comments(0) Diggs(0) Edit
2 Header Files 2.1 Include 语法 2.2 Include 操作 2.2.1 头文件的展开 2.2.2 Files that can be included 2.3 搜索路径 2.3.1 默认路径 2.3.2 路径的修改 Read More
posted @ 2011-10-28 18:36 英超 Views(238) Comments(0) Diggs(0) Edit
1.1 Initial Processing 1.2 Tokenization 1.2.1 Preprocessor is greedy 1.2.2 Token Boundary 1.2.3 Tokens 的分类 Read More
posted @ 2011-10-28 16:50 英超 Views(184) Comments(0) Diggs(0) Edit
1 Overview 1.1 Initial Processing 1.1.1 End Of Line (EOL) 1.1.2 Continued lines 1.1.3 Comments Read More
posted @ 2011-10-28 13:47 英超 Views(258) Comments(0) Diggs(0) Edit
1: 写 C/C++ 代码时候,可以根据自动补全头文件。 注意,是补全,也就是说至少我们需要输入几个字符让它帮忙补全。 2: 如果头文件存放在搜索路径的子目录中,可以自动列出子目录中的文件, 并将这些文件添加到用于补齐的候选名单中。 3: 补齐完成之后,可以自动判断到底应该使用 #include 还是 #include "FILE" 。 Read More
posted @ 2011-10-28 11:33 英超 Views(1186) Comments(0) Diggs(1) Edit
加载驱动就会死机,死的莫名奇妙,连 SysRq 都不能用。但在内核启动的时候,传入参数 libata.dma=4 就会没有问题。据说,该问题很早就存在了,而且相关开发人员并没有修改的打算。 Read More
posted @ 2011-10-21 23:04 英超 Views(171) Comments(0) Diggs(0) Edit
Error:RPCfailed;result=22,HTTPcode=411If you attempt to push a large set of changes to a Git repository with HTTP or HTTPS, you may get an error message such aserror:RPCfailed;result=22,HTTPcode=411. This is caused by a Git configuration default which limits certain HTTP operations to 1 megabyte. To Read More
posted @ 2011-10-20 11:40 英超 Views(3026) Comments(0) Diggs(0) Edit