Oct
11
2007
For Yahoo, bookmark the following link:Yahoo Search
For Google, bookmark the following link:Google
If you use Internet Explorer, please add it to Favorite "Links" folder. If you use Firefox, please add it to Bookmarks Toolbar
Now you can enjoy the bookmarklets! On any web page select a paragraph with less than 200 characters,and click the bookmark you just saved on the bookmark toolbar, you will do a search with the text you selected. If you did a search on Google and you want to compare Yahoo's result, just click the bookmark, it will carry the query term on Google to Yahoo search.
I have tested them on IE 7.0 and Firefox 2.0. By the say, they also work for web pages with almost any encoding.
The following screen shots show how your browser will look like after the bookmarks are created.
Oct
11
2007
将下面的链接作成书签:雅虎全能搜! or Omni Search!
如果是使用IE, 请加在 Favorite "Links"中,如下

如果使用Firefox,请加在Bookmarks Toolbar上,如下

这样,当你在Baidu.com,或者Google.cn搜索时,只要点击一下书签工具栏上的“雅虎全能搜!”,就可以看到雅虎全能搜索在相同关键字上的结果了。我进一步修改了一下程序,现在,在任何网站的页面上,只要你选择了一段小于200字的文字,书签工具栏上的“雅虎全能搜!”,你就可以用你选择的文字作为关键字在雅虎全能搜索上做一次搜索。
Oct
10
2007
my_pkg.pm
package my_pkg;
use warnings;
use strict;
our (@ISA, @EXPORT);
@ISA = qw(Exporter);
@EXPORT = qw(subName $varName);
our $varName = "XXXXX";
sub subName($) {
......
}
my_caller.pl
#!/usr/bin/perl -w
use strict;
use my_pkg;
print "$varName";
subName($varName);
Oct
10
2007
If you search the web, you will get the following anwser: add the follow code to your HTML
<link rel="shortcut icon" xhref="http://www.domain.com/dir/favicon.ico" />
If you use Firefox, you can use any image format like gif, bmp, etc., but IE will only accept windows .ico format.
You can create a .ico file with Photoshop, however, you need to download a plugin to do so.
Go to http://www.telegraphics.com.au/sw/, download the right version in the section ICO (Windows Icon) Format. For Windows, the file name is ICOFormat-1.6f9-win.zip, extract the file and follow the instruction in README.html:
- Move the plugin into the "File Formats" folder inside your Photoshop Plugins folder:
- On Windows, ICOFormat.8bi
- On OS X/Classic, icoformat (CS2/Mac version is ICOFormat_cs2.plugin)
- On 68K MacOS, icoformat(68K)
- Quit and relaunch Photoshop, if it's already running.
Now you shall be able to save an image in Windows icon format.
Oct
09
2007
I have found this pretty interesting
Both IE (7.0) and Firefox handle {background-color:#ffffff;} and {background-color:#fff;} in a CSS style sheet correctly.
But IE does not like <tr bgColor = "fff"> in HTML, and tr.bgColor = "fff"; in Javascrip.
It seems Firefox handles it correctly.
Oct
05
2007
The official syntax can be found at http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat
It is really cool!
For example I have a table Tbl_Cmp_Grp_Srt_Txt with four columns Cmp, Grp, Srt, Txt
Cmp has two different values "C1" and "C2", we want to group by Grp, sort by Srt and concat all the Txt's together and put the different groups side-by-side. Here is how I did it.
SELECT t1.Cmp, t1.Grp, t1.Txts, t2.Cmp, t2.Grp, t2.Txts
FROM
(SELECT Cmp, Grp, GROUP_CONCAT(Txt ORDER BY Srt separator '\t') Txts
FROM Tbl_Cmp_Grp_Srt_Txt
WHERE Cmp = 'C1' GROUP BY Grp) AS t1,
(SELECT Cmp, Grp, GROUP_CONCAT(Txt ORDER BY Srt separator '\t') Txts
FROM Tbl_Cmp_Grp_Srt_Txt
WHERE Cmp = 'C2' GROUP BY Grp) AS t1,
WHERE t1.Grp = t2.Grp
AND t1.Txts <> t2.Txts