手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表2009年09月28日的文章

JS找出一串字符中出现最多的字符

本文来自博客园,有点意思。。。
原文地址:http://www.cnblogs.com/kenandalda/archive/2009/09/20/1570617.html

作者认为:

XML/HTML代码
  1. 用数组的sort方法对字符串进行排序,让相同字母都到一起去  
  2. 用正则表达式来匹配两个相邻的不同字符,中间加上逗号  
  3. 以逗号为界把第二步得到的字符串打散成数组  
  4. 按字符串长度排序该数组,得到的第一个元素就是要的答案  

于是写了以下代码:

JavaScript代码
  1. String.Count=function(str){  
  2.     var ret=str.split("")  
  3.                 .sort()  
  4.                 .join("")  
  5.                 .replace(/((.)\2*)/g,"$1,")  
  6.                 .split(",")  
  7.                 .sort(function(a,b){return b.length-a.length});  
  8.     return [ret[0][0],ret[0].length];  
  9. }  
  10.   
  11. var s="&(&$#(JFLSDJFOIWEfdjsklfewosd2378907345asdsdwsdqs";  
  12. alert(String.Count(s));  

作者是谁?他是:Kenneth Chen,据称代码已经修改过了。。

Mediaplay for Firefox

以前是不可想像 的事,现在也终于可以实现了。

Installation Instructions

  1. Installation of the Windows Media Player Firefox Plugin may require administrative access to your PC. It is recommended that you close all other open browser windows before continuing with the installation.
  2. Click the Install button to automatically download and install the Windows Media Player Firefox Plugin.
  3. Depending on your security settings, you may see a Security Warning dialog box. Click Install to install the plugin.

Get answers about Windows Media, Media Player 11 and Windows Vista at Microsoft.com.

支持的平台也不少,当然,only for Windows。。。只是不支持SERVER版的系统,郁闷啊。。

File size: 302K
Platforms:

  • Windows XP SP2 (x86)
  • Windows XP SP2 (x64)
  • Windows Vista (x86)
  • Windows Vista (x64)

远程下载:Download Now

本地下载:wmpfirefoxplugin.rar

Tags: mediaplay, firefox