JiaHe

相遇即是缘

Source: https://stackoverflow.com/questions/45483699/cmd-exited-with-error-code-1

按 windows+r 打开注册表编辑器,然后键入 regedit,然后在搜索栏中按 enter 键粘贴下面的行

HKEY_CURRENT_USER\Software\Microsoft\Command Processor\

如果您可以使用链接在图片中看到带下划线的标记很重要,请不要在该特定注册表的数据中插入任何其他值。

在这里,如果您提交了许多注册表值,则删除除默认值之外的所有注册表值,因为它们是命令提示符显示错误代码 1 的主要原因。 所以在删除所有这些之后。

编辑默认注册表值并在Data中插入cmd 并保存

你的问题解决了!! 如果不是,则清除默认注册表的数据。

背景

线上某任务出现报警,报错日志如下:

java.lang.NullPointerException: null
at java.util.HashMap.merge(HashMap.java:1225)
at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1320)
at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1380)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at com.xxx.web.controller.TaskController.getOmsAccidCloudCCUserIdMap(TaskController.java:648)
at com.xxx.web.controller.TaskController.executePushNewRegisterLead(TaskController.java:400)
at com.xxx.web.controller.TaskController.pushNewRegister(TaskController.java:145)

对应出错的代码:

omsAccidCloudCCUserIdMap = administratorList.stream()
.collect(Collectors.toMap(Administrator::getAccid,administrator
-> cloudccAccidUserIdMap.get(administrator.getCloudccAccid())));

已知administratorList不含有null元素,administratorListcloudccAccidUserIdMap都不为nullAdministrator::getAccid也不会返回null值。

阅读全文 »

!/bin/bash

function timediff() {
# time format:date +"%s.%N", such as 1502758855.907197692
start_time=$1
end_time=$2

start_s=${start_time%.*}
start_nanos=${start_time#*.}
end_s=${end_time%.*}
end_nanos=${end_time#*.}

# end_nanos > start_nanos?
# Another way, the time part may start with 0, which means
# it will be regarded as oct format, use "10#" to ensure
# calculateing with decimal
if [ "$end_nanos" -lt "$start_nanos" ];then
end_s=$(( 10#$end_s - 1 ))
end_nanos=$(( 10#$end_nanos + 10**9 ))
fi

# get timediff
time=$(( 10#$end_s - 10#$start_s )).`printf "%03d\n" $(( (10#$end_nanos - 10#$start_nanos)/10**6 ))`
echo $time
}

# 退出时清空屏幕
trap "clear;exit" 2
# 清空首屏
clear
# 隐藏光标
echo -e "\033[?25l"

diff=0
str=`date +'%Y / %m / %d %H : %M : %S'`
while true
do
figlet -w 120 -f big -c "${str}"

start=$(date +'%s.%N')
str=`date +'%Y . %m . %d - %H : %M : %S'`
echo -ne "$report"
echo -ne "\033[1;1H"
a=`timediff $start $end`
b=1
end=$(date +'%s.%N')

sleep `awk 'BEGIN{print "'$end'" - "'$start'"}'`
done

非常强大的对齐格式化插件; 对于编辑 Markdowntable 来说简直就是量身定制神器
支持的分隔符: <Space> = : . | & # ,

安装

vundle` 方式安装: `vim ~/.vimrc
" 找到 call vundle#begin() 和 call vundle#end() 之间插入
plugin 'junegunn/vim-easy-align'


" 然后直接在 vim 里用命令方式安装
:source %
:plugininstall


" 文件末尾增加配置
" start interactive easyalign in visual mode (e.g. vipga)
xmap ga <plug>(easyalign)

" start interactive easyalign for a motion/text object (e.g. gaip)
nmap ga <plug>(easyalign)
阅读全文 »

This is a complete guide to Java 8 features, enhancements, date and time API, and coding examples. The examples from this tutorial are tested in our local development environment. You can simply clone from Github and try to use it in your projects or practice.

New Tutorials added (2020)

Key Features of Java 8

In this tutorial, we will learn the following important keys features that came in Java 8:

img

阅读全文 »