<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Saurabh Sharma]]></title><description><![CDATA[Saurabh Sharma]]></description><link>https://saurabhsharmatools.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6b03cbbb2190a875b2aa07fb/e8d091a8-b7d5-4d58-b77d-0c1d7c976330.jpg</url><title>Saurabh Sharma</title><link>https://saurabhsharmatools.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 24 Nov 2026 13:02:20 GMT</lastBuildDate><atom:link href="https://saurabhsharmatools.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[What a 50-state look at dental implant costs and surgeon supply turned up]]></title><description><![CDATA[A 50-state look at dental implants cost burden and oral surgeon supply. Fifteen states face both problems. Data, method and limits explained.]]></description><link>https://saurabhsharmatools.hashnode.dev/what-a-50-state-look-at-dental-implant-costs-and-surgeon-supply-turned-up</link><guid isPermaLink="true">https://saurabhsharmatools.hashnode.dev/what-a-50-state-look-at-dental-implant-costs-and-surgeon-supply-turned-up</guid><category><![CDATA[data]]></category><category><![CDATA[healthcare]]></category><category><![CDATA[datascience]]></category><category><![CDATA[research]]></category><category><![CDATA[Open Source]]></category><dc:creator><![CDATA[Saurabh Sharma]]></dc:creator><pubDate>Mon, 23 Nov 2026 05:44:18 GMT</pubDate><content:encoded><![CDATA[<p>I run <a href="https://dentalimplantcalc.com">DentalImplantCalc</a>, a free estimator for US dental implant costs. After a while the same question kept nagging me. A price is only half of access. If a procedure costs a lot relative to what people earn, and there are also few specialists nearby, that's a different problem from either one alone.</p>
<p>So I put the two together for all 50 states and published the result as <a href="https://dentalimplantcalc.com/dental-implant-access-gap/">a data study</a>.</p>
<h2>What I measured</h2>
<p>Two things per state:</p>
<ul>
<li>A typical single implant cost as a share of median household income</li>
<li>Oral and maxillofacial surgeons per 100,000 residents Income comes from the Census Bureau's 2024 American Community Survey. Surgeon counts come from KFF, based on an American Dental Association data request at the end of 2025. Medicaid dental coverage comes from CareQuest Institute's rubric. The cost figure is my own model.</li>
</ul>
<h2>The headline numbers</h2>
<p>Nationally there are 7,482 oral surgeons, about 2.19 per 100,000 people. Median household income is $81,604, and a $4,259 single implant works out to 5.22% of it.</p>
<p>The spread underneath that is large:</p>
<ul>
<li>Surgeon supply runs from 3.25 per 100,000 in New Hampshire down to 1.19 in Wyoming, where that's seven surgeons in the whole state.</li>
<li>Implant burden runs from 7.20% of median income in Mississippi to 4.14% in Maryland.</li>
</ul>
<h2>The "double bind" states</h2>
<p>I split states at the median on both measures. Fifteen land on the bad side of each, with fewer surgeons and a higher cost burden: Mississippi, Louisiana, Arkansas, Kentucky, Oklahoma, Alabama, New Mexico, Missouri, Indiana, Ohio, South Carolina, Michigan, Montana, Kansas and Wyoming.</p>
<p>On average, that group has a median income of $68,950 and 1.69 surgeons per 100,000. The states that do better on both average $89,839 and 2.53.</p>
<p>Surgeon supply and income are fairly strongly correlated (r = +0.667 across the 50 states), which fits the pattern. Medicaid doesn't obviously fill the gap either. Eleven states plus DC had extensive adult dental benefits at the end of 2024, up from two in 2020, but the rubric's service categories don't include implants.</p>
<h2>What this doesn't show</h2>
<p>I'd rather you hear the weak spots from me:</p>
<ol>
<li>The cost axis is mostly income. Forty-five of the 50 states share one dollar figure, so the burden differences come from income, not from prices varying.</li>
<li>Medians hide the distribution within a state.</li>
<li>Small states have wide margins of error on income.</li>
<li>A surgeon count isn't access. It doesn't say who accepts your insurance or how far away they are.</li>
<li>This is correlation. It says nothing about cause. I also didn't build a composite index or state-specific prices. That would have meant weighting choices I couldn't justify, or numbers I'd have had to invent.</li>
</ol>
<p>The full dataset is a downloadable CSV on <a href="https://dentalimplantcalc.com/dental-implant-access-gap/">the study page</a>, if you want to check my work or run a different cut. If you do find something I got wrong, tell me.</p>
]]></content:encoded></item><item><title><![CDATA[Converting clock time to decimal hours without underpaying anyone]]></title><description><![CDATA[Why 7:30 is 7.5 and not 7.30. A plain guide to decimal hours, rounding, hourly-to-salary math and the overtime deduction.]]></description><link>https://saurabhsharmatools.hashnode.dev/converting-clock-time-to-decimal-hours-without-underpaying-anyone</link><guid isPermaLink="true">https://saurabhsharmatools.hashnode.dev/converting-clock-time-to-decimal-hours-without-underpaying-anyone</guid><category><![CDATA[finance]]></category><category><![CDATA[Payroll]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[webdev]]></category><category><![CDATA[tools]]></category><dc:creator><![CDATA[Saurabh Sharma]]></dc:creator><pubDate>Mon, 23 Nov 2026 05:38:49 GMT</pubDate><content:encoded><![CDATA[<p>Here's a mistake I see more than any other in timesheets. Someone works 7 hours and 30 minutes and it gets typed in as 7.30. That reads as 7.3 hours, which is 18 minutes short of the real 7.5. Do that every day for a week and you've quietly shorted a person by an hour and a half.</p>
<p>We run <a href="https://paytimehub.com">PayTimeHub</a>, a set of free US payroll and time calculators, and this conversion is the thing people come for most. So here's how it actually works.</p>
<h2>The only rule you need</h2>
<p>Clock time is base 60. Decimal hours are base 10. To convert, divide the minutes by 60.</p>
<ul>
<li>15 minutes = 0.25</li>
<li>30 minutes = 0.50</li>
<li>45 minutes = 0.75 Add that to the whole hours and you're done. A shift of 8:07 to 16:42 with a 30 minute lunch is 8 hours 5 minutes, or 8.08 hours.</li>
</ul>
<p>Notice that 20 minutes is 0.3333 and keeps going. That's why payroll systems round, usually to the nearest quarter hour or tenth of an hour. Employers in the US can round this way, but it generally can't favour the employer every time. Your state may have its own rules, so check them before you pick a convention.</p>
<h2>Hourly to salary is just multiplication</h2>
<p>Hourly rate x hours per week x weeks per year. At the default 40 hours and 52 weeks, $25 an hour comes to $52,000 a year. It's gross pay only, and it assumes you're paid for all 52 weeks. If you take unpaid time off, change the weeks.</p>
<h2>A quick look at the overtime deduction</h2>
<p>The newer federal rules gave overtime pay its own deduction, covering tax years 2025 through 2028. The part people miss is that only the "half" portion of time-and-a-half is eligible, not the full overtime wage, and there are income caps and a phase-out. It also only covers overtime the Fair Labor Standards Act requires, so some state rules, like California's daily overtime, may not qualify.</p>
<p>We built a calculator that estimates the federal tax saving, but treat it as an estimate. It's not tax advice and it won't replace your pay stub. The paycheck calculator also doesn't account for things like 401(k) contributions, health insurance premiums or every local tax jurisdiction.</p>
<h2>Why it runs in your browser</h2>
<p>Pay figures are personal. So the calculators run entirely client-side, and nothing you type is stored or sent anywhere. No account either.</p>
<p>If you'd rather not do the base-60 math at 4:55 on a Friday, the tools are at <a href="https://paytimehub.com">paytimehub.com</a>.</p>
]]></content:encoded></item><item><title><![CDATA[Hitting an exact GIF size limit with a binary search]]></title><description><![CDATA[Discord, Slack and WhatsApp cap GIF and sticker sizes. Here is how a binary search finds compression settings that fit, in the browser.]]></description><link>https://saurabhsharmatools.hashnode.dev/hitting-an-exact-gif-size-limit-with-a-binary-search</link><guid isPermaLink="true">https://saurabhsharmatools.hashnode.dev/hitting-an-exact-gif-size-limit-with-a-binary-search</guid><category><![CDATA[WebAssembly]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[webdev]]></category><category><![CDATA[performance]]></category><category><![CDATA[tooling]]></category><dc:creator><![CDATA[Saurabh Sharma]]></dc:creator><pubDate>Mon, 23 Nov 2026 05:36:15 GMT</pubDate><content:encoded><![CDATA[<p>If you've ever made a custom emoji, you know the loop. Export a GIF, upload it, get told it's over the limit, nudge a quality slider, export again, repeat. Half the time you overshoot and end up with something uglier than it needed to be.</p>
<p>That loop is a search problem, and search problems have better answers than "try it and see." I built <a href="https://compressgifs.com">CompressGIFs</a> around that idea: you give it a target size, and it finds settings that land under it.</p>
<h2>The limits people keep tripping on</h2>
<p>These are the numbers the site uses for its presets. Platforms change them, so check the current docs before relying on any of this.</p>
<table>
<thead>
<tr>
<th>Where</th>
<th>Limit</th>
</tr>
</thead>
<tbody><tr>
<td>Discord emoji</td>
<td>under 256 KB</td>
</tr>
<tr>
<td>Discord sticker</td>
<td>512 KB max, exactly 320 x 320, and it has to be APNG</td>
</tr>
<tr>
<td>Discord upload (no Nitro)</td>
<td>20 MB</td>
</tr>
<tr>
<td>Slack emoji</td>
<td>under 128 KB, square</td>
</tr>
<tr>
<td>WhatsApp sticker</td>
<td>exactly 512 x 512, under 500 KB, WebP only</td>
</tr>
<tr>
<td>X (Twitter) GIF</td>
<td>up to 15 MB, though large uploads can fail on mobile</td>
</tr>
</tbody></table>
<p>The Discord sticker one catches a lot of people. A GIF that's small enough still gets rejected because it isn't an APNG.</p>
<h2>Why a binary search fits</h2>
<p>Compression has a few knobs, and they don't cost the same in visual quality. Roughly, from cheapest to most painful:</p>
<ol>
<li>Lossy compression, which is often barely visible</li>
<li>Fewer colours in the palette</li>
<li>Smaller dimensions You want to spend the cheap knobs first and only touch the expensive one when you have to. For each knob, file size goes down as you turn it up, which is exactly the property a binary search needs. Here's the shape of it:</li>
</ol>
<pre><code class="language-js">async function fitUnderTarget(frames, targetBytes) {
  let lo = 0;      // least aggressive setting
  let hi = 100;    // most aggressive setting
  let best = null;
 
  while (lo &lt;= hi) {
    const mid = Math.floor((lo + hi) / 2);
    const result = await encode(frames, { lossy: mid });
 
    if (result.size &lt;= targetBytes) {
      best = result;   // fits, so try something gentler
      hi = mid - 1;
    } else {
      lo = mid + 1;    // too big, squeeze harder
    }
  }
  return best;         // null means this knob wasn't enough alone
}
</code></pre>
<p>If one knob can't get you there, move to the next one and search again. That's a handful of encodes instead of twenty guesses. The encoding happens in the browser with WebAssembly, so it stays responsive and nothing gets uploaded anywhere.</p>
<h2>Where it runs out of road</h2>
<p>Be honest with yourself about physics. GIF tops out at 256 colours, and a long, detailed, full-colour clip squeezed into 128 KB will look rough however clever the search is. The tool says as much. Some files just can't shrink much further without visible loss.</p>
<p>Because everything runs locally, there's also no upload step and no server-side size cap, which matters when the thing you're compressing is a private screen recording.</p>
<p>If you're tired of the export-upload-fail loop, <a href="https://compressgifs.com">CompressGIFs</a> is free and has presets for the limits above.</p>
]]></content:encoded></item><item><title><![CDATA[Cropping passport photos in the browser with canvas, no upload needed]]></title><description><![CDATA[How a passport photo cropper works with HTML canvas: the mm to pixel math, country guides, and why your photo never needs uploading.]]></description><link>https://saurabhsharmatools.hashnode.dev/cropping-passport-photos-in-the-browser-with-canvas-no-upload-needed</link><guid isPermaLink="true">https://saurabhsharmatools.hashnode.dev/cropping-passport-photos-in-the-browser-with-canvas-no-upload-needed</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[webdev]]></category><category><![CDATA[canvas]]></category><category><![CDATA[privacy]]></category><category><![CDATA[HTML]]></category><dc:creator><![CDATA[Saurabh Sharma]]></dc:creator><pubDate>Mon, 23 Nov 2026 05:33:39 GMT</pubDate><content:encoded><![CDATA[<p>Most passport photo sites want you to upload your face first. Some keep it. Some stamp a watermark on the result. Almost all of them make you wait for a round trip to a server to do something your browser can do in a few milliseconds.</p>
<p>I wanted to see how little it takes to do the whole job on the user's device, so I built <a href="https://passportcrop.com">PassportCrop</a>. Here's the interesting part, which is less code than you'd guess.</p>
<h2>Millimetres in, pixels out</h2>
<p>Every country defines its photo size in millimetres. Canvas works in pixels. So the first job is a conversion, and you have to pick a resolution to print at. 300 dpi is the usual choice.</p>
<p>At 300 dpi:</p>
<ul>
<li>35 x 45 mm (UK, India, much of Europe) is about 413 x 531 px</li>
<li>51 x 51 mm (the US 2 x 2 inch photo) is about 602 x 602 px The crop itself is one <code>drawImage</code> call that reads a rectangle from the source photo and scales it into the output canvas:</li>
</ul>
<pre><code class="language-js">const MM_TO_PX = 300 / 25.4;
 
