Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

常识 #76

Open
magicdawn opened this issue May 17, 2016 · 3 comments
Open

常识 #76

magicdawn opened this issue May 17, 2016 · 3 comments

Comments

@magicdawn
Copy link
Owner

常人 常识

@magicdawn
Copy link
Owner Author

magicdawn commented May 17, 2016

Date

时间戳, s = 10位, ms = 13位
from 1970. s = 86400 * (2016 - 1970) = 14 xxxx xxxx. 大概14亿秒左右. 毫秒数乘以3

http://blog.csdn.net/webcainiao/article/details/4018761

  • UTC Date 世界协调时间, 在 GMT 时间的基础上, 经过严格计算得到. 时区与 GMT 0
  • GMT Date 格林威治 Greenwich Mean time, 标准时间. 格林威治在London UK
  • ISO Date: ISO format ISO 8601 YYYY-MM-DDTHH:mm:ss.sssZ 总是 zero UTC offset
  • Local Date 本地时间
const d = new Date;

// 这两个输出应该一致
d.toUTCString(); // 'Mon, 06 Jun 2016 08:47:48 GMT'
d.toGMTString(); // 'Mon, 06 Jun 2016 08:47:48 GMT'

// ISO 时间, 与上面两个表示的时间一致, 格式不同
d.toISOString(); // '2016-06-06T08:47:48.835Z'

// toString()
d.toString(); // 'Mon Jun 06 2016 16:47:48 GMT+0800 (CST)'
d.toDateString(); // 'Mon Jun 06 2016'
d.toTimeString(); // 16:47:48 GMT+0800 (CST)

// toLocaleString()
d.toLocaleString // 2016-06-06 16:47:48
d.toLocaleDateString() // '2016-06-06'
d.toLocaleTimeString() // '16:47:48'

关于 toString() 产生的 CST 查到资料可表示

  • CST Central Standard Time (USA) UT-6:00
  • CST Central Standard Time (Australia) UT+9:30
  • CST China Standard Time UT+8:00
  • CST Cuba Standard Time UT-4:00

image

@magicdawn
Copy link
Owner Author

magicdawn commented Nov 25, 2022

bytes: KB / KiB

起因

KB 比较常见, 但是看到 vite 的 build 给的是 KiB, 然后与 rollup-plugin-visualizer 大小不一样,

image

image

在 Finder / 第三方 Path Finder 中的大小
image

解释

KB代表国际单位制标准规定的1000进位,KiB这类中间带个"i"的是1024进位法的标准写法。Windows使用1024进位,但是没有按照标准写,Linux和macOS等很多其他系统使用1000进位,并且按照规范写了。Kb这类代表1000进位,计量单位为bit而不是byte的单位,常见于描述带宽和媒体码率。

https://www.expreview.com/71068.html

  • SI 1000 进位, KB KiloByte
  • IEC 规范, Kibibyte

库的表现

vite

翻了翻 vite 的源码, 但是没找到 KiB 在哪里写的

在这两个版本 4.0.0 alpha.4 & alpha.5 之间发生了改变, 使用本地 main 分支没找到 KiB 的代码

vite 更改 PR
vitejs/vite#10982

chrome use kB
https://developer.chrome.com/blog/new-in-devtools-88/#consistent-kb

其他

  • ls, 命令行, KB = KiB
  • Windows, macOs PathFinder, KB = KiB
  • 内存行业, KB = KiB
  • 硬盘行业, KB = 真 KB = 1000Byte

@magicdawn
Copy link
Owner Author

magicdawn commented Oct 30, 2023

IP-CIDR

  • CIDR = Classless Inter-Domain Routing
  • classless 对应 classful, 即 A类 / B类 / C类

198.51.100.14/24 represents the IPv4 address 198.51.100.14 and its associated network prefix 198.51.100.0, or equivalently, its subnet mask 255.255.255.0, which has 24 leading 1-bits.

注意数字 24 是前缀长度, 对于 IPv4 来说, 可变长度为 8 位

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant