<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Serguey Asael Shinder</title>
    <description>The latest articles on DEV Community by Serguey Asael Shinder (@sergueyasaelshinder).</description>
    <link>https://dev.to/sergueyasaelshinder</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3162425%2F9aec4162-92b2-44e6-aa10-8ffd5d721296.png</url>
      <title>DEV Community: Serguey Asael Shinder</title>
      <link>https://dev.to/sergueyasaelshinder</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sergueyasaelshinder"/>
    <language>en</language>
    <item>
      <title>Your Watchdog Stops Stuck Threads With Thread.stop and Java 21 Throws Instead</title>
      <dc:creator>Serguey Asael Shinder</dc:creator>
      <pubDate>Thu, 26 Nov 2026 07:05:12 +0000</pubDate>
      <link>https://dev.to/sergueyasaelshinder/your-watchdog-stops-stuck-threads-with-threadstop-and-java-21-throws-instead-4lf6</link>
      <guid>https://dev.to/sergueyasaelshinder/your-watchdog-stops-stuck-threads-with-threadstop-and-java-21-throws-instead-4lf6</guid>
      <description>&lt;p&gt;The report server&lt;br&gt;
has a watchdog.&lt;/p&gt;

&lt;p&gt;Every minute&lt;br&gt;
it looks for report threads&lt;br&gt;
that have run too long,&lt;br&gt;
and kills them.&lt;/p&gt;

