May272019
May272019
Oct302018
php身份证号码效验
if (!function_exists('VerifyIdCardNo')) {
function VerifyIdCardNo($idCardNo)
{
$iW = array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
$szVerCode = "10X98765432";
$sum = 0;
for ($i = 0; $i < 17; $i++) {
$sum += $idCardNo[$i] * $iW[$i];
}
$iy = $sum % 1...阅读全文
Sep192018
excel支持正则表达式提取字符函数(支持RegExp捕获分组)
excel支持正则表达式提取字符函数(支持RegExp捕获分组)
一、要让excel脚本支持Microsoft VBScript Regular Expressions 5.5 ,按快捷键alt+F11,出现下图界面,操作如图示:
二.添加VBA代码:
代码添加完毕后,关闭该窗口。
Function regex(strInput As String, matchPattern As String, Optional ByVal outputPattern As...阅读全文
Jul132018
CentOS7使用firewalld打开关闭防火墙与端口
1、firewalld的基本使用
启动: systemctl start firewalld
关闭: systemctl stop firewalld
查看状态: systemctl status firewalld
开机禁用 : systemctl disable firewalld
开机启用 : systemctl enable firewalld
2.systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。
...阅读全文
Jul132018
Jul132018
centos7重启apache、nginx、mysql、php-fpm命令
apache
启动
systemctl start httpd
停止
systemctl stop httpd
重启
systemctl restart httpd
mysql
启动
systemctl start mysqld
停止
systemctl stop mysqld
重启
systemctl restart mysqld
php-fpm
启动
systemctl start php-fpm
停止
systemctl stop php-fpm
重启
systemctl restart php-fpm
nginx
启动
systemctl start nginx
停止
systemctl stop nginx
重启
systemctl res...阅读全文
Jul082018
linux Phantomjs Casperjs 安装
安装 必要的包
yum install gcc gcc-c++ make flex bison gperf ruby openssl-devel freetype-devel fontconfig-devel libicu-devel sqlite-devel libpng-devel libjpeg-devel bzip2
Phantomjs 安装
wget https://www.cxy163.net/soft/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar -jxvf phantomjs-2.1.1-linux-x86_64.tar.bz2 -C /usr/local/
mv /usr/local/phantomjs-2.1.1-linux-x...阅读全文
Jul082018
centos 升级 python3.6.0
python -V # 查看python 版本
cd /usr/local/ # 进入存放目录
wget wget https://www.cxy163.net/soft/Python-3.6.0.tar.xz # 获取新版的 python
tar xvf Python-3.6.0.tar.xz # 解压文件
cd ./Python-3.6.0 # 进入解压后的文件目录
mkdir /usr/local/python3 # 创建...阅读全文
Jul052018
Python正则表达式实例
Python正则表达式在使用中会经常应用到字符串替换的代码。有很多人都不知道如何解决这个问题,下面的代码就告诉你其实这个问题无比的简单,希望你有所收获。
1.替换所有匹配的子串用newstring替换subject中所有与正则表达式regex匹配的子串
result, number = re.subn(regex, newstring, subject)
2.替换所有匹配的子串(使 用正则表达式对象)
rereobj = re.compile(regex)
...阅读全文
