自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(120)
  • 资源 (4)
  • 收藏
  • 关注

原创 Zend studio 13.6.1 mac 版 闪退!!!!!

最近mac 安装的zendstudio一直出现选择大片代码,然后删除的时候出现闪退的情况,网上找到如下方法,亲测有效Zend studio 13.6.1 mac 版 闪退!!!!!当选中一块区域,按Delete键,或 Command + x; 后 会闪退!1. 下载这个jar文件http://duyumi.net/uploads/org.eclipse.swt.cocoa.macosx.x86_64_3.105.3.v20170228-0512.jar2.替换到/Application.

2020-11-16 11:23:29 285

原创 git clone 子模块

git clone --recursive ssh://[email protected] 

2019-02-20 15:34:58 736

原创 phalcon beforeSave beforeCreate

* beforeSave()和afterFetch()成对使用,用于读写数据时自动转化数据。 * 例如自动执行serialize unSerialize * * save()发生时事件调用顺序是 * initialize, * onConstruct, * beforeValidation, * beforeValidationOnCreate, * afterValidatio...

2018-12-11 10:43:52 935

原创 mac 免费使用 Navicat for Premium教程

1.百度网盘下载dmp文件百度网盘这里下载2.下载DoubleLabyrinth/navicat-keygen地址:https://github.com/DoubleLabyrinth/navicat-keygen注意切换到Mac版分支破解1.打开终端 进入navicat-keygen 命令如下:$ cd navicat-keygen$ make release...

2018-09-13 11:37:28 3871

原创 git权限报错error: insufficient permission for adding an object to repository database

➜ atd git:(b4.232) ✗ git pullremote: Counting objects: 78, done.remote: Compressing objects: 100% (77/77), done.remote: Total 78 (delta 60), reused 0 (delta 0)error: insufficient permission for ...

2018-09-06 13:53:31 21809

原创 深度优先,广度优先,php打印多维数组

把图一的结构转变为图二的结构<?php//读数据$file = fopen('test.csv', 'r');$all = [];while ( $v = fgetcsv($file) ){ $v[9] = isset($v[9]) ? $v[9] :''; $all[$v[0]][$v[1]][$v[2]][$v[3]][$v[4]][$v[5]][$v[6]]...

2018-06-28 16:07:28 519 1

转载 python csv操作

# _*_ coding: utf-8 _*_import csvimport datetimedata = [ [1, "程欢", 19.353, datetime.datetime(2001, 3, 17)], [2, "chenghuan", 13.287, datetime.datetime(2011, 4, 27)], [3, "aaa", 15.852...

2018-06-13 15:36:45 218

原创 大坑:Python 使用 list 作为函数参数时,参数为可变变量时,默认参数变量的内存地址是相同的,

def foo(numbers=[]): numbers.append(9) print(numbers, id(numbers))foo() #[9]foo() #[9,9]foo([8,9]) #[8,9,9]foo() #[9,9,9]foo() #[9,9,9,9]#出现上述问题的原因是python默认参数的或者值等于默认参数的时候指向的内存地址是同一个地...

2018-06-12 15:33:05 4349 1

原创 python中文乱码

在python项目的文件开头会有# -*- coding: utf-8 -*-的一段代码这是因为PY文件当中是不支持中文的,即使你输入的注释是中文也不行,为了解决这个问题,就需要把文件编码类型改为UTF-8的类型,输入这个代码就可以让PY源文件里面有中文了。但是当保存的python文件的编码格式是GBK的时候会和上面注释定义的编码格式不同,导致输出乱码因为windows默认的编码方式是GB...

2018-03-09 11:21:30 856

原创 python open错误

(result, consumed) = self._buffer_decode(data, self.errors, final)MNIST files need to be opened with binary 'rb' mode instead of just text 'r'.

2018-01-24 13:57:45 2359

转载 python按照比例缩小图片并生成新的图片

import osfrom PIL import Imageext = ['jpg','jpeg','png']files = os.listdir('.')def process_image(filename, mwidth=200, mheight=400): image = Image.open(filename) w,h = image.size if w

2018-01-23 10:42:38 17198 1

转载 python 批量生成优惠券码

import base64#base64编码容易使用#通过id检验验证码是否存在,通过goods查找商品coupon = { 'id':'1231', 'goods':'0001'}def gen_coupon(id, goods): coupon['id'] = id coupon['goods'] = goods raw =

2018-01-22 15:35:07 1524

转载 python图片添加水印

