Quantcast
Channel: int – Gea-Suan Lin's BLOG
Browsing latest articles
Browse All 7 View Live

Twitter 提供兩個 userid 超過 32bits 的使用者 (機器人),讓程式測試是不是有問題…

Twitter 宣佈兩個帳號,@64Flavors 以及 @Overflow64,這兩個帳號的 user ID 都超過 32bits 可以存放的範圍,而且每十分鐘就會發一則 tweet:「Test accounts with user IDs greater than 32 bits」。 目前 Twitter 的 user ID 還在 32bits 可以儲存的範圍內,但官方預估在今年就會超過。...

View Article



MySQL 裡儲存時間的方式…

這應該是 MySQL 的 best practice 之一,不知道為什麼 Baron Schwartz 又拿出來講:「A simple rule for sane timestamps in MySQL」。 MySQL 內可以儲存「日期與時間」的資料型態是 DATETIME 與 TIMESTAMP 兩種,不過 DATETIME 沒有時區觀念,而 TIMESTAMP 只能是 UTC (GMT+0)。...

View Article

MySQL 裡搜尋 CHAR/VARCHAR (String) 欄位時要注意的事情

MySQL 表格欄位是 CHAR 或 VARCHAR 時,寫搜尋條件要記得使用 string 格式,而非數字。意思是,要避免這種 SQL query: SELECT * FROM foo WHERE `column_string` = 123456; 原因是即使 column_string 加上了 B-tree index,也無法利用這個 index 加速查詢。 原因是,除了最明確的...

View Article

Facebook 在 MySQL 裡存時間的型態

在 MySQL at Facebook 的這邊說明提到了,Facebook 內部是使用 INT UNSIGNED 儲存時間: Which gets us to the point that it is no different than storing INT (hello 2038?) or UNSIGNED INT (a bit later) or BIGINT (till the end of...

View Article

Despacito 突破 UINT_MAX (4294967295) 次播放了

剛剛看已經 4298389880 次了,成為 YouTube 史上第一個突破 UINT_MAX (4294967295) 的影片:

View Article


MySQL 的 TIME 範圍

這篇算是考古文,找出 MySQL 裡 TIME 資料型態奇怪範圍的由來:「TIME for a WTF MySQL moment」。 在官方的文件裡面可以看到 TIME 的範圍是個奇怪的數字,如果把各版本的文件都拉出來看,會發現都沒改過:「11.2.3 The TIME Type (8.0)」、「11.2.3 The TIME Type (5.7)」、「11.2.3 The TIME Type...

View Article

兩個 unsigned int 取平均值的方法

在 Hacker News Daily 上看到 Raymond Chen 在講怎麼對兩個 unsigned int 取平均值的方法:「On finding the average of two unsigned integers without overflow」,這篇裡面提到了不少有趣的歷史,另外 Hacker News 上的討論「Finding the average of two...

View Article
Browsing latest articles
Browse All 7 View Live




Latest Images

Pangarap Quotes

Pangarap Quotes

Vimeo 10.7.0 by Vimeo.com, Inc.

Vimeo 10.7.0 by Vimeo.com, Inc.

HANGAD

HANGAD

MAKAKAALAM

MAKAKAALAM

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC