Interpreter:Represent a Grammar and Evaluate It
Model a tiny promo DSL as AND/OR of percent-off and sku-in-category expressions that evaluate(Order), and skip it when a few ifs or a real parser would be honest.
Read MoreBrowse the full archive. Use topics in the sidebar to explore by tag.
Model a tiny promo DSL as AND/OR of percent-off and sku-in-category expressions that evaluate(Order), and skip it when a few ifs or a real parser would be honest.
Read MoreRaft terms, leader election, and log replication at awareness depth — enough to know what etcd and Kafka-adjacent consensus are doing, not enough to ship your own cluster.
Read MoreAdd CSV export and tax walks to a stable Sku / Category tree with accept(Visitor) so each new report is a class, not another method on every catalog type.
Read MoreSlide a window hash in O(1), compare hashes first, then verify characters — the procedure for one needle or many needles against the same haystack.
Read MoreClone a configured DiscountPolicy, ChargeRequest, or gateway test double in Java instead of rebuilding constructor arguments — and skip clone() when new is cheaper or the copy shares mutable guts.
Read MoreA coordinator asks every participant to prepare, then commit or abort together — and why a crashed coordinator leaves the cluster stuck.
Read MoreUndo a checkout draft in Java by letting Order take an opaque snapshot — no public fields, no JSON dump, and no serializing OrderProcessor.
Read MoreStop DiscountPolicy, PaymentGateway, fraud, inventory, and the notifier from importing each other by letting CheckoutMediator own the checkout conversation.
Read MoreWait base × 2^attempt after a failure, cap the wait, and add jitter so retries do not stampede the same instant.
Read MoreShare immutable catalog SKU metadata across cart LineItems so a Black Friday order does not clone name, tax class, and image URL on every row.
Read More