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…)
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…)
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.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...)
相信很多PHPer都会遇到这样的问题:在utf-8的页面下面,如果直接访问带有中文参数的地址如test.php?s=测试 这样的地址输出参数的值会乱码,在搜索引擎上查询了下相关资料,都只给出了一些解决方案,但是却没有人研究导致这个问题的原因,今天特写此文来深入这个问题产生的原因: (continue reading…)
similar_text() 函数计算两个字符串的匹配字符的数目,也可以计算两个字符串的相似度(以百分比计)。
similar_text ( string first, string second [, float percent])//比较相似度 存放于$percent
if($percent>90) {…} //相似度
/**
+----------------------------------------------------------
* 检查字符串是否是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);
}
MySQL 字符串截取函数:left(), right(), substring(), substring_index()。还有 mid(), substr()。其中,mid(), substr() 等价于 substring() 函数,substring() 的功能非常强大和灵活。 (continue reading…)
要使用 gzip 来压缩文件,在 shell 提示下键入以下命令:
gzip filename
|
文件即会被压缩,并被保存为 filename.gz。
要扩展压缩的文件,键入以下命令:
gunzip filename.gz
|
filename.gz 会被删除,而继之以 filename。
你可以使用 gzip 命令同时处理多个文件和目录,方法是将它们逐一列出,并用空格间隔:
gzip -r filename.gz file1 file2 file3 /usr/work/school
|
上面的命令把 file1、file2、 file3、以及 /usr/work/school 目录的内容(假设这个目录存在)压缩起来,然后放入 filename.gz 文件中。
注:使用gzip和gunzip时,会删除原有的文件。
[root@linux ~]# tar -zcvf /tmp/etc.tar.gz /etc <==打包后,以gzip压缩
[root@linux src]# tar -zxvf /tmp/etc.tar.gz
#mysqldump -u 用户名 -p 库名 | gzip > tm_050519.sql.gz
解压缩:gunzip filename.gz
#mysql -u 用户名 -p 库名< /home/beinan/linuxsir031130.sql (continue reading…)
====== Flexform ======
LLL:EXT:cms/locallang_ttc.xml:media.additionalOptions
array
1
array
LLL:EXT:cms/locallang_ttc.xml:media.params
select
LLL:EXT:cms/locallang_ttc.xml:media.params.autoPlay
autoPlay
LLL:EXT:cms/locallang_ttc.xml:media.params.loop
loop
select
LLL:EXT:cms/locallang_ttc.xml:media.params.on
1
LLL:EXT:cms/locallang_ttc.xml:media.params.off
0
input
16
array
LLL:EXT:cms/locallang_ttc.xml:media.params.customEntry
text
6
60
How to get:
$this->pi_initPIflexForm(); //Init FlexForm configuration for plugin
$this->lConf = array(); // Setup our storage array...
// Assign the flexform data to a local variable for easier access
$piFlexForm = $this->cObj->data ['pi_flexform'];
// Traverse the entire array based on the language...
// and assign each configuration option to $this->lConf array...
if (!empty($piFlexForm['data'])) {
foreach ($piFlexForm['data'] as $sheet => $data) {
if (!empty($data)) {
foreach ($data as $lang => $value) {
if (!empty($value)) {
foreach ($value as $key => $val) {
if ($key == 'multiOptions') {
foreach ($val['el'] as $mmKey => $mmVal) {
foreach ($mmVal as $mmListKey => $mmListVal) {
if ($mmListKey == 'container1') {
foreach ($mmListVal['el'] as $keyshow => $keyval) {
$this->container1[$keyshow][] = $keyval['vDEF'];
}
}
if ($mmListKey == 'container2') {
foreach ($mmListVal['el'] as $keyshow => $keyval) {
$this->container2[$keyshow][] = $keyval['vDEF'];
}
}
}
}
} else {
$this->lConf[$key] = $this->pi_getFFvalue($piFlexForm, $key, $sheet);
}
}
}
}
}
}
}