This week I want to share with you about monotonic clock. It’s a special clock which tick out continuously, independent from system clock. That mean when you change the system datetime, it won’t affect this clock. Therefore, it is useful to calculate elapsed. When using system clock or wall-clock, it can be changed by user or re-sync via ntpd and therefore may not be accurate. Eg, user accidently set wrong time to a future date and later change it back. These may cause negative delta time. Monotonic clock fixes that. It constantly tick since starting your program.
So next time when you need to calculate delta time. Example in Ruby. instead of:
t1 = Time.now
# Do stuff
t2 = Time.now
puts "it takes #{t2 - t1}"
Do this:
t1 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
# Do stuff
t2 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
puts "it takes #{t2 - t1}"
Now to our links :-).
Programmers tend to work late at night, try to fix some bug, meet dead line and we scacrify our sleep. We need to keep up with new tools, new language, again no sleep. The author do not agree with that and suggest us to sleep more :-). I can tottally agree.
If you work for a company that is doing well, it’s common that it will expand into new markets. How would you change the application to accommodate that? Create a new app from scrach? Or changing existing code to make it work for both old and new business.
In high level programming, we often don’t have to worry about text rendering. A textbox, a label,… do that for us. Rendering text, how hard could it be? As it turns out, incredibly hard! To my knowledge, literally no system renders text “perfectly”. It’s all best-effort, although some efforts are more important than others.
A short story about how a small DB change made me question google cloud, Postgres, and my sanity.
There’s a recurring problem that occurs when writing real-world software. Many believe that any kind of concurrency is inherently difficult, but few realise that structured programming makes it even more difficult than it would have to be.
Understand Statistics helps you visualize and extract information about collected data(log, metrics) more useful. But resources for learning the relevant statistical methods for this domain are hard to find.
The Streaming PubSub team at Lyft got multiple Apache Kafka clusters ready to take on load that required 24⁄7 support. To get their work life balance back and help the business expand, they took a month to create an automatic remediation system.
Using a different color-space than RGB makes handling color gradients much more easy and more intuitive. However, the calculation can be quite hard for a small CPU. Conversion normally use floating point, which is something small CPUs do not have.
LZ78, a lossless data-compression algorithm created by Lempel and Ziv in 1978. The GIF format is based on LZ78. LZ78 takes advantage of a dictionary-based data structure to compress our data. In this case, it makes use of a trie data structure, as it’s more efficient for this compression technique.
Do you know in which order SQL queries actually run in? Read to see how Julia explain it. if you like SQL, checkout “What’s an sql query you’ve written that was really hard and/or fun to write?” It is just a tweet but the responding is lot of cool stuffs. Someone even wrote an ancient handwriting recognition algorithm in SQL. Another one generate a fish and calculate crc-32 checksum
Kubernetes History Visualization
CLI tool for auditing S3 buckets
A serverless cluster computing system for the Go programming language
the toolset for Kubernetes SREs to practice chaos engineering. Use the pre-defined chaos charts, run chaos, find weaknesses in your Kubernetes systems.
BetterDev Link
Every Monday