Skip to content

Instantly share code, notes, and snippets.

@jayxhj
jayxhj / ExecutingCompleteServiceUtil.java
Created June 25, 2019 13:54
使用 ExecutingCompleteService 进行多线程任务结果处理并增加重试机制
package com.jayxhj.util;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletionService;
import java.util.concurrent.ExecutionException;
@jayxhj
jayxhj / find_and_replace.sh
Last active April 4, 2017 02:14
通过文件a中的某列在文件b中找出并替换 find a pattern of file a in file b and replace them
#!/bin/bash
# 变量初始化
biFile=$1
file=$2
date=$3
# 插入时间,为运行的文件日期往后一天
insert_time=$(date +"%Y-%m-%d 00:10:05" -d "$date + 1 day")
class Solution {
/**
* 先计算差集,再根据差集里相同的长度,得到全排列的值,累计相加
*/
public int solution(int[] A) {
// write your code in Java SE 8
int arithmeticNum = 0;
// 长度
int length = A.length;
@jayxhj
jayxhj / svn_update.sh
Created September 7, 2016 06:40
svn update directory
#!/bin/sh
dir_root='/data/home/xuhaojie01_58/www/ganji/ganji_online/'
dires=$(ls -l ${dir_root} | awk '{if($9 != "") print $9}')
for dir in ${dires}
do
dir_path=${dir_root}/${dir}
echo "svn up ${dir_path} start"
svn up ${dir_path}
echo "svn up done"
@jayxhj
jayxhj / isayme.xcs
Last active August 29, 2015 14:06 — forked from isayme/isayme.xcs
Xshell Color Theme
[isayme]
text(bold)=eaeaea
magenta(bold)=ff00ff
text=ffffff
white(bold)=eaeaea
green=00c000
red(bold)=d20000
green(bold)=00ff00
black(bold)=808080
red=c00000