2015年8月16日日曜日

ランダム文字列

ランダム文字列


結果
18439|kC-EU6_n_Ki||admin|admin_password||1|0
18440|34L95b28gAj||admin|admin_password||1|0
18441|i1U9_95_O2_||admin|admin_password||1|0
18442|NvNl-WklsLm||admin|admin_password||1|0
18443|NwG1_F1-H7n||admin|admin_password||1|0
18444|S--7z5-m7_-||admin|admin_password||1|0
18445|re02t7Z-yXq||admin|admin_password||1|0
18446|sN487lP8_-5||admin|admin_password||1|0
18447|GJo9l_4MN-M||admin|admin_password||1|0
18448|nav-HcE9M3H||admin|admin_password||1|0
18449|w--bl6n1Lh_||admin|admin_password||1|0
18450|-5269e50Hb2||admin|admin_password||1|0
18451|l-71gTkJeSh||admin|admin_password||1|0
18452|G38Pz0Nn21M||admin|admin_password||1|0
18453|-A-A67Hnq1W||admin|admin_password||1|0
18454|1pw890B6X_3||admin|admin_password||1|0
18455|t_Qxo_59nj-||admin|admin_password||1|0
18456|97u7_7B5_qg||admin|admin_password||1|0


Github
https://raw.githubusercontent.com/kankanla/Function/master/rand_uniqid.php



<?php
set_time_limit(0);

$db = new sqlite3('xtext.db');
$db->busyTimeout(10000);

for ($i=0; $i<1000; $i++){
do{
//$temp_id = uniqid(mf_rand());
$temp_id = mf_rand();
//$temp_id = uniqid();
$id_check = $db->querySingle(sprintf("select url_id from title where url_id='%s'",$temp_id));
if($id_check){
echo $id_check;
echo '<br>';
}
}while($id_check);
$insert = sprintf("insert into title(url_id)VALUES('%s')",$temp_id);
$db->exec($insert);
}
$db->close();




function mf_rand(){
$str = array(range('z','a'),range('Z','A'),range('9','0'),range('a','z'),range('A','Z'),range('1','9'),array('_','-'));
$length = 11;
$str_r ='';
for ($i=0; $i<$length ;$i++){
$temp = $str[array_rand($str)];
$str_r = $str_r.$temp[array_rand($temp)];
}
return($str_r);
}

?>



その2

<?php
set_time_limit(0);

$db = new sqlite3('xtext.db');
$db->busyTimeout(10000);

for ($i=0; $i<3000; $i++){
//$temp_id = uniqid(mf_rand());
//$temp_id = uniqid();
$temp_id = mf_rand();
do{
shuffle($temp_id);
$temp_id_str = implode($temp_id);
$id_check = $db->querySingle(sprintf("select * from title where url_id='%s'",$temp_id_str),true);
if($id_check){
//print_r ( $id_check);
}
}while($id_check);
$insert = sprintf("insert into title(url_id)VALUES('%s')",$temp_id_str);
$db->exec($insert);
}
$db->close();

function mf_rand(){
$str = array(range('z','a'),range('Z','A'),range('9','0'));
$length = 11;
$str_r =array();
for ($i=0; $i<$length ;$i++){
$temp = $str[array_rand($str)];
$str_r[count($str_r)] = $temp[array_rand($temp)];
}
return($str_r);
}
?>



2015年8月6日木曜日

Google にアプリケーションIDの取得サイト

Google にアプリケーションIDの取得サイト

https://appengine.google.com/
https://console.developers.google.com/project




2015年6月16日火曜日

javascript 無限ループする方法

javascript 無限ループする方法


その1
var j = 0;
for(;;){
  console.log(j++);
}


その2
var j = 0;
do{
  console.log(j++);
}while(true);




2015年6月10日水曜日

Chrome 開いているタブを選択する方法

Chrome 開いているタブを選択する方法
chrome.tabs.getAllInWindow()


chrome.tabs.getAllInWindow(function(e){
     console.log(e);
});






2015年6月1日月曜日

XMLHttpRequests のLogが表示するための設定

Chrome デフォルトの設定が変わったと思いますが、設定を変更しないと
XMLHttpRequests のLogが表示されない。



2015年5月28日木曜日

Javascript ページの繰り返しOpen.

Javascript ページの繰り返しOpen.


var x = {};
setInterval("opp()",50000);

function opp(){
 x = open('http://yahoo.co.jp')
 console.log('open');
 setTimeout("cl()",5000);
}

function cl(){
x.close();
console.log('close');
}




2015年5月26日火曜日

chrome 拡張機能 CPU情報

chrome 拡張機能 CPU情報


chrome.system.cpu.getInfo(function(e){
console.log(e);
})






chrome.runtime.getManifest()
chrome.runtime.getPlatformInfo(function(e){console.log(e)})
chrome.system.cpu.getInfo(function(e){console.log(e);})
chrome.system.storage.getInfo(function(e){console.log(e);})