- 博客(28)
- 资源 (2)
- 收藏
- 关注
原创 Java拆分和文件合并
参考https://blog.youkuaiyun.com/u013632755/article/details/80467324上面的实现可能针对作者的个人需求,我做了精简将拆分和合并写在一起,直接上代码class FileSplitMerge { //拆分文件 public static void splitFile(String filePath, int fileCount) throws IOException { FileInputStream fis = n..
2020-08-25 22:41:57
315
1
原创 PHP 单例模式的实现
单例设计模式为了解决在一个应用中只有一个实例【比如数据库实例】,并且禁止clone 复制在PHP中可以继承单例模式来使用单例模式的特性,避免每次创建一个类都要创建一个对象一般Sigleton类的实现 参考【https://stackoverflow.com/questions/3126130/extending-singletons-in-php】但是上面参考链接其实也有一点问题一般单例模式的实现...
2018-06-19 15:04:20
2082
原创 centos 6.6 安装 imagemagick 和 php imagick 插件安装 心路历程
先介绍 环境Linux 2.6.32-431.23.3.el6.x86_64 #1 SMP Thu Jul 31 17:20:51 UTC 2014 x86_64 x86_64 x86_64 GNU/LinuxCentOS release 6.8 (Final)aliyun 服务器整个的关系图:1. 第一遍安装 [安装部分只指出configure 参数]初始安装 从imaggick 官网下载 so...
2018-05-07 16:26:07
2372
原创 Mysql 锁 小结
MyISAM :MyISAM存储引擎使用的锁定机制完全是由MySQL提供的表级锁定实现,MyISAM在执行查询语句(SELECT)前,会自动给涉及的所有表加读锁,在执行更新操作(UPDATE、DELETE、INSERT等)前,会自动给涉及的表加写锁,这个过程并不需要用户干预,因此,用户一般不需要直接用LOCK TABLE命令给MyISAM表显式加锁。下面主要针对的是InnoDB 支持事务的存储引擎...
2018-04-20 16:52:10
337
原创 git 从源 编译升级 安装[centos]
准备从github 下载最新版的 官方的git 仓库 https://github.com/git/git/releases 【顺便膜拜一下大神,git的缔造者是 linus Torvalds】从仓库中随便选择一个rc 的是待发布版本 可能有问题 我们直接下载 版本号只有数字的下载 解压#下载wget https://github.com/git/git/archive/...
2018-03-20 18:36:21
389
原创 git 原理
参考文档 https://maryrosecook.com/blog/post/git-from-the-inside-out 参考 http://blog.youkuaiyun.com/bdss58/article/details/45023493上面的文档2 已经整理的可以了 我自己整理一下 自己再做一遍 先说明一下我的git 是1.7 版本比较老可能有差异[root@...
2018-03-20 15:38:59
643
原创 redis 实践1
参考文档 http://redisdoc.com/index.html 详情的redis 命令参考这个文档 [x] 总结下来 其实redis 是用来处理string的一个db 最基本的是string 1. 设置string 并且设置 过期时间 查看还剩时间语法 : SET key value [EX seconds] [PX milliseconds] [NX|XX]> set name
2018-01-23 15:27:13
394
原创 grep 全详解
使用的正则是 POSIX 格式的正则 不可以使用\d 只能使用[:digit:] 这样的缩写但是我也不建议使用[:digit:] 这样的形式 [0-9] 不是更直接 \w 使用 [a-zA-Z0-9]替代 反正根据自己的需求来 [\w 匹配字母或数字或下划线或汉字] 语法 grep [-abcdDEFGHhIiJLlmnOopqRSsUVvwxZ] [-A num] [-B num] [
2018-01-17 19:14:54
7015
原创 awk 使用
awk 和grep 的正则的区别在于 grep 的正则 是需要“/” 而 awk 不需要 “/” 进行包裹 awk 使用教程 awk - pattern-directed scanning and processing language (模式定位 扫描和处理语言) Awk scans each input file for lines that match
2018-01-17 17:02:03
572
原创 正则表达式 中? 问号的作用
参考 https://stackoverflow.com/questions/28646475/warning-preg-match-compilation-failed-unrecognized-character-after-or 参考 https://www.regular-expressions.info/atomic.html上面第二个连接是文档 厉害了For a strang
2018-01-17 15:06:48
7244
原创 正则表达式之贪婪模式讲解
没有注意过 贪婪模式和 非贪婪模式的含义 查看 这篇文章 参考 https://stackoverflow.com/questions/5319840/greedy-vs-reluctant-vs-possessive-quantifiers 关于正则表达式入门参考正则表达式30分钟入门教程摘抄A greedy quantifier first matches as much as
2018-01-17 15:00:29
602
原创 find 全解析
find 命令是linux 世界中查找文件用的最多的一个命令最简单的用法如下find dir -d(depth) 1 -type f(f 文件 d 文件夹) -ctime -1d-atime 最后的访问时间s secondm minute (60 seconds)h hour (60 minutes)d day (24 hours)w
2018-01-17 14:55:48
425
翻译 12. sed 替换 增强版
原文 https://www.thegeekstuff.com/2009/09/unix-sed-tutorial-replace-text-inside-a-file-using-substitute-command/?utm_source=sitekickr&utm_medium=snip_button语法Syntax:#sed 'ADDRESSs/REGEXP/REPLACEMENT/FLA
2018-01-17 12:02:39
835
原创 11. Sed 例子
去除代码中的注释dingmac@ubuntu:~$ echo -e "One\nTwo One\n#One\n//zhang" | sed -E 's@(//.*|#.*)@ ---- @' 打印出行数 类似wc -l seq 129 | sed -n '$='答应出前几行 head 10seq 120 | sed '10 q'打印出最后一行seq 102 | sed -n '$p'打
2018-01-17 10:26:24
172
原创 10. Sed正则表达式
^$.[][^][-] 区间\? -E 的时候不需要\\+ -E 的时候不需要 \*{n} 或者 {n,}| \ 转义字符\r\nPOSIX 类型的的正则[:alnum:][:alpha:][:blank:][:digit:][:lower:] … 我觉得用不到 我反正我是不怎么用 元字符 含义
2018-01-16 19:35:27
306
原创 9. Sed manage Pattern
参考 http://man.linuxde.net/sed - x - h - And curly braces {} are used to group multiple SED commands 下面的都是摘抄自 http://man.linuxde.net/sed 仅帮助回忆 具体查看man - a\ 在当前行下面插入文本。 有\ 表示将增加的内容 另起一行
2018-01-16 19:28:19
174
原创 8.Sed 替换
s[jerry]$ sed 's/,/ | /' books.txt替换On executing the above code, you get the following result:1) A Storm of Swords | George R. R. Martin, 1216 2) The Two Towers | J. R. R. Tolkien, 352 3
2018-01-16 19:07:06
206
原创 7.Sed 特殊操作符
=显示当前的行号[jerry]$ sed '=' books.txt On executing the above code, you get the following result:1 1) A Storm of Swords, George R. R. Martin, 1216 2 2) The Two Towers, J. R. R. Tolkien, 352
2018-01-16 19:01:22
282
原创 6. Sed 基本操作符
d 删除w write 写入到文件a append 在某一行 跟随某一个[jerry]$ sed '4 a 7) Adultry, Paulo Coelho, 234' books.txt 得到的结果:1) A Storm of Swords, George R. R. Martin, 1216 2) The Two Towers, J. R. R. T
2018-01-16 18:59:52
895
原创 5. Sed 模式
sed -n '/The/,$ p' books.txt从 The 开始到最后一行打印出来sed -n '/Two/, +4 p' books.txt #这个就不解释了 打印出后面的4行
2018-01-16 18:59:25
173
原创 4. Sed 行数控制
sed -n ‘1d’ files就是删除第一行‘2,5p’ 表示 prints all the lines from 2 to 5($) which represents the last line of the file‘2,+4 p’ books.txt 从第二行开始打印出后面4行‘M~n’ 50~5 matches line number 50, 55, 60, 6
2018-01-16 18:58:40
481
原创 3 .Sed Loop
LOOP 类似于goto we can define a label as follows::label :start :end :upIn the above example, a name after colon(:) implies the label name.:label的形式就是一个labelTo jump to a specific label, we
2018-01-16 18:57:40
420
原创 2. Sed 语法初步
sed [-n] [-e] 'command(s)' files sed [-n] -f scriptfile files可以写在 文件中使用 sed -f scriptfile files 这样的格式调用在scriptfile中最后一个命令 写一行 类似于执行 sed -e 'commad1' -e 'commad2' files 或者 sed 'commad1;commad2' fi
2018-01-16 18:56:33
185
原创 1.Sed 初识
Sed 指的是 Stream Editor SED can be used in many different ways, such as:Text substitution, 文字替换Selective printing of text files, 选择性答应text 文档In-a-place editing of text files, 编辑文档Non-interactive
2018-01-16 18:55:48
214
转载 glob 模式简
【转】不同语言的 glob 库支持的规则会略有不同。下面是 node-glob 的匹配规则。* 匹配任意 0 或多个任意字符 ? 匹配任意一个字符 […] 若字符在中括号中,则匹配。若以 ! 或 ^ 开头,若字符不在中括号中,则匹配 !(pattern|pattern|pattern) 不满足括号中的所有模式则匹配 ?(pattern|pattern|pattern) 满足 0 或 1 括号
2018-01-15 16:33:56
245
原创 mac ampps 安装php redis 扩展
我在安装php redis 的时候 遇到了一些问题 我是用的是homebrew 方式安装 ampps 使用的 php 版本是 php5.6 下面在终端执行代码 ~$ brew install php56-redis...==> CaveatsTo finish installing redis for PHP 5.6: * /usr/local/etc/php/5.6/conf.d/ext
2018-01-15 15:29:52
784
原创 mysql stored routine (存储例程) 中 definer 的作用 和实例
创建 例程语法参见https://dev.mysql.com/doc/refman/5.7/en/create-procedure.html创建procedure 的语法如下CREATE [DEFINER = { user | CURRENT_USER }] PROCEDURE sp_name ([proc_parameter[,...]]) [characteristic
2017-12-19 11:54:57
1652
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人