你貌似开启了广告屏蔽插件... 写博客不容易,希望能将广告过滤去掉,谢谢!

vim中插件推荐, 不定期更新(发现好用的插件就更新)

2019-05-05   朋也   杂项   vim  

上一篇介绍了vim的常用快捷键的配置, 插件安装没有说, 这一篇来推荐一些插件以及常规用法

VIM用法总结(备忘)

2019-05-04   朋也   杂项   vim  

之前在整理ubuntu16.04安装和配置的时候, 贴上了一段vim的配置, 可以比较方便的使用vim, 这篇博客总结一下vim里常用的快捷键, 备忘用

算法 - 找最长回文字符串, 从3s到30ms的解法说明

2019-04-30   朋也   算法学习笔记   algorithm  

刷力扣的时候, 碰到了一个找最长回文字符串的题, 解开了, 但只要提交就提示超时, 然后就开始想办法优化, 下面说一下我处理的方法

有兴趣的可以先尝试着解一下这个题, 然后再看我下面整理的解法思路

算法 - 打印1000以内的斐波那契数列

2019-04-27   朋也   算法学习笔记   algorithm  

规律: 前两项的和跟第三项相等

原链接文:https://tomoya92.github.io/2019/04/27/algorithm-2/

@Test
public void test() {
  print(1, 1, 1000);
}

/**
  * 递归打印斐波那契数列
  *
  * @param i   第一项
  * @param j   第二项
  * @param max 最大数
  */
private void print(int i, int j, int max) {
  // 如果j为1, 说明是前两项, 因为前两项都是1, 提前打印出来
  if (j == 1) System.out.print(i + ", " + j + ", ");
  int sum = i + j;
  if (sum > max) return;
  System.out.print(sum + ", ");
  print(j, sum, max);
}
1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987

写博客不易,转载请保留原文链接,谢谢!

算法 - 找出数组中子集乘积的最大值

2019-04-27   朋也   算法学习笔记   algorithm  

给定一个数组, 找出数组子集乘积的最大值

比如[2, 3, -2, 4] 数组, 子集有 [2,3], [2,3,-2], [2,3,-2,4], [3,-2], [3,-2,4], [-2,4]

每个乘积为 6, -12, -48, -6, -24, -8 所以最大值为 6

Activiti6.0教程(7) - 并行网关(ParallelGateway)用法

2019-04-25   朋也   activiti学习笔记   activiti  

先看官网描述

Gateways can also be used to model concurrency in a process. The most straightforward gateway to introduce concurrency in a process model, is the Parallel Gateway, which allows to fork into multiple paths of execution or join multiple incoming paths of execution.

翻译过来

网关还可以用于对流程中的并发性建模。在流程模型中引入并发性的最简单的网关是并行网关,它允许分叉到多个执行路径或连接多个传入的执行路径。

说白了就是流程有分支了, 就叫并行, 其实我觉得这个应该叫分支网关比较好, 不容易误导人, 举个例子

Activiti6.0教程(6) - 排它网关/异或网关(ExclusiveGateway)用法

2019-04-25   朋也   activiti学习笔记   activiti  

官方文档描述

An exclusive gateway (also called the XOR gateway or more technical the exclusive data-based gateway), is used to model a decision in the process. When the execution arrives at this gateway, all outgoing sequence flow are evaluated in the order in which they are defined. The sequence flow which condition evaluates to true (or which doesn’t have a condition set, conceptually having a ‘true’ defined on the sequence flow) is selected for continuing the process.

Note that the semantics of outgoing sequence flow is different to that of the general case in BPMN 2.0. While in general all sequence flow which condition evaluates to true are selected to continue in a parallel way, only one sequence flow is selected when using the exclusive gateway. In case multiple sequence flow have a condition that evaluates to true, the first one defined in the XML (and only that one!) is selected for continuing the process. If no sequence flow can be selected, an exception will be thrown.