&lt;p&gt;if (elapsed &amp;gt; limit) {&lt;br&gt;
    worker.stop();&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Some reports&lt;br&gt;
hang on a bad query.&lt;/p&gt;

&lt;p&gt;Some loop forever&lt;br&gt;
on bad data.&lt;/p&gt;

&lt;p&gt;The watchdog&lt;br&gt;
has kept the server alive&lt;br&gt;
since 2014.&lt;/p&gt;

&lt;p&gt;Then the upgrade.&lt;/p&gt;

&lt;p&gt;Java 17&lt;br&gt;
to Java 21.&lt;/p&gt;

&lt;p&gt;Tests green.&lt;/p&gt;

&lt;p&gt;The first stuck report&lt;br&gt;
did not die.&lt;/p&gt;

&lt;p&gt;The watchdog&lt;br&gt;
threw instead:&lt;/p&gt;

&lt;p&gt;java.lang.UnsupportedOperationException&lt;/p&gt;

&lt;p&gt;The exception&lt;br&gt;
was logged&lt;br&gt;
inside the watchdog's own loop,&lt;br&gt;
once a minute,&lt;br&gt;
and the stuck thread&lt;br&gt;
kept its connection&lt;br&gt;
and its memory.&lt;/p&gt;

&lt;p&gt;By the afternoon&lt;br&gt;
there were thirty of them.&lt;/p&gt;

&lt;p&gt;Here is what changed.&lt;/p&gt;

&lt;p&gt;Thread.stop&lt;br&gt;
was deprecated&lt;br&gt;
in Java 1.2,&lt;br&gt;
in 1998.&lt;/p&gt;

&lt;p&gt;It was never safe.&lt;/p&gt;

&lt;p&gt;It throws ThreadDeath&lt;br&gt;
wherever the thread happens to be,&lt;br&gt;
and releases every lock&lt;br&gt;
it holds,&lt;br&gt;
mid-update.&lt;/p&gt;

&lt;p&gt;Java 18 marked it&lt;br&gt;
for removal.&lt;/p&gt;

&lt;p&gt;Java 20&lt;br&gt;
turned it into a method&lt;br&gt;
that only throws.&lt;/p&gt;

&lt;p&gt;It still compiles,&lt;br&gt;
with a warning&lt;br&gt;
nobody reads.&lt;/p&gt;

&lt;p&gt;It still links.&lt;/p&gt;

&lt;p&gt;It just&lt;br&gt;
does nothing useful,&lt;br&gt;
loudly.&lt;/p&gt;

&lt;p&gt;The tests passed&lt;br&gt;
because nothing in them&lt;br&gt;
ever got stuck.&lt;/p&gt;

&lt;p&gt;Here is what to do.&lt;/p&gt;

&lt;p&gt;Find every call first.&lt;/p&gt;

&lt;p&gt;The JDK ships a tool for it:&lt;/p&gt;

&lt;p&gt;jdeprscan --for-removal --release 21 app.jar&lt;/p&gt;

&lt;p&gt;Then replace force&lt;br&gt;
with interruption.&lt;/p&gt;

&lt;p&gt;future.cancel(true)&lt;/p&gt;

&lt;p&gt;interrupts the thread.&lt;/p&gt;

&lt;p&gt;Blocking calls&lt;br&gt;
throw InterruptedException.&lt;/p&gt;

&lt;p&gt;Long loops&lt;br&gt;
must check&lt;br&gt;
Thread.currentThread().isInterrupted()&lt;br&gt;
and leave.&lt;/p&gt;

&lt;p&gt;Give the query&lt;br&gt;
its own timeout&lt;br&gt;
on the statement,&lt;br&gt;
so the database ends it&lt;br&gt;
instead of you.&lt;/p&gt;

&lt;p&gt;For code you cannot change,&lt;br&gt;
a library that loops&lt;br&gt;
and never checks,&lt;br&gt;
run it in a separate process&lt;br&gt;
with a deadline,&lt;br&gt;
and destroy the process.&lt;/p&gt;

&lt;p&gt;Processes can be killed.&lt;/p&gt;

&lt;p&gt;The operating system&lt;br&gt;
takes back&lt;br&gt;
the memory,&lt;br&gt;
the connections&lt;br&gt;
and the locks.&lt;/p&gt;

&lt;p&gt;Threads, in Java,&lt;br&gt;
no longer can be.&lt;/p&gt;

&lt;p&gt;A method that only throws&lt;br&gt;
looks like a feature&lt;br&gt;
right up until&lt;br&gt;
the day you need it.&lt;/p&gt;

&lt;p&gt;Search for the ones&lt;br&gt;
your emergencies depend on&lt;br&gt;
before you upgrade.&lt;/p&gt;

&lt;p&gt;– Serguey Asael Shinder&lt;/p&gt;

</description>
      <category>sergueyasaelshinder</category>
      <category>java</category>
      <category>programming</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>You Pasted the Error Into the Team Channel and the Clipboard Still Held the Password</title>
      <dc:creator>Serguey Asael Shinder</dc:creator>
      <pubDate>Thu, 26 Nov 2026 07:04:41 +0000</pubDate>
      <link>https://dev.to/sergueyasaelshinder/you-pasted-the-error-into-the-team-channel-and-the-clipboard-still-held-the-password-i5c</link>
      <guid>https://dev.to/sergueyasaelshinder/you-pasted-the-error-into-the-team-channel-and-the-clipboard-still-held-the-password-i5c</guid>
      <description>&lt;p&gt;The deploy failed.&lt;/p&gt;

&lt;p&gt;You copied the error,&lt;br&gt;
switched to the team channel,&lt;br&gt;
typed "anyone seen this?"&lt;br&gt;
and pasted.&lt;/p&gt;

&lt;p&gt;What appeared&lt;br&gt;
was not the error.&lt;/p&gt;

&lt;p&gt;It was the database password.&lt;/p&gt;

&lt;p&gt;You had copied it&lt;br&gt;
from the password manager&lt;br&gt;
ninety seconds earlier,&lt;br&gt;
to log in&lt;br&gt;
and check the migration.&lt;/p&gt;

&lt;p&gt;Then you selected the error.&lt;/p&gt;

&lt;p&gt;Then someone&lt;br&gt;
asked you a question.&lt;/p&gt;

&lt;p&gt;Then you switched windows.&lt;/p&gt;

&lt;p&gt;The copy&lt;br&gt;
never happened.&lt;/p&gt;

&lt;p&gt;You deleted the message&lt;br&gt;
in eleven seconds.&lt;/p&gt;

&lt;p&gt;Here is the mechanism.&lt;/p&gt;

&lt;p&gt;The clipboard&lt;br&gt;
is state&lt;br&gt;
you cannot see.&lt;/p&gt;

&lt;p&gt;Nothing on the screen&lt;br&gt;
shows what it holds.&lt;/p&gt;

&lt;p&gt;So you do not&lt;br&gt;
check it.&lt;/p&gt;

&lt;p&gt;You remember it.&lt;/p&gt;

&lt;p&gt;And what you remember&lt;br&gt;
is your intention.&lt;/p&gt;

&lt;p&gt;You meant to copy the error.&lt;/p&gt;

&lt;p&gt;You selected the error.&lt;/p&gt;

&lt;p&gt;You are sure you copied the error.&lt;/p&gt;

&lt;p&gt;Memory files&lt;br&gt;
the plan as done.&lt;/p&gt;

&lt;p&gt;A single interruption&lt;br&gt;
between select and copy&lt;br&gt;
is all it takes.&lt;/p&gt;

&lt;p&gt;Paste&lt;br&gt;
does not do&lt;br&gt;
what you think it holds.&lt;/p&gt;

&lt;p&gt;It does&lt;br&gt;
what is actually there.&lt;/p&gt;

&lt;p&gt;Then the second mechanism.&lt;/p&gt;

&lt;p&gt;Delete&lt;br&gt;
is not unsend.&lt;/p&gt;

&lt;p&gt;The message was gone&lt;br&gt;
from the channel.&lt;/p&gt;

&lt;p&gt;It was not gone&lt;br&gt;
from forty phones&lt;br&gt;
that had already shown&lt;br&gt;
the preview.&lt;/p&gt;

&lt;p&gt;Or the email digest.&lt;/p&gt;

&lt;p&gt;Or the bot&lt;br&gt;
that archives the channel&lt;br&gt;
for compliance.&lt;/p&gt;

&lt;p&gt;Eleven seconds&lt;br&gt;
was not fast.&lt;/p&gt;

&lt;p&gt;It was already too late.&lt;/p&gt;

&lt;p&gt;Here is what to do.&lt;/p&gt;

&lt;p&gt;Make the clipboard&lt;br&gt;
forget secrets.&lt;/p&gt;

&lt;p&gt;Most password managers&lt;br&gt;
can clear it&lt;br&gt;
after a few seconds.&lt;/p&gt;

&lt;p&gt;Turn that on.&lt;/p&gt;

&lt;p&gt;Better still,&lt;br&gt;
let them type the password&lt;br&gt;
for you,&lt;br&gt;
so it never touches&lt;br&gt;
the clipboard at all.&lt;/p&gt;

&lt;p&gt;Before you paste&lt;br&gt;
into anything shared,&lt;br&gt;
paste into an empty editor&lt;br&gt;
first.&lt;/p&gt;

&lt;p&gt;One second.&lt;/p&gt;

&lt;p&gt;You see&lt;br&gt;
what you are about to send,&lt;br&gt;
while it is still&lt;br&gt;
only yours.&lt;/p&gt;

&lt;p&gt;And when a secret&lt;br&gt;
does reach a channel,&lt;br&gt;
do not count the seconds.&lt;/p&gt;

&lt;p&gt;Rotate it.&lt;/p&gt;

&lt;p&gt;Now,&lt;br&gt;
then tell the channel&lt;br&gt;
you did.&lt;/p&gt;

&lt;p&gt;You trust the clipboard&lt;br&gt;
because you remember&lt;br&gt;
filling it.&lt;/p&gt;

&lt;p&gt;You remember&lt;br&gt;
what you meant to do.&lt;/p&gt;

&lt;p&gt;– Serguey Asael Shinder&lt;/p&gt;

</description>
      <category>sergueyasaelshinder</category>
      <category>productivity</category>
      <category>security</category>
      <category>devops</category>
    </item>
    <item>
      <title>You Ranked Next Year's Risks and the Top Three Were Whatever Broke This Year</title>
      <dc:creator>Serguey Asael Shinder</dc:creator>
      <pubDate>Thu, 26 Nov 2026 07:04:09 +0000</pubDate>
      <link>https://dev.to/sergueyasaelshinder/you-ranked-next-years-risks-and-the-top-three-were-whatever-broke-this-year-22ol</link>
      <guid>https://dev.to/sergueyasaelshinder/you-ranked-next-years-risks-and-the-top-three-were-whatever-broke-this-year-22ol</guid>
      <description>&lt;p&gt;The planning meeting&lt;br&gt;
had one job.&lt;/p&gt;

&lt;p&gt;List the risks&lt;br&gt;
for next year.&lt;/p&gt;

&lt;p&gt;Rank them.&lt;/p&gt;

&lt;p&gt;Fund the top three.&lt;/p&gt;

&lt;p&gt;Number one:&lt;br&gt;
the certificate&lt;br&gt;
that expired in March.&lt;/p&gt;

&lt;p&gt;Number two:&lt;br&gt;
the disk&lt;br&gt;
that filled up in June.&lt;/p&gt;

&lt;p&gt;Number three:&lt;br&gt;
the deploy&lt;br&gt;
that took the site down&lt;br&gt;
the week before.&lt;/p&gt;

&lt;p&gt;Everyone agreed.&lt;/p&gt;

&lt;p&gt;Everyone remembered.&lt;/p&gt;

&lt;p&gt;That was the problem.&lt;/p&gt;

&lt;p&gt;Nobody had opened&lt;br&gt;
the incident log.&lt;/p&gt;

&lt;p&gt;It had forty two entries.&lt;/p&gt;

&lt;p&gt;Eleven of them&lt;br&gt;
were the same slow leak&lt;br&gt;
in the queue consumers.&lt;/p&gt;

&lt;p&gt;Never dramatic.&lt;/p&gt;

&lt;p&gt;Never on a Friday night.&lt;/p&gt;

&lt;p&gt;Never in the list.&lt;/p&gt;

&lt;p&gt;Here is the mechanism.&lt;/p&gt;

&lt;p&gt;When you judge&lt;br&gt;
how often something happens,&lt;br&gt;
you do not count.&lt;/p&gt;

&lt;p&gt;You check&lt;br&gt;
how easily examples&lt;br&gt;
come to mind.&lt;/p&gt;

&lt;p&gt;Tversky and Kahneman&lt;br&gt;
called it&lt;br&gt;
the availability heuristic,&lt;br&gt;
in 1973.&lt;/p&gt;

&lt;p&gt;They asked people&lt;br&gt;
whether K&lt;br&gt;
is more often&lt;br&gt;
the first letter of a word&lt;br&gt;
or the third.&lt;/p&gt;

&lt;p&gt;Most said first.&lt;/p&gt;

&lt;p&gt;Words that start with K&lt;br&gt;
are easy to call up.&lt;/p&gt;

&lt;p&gt;Words with K third&lt;br&gt;
are not.&lt;/p&gt;

&lt;p&gt;In typical English text,&lt;br&gt;
K turns up&lt;br&gt;
in third position&lt;br&gt;
about twice as often.&lt;/p&gt;

&lt;p&gt;Your memory&lt;br&gt;
answers a different question&lt;br&gt;
from the one you asked.&lt;/p&gt;

&lt;p&gt;Not "how often?"&lt;/p&gt;

&lt;p&gt;"How easily&lt;br&gt;
can I picture it?"&lt;/p&gt;

&lt;p&gt;Recent is easy.&lt;/p&gt;

&lt;p&gt;Painful is easy.&lt;/p&gt;

&lt;p&gt;Your own pager&lt;br&gt;
at three in the morning&lt;br&gt;
is very easy.&lt;/p&gt;

&lt;p&gt;The quiet failure&lt;br&gt;
someone else fixed&lt;br&gt;
on a Tuesday&lt;br&gt;
is almost impossible.&lt;/p&gt;

&lt;p&gt;So the ranking&lt;br&gt;
was not a list of risks.&lt;/p&gt;

&lt;p&gt;It was a list&lt;br&gt;
of memories.&lt;/p&gt;

&lt;p&gt;Here is what to do.&lt;/p&gt;

&lt;p&gt;Count first,&lt;br&gt;
then talk.&lt;/p&gt;

&lt;p&gt;Bring the incident log,&lt;br&gt;
grouped by cause,&lt;br&gt;
with hours lost,&lt;br&gt;
not just count.&lt;/p&gt;

&lt;p&gt;Ask what happened&lt;br&gt;
that nobody here&lt;br&gt;
was paged for.&lt;/p&gt;

&lt;p&gt;Ask the support team.&lt;/p&gt;

&lt;p&gt;They remember&lt;br&gt;
a different year.&lt;/p&gt;

&lt;p&gt;And for every vivid item&lt;br&gt;
on the list,&lt;br&gt;
ask:&lt;/p&gt;

&lt;p&gt;"How many times&lt;br&gt;
did this actually happen?"&lt;/p&gt;

&lt;p&gt;Sometimes the answer&lt;br&gt;
is once.&lt;/p&gt;

&lt;p&gt;Sometimes it belongs at the top.&lt;/p&gt;

&lt;p&gt;Now you know&lt;br&gt;
which.&lt;/p&gt;

&lt;p&gt;What you remember best&lt;br&gt;
is what hurt you most recently.&lt;/p&gt;

&lt;p&gt;What costs you most&lt;br&gt;
is often what never hurt&lt;br&gt;
enough to remember.&lt;/p&gt;

&lt;p&gt;– Serguey Asael Shinder&lt;/p&gt;

</description>
      <category>sergueyasaelshinder</category>
      <category>career</category>
      <category>productivity</category>
      <category>psychology</category>
    </item>
    <item>
      <title>Your Bass Amp Sent the Desk Its Post EQ Signal and Every Knob You Turned on Stage Reached the Back of the Room</title>
      <dc:creator>Serguey Asael Shinder</dc:creator>
      <pubDate>Thu, 26 Nov 2026 07:03:38 +0000</pubDate>
      <link>https://dev.to/sergueyasaelshinder/your-bass-amp-sent-the-desk-its-post-eq-signal-and-every-knob-you-turned-on-stage-reached-the-back-2j79</link>
      <guid>https://dev.to/sergueyasaelshinder/your-bass-amp-sent-the-desk-its-post-eq-signal-and-every-knob-you-turned-on-stage-reached-the-back-2j79</guid>
      <description>&lt;p&gt;Soundcheck&lt;br&gt;
went well.&lt;/p&gt;

&lt;p&gt;The engineer&lt;br&gt;
took the DI&lt;br&gt;
from the back of your amp,&lt;br&gt;
set the channel,&lt;br&gt;
and the bass&lt;br&gt;
sat under the band&lt;br&gt;
like a floor.&lt;/p&gt;

&lt;p&gt;Second song,&lt;br&gt;
you felt thin.&lt;/p&gt;

&lt;p&gt;On your side of the stage&lt;br&gt;
the low end&lt;br&gt;
had gone somewhere.&lt;/p&gt;

&lt;p&gt;So you turned up&lt;br&gt;
the bass knob.&lt;/p&gt;

&lt;p&gt;A bit more.&lt;/p&gt;

&lt;p&gt;Out front&lt;br&gt;
the bass&lt;br&gt;
turned into a boom.&lt;/p&gt;

&lt;p&gt;The engineer&lt;br&gt;
cut it at the desk.&lt;/p&gt;

&lt;p&gt;You still felt thin,&lt;br&gt;
so you turned up&lt;br&gt;
again.&lt;/p&gt;

&lt;p&gt;Two people&lt;br&gt;
fixing the same sound&lt;br&gt;
in opposite directions,&lt;br&gt;
all night.&lt;/p&gt;

&lt;p&gt;Here is the mechanism.&lt;/p&gt;

&lt;p&gt;Most bass amps&lt;br&gt;
with a DI out&lt;br&gt;
have a small switch&lt;br&gt;
next to it.&lt;/p&gt;

&lt;p&gt;Pre.&lt;/p&gt;

&lt;p&gt;Post.&lt;/p&gt;

&lt;p&gt;Pre sends the desk&lt;br&gt;
your bass&lt;br&gt;
before the amp's EQ.&lt;/p&gt;

&lt;p&gt;Post sends it&lt;br&gt;
after.&lt;/p&gt;

&lt;p&gt;Yours was on post.&lt;/p&gt;

&lt;p&gt;So every knob&lt;br&gt;
you turned&lt;br&gt;
for your own ears&lt;br&gt;
went straight&lt;br&gt;
into the PA.&lt;/p&gt;

&lt;p&gt;And your ears&lt;br&gt;
were the wrong judge.&lt;/p&gt;

&lt;p&gt;On many stages&lt;br&gt;
the bass you hear&lt;br&gt;
standing next to the cab&lt;br&gt;
is nothing like&lt;br&gt;
the bass in the room.&lt;/p&gt;

&lt;p&gt;Low notes&lt;br&gt;
build up in some places&lt;br&gt;
and cancel in others.&lt;/p&gt;

&lt;p&gt;You were standing&lt;br&gt;
in a hole,&lt;br&gt;
and you fixed the hole&lt;br&gt;
for three hundred people&lt;br&gt;
who were not in it.&lt;/p&gt;

&lt;p&gt;The engineer&lt;br&gt;
could not see your knobs.&lt;/p&gt;

&lt;p&gt;You could not hear&lt;br&gt;
the room.&lt;/p&gt;

&lt;p&gt;Neither of you&lt;br&gt;
knew the other&lt;br&gt;
was moving.&lt;/p&gt;

&lt;p&gt;Here is what to do.&lt;/p&gt;

&lt;p&gt;Ask the engineer&lt;br&gt;
which they want,&lt;br&gt;
and set the switch&lt;br&gt;
before soundcheck,&lt;br&gt;
not after.&lt;/p&gt;

&lt;p&gt;Many prefer pre,&lt;br&gt;
so your stage sound&lt;br&gt;
is yours&lt;br&gt;
and the house sound&lt;br&gt;
is theirs.&lt;/p&gt;

&lt;p&gt;If it has to be post,&lt;br&gt;
treat the EQ&lt;br&gt;
as locked&lt;br&gt;
once soundcheck ends.&lt;/p&gt;

&lt;p&gt;If you feel thin,&lt;br&gt;
say so.&lt;/p&gt;

&lt;p&gt;Ask for more bass&lt;br&gt;
in your monitor,&lt;br&gt;
not more bass&lt;br&gt;
in the amp.&lt;/p&gt;

&lt;p&gt;And walk out front&lt;br&gt;
during soundcheck,&lt;br&gt;
or ask someone to,&lt;br&gt;
once.&lt;/p&gt;

&lt;p&gt;You will hear&lt;br&gt;
what your knobs&lt;br&gt;
are really doing.&lt;/p&gt;

&lt;p&gt;The knob is on your amp.&lt;/p&gt;

&lt;p&gt;The sound it changes&lt;br&gt;
might be everyone's.&lt;/p&gt;

&lt;p&gt;– Serguey Asael Shinder&lt;/p&gt;

</description>
      <category>sergueyasaelshinder</category>
      <category>music</category>
      <category>bass</category>
      <category>livesound</category>
    </item>
    <item>
      <title>You Served the Model Without Calling eval and the Same Photo Got a Different Score Every Time</title>
      <dc:creator>Serguey Asael Shinder</dc:creator>
      <pubDate>Thu, 26 Nov 2026 07:03:06 +0000</pubDate>
      <link>https://dev.to/sergueyasaelshinder/you-served-the-model-without-calling-eval-and-the-same-photo-got-a-different-score-every-time-h48</link>
      <guid>https://dev.to/sergueyasaelshinder/you-served-the-model-without-calling-eval-and-the-same-photo-got-a-different-score-every-time-h48</guid>
      <description>&lt;p&gt;The damage classifier&lt;br&gt;
scored ninety four percent&lt;br&gt;
in the notebook.&lt;/p&gt;

&lt;p&gt;So you wrote&lt;br&gt;
the serving script.&lt;/p&gt;

&lt;p&gt;model = DamageNet()&lt;br&gt;
model.load_state_dict(torch.load("best.pt"))&lt;/p&gt;

&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/torch"&gt;@torch&lt;/a&gt;.no_grad()&lt;br&gt;
def score(image):&lt;br&gt;
    return model(prepare(image).unsqueeze(0))&lt;/p&gt;

&lt;p&gt;A returns clerk&lt;br&gt;
uploaded the same photo&lt;br&gt;
twice.&lt;/p&gt;

&lt;p&gt;0.81.&lt;/p&gt;

&lt;p&gt;Then 0.62.&lt;/p&gt;

&lt;p&gt;Same pixels.&lt;/p&gt;

&lt;p&gt;Different answer.&lt;/p&gt;

&lt;p&gt;And over the week&lt;br&gt;
every score&lt;br&gt;
drifted a little lower.&lt;/p&gt;

&lt;p&gt;Here is the mechanism.&lt;/p&gt;

&lt;p&gt;A PyTorch model&lt;br&gt;
has two modes.&lt;/p&gt;

&lt;p&gt;Training.&lt;/p&gt;

&lt;p&gt;And evaluation.&lt;/p&gt;

&lt;p&gt;A new model&lt;br&gt;
starts in training mode.&lt;/p&gt;

&lt;p&gt;Loading the weights&lt;br&gt;
does not change that.&lt;/p&gt;

&lt;p&gt;torch.no_grad&lt;br&gt;
does not change that.&lt;/p&gt;

&lt;p&gt;It only stops&lt;br&gt;
gradients being recorded.&lt;/p&gt;

&lt;p&gt;In the notebook&lt;br&gt;
the evaluate helper&lt;br&gt;
called model.eval()&lt;br&gt;
first.&lt;/p&gt;

&lt;p&gt;You copied the model.&lt;/p&gt;

&lt;p&gt;Not the helper.&lt;/p&gt;

&lt;p&gt;The one line&lt;br&gt;
that mattered&lt;br&gt;
lived in a function&lt;br&gt;
nobody thought of&lt;br&gt;
as part of the model.&lt;/p&gt;

&lt;p&gt;So in production&lt;br&gt;
two layers&lt;br&gt;
were still training.&lt;/p&gt;

&lt;p&gt;Dropout&lt;br&gt;
was switching off&lt;br&gt;
a random part of the network&lt;br&gt;
on every request.&lt;/p&gt;

&lt;p&gt;That is the 0.81&lt;br&gt;
and the 0.62.&lt;/p&gt;

&lt;p&gt;BatchNorm&lt;br&gt;
was normalising each image&lt;br&gt;
with that one image's statistics,&lt;br&gt;
not the ones it learned.&lt;/p&gt;

&lt;p&gt;And in training mode&lt;br&gt;
it updates&lt;br&gt;
its running averages&lt;br&gt;
on every forward pass,&lt;br&gt;
gradients or not.&lt;/p&gt;

&lt;p&gt;Every photo the clerks uploaded&lt;br&gt;
was quietly rewriting&lt;br&gt;
what the model thought&lt;br&gt;
a normal photo looked like.&lt;/p&gt;

&lt;p&gt;That is the drift.&lt;/p&gt;

&lt;p&gt;The ninety four percent&lt;br&gt;
was real.&lt;/p&gt;

&lt;p&gt;It was measured&lt;br&gt;
in the right mode.&lt;/p&gt;

&lt;p&gt;It just measured&lt;br&gt;
a model&lt;br&gt;
you never deployed.&lt;/p&gt;

&lt;p&gt;No error.&lt;/p&gt;

&lt;p&gt;No warning.&lt;/p&gt;

&lt;p&gt;Plausible numbers,&lt;br&gt;
every time.&lt;/p&gt;

&lt;p&gt;Here is the fix.&lt;/p&gt;

&lt;p&gt;model.load_state_dict(torch.load("best.pt"))&lt;br&gt;
model.eval()&lt;/p&gt;

&lt;p&gt;One line,&lt;br&gt;
straight after loading.&lt;/p&gt;

&lt;p&gt;Then make it&lt;br&gt;
impossible to forget.&lt;/p&gt;

&lt;p&gt;Put loading and eval&lt;br&gt;
in one function,&lt;br&gt;
and use it&lt;br&gt;
in the notebook,&lt;br&gt;
the tests&lt;br&gt;
and the server.&lt;/p&gt;

&lt;p&gt;assert not model.training&lt;/p&gt;

&lt;p&gt;at startup.&lt;/p&gt;

&lt;p&gt;And one test&lt;br&gt;
that scores the same input&lt;br&gt;
twice&lt;br&gt;
and expects&lt;br&gt;
the same number.&lt;/p&gt;

&lt;p&gt;Then one more,&lt;br&gt;
that scores it&lt;br&gt;
alone&lt;br&gt;
and inside a batch of strangers,&lt;br&gt;
and expects&lt;br&gt;
the same number again.&lt;/p&gt;

&lt;p&gt;A model that disagrees&lt;br&gt;
with itself&lt;br&gt;
is not uncertain.&lt;/p&gt;

&lt;p&gt;It is still training.&lt;/p&gt;

&lt;p&gt;On your customers.&lt;/p&gt;

&lt;p&gt;– Serguey Asael Shinder&lt;/p&gt;

</description>
      <category>sergueyasaelshinder</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>pytorch</category>
    </item>
    <item>
      <title>You Let Each Branch Edit Its Own Email Template and str.format Printed the Server's Environment</title>
      <dc:creator>Serguey Asael Shinder</dc:creator>
      <pubDate>Thu, 26 Nov 2026 07:02:35 +0000</pubDate>
      <link>https://dev.to/sergueyasaelshinder/you-let-each-branch-edit-its-own-email-template-and-strformat-printed-the-servers-environment-17n4</link>
      <guid>https://dev.to/sergueyasaelshinder/you-let-each-branch-edit-its-own-email-template-and-strformat-printed-the-servers-environment-17n4</guid>
      <description>&lt;p&gt;Every branch&lt;br&gt;
wanted its own wording&lt;br&gt;
on the "order ready" email.&lt;/p&gt;

&lt;p&gt;Fair enough.&lt;/p&gt;

&lt;p&gt;So the admin screen&lt;br&gt;
got a template box.&lt;/p&gt;

&lt;p&gt;Hi {customer.name},&lt;br&gt;
order {order.number}&lt;br&gt;
is ready at {branch.name}.&lt;/p&gt;

&lt;p&gt;And the code&lt;br&gt;
was one line:&lt;/p&gt;

&lt;p&gt;body = template.format(&lt;br&gt;
    customer=customer, order=order, branch=branch)&lt;/p&gt;

&lt;p&gt;It looked like&lt;br&gt;
a mail merge.&lt;/p&gt;

&lt;p&gt;It was not one.&lt;/p&gt;

&lt;p&gt;Python's format&lt;br&gt;
does more&lt;br&gt;
than fill in names.&lt;/p&gt;

&lt;p&gt;It follows dots.&lt;/p&gt;

&lt;p&gt;It follows square brackets.&lt;/p&gt;

&lt;p&gt;On any object&lt;br&gt;
you hand it.&lt;/p&gt;

&lt;p&gt;So a branch admin,&lt;br&gt;
curious,&lt;br&gt;
or angry,&lt;br&gt;
or just borrowed,&lt;br&gt;
saved this template:&lt;/p&gt;

&lt;p&gt;{order.&lt;strong&gt;init&lt;/strong&gt;.&lt;strong&gt;globals&lt;/strong&gt;[os].environ}&lt;/p&gt;

&lt;p&gt;The test email arrived&lt;br&gt;
with the database password,&lt;br&gt;
the payment key&lt;br&gt;
and everything else&lt;br&gt;
the server had been started with.&lt;/p&gt;

&lt;p&gt;Here is the mechanism.&lt;/p&gt;

&lt;p&gt;order is an object.&lt;/p&gt;

&lt;p&gt;Its &lt;strong&gt;init&lt;/strong&gt;&lt;br&gt;
is a Python function.&lt;/p&gt;

&lt;p&gt;Every Python function&lt;br&gt;
carries &lt;strong&gt;globals&lt;/strong&gt;,&lt;br&gt;
the variables of the module&lt;br&gt;
it was written in.&lt;/p&gt;

&lt;p&gt;That module&lt;br&gt;
imported os.&lt;/p&gt;

&lt;p&gt;os.environ&lt;br&gt;
is the process environment.&lt;/p&gt;

&lt;p&gt;Four dots&lt;br&gt;
and two brackets&lt;br&gt;
from a mail merge&lt;br&gt;
to your secrets.&lt;/p&gt;

&lt;p&gt;No code ran.&lt;/p&gt;

&lt;p&gt;No injection&lt;br&gt;
in the usual sense.&lt;/p&gt;

&lt;p&gt;format did exactly&lt;br&gt;
what it is documented to do.&lt;/p&gt;

&lt;p&gt;The template box&lt;br&gt;
was a programming language&lt;br&gt;
nobody had meant to ship.&lt;/p&gt;

&lt;p&gt;It can also&lt;br&gt;
just hurt you:&lt;/p&gt;

&lt;p&gt;{customer.name:&amp;gt;999999999}&lt;/p&gt;

&lt;p&gt;asks for a field&lt;br&gt;
a billion characters wide.&lt;/p&gt;

&lt;p&gt;Armin Ronacher&lt;br&gt;
wrote about this in 2016.&lt;/p&gt;

&lt;p&gt;It is still&lt;br&gt;
one line away&lt;br&gt;
in most codebases&lt;br&gt;
that let customers&lt;br&gt;
customise anything.&lt;/p&gt;

&lt;p&gt;Here is the fix.&lt;/p&gt;

&lt;p&gt;Never let users&lt;br&gt;
write the format string.&lt;/p&gt;

&lt;p&gt;If they need templates,&lt;br&gt;
give them string.Template.&lt;/p&gt;

&lt;p&gt;from string import Template&lt;br&gt;
body = Template(template).safe_substitute(&lt;br&gt;
    name=customer.name, number=order.number)&lt;/p&gt;

&lt;p&gt;$name only.&lt;/p&gt;

&lt;p&gt;No dots.&lt;/p&gt;

&lt;p&gt;No brackets.&lt;/p&gt;

&lt;p&gt;No attributes.&lt;/p&gt;

&lt;p&gt;If you need loops and conditions,&lt;br&gt;
use Jinja2's&lt;br&gt;
SandboxedEnvironment,&lt;br&gt;
which refuses&lt;br&gt;
the underscore attributes.&lt;/p&gt;

&lt;p&gt;And whatever you pass,&lt;br&gt;
pass plain strings,&lt;br&gt;
never the objects&lt;br&gt;
behind them.&lt;/p&gt;

&lt;p&gt;Then search the codebase&lt;br&gt;
for .format(&lt;br&gt;
on anything&lt;br&gt;
that came from a database.&lt;/p&gt;

&lt;p&gt;A template a user writes&lt;br&gt;
is input.&lt;/p&gt;

&lt;p&gt;format treats it&lt;br&gt;
as a map&lt;br&gt;
of your process.&lt;/p&gt;

&lt;p&gt;– Serguey Asael Shinder&lt;/p&gt;

</description>
      <category>sergueyasaelshinder</category>
      <category>security</category>
      <category>python</category>
      <category>webdev</category>
    </item>
    <item>
      <title>You Numbered the Delivery Lines With for...in and the Second Line Came Out as 11</title>
      <dc:creator>Serguey Asael Shinder</dc:creator>
      <pubDate>Thu, 26 Nov 2026 07:02:03 +0000</pubDate>
      <link>https://dev.to/sergueyasaelshinder/you-numbered-the-delivery-lines-with-forin-and-the-second-line-came-out-as-11-1078</link>
      <guid>https://dev.to/sergueyasaelshinder/you-numbered-the-delivery-lines-with-forin-and-the-second-line-came-out-as-11-1078</guid>
      <description>&lt;p&gt;Every delivery note&lt;br&gt;
numbers its lines.&lt;/p&gt;

&lt;p&gt;The customer rings&lt;br&gt;
and says&lt;br&gt;
"line two is wrong",&lt;br&gt;
and the counter&lt;br&gt;
finds it in a second.&lt;/p&gt;

&lt;p&gt;Someone tidied the loop.&lt;/p&gt;

&lt;p&gt;The old one&lt;br&gt;
counted from zero&lt;br&gt;
by hand.&lt;/p&gt;

&lt;p&gt;The new one&lt;br&gt;
was shorter:&lt;/p&gt;

&lt;p&gt;let out = "";&lt;br&gt;
for (const i in order.lines) {&lt;br&gt;
  out += &lt;code&gt;Line ${i + 1}: ${order.lines[i].text}\n&lt;/code&gt;;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;The next morning&lt;br&gt;
the notes said:&lt;/p&gt;

&lt;p&gt;Line 01.&lt;br&gt;
Line 11.&lt;br&gt;
Line 21.&lt;/p&gt;

&lt;p&gt;The customer rang&lt;br&gt;
about line 11.&lt;/p&gt;

&lt;p&gt;There were three lines.&lt;/p&gt;

&lt;p&gt;Here is the mechanism.&lt;/p&gt;

&lt;p&gt;for...in&lt;br&gt;
does not walk an array.&lt;/p&gt;

&lt;p&gt;It walks&lt;br&gt;
an object's property names.&lt;/p&gt;

&lt;p&gt;Property names&lt;br&gt;
are strings.&lt;/p&gt;

&lt;p&gt;Even on an array.&lt;/p&gt;

&lt;p&gt;So i is not 0, 1, 2.&lt;/p&gt;

&lt;p&gt;It is "0", "1", "2".&lt;/p&gt;

&lt;p&gt;And + with a string&lt;br&gt;
does not add.&lt;/p&gt;

&lt;p&gt;It joins.&lt;/p&gt;

&lt;p&gt;"1" + 1 is "11".&lt;/p&gt;

&lt;p&gt;The same loop&lt;br&gt;
also had this:&lt;/p&gt;

&lt;p&gt;if (i === 0) boldHeader();&lt;/p&gt;

&lt;p&gt;"0" is not 0.&lt;/p&gt;

&lt;p&gt;The header&lt;br&gt;
was never bold again.&lt;/p&gt;

&lt;p&gt;Nobody noticed that one.&lt;/p&gt;

&lt;p&gt;There is a second trap&lt;br&gt;
waiting in the same loop.&lt;/p&gt;

&lt;p&gt;for...in&lt;br&gt;
also visits enumerable properties&lt;br&gt;
the array inherited.&lt;/p&gt;

&lt;p&gt;Some older libraries&lt;br&gt;
added methods&lt;br&gt;
to Array.prototype.&lt;/p&gt;

&lt;p&gt;Load one,&lt;br&gt;
and your loop&lt;br&gt;
gets a line&lt;br&gt;
called "sum",&lt;br&gt;
whose text is undefined.&lt;/p&gt;

&lt;p&gt;The snapshot test&lt;br&gt;
failed, by the way.&lt;/p&gt;

&lt;p&gt;Someone read the diff&lt;br&gt;
as formatting&lt;br&gt;
and updated the snapshot.&lt;/p&gt;

&lt;p&gt;Here is what to use instead.&lt;/p&gt;

&lt;p&gt;If you need the value&lt;br&gt;
and the position:&lt;/p&gt;

&lt;p&gt;for (const [i, line] of order.lines.entries()) {&lt;br&gt;
  out += &lt;code&gt;Line ${i + 1}: ${line.text}\n&lt;/code&gt;;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;entries gives you&lt;br&gt;
a real number&lt;br&gt;
and only the elements.&lt;/p&gt;

&lt;p&gt;Or forEach,&lt;br&gt;
whose index&lt;br&gt;
is a number too.&lt;/p&gt;

&lt;p&gt;Keep for...in&lt;br&gt;
for plain objects,&lt;br&gt;
if you keep it at all.&lt;/p&gt;

&lt;p&gt;Many teams ban it&lt;br&gt;
on arrays&lt;br&gt;
with a lint rule,&lt;br&gt;
no-restricted-syntax,&lt;br&gt;
so the shortcut&lt;br&gt;
cannot come back&lt;br&gt;
in the next tidy-up.&lt;/p&gt;

&lt;p&gt;And when a snapshot fails&lt;br&gt;
on a number,&lt;br&gt;
read the number.&lt;/p&gt;

&lt;p&gt;for...in&lt;br&gt;
hands you names,&lt;br&gt;
not positions.&lt;/p&gt;

&lt;p&gt;They look the same&lt;br&gt;
until you add one.&lt;/p&gt;

&lt;p&gt;– Serguey Asael Shinder&lt;/p&gt;

</description>
      <category>sergueyasaelshinder</category>
      <category>javascript</category>
      <category>programming</category>
      <category>debugging</category>
    </item>
    <item>
      <title>Your Ruby Code Appends to an Empty String Literal and Ruby Is Getting Ready to Freeze It</title>
      <dc:creator>Serguey Asael Shinder</dc:creator>
      <pubDate>Wed, 25 Nov 2026 11:01:57 +0000</pubDate>
      <link>https://dev.to/sergueyasaelshinder/your-ruby-code-appends-to-an-empty-string-literal-and-ruby-is-getting-ready-to-freeze-it-3kpa</link>
      <guid>https://dev.to/sergueyasaelshinder/your-ruby-code-appends-to-an-empty-string-literal-and-ruby-is-getting-ready-to-freeze-it-3kpa</guid>
      <description>&lt;p&gt;The export&lt;br&gt;
builds a CSV&lt;br&gt;
the old way.&lt;/p&gt;

&lt;p&gt;def to_csv(rows)&lt;br&gt;
  out = ""&lt;br&gt;
  rows.each { |r| out &amp;lt;&amp;lt; r.join(",") &amp;lt;&amp;lt; "\n" }&lt;br&gt;
  out&lt;br&gt;
end&lt;/p&gt;

&lt;p&gt;An empty string.&lt;/p&gt;

&lt;p&gt;Append,&lt;br&gt;
append,&lt;br&gt;
append.&lt;/p&gt;

&lt;p&gt;It has run&lt;br&gt;
every night&lt;br&gt;
for nine years.&lt;/p&gt;

&lt;p&gt;Here is what is changing.&lt;/p&gt;

&lt;p&gt;Ruby has been moving&lt;br&gt;
towards frozen string literals&lt;br&gt;
for a long time.&lt;/p&gt;

&lt;p&gt;Most files in Rails apps&lt;br&gt;
already start with:&lt;/p&gt;

&lt;h1&gt;
  
  
  frozen_string_literal: true
&lt;/h1&gt;

&lt;p&gt;Files without it&lt;br&gt;
have always been allowed&lt;br&gt;
to change their literals.&lt;/p&gt;

&lt;p&gt;Ruby 3.4&lt;br&gt;
changed that quietly.&lt;/p&gt;

&lt;p&gt;A literal&lt;br&gt;
in a file without the comment&lt;br&gt;
is now "chilled".&lt;/p&gt;

&lt;p&gt;It still works.&lt;/p&gt;

&lt;p&gt;But mutate it,&lt;br&gt;
with &amp;lt;&amp;lt; or gsub!,&lt;br&gt;
and Ruby&lt;br&gt;
records a deprecation:&lt;/p&gt;

&lt;p&gt;warning: literal string will be frozen in the future&lt;/p&gt;

&lt;p&gt;The plan is&lt;br&gt;
that a later Ruby&lt;br&gt;
freezes them for real.&lt;/p&gt;

&lt;p&gt;Then the same line&lt;br&gt;
raises FrozenError.&lt;/p&gt;

&lt;p&gt;can't modify frozen String&lt;/p&gt;

&lt;p&gt;Here is the trap.&lt;/p&gt;

&lt;p&gt;Deprecation warnings&lt;br&gt;
are off by default.&lt;/p&gt;

&lt;p&gt;So the nightly export&lt;br&gt;
says nothing.&lt;/p&gt;

&lt;p&gt;The test suite&lt;br&gt;
says nothing.&lt;/p&gt;

&lt;p&gt;Everything is green&lt;br&gt;
until the version&lt;br&gt;
where it stops.&lt;/p&gt;

&lt;p&gt;Here is what to do now.&lt;/p&gt;

&lt;p&gt;Run your tests&lt;br&gt;
with the warnings on:&lt;/p&gt;

&lt;p&gt;RUBYOPT="-W:deprecated" bundle exec rspec&lt;/p&gt;

&lt;p&gt;Every warning&lt;br&gt;
is a line&lt;br&gt;
that will break.&lt;/p&gt;

&lt;p&gt;Or rehearse the future&lt;br&gt;
in a branch:&lt;/p&gt;

&lt;p&gt;RUBYOPT="--enable-frozen-string-literal"&lt;/p&gt;

&lt;p&gt;Now every literal&lt;br&gt;
is frozen,&lt;br&gt;
and you get the FrozenError&lt;br&gt;
today,&lt;br&gt;
with a stack trace,&lt;br&gt;
instead of later.&lt;/p&gt;

&lt;p&gt;Fix each one&lt;br&gt;
by asking for&lt;br&gt;
a string you can change:&lt;/p&gt;

&lt;p&gt;out = +""&lt;/p&gt;

&lt;p&gt;Unary plus&lt;br&gt;
returns a mutable copy.&lt;/p&gt;

&lt;p&gt;Careful with String.new&lt;br&gt;
without an argument.&lt;/p&gt;

&lt;p&gt;It gives you a binary string,&lt;br&gt;
not UTF-8,&lt;br&gt;
and that has its own surprises.&lt;/p&gt;

&lt;p&gt;Then add the magic comment&lt;br&gt;
to each file you fix,&lt;br&gt;
so it already behaves&lt;br&gt;
the way the future will.&lt;/p&gt;

&lt;p&gt;Gems you depend on&lt;br&gt;
need the same check.&lt;/p&gt;

&lt;p&gt;Run the suite&lt;br&gt;
with the flag,&lt;br&gt;
and read the warnings&lt;br&gt;
from their paths too.&lt;/p&gt;

&lt;p&gt;A deprecation you cannot see&lt;br&gt;
is not a quiet one.&lt;/p&gt;

&lt;p&gt;It is a countdown&lt;br&gt;
with the sound off.&lt;/p&gt;

&lt;p&gt;– Serguey Asael Shinder&lt;/p&gt;

</description>
      <category>sergueyasaelshinder</category>
      <category>ruby</category>
      <category>rails</category>
      <category>programming</category>
    </item>
    <item>
      <title>You Read 8640000 as One Day and Every Price Was Cached for a Hundred</title>
      <dc:creator>Serguey Asael Shinder</dc:creator>
      <pubDate>Wed, 25 Nov 2026 11:01:26 +0000</pubDate>
      <link>https://dev.to/sergueyasaelshinder/you-read-8640000-as-one-day-and-every-price-was-cached-for-a-hundred-g3p</link>
      <guid>https://dev.to/sergueyasaelshinder/you-read-8640000-as-one-day-and-every-price-was-cached-for-a-hundred-g3p</guid>
      <description>&lt;p&gt;The pull request&lt;br&gt;
added a cache&lt;br&gt;
in front of the price service.&lt;/p&gt;

&lt;p&gt;Prices change&lt;br&gt;
once a day,&lt;br&gt;
overnight.&lt;/p&gt;

&lt;p&gt;So the cache&lt;br&gt;
should hold them&lt;br&gt;
for a day.&lt;/p&gt;

&lt;p&gt;const val PRICE_CACHE_TTL_SECONDS = 8640000L&lt;/p&gt;

&lt;p&gt;You read it.&lt;/p&gt;

&lt;p&gt;A long number,&lt;br&gt;
lots of zeros,&lt;br&gt;
roughly a day&lt;br&gt;
in seconds.&lt;/p&gt;

&lt;p&gt;Approved.&lt;/p&gt;

&lt;p&gt;So did the second reviewer.&lt;/p&gt;

&lt;p&gt;A day&lt;br&gt;
is 86,400 seconds.&lt;/p&gt;

&lt;p&gt;That line&lt;br&gt;
has one zero more.&lt;/p&gt;

&lt;p&gt;One hundred days.&lt;/p&gt;

&lt;p&gt;Two weeks later&lt;br&gt;
the buyers raised&lt;br&gt;
the price of cement.&lt;/p&gt;

&lt;p&gt;The website&lt;br&gt;
did not.&lt;/p&gt;

&lt;p&gt;The branches did.&lt;/p&gt;

&lt;p&gt;So the counter&lt;br&gt;
and the checkout&lt;br&gt;
disagreed for days&lt;br&gt;
before anyone found the cache.&lt;/p&gt;

&lt;p&gt;Here is the mechanism.&lt;/p&gt;

&lt;p&gt;Your eyes&lt;br&gt;
do not count digits.&lt;/p&gt;

&lt;p&gt;Up to about four,&lt;br&gt;
you see how many things&lt;br&gt;
there are&lt;br&gt;
without counting.&lt;/p&gt;

&lt;p&gt;Psychologists call that&lt;br&gt;
subitizing.&lt;/p&gt;

&lt;p&gt;Past four,&lt;br&gt;
you have to count,&lt;br&gt;
one by one,&lt;br&gt;
and nobody counts&lt;br&gt;
when they are reviewing&lt;br&gt;
forty files.&lt;/p&gt;

&lt;p&gt;So a long run of zeros&lt;br&gt;
is read by shape.&lt;/p&gt;

&lt;p&gt;Long number.&lt;/p&gt;

&lt;p&gt;Starts with 86.&lt;/p&gt;

&lt;p&gt;Must be the day one.&lt;/p&gt;

&lt;p&gt;The check you thought you did&lt;br&gt;
was a glance&lt;br&gt;
at the first two digits.&lt;/p&gt;

&lt;p&gt;And the word "seconds"&lt;br&gt;
in the name&lt;br&gt;
made it look more careful&lt;br&gt;
than it was.&lt;/p&gt;

&lt;p&gt;Here is what to do.&lt;/p&gt;

&lt;p&gt;Do not make anyone count.&lt;/p&gt;

&lt;p&gt;Most languages&lt;br&gt;
let you group digits:&lt;/p&gt;

&lt;p&gt;const val PRICE_CACHE_TTL_SECONDS = 86_400L&lt;/p&gt;

&lt;p&gt;Kotlin, Java, Python,&lt;br&gt;
JavaScript, Go, Rust and C#&lt;br&gt;
all accept a separator.&lt;/p&gt;

&lt;p&gt;Now the extra zero&lt;br&gt;
breaks the pattern&lt;br&gt;
you can see.&lt;/p&gt;

&lt;p&gt;Better still,&lt;br&gt;
do not write the number at all.&lt;/p&gt;

&lt;p&gt;val priceCacheTtl = 1.days&lt;/p&gt;

&lt;p&gt;Or Duration.ofDays(1) in Java.&lt;/p&gt;

&lt;p&gt;A reviewer can read "one day".&lt;/p&gt;

&lt;p&gt;Nobody can read&lt;br&gt;
seven zeros.&lt;/p&gt;

&lt;p&gt;Or show the arithmetic:&lt;/p&gt;

&lt;p&gt;24 * 60 * 60&lt;/p&gt;

&lt;p&gt;And when you review&lt;br&gt;
a constant&lt;br&gt;
that controls time,&lt;br&gt;
money or size,&lt;br&gt;
stop&lt;br&gt;
and say its value out loud,&lt;br&gt;
in words.&lt;/p&gt;

&lt;p&gt;If you cannot,&lt;br&gt;
you have not read it.&lt;/p&gt;

&lt;p&gt;Long numbers&lt;br&gt;
are not read.&lt;/p&gt;

&lt;p&gt;They are recognised,&lt;br&gt;
and they are recognised wrong.&lt;/p&gt;

&lt;p&gt;– Serguey Asael Shinder&lt;/p&gt;

</description>
      <category>sergueyasaelshinder</category>
      <category>productivity</category>
      <category>kotlin</category>
      <category>programming</category>
    </item>
    <item>
      <title>You Compared the Two Build Tools Side by Side and Paid for a Difference You Would Never Feel</title>
      <dc:creator>Serguey Asael Shinder</dc:creator>
      <pubDate>Wed, 25 Nov 2026 11:00:54 +0000</pubDate>
      <link>https://dev.to/sergueyasaelshinder/you-compared-the-two-build-tools-side-by-side-and-paid-for-a-difference-you-would-never-feel-4e4i</link>
      <guid>https://dev.to/sergueyasaelshinder/you-compared-the-two-build-tools-side-by-side-and-paid-for-a-difference-you-would-never-feel-4e4i</guid>
      <description>&lt;p&gt;Two build tools.&lt;/p&gt;

&lt;p&gt;One afternoon&lt;br&gt;
to choose.&lt;/p&gt;

&lt;p&gt;You ran them both&lt;br&gt;
on the same project,&lt;br&gt;
in the same terminal,&lt;br&gt;
one after the other.&lt;/p&gt;

&lt;p&gt;Forty six seconds.&lt;/p&gt;

&lt;p&gt;Thirty eight seconds.&lt;/p&gt;

&lt;p&gt;Side by side,&lt;br&gt;
eight seconds&lt;br&gt;
looked enormous.&lt;/p&gt;

&lt;p&gt;Almost a fifth faster.&lt;/p&gt;

&lt;p&gt;So you chose the fast one,&lt;br&gt;
and accepted&lt;br&gt;
the configuration file&lt;br&gt;
nobody could read.&lt;/p&gt;

&lt;p&gt;Six months later&lt;br&gt;
nobody remembers&lt;br&gt;
the eight seconds.&lt;/p&gt;

&lt;p&gt;Every build&lt;br&gt;
starts while you&lt;br&gt;
reach for your coffee.&lt;/p&gt;

&lt;p&gt;Nobody ever sits there&lt;br&gt;
with both tools open,&lt;br&gt;
feeling the difference.&lt;/p&gt;

&lt;p&gt;But everyone&lt;br&gt;
feels the configuration.&lt;/p&gt;

&lt;p&gt;Every new module.&lt;/p&gt;

&lt;p&gt;Every upgrade.&lt;/p&gt;

&lt;p&gt;Every time someone asks&lt;br&gt;
why the cache&lt;br&gt;
missed again.&lt;/p&gt;

&lt;p&gt;Here is what happened.&lt;/p&gt;

&lt;p&gt;Psychologists call it&lt;br&gt;
distinction bias.&lt;/p&gt;

&lt;p&gt;Christopher Hsee&lt;br&gt;
and Jiao Zhang&lt;br&gt;
described it in 2004.&lt;/p&gt;

&lt;p&gt;When you compare options&lt;br&gt;
side by side,&lt;br&gt;
you predict&lt;br&gt;
that small differences&lt;br&gt;
will matter to you.&lt;/p&gt;

&lt;p&gt;When you live with one option,&lt;br&gt;
on its own,&lt;br&gt;
you mostly&lt;br&gt;
do not notice them.&lt;/p&gt;

&lt;p&gt;The comparison&lt;br&gt;
is a different situation&lt;br&gt;
from the experience.&lt;/p&gt;

&lt;p&gt;And you choose&lt;br&gt;
in the comparison,&lt;br&gt;
then live&lt;br&gt;
in the experience.&lt;/p&gt;

&lt;p&gt;Numbers make it worse.&lt;/p&gt;

&lt;p&gt;Thirty eight&lt;br&gt;
next to forty six&lt;br&gt;
is easy to see.&lt;/p&gt;

&lt;p&gt;The cost of a confusing config&lt;br&gt;
has no number,&lt;br&gt;
so it never sits&lt;br&gt;
in the same table.&lt;/p&gt;

&lt;p&gt;Here is what to do.&lt;/p&gt;

&lt;p&gt;When you compare,&lt;br&gt;
ask the question&lt;br&gt;
in single mode:&lt;/p&gt;

&lt;p&gt;if I only ever had this one,&lt;br&gt;
would I notice?&lt;/p&gt;

&lt;p&gt;Would anyone&lt;br&gt;
complain about forty six seconds&lt;br&gt;
if they had never seen thirty eight?&lt;/p&gt;

&lt;p&gt;Write down&lt;br&gt;
what you will do with each option&lt;br&gt;
every week,&lt;br&gt;
not just what you will measure once.&lt;/p&gt;

&lt;p&gt;Try each option alone&lt;br&gt;
for a few days,&lt;br&gt;
not both&lt;br&gt;
in one afternoon.&lt;/p&gt;

&lt;p&gt;And give the things&lt;br&gt;
you cannot benchmark,&lt;br&gt;
readability,&lt;br&gt;
upgrades,&lt;br&gt;
the person who joins next year,&lt;br&gt;
a row in the table anyway.&lt;/p&gt;

&lt;p&gt;A difference you can see&lt;br&gt;
is not always&lt;br&gt;
a difference you will feel.&lt;/p&gt;

&lt;p&gt;Choose for the life you will have&lt;br&gt;
with the thing,&lt;br&gt;
not for the minute&lt;br&gt;
you spent comparing it.&lt;/p&gt;

&lt;p&gt;– Serguey Asael Shinder&lt;/p&gt;

</description>
      <category>sergueyasaelshinder</category>
      <category>career</category>
      <category>productivity</category>
      <category>psychology</category>
    </item>
    <item>
      <title>You Set the Delay by Ear at Home and on Stage Every Echo Landed Between the Beats</title>
      <dc:creator>Serguey Asael Shinder</dc:creator>
      <pubDate>Wed, 25 Nov 2026 11:00:23 +0000</pubDate>
      <link>https://dev.to/sergueyasaelshinder/you-set-the-delay-by-ear-at-home-and-on-stage-every-echo-landed-between-the-beats-1e4i</link>
      <guid>https://dev.to/sergueyasaelshinder/you-set-the-delay-by-ear-at-home-and-on-stage-every-echo-landed-between-the-beats-1e4i</guid>
      <description>&lt;p&gt;At home&lt;br&gt;
the delay sounded perfect.&lt;/p&gt;

&lt;p&gt;Each repeat&lt;br&gt;
dropped into the groove,&lt;br&gt;
right on the beat,&lt;br&gt;
like another guitarist&lt;br&gt;
answering you.&lt;/p&gt;

&lt;p&gt;You dialled it by ear.&lt;/p&gt;

&lt;p&gt;500 milliseconds.&lt;/p&gt;

&lt;p&gt;You never wrote down why.&lt;/p&gt;

&lt;p&gt;At the gig&lt;br&gt;
the same patch&lt;br&gt;
sounded like a mistake.&lt;/p&gt;

&lt;p&gt;The repeats&lt;br&gt;
smeared across the drums.&lt;/p&gt;

&lt;p&gt;Not wrong notes.&lt;/p&gt;

&lt;p&gt;Wrong time.&lt;/p&gt;

&lt;p&gt;Here is the mechanism.&lt;/p&gt;

&lt;p&gt;A delay&lt;br&gt;
does not know your song.&lt;/p&gt;

&lt;p&gt;It waits a fixed time.&lt;/p&gt;

&lt;p&gt;The time that lands&lt;br&gt;
on the next beat&lt;br&gt;
depends on the tempo:&lt;/p&gt;

&lt;p&gt;60,000 divided by the BPM&lt;br&gt;
gives you milliseconds&lt;br&gt;
per beat.&lt;/p&gt;

&lt;p&gt;At home&lt;br&gt;
you practised along&lt;br&gt;
with the record,&lt;br&gt;
at 120.&lt;/p&gt;

&lt;p&gt;500 milliseconds.&lt;/p&gt;

&lt;p&gt;Perfect.&lt;/p&gt;

&lt;p&gt;On stage&lt;br&gt;
your drummer&lt;br&gt;
counted it in at 128,&lt;br&gt;
as live drummers do.&lt;/p&gt;

&lt;p&gt;One beat&lt;br&gt;
is now about 469 milliseconds.&lt;/p&gt;

&lt;p&gt;Your first repeat&lt;br&gt;
is 31 milliseconds late.&lt;/p&gt;

&lt;p&gt;Each repeat&lt;br&gt;
waits another 500,&lt;br&gt;
so the error adds up.&lt;/p&gt;

&lt;p&gt;By the fourth repeat&lt;br&gt;
it is about 125 milliseconds behind.&lt;/p&gt;

&lt;p&gt;At 128,&lt;br&gt;
that is more&lt;br&gt;
than a sixteenth note.&lt;/p&gt;

&lt;p&gt;The echo is no longer&lt;br&gt;
answering the band.&lt;/p&gt;

&lt;p&gt;It is arguing with it.&lt;/p&gt;

&lt;p&gt;The famous dotted eighth sound&lt;br&gt;
has the same problem&lt;br&gt;
in a smaller space.&lt;/p&gt;

&lt;p&gt;At 120&lt;br&gt;
it is 375 milliseconds.&lt;/p&gt;

&lt;p&gt;At 128&lt;br&gt;
it is about 352.&lt;/p&gt;

&lt;p&gt;Close enough&lt;br&gt;
to sound almost right,&lt;br&gt;
which is worse.&lt;/p&gt;

&lt;p&gt;Your ear at home&lt;br&gt;
never heard the problem,&lt;br&gt;
because the record&lt;br&gt;
never changes speed.&lt;/p&gt;

&lt;p&gt;A band does.&lt;/p&gt;

&lt;p&gt;Here is what to do.&lt;/p&gt;

&lt;p&gt;Use tap tempo,&lt;br&gt;
and tap it&lt;br&gt;
during the count in&lt;br&gt;
or the first bar,&lt;br&gt;
on the tempo&lt;br&gt;
the band is actually playing.&lt;/p&gt;

&lt;p&gt;If your drummer plays to a click,&lt;br&gt;
send the delay&lt;br&gt;
the same MIDI clock.&lt;/p&gt;

&lt;p&gt;Then it follows&lt;br&gt;
whatever the night does.&lt;/p&gt;

&lt;p&gt;If you use presets,&lt;br&gt;
store the BPM,&lt;br&gt;
not the milliseconds,&lt;br&gt;
and check it&lt;br&gt;
against the setlist.&lt;/p&gt;

&lt;p&gt;And fewer repeats,&lt;br&gt;
a little lower,&lt;br&gt;
forgive more.&lt;/p&gt;

&lt;p&gt;A delay time&lt;br&gt;
is not a sound.&lt;/p&gt;

&lt;p&gt;It is a tempo&lt;br&gt;
you chose once,&lt;br&gt;
in a quiet room.&lt;/p&gt;

&lt;p&gt;– Serguey Asael Shinder&lt;/p&gt;

</description>
      <category>sergueyasaelshinder</category>
      <category>music</category>
      <category>guitar</category>
      <category>performance</category>
    </item>
    <item>
      <title>Your Model Learned to Find Cracked Tiles by Looking at the Table They Were Photographed On</title>
      <dc:creator>Serguey Asael Shinder</dc:creator>
      <pubDate>Wed, 25 Nov 2026 10:59:51 +0000</pubDate>
      <link>https://dev.to/sergueyasaelshinder/your-model-learned-to-find-cracked-tiles-by-looking-at-the-table-they-were-photographed-on-39f8</link>
      <guid>https://dev.to/sergueyasaelshinder/your-model-learned-to-find-cracked-tiles-by-looking-at-the-table-they-were-photographed-on-39f8</guid>
      <description>&lt;p&gt;The returns desk&lt;br&gt;
wanted help.&lt;/p&gt;

&lt;p&gt;Customers send photos&lt;br&gt;
of tiles they say&lt;br&gt;
arrived cracked.&lt;/p&gt;

&lt;p&gt;Could a model&lt;br&gt;
sort the real claims&lt;br&gt;
from the rest?&lt;/p&gt;

&lt;p&gt;You needed training photos.&lt;/p&gt;

&lt;p&gt;The cracked ones&lt;br&gt;
were easy.&lt;/p&gt;

&lt;p&gt;The returns team&lt;br&gt;
had photographed&lt;br&gt;
every damaged tile&lt;br&gt;
for two years.&lt;/p&gt;

&lt;p&gt;On the same grey bench.&lt;/p&gt;

&lt;p&gt;Under the same light.&lt;/p&gt;

&lt;p&gt;The good ones&lt;br&gt;
came from the product photography.&lt;/p&gt;

&lt;p&gt;White studio background.&lt;/p&gt;

&lt;p&gt;You trained,&lt;br&gt;
held out twenty percent,&lt;br&gt;
and tested.&lt;/p&gt;

&lt;p&gt;Ninety eight percent.&lt;/p&gt;

&lt;p&gt;Then the first real week.&lt;/p&gt;

&lt;p&gt;Photos from kitchen floors,&lt;br&gt;
van beds,&lt;br&gt;
car boots.&lt;/p&gt;

&lt;p&gt;The model called&lt;br&gt;
almost all of them&lt;br&gt;
undamaged.&lt;/p&gt;

&lt;p&gt;Including the one&lt;br&gt;
that was in three pieces.&lt;/p&gt;

&lt;p&gt;Here is the mechanism.&lt;/p&gt;

&lt;p&gt;A model learns&lt;br&gt;
whatever separates&lt;br&gt;
your labels&lt;br&gt;
most cheaply.&lt;/p&gt;

&lt;p&gt;You meant it to learn&lt;br&gt;
cracks.&lt;/p&gt;

&lt;p&gt;But in your data&lt;br&gt;
there was something&lt;br&gt;
much easier.&lt;/p&gt;

&lt;p&gt;Grey bench: cracked.&lt;/p&gt;

&lt;p&gt;White background: fine.&lt;/p&gt;

&lt;p&gt;A whole image of evidence,&lt;br&gt;
versus a thin dark line.&lt;/p&gt;

&lt;p&gt;The test set&lt;br&gt;
came from the same two piles,&lt;br&gt;
so it had the same shortcut.&lt;/p&gt;

&lt;p&gt;It could only confirm it.&lt;/p&gt;

&lt;p&gt;Researchers call this&lt;br&gt;
shortcut learning.&lt;/p&gt;

&lt;p&gt;Geirhos and colleagues&lt;br&gt;
wrote the standard paper on it&lt;br&gt;
in 2020.&lt;/p&gt;

&lt;p&gt;Medical models&lt;br&gt;
have learned&lt;br&gt;
which hospital took the X-ray.&lt;/p&gt;

&lt;p&gt;Yours learned&lt;br&gt;
which room took the photo.&lt;/p&gt;

&lt;p&gt;Here is what to do.&lt;/p&gt;

&lt;p&gt;Collect both classes&lt;br&gt;
in the same conditions.&lt;/p&gt;

&lt;p&gt;Good tiles on the grey bench too.&lt;/p&gt;

&lt;p&gt;Cracked tiles&lt;br&gt;
on floors and in boxes.&lt;/p&gt;

&lt;p&gt;Build your test set&lt;br&gt;
from the place&lt;br&gt;
the model will actually work.&lt;/p&gt;

&lt;p&gt;Real customer photos,&lt;br&gt;
labelled by hand,&lt;br&gt;
even if it is only two hundred.&lt;/p&gt;

&lt;p&gt;Look at what the model looks at.&lt;/p&gt;

&lt;p&gt;A saliency map&lt;br&gt;
lighting up the table edge&lt;br&gt;
tells you more&lt;br&gt;
than any accuracy figure.&lt;/p&gt;

&lt;p&gt;And try one cruel test.&lt;/p&gt;

&lt;p&gt;Put a good tile&lt;br&gt;
on the grey bench.&lt;/p&gt;

&lt;p&gt;If the model calls it cracked,&lt;br&gt;
you have trained&lt;br&gt;
a bench detector.&lt;/p&gt;

&lt;p&gt;The model did not fail&lt;br&gt;
at the job you gave it.&lt;/p&gt;

&lt;p&gt;It did the job&lt;br&gt;
your data described.&lt;/p&gt;

&lt;p&gt;– Serguey Asael Shinder&lt;/p&gt;

</description>
      <category>sergueyasaelshinder</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>computervision</category>
    </item>
  </channel>
</rss>
