Skip to content

Instantly share code, notes, and snippets.

View de-sh's full-sized avatar

Devdutt Shenoi de-sh

View GitHub Profile
@de-sh
de-sh / vd.rs
Created November 23, 2023 05:52
Vehicle Dynamics, a rust library
use std::{default, f64::consts::PI};
use rand::{thread_rng, Rng};
const BASE_RPM: f64 = 750.0;
const MAX_RPM: f64 = 5000.0;
const WHEEL_RADIUS: f64 = 0.4; // in m
const WHEEL_CIRCUMFERENCE: f64 = 2.0 * PI * WHEEL_RADIUS; // in m
#[derive(Debug, Default)]
@de-sh
de-sh / dataloss.md
Last active March 14, 2025 20:51
Data Loss Due to Scheduler Time Skew

Problem Statement

Parseable is experiencing data loss due to a time skew in local-sync. The scheduler operates on minute-based(eventually configurable) intervals and performs flush operations at the end of each interval. However, a timing discrepancy causes late-arriving data to be appended after EOF markers, rendering this data kinda invisible to readers.

Current System Behavior

The scheduler triggers a flush operation at the end of each minute interval

The flush operation:

  1. Writes all in-memory buffered data to disk
  2. Appends an EOF marker to signal completion
@de-sh
de-sh / public-transport.md
Last active August 11, 2025 19:01
A case for public transport

We are at a precipice when it comes to public infrastructure in India, the roads are crumbling, the trains aren't enough, yet everyone still wants more flyovers, more lanes and even tunnel roads. The problem is clearly not with the laws, we have the right policy structures in place, legal frameworks such as the DULT/BMLTA act of 2023 for Bengaluru, UMMTA for Mumbai, CUMTA for chennai and so many other organizations that are championing the cause of public transport, but the problem of bad incentives have driven people to choose private vehicles, leading to a call for better roads, which leads to constant wear and tear on the roads, which are built haphazardly to ensure timely and within cost construction, a ouroboros if you may...

In cities such as Kochi, where I come from, the menace of rashly driven private buses, which is still a form of public transport, has led t