Urgent.News

What's breaking now, across thousands of outlets.

Tech

Event Timestamps Need Units, Not Guesswork

An event can have a valid name, a stable identifier, and a timestamp that lands decades outside the reporting period. The request may still be valid JSON. A successful HTTP response would not tell you whether the timestamp meant seconds or milliseconds. Event timestamp validation should start with a declared unit, not a guess based on the number of digits. This tutorial builds a small, offline…

The article emphasizes the importance of specifying timestamp units in event data to avoid confusion and errors in interpretation. It highlights that event timestamps can be valid JSON but may still be ambiguous regarding whether they represent seconds or milliseconds. The author suggests that a contract should be established for timestamp units, such as using a field with a defined unit like `occurred_at_ms` or a versioned source contract that explicitly declares the unit.

By converting the timestamp to a single unit at the boundary and validating the normalized value, the system can ensure accurate interpretation. The article provides a Node.js example demonstrating how to implement this validation process, emphasizing the need for explicit conversion checks and rejecting non-numeric or fractional values.

Brief written by urgent.news from Dev.to's own syndicated text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How Browser Games Work: HTML5, Canvas and WebGL Explained

Browser games have changed dramatically over the years. Older web games often depended on plugins such as Flash, but modern browser games can now run directly inside Chrome, Firefox, Safari, Edge and…

  • Browser games run directly in web browsers using HTML5, Canvas, WebGL
  • HTML5 provides foundational structure, Canvas renders graphics, WebGL enables 2D/3D graphics
  • WebSockets and WebAssembly facilitate multiplayer and complex computations

The Provenance Layer — Or, You Can't Audit What You Can't Rebuild

Yesterday was the solvency layer (#63): the vendor holding your switch can run out of money. Today's front page answers the next question down — how do you know what the thing on your machine actually…

  • Provenance Layer addresses authenticity of software dependencies
  • Most dependencies cannot be rebuilt from public inputs
  • Implement provenance by pinning dependencies by digest and using lockfiles

Bad Habits in Web Development We Should Avoid

Web development mixes creativity, technology and user experience. It's also easy to pick up habits that quietly erode a site's quality, accessibility and maintainability.

  • Neglecting mobile design from the outset degrades site quality and accessibility
  • Inconsistent design elements confuse users and give unprofessional impression
  • Hardcoding URLs makes website maintenance and scaling difficult

A dark cloud hanging over Nigeria

Distinguished guests, ladies and gentlemen. Some months ago, a colleague walked into my office and noticed the back issues of Nigerian newspapers and magazines, together with printed copies of…

BBC Master Pi 1MHz Domesday

Dominic Plunkett has updated the BBC Micro PiMHz software to emulate most of the hardware for a BBC AIV system, including the LV player!

More from Monday 19 October →