由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - How to encode YYYY-MM-DD?
相关主题
Any one works in Intel for 64bit asm ? (转载)求教, python 对于很奇怪的字符的encoding 怎么处理?
C语言大文件如何得到文件大小?用react的试过中文么?
sucks (转载)encode high cardinality categorical features
what is used to represent a "tab" character in "sed"[合集] 微软另一道智力题,求救
How to print \t in perl one-liner?bit count in value from 0 - 255
one question about algorithm[转载] Mac C++ program question
怎么把 integer 转为 multi-byte integer format?谢谢大家!One More Question! Re: C 程序计算结果
大家来看看这个纯Javascript实现的QR二维码生成器Excel Marco
相关话题的讨论汇总
话题: represent话题: dd话题: mm话题: use话题: bits
进入Programming版参与讨论
1 (共1页)
c**t
发帖数: 2744
1
how to use three characters to represent a date?
c**t
发帖数: 2744
2
MM - 0-9AB
DD - 0-9A-U
YY - chr(33) - chr(133)?

【在 c**t 的大作中提到】
: how to use three characters to represent a date?
D****g
发帖数: 2860
3
没明白

【在 c**t 的大作中提到】
: how to use three characters to represent a date?
c**t
发帖数: 2744
4
It's easy to use one character to reprent either month or day; The maximun
one
is 31. (we have 0-9A-Z total 36 to use); but for year, assuming using two
digits, there are 100 possibilities, may use ascii to reprent....
Is there better idea to encode a date?

【在 D****g 的大作中提到】
: 没明白
t****t
发帖数: 6806
5
要只用0-9A-Z也不是不可以,不过就要做一点运算而已
100*12*31=37200 < 46656=36*36*36

【在 c**t 的大作中提到】
: It's easy to use one character to reprent either month or day; The maximun
: one
: is 31. (we have 0-9A-Z total 36 to use); but for year, assuming using two
: digits, there are 100 possibilities, may use ascii to reprent....
: Is there better idea to encode a date?

c**t
发帖数: 2744
6
gotta, 36 进制! 我也是才想到这一点

【在 t****t 的大作中提到】
: 要只用0-9A-Z也不是不可以,不过就要做一点运算而已
: 100*12*31=37200 < 46656=36*36*36

c**t
发帖数: 2744
7
这样三位可以cover 127 年

【在 c**t 的大作中提到】
: gotta, 36 进制! 我也是才想到这一点
t****t
发帖数: 6806
8
那你干嘛不用0-9A-Za-z,就可以cover 640年了

【在 c**t 的大作中提到】
: 这样三位可以cover 127 年
c**t
发帖数: 2744
9
the tag requires upper case & digits only

【在 t****t 的大作中提到】
: 那你干嘛不用0-9A-Za-z,就可以cover 640年了
O*******d
发帖数: 20343
10
Using first 4 bits of the first char to represent month 1 - 12. The last 4
bits to represent day 1-16. Using one bit in the second char to represent a
flag which indicates whether to add 15 to the day. You will then have 15
remaining bit to represent year that will be from 0 to 32767.
g*****g
发帖数: 34805
11
Use a number of offset by 1900-1-1 for example.
You have 24 bits, that's more than enough.
Actually time is done that way internally in Unix.

【在 c**t 的大作中提到】
: how to use three characters to represent a date?
c**t
发帖数: 2744
12
I used the offset (days) by 2000-1-1 and 35 base. There is some limit: shoul
d be always three characters (0-9A-Z).
Actually I don't have 24 bits to use.

【在 g*****g 的大作中提到】
: Use a number of offset by 1900-1-1 for example.
: You have 24 bits, that's more than enough.
: Actually time is done that way internally in Unix.

g*****g
发帖数: 34805
13
If you can't take full advantage of the bits, yes, you can only
cover 36*36*36 and approximately 127 years then.

shoul

【在 c**t 的大作中提到】
: I used the offset (days) by 2000-1-1 and 35 base. There is some limit: shoul
: d be always three characters (0-9A-Z).
: Actually I don't have 24 bits to use.

1 (共1页)
进入Programming版参与讨论
相关主题
Excel MarcoHow to print \t in perl one-liner?
a question about CGIone question about algorithm
贡献一下:本版上搜集的 Google 面试题 (转载)怎么把 integer 转为 multi-byte integer format?
一道c++ 题, 找出duplicate numbers大家来看看这个纯Javascript实现的QR二维码生成器
Any one works in Intel for 64bit asm ? (转载)求教, python 对于很奇怪的字符的encoding 怎么处理?
C语言大文件如何得到文件大小?用react的试过中文么?
sucks (转载)encode high cardinality categorical features
what is used to represent a "tab" character in "sed"[合集] 微软另一道智力题,求救
相关话题的讨论汇总
话题: represent话题: dd话题: mm话题: use话题: bits