Comments (1)
/**
* 进制转换器
* BHD Converter
* @package library\logic
*/
class ConvertLogic
{
public static $dict = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
public static $patch = "0";
public static function set($dict, $patch){
self::$dict = $dict;
self::$patch = $patch;
}
public static function convert($str, $from, $to, $min_length = null)
{
if ($from !== 10) {
$fromBase = self::convertTo10($str, $from);
} else {
$fromBase = $str;
}
$toBase = self::convert10($fromBase, $to);
if (!is_null($min_length)) {
$strLength = strlen($toBase);
while ($strLength < $min_length) {
$toBase = self::$patch . $toBase;
$strLength++;
}
}
return $toBase;
}
private static function convert10($num, $to = 62)
{
$dict = self::$dict;
$ret = '';
do {
$ret = $dict[bcmod($num, $to)] . $ret;
$num = bcdiv($num, $to);
} while ($num > 0);
return $ret;
}
private static function convertTo10($num, $from = 62)
{
$num = strval($num);
$dict = self::$dict;
$len = strlen($num);
$dec = 0;
for ($i = 0; $i < $len; $i++) {
$pos = strpos($dict, $num[$i]);
$dec = bcadd(bcmul(bcpow($from, $len - $i - 1), $pos), $dec);
}
return $dec;
}
}https://github.com/AxiosCros/tpr-cms/blob/master/library/logic/ConvertLogic.php
$counts = RedisFacade::hmget('room_connection_set_count', $rooms);
return array_map('intval', array_combine($rooms, $counts));
desc select a.* from package a,(select max(id) m,user_id from package GROUP BY user_id,type) b where a.user_id=b.user_id and a.id=b.m ORDER BY a.id limit 100;
desc select a.* from (select *from package ORDER BY id desc) a where a.id> 0 GROUP BY user_id,type ORDER BY a.id limit 100;
$itemSubjects.="\t".$itemSubjects
PHPExcel_Calculation_Exception: Sheetname!B3 -> Formula Error: Unexpected , in /application/class/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell.php:291
我们输入命令:contrab -e
然后会打开一个编辑器,在其中输入下面这个命令:
0 5 * * * cd /home/lincheung; sh PP_insert_db.sh
from mingyun.github.io.
Related Issues (20)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mingyun.github.io.