- 博客(20)
- 资源 (27)
- 收藏
- 关注
原创 regexp 正则表达式
* 给定字符串 str,检查其是否包含连续重复的字母(a-zA-Z),包含返回 true,否则返回 falseinput: 'rattler'output: truefunction containsRepeatingLetter(str) { return /([a-zA-Z])\1/.test(str);} * 给定字符串 str,检查其是否以元音字母结尾1...
2018-06-30 23:54:00 250
原创 位运算
*获取数字 num 二进制形式第 bit 位的值。注意:1、bit 从 1 开始2、返回 0 或 13、举例:2 的二进制为 10,第 1 位为 0,第 2 位为 1input:128, 8output: 1function valueAtBit(num, bit) { // 1000 0000 return num & 1<<(bit...
2018-06-30 21:56:00 227
原创 javascript 面向对象 模块
* module完成函数 createModule,调用之后满足如下要求:1、返回一个对象2、对象的 greeting 属性值等于 str1, name 属性值等于 str23、对象存在一个 sayIt 方法,该方法返回的字符串为 greeting属性值 + ', ' + name属性值function createModule(str1, str2) { return {...
2018-06-30 21:52:00 192
原创 javascript call/apply
Function.prototype.applyapply接受2个参数, 第1个指定了函数体内this对象的指向, 第2个参数为一个数组或者Array like的集合.apply方法吧这个集合中的元素作为参数传递给被调用的函数.var func = function(a, b, c) { console.log([a,b,c]); // [1,2,3]}func.a...
2018-06-30 21:22:00 234
原创 javascript 闭包 closure
* 实现函数 makeClosures,调用之后满足如下条件:1、返回一个函数数组 result,长度与 arr 相同2、运行 result 中第 i 个函数,即 result[i](),结果与 fn(arr[i]) 相同input:[1, 2, 3], function (x) { return x * x; }function makeClosu...
2018-06-30 20:16:00 235
原创 javascript 定时器 / 计时器 timer setTimeout setInterval (js for循环如何等待几秒再循环)
实现一个打点计时器,要求1、从 start 到 end(包含 start 和 end),每隔 100 毫秒 console.log 一个数字,每次数字增幅为 12、返回的对象中需要包含一个 cancel 方法,用于停止定时操作3、第一个数需要立即输出* 使用setTimeout方法var timer;function count(start, end) { if ...
2018-06-30 18:35:00 1799
原创 javascript 编码规范 - 正确使用parseInt, javascript clone 变量克隆
题目描述修改 js 代码中 parseInt 的调用方式,使之通过全部测试用例示例1输入'12'输出12示例2输入复制'12px'输出复制12示例3输入'0x12'输出0function parse2Int(num) { var ...
2018-06-30 18:05:00 336
原创 一些简单的算法题目
1. 移除数组 arr 中的所有值与 item 相等的元素,直接在给定的 arr 数组上进行操作,并将结果返回 input:[1, 2, 2, 3, 4, 2, 2], 2 output: [1, 3, 4] function removeWithoutCopy(arr, item) { var stack = [], last; while (...
2018-06-29 10:19:00 818
原创 javascript/html 禁止图片缓存
更新图片, 如果图片的url没有改变, 刷新页面之后图片会使用缓存的图片Solutions:* js改变图片链接 (添加get参数)// 假设当前这个图片的dom对象为imgimg.src += '?t='+(+new Date()); * html Meta修改<meta http-equiv="Pragma" content="no-cache">...
2018-06-28 16:35:00 12114 2
原创 localStorage util
// localStorage utilvar db ={ set : function(key, obj){ localStorage.setItem(key, JSON.stringify(obj)); }, get : function(key){ return JSON.parse(localStorage.getItem(key)); }, each ...
2018-06-26 15:52:00 557
原创 javascript 继承 inheritance prototype
* Rectangle继承Shape function Shape() { this.x = 0; this.y = 0;}Shape.prototype.move = function(x, y) { this.x += x; this.y += y; console.log("Shape moved ("+this.x+","+th...
2018-06-21 19:43:00 317
原创 FormData上传文件 带进度条
* jQuery ajax FormData 上传文件 template$.ajax({ url: url, type: 'POST', data: new FormData(form), dataType: 'json', cache: false, processData: false, contentType: false,}).done(function(data)...
2018-06-21 16:48:00 1075
原创 javascript 一些函数的实现 Function.prototype.bind, Array.prototype.map
* Function.prototype.bindFunction.prototype.bind = function() { var self = this, context = [].shift.call(arguments), args = [].slice.call(arguments); return function() { ret...
2018-06-21 11:26:00 252
原创 javascript addEvent 添加事件
// https://open.alipay.com/developmentAccess/developmentAccess.htm var $ = window.jQuery; (function() { if (!NodeList.prototype.forEach) { NodeList.prototype.forEach = functio...
2018-06-19 15:47:00 1859
原创 配置阿里云gradle
build.gradlebuildscript { ext { springBootVersion = '1.5.15.BUILD-SNAPSHOT' } repositories { // mavenCentral() maven {url "http://maven.aliyun.com/nexus/content/groups/public/" } ma...
2018-06-17 20:40:00 2862 1
原创 配置阿里云maven
在安装好Maven之后,默认的~/.m2目录下是没有maven仓库配置文件settings.xml的,默认使用的是官方的仓库,访问速度会非常慢,我们需要配置下国内的仓库。创建~/.m2/settings.xml文件,文件内容如下:<?xml version="1.0"?><settings> <mirrors> <mi...
2018-06-12 10:12:00 394 1
原创 php 页面公共部分 转化为js document.write(); 并由匿名函数包裹
页面公共部分以javascript document.write()方式加载生成的js放到需要的位置 footer.js 放到body底部引入...<script src="js/footer.js"></script></body> --------------------------------------php.exe所在文件...
2018-06-11 18:01:00 392
原创 php无限分类 构建树形结构 递归求所有下线用户 树形结构
<?phpclass Classification { const PARENT_ID = 'parentid'; const ID = 'id'; const CHILDREN = 'children'; public static function getTree($items) { $children = []; // group by parent id ...
2018-06-11 17:57:00 1842 1
原创 javascript 字符串反转 strip_tags 字符串常用的自定义函数,加载css etc.
字符串反转String.prototype.reverse = function() { var a = this.split(''); for (var i = 0, j = a.length-1; i < j; i++, j--) { var tmp = a[i]; a[i] = a[j]; a[j] = tmp; } return a.jo...
2018-06-11 17:52:00 855
原创 取得get参数 从url
1. getUrlParam.jsdefine(function() { // url参数 var data, index; (function init() { data = []; index = {}; var u = window.location.search.substr(1); if (u ...
2018-06-11 17:49:00 308 2
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关注的人