function cropToSpec(img, crop, widthMm, heightMm) {
  const out = document.createElement("canvas");
  out.width = Math.round(widthMm * MM_TO_PX);
  out.height = Math.round(heightMm * MM_TO_PX);
 
  const ctx = out.getContext("2d");
  // crop is { x, y, w, h } in source-image pixels
  ctx.drawImage(img, crop.x, crop.y, crop.w, crop.h, 0, 0, out.width, out.height);
 
  return new Promise((resolve) =&gt; out.toBlob(resolve, "image/jpeg", 0.95));
}
</code></pre>
<p>That's a simplified version of the idea, not a copy of the production code, but it's the skeleton. Everything else is UI: letting someone drag and zoom until their face sits correctly inside the guide.</p>
<h2>The guide matters more than the crop</h2>
<p>The hard part isn't resizing. It's that each country publishes its own head-height range, and a photo with the wrong proportions gets rejected no matter how sharp it is. So the overlay on screen shows the rule for whichever country you picked. PassportCrop covers 32 countries (the Schengen area counts as one entry), plus things like OCI cards, PAN and Aadhaar photos.</p>
<p>I'd tell anyone building something similar to test with photos straight off a phone, not screenshots or stock images. Real photos expose the problems.</p>
<h2>Proving nothing leaves the browser</h2>
<p>"We don't upload your photo" is easy to write on a page and hard for anyone to check. With canvas it's checkable. Open your browser's network tab, load a photo, crop it, and look for any request carrying image data. There isn't one. The tool also keeps working if you go offline after the page has loaded, which is a decent sign that no server is involved.</p>
<h2>What I left out on purpose</h2>
<p>There's an optional background swap to a flat colour, since many offices want a plain backdrop. There's no skin smoothing, no blemish removal and no "AI enhancement". Plenty of passport authorities reject edited photos, and a tool that quietly retouches your face could get your application bounced.</p>
<p>There's also a print option that lays several copies on a 4 x 6 inch sheet, so you can take one file to a photo counter.</p>
<p>If you need a passport or ID photo, it's free at <a href="https://passportcrop.com">passportcrop.com</a>, with no account and no watermark. If you build something like it, I'd be curious which canvas gotchas you hit.</p>
]]></content:encoded></item></channel></rss>