Urgent.News

What's breaking now, across thousands of outlets.

Tech

Ranking by exponential decay without a cron job

I built a board of 1,000 tiles where anyone can pay to take a tile away from whoever currently holds it. Tiles are sorted by "heat" — a value that decays over time — so the board reorders itself continuously. The obvious way to do that is a scheduled job that recomputes every row on a timer. I didn't want a scheduled job. Here's how you avoid one. The problem Heat is the sum of every payment a…

The author built a board with 1,000 tiles where the order changes based on a value called heat. Heat is calculated by adding up payments, each with an exponential decay factor. To avoid frequent calculations, the author stored heat as a single pair (P, t_P) instead of individual payments. They then used logarithms to simplify heat calculations and stored it as rank_key.

This rank_key is used to order tiles, with no need for a scheduled job to recompute rankings. The author also provides a function for adding heat values in a numerically stable way. They caution against choosing the wrong time unit for rank_key calculations and emphasize that rank_key is only for ordering, not for computing actual heat values.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

XYZ And GALAXEA Sign MOU For Robot Applications

South Korean robot company XYZ and Chinese robot company GALAXEA have joined hands to develop robot applications.The two companies signed a Memorandum of Understanding (MOU) on August 24 to expand…

  • XYZ and GALAXEA sign MOU on August 24 for robot applications collaboration
  • GALAXEA supplies hardware, XYZ focuses on software optimization and verification
  • Partnership aims to develop task-centric applications like retail automation and factory operations

The 18 products EarthLink Network builds in-house

Here is what this article gives you first (about a 7-minute read): The full picture of the 18 products we run in-house , grouped into six areas — foundation, growth, execution, monitoring, support…

  • EarthLink builds 18 in-house products across six categories
  • Foundation platform includes monorepo for shared components
  • Onion is SSO foundation unifying login across products

More from Tuesday 25 August →