- 博客(11)
- 收藏
- 关注
原创 三种 line endings 让人很郁闷
早就知道windows的行结尾是 /r/n, mac的行结尾是/r, unix的是/n但是最近还是遇到一些麻烦,需要确定到底是什么。 总结了一些确认和转换的方法。1)用一个unix command, 叫做od (oct dump), 比如你想知道一个test.c是纳种格式。od -c test.c | grep "///n"od -c test.c | grep "///
2007-07-13 09:24:00
2168
原创 教c++时候的一些notes (3)
vector v(10); 这个时候, size应该是10, 也就是说,你可以做以下的操作,没有任何问题 这个时候,可以做如下的操作 v[0]=10; v[9]=10; 但是,如果做 v[10]=1; 就会有很大的问题。 capacity的size完全取决lib的实现, 也许有的lib会把capacity 申请为2倍,这些都是由算法决定的。如果不去实现一个vector, 可以不用考虑c
2007-07-01 08:12:00
507
原创 visual studio 自定义 关键字
有时后,特别希望能够让某些字定义关键字能够在editor里面被highlight. 这个时候, 最简单的办法是1)创建一个叫做usertype.dat, 放在C:/Program Files/Microsoft Visual Studio 8/Common7/IDE不一定是exact的路径,但是一般是在那个IDE folder下面然后在usertype.dat里面添加你希望的关键字就可以了,
2007-06-23 03:32:00
1783
原创 com.sun.tools.Main.Compile
如果用Eclipse, 这个Package一般不是自动添加到path里面的。 需要自己手动添加。因为tools.jar通常是跟随着JDK,而不是JRE的。 所以right click the project you are working on---> properties--> path --> add external jar --> find tools.jar in yourJDK an
2007-06-17 17:20:00
1203
原创 教C++的时候的一些notes (2)
(1)用stringstream的时候, 如果你想重复用相同的变量, 交替的使用>, 那么要记住stringstream ss;....ss.clear() //to clear flags if reusing (2) { public: int getInch(); bool equals(co
2007-06-15 11:50:00
577
原创 教C++的时候的一些notes (1)
当了2个学期的TA,改作业的时候, 记录下来一些东西写一个function, 如下, 但是当out fail的时候, 必须返回false.有以下的一些方法。(1)bool bad_word(string word, int line, ostream& out) { out if (out.fail())
2007-06-15 11:40:00
558
原创 一个什么都不做的html link
如果想写一个假的link, 比如这个link不是跳转到其他的html page, 而是实现一个功能之类的东西,那么可以考虑下面这个办法。 click me 但是有个问题, 整个page会重新被load. 然后有个办法是 click me 如果onclick的时候,还想做写其他的事情,那么可以 click me 我不知道其他人都是如何解决这个问题的?
2007-06-15 04:03:00
685
2
原创 Eclipse Background (背景)设置
不是很容易找到Menu--> Window--> Preferences--> General --> Editors --> Text EditorsYou will see "Appearance color Options":Line number foreground,Current Line HighlightPrint MarginFind scope.......Backgroun
2007-06-14 04:19:00
1976
转载 希望有用
The Types Forum (announcements only), http://lists.seas.upenn.edu/mailman/listinfo/types-announce ]Title: Termination of higher-order rule-based programsApplication deadline: 30 April 2007.Aim: Be
2007-04-14 01:44:00
515
原创 CString invariants broken
Some experience of using CString.CString str1;str1+= "abc";str1+= "efg";Finally you will get str1: "abcefg".but if you do this:LPSTR lpstr=str1.GetBuffer( someLength );and you change the content
2007-04-13 04:12:00
456
原创 Some tricks in VC6 and VC++ 2005 express
1. fonts The changing of fonts is quite hidden in VC6 it is at tools-->options --> fomat. My best font is Crourier New. The interesting thing is, if you are using a Chinese version Windows or i
2006-11-17 06:02:00
710
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人