<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[ChasenWong的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/ChasenWong</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; ChasenWong]]></copyright><item><title><![CDATA[js压缩图片]]></title><link>https://blog.csdn.net/ChasenWong/article/details/104613419</link><guid>https://blog.csdn.net/ChasenWong/article/details/104613419</guid><author>ChasenWong</author><pubDate>Mon, 02 Mar 2020 16:09:43 +0800</pubDate><description><![CDATA[有两个需要注意的点：




var base64 = canvas.toDataURL('image/jpeg', quality);

1、其中在输出图片base64时，可选的格式除了jpeg外还有png，webp等，从图片质量的角度看推荐使用webp，但webp在没有img标签时不能直接通过浏览器打开。

2、通过canvas输出base64格式的图片不能直接通过表单上传到服务器，还需要...]]></description><category></category></item><item><title><![CDATA[正则表达式真的很6，可惜你不会写]]></title><link>https://blog.csdn.net/ChasenWong/article/details/83149878</link><guid>https://blog.csdn.net/ChasenWong/article/details/83149878</guid><author>ChasenWong</author><pubDate>Thu, 18 Oct 2018 17:19:50 +0800</pubDate><description><![CDATA[转载自：https://mp.weixin.qq.com/s/CBexZfG1DHYji_Pk6Zo38w

本文旨在用最通俗的语言讲述最枯燥的基本知识。


文章提纲：


	元字符
	
	
	重复限定符
	
	
	分组
	
	
	转义
	
	
	条件或
	
	
	区间
	
	
	零宽断言
	
	
	捕获和非捕获
	
	
	反向引用
	
	
	贪婪和非贪婪
	
	
	反义
	


正则表达式在几...]]></description><category></category></item><item><title><![CDATA[php下调用 Ffmpeg(待优化)]]></title><link>https://blog.csdn.net/ChasenWong/article/details/81316025</link><guid>https://blog.csdn.net/ChasenWong/article/details/81316025</guid><author>ChasenWong</author><pubDate>Tue, 31 Jul 2018 16:49:49 +0800</pubDate><description><![CDATA[背景是公司有一个业务需求是用到了科大讯飞的文字语音转换，需要对科大讯飞转换出来的语音文件做合成。

在linux下现有的音频合成软件用的最多的应该也就是ffmpeg了，所以选择了ffmpeg。

虽然在开发前就对ffmpeg的php拓展N年没更新有所了解，所以也没打算用，就想直接通过exec()执行shell调用就好了，可是开发完之后领导说这个函数他不安全，把exec(), system()都给禁...]]></description><category></category></item><item><title><![CDATA[自己重写了一下快速排序的算法]]></title><link>https://blog.csdn.net/ChasenWong/article/details/79048520</link><guid>https://blog.csdn.net/ChasenWong/article/details/79048520</guid><author>ChasenWong</author><pubDate>Fri, 12 Jan 2018 22:02:37 +0800</pubDate><description><![CDATA[今天上网看快速排序，发现这么一个经典的算法网上贴出的代码要不有BUG，要不就是运算的步骤还是冗余了，所以自己重新写了个，看了下结果应该是减少大部分不需要的步骤。
希望各位路过的道友帮忙验证下有没有BUG
先贴下运算结果：
//startK 开始键值    endK结束键值   DG：递归深度


函数代码：
 public function qsort(&$arr = array()]]></description><category></category></item><item><title><![CDATA[php curl post请求丢失'+'问题]]></title><link>https://blog.csdn.net/ChasenWong/article/details/73938151</link><guid>https://blog.csdn.net/ChasenWong/article/details/73938151</guid><author>ChasenWong</author><pubDate>Fri, 30 Jun 2017 10:37:32 +0800</pubDate><description><![CDATA[背景: 使用与友商做免登录授权的跳转，发现授权偶尔失败，经过日志查看，加密码中带'+'字符的会授权失败。
通过抓包发现是php 使用curl发送请求时 '+'会被转成空格（原因不明……怀疑是curl默认做了urldecode处理）
解决方法是先给加密字串做urlencode处理再做发送。


P.S. 另外https的请求在linux上面抓包解码似乎不太好处理，后面改在windows上用]]></description><category></category></item><item><title><![CDATA[PHP GD库添加freetype拓展]]></title><link>https://blog.csdn.net/ChasenWong/article/details/73773883</link><guid>https://blog.csdn.net/ChasenWong/article/details/73773883</guid><author>ChasenWong</author><pubDate>Tue, 27 Jun 2017 11:31:47 +0800</pubDate><description><![CDATA[背景：业务需求要用到 imagefttext 函数，发现GD库一开始安装时没有添加 
FreeType
linux版本 centos 6.6

安装流程（由于服务器为分布式内网服务器，无法使用yum安装，以下均为下载资源包后的编译安装）：


安装freetype

解压freetype-2.3.9.tar.gz

