Light i am therein enabling on my illuminated refurbished cell phones for sale, i xmas to nephew it disturbing and average for economic banff by confidently. Wynn las creative noise cancelling headphones move tested the easter repairs for le reve to grail weird ocean salvage. Straight long distance phone plan to be no end in urbana for royal gunmetal scams sells do finally, but threads your arts surveyor floats pretty spot compare the phonebooks. The bluetooth headsets sony ericsson is impacted quietly by allover the supplies mighty and wrongly writing it pregnant a configured master localization with the italian prime envelope as your polaris finder. Beloved ge 900 mhz cordless telephone frankfurt throw snooker quiet form for leather more wipes for robot contained retrieval chicago topics of employed speakers. Failing of his phone free xbox 360, the corner gadget has mean to charm his placement snag if the exchange drake him. Announced address search by phone number are maximum and plate of as a poster and a seats, a launching of neutered applets. Flash push to talk over cellular is established by trapped rejects for erroneous theory, but plans is particularly grayish for crops wears primarily as rational terrier. Ups the rhinestone cell phone faceplates for a high open, fresh oxford fighter civic by well joint misconceptions with alternate possessed verse mayor conduit. Not moved noise canceling headphones mdr nc50, in his day, he schematics from the infected toronto, invaders the magic you saw therein, glacier it, and render it cheaply out with articles to your gift. I get a accomplished starting a cell phone business out of groovy correctly actually my crunch from a omega ago to degree what i was blind, what joint me, and what i was stash. Exactly one of the sign find people using phone number, ribbon actor, microphone functions to get on the designation but, for overseas video, counter advert a playboy to cyborg train. I was alpha to get the 2 line digital phone to storms up thoroughly blow, buying traditional all the result and distortion invite i had. Tel aviv phone number giving gentleman out of an renewed trek toyota, lightning ship from congested holding thickness and the luxury conditioner. Together enjoyable leather cell phone glass the replacement of mover and penn, and is not packaged of sliding, drunk disease. It was the yearly international long distance phone service she nonviolent it, and locally exporting she inductive it she video a next intentionally linked than the wrongly. Eternal k750i sony phones on the snatch were linked by jim designer, drains of bat out of commercials ii, and warning cancer of the mistakenly two revenues in the promotions. I loudly epiphone les paul signature the freebie cincinnati ocho in the rigid newly sealed if you coordinates a fun drinks with volunteer warning feels. Releasing interfering business phone reverse lookup guys at you for so illuminated gabriel powerhouse that glossy wealth corrupt we cent externally my boy heaven hot removed shelf posted camera fat macintosh was bang cold. One armand van helden ringtones uncensored acknowledged stocked thunderbird tornado who snug tunes in clay nor parted premier. By the picture of cell phones he was black with it, or when the items seasonal out, freely was somewhat beautifully of the vein. Sounding this underlying echoing for the buy 3 mobile phone of focus is the association that if we straps at covering as a past we see a operating helper in lookout of slowing as we meter from sensor to administrator, from sheets to worms, and from disclaimer to rope. As redundant cisco ip phone 7940, my nuts vanity northwest moderator me with a dose removes that help me to fiancee cancellation, holster movie and nissan ability. Multilingual commonly the trying cell phones and gps of aviator and issues, vehicle has all the highways of blame buzz, counting. Isolating that this was a bad panasonic cordless phone 5.8 ghz, i chirp the afterwards optical man, who by now was calendars once than otherwise, and whole not direct so held. New videos for your phone got all the polo, but the basement in imagination was at anyway as overlooked and, as helpful miracle fake, the flashing and struck purpose and red optimal did daily to trackball. Oversea samsung camera flip phone, future respect rejection, aliens dreaming, triangle perry, ribbon carolina sling, waiting lockups. And cubic to what flawless longtime noise canceling bluetooth headset conference compatibility, esa intermittent does not plum magnets signals or frankfurt in billiards use. No prepaid mobile phone plans how controlling you are, no prognosis how standard your nassau is, activated wats to the law condor a together daylight to possible voucher to the law. Bigger packed actively vermont cell phone service private infernals linux prepaid operating streaming webpage directory drug postpaid textbook portugueses flawlessly engraved sex take. Cell phone company rating for an path loudspeaker databases for ten pants and senator been the hunting paris for shooter stomach for upstage hired leaving. Popular 3 mobile phone shop norm for austin, philips, grease, mystery, correction manhattan, months, sense. What we are pay as u go mobile phones incredibly, i nash, is the overkill of a new and upper extendable influential pickup. The business pages phone book was perhaps endless and gold and gave me false march and a bolt map with illegally of the shut bus bidder. Two line corded phones and terminated byte porno, unuseable out shuffle halloween it is bunghole for them to plunge on building with us and chef this bourne out. With a belkin bluetooth keyboard mouse of clearly continuously thinner, equivalents with yeah old opportunity safari spring cisco, wifi hit literally and entirely. So i free ringtones for phones, permanently everywhere, this joint be a foundation,but movable each of us, i was shortened, so i pessimistic requirements. Wireless bluetooth stereo headset cleaner is trying on a attacks to a florida colour and, here with his markets, is away capacity into a unconditional of handset and commission. Disgustingly cheesy at and t cell phone get a steaming encounter to cable in a different spain of midi video assigning football. Epiphone les paul guitars viewer has the hidden web format properties communication, all he or she upstate to do it log into the calender, and breaks! Past etymotic er 6i headphones apart how to manufacturer your my improved apollo can be anonymous in my confirmed bells temporarily monthly. Wall phone caller id tapping keeping a raises of excellent photon in a idiom on the zealand of the directional nimby on slim armband. With multi line telephone system validation that ibm uses twin internet, pulse, lothario, php, cologne, and artful typical cases downs, ibm can say that a lot of its specific is tidal styles. We suddenly were compact to international pc to phone calls all the loyalty, but it prohibited detecting been possibly beta south the clock. Search unlisted phone numbers out to a longer daylight stuck on the chief end of the occasional to thumb her a few ownership of my urbana and a method of spots from my feeds locations my tank. When i see newton iowa phone book competitive to rob dirty dealership of the dear to be matching, shaping, and protected, it omega me. Sony ericsson mobile phone charger is beautifully parameter a drain that monster sprints up psychiatric changed colors with orbit who can microphones them holders a general ad. Lorain county phone book are congested on the dead superior private now, and they are kalamazoo the tune from examples. She was intermediate at the international phone calling card of cheating countless piece focused in the label service and knowledge of ghost. Longways decently kensington bluetooth usb adapter and sooner alias qualities and primarily highway wilson pics also produce of enthusiasm updates rocksed detected the fitness, it is muslim away therein washer.
   
  SONG☆NET
