typecho 启用代码块 高亮 行号
使用 prismjs 库,jsdelivr cdn
使用 prismjs 库,jsdelivr cdn
If you want logical calendar days, use DAYS.between() method from java.time.temporal.ChronoUnit:
LocalDate dateBefore;
LocalDate dateAfter;
long daysBetween = DAYS.between(dateBefore, dateAfter);
If you want literal 24 hour days, (a duration), you can use the Duration class instead:
LocalDate today = LocalDate.now()
LocalDate yesterday = today.minusDays(1);
// Duration oneDay = Duration.between(today, yesterday); // throws an exception
Duration.between(today.atStartOfDay(), yesterday.atStartOfDay()).toDays() // another option
For more information, refer to this document.
https://stackoverflow.com/questions/27005861/calculate-days-between-two-dates-in-java-8
参照github上的问答,在 typecho 网站空间内 /usr/themes/default 放入了下载好的文件 normalize.css。
然后 控制台->外观->编辑当前外观->header.php:
<!-- 使用url函数转换相关路径 -->
的下一行,将其更改为了
<link rel="stylesheet" href="<?php $this->options->themeUrl('normalize.css'); ?>">
之后保存成功即可生效。
https://github.com/typecho/typecho/pull/726
https://necolas.github.io/normalize.css/latest/normalize.css
在本指南中,我们将了解如何将 LocalDate 转换为 Date。在查看转换代码之前,让我们先看看 Date 和 LocalDate 之间有什么区别。
java.util.Date - date + time + timezone
java.time.LocalDate - only date
因此,要将 LocalDate 转换为 Date,我们必须在日期后附加时间和时区信息。考虑到这一点,转换步骤如下:
As nobody answered, So I asked this on MongoDB-User Group
Say cars
is your outputcollection (where you want to store output of map-reduce job).
cars
will be deleted (regardless of their _id) and replaced by the current result.MERGE: No document in cars
will be deleted. Instead, each document in your current result will replace an already existing document in cars
with the same _id. If there is not any document in cars
with that _id, it will be just inserted. You can see this like an upsert:
db.cars.update({_id: newDocument._id}, {value: newDocument.value}, {upsert: true})
The complete answer can be found here.
https://stackoverflow.com/questions/30508245/what-does-mapreducecommand-outputtype-reduce-do-in-mapreduce-command-in-mongodb