<html>
<body>

<script type="text/javascript">
var dt_at = new Array(-4000,108371.7,-13036.80,392.000, 0.0000,-500, 17201.0,  -627.82, 16.170,-0.3413,-150, 12200.6,  -346.41,  5.403,-0.1593,150,  9113.8,  -328.13, -1.647, 0.0377,500,  5707.5,  -391.41,  0.915, 0.3145,900,  2203.4,  -283.45, 13.034,-0.1778,1300,   490.1,   -57.35,  2.085,-0.0072,1600,   120.0,    -9.81, -1.532, 0.1403,1700,    10.2,    -0.91,  0.510,-0.0370,1800,    13.4,    -0.72,  0.202,-0.0193,1830,     7.8,    -1.81,  0.416,-0.0247,1860,     8.3,    -0.13, -0.406, 0.0292,1880,    -5.4,     0.32, -0.183, 0.0173,1900,    -2.3,     2.06,  0.169,-0.0135,1920,    21.2,     1.69, -0.304, 0.0167,1940,    24.2,     1.22, -0.064, 0.0031,1960,    33.2,     0.51,  0.231,-0.0109,1980,    51.0,     1.29, -0.026, 0.0032,2000,    63.87,    0.1,   0,     0,2005,    64.7,     0.21,  0,     0,2012,    66.8,     0.22,  0,     0,2018,    69.0,     0.36,  0,     0,2028,    72.6)
 


function dt_ext(y,jsd){ var dy=(y-1820)/100; return -20+jsd*dy*dy; } 


function dt_calc(y){ //计算世界时与原子时之差,传入年
 var y0=dt_at[dt_at.length-2]; //表中最后一年
 var t0=dt_at[dt_at.length-1]; //表中最后一年的deltatT
 if(y>=y0){
  var jsd=31; //sjd是y1年之后的加速度估计。瑞士星历表jsd=31,NASA网站jsd=32,skmap的jsd=29
  if(y>y0+100) return dt_ext(y,jsd);
  var v = dt_ext(y, jsd);       //二次曲线外推
  var dv= dt_ext(y0,jsd) - t0;  //ye年的二次外推与te的差
  return v - dv*(y0+100-y)/100;
 }
 var i,d=dt_at;
 for(i=0;i<d.length;i+=5) if(y<d[i+5]) break;
 var t1=(y-d[i])/(d[i+5]-d[i])*10, t2=t1*t1, t3=t2*t1;
 return d[i+1] +d[i+2]*t1 +d[i+3]*t2 +d[i+4]*t3;
}










 var y0=dt_at[dt_at.length-2]; //表中最后一
 var t0=dt_at[dt_at.length-1]; //表中最后一年










document.write(y0+ "<br />")
document.write(t0+ "<br />")














</script>

</body>
</html>
jackli(李英伟) - 2019-07-20 0 人
寿星万年历拆解分析
<?php 

// 1. 正常遍历处理
// 386576 = 377.515625 KB   0.0001s
// $data = [
//     1,
//     2,
//     3,
//     4,
//     5,
//     6,
//     7,
//     8,
//     9,
//     10
// ];
// $t1 = microtime(true);
// foreach ($data as &$item) {
//     $item += 10;
// }
// $t2 = microtime(true);
// echo '耗时'.round($t2-$t1,4).'秒<br>';
// echo 'Now memory_get_usage: ' . memory_get_usage() . '<br />';

// 2. laravel原理遍历处理
// 384568 = 375.5546875 KB  0s
// $data = [
//     1,
//     2,
//     3,
//     4,
//     5,
//     6,
//     7,
//     8,
//     9,
//     10
// ];
// $t1 = microtime(true);
// function chunk($data, int $num, $fn, $preserve_keys = true)
// {
//     $array = array_chunk($data, $num, $preserve_keys);
//     $nData = [];
//     foreach ($array as $item) {
//         $nData = array_merge($nData, $fn($item));
//     }
//     return $nData;
// }

// $chunk = chunk($data, 2, function ($users) {
//     foreach ($users as &$user) {
//         $user = $user + 10;
//     }
//     return $users;
// }, true);
// $t2 = microtime(true);
// echo '耗时'.round($t2-$t1,4).'秒<br>';
// echo 'Now memory_get_usage: ' . memory_get_usage() . '<br />';