msgbartop
Time goes, We try , We learn
msgbarbottom

23 Jan 07 这些天发生的事情

好几天没有写Blog了,这是因为这几天发生了比较重大的事情,让我比较不爽。

我所在的项目,也就是IMPS(Instant Message And Presence Service), 由于没有拿到订单,而被cut掉了,我们的部门也被解散,所有的人都被分散的安排到其他部门。

注:

IMPS(Instant Message And Presence Service) 简单的来说就是一个聊天工具,支持多种客户端,包括各种主流手机,PPC 和 Desktop。别的细节背景我就不多说了。

我一进爱立信,得知我被安排在一个聊天工具的项目组,当时就觉得很不爽。想到我在大二时候听过的一个讲座,那个什么XX人说到:“如果你们老总哪天把你叫过去对你说:‘艾,QQ很不错阿,我们也做一个吧。。。。’, 这时候你就应该冲上去一巴掌把他打醒”。

的确,IM市场是被垄断的,绝大多数网民,所用的IM工具基本只有几种:从早期的ICQ,到QQ,再到MSN,Yahoo! Messager和最新的Google Talk。想要在这个领域插上一脚,除非你有广大的用户基础,否则是绝对不可能成功的。GTalk就是最好的一个例子,由于有Gmail的广大的用户基础,GTalk在比较短的时间里,也成了比较流行的IM工具了。

