Archive for 七月, 2010

如何隐藏WordPress的版本号

为了方便追踪, WordPress底部默认保留了版本号。我们也是根据这些追踪信息才得以知道WordPress是世界最大的博客平台。但是如果你使用的不是最新的WordPress版本,保留这些踪迹在你的站点上有时却有可能给你的网站带来安全漏洞。这些信息对黑客是非常有用的,你告诉了他们你目前正在使用的版本号。 (continue reading…)


WordPress博客提速十一招

1. WordPress缓存


使用WordPress对象缓存 (continue reading…)


wordpress模板制作

WordPress基本模板文件 (continue reading…)


MySQL字符串中的大小写转换详解

MySQL字符串大小写转换

deMySQL 字符串大小写转化函数有两对: lower(), uppper() 和 lcase(), ucase() (continue reading…)


TYPO3 Backend Via SSL Proxy

TYPO3 Backend Via SSL Proxy

Breaking news: TYPO3 4.2 has reverse proxy support

If you use TYPO3 version 4.2.x, you don’t need the patch below any more. Masi has added some code to the core to get it work. New options are available in the install tool: (continue reading…)

1 Comment more...

RTE自定义Character ,Paragraph,Table

RTE中往往用到自定义样式。解决方法如下。 (continue reading…)


Google Map – Travel Modes

Using Waypoints in Routes

As noted within the DirectionsRequest, you may also specify waypoints (of type DirectionsWaypoint) when calculating routes using the Directions service. Waypoints allow you to calculate routes through additional locations, in which case the returned route passes through the given waypoints. A waypoint consists of the following fields:
  • location (required) specifies the address of the waypoint.
  • stopover (optional) indicates whether this waypoint is a actual stop on the route (true) or instead only a preference to route through the indicated location (false). Stopovers are true by default.
By default, the Directions service calculates a route through the provided waypoints in their given order. Optionally, you may pass optimizeWaypoints: true within the DirectionsRequest to allow the Directions service to optimize the provided route by rearranging the waypoints in a more efficient order. (This optimization is an application of the Travelling Salesman Problem.) All waypoints must be stopovers for the Directions service to optimize their route. If you instruct the Directions service to optimize the order of its waypoints, their order will be returned in the optimized_waypoints_order field within the DirectionsResult object. The following example calculates cross-country routes across the United States using a variety of start points, end points, and waypoints. (To select multiple waypoints, press Ctrl-Click when selecting items within the list.) Note that we inspect the routes.start_geocode.formatted_address and routes.end_geocode.formatted_address to provide us with the text for each route's start and end point. (continue reading...)
1 Comment more...

PHP接收GET中文参数乱码深入研究

相信很多PHPer都会遇到这样的问题:在utf-8的页面下面,如果直接访问带有中文参数的地址如test.php?s=测试 这样的地址输出参数的值会乱码,在搜索引擎上查询了下相关资料,都只给出了一些解决方案,但是却没有人研究导致这个问题的原因,今天特写此文来深入这个问题产生的原因: (continue reading…)


PHP字符串相似度

similar_text() 函数计算两个字符串的匹配字符的数目,也可以计算两个字符串的相似度(以百分比计)。

similar_text ( string first, string second [, float percent])//比较相似度 存放于$percent
if($percent>90) {…} //相似度


检查字符串是否是UTF8编码

/**
 +----------------------------------------------------------
 * 检查字符串是否是UTF8编码
 +----------------------------------------------------------
 * @param string $string 字符串
 +----------------------------------------------------------
 * @return Boolean 
 +----------------------------------------------------------
 */
function is_utf8($string)
{
    return preg_match('%^(?:
         [\x09\x0A\x0D\x20-\x7E]            # ASCII
       | [\xC2-\xDF][\x80-\xBF]             # non-overlong 2-byte
       |  \xE0[\xA0-\xBF][\x80-\xBF]        # excluding overlongs
       | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}  # straight 3-byte
       |  \xED[\x80-\x9F][\x80-\xBF]        # excluding surrogates
       |  \xF0[\x90-\xBF][\x80-\xBF]{2}     # planes 1-3
       | [\xF1-\xF3][\x80-\xBF]{3}          # planes 4-15
       |  \xF4[\x80-\x8F][\x80-\xBF]{2}     # plane 16
   )*$%xs', $string);
}


Copyright © 1996-2010 Add Lives. All rights reserved.
iDream theme by Templates Next | Powered by WordPress