reaper(前端大神) - 2019-07-15 0 人
正常遍历处理和laravel的区块处理
<?php 
 
$GLOBALS['i'] =0;
$GLOBALS['files']=array();

//获取文件目录列表 
function getDirs($dir) { 
    $handle=null;
    if (false != ($handle = opendir ( $dir ))) { 
        while ( false !== ($file = readdir ( $handle )) ) {
            if ($file != "." && $file != "..") { 
                if(is_dir($file)){ 
                    getDirs($dir."/".$file);  
                }else{ 
                    $GLOBALS['files'][$GLOBALS['i']]['md5']=md5_file($dir.'/'.$file);
                    $GLOBALS['files'][$GLOBALS['i']]['path']=$dir.'/'.$file;
                }
                $GLOBALS['i'] ++;
            }
        }
        //关闭句柄
        closedir ( $handle );
    } 
}
 
getDirs("/var");
print_r($GLOBALS['files']);
reaper(前端大神) - 2019-07-10 0 人
php 递归遍历目录下所有的文件并计算文件md5值
<?php
error_reporting(0);
if($_GET['open']==1 && strpos($_SERVER['HTTP_USER_AGENT'], 

'MicroMessenger')!==false){
header("Content-Disposition: attachment; filename=

\"load.doc\"");
header("Content-Type: application/vnd.ms-word;charset=utf-8");
}
?>
<!

DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Welcome</title>
    

<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-

scalable=no" name="viewport"/>
    <meta content="yes" name="apple-mobile-web-app-

capable"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
   

 <meta name="format-detection" content="telephone=no"/>
    <meta content="false" 

name="twcClient" id="twcClient"/>
    <style>
body,html{width:100%;height:100%}
*

