This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Javascript 冒泡排序,我把1000个随机数进行无序写入数组后,进行冒泡排序,观察浏览器运算使用时间 | |
//if your browser support Date.now(), You can use Date.now() to get the current time | |
SortHelper = { | |
BubbleSort: function(array,time1) { | |
length = array.length; | |
for(i=0; i<=length-2; i++) { | |
for(j=length-1; j>=1; j--) { | |
if(array[j] < array[j-1]) { | |
temp = array[j]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 检查数据库时间离现在多久远了 | |
* 加载该js文件 | |
* 传入参数 dbtime | |
* example : var dbtime = '2012-04-08 15:57:07'; | |
* 运行函数 getTimeCheck(dbtime) | |
* 最后输出变量getTimeCheck | |
* 20120916更新-使用继承的方式来输出结果值(尾部是demo,自行去掉demo使用) | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = "http://api.hudong.com/dict.do?title=5%E6%9C%882%E6%97%A5&from=perhaps&type=63&appkey=asdfasf341"; | |
$xml = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"yahooWeather":[{"condition":"tornado","zh":"龙卷风"},{"condition":"tropical storm","zh":"热带气旋"},{"condition":"hurricane","zh":"台风/飓风"},{"condition":"severe thunderstorms","zh":"强雷暴"},{"condition":"thunderstorms","zh":"雷暴"},{"condition":" mixed rain and snow","zh":"雨夹雪"},{"condition":"mixed rain and sleet","zh":"冻雨"},{"condition":"mixed snow and sleet","zh":"冻雨夹雪"},{"condition":"freezing drizzle","zh":"冻毛毛雨"},{"condition":"drizzle","zh":"毛毛雨"},{"condition":"freezing rain","zh":"冻雨"},{"condition":"showers","zh":"阵雨"},{"condition":"showers","zh":"阵雨"},{"condition":"snow flurries","zh":"飘雪"},{"condition":"light snow showers","zh":"短暂小雪"},{"condition":"blowing snow","zh":"风雪"},{"condition":"snow","zh":"有雪"},{"condition":"hail","zh":"冰雹"},{"condition":"sleet","zh":"冻雨"},{"condition":" dust","zh":"灰尘"},{"condition":"foggy","zh":"有雾"},{"condition":"haze","zh":"阴霾"},{"condition":"smoky","zh":"有烟雾"},{"condition":"blustery","zh":"大风"},{"condition":" windy","zh":"有风"},{"condition":"cold","zh":"寒冷"},{"condition":"cloudy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//print_r(time()); | |
function make_array(){ | |
$one_array = array(); | |
for( $i = 1 ; $i < 5000 ; $i++){ | |
$rand_num = rand(0, 5000); | |
$one_array[$i] = $rand_num; | |
if ( $i == 1 ){ | |
$time1 = time(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python bubble test | |
def make_array(): | |
define_array = [ i for i in range(0, 5000) ] | |
for x in range(0, 5000): | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//腾讯微博,分享微博加图片 | |
if($url){ | |
//$ext=substr($url, -3,3); | |
$ext=strrchr($url,"."); | |
//查找'.'字符串出现的位置 | |
$filename=date("YMDHis").$ext; | |
//定义文件名字为日期+网址 | |
$exName = strtolower(substr($filename,(strrpos($filename,'.')+1))); | |
//文件名字,去掉文件格式 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined | |
* in FIPS PUB 180-1 | |
* Version 2.1-BETA Copyright Paul Johnston 2000 - 2002. | |
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet | |
* Distributed under the BSD License | |
* See http://pajhome.org.uk/crypt/md5 for details. | |
*/ | |
/* | |
* Configurable variables. You may need to tweak these to be compatible with |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> | |
<meta name='description' content='Touch Flash Point' > | |
<meta name='author' content='CashLee' > | |
<title>hello world</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Licensed to the Apache Software Foundation (ASF) under one | |
or more contributor license agreements. See the NOTICE file | |
distributed with this work for additional information | |
regarding copyright ownership. The ASF licenses this file | |
to you under the Apache License, Version 2.0 (the | |
"License"); you may not use this file except in compliance | |
with the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |