通过给出的地点或者坐标信息,查询周边区域的地理信息。
-
地理信息搜索,通过给定的关键字给出地理的标准名字和坐标。还提供给予坐标信息返回附近的地点等等。
-
未来可能加入更多功能
<?php | |
/* from unix timestamp to date */ | |
$time = time(); | |
echo date("Y-m-d H:i:s", $time),"\n"; | |
/* from date string to timestamp */ | |
$date = '2011-01-01 00:00:00'; | |
echo strtotime($date),"\n"; |
<?php | |
/* input the year and week you want, then get the date! */ | |
function getFirstDayOfWeek($year, $weeknr, $date_format="Y-m-d"){ | |
$offset = date('w', mktime(0,0,0,1,1,$year)); | |
$offset = ($offset < 5) ? 1-$offset : 8-$offset; | |
$monday = mktime(0,0,0,1,1+$offset,$year); | |
$date = strtotime('+' . ($weeknr - 1) . ' weeks', $monday); | |
return date($date_format,$date); | |
} |
function activatePlaceholders() { | |
var detect = navigator.userAgent.toLowerCase(); | |
if (detect.indexOf('safari') > 0) { | |
return false; | |
} | |
var inputs = document.getElementsByTagName('input'); | |
for (var i=0;i<inputs.length;i++) { | |
if (inputs[i].getAttribute('type') == 'text') { | |
if (inputs[i].getAttribute('placeholder') && inputs[i].getAttribute('placeholder').length > 0) { | |
var className = inputs[i].getAttribute('class'); |
function getFirstDayOfWeek(date) { | |
if (!date) { | |
date = new Date(); | |
} | |
var firstDay = new Date(date - (date.getDay() - 1) * 86400000); | |
return firstDay; | |
} | |
function getLastDayOfWeek(date) { | |
if (!date) { | |
date = new Date(); |
<?php | |
function recur_mkdir($path, $seperator = "/"){ | |
if($path){ | |
$folders = explode($seperator, $path); | |
if($folders){ | |
$current_path = ''; | |
foreach($folders as $folder){ | |
$current_path .= $folder.$seperator; | |
if(!file_exists($current_path) && $current_path){ |
<? | |
$expire=180; | |
$showname = "testfile.tgz"; | |
$file = '/var/www/snippet/index.html'; | |
$length = filesize($file); | |
/* the file type is accroding to the mime type, not concern on file name */ | |
header('Content-Description: File Transfer'); | |
header('Content-Type: text/html'); |
<html> | |
<head> | |
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script> | |
<script type="text/javascript" src="js/jquery.validate.js"></script> | |
<script type="text/javascript" src="js/jquery-ui-1.8.7.custom.min.js"></script> | |
<script type="text/javascript" src="js/jquery.dataTables.min.js"></script> | |
<script type="text/javascript" src="js/date.format.js"></script> | |
<script type="text/javascript" src="js/browser.detection.js"></script> | |
<link type="text/css" href="css/custom-theme/jquery-ui-1.8.7.custom.css" rel="stylesheet" /> | |
<link type="text/css" href="css/demo_page.css" rel="stylesheet" /> |
<?php | |
$str = "/parent/:dbname/:collname/:id"; | |
function uri2regex ($str, &$params_keys) { | |
$word = "([0-9a-zA-Z_-]+)"; | |
$flag = preg_match_all("/:\w+/",$str, $matches); | |
$params = $matches[0]; | |
array_walk($params, 'uriNormalize'); | |
$ret = preg_replace("/:\w+/", $word, $str); |
#!/sbin/runscript | |
# Copyright 1999-2011 Gentoo Technologies, Inc. | |
# Distributed under the terms of the GNU General Public License v2 | |
# $Header: /var/cvsroot/gentoo-x86/net-proxy/polipo/files/polipo.initd,v 1.6 2011/12/31 21:11:37 idl0r Exp $ | |
POLIPO=${SVCNAME#*.} | |
POLIPOCONF="/etc/polipo/${POLIPO}.conf" | |
if [ -n "$POLIPO" ] && [ $SVCNAME != "polipo" ]; then | |
PIDFILE="/var/run/polipo.${POLIPO}.pid" | |
else |