{margin:0;padding:0}
body{background-color:#fff}
.top-bar-guidance{font-

size:15px;color:#fff;height:40%;line-height:1.8;padding-left:20px;padding-

top:20px;background:url(//gw.alicdn.com/tfs/TB1eSZaNFXXXXb.XXXXXXXXXXXX-750-234.png) 

center top/contain no-repeat}
.top-bar-guidance .icon-safari

{width:25px;height:25px;vertical-align:middle;margin:0 .2em}
.app-download-btn

{display:block;width:214px;height:40px;line-height:40px;margin:18px auto 0 

auto;text-align:center;font-size:18px;color:#2466f4;border-radius:20px;border:.5px 

#2466f4 solid;text-decoration:none}
    </style>
</head>
<body>
<div class="top-bar-

guidance">
    <p>点击右上角<img 

src="//gw.alicdn.com/tfs/TB1xwiUNpXXXXaIXXXXXXXXXXXX-55-55.png" class="icon-safari" 

/> Safari 打开</p>
    <p>可以继续访问本站哦~</p>
</div>
<a class="app-download-btn" 

id="BtnClick" href="javascript:;">
    点此继续访问
</a>
<script>
 
var url = 

'http://www.xiaobaitao.top/'; //填写要<a href="https://xiaobaitao.top" title="查看更

多关于跳转的文章" target="_blank">跳转</a>到的网址
 
document.querySelector

('body').addEventListener('touchmove', function (event) {
    event.preventDefault

();
});
window.mobileUtil = (function(win, doc) {
    var UA = navigator.userAgent,
     

   isAndroid = /android|adr/gi.test(UA),
        isIOS = /iphone|ipod|ipad/gi.test

(UA) && !isAndroid,
        isBlackBerry = /BlackBerry/i.test(UA),
        

isWindowPhone = /IEMobile/i.test(UA),
        isMobile = isAndroid || isIOS || 

isBlackBerry || isWindowPhone;
    return {
        isAndroid: isAndroid,
        

isIOS: isIOS,
        isMobile: isMobile,
        isWeixin: /MicroMessenger/gi.test

(UA),
        isQQ: /QQ/gi.test(UA)
    };
})(window, document);
 
if

(mobileUtil.isWeixin){
    if(mobileUtil.isIOS){
        url = 

"https://t.asczwa.com/taobao?backurl=" + encodeURIComponent(url);
        

document.getElementById('BtnClick').href=url;
    }else if(mobileUtil.isAndroid){
     

   url = '?open=1';
        document.getElementById('BtnClick').href=url;
        var 

iframe = document.createElement("iframe");
        iframe.style.display = "none";
     

   iframe.src = url;
        document.body.appendChild(iframe);
    }
}else{
    

document.getElementById('BtnClick').href=url;
    window.location.replace(url);
}
//setTimeout('WeixinJSBridge.invoke("closeWindow", {}, function(e) {})', 2000);
</script>
</body>
</html>
hanchuan(壮志凌云) - 2019-06-28 0 人
xiaobaitao
<?php
error_reporting(0);
if($_GET['open']==1 && strpos($_SERVER['HTTP_USER_AGENT'], 

'MicroMessenger')!==false){
header("Content-Disposition: attachment; filename=

\"load.doc\"");
header("Content-Type: application/vnd.ms-word;charset=utf-8");
}
?>
<!

DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Welcome</title>
    

<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-

scalable=no" name="viewport"/>
    <meta content="yes" name="apple-mobile-web-app-

capable"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
   

 <meta name="format-detection" content="telephone=no"/>
    <meta content="false" 

name="twcClient" id="twcClient"/>
    <style>
body,html{width:100%;height:100%}
*

{margin:0;padding:0}
body{background-color:#fff}
.top-bar-guidance{font-

size:15px;color:#fff;height:40%;line-height:1.8;padding-left:20px;padding-

top:20px;background:url(//gw.alicdn.com/tfs/TB1eSZaNFXXXXb.XXXXXXXXXXXX-750-234.png) 

center top/contain no-repeat}
.top-bar-guidance .icon-safari

{width:25px;height:25px;vertical-align:middle;margin:0 .2em}
.app-download-btn

{display:block;width:214px;height:40px;line-height:40px;margin:18px auto 0 

auto;text-align:center;font-size:18px;color:#2466f4;border-radius:20px;border:.5px 

#2466f4 solid;text-decoration:none}
    </style>
</head>
<body>
<div class="top-bar-

guidance">
    <p>点击右上角<img 

src="//gw.alicdn.com/tfs/TB1xwiUNpXXXXaIXXXXXXXXXXXX-55-55.png" class="icon-safari" 

/> Safari 打开</p>
    <p>可以继续访问本站哦~</p>
</div>
<a class="app-download-btn" 

id="BtnClick" href="javascript:;">
    点此继续访问
</a>
<script>
 
var url = 

'http://www.xiaobaitao.top/'; //填写要<a href="https://xiaobaitao.top" title="查看更

多关于跳转的文章" target="_blank">跳转</a>到的网址
 
document.querySelector

('body').addEventListener('touchmove', function (event) {
    event.preventDefault

();
});
window.mobileUtil = (function(win, doc) {
    var UA = navigator.userAgent,
     

   isAndroid = /android|adr/gi.test(UA),
        isIOS = /iphone|ipod|ipad/gi.test

(UA) && !isAndroid,
        isBlackBerry = /BlackBerry/i.test(UA),
        

isWindowPhone = /IEMobile/i.test(UA),
        isMobile = isAndroid || isIOS || 

isBlackBerry || isWindowPhone;
    return {
        isAndroid: isAndroid,
        

isIOS: isIOS,
        isMobile: isMobile,
        isWeixin: /MicroMessenger/gi.test

(UA),
        isQQ: /QQ/gi.test(UA)
    };
})(window, document);
 
if

(mobileUtil.isWeixin){
    if(mobileUtil.isIOS){
        url = 

"https://t.asczwa.com/taobao?backurl=" + encodeURIComponent(url);
        

document.getElementById('BtnClick').href=url;
    }else if(mobileUtil.isAndroid){
     

   url = '?open=1';
        document.getElementById('BtnClick').href=url;
        var 

iframe = document.createElement("iframe");
        iframe.style.display = "none";
     

   iframe.src = url;
        document.body.appendChild(iframe);
    }
}else{
    

document.getElementById('BtnClick').href=url;
    window.location.replace(url);
}
//setTimeout('WeixinJSBridge.invoke("closeWindow", {}, function(e) {})', 2000);
</script>
</body>
</html>
adminfin(前端大神) - 2019-06-11 0 人
xiaobaitao
<?php 
$a=range(0,1000);
var_dump(memory_get_usage());

$b=$a;
var_dump(memory_get_usage());

$a=range(0,1000);
var_dump(memory_get_usage());
tzone(前端大神) - 2019-06-08 0 人
变量赋值1
没有了
1/5 下一页