99 82 75 27 23 17 10 9 8 7 7 7 5 5 4 4 4 4 3 3 3 3 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 基础 中的文章

html转文本 | JAVA

br转换行 1 2 3 4 5 6 7 8 9 10 11 12 public class Test1 { private static final Log log = LogFactory.getLog(Test1.class); public static void main(String[] args) throws Exception { String str = "<br> <br > <br /> <br/>"; str = str.replaceAll("(?i)<br[^>]*>","\n"); System.out.println("str = " + str); } 正则表达式解析 html转txt 1 2 3 4 5 6 7 8 9 10 11……

阅读全文

java列表平均分割 | JAVA

问题描述 1 2 oracle id in(a,b,c) 语句如果选项长度超过了1000会引起jdbc异常,错误如下 1 ERROR [net.sf.hibernate.util.JDBCExceptionReporter:58] ORA-01795: maximum number of expressions in a list is 1000 解决方法 将获取id数组的地方用java平均拆分成小于100……

阅读全文

创建并打开新的scratch Buffer

使用场景 在原有的scratch保存新文件时,scratch buffer会消失 创建新命令 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ;;create-new-scratch-buffer (defun create-scratch-buffer nil "create a scratch buffer" (interactive) (switch-to-buffer (get-buffer-create "*scratch*")) (lisp-interaction-mode)) (defun switch-to-scratch-and-back () "Toggle between *scratch* buffer and the……

阅读全文

文件操作 | emacs基础

模板优化, 获取文件名当作博客名称 使用到两个函数 string-replace buffer-name 博客文件模板 1 2 3 4 5 6 7 #+title: ${1:Title} #+DATE: `(format-time-string org-hugo-date-format)` #+author: zhangxingong #+SLUG: ${2:`(string-replace ".org" "" (buffer-name))`} #Result "emacs-file" 参考博客: 操作对象之三 ── 文件……

阅读全文

Emacs里自带的vi模式

Emacs里如何使用vim映射 使用自带的模式viper-mode 使用插件Evil 参考链接如下: Emacs键盘映射效率与vim映射效率哪个更快……

阅读全文

Java列表去重 | Java基础

使用HashSet实现List去重(无序) 1 2 3 4 5 6 7 8 9 10 11 12 /**使用HashSet实现List去重(无序) * * @param list * */ public static List removeDuplicationByHashSet(List<Integer> list) { HashSet set = new HashSet(list); //把Lis……

阅读全文

Oracle时间截断为日期

需求SQL日期对比,需要把sysdate转为日期(oracle) 需要要到截取函数 `TRUNC` 代码如下: 1 select TRUNC(sysdate) from dual; 结果如下: Oracle 日期格式 日期格式化 代码如下: 1 select TRUNC(sysdate) field1, sysdate field2, to_char(sysdate , 'yyyy-mm-dd……

阅读全文

两数之和 | Leetcode

題目描述: 题解 暴力枚举 思路及算法 最容易想到的方法是枚举数组中的每一个数 x,寻找数组中是否存在 target - x。 当我们使用遍历整个数组的方式寻找 target - x 时,需要注意到每一个位……

阅读全文

字符串默认包含空串 | Java基础

昨天开发过程中遇到一个字符串问题: 如果字符串包含了空串返回了true导致判断出错 解决办法消除边界,两个字符串都有值再判断 以下是测试用例:……

阅读全文