- 博客(22)
- 资源 (27)
- 收藏
- 关注
原创 [LEETCODE] #2 linked list add two numbers
https://leetcode.com/problems/add-two-numbers/You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain ...
2018-11-28 20:00:13 266
原创 javascript 指数为整数 Math.pow
指数为整数Math.ipow = function(x, y) { if (0==y) return 1; // else return x * pow(x, y-1); var res = 1; for (; y != 0; y>>=1) { if ((y&1) != 0) { res *= x;...
2018-11-27 10:57:38 316
原创 php sql导出
方法一* 安装 navicat for mysqlCtrl +Q 新建查询SELECT * FROM W_R_Auth_PaidCourseWHERE activemodule = 0 AND structtype = 3 AND userid = 27900612;对结果集 复制为 insert语句 或 update语句方法二:* 安装mysqlworkb...
2018-11-26 16:05:30 1170
原创 javascript 取得get参数, set/get cookie, jQuery.cookie.js
* javascript 取得get参数var qs = function(name) { var ps = location.search.substr(1).split('&').find(function(s) { return s.split('=')[0] === name; }); if (ps) { return decodeURIComponent(ps.s...
2018-11-22 10:16:07 391
原创 javascript singleton 单例模式 closure 闭包
* 抽象的单例函数 (通过closure 闭包实现)var singleton = function(fn) { var result; return function() { return result || (result = fn.apply(this, arguments)); }}; * 创建一个唯一的 modal 遮罩层fu...
2018-11-21 15:54:19 309
原创 javascript create alias for document.getElmentById, 通过apply修改this指向
* 通过apply修改this指向 window, 改为documentdocument.getElementById = function(fun) { return function() { return fun.apply(document, arguments); }}(document.getElementById);var getId = document.g...
2018-11-21 15:28:08 280 2
原创 调用短链接生成接口
调用短链接生成接口* zh.jsfunction zh(url) { var postdata = {url: url}; $.getJSON('http://yiqd.cn/site/save?jsoncallback=?', postdata, function(resp) { console.log(resp); if (resp.ret ===...
2018-11-19 09:51:00 565
原创 javascript quicksort quick sort, insertion sort 三分中值法 快速排序 插入排序 heapsort, mergesort
* Arr.jsfunction Arr() { this.cmp = Arr.defaultCompareFunction;}Arr.prototype = [];Arr.fromArray = function(/* Array */ a) { var _this = new Arr(); for (var i = 0; i < a.length;...
2018-11-15 10:18:58 543
原创 php redis 用法 api
<?php/** * Helper autocomplete for php redis extension * @author Max Kamashev <max.kamashev@gmail.com> * @link https://github.com/ukko/phpredis-phpdoc * * @method echo string $string S...
2018-11-14 17:37:27 1045
原创 javascript 状态模式
* index.html<html><head> <meta charset="UTF-8"> <title>state mode</title></head><body><script type="text/javascript"
2018-11-13 23:32:24 383
原创 php call_user_func, call_user_func_array 函数用法
mixed call_user_func ( callable $callback [, mixed $parameter [, mixed $... ]] )mixed call_user_func_array ( callable $callback , array $param_arr )http://php.net/manual/en/function.call-user-func...
2018-11-13 17:35:30 523 1
转载 linux 挂载window共享的目录 | 解压命令 .gz .bz2 .tar.gz
net share doc=D:\mount\mntumount /home/ubuntu/easyeyemount -t cifs //192.168.4.157/easyeye /home/ubuntu/easyeye -o username=mingzhanghui,password=xxxx,vers=2.0,rw,uid=1000,gid=1000,dir_mode=07...
2018-11-13 09:12:39 423
原创 php-fpm 配置, socket改为端口号, nginx
安装nginx先安装zlib, pcre, openssl, 再安装nginxhttp://www.php.cn/php-weizijiaocheng-400180.html安装php-fpmyum -y install gcc automake autoconf libtool makeyum -y install gcc gcc-c++ glibcyum -y i...
2018-11-12 10:05:03 913
原创 php 开发环境显示所有错误; preg_replace preg_replace_callback 函数用法
php 开发环境显示所有错误<?phperror_reporting(E_ALL);ini_set('display_errors', 1);preg_replace preg_replace_callback 函数用法<?php// http://php.net/manual/en/function.preg-replace.php// mixed preg...
2018-11-07 11:06:18 593
原创 javascript sha1 php加密函数sha1用js实现
/* * UTF-8 encoding */ function utf8_encode(argString) { return unescape(encodeURIComponent(argString)); } /***********************************************************...
2018-11-06 12:16:07 942
原创 javascript 兼容浏览器 添加事件, 动态加载js, trigger
/* * Cross-browser helper function to add event handler */ function addEventListener(element, eventType, eventHandler, useCapture) { if (element.addEventListener) { el...
2018-11-06 11:56:24 590
原创 javascript test empty object {}
isObjectEmpty function isObjectEmpty(property) { if (!property) { return true; } var i; var isEmpty = true; for (i in property) { if (Object.pr...
2018-11-06 11:45:31 353
原创 php 下载文件
php 下载文件:<?phpclass WebUtility { /** * 下载文件 * @param $file_path string 文件全路径 * @param $file_name string 文件显示名称(带扩展名) * @param null $file_type 扩展名 zip, jpg, docx * @...
2018-11-05 18:01:37 258 1
原创 vscode c/c++ include header files 配置
* 需要的插件C/C++ for Visual Studio Code C++ Intellisense E:\github\swoole\swoole-src\.vscode\c_cpp_properties.json { "configurations": [ { "name": "Win32", ...
2018-11-05 10:13:28 4342
原创 heapsort Heap Sort 堆排序
* sort/Heap.php<?php/** * Created by PhpStorm. * User: Mch * Date: 2018/11/4 * Time: 10:12 PM */namespace sort;class Heap { /** @var Comparator */ protected $comparator; p...
2018-11-04 22:35:13 535
原创 二叉堆 binary heap (2) 利用小根堆求最大 top k 优先队列 PriorityQueue
相关文章:https://blog.csdn.net/fareast_mzh/article/details/82875342使操作被快速执行的性质是堆序(heap order)性. 由于我们想要快速地找出最小元,因此最小元应该在根上.类似的,可以声明一个max堆,找到和删除最大元 在一个堆中,对于每一个节点X,X的parent中的关键字<=X中的关键字, 根节点除外(...
2018-11-03 16:26:09 579
原创 php 生成随机字符串
* StringGenerator.php<?php// http://php.net/manual/en/function.rand.phpclass StringGenerator { private $chars = []; private $len = 0; public function __construct($s = "") { ...
2018-11-01 10:33:18 283
CRYPTOPP-8-5-0.tar.gz
2024-05-25
aMule源代码,eMule Linux版源代码,amuled
2024-05-25
1119. Metro. dynamic programming, graph theory
2024-05-10
https://acm.timus.ru/print.aspx?space=1&num=1002 题目答案
2024-05-06
Assembly Language Step-By-Step - (Wiley, 2009, 0470497025).pdf
2024-04-21
libevent库, http-server静态文件服务器示例
2023-12-14
nasm-10.09.tar.gz
2023-11-21
windows, which命令找到.exe文件路径
2023-09-30
xxd用16进制打印文件内容,调试代码用
2023-08-23
windows Visual Studio dll动态库模板
2022-09-26
windows环境Visual studio创建静态库,项目框架
2022-09-26
PHP-TreeMap.zip
2021-08-13
DesignPatterns.zip
2020-06-22
composer.phar
2020-05-19
phalcon-stub-3.4.12.zip
2020-04-27
XhUser.vue
2020-01-15
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人