07 2018 档案

摘要:$.ajax 常用的套路 阅读全文
posted @ 2018-07-31 18:52 zhanghui_ming 阅读(108) 评论(0) 推荐(0) 编辑
摘要:* 一个对象池的简单应用 tool tip tootip.html js/toolTip.js Run: A, B没有重复创建 * 通用对象池的实现 iframe.html js/iframe.js Run: 阅读全文
posted @ 2018-07-31 17:42 zhanghui_ming 阅读(845) 评论(0) 推荐(0) 编辑
摘要:* 适应条件 ** 一个程序中使用了大量的相似对象 造成大的内存开销 ** 对象的大多数状态都可以变为外部状态 ** 剥离出对象的外部状态之后, 可以使用相对较少的共享对象取代大量对象 * 上传文件的例子: index.html js/upload.js 阅读全文
posted @ 2018-07-31 16:36 zhanghui_ming 阅读(124) 评论(0) 推荐(0) 编辑
摘要:* 项目部署更新 用符号链接 project => project1, project2 * composer自动加载机制 namespace => directory, class name => file name * fcgi, cgi原理 php-fpm * mysql当前版本8.0 htt 阅读全文
posted @ 2018-07-31 09:22 zhanghui_ming 阅读(109) 评论(0) 推荐(0) 编辑
摘要:* 绝对路径转化为相对路径 <?php /** * $path相对于$base的相对路径 * @param string $base * @param string $path */ function abs2rel(string $base, string $path) { if (is_dir( 阅读全文
posted @ 2018-07-30 15:43 zhanghui_ming 阅读(194) 评论(0) 推荐(0) 编辑
摘要:1. array_chunk 实现 http://php.net/manual/en/function.array-chunk.php test: $input_array = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'); print_r(my_arr 阅读全文
posted @ 2018-07-30 10:19 zhanghui_ming 阅读(1081) 评论(0) 推荐(0) 编辑
摘要:Mac: * 下载go安装包 go语言中文网 ** 通过源码编译安装需要先安装go1.4 Building Go cmd/dist using /Users/Mch/go1.4.ERROR: Cannot find /Users/Mch/go1.4/bin/go.Set $GOROOT_BOOTST 阅读全文
posted @ 2018-07-29 11:32 zhanghui_ming 阅读(879) 评论(0) 推荐(0) 编辑
摘要:always makes the choice that seems to be the best at that moment. Example #1: @function: scheduling // You are given an array A of integers, where eac 阅读全文
posted @ 2018-07-28 14:58 zhanghui_ming 阅读(244) 评论(0) 推荐(1) 编辑
摘要:1. 面向对象 2. 闭包 3. display:inline-block有间隙怎么处理 4.node.js5. express.js 6.apply/call区别 7.css有哪几种选择器 8.react原理 9.说一下mvc框架 10.http https区别 11.原生ajax实现步骤 <ht 阅读全文
posted @ 2018-07-27 09:56 zhanghui_ming 阅读(216) 评论(0) 推荐(0) 编辑
摘要:jQuery has been removed 阅读全文
posted @ 2018-07-27 09:45 zhanghui_ming 阅读(174) 评论(0) 推荐(0) 编辑
摘要:* 允许所有跨域 E:\apache-tomcat-7.0.81\conf\web.xml <filter> <filter-name>CorsFilter</filter-name> <filter-class>org.apache.catalina.filters.CorsFilter</fil 阅读全文
posted @ 2018-07-26 10:43 zhanghui_ming 阅读(1261) 评论(0) 推荐(0) 编辑
摘要:* javascript自定义事件 output: Event {isTrusted: false, type: "myEventName", target: div, currentTarget: div, eventPhase: 2, …} @Ref: Usage: * 发布-订阅 模式 阅读全文
posted @ 2018-07-26 10:00 zhanghui_ming 阅读(341) 评论(0) 推荐(0) 编辑
摘要:* 假设 E:\upload 作为图片上传的位置 nginx 做web服务 * 创建文件conf.php 放到这个目录下 * 把out.txt粘贴到 nginx 的conf路径下的nginx.conf文件中的对应位置 #user nobody; worker_processes 1; #error_ 阅读全文
posted @ 2018-07-25 18:11 zhanghui_ming 阅读(550) 评论(0) 推荐(0) 编辑
摘要:数据库连接 长时间空闲 断开连接solution: <property name="validationQuery" value="select 1"/> <!-- 执行没有实际意义的sql --><property name="testWhileIdle" value="true" /><prop 阅读全文
posted @ 2018-07-25 15:11 zhanghui_ming 阅读(2026) 评论(0) 推荐(0) 编辑
摘要:This pattern involves a single class which provides simplified methods required by client and delegates calls to methods of existing system classes. O 阅读全文
posted @ 2018-07-25 10:33 zhanghui_ming 阅读(152) 评论(0) 推荐(0) 编辑
摘要:输入两棵二叉树A,B,判断B是不是A的子结构。(ps:我们约定空树不是任意一个树的子结构) test: 阅读全文
posted @ 2018-07-24 22:08 zhanghui_ming 阅读(149) 评论(0) 推荐(0) 编辑
摘要:输入两个单调递增的链表,输出两个链表合成后的链表,当然我们需要合成后的链表满足单调不减规则。 用递归可以简化问题 阅读全文
posted @ 2018-07-24 21:46 zhanghui_ming 阅读(129) 评论(0) 推荐(0) 编辑
摘要:* 引入AMD加载方式: require.js CDN https://cdn.bootcss.com/require.js/2.3.5/require.js * 创建模块文件./js/util/date.js * 配置amd方式加载的配置文件 config.js +1 Line: "date": 阅读全文
posted @ 2018-07-24 11:44 zhanghui_ming 阅读(348) 评论(0) 推荐(0) 编辑
摘要:* for in * Object keys 阅读全文
posted @ 2018-07-23 17:08 zhanghui_ming 阅读(570) 评论(0) 推荐(0) 编辑
摘要:* 参考资料 redis文档 http://www.redis.cn/documentation.html, http://redisdoc.com/index.html redis桌面客户端 https://redisdesktop.com/download * 修改redis.conf 添加一行 阅读全文
posted @ 2018-07-23 10:25 zhanghui_ming 阅读(1137) 评论(0) 推荐(0) 编辑
摘要:http://php.net/manual/wrappers.php 过程: 1. 开始通信 2. 读取数据 3. 写入数据 4. 结束通信 usage: * 读写文件系统 ## # Host Database # # localhost is used to configure the loopb 阅读全文
posted @ 2018-07-22 21:01 zhanghui_ming 阅读(195) 评论(0) 推荐(0) 编辑
摘要:* 不用系统比较大小的函数 test: 阅读全文
posted @ 2018-07-22 15:41 zhanghui_ming 阅读(1920) 评论(0) 推荐(0) 编辑
摘要:* 数据表 -- MySQL dump 10.16 Distrib 10.1.31-MariaDB, for osx10.6 (i386) -- -- Host: localhost Database: laravel -- -- Server version 10.1.31-MariaDB /*! 阅读全文
posted @ 2018-07-22 12:08 zhanghui_ming 阅读(444) 评论(0) 推荐(0) 编辑
摘要:String.prototype.charCodeAt String.fromCharCode() test: * UTF-8 变长 字符 UTF-8编码 Byte 1 Byte 2 Byte 3 A 01000001 Ö 11000011 10010110 中 11100100 10111000 阅读全文
posted @ 2018-07-22 08:45 zhanghui_ming 阅读(178) 评论(0) 推荐(0) 编辑
摘要:* 字符编码 ** 一定要知道数据的字符编码 ** 使用utf-8字符编码存储数据 ** 使用utf-8字符编码输出数据 * Crypto.js 支持中文 Base64编码要求把3个8位字节(3*8=24)转化为4个6位的字节(4*6=24),之后在6位的前面补两个0,形成8位一个字节的形式。 如果 阅读全文
posted @ 2018-07-21 23:10 zhanghui_ming 阅读(1014) 评论(0) 推荐(0) 编辑
摘要:* 配置好redis 参照这里 https://www.cnblogs.com/mingzhanghui/p/9338385.html * 修改.env 指定redis作为队列的驱动 * 改队列的配置文件 config/queue.php 下面的这块保持默认 清除缓存 * 创建Controller 阅读全文
posted @ 2018-07-21 11:52 zhanghui_ming 阅读(216) 评论(0) 推荐(0) 编辑
摘要:参照这篇博客: http://www.geekpage.jp/programming/linux-network/book/04/4-21.php * 查看主机当前网卡,哪块在使用. lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 o 阅读全文
posted @ 2018-07-20 14:54 zhanghui_ming 阅读(569) 评论(0) 推荐(0) 编辑
摘要:> node char.jsABCD321abcd654 阅读全文
posted @ 2018-07-19 11:40 zhanghui_ming 阅读(1673) 评论(0) 推荐(0) 编辑
摘要:为Python安装Redis库,登陆https://github.com/andymccurdy/redis-py 后点击Download ZIP下载安装包。 解压并安装: git clone https://github.com/andymccurdy/redis-py cd redis-py s 阅读全文
posted @ 2018-07-18 22:47 zhanghui_ming 阅读(792) 评论(0) 推荐(0) 编辑
摘要:* DateInterval output: 2018-08-01 21:30:002018-09-01 21:30:002018-07-18 21:30:00 2018-07-182018-07-172018-07-162018-07-15 * DateTimeZone * DatePeriod 阅读全文
posted @ 2018-07-18 21:50 zhanghui_ming 阅读(322) 评论(0) 推荐(0) 编辑
摘要:不要相信外部源 $_GET $_POST $_REQUEST $_COOKIE $argv php://stdin php://input file_get_contents() 远程数据库 远程api 来自客户端的数据 htmlentities 1 <?php 2 $input = '<p><sc 阅读全文
posted @ 2018-07-17 22:17 zhanghui_ming 阅读(256) 评论(0) 推荐(0) 编辑
摘要:* 用数组 // test /* var a= []; for (var i = 0; i < 12; i++) { a.push(Math.round(Math.random()*100)); } console.log(a); */ var a = [3, 12, 17, 16, 73, 32, 阅读全文
posted @ 2018-07-17 10:22 zhanghui_ming 阅读(136) 评论(0) 推荐(0) 编辑
摘要:Windows10家庭版的用户,因为系统中没有组策略编辑器,需要修改注册表来实现。 注册表路径:HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters 打开注册表,快捷输入 “regedit” 阅读全文
posted @ 2018-07-16 15:15 zhanghui_ming 阅读(666) 评论(0) 推荐(0) 编辑
摘要:javascript LinkedList: // Array like 1 // test 2 var list = new LinkedList(); 3 4 for (var i = 1; i < 10; i++) { 5 list.push(i); 6 } 7 for (i = 0; i < 阅读全文
posted @ 2018-07-16 13:03 zhanghui_ming 阅读(263) 评论(0) 推荐(0) 编辑
摘要:export: import: 阅读全文
posted @ 2018-07-16 10:42 zhanghui_ming 阅读(1958) 评论(0) 推荐(0) 编辑
摘要:jQuery 选择元素 a.text-success, a.text-danger, a.text-primary, a.text-info css selector regexp css选择器 正则表达式 Selectors This section is non-normative, as it 阅读全文
posted @ 2018-07-16 10:35 zhanghui_ming 阅读(380) 评论(0) 推荐(0) 编辑
摘要:* 从Packagist上搜索需要的包 https://packagist.org/ * 通过composer下载依赖包 * 使用composer自动加载器, 编写scan.php * input csv: ../data/urls.csv output: * 在Linux终端输出带颜色的文字的方法 阅读全文
posted @ 2018-07-15 22:21 zhanghui_ming 阅读(1085) 评论(0) 推荐(0) 编辑
摘要:取第5列,去掉开头结尾的引号,匹配以http://, https://, ftp://开头的行 * awk * php input: ../data/t_video.csv output: ../data/url.csv SplFileObject http://php.net/manual/en/ 阅读全文
posted @ 2018-07-15 21:33 zhanghui_ming 阅读(284) 评论(0) 推荐(0) 编辑
摘要:字节码缓存能存储预先编译好的php代码 * 如果是自己编译PHP 编译好后 php.ini /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20170718 警告: 如果使用 Xdebug, php.ini文件必须 阅读全文
posted @ 2018-07-15 17:46 zhanghui_ming 阅读(136) 评论(0) 推荐(0) 编辑
摘要:* 在array_map()函数中使用闭包 Array( [0] => 2 [1] => 3 [2] => 4) * 使用use关键字附加闭包的状态 Clay, get me some sweet tea! * 使用bindTo方法附加闭包的状态 阅读全文
posted @ 2018-07-15 17:25 zhanghui_ming 阅读(99) 评论(0) 推荐(0) 编辑
摘要:* 使用生成器处理csv文件 input: ../data/t_video.csv output: Generator: 阅读全文
posted @ 2018-07-15 13:49 zhanghui_ming 阅读(449) 评论(0) 推荐(0) 编辑
摘要:windows ~/.emacs mac ~/.emacs 阅读全文
posted @ 2018-07-15 11:28 zhanghui_ming 阅读(190) 评论(0) 推荐(0) 编辑
摘要:The right way /dev/hell Code Response.php 接口 demo: modern-php/├── data│ └── stream.txt└── interface ├── CommandOutputDocument.php ├── DocumentStore.ph 阅读全文
posted @ 2018-07-15 10:07 zhanghui_ming 阅读(112) 评论(0) 推荐(0) 编辑
摘要:* 通过composer下载 // composer.json * 去掉讨厌的注释 https://doc.phpspider.org/demo-start.html ./vendor/owner888/phpspider/core/phpspider.php 删掉这段恶心的代码 * 导入数据库文件 阅读全文
posted @ 2018-07-14 23:13 zhanghui_ming 阅读(329) 评论(1) 推荐(0) 编辑
摘要:laravel 连接数据库出现错误 1. 确认./config/database.php 2. 检查.env文件 默认的配置导致的错误 DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret 3. 重启服务 laravel art 阅读全文
posted @ 2018-07-14 10:43 zhanghui_ming 阅读(317) 评论(0) 推荐(0) 编辑
摘要:<?php class DB { private static $dh = null; private function __construct() { self::$dh = mysqli_connect("localhost","root",""); if (!self::$dh) { die('Could not connect: ' . mysql_err... 阅读全文
posted @ 2018-07-13 11:05 zhanghui_ming 阅读(110) 评论(0) 推荐(0) 编辑
摘要:1. 确认服务器 开放8088端口 https://www.apachefriends.org/download.html 下载XAMPP for Windows,安装 2. 修改apache主配置文件 e:/opt/xampp/apache/conf/httpd.conf 默认有Listen 80 阅读全文
posted @ 2018-07-13 10:41 zhanghui_ming 阅读(1892) 评论(0) 推荐(0) 编辑
摘要:List process by port number -a – Displays all connections and listening ports. -o – Displays the owning process ID associated with each connection. -n 阅读全文
posted @ 2018-07-13 10:24 zhanghui_ming 阅读(128) 评论(0) 推荐(0) 编辑
摘要:方法1: 用SET PASSWORD命令 mysql -u root mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');方法2:用mysqladmin mysqladmin -u root password "newpa 阅读全文
posted @ 2018-07-13 10:20 zhanghui_ming 阅读(140) 评论(0) 推荐(0) 编辑
摘要:windows cmd bat alias 命令 别名 1. 创建文件 C:\cmd-alias.bat 2. 编辑注册表 regedit Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor+ key/value pair 阅读全文
posted @ 2018-07-13 10:18 zhanghui_ming 阅读(363) 评论(0) 推荐(0) 编辑
摘要:* 分离出共同点 阅读全文
posted @ 2018-07-13 10:07 zhanghui_ming 阅读(125) 评论(0) 推荐(0) 编辑
摘要:# 查看git源 13352@zhanghum MINGW64 /g/eclipse-workspace/platform (20180706_dev_question_course)$ git branch* 20180706_dev_question_course enso-branch mas 阅读全文
posted @ 2018-07-10 16:23 zhanghui_ming 阅读(205) 评论(0) 推荐(0) 编辑
摘要:1. 不带任何提示关闭窗口的js代码 2. 自定义提示关闭 <body onbeforeunload="return '真的要关闭此窗口吗?'"> 阅读全文
posted @ 2018-07-10 10:46 zhanghui_ming 阅读(1352) 评论(3) 推荐(0) 编辑
摘要:* 基本宏命令 * 树形宏命令 运行结果: * 扫描文件夹 * 引用父对象 阅读全文
posted @ 2018-07-09 10:54 zhanghui_ming 阅读(173) 评论(0) 推荐(0) 编辑
摘要:http://docs.php-http.org/en/latest/httplug/users.html 阅读全文
posted @ 2018-07-08 23:36 zhanghui_ming 阅读(485) 评论(0) 推荐(0) 编辑
摘要:* CURL http://www.php.net/manual/en/book.curl.php http://jp2.php.net/manual/en/function.curl-setopt.php GET: http://www.tfjyzx.com/news/listTeacherByA 阅读全文
posted @ 2018-07-08 17:35 zhanghui_ming 阅读(375) 评论(0) 推荐(0) 编辑
摘要:https://pkg.phpcomposer.com/#how-to-install-composer 下载 Composer 安装前请务必确保已经正确安装了 PHP。打开命令行窗口并执行 php -v 查看是否正确输出版本号。 打开命令行并依次执行下列命令安装最新版本的 Composer: 执行 阅读全文
posted @ 2018-07-08 16:47 zhanghui_ming 阅读(292) 评论(0) 推荐(0) 编辑
摘要:html: javascript: FormData upload file * $.ajax setRequestHeader 修改http协议头 阅读全文
posted @ 2018-07-05 14:29 zhanghui_ming 阅读(106) 评论(0) 推荐(0) 编辑
摘要:config.js Usage: 阅读全文
posted @ 2018-07-05 10:04 zhanghui_ming 阅读(180) 评论(0) 推荐(0) 编辑
摘要:参照runoob:PHP 使用 Redis Windows: - 假设redis已经安装好 服务启动 - xampp (php 7.1 x86 windows) 查看phpinfo (php 7.1 x86/x64 ts/uts vc14/vc15) Zend Extension Build API 阅读全文
posted @ 2018-07-04 10:10 zhanghui_ming 阅读(197) 评论(0) 推荐(0) 编辑
摘要:* 将 rgb 颜色字符串转换为十六进制的形式,如 rgb(255, 255, 255) 转为 #ffffff1. rgb 中每个 , 后面的空格数量不固定2. 十六进制表达式使用六位小写字母3. 如果输入不符合 rgb 格式,返回原始输入 input: 'rgb(255, 255, 255)' o 阅读全文
posted @ 2018-07-01 22:32 zhanghui_ming 阅读(376) 评论(0) 推荐(0) 编辑
摘要:根据包名,在指定空间中创建对象 输入描述: 输出描述: 阅读全文
posted @ 2018-07-01 20:22 zhanghui_ming 阅读(289) 评论(0) 推荐(0) 编辑
摘要:* 查找两个节点的最近的一个共同父节点,可以包括节点自身 input: oNode1 和 oNode2 在同一文档中,且不会为相同的节点 阅读全文
posted @ 2018-07-01 15:12 zhanghui_ming 阅读(239) 评论(0) 推荐(0) 编辑
摘要:最优解: 阅读全文
posted @ 2018-07-01 13:34 zhanghui_ming 阅读(144) 评论(0) 推荐(0) 编辑