Finology 大数据金融

通过大数据以量化金融

create-react-app工具创建了一个项目,使用IDEA打开项目,出现如下错误提示:

点击Detail查看:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
TypeError: this.cliEngine is not a constructor

TypeError: this.cliEngine is not a constructor
at ESLintPlugin.invokeESLint (/Applications/IntelliJ IDEA.app/Contents/plugins/JavaScriptLanguage/languageService/eslint/bin/eslint-plugin.js:97:25)
at ESLintPlugin.getErrors (/Applications/IntelliJ IDEA.app/Contents/plugins/JavaScriptLanguage/languageService/eslint/bin/eslint-plugin.js:76:21)
at ESLintPlugin.onMessage (/Applications/IntelliJ IDEA.app/Contents/plugins/JavaScriptLanguage/languageService/eslint/bin/eslint-plugin.js:42:29)
at Interface.<anonymous> (/Applications/IntelliJ IDEA.app/Contents/plugins/JavaScriptLanguage/jsLanguageServicesImpl/js-language-service.js:105:39)
at Interface.emit (events.js:198:13)
at Interface._onLine (readline.js:308:10)
at Interface._normalWrite (readline.js:451:12)
at Socket.ondata (readline.js:165:10)
at Socket.emit (events.js:198:13)
at addChunk (_stream_readable.js:288:12)
Process finished with exit code -1

编辑文件

把如下内容:

1
this.cliEngine = require(packagePath + "lib/cli-engine");

修改为:

1
this.cliEngine = require(packagePath + "lib/cli-engine").CLIEngine;

关闭项目,重新打开项目就可以了。

文中输出的时间,都是相同的,便于读者观看。

Date转Timestamp

1
2
3
4
5
Date date = new Date();
long currentMillis = date.getTime()
System.out.println(currentMillis);

1578064861125

java.util.Date, 这个类跟时区是无关的。

Timestamp转Date

1
2
3
4
5
long timeMillis = System.currentTimeMillis();
Date date = new Date(timeMillis);
System.out.println(date);

Fri Jan 03 23:21:01 CST 2020

Date转日期字符串

当我们打印出Date时,显示的时间,就是带有时区的字符串了。那为什么是CST(China Standard Time)呢?

1
2
3
4
String timeZoneId = TimeZone.getDefault().getID();
System.out.println(timeZoneId);

Asia/Shanghai

发现系统默认的时区id为Asia/Shanghai

如何查看有哪些时区id呢?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
String[] availableIDs = TimeZone.getAvailableIDs();
for (String availableID : availableIDs) {
System.out.println(availableID);
}

Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
...
Asia/Shanghai
Asia/Singapore
Asia/Srednekolymsk
Asia/Taipei

如果我们想查看日本东京的时间呢?

1
2
3
4
5
6
7
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS Z");
sdf.setTimeZone(TimeZone.getTimeZone("Asia/Tokyo"));
String dateStr = sdf.format(date);
System.out.println(dateStr);

2020-01-04 00:21:01.125 +0900

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
cd /etc/yum.repos.d/
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm

yum install jq

...
==============================================================================================================================================
Package 架构 版本 源 大小
==============================================================================================================================================
正在安装:
jq x86_64 1.5-1.el7 epel 153 k
为依赖而安装:
oniguruma x86_64 5.9.5-3.el7 epel 129 k
...
0%