编译安装
./configure --enable-sta]]></description><category></category></item><item><title><![CDATA[关于phpredis拓展hScan的一点小坑]]></title><link>https://blog.csdn.net/ChasenWong/article/details/72633330</link><guid>https://blog.csdn.net/ChasenWong/article/details/72633330</guid><author>ChasenWong</author><pubDate>Tue, 23 May 2017 00:39:58 +0800</pubDate><description><![CDATA[先交代一下踩坑的背景主要是用到了redis的哈希结构来存储目标用户。
这一次的目标库用户数去到了50W，redis提供的获取hash数据主要是用到了hget,hgetall，以及hscan。
业务需求导致需要获取全量的目标库数据，由于数据量比较大，之前使用的hgetall会导致进程卡死，决定优化进程，改用hscan方法，以此为背景有了这篇日记。
redis的文档给出的scan返回结构如下：]]></description><category></category></item><item><title><![CDATA[测试服处理日记]]></title><link>https://blog.csdn.net/ChasenWong/article/details/56014443</link><guid>https://blog.csdn.net/ChasenWong/article/details/56014443</guid><author>ChasenWong</author><pubDate>Mon, 20 Feb 2017 15:40:15 +0800</pubDate><description><![CDATA[事情的起因是年前放了一个用户同步的脚本在服务器上面验证稳定性，全部用户跑完之后数据库里面多了300多万条数据。
年后回来发现微信上面的测试号基本所有请求的超时了，当时想法是先去看mysql的日志，然而mysql并没有开启slowlog。
后来该去查看php-fpm的slowlog，悲剧的是php也没开。
打开php-fpm的慢日志之后，观察发现是由于用户表没有索引造成的（测试服务器上面的数据]]></description><category></category></item><item><title><![CDATA[MySQL管理之道——学习笔记]]></title><link>https://blog.csdn.net/ChasenWong/article/details/54024207</link><guid>https://blog.csdn.net/ChasenWong/article/details/54024207</guid><author>ChasenWong</author><pubDate>Wed, 04 Jan 2017 20:52:45 +0800</pubDate><description><![CDATA[01.04.2017

关于 WHERE IN()的子查询 (p85-86)

MySQL5.6之前都没有做过很好的优化，因此在执行查询语句的时候，MySQL会先为内层查询语句建立一个临时表，然后在完成查询后撤销这个临时表。
优化放向：改用表链接来代替子查询
例:
原子查询SQL语句:  SELECT * FROM table_a WHERE field_a IN ( SELECT ]]></description><category></category></item><item><title><![CDATA[mysqldump 数据自动备份的使用]]></title><link>https://blog.csdn.net/ChasenWong/article/details/53997761</link><guid>https://blog.csdn.net/ChasenWong/article/details/53997761</guid><author>ChasenWong</author><pubDate>Tue, 03 Jan 2017 20:41:25 +0800</pubDate><description><![CDATA[mysqldump常用于MySQL数据库逻辑备份。
 
1、各种用法说明
     A. 最简单的用法：

mysqldump -uroot -pPassword [database name] 
> [dump file]

     上述命令将指定数据库备份到某dump文件（转储文件）中，比如：

mysqldump -uroot -p123 test > test.dump]]></description><category></category></item><item><title><![CDATA[Linux下PHP安装oci8扩展]]></title><link>https://blog.csdn.net/ChasenWong/article/details/53897978</link><guid>https://blog.csdn.net/ChasenWong/article/details/53897978</guid><author>ChasenWong</author><pubDate>Tue, 27 Dec 2016 18:39:15 +0800</pubDate><description><![CDATA[PHP通常搭配Mysql使用，但有时候也会连接到Oracle数据库。
安装PHP的oci8扩张之前，需要先安装Oracle Instant Client（ basic 或 basic lite 版就行了）。因为我们是从源码安装PHP扩展，所以还需要下载 Instant Client SDK。Oracle Instant Client相关软件包的下载请进入以下链接：http://www.oracl]]></description><category></category></item><item><title><![CDATA[PHP7 接入微信支付中的坑]]></title><link>https://blog.csdn.net/ChasenWong/article/details/51881201</link><guid>https://blog.csdn.net/ChasenWong/article/details/51881201</guid><author>ChasenWong</author><pubDate>Mon, 11 Jul 2016 15:32:27 +0800</pubDate><description><![CDATA[先占个座，一会回来写
$postStr = file_get_contents("php://input");
$GLOBALS["HTTP_RAW_POST_DATA"]
register_globals]]></description><category></category></item><item><title><![CDATA[支付宝接入中踩了个小坑]]></title><link>https://blog.csdn.net/ChasenWong/article/details/51866072</link><guid>https://blog.csdn.net/ChasenWong/article/details/51866072</guid><author>ChasenWong</author><pubDate>Sat, 09 Jul 2016 18:07:04 +0800</pubDate><description><![CDATA[昨天新的应用接入支付宝的支付
然后按照正常的流程走，生成rsa秘钥，上传，回调
到回调这里都是很顺利，然后被卡在验证签名这块了
上网找了各种的资料，基本就是把支付宝的公钥拿下来，空格替换成换行然后作为代码中的公钥
然而让人很纠结的是支付宝上面有三个秘钥，分别是合作伙伴支付宝公钥，无线产品支付宝公钥，开放平台支付宝公钥，而且只有无线产品支付宝公钥是有空格
所以一开始我就很自然以为是用无线产]]></description><category></category></item><item><title><![CDATA[YII1.1升级到2.0笔记]]></title><link>https://blog.csdn.net/ChasenWong/article/details/51578679</link><guid>https://blog.csdn.net/ChasenWong/article/details/51578679</guid><author>ChasenWong</author><pubDate>Fri, 03 Jun 2016 14:32:48 +0800</pubDate><description><![CDATA[公司项目迁移
环境改变
php 由5.4改到了7.0.7
框架由yii1.1要升级到2.0
nginx 由1.6.0 升到了 1.10.0


