爱看书的阿东

赐他一块白色石头,石头上写着新名

Source

https://dev.mysql.com/doc/refman/8.0/en/datetime.html

Mysql 官方文档解释

The DATE, DATETIME, and TIMESTAMP types are related.

DATE”、”DATETIME “和 “TIMESTAMP “类型是相关的。

This section describes their characteristics, how they are similar, and how they differ. MySQL recognizes DATE, DATETIME, and TIMESTAMP values in several formats, described in Section 9.1.3, “Date and Time Literals”.

本节将介绍它们的特点、相似之处和不同之处。MySQL以几种格式识别DATEDATETIMETIMESTAMP值,在第9.1.3节,”日期和时间字面”中描述。

For the DATE and DATETIME range descriptions, “supported” means that although earlier values might work, there is no guarantee.

对于 DATEDATETIME 范围描述,”支持 “表示虽然早期值可能有效,但不能保证。

The DATE type is used for values with a date part but no time part. MySQL retrieves and displays DATE values in '_`YYYY-MM-DD`_' format. The supported range is '1000-01-01' to '9999-12-31'.

Date “类型用于包含日期部分但不包含时间部分的值。MySQL 以 '_`YYY-MM-DD`_' 格式检索和显示 DATE 值。支持的范围是1000-01-019999-12-31

The DATETIME type is used for values that contain both date and time parts.

阅读全文 »

Source

Working with time zones, timestamps and datetimes in Laravel and MySQL - Advanced and Qualified electronic signature marketplace (eideasy.com)

There seems to be quite a bit of confusion around how timestamps, datetimes and time zones really work. This article aims to demystify these concepts and give some recommendations and best practices on how to handle dates and time zones in a sane way in your Laravel app and MySQL.

阅读全文 »

Source

Source:Linux Zero-Copy Using sendfile(). sendfile() has been gradually becoming… | by CocCoc Techblog | The Startup | Medium

Why Zero-copy?

What’s happening under the hood when the OS is copying a file / transfering a file to another host?

当操作系统将文件复制/传输到另一台主机时,在系统底层下发生了什么?

For our naked eyes the process can be simple, OS first reads content of the file, then writes it to another file, then it’s done!

我们肉眼看到的过程可能很简单:操作系统首先读取文件内容,然后将其写入另一个文件,接着就完成了!

However, things become complicated when we look more closely and memory is taken into account.

然而,当我们仔细观察并将内存考虑在内时,事情就变得复杂了。

As depicted in the dataflow below, the file read from disk must go through kernel system cache — which resides in the kernel space, then the data is copied to userspace’s memory area before being written back to a new file — which then in turn goes to kernel memory buffer before really flushed out to disk.

如下面的数据流所示,从磁盘读取的文件必须经过内核系统缓存(位于内核空间),然后数据被复制到用户空间的内存区域,再写回一个新文件,然后再进入内核内存缓冲区,最后被刷新到磁盘。

The procedure takes quite many unnecessary operations of copying back and forth between kernel and userspace without actually doing anything, and the operations consume system resources and context switches as well.

这个过程需要在内核和用户空间之间进行大量不必要的来回复制操作,但实际上什么都没做,而且这些操作还会消耗系统资源和上下文切换。

There’re room for improvement.

当然这部分还有改进余地。

阅读全文 »

Source

Pass arguments into a function - Linux Bash Shell Scripting Tutorial Wiki (cyberciti.biz)

Let us see how to pass parameters to a Bash function.

让我们看看如何向 Bash 函数传递参数。

  • A shell function is nothing but a set of one or more commands/statements that act as a complete routine.

  • Each function must have a unique name.

  • Shell functions have their own command line argument or parameters.

  • Use shell variable $1, $2,..$n to access argument passed to the function.

  • shell 函数是由一条或多条命令/语句组成的一个完整例程。

  • 每个函数都必须有一个唯一的名称。

  • shell 函数有自己的命令行参数。

  • 使用 shell 变量 $1$2…$n 访问传递给函数的参数。

阅读全文 »

Source

Garbage First Garbage Collector Tuning (oracle.com)

Learn about how to adapt and tune the G1 GC for evaluation, analysis and performance. 了解如何适应和调整G1 GC的评估、分析和性能

The Garbage First Garbage Collector (G1 GC) is the low-pause, server-style generational garbage collector for Java HotSpot VM. The G1 GC uses concurrent and parallel phases to achieve its target pause time and to maintain good throughput. When G1 GC determines that a garbage collection is necessary, it collects the regions with the least live data first (garbage first).

Garbage First Garbage Collector (G1 GC)是 Java HotSpot VM 的低等待、Server端垃圾收集器。G1 GC 使用并发和并行阶段来实现其目标暂停时间,并保持良好的吞吐量。当 G1 GC 确定有必要进行垃圾收集时,它会首先收集实时数据最少的区域(垃圾优先)。

