Urgent.News

What's breaking now, across thousands of outlets.

Tech

Building a BaZi Calculator: The Hard Part Is Explaining the Rules

I built BaZi Cue , a free calculator for BaZi’s Four Pillars, Day Master, and Five Elements. The interesting engineering problem isn’t drawing a chart. It’s making a calendar-dependent result understandable without hiding the conventions that produced it. Start with the calculation contract For a project like this, "convert a birth date into a chart" is not a complete specification. You need to…

BaZi Cue is a free calculator that computes the Four Pillars, Day Master, and Five Elements of BaZi. The hardest part of creating the calculator was not the design of the chart, but rather making the calendar-dependent results understandable without obscuring the conventions used to generate them. The first step in building such a calculator is to define the calculation contract, which involves determining the inputs and outputs, as well as the calendar rules that apply.

The interface should be designed in a way that it is clear how the different assumptions lead to different results.

One important aspect of the calculator is input normalization, calendar conversion, pillar derivation, and presentation. These are distinct architectural boundaries that should be clearly defined, rather than being tied to a specific framework or library. It's crucial to keep the derived values traceable, so that the Day Master, which is associated with the heavenly stem of the day pillar, remains a consistent piece of state throughout the calculation.

When testing the calculator, it's important to go beyond ordinary dates and consider boundary cases, such as dates near calendar transitions, time boundaries, and input-validation limits. It's also helpful to record the assumptions behind each reference case, so that any disagreements between calculators can be easily identified.

BaZi Cue is a browser-accessible web calculator, and the focus of this write-up is on the calculation and presentation architecture rather than the specific implementation details. The key takeaway is the importance of separation of concerns, where the calculation rules should be inspectable independently of the UI choices. The author would appreciate feedback on the explanations, particularly from developers with experience in calendrical software.

They are also interested in knowing which boundary cases developers would test first and what would make a calculation rule sufficiently clear to reproduce.

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

A Simple Puzzle to learn Python Loops

problem : 1 Tenali Raman and the Palace Guards Tenali Raman wishes to meet the King. Before reaching the royal court, he has to pass through many palace gates. A guard is posted at each gate.

  • Tenali Raman starts with 1024 lashes
  • Each guard takes half of Raman's reward
  • Program tracks remaining lashes and guards

Building an Image-to-Pattern Editor Is Really a Grid Design Problem

I built MotifDraft to turn images into cross stitch, crochet, and bead charts. Users can edit colors and grids, then print a pattern. It starts free in the browser without an account.

  • MotifDraft converts images into patterns for crafts like cross stitch and crochet.
  • Core challenge lies in transforming images into editable grid format for physical projects.
  • Design focuses on structured data pattern, not just screenshot display.

Dynamics 365 Finance OData Returns Only One Company: How to Read Them All

A sales report built on Dynamics 365 finance and operations data can look complete and still be missing most of the business.

  • Dynamics 365 Finance OData returns data for default company only
  • Cross-company=true query option retrieves data from all accessible companies
  • PrimaryCompanyContext property assigns dataAreaId to each row for specific company

Building a Browser Arcade: Three Game Loops, One Entry Point

I’m Ludy, and I built LudyPlay , a free browser-game portal with open-answer trivia, a 15-minute survival run, and a coastal motorcycle race.

  • Each game requires unique rules, input handling, and lifecycle despite the unified entry point.
  • State boundaries are kept simple to enhance testing clarity and user experience feedback.

Saw a notice at work about an H-1B filing? What it is, and what it is not

Checked against official sources on November 12, 2026 You may see a new paper on a hallway board. Or a note on the company intranet. It talks about an H-1B filing, a wage, and a work location.

  • Notice appears at workplace before H-1B filing
  • Outlines job category, wage, dates, location
  • Provides contact for complaints about LCA compliance

More from Saturday 14 November →