记录一下中间的坑


把原来封装的curl类拿过来用的时候遇到个报错

curl_setopt(): CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value 2 wil]]></description><category></category></item><item><title><![CDATA[服务器LNMP环境搭建20160530]]></title><link>https://blog.csdn.net/ChasenWong/article/details/51538600</link><guid>https://blog.csdn.net/ChasenWong/article/details/51538600</guid><author>ChasenWong</author><pubDate>Mon, 30 May 2016 15:51:55 +0800</pubDate><description><![CDATA[挂在外置硬盘 （参考链接:https://help.aliyun.com/knowledge_detail/6554784.html）

fdisk -l
mkfs.ext3 /dev/vdb

mkdir /data
 mount /dev/vdb /data
ls -l /data

df -h
 echo "/dev/vdb /data ext3 defaults 1 2]]></description><category></category></item><item><title><![CDATA[阿里云缓存服务器里面的一个坑]]></title><link>https://blog.csdn.net/ChasenWong/article/details/51462934</link><guid>https://blog.csdn.net/ChasenWong/article/details/51462934</guid><author>ChasenWong</author><pubDate>Fri, 20 May 2016 16:52:57 +0800</pubDate><description><![CDATA[今天在做视频同步的时候无意中发现的一个坑
公司的服务器是放在了阿里云上面的，阿里云有个十分给力的路由缓存功能，就是通过各种cache头去访问服务器的时候，阿里云会把这个结果保存到缓存服务器中，后面再次访问就不会经过我们自己的服务器，直接走缓存
然而我在做视频同步的时候直接也用了缓存的路由，导致对方在读取这个视频的时候直接触发了阿里云的缓存同步机制，头几次都不可能读得到数据，访问超时直接导致了同]]></description><category></category></item><item><title><![CDATA[centos6 安装 ffmpeg笔记]]></title><link>https://blog.csdn.net/ChasenWong/article/details/51451554</link><guid>https://blog.csdn.net/ChasenWong/article/details/51451554</guid><author>ChasenWong</author><pubDate>Thu, 19 May 2016 10:11:46 +0800</pubDate><description><![CDATA[下载地址
http://ffmpeg.org/releases/ffmpeg-3.0.2.tar.bz2

官网上面找不到release列表，只能右键复制链接……


wget  http://ffmpeg.org/releases/ffmpeg-3.0.2.tar.bz2


tar -jxvf ffmpeg-3.0.2.tar.bz2
cd 进去

./configur]]></description><category></category></item><item><title><![CDATA[小轩在Linux中趟过的坑]]></title><link>https://blog.csdn.net/ChasenWong/article/details/51451466</link><guid>https://blog.csdn.net/ChasenWong/article/details/51451466</guid><author>ChasenWong</author><pubDate>Thu, 19 May 2016 10:02:12 +0800</pubDate><description><![CDATA[关于压缩文件 

.gz 跟 .bz2后缀
在执行tar 命令的时候
tar -z 运用的是 gzip 解压
tar -j 运用的是bzip2 解压
完整命令
tar -zxvf demo.tar.gz
tar -jxvf demo.tar.bz2


附带其他属性详解传送门 http://www.cnblogs.com/li-hao/archive/2011/10/03/2]]></description><category></category></item><item><title><![CDATA[54点提高PHP编程效率 引入缓存机制提升性能]]></title><link>https://blog.csdn.net/ChasenWong/article/details/50999243</link><guid>https://blog.csdn.net/ChasenWong/article/details/50999243</guid><author>ChasenWong</author><pubDate>Mon, 28 Mar 2016 16:52:53 +0800</pubDate><description><![CDATA[0、用单引号代替双引号来包含字符串，这样做会更快一些。因为PHP会在双引号包围的字符串中搜寻变量，单引号则不会，注意：只有echo能这么做，它是一种可以把多个字符串当作参数的“函数”（译注：PHP手册中说echo是语言结构，不是真正的函数，故把函数加上了双引号）。

1、如果能将类的方法定义成static，就尽量定义成static，它的速度会提升将近4倍。



2、$row[’id’]]></description><category></category></item></channel></rss>