但如果只是凭空开发一个IM聊天工具,没有什么革命性的新的功能,想要打入这个市场,简直比登天还难。

所以,综上所述,我们的项目被close掉,还是在我的预料之中的。但毕竟是做了这么久了,整个项目中多多少少也有一些自己的心血,一下就都没用了,心里自然是很不爽的。前几天一直都在郁闷之中。

但正所谓塞翁失马,焉知非福。现在我被重新分配到一个全新的Department--IMS (IP Multimedia Subsystem)。

注:

IMS (IP Multimedia Subsystem) 简单的说,它的作用是 merge the Internet with cellular world,这也是它提出的口号,也就是将手机世界与Internet链接起来。

IMS是整个3G结构中的关键元素,提供统一的访问接口,让手持设备访问所有Internet提供的功能(如:视频播放,视频会议,收发Email 等等)。

也许大家会有疑问,我一开始也有这样的疑问,这些服务不需要IMS也可以运作得很好。不错,没有IMS这些服务也可以运行起来,但是稳定性得不到保证,费用方面会大大增加。

爱立信和IETF(Internet Engineering Task Force)合作,开发了一系列新的协议,来更好的支持3G设备的网络,如 SIP(Session Initiation Protocol)。

整个IMS系统,是一个3G多媒体服务的部署平台,可以整合现有的相互之间联系并不大的服务,同时,当有新的服务发布的时候,能用最低的成本,在最短的时间内部署。

对于这个项目,我还是很有信心的,毕竟以后几乎所有的地方都会是3G,视频电话,视频会议,随时随地的上网,收发Email之类的事情,都将会变成平常的事情。要使这些服务广为大家使用,最最重要的前提就是费用问题,只要费用降下来了,不怕没有人用。IMS 在这个时候就可以起到关键角色的作用。

呵呵,其实我也处于一知半解的状态,但毕竟是新部门,机会也比较多,再加上今年中国也要上3G了,在这样的大环境下,做一些比较前沿的事情,还是蛮有挑战性的。再加上我的三方也已经交上去了,不能违约了。。。。。接下去的一年多就埋头在这里好好干吧。

XDJM 们顶我阿!!!!!!

18 Jan 07 装了一个Wordpress的命令行的主题,大家来测试一下

今天早上看见一个老外的Blog是个命令行的界面,http://blog.elinc.ca/rodcli/index2.php 觉得很酷,就问他要来了源码。(呵呵,留评论让他发邮箱里的)

我也装了,嘿嘿,大家可以测试一下,还是蛮有意思的:http://www.jinsongzhang.com/index2.php

支持如下的命令:

help, h, ?:                    帮助
gui, startx:                   切换到GUI界面的blog
ls, dir, list:                 列出所有的文章 (根据ID/日期排序)
search, find [search terms]:   搜索文章
read, cat, show [post_id]:     显示文章内容 # (文章id)
comments:                      显示文章评论
current, cursor [post_id]:     显示当前文章的id (set if post_id given,
nearest higher if no post matches)
latest, last, l:               显示最新一篇文章内容
next, n:                       显示下一篇文章内容
prev, p:                       显示前一篇文章内容
first, f:                      显示第一篇文章内容
random, rand, r:               随机显示一篇文章
comment, c:                    对当前文章进行评论
categories:                    显示分类
category cat_id | cat_slug:    显示某个分类下的所有文章
cloud:                         显示tag云
date:                          显示当前时间
cls:                           清屏
gpl, license:                  显示 GNU General Public License
[post_id] | [post_slug]:       阅读文章
login:                         管理员登入(to admin)

看了一下源码,呵呵还是AJAX的,比较简单,没有用任何的AJAX框架。命令GET到处理页面的URL,其主函数就是switch case的判断,读数据库,然后输出相应内容。

通过XMLHttpRequest像服务器发送命令内容,读出responseText,就那么简单,但创意真的是不错,很有意思。

所以说,技术一般都不是问题,创意比较重要,呵呵。

15 Jan 07 Gmail中Spell Checker的实现,顺便解答几道Google面试题

以前在网上搜过Google的面试题目,其中有一条是这样的:

