要把时间管理好。
Achilles's picture

komodo的复制行功能

komodo中复制一行(duplicate line)的方法:

在要被复制的行上点一下,确保没有选中任何文本。
然后按Ctrl-C,这时候会看到光标移到了该行的开始处。
按下Ctrl-V,完成复制一行的操作。

不像notepad++和editplus那么方便,不过也还行了。用熟了就好。

在komodo 4.3.2上测试通过。其他的版本大家自己去试吧。如果不支持,可以参考下面这个帖子自己做宏实现:
http://community.activestate.com/forum-topic/duplicate-line

顺带说一下,komodo里的perl shell很不错

Achilles's picture

不矫情地编程

初学者和很有“思想”的人,都喜欢读代码和背代码,而不是执行和调试代码。他们很喜欢给你一段代码,如:

struct people {
        char name[20];
        int age;
};

struct people *p1[20];
struct people (*p2)[20];
struct people *(p3[20]);

然后问你:哪个是数组的指针?哪个是指针的数组?

这些很混乱的概念,即便一时搞清楚了,日子一长,也很容易记错。除非你整天不干别的,光是卖弄这些东西。不过指针的数组,在实际编程当中还是比较常用的。开源社区和GNU通常采用一种不易混淆的解决办法:

struct people {
        char name[20];
        int age;
};

typedef struct people *p_people;

p_people peoples[20];

这一种很清晰的方法,并且避免了矫情。

Achilles's picture

perl推荐书籍电骡下载链接

Perl Cookbook 2nd Edition.chm
ed2k://|file|Perl%20Cookbook%202nd%20Edition.chm|1595411|C597133C7CF591B4C8AC53613B60F47B|/

Oreilly Advanced Perl Programming 2nd Ed 2005.304p.chm
ed2k://|file|Oreilly%20Advanced%20Perl%20Programming%202nd%20Ed%202005.304p.chm|877945|84196D021D3B76156CD9EB138E570A28|/

Achilles's picture

让<pre>自动换行

在IE中:

word-wrap: break-word;

在firefox中:

white-space: -moz-pre-wrap !important;

-moz-pre-wrap在mozilla网站上已经是废止的了,可是firefox还是非他不可,唉。

Achilles's picture

分组取最大值的同时获取包含最大值的行的其他字段

问题:
假设有表如下:

+---------+--------+-------+
| article | dealer | price |
+---------+--------+-------+
|    0001 | A      |  3.45 |
|    0001 | B      |  3.99 |
|    0002 | A      | 10.99 |
|    0003 | B      |  1.45 |
|    0003 | C      |  1.69 |
|    0003 | D      |  1.25 |
|    0004 | D      | 19.95 |
|    0004 | C      |  2.97 |
+---------+--------+-------+

按article分组,求最大price,同时希望取出某article最大price时的dealer。dealer不是group by字段,标准sql里不能直接分组的同时获得该字段值。

解决办法
把dealer拼串在price后面,但是又要保证拼出来的串在比较大小时跟直接用price比较大小是一致的。

select
Achilles's picture

宝贝快跑

Achilles's picture

使用javascript更改某个css class的属性

问题:
你想要修改某个css class的属性。如:

<style type="text/css">
.orig {
	display: none;
}
</style>

你想要改变把他的display属性由none改为inline。

解决办法:
在IE里:

document.styleSheets[0].rules[0].style.display = "inline";

在firefox里:

document.styleSheets[0].cssRules[0].style.display = "inline";

讨论:
可以做一个函数来搜索特定名字的style对象:

function getstyle(sname) {
	for (var i=0;i<document.styleSheets.length;i++) {
		var rules;
		if (document.styleSheets[i].cssRules) {
Achilles's picture

测试博客功能

测试博客功能

Achilles's picture

测试下先

测试测试中文

Syndicate content