from PIL import Image,ImageDraw, ImageFontdef add_num(img): draw = ImageDraw.Draw(img) myfont = ImageFont.truetype('C:/windows/fonts/Arial.ttf', size=40) fillcolor = "#ff0000" width,h

2018-01-22 13:21:29 1175 1

原创 php获取毫秒级时间戳

function getMillisecond() {//获取毫秒级时间戳 list($usec, $sec) = explode(" ", microtime()); $usec = str_replace('.', '', $usec); $ctime=substr($sec.$usec,0,17); return $ctime;}

2018-01-16 11:48:27 1614

转载 Charles Proxy破解注册 - 最新Win64、Win32、Mac破解版免费下载

备注 参考:  http://charles.iiilab.com/

2017-11-17 13:59:47 746

转载 golang 正则获取和替换

// test18 project main.gopackage mainimport ( "fmt" "regexp" "strconv")// 将字符串解析为浮点数,使用 IEEE754 规范进行舍入。// bigSize 取值有 32 和 64 两种,表示转换结果的精度。// 如果有语法错误,则 err.Error = ErrSyntax// 如果结果超出范围,则返回

2017-09-08 14:35:47 14818

转载 php 策略模式

http://www.lanecn.com/article/main/aid-16 对原始代码进行了封装<?php/* * 策略模式 */// 策略模式,策略就是算法和变化,策略模式就是对算法和变化的封装。是条件选择从客户端到服务端的转移。客户端与算法类的彻底隔离。//场景: 沃尔玛要做一个收银软件。有打8折,打5折等,有每满100减20等。abstract class Pa

2017-08-31 09:54:21 387

原创 golang buffer的使用

// test14 project main.gopackage mainimport ( "bytes" "fmt" //"os")func main() { /* s := []byte(" world") buf := bytes.NewBufferString("hello") fmt.Println(buf.String()) //buf转整形 buf

2017-08-28 18:34:24 4986

转载 golang 读出缓冲器(缓冲器变小)

Read----func (b *Buffer) Read(p []byte) (n int, err error)给Read方法一个容器p,读完后,p就满了,缓冲器相应的减少了,返回的n为成功读的数量如,缓冲器是一个装满5升水的杯子,这个杯子有Read方法,给Read方法一个3升的杯子Read完后,5升杯子里有2升水,3升的杯子满了,返回的n为3在一次Read时,5升杯子里有0升水,3升

2017-08-28 17:56:59 1001

原创 golang 文件读取

// test14 project main.gopackage mainimport ( //"fmt" "io/ioutil" "log" "os" "strings" "unicode")func main() { file, err := os.Open("./aa.txt") if err != nil { log.Fatal(err) } defe

2017-08-28 14:51:47 1561

原创 golang base64

// test12 project main.gopackage mainimport ( "bytes" "encoding/base64" "fmt")func main() { eightBitData := []byte{1, 2, 3, 4, 5, 6, 7, 8} bb := &bytes.Buffer{} encoder := base64.NewEncode

2017-08-28 14:18:35 695

原创 golang 学习笔记(1)数组,切片,字典

// test10 project main.gopackage mainimport ( "fmt")const ( a int = 1 b string = "td" flag bool = false c = "33")func testArray() { //一维数组 var arr [2]int arr[0] =

2017-08-25 16:18:46 1154

原创 curl get post http 操作类

class HttpService{ /** * HTTP GET 请求 * @param string $url 请求的URL地址 * @param array $data GET参数 * @param int $second 设置超时时间(默认30秒) * @param array $header 请求Header信息 *

2017-08-23 18:13:12 628

原创 mongdb和sql对比

SQL Statement Mongo Statement CREATE TABLE USERS (a Number, b Number)db.createCollection("mycoll")ALTER TABLE users ADD ..

2017-07-20 11:32:16 751

转载 golang post发送application/json数据到服务器

import ( "net/http" "encoding/json" "fmt" "bytes" "io/ioutil" "unsafe") type JsonPostSample struct { } func (this *JsonPostSample) SamplePost() { song := make(map[st

2017-07-19 17:36:01 11336

转载 go-simplejson|解析json字符串

package mainimport ( "github.com/bitly/go-simplejson" // for json get "fmt")var jsonStr = ` { "person": [{ "name": "piao", "age"

2017-07-19 17:18:05 14197

原创 golang 模拟 curl post

package mainimport ( // "bytes" "fmt" "io/ioutil" "net/http" "net/url" // "os" // "strings")func main() { client := &http.Client{} //向服务端发送get请求 //request, _ := http.NewRequest("GET", "

2017-07-12 17:51:17 7772

转载 php常用探针

<?phpheader("content-Type: text/html; charset=utf-8");header("Cache-Control: no-cache, must-revalidate");header("Pragma: no-cache");error_reporting(0);ob_end_flush();?>

2017-05-08 11:50:40 4784

转载 php memcache

<?php/* +----------------------------------------------------------------------+ | PHP Version 5 | +--------------------------------------

2016-12-12 17:19:04 399

原创 php生成uuid 工具方法

/** * 生成uuid * @copyright [chenghuan] * @license [license] * @version [version] * @return [string] [uuid] 长度36 */ function guid(){ $uuid = '';

2016-11-03 16:29:22 1781

原创 php pdo操作数据库工具类

<?phpclass pdomysql { public static $dbtype = 'mysql'; public static $dbhost = '127.0.0.1'; public static $dbport = '3306'; public static $dbname = 'sweixin'; public static $dbuser = 'root'; pu

2016-11-03 16:25:59 1027

原创 php 日志、文件保存工具方法

/** * 根据路径创建目录 * @author [email protected] * @param * @return array * @date 2016年11月3日 下午3:39:46 */ function mkdirs($dir, $mode = 0777) { if (is_

2016-11-03 15:48:51 608

转载 配置nginx的端口来访问不同网站

可以.在配置nginx.conf里的http下配置两个server即可:server { listen 81; root /path/to/site1; index index.html index.htm index.php; location ~ \.php$ { try_files $uri =404; include f

2016-09-18 17:40:46 7670 1

转载 微信支付

http://blog.csdn.net/csdn_dengfan/article/details/52152591微信支付可以参考下面文章,很详细,仅做参考

2016-09-14 10:46:20 387

转载 Linux rsync同步文件脚本

使用rsync可以实现文件备份同步,现实的一个使用场景是,在后台上传的模板文件,需要同步到另一台服务器,通过别的域名地址访问,这就需要把后台上传的文件自动同步到对外可访问的服务器。记录一个rsync同步文件的sh脚本,作为例子:#!/bin/bashrsync -avz --password-file=/etc/rsync.msg.key /usr/local/zeus/htdo

2016-09-02 19:12:13 3566 1

原创 php 查看数组占用的内存大小

<?phpfunction convert($size){ $unit=array('b','kb','mb','gb','tb','pb'); return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];} $start = memory_get_usage();

2016-08-25 17:53:34 3233

转载 php数组和xml之间相互转化

//数组转XML function arrayToXml($arr) { $xml = ""; foreach ($arr as $key=>$val) { if (is_numeric($val)){ $xml.="".$val.""; }else{

2016-08-11 17:19:43 549

转载 PhpExcel中文帮助手册|PhpExcel使用方法

下面是总结的几个使用方法include 'PHPExcel.php';include 'PHPExcel/Writer/Excel2007.php';//或者include 'PHPExcel/Writer/Excel5.php'; 用于输出.xls的创建一个excel$objPHPExcel = new PHPExcel();保存excel—2007格式$objWriter = n

2016-07-28 16:11:08 466

转载 php mysql 操作类

<?phpclass DB_mysql { private $db_host; //数据库主机 private $db_user; //数据库用户名 private $db_pwd; //数据库用户名密码 private $db_database; //数据库名 private $conn; //数据库连接标识; private $result;

2016-06-17 10:27:46 426

转载 php加密

<?php $str = base64_encode(file_get_contents('12.jpg')); //$id = "http://www.xiaoshuoshu.org/files/article/html/0/160/index.html"; $token = encrypt($str, 'E', 'qingdou'); echo '加密:'.encryp

2016-06-16 11:38:30 301

pdo详解(中文教程)

PDO是连接数据库的常用方法,这个文档介绍了,该怎么使用PDO连接数据库,内容非常详实

2013-07-21

C 学习笔记.pdf

很好的学习c语言的书,很值得看一下,看过之后绝对不会后悔

2013-01-02

TCP-IP协议详解

这是一本讲解网络TCP——IP协议的书籍,里面很详细的讲解了tcp-ip协议,很值得一看,绝不是后悔

2012-12-16

数据结构习题集

一本学习数据结构很好的书,数据结构是编程的灵魂,希望直这本书对大家有帮助

2012-12-16

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除