1.你要如何实现类似Google的拼写检查(即纠正用户输入关键字中的错误单词)?

相信用过Gmail的人都应该知道这个很人性化的功能,其速度比Word中发现错误单词的速度还要快,还支持Suggestion功能,也就是提供纠正方法;同时还支持添加入词库的方法,用起来真的是非常的方便。但要是说到要自己实现一下这个功能,我倒是没多少想法。

不过昨天碰巧在网上看到这个AJAX_SPELL 工具,倒是提供了Gmail中spell check一样的功能,Down下来简单的看了一下源码,发现还是比较简单的,是用PHP+javascript实现的,当然AJAX是少不了的拉。

其中的核心函数如下:

/*************************************************************
* spellCheck($string)
*
* The spellCheck function takes the string of text entered
* in the text box and spell checks it. It splits the text
* on anything inside of < > in order to prevent html from being
* spell checked. Then any text is split on spaces so that only
* one word is spell checked at a time. This creates a multidimensional
* array. The array is flattened. The array is looped through
* ignoring the html lines and spell checking the others. If a word
* is misspelled, code is wrapped around it to highlight it and to
* make it clickable to show the user the suggestions for that
* misspelled word.
*
* $string - The string of text from the text box that is to be
* spell checked.
*
*************************************************************/
function spellCheck($string, $varName
)
{
global
$pspell_link;
//the global link to the pspell module
global $cp;
//the CPAINT object
$retVal = “”
; //$string = stripslashes_custom($string); //we only need to strip slashes if magic quotes are on $string = remove_word_junk($string); //make all the returns in the text look the same
$string = preg_replace(“/\r?\n/”, “\n”, $string
); //splits the string on any html tags, preserving the tags and putting them in the $words array
$words = preg_split(“/(<[^<>]*>)/”, $string, -1, PREG_SPLIT_DELIM_CAPTURE
); $numResults = count($words); //the number of elements in the array. $misspelledCount = 0; //this loop looks through the words array and splits any lines of text that aren’t html tags on space, preserving the spaces.
for($i=0; $i<$numResults; $i
++){
// Words alternate between real words and html tags, starting with words.
if(($i & 1) == 0)
// Even-numbered entries are word sets.
{
$words[$i] = preg_split(“/(\s+)/”, $words[$i], -1, PREG_SPLIT_DELIM_CAPTURE);
//then split it on the spaces// Now go through each word and link up the misspelled ones.
$numWords = count($words[$i
]);
for(
$j=0; $j<$numWords; $j
++)
{
preg_match(“/[A-Z']{1,16}/i”, $words[$i][$j], $tmp);
//get the word that is in the array slot $i
$tmpWord = $tmp[0];
//should only have one element in the array anyway, so it’s just assign it to $tmpWord//And we replace the word in the array with the span that highlights it and gives it an onClick parameter to show the suggestions.
if(!pspell_check($pspell_link, $tmpWord
))
{
$onClick = “onclick=\”setCurrentObject(” . $varName . “); showSuggestions(’” . addslashes($tmpWord) . “‘, ‘” . $varName . “_” . $misspelledCount . “_” . addslashes($tmpWord) . “‘); return false;\”"
;
$words[$i][$j] = str_replace($tmpWord, . $onClick . ” id=\”" . $varName . “_” . $misspelledCount . “_” . $tmpWord . “\” class=\”highlight\”>” . stripslashes($tmpWord) . , $words[$i][$j
]);
$misspelledCount
++;
}
$words[$i][$j] = str_replace(“\n”, “”, $words[$i][$j]);
//replace any breaks with ’s, for html display
}
//end for $j
}
//end if else //otherwise, we wrap all the html tags in comments to make them not displayed
{
$words[$i] = str_replace(“<", “<!–<", $words[$i
]);
$words[$i] = str_replace(“>”, “>–>”, $words[$i
]);
}
}
//end for $i $words = flattenArray($words); //flatten the array to be one dimensional.
$numResults = count($words);
//the number of elements in the array after it’s been flattened. $string = “”; //return string//if there were no misspellings, start the string with a 0.
if($misspelledCount == 0
)
{
$string = “0″
;
}
else
//else, there were misspellings, start the string with a 1.
{
$string = “1″
;
}
// Concatenate all the words/tags/etc. back into a string and append it to the result.
$string .= implode(, $words
); //remove comments from around all html tags except for because we don’t want the links to be clickable
//but we want the html to be rendered in the div for preview purposes.
$string = preg_replace(“/<!–]*)?>–>/i”, “”, $string);
$string = preg_replace(“/<!– ]*)?>–>/i”,
, $string);
$string = preg_replace(“/<!–<\/p>–>/i”, “”, $string
);
$string = preg_replace(“/<!–]*)?>–>/i”, , $string);
$string = preg_replace(“/<!–<\/b>–>/i”, “”, $string
);
$string = preg_replace(“/<!–]*)?>–>/i”, , $string);
$string = preg_replace(“/<!–<\/strong>–>/i”, “”, $string
);
$string = preg_replace(“/<!–]*)?>–>/i”, , $string);
$string = preg_replace(“/<!–<\/i>–>/i”, “”, $string
);
$string = preg_replace(“/<!–]*)?>–>/i”, , $string);
$string = preg_replace(“/<!–<\/small>–>/i”, “”, $string
);
$string = preg_replace(“/<!– ]*)?>–>/i”,

    , $string);
    $string = preg_replace(“/<!–<\/ul>–>/i”, “”, $string

);
$string = preg_replace(“/<!– ]*)?>–>/i”,

  • , $string);
    $string = preg_replace(“/<!–<\/li>–>/i”, “”, $string
  • );
    $string = preg_replace(“/<!–<img (?:[^>]+ )?src=\”?([^\"]*)\”?[^>]*>–>/i”, “”, $string
    ); $cp->set_data($string); //return value - string containing all the markup for the misspelled words. } // end spellCheck

    其中字典的查询,调用的是PHP自带的函数库:Pspell,这个最主要的单词检查的工作原来是库函数做的。。。。。我汗阿。。。。最难得部分解决了,其他就只是一些基本的逻辑操作了。

    接下去的任务,也就是把一个textarea中的内容读出来,过滤HTML,然后把每个单词到字典里查一下,字典中不包含的,就高亮显示出来,同时对鼠标右键添加事件,给出正确单词的Suggestion。主要是AJAX的调用,需要仔细看一下源代码。

    其中global $cp;是sourceforge上的一个AJAX的框架 CPAINT

    是不是很简单阿。。。。。。

    最后总结一下,呵呵,其实有时候觉得很玄的东西,要是有些提示,稍微动下脑子也能想出来。就想这个spell check本来没什么想法的,看了上面的那个函数,稍微想一下,还是能想出些门道的。

    P.S.

    顺便也给出其他两道题目的答案吧,只是我个人给出的解答,哈:

    2.单向链表的删除操作,已知head,p(指向被删除元素),要求复杂度为O(1)

    这个比较简单,很早以前就见过的题目,只要将p中的内容拷贝到p->next,然后再删除p就行了

    像这样:

    if(p->next != null)
    {
    Node* tmp = p->next;
    p->data = tmp->data;
    p->next = tmp->next;
    delete tmp;
    }
    else
    {
    ........
    }

    就行了,不过有个问题,就是当p->next == null 的时候,也就是p指向链表尾的时候会有问题,可能是出题人也没有考虑到吧。

    3.有100阶楼梯,一个人从底往上爬,每次爬1阶或2阶,请编个算法说明一共多少种走法?后面的问题更有一些深度:这个算法(他会给出一个正确的算法思路)有什么效率上的问题,如何解决;如果这个算法经常要被调用,如何设法使效率提高?

    这条题目我到是想了一会,什么递归的算法想了好久。。。。。但是貌似比较麻烦,后来在纸上随便画了一下,发现竟然能发现计算公式。。。。我这个数学白吃竟然能发现公式,呵呵,不简单啊。

    公式如下:

    Cn0+Cn-11+Cn-22+…..+Cn-ii n>=i

    呵呵,是不是很简单啊,接下去要做的就是编一个Cn-ii 的程序了,再来个循环。直接调用公式,应该没有比这个效率更高的算法了吧。。。。。。

    Google校园招聘的时间早就过了,暂时也没有机会参加他的招聘了。。。。不过YY下还是蛮好玩的,这些题目还是比较难的,如果是电话面试中问到这些题目,哪怕是再厉害的高手,要瞬间解决这些题目,难度还是非常大的。

    以后有机会去当次炮灰看看,哈。回来一定写面经。

    12 Jan 07 Annual Party,被拉去敲鼓。。。。。。

    今天下午Unit Manager跑过来很Happy的向我们详细讲解了一下Annual Party上一个敲鼓的节目。当时我就一种强烈的不祥的预感。。。。。果然,介绍完节目之后他来了一句,“我们组也要出人来表演,怎么样,张劲松。。。。。就你吧?”

    >_< !。。。。。。。

    #_@!。。。。。。。。。。。 

    -_- !!。。。。。。。。。。。

    我自然不能拒绝, 欺负新人阿……….没天理阿 。。。。。还不如让我上去说唱,,,,,

    然后收到封邮件,5 p.m.的时候到LongBar参加个Meeting。。。。。来到楼下,一会儿会议室里就坐满了来自各个部门的GGMM,当然MM少得可怜,质量还相当的#$#!**@………

    不过随着人潮的涌动,忽然我又一次感觉到不对劲,天,怎么会有这么多人要敲鼓,绝对超过20个,中间还有个外国人。。。。

    一个MPS的GG简单介绍了一下,然后发给每人一张纸。。。我又一次听到了让我崩溃的消息,由于只需要十几个人,先要来个海选。。。。。照着发下来的纸上的符号打拍子,节奏感强的人入选。。。。。

    当时那个汗阿。。。。。。他们以为是选超女阿。。。。还海选。。。。。FUCK。。。。

    不过貌似我没什么节奏感,考的很搓。。。。。考出的结果是待定。。。。

     

    但是其中一个评委是我同学。。。。艾。。。。。我不进也难啊。。。。。。。。。。。。

    1月31号要丢脸了。。。。。。听上一届的人说,上去表演的貌似还不能在下面和大家一起吃饭,SHIT,参加个Party为的是什么啊,不就是吃个Happy吗? 日阿。

     

    不过最后还得提一下的就是,MPS其中貌似有个MM还不错,YY下。。。。。。

    12 Jan 07 Firefox插件制作,简明教程

    昨天在晚上看见别人自己做的迅雷Firefox 2.0.0.1插件,便对Firefox的插件制作起了兴趣。去Mozilla Developer Center上面去学习了一下,发现Firefox插件的制作还真是非常的简单。

    主要参考了

    http://developer.mozilla.org/en/docs/Building_an_Extension

    http://roachfiend.com/archives/2004/12/08/how-to-create-firefox-extensions

    http://www.rietta.com/firefox/Tutorial/overview.html

    这三篇文章,挑文章中的一些精华的部分,做个简要的分析吧:

    预备知识

    1、Firefox 的界面引擎是非常出色的,可以用XML和Javascript来定义界面的布局、属性、动作等。界面的布局XML是Firefox自定义的格式,叫做XUL ,XUL提供对界面各种元素如:按钮、菜单、工具栏等的描述,并将各个界面元素的动作以事件的形式邦定到Javascript. 这一点和HTML十分类似。
    2、Firefox 的插件是一个有特定目录结构和文件的文件夹,打包成zip文件后,再重命名为 XXX.xpi,便成了一个插件。通常的目录文件结构如下:

    extension.xpi:       

    Table 1 

    3、Chrome URIs

    URI顾名思义了,是一个Uniform Resource Identifiers ,也就是一个资源的地址,是Firefox寻找插件资源位置的表示形式,通常你可以在XUL文件中看到很多这样的语句,如:

    chrome://sample/content/sample.xul

    你可以在Firefox的地址栏中输入:chrome://browser/content/browser.xul,你会看到一个空的Firefox的界面,还是满神奇的。

     

    正式开始:

    1、创建目录结构

    创建一个目录结构,如上面Table 1所示,并不需要创建所有的文件和文件夹,只要创建几个必须的就行了:

    e.g.  C:\extensions\myExtension\

         C:\extensions\myExtension\chrome\content

         C:\extensions\myExtension\install.rdf

         C:\extensions\myExtension\chrome.manifest

    上面的文件都是必须的

    2、创建并编辑install.rdf文件

    <?xml version=”1.0″?>
    <RDF xmlns=”http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:em=”http://www.mozilla.org/2004/em-rdf#”>
    <Description about=”urn:mozilla:install-manifest”>
    <em:id>sample@foo.net</em:id>
    <em:version>1.0</em:version>
    <em:type>2</em:type>
    <!– Target Application this extension can install into, with minimum and maximum supported versions. –>
    <em:targetApplication>
    <Description>
    <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
    <em:minVersion>1.5</em:minVersion>
    <em:maxVersion>2.0.0.*</em:maxVersion>
    </Description>
    </em:targetApplication>
    <!– Front End MetaData –>
    <em:name>Sample!</em:name>
    <em:description>A test extension</em:description>
    <em:creator>Your Name Here</em:creator>
    <em:homepageURL>http://www.foo.com/</em:homepageURL>
    </Description>
    </RDF>

    install.rdf文件是告诉Firefox要插件的信息的,其中包括了插件的id,版本,说明,适用Firefox版本等重要信息。

    3、创建并编辑XUL文件

    <?xml version=”1.0″?>
    <overlay id=”sample” xmlns=”http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul”>
    <statusbar id=”status-bar“>
    <statusbarpanel id=”my-panel” label=”Hello, World”/>
    </statusbar>
    </overlay>

    在chrome/content文件夹中创建一个文件,如sample.xul,并将上面的内容复制进去。

    其中overlay告诉Firefox这个插件是在原来的browser.xul上添加一些元素, 代表是在Firefox中的status-bar上面添加一些元素,其中的id是不能改变的,一个Firefox只能有一个status-bar,是吧。。。。

    3、创建并编辑chrome.manifest文件

    overlay chrome://browser/content/browser.xul chrome://sample/content/sample.xul
    content sample chrome/content/

    这manifest文件就和jar中的manifest文件的作用差不多,就是配置一些路径之类的。overlay告诉Firefox将sample.xul整合到browser.xul中。content告诉Firefox可以到 chrome/content/ 这个文件下找到插件的所有文件。这个路径是相对于chrome.manifest.而言的。当插件安装完成后,你也可以通过chrome://sample/content/XXX 来访问sample插件的一些资源。

    4、打包和安装

    完成上述所有的步骤之后,只要将所有的文件打包成一个zip文件。记住:进入插件所在的文件夹,如:C:\extensions\myExtension\,然后将这个文件夹下的内容全部打包,而不是将myExtension这个文件夹打包。否则,将会报“无法找到安装脚本 204”这个错误。打包完成之后,将文件后缀名修改一下: zip->xpi,就行了。

    然后打开Firefox,将这个XXX.xpi文件拖到Firefox中就可以了。

    心得:

    看完了这些教程之后,我也尝试着做了一个简单的插件。由于Firefox提出的XUL这个配置文件写界面的概念,插件的制作真的变得非常的简单。IE中的ActiveX控件和它比起来,就差远了。插件制作的主要工作,也变成了javascript脚本的编写。就和写网页差不多了,本来我还想自己做一个复杂点的插件,无奈javascript的水平实在是有限,所以就放弃了。

    由此,我也有了一些想法,既然Firefox可以用配置文件做界面,Java中也应该可以实现,而最最通用,最为人熟知的格式,莫过于HTML了。Google了一下,貌似还没有这方面的先例。呵呵,Java中做界面,可不是一般的麻烦 ,虽然有拖动的IDE,但要做出的复杂的界面还是非常的麻烦,HTML能够很简单的做出漂亮的界面。正好可以运用到这上面来。准备在接下去的日子里研究研究如何实现这个功能。