- 博客(15)
- 收藏
- 关注

原创 关于phpMailer乱码问题
最近在利用phpmailer这个很火的第三方函数包开发php邮件发送功能时候,遇到一个很蹊跷的乱码问题,即发出去的邮件有时候邮件标题会变成一堆很特别的乱码,乱码的具体内容根据邮件标题是会发生变化的,不过共同的特点是都是有=?utf-8?B?这样的格式,在网上查阅了很多资料,包括stackoverflow,有不少人也都遇到过这个问题,但是回答的都比较模糊,初步的结论是邮件标题在进行base64编码时
2016-10-26 17:20:23
701
原创 一个关于php将资源提供进行下载的操作类
最近项目有需求需要定期svn更新项目,并打包成下载包供下载,参考了网上的一些相关代码后写了如下一个用来提供给用户下载的小组件class downloadUtil { protected $_filename; protected $_filepath; protected $_filesize; //文件大小 public function
2017-10-20 17:12:00
893
原创 一个关于php操作进行zip打包的压缩类
最近项目有需求需要定期svn更新项目,并打包成下载包供下载,参考了网上的一些相关代码后写了如下一个用来进行zip压缩的小组件class zipUtil { public static function zip($dir,$saveDir,$file) { $zip = new ZipArchive(); if($zip->open($saveD
2017-10-20 17:07:33
1138
1
原创 一个关于php操作svn的功能类
最近项目有需求需要定期svn更新项目,并打包成下载包供下载,参考了网上的一些相关代码后写了如下一个用来进行svn操作的小组件class svnUtil { /** * List directory entries in the repository * * @param string a specific project repository pat
2017-10-20 16:41:04
1844
原创 使用php curl扒图片的简单实例
最近研究了一下爬虫相关的一些代码,可以简单理解爬虫其实就是访问页面,并将其信息进行一定的归纳或者处理,达成自己预想的目标的程序,研究了一下后,参考网上的一些代码,自己封装了一个访问url并将上面的img标签内的图片保存下来的php脚本,话不多说,上代码<?php class getImg { function __construct($url = 'http://blo
2017-02-22 23:09:35
5510
原创 一个关于单引号和null和大坑
今天早上在公司上班的时候,突然同事在内部群上说有几个跑日志的脚本没有正常运行,找了各种原因都没找到问题,后天来发现是日志相关的配置在数据库的一个字段有问题,原定的逻辑是要存NULL,而数据库中则是null,乍一看,似乎并无区别,然而两者执行情况完全不同,null本身只是一个字符串变量,在逻辑上与NULL(空)完全不同,查找代码,发现原来是php变量有误,在空的情况下本该赋值null,结果写成了'n
2016-09-05 14:35:37
1720
原创 关于mysql下索引使用的一点心得
最近接到了一个需求,要对后台的一个查询功能进行优化,其实功能是非常简单的,就是从异步数据库拉取数据总量再分页显示,主要就两句sql,一个是计算总量,另一个是分页拉取,进入到数据库分别执行了两句sql后,发现其中一句拉取数据的耗时基本都在0.2s之内,而另一句就出问题,由于这张表的数据量在百万左右,发现SELECT COUNT(*) AS count FROM xxx.xxx WHERE `beg
2016-08-22 16:24:52
2402
原创 一个关于php使用pdo方式进行数据库连接和处理的类
话不多说,先贴代码<?php /** @DB Operates For PDO @author:MeeeeN @date:2015-10-22 22:40:32**/ //定义数据库信息 header("Content-type:text/html; charset=utf-8"); define('DB_HOST', 'localhost'); define
2016-08-06 15:24:53
6036
原创 杭电1069 Monkey and Banana
题目内容:Problem DescriptionA group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the mo
2014-11-10 20:46:12
328
原创 杭电1007 Quoit Design
题目内容:Problem DescriptionHave you ever played quoit in a playground? Quoit is a game in which flat rings are pitched at some toys, with all the toys encircled awarded.In the field of Cyberg
2014-11-10 20:31:07
378
原创 杭电1059 Dividing
题目内容:Problem DescriptionMarsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy
2014-10-10 21:05:00
647
原创 杭电1053 Entropy
Problem DescriptionAn entropy encoder is a data encoding method that achieves lossless data compression by encoding a message with “wasted” or “extra” information removed. In other words, entropy
2014-10-10 20:48:49
391
原创 杭电1051 Wooden Sticks
题目内容:Problem DescriptionThere is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fa
2014-10-10 20:36:26
269
原创 杭电1025 Constructing Roads In JGShining's Kingdom
题目内容:Problem DescriptionJGShining's kingdom consists of 2n(n is no more than 500,000) small cities which are located in two parallel lines.Half of these cities are rich in resource (we c
2014-10-10 20:07:56
316
原创 杭电1024 Max Sum Plus Plus
#include#define min -99999999;int num[1000005];int f[1000005];int g[1000005];int max(int x,int y){ return x>y?x:y;}int minn(int x,int y){ return x<y?x:y;}int main(){ int m,n; whil
2014-10-09 21:23:22
840
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人