A garbage collector (GC) is a memory management tool. The G1 GC achieves automatic memory management through the following operations:

垃圾收集器(GC)是一种内存管理工具。G1 GC 通过以下操作实现自动内存管理:

  • Allocating objects to a young generation and promoting aged objects into an old generation.

  • Finding live objects in the old generation through a concurrent (parallel) marking phase. The Java HotSpot VM triggers the marking phase when the total Java heap occupancy exceeds the default threshold.

  • Recovering free memory by compacting live objects through parallel copying.

  • 将对象分配到年轻一代,并将老化对象提升到老一代。

  • 通过并发(并行)标记阶段,在旧一代中查找有效对象。Java HotSpot VM 会在 Java 堆总占用率超过默认阈值时触发标记阶段。

  • 通过并行复制压缩活对象来恢复空闲内存。

阅读全文 »

#zookeeper

原文

https://www.baeldung.com/apache-curator

1. Introduction

Apache Curator is a Java client for Apache Zookeeper, the popular coordination service for distributed applications.

Apache CuratorApache Zookeeper 的 Java 客户端,后者是分布式应用程序的流行协调服务。

In this tutorial, we’ll introduce some of the most relevant features provided by Curator:

  • Connection Management – managing connections and retry policies
  • Async – enhancing existing client by adding async capabilities and the use of Java 8 lambdas
  • Configuration Management – having a centralized configuration for the system
  • Strongly-Typed Models – working with typed models
  • Recipes – implementing leader election, distributed locks or counters

在本文中,我们讲介绍一些Curator提供的最实用的功能实现:

  • 连接管理:管理连接和重试策略
  • 异步:通过添加异步功能和使用 Java 8 lambda 来增强现有客户端
  • 配置管理:系统集中配置。
  • 强类型模型:作用于类型模型上
  • Recipes:实现领导选举,分布式锁或者计数器
阅读全文 »

一. 交易

1.1 什么是交易?

按照历史趋势:贝壳交换 => 实体货币 => 数据化虚拟货币(轻量化和虚拟化)。

一句话:等价交换行为

1.2 交易定义

买卖双方对有价值的物品与服务互通有无的行为。

关键:双方、有价值、互通有无、物品和服务

1.3 交易流程

古代:袖内拉手袖内比价

现代:某些交易场景下有专业的手势,比如交易所手心向内和手心向外代表买入和卖出。

具体步骤

步骤:签约 => 认证 => 交付 => 记录

签约:交易条件一致。

认证:互验真伪。

交付:卖方物品服务托付买方。

记录:买方转账给卖方。

产生问题

  1. 跨境交易
  2. 失信问题
  3. 诈骗
  4. 换汇等一系列问题
阅读全文 »

相关视频

通向另一个世界的窗口——摄影构图三步法

概念

传统的构图模式适合新手,比如三分法,对称法,对角线构图等等,遵循模式的构图会造成成片的千篇一律,这个过程这好似应试教育讲解例题,按照例题去不断练习完成考试。

应试教育的方式学习摄获取不到真正的知识,真正的知识是以原理为基础,构建有效方法

二维影像的基本构成

影响构成的基本原理是形态,形态分为点线面等基本要素,色彩是附加在形态之上的,在影像构成的时候可以忽略色彩观察形态,色彩是在影像结构上的视觉和心理影响。

阅读全文 »

前言:

Jmeter 作为实操性的软件,更注重练习,理论作为参考掌握即可,不需要去具体的纠结

1. 目前用的常用测试工具对比

1、loadrunner

​ 性能稳定,压测结果及细粒度大,可以自定义脚本进行压测,但是太过于重大,功能比较繁多

​ 1、loadrunner

2、apache ab(单接口压测最方便)

​ 模拟多线程并发请求,ab命令对发出负载的计算机要求很低,既不会占用很多CPU,也不会占用太多的内存,但却会给目标服务器造成巨大的负载, 简单DDOS攻击等

3、webbench

​ webbench首先fork出多个子进程,每个子进程都循环做web访问测试。子进程把访问的结果通过pipe告诉父进程,父进程做最终的统计结果。

阅读全文 »

#springboot

Source

Mastering Backend Development with Java Spring Boot: Best Practices and Pro Tips | by Nihal Parmar | Medium

image.png

Spring Boot is a widely used and very popular enterprise-level high-performance framework.

Spring Boot 是一种广泛使用且非常流行的企业级高性能框架。

Here are some best practices and a few tips you can use to improve your Spring Boot application and make it more efficient.

以下是一些最佳实践和技巧,您可以用来改进 Spring Boot 应用程序,使其更加高效。

This article will be a little longer, and it will take some time to completely read the article.

本文篇幅稍长,完整阅读需要耗费不少时间。

阅读全文 »