SShortSingh.
Back to feed

Blood Type Compatibility Can Be Modeled With Simple Bitwise Operations

0
·1 views

A technical analysis published on DEV Community demonstrates that blood transfusion compatibility rules can be represented using 3-bit binary masks instead of complex conditional logic. Each of the eight primary blood types is assigned a unique integer from 0 to 7, with individual bits representing the presence or absence of A, B, and Rh antigens. A single bitwise operation — checking whether the donor's antigen mask contains any bits not present in the recipient's mask — determines compatibility in constant time. This approach mirrors the underlying biochemistry, where a recipient's immune system rejects any antigen it does not already carry. The compatibility relationships also form a directed graph, with O- as the universal donor at the base and AB+ as the universal recipient at the top.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Optimajet Workflow Engine 22.0 lets SaaS teams add tenants without restarting

Optimajet co-founder Mike Lukinov announced the release of Workflow Engine version 22.0.0 in July 2026, designed to eliminate production restarts when onboarding new customers on .NET SaaS platforms. The update introduces runtime tenant registration, allowing tenants to be added or removed while the host application continues running. The engine now supports full hybrid multi-tenancy, meaning workflow schemes, forms, parameters, and process records can each be either shared across all tenants or scoped to a specific one within a single installation. Previously, some production systems required a redeployment to onboard each new customer, disrupting active workflows for existing tenants during restart windows. The new architecture enforces tenant isolation at the engine and API level rather than relying on application-layer code discipline.

0
ProgrammingDEV Community ·

Wasp framework lets developers build custom file-based routers in under 50 lines

Wasp, a full-stack TypeScript web framework, has traditionally avoided file-based routing in favor of explicit, declarative app configuration. The framework recently updated its core spec file to a standard TypeScript Node.js program, replacing a static config with fully executable code. This change allows developers to use npm libraries, read from disk, and call APIs within their app spec. As a result, developers can now write a small function that scans their source folder and generates routing objects automatically, effectively building their own file-based router. Unlike frameworks such as Next.js where routing conventions are fixed, Wasp's approach lets teams design and customize their own routing logic from scratch.

0
ProgrammingDEV Community ·

AI Agents vs Automation: Key Differences and When to Use Each

Automation follows predefined rules and fixed steps, producing consistent outputs for structured, high-volume tasks, while AI agents use large language models to evaluate context, select actions, and adapt dynamically toward a goal. The choice between the two depends on factors such as task ambiguity, input structure, error frequency, cost, and required oversight. Most production systems fall on a spectrum ranging from traditional scripts to multi-agent setups, rather than fitting neatly into one category. Experts recommend using the least autonomous option capable of completing a task, as this keeps systems easier to test, cheaper to run, and safer to operate. In many enterprise environments, the optimal approach combines predictable automated steps, AI-driven decisions, and human approval for high-risk actions.

0
ProgrammingDEV Community ·

Developers Debate the One Non-Negotiable Security Check in CI/CD Pipelines

The developer community on DEV Community has sparked a discussion around mandatory security practices in CI/CD pipelines before deployment. The central question focuses on identifying a single, non-negotiable security check that teams should enforce at every deployment stage. Topics under discussion include vulnerability scanning, secrets detection, dependency audits, and code analysis as leading candidates. The conversation highlights growing awareness among developers about the importance of embedding security directly into automated deployment workflows. No consensus has been reached, reflecting the varied security priorities across different development teams and environments.

Blood Type Compatibility Can Be Modeled With Simple Bitwise Operations · ShortSingh