<?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: Christopher </title>
    <description>The latest articles on DEV Community by Christopher  (@christopherclemmons).</description>
    <link>https://dev.to/christopherclemmons</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F698547%2Fd067c21f-d112-44a4-b713-07aacebc6495.jpeg</url>
      <title>DEV Community: Christopher </title>
      <link>https://dev.to/christopherclemmons</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/christopherclemmons"/>
    <language>en</language>
    <item>
      <title>Your Code Isn’t the Bottleneck. Other People’s Approval Is.</title>
      <dc:creator>Christopher </dc:creator>
      <pubDate>Fri, 16 Jan 2026 17:09:05 +0000</pubDate>
      <link>https://dev.to/christopherclemmons/your-code-isnt-the-bottleneck-other-peoples-approval-is-32p4</link>
      <guid>https://dev.to/christopherclemmons/your-code-isnt-the-bottleneck-other-peoples-approval-is-32p4</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv6unkhgfya04scoq6plv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv6unkhgfya04scoq6plv.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Read the full blog for free here: &lt;a href="https://strategystack.io/blog/redtape" rel="noopener noreferrer"&gt;https://strategystack.io/blog/redtape&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most engineers think job security is about writing clean code, shipping fast, and being “good at communication.”&lt;/p&gt;

&lt;p&gt;That’s the fair version of the world.&lt;/p&gt;

&lt;p&gt;A lot of teams don’t run on fairness. They run on approvals.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Hidden System Nobody Warns You About
&lt;/h2&gt;

&lt;p&gt;On some teams, work isn’t done when the code is done.&lt;/p&gt;

&lt;p&gt;It’s done when the right people have signed off:&lt;br&gt;
product, business, QA, and usually one or two senior engineers whose opinion quietly decides whether your work is “acceptable.”&lt;/p&gt;

&lt;p&gt;If you don’t treat that like a real dependency, you’ll learn the hard way.&lt;/p&gt;

&lt;p&gt;Because the org won’t grade your effort. It’ll grade whether the feature was accepted on time.&lt;/p&gt;

&lt;h2&gt;
  
  
  “I Sent Them a Message” Doesn’t Protect You
&lt;/h2&gt;

&lt;p&gt;This is where good engineers get hurt.&lt;/p&gt;

&lt;p&gt;They finish the work.&lt;br&gt;
They ask for review once.&lt;br&gt;
No one responds.&lt;br&gt;
Sprint ends.&lt;br&gt;
Someone says, “Why wasn’t this approved?”&lt;/p&gt;

&lt;p&gt;Now it looks like you didn’t deliver.&lt;/p&gt;

&lt;p&gt;Even if you did everything “right” technically, you still missed the invisible gate.&lt;/p&gt;

&lt;p&gt;In environments like this, you don’t just notify people. You drive the approval to completion.&lt;/p&gt;

&lt;h2&gt;
  
  
  Document Everything That Can Blow Back Later
&lt;/h2&gt;

&lt;p&gt;If the team has high turnover, it usually has high ambiguity too.&lt;/p&gt;

&lt;p&gt;And ambiguity is a weapon. Not always on purpose, but it becomes one.&lt;/p&gt;

&lt;p&gt;So document:&lt;br&gt;
what you understood, what you asked, what was confirmed, and who was responsible for sign-off.&lt;/p&gt;

&lt;p&gt;Not for drama. For clarity.&lt;/p&gt;

&lt;p&gt;When requirements change late, written context is leverage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Don’t Start Coding Until the Ticket Is Real
&lt;/h2&gt;

&lt;p&gt;A vague ticket is not a green light. It’s risk.&lt;/p&gt;

&lt;p&gt;If you start building before you understand what “done” means, you’re volunteering for rework.&lt;/p&gt;

&lt;p&gt;Ask questions early.&lt;br&gt;
Confirm expectations early.&lt;br&gt;
Get someone to define success early.&lt;/p&gt;

&lt;p&gt;Early clarification makes you look sharp.&lt;br&gt;
Late clarification makes you look behind.&lt;/p&gt;

&lt;h2&gt;
  
  
  Align With the People Who Can Block You
&lt;/h2&gt;

&lt;p&gt;Every team has a few people who function as gatekeepers, even if their title doesn’t say it.&lt;/p&gt;

&lt;p&gt;If you’re not aligned with them, your PR will stall or your approach will get challenged at the worst possible time.&lt;/p&gt;

&lt;p&gt;A quick alignment chat early can save days of back-and-forth later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use What Already Works
&lt;/h2&gt;

&lt;p&gt;If there’s an existing pattern in the codebase, copy it.&lt;/p&gt;

&lt;p&gt;It’s faster.&lt;br&gt;
It’s safer.&lt;br&gt;
It’s easier to review.&lt;/p&gt;

&lt;p&gt;Novelty is expensive. Consistency ships.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use AI and Meeting Artifacts to Reduce Waiting
&lt;/h2&gt;

&lt;p&gt;In big companies, people are constantly unavailable.&lt;/p&gt;

&lt;p&gt;If you’re blocked, don’t just sit there refreshing Slack.&lt;/p&gt;

&lt;p&gt;Use AI to pressure-test your understanding, generate options, and draft crisp questions.&lt;/p&gt;

&lt;p&gt;Also mine meeting notes and recordings. Decisions get made verbally all the time and never make it into the ticket.&lt;/p&gt;

&lt;p&gt;The engineers who move fastest aren’t always the smartest.&lt;/p&gt;

&lt;p&gt;They’re the ones who build context without needing permission.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How To Avoid Looking Stupid At the End Of a Sprint</title>
      <dc:creator>Christopher </dc:creator>
      <pubDate>Fri, 16 Jan 2026 17:07:27 +0000</pubDate>
      <link>https://dev.to/christopherclemmons/how-to-avoid-looking-stupid-at-the-end-of-a-sprint-6b2</link>
      <guid>https://dev.to/christopherclemmons/how-to-avoid-looking-stupid-at-the-end-of-a-sprint-6b2</guid>
      <description>&lt;p&gt;Read the full article here: &lt;a href="https://strategystack.io/blog/question-everything" rel="noopener noreferrer"&gt;https://strategystack.io/blog/question-everything&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you don’t understand the outcome, the tech questions are noise. Most delivery problems start in meetings, not in code.&lt;/p&gt;

&lt;p&gt;One of the hardest parts of a new story isn’t the implementation.&lt;br&gt;
It’s the meeting where someone asks, “Any questions?” and you’re still trying to understand what the ticket even is.&lt;/p&gt;

&lt;p&gt;You’re mapping the domain.&lt;br&gt;
You’re decoding stakeholder language.&lt;br&gt;
You’re trying to understand intent, scope, and constraints at the same time.&lt;/p&gt;

&lt;p&gt;And now you’re supposed to ask “good questions.”&lt;/p&gt;

&lt;p&gt;Most engineers default to technical questions:&lt;/p&gt;

&lt;p&gt;What framework are we using?&lt;br&gt;
Is this a new table or an update?&lt;br&gt;
Is this synchronous or async?&lt;br&gt;
Those aren’t bad questions. They’re just early. If you don’t understand the outcome, the rest is guesswork.&lt;/p&gt;

&lt;p&gt;When you’re working with non-technical stakeholders, requirements are written in outcome language, policy language, or compliance language. Not engineering language. If you start at the tech layer, you’re building on fog.&lt;/p&gt;

&lt;p&gt;The first question should always be:&lt;/p&gt;

&lt;p&gt;“What should be true when this is done?”&lt;/p&gt;

&lt;p&gt;Not how.&lt;br&gt;
Not with what.&lt;br&gt;
Not in which service.&lt;/p&gt;

&lt;p&gt;Outcome first. Everything else follows.&lt;/p&gt;

&lt;p&gt;Most delivery drag doesn’t come from bad code. It comes from misunderstood intent.&lt;/p&gt;

&lt;p&gt;And here’s the uncomfortable truth…&lt;/p&gt;

&lt;p&gt;Most engineers aren’t bad at coding. They’re bad at clarifying.&lt;/p&gt;

&lt;p&gt;They try to listen, think, and write at the same time.&lt;/p&gt;

&lt;p&gt;They miss context.&lt;br&gt;
They miss nuance.&lt;br&gt;
Their notes are useless later.&lt;br&gt;
That’s not a skill problem. It’s a tooling problem.&lt;/p&gt;

&lt;p&gt;This is where AI is real leverage.&lt;/p&gt;

&lt;p&gt;Record the meeting.&lt;br&gt;
Get the transcript.&lt;br&gt;
Let AI structure the chaos.&lt;/p&gt;

&lt;p&gt;Now you can extract intent, identify ambiguity, and come back with precise questions. Not guesses.&lt;/p&gt;

&lt;p&gt;Domain understanding beats syntax every time.&lt;/p&gt;

&lt;p&gt;The engineers who move fastest aren’t the ones who type the quickest.&lt;br&gt;
They’re the ones who clarify the best.&lt;/p&gt;

&lt;p&gt;That’s what quality software engineering looks like.&lt;/p&gt;

</description>
      <category>agile</category>
      <category>career</category>
      <category>productivity</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>How To Train Predictable AI Agents using XML+JSON</title>
      <dc:creator>Christopher </dc:creator>
      <pubDate>Fri, 15 Aug 2025 11:13:56 +0000</pubDate>
      <link>https://dev.to/christopherclemmons/how-to-train-predictable-ai-agents-using-xmljson-cn9</link>
      <guid>https://dev.to/christopherclemmons/how-to-train-predictable-ai-agents-using-xmljson-cn9</guid>
      <description>&lt;h1&gt;
  
  
  Prompting Predictable AI Agents: A Complete Guide
&lt;/h1&gt;

&lt;p&gt;Instructions given to your agent greatly affects the consistency of its output. Once your agent receives suitable instructions, outputs are much more predictable and structured, resulting in less bugs and embarrassing mistakes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Instruction File Formats
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;XML&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Preferred format for training models due to less complexity for the system training on it&lt;/li&gt;
&lt;li&gt;Better for hierarchical instructions and complex nested structures&lt;/li&gt;
&lt;li&gt;More readable for humans when dealing with multi-layered prompts&lt;/li&gt;
&lt;li&gt;Natural way to separate different instruction components&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;JSON&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Best for creating multiple outputs from a single execution of an AI agent&lt;/li&gt;
&lt;li&gt;More flexible with working on software contributions&lt;/li&gt;
&lt;li&gt;Easier to parse programmatically in most programming languages&lt;/li&gt;
&lt;li&gt;Better for structured data exchange between systems&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to Choose XML vs JSON
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Choose XML when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need clear separation of instruction sections&lt;/li&gt;
&lt;li&gt;Working with complex, nested prompt structures&lt;/li&gt;
&lt;li&gt;Human readability is a priority&lt;/li&gt;
&lt;li&gt;Building templates that will be reused frequently&lt;/li&gt;
&lt;li&gt;Creating prompts with multiple conditional branches&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Choose JSON when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Building API integrations&lt;/li&gt;
&lt;li&gt;Need to programmatically generate or modify prompts&lt;/li&gt;
&lt;li&gt;Working with structured data inputs/outputs&lt;/li&gt;
&lt;li&gt;Building systems that need to parse responses automatically&lt;/li&gt;
&lt;li&gt;Creating dynamic prompts based on user input&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Creating the Prompt
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Define the Role
&lt;/h3&gt;

&lt;p&gt;The role sets the context and expertise level for your AI agent. A well-defined role helps the AI understand what perspective to take and what knowledge to draw from.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key principles for defining roles:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Be specific about the expertise level (junior, senior, expert)&lt;/li&gt;
&lt;li&gt;Include relevant background context&lt;/li&gt;
&lt;li&gt;Specify the industry or domain if applicable&lt;/li&gt;
&lt;li&gt;Define the relationship to the user (assistant, advisor, reviewer, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Examples of good role definitions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"You are a senior software engineer with 10 years of experience in Python and web development"&lt;/li&gt;
&lt;li&gt;"You are a helpful customer service representative for a SaaS company"&lt;/li&gt;
&lt;li&gt;"You are an expert data analyst specializing in e-commerce metrics"&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Define the Goal
&lt;/h3&gt;

&lt;p&gt;The goal clarifies what you want the AI to accomplish. It should be specific, measurable, and aligned with your desired outcome.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Components of a good goal:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clear objective statement&lt;/li&gt;
&lt;li&gt;Expected deliverable format&lt;/li&gt;
&lt;li&gt;Success criteria&lt;/li&gt;
&lt;li&gt;Any constraints or limitations&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Write Instructions
&lt;/h3&gt;

&lt;p&gt;Instructions are the core of your prompt. They should be detailed, unambiguous, and actionable.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Write Effective Instructions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Be Specific and Detailed
&lt;/h3&gt;

&lt;p&gt;Vague instructions lead to unpredictable outputs. Instead of "analyze this data," specify exactly what analysis you want, what metrics to focus on, and how to present the results.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Clear Structure
&lt;/h3&gt;

&lt;p&gt;Break complex instructions into numbered steps or bullet points. This helps the AI follow a logical sequence and reduces the chance of missing important details.&lt;/p&gt;

&lt;h3&gt;
  
  
  Define Output Format
&lt;/h3&gt;

&lt;p&gt;Specify exactly how you want the response formatted. Include details about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Length requirements&lt;/li&gt;
&lt;li&gt;Structure (headings, lists, paragraphs)&lt;/li&gt;
&lt;li&gt;Tone and style&lt;/li&gt;
&lt;li&gt;Any specific terminology to use or avoid&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Include Constraints
&lt;/h3&gt;

&lt;p&gt;Be explicit about what the AI should NOT do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Information it shouldn't include&lt;/li&gt;
&lt;li&gt;Approaches to avoid&lt;/li&gt;
&lt;li&gt;Length limitations&lt;/li&gt;
&lt;li&gt;Sensitive topics to handle carefully&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Provide Context
&lt;/h3&gt;

&lt;p&gt;Give the AI enough background information to understand the situation, but avoid information overload that might confuse the core task.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Provide Examples
&lt;/h2&gt;

&lt;p&gt;Examples are one of the most powerful tools for ensuring consistent AI behavior. They show rather than tell the AI what you want.&lt;/p&gt;

&lt;h3&gt;
  
  
  Types of Examples to Include:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Input-Output Examples&lt;/strong&gt;: Show the AI exactly what kind of input it will receive and what output you expect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Format Examples&lt;/strong&gt;: Demonstrate the exact structure, tone, and style you want in responses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edge Case Examples&lt;/strong&gt;: Show how to handle unusual or problematic inputs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Negative Examples&lt;/strong&gt;: Include examples of what NOT to do, which can be as valuable as positive examples.&lt;/p&gt;

&lt;h3&gt;
  
  
  Best Practices for Examples:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Include 2-3 examples minimum for consistency&lt;/li&gt;
&lt;li&gt;Make examples diverse to cover different scenarios&lt;/li&gt;
&lt;li&gt;Keep examples concise but comprehensive&lt;/li&gt;
&lt;li&gt;Update examples based on real-world performance&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to Write Good Prompts
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The CLEAR Framework:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;C&lt;/strong&gt;ontext: Provide necessary background information&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;L&lt;/strong&gt;ength: Specify desired response length&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;E&lt;/strong&gt;xamples: Include relevant examples&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A&lt;/strong&gt;udience: Define who the response is for&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;R&lt;/strong&gt;ole: Clearly define the AI's role and expertise&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Additional Best Practices:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Test your prompts with various inputs&lt;/li&gt;
&lt;li&gt;Iterate based on actual performance&lt;/li&gt;
&lt;li&gt;Keep prompts as concise as possible while maintaining clarity&lt;/li&gt;
&lt;li&gt;Use consistent terminology throughout&lt;/li&gt;
&lt;li&gt;Version control your prompts for tracking improvements&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Examples of Good and Bad Prompts
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Example 1: Content Creation
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;❌ Bad Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;prompt&amp;gt;&lt;/span&gt;
Write about dogs.
&lt;span class="nt"&gt;&amp;lt;/prompt&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ Good Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;prompt&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;role&amp;gt;&lt;/span&gt;You are an expert pet care writer with 5 years of experience creating educational content for dog owners.&lt;span class="nt"&gt;&amp;lt;/role&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;goal&amp;gt;&lt;/span&gt;Create an informative blog post about dog training basics that will help new dog owners establish good behaviors in their pets.&lt;span class="nt"&gt;&amp;lt;/goal&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;instructions&amp;gt;&lt;/span&gt;
1. Write a 800-1000 word blog post about basic dog training
2. Include practical, actionable advice
3. Structure with clear headings and subheadings
4. Use a friendly, encouraging tone
5. Include 3-4 specific training techniques
6. End with a brief summary of key points
7. Avoid mentioning specific dog breeds unless necessary for context
&lt;span class="nt"&gt;&amp;lt;/instructions&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;examples&amp;gt;&lt;/span&gt;
Good section example:
"## Positive Reinforcement Training
Positive reinforcement is the foundation of effective dog training. When your dog performs a desired behavior, immediately reward them with treats, praise, or play. This creates a positive association..."

Bad section example:
"Dogs are bad when they don't listen. You should punish them when they're bad."
&lt;span class="nt"&gt;&amp;lt;/examples&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;output_format&amp;gt;&lt;/span&gt;
- Use markdown formatting
- Include H2 headings for main sections
- Write in second person (addressing the dog owner directly)
- Include actionable bullet points where appropriate
&lt;span class="nt"&gt;&amp;lt;/output_format&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/prompt&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example 2: Data Analysis
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;❌ Bad Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;prompt&amp;gt;&lt;/span&gt;
Look at this sales data and tell me what's happening.
&lt;span class="nt"&gt;&amp;lt;/prompt&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ Good Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;prompt&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;role&amp;gt;&lt;/span&gt;You are a senior business analyst specializing in e-commerce sales performance with expertise in identifying trends and providing actionable insights.&lt;span class="nt"&gt;&amp;lt;/role&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;goal&amp;gt;&lt;/span&gt;Analyze the provided quarterly sales data to identify key trends, opportunities, and areas of concern that require management attention.&lt;span class="nt"&gt;&amp;lt;/goal&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;instructions&amp;gt;&lt;/span&gt;
1. Review the sales data for Q1-Q3 2024
2. Identify the top 3 positive trends and top 3 areas of concern
3. Calculate month-over-month and quarter-over-quarter growth rates
4. Compare performance against industry benchmarks (if available)
5. Provide specific, actionable recommendations for Q4
6. Focus on metrics that directly impact revenue and profitability
7. Do not speculate beyond what the data supports
&lt;span class="nt"&gt;&amp;lt;/instructions&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;data_context&amp;gt;&lt;/span&gt;
The data includes: monthly revenue, number of transactions, average order value, customer acquisition cost, and return rate across three product categories (electronics, clothing, home goods).
&lt;span class="nt"&gt;&amp;lt;/data_context&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;output_format&amp;gt;&lt;/span&gt;
## Executive Summary
[2-3 sentence overview]

## Key Findings
### Positive Trends
[Numbered list with specific data points]

### Areas of Concern  
[Numbered list with specific data points]

## Recommendations
[Actionable steps with expected impact]

## Supporting Data
[Relevant calculations and metrics]
&lt;span class="nt"&gt;&amp;lt;/output_format&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;examples&amp;gt;&lt;/span&gt;
Good finding example:
"Electronics revenue increased 23% QoQ driven by a 15% increase in average order value ($127 to $146) while maintaining stable conversion rates at 3.2%."

Bad finding example:
"Sales went up which is good for business."
&lt;span class="nt"&gt;&amp;lt;/examples&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/prompt&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example 3: Code Review
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;❌ Bad Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;prompt&amp;gt;&lt;/span&gt;
Review this code and make it better.
&lt;span class="nt"&gt;&amp;lt;/prompt&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ Good Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;prompt&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;role&amp;gt;&lt;/span&gt;You are a senior software engineer with expertise in Python, code quality, and best practices. You conduct thorough code reviews focusing on functionality, maintainability, and security.&lt;span class="nt"&gt;&amp;lt;/role&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;goal&amp;gt;&lt;/span&gt;Provide a comprehensive code review that identifies issues, suggests improvements, and ensures the code meets professional standards.&lt;span class="nt"&gt;&amp;lt;/goal&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;instructions&amp;gt;&lt;/span&gt;
1. Review the provided Python function for correctness and efficiency
2. Check for potential security vulnerabilities
3. Evaluate code readability and maintainability
4. Suggest specific improvements with code examples
5. Identify any missing error handling
6. Comment on naming conventions and documentation
7. Rate the overall code quality on a scale of 1-10 with justification
8. Prioritize suggestions by impact (high, medium, low)
&lt;span class="nt"&gt;&amp;lt;/instructions&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;review_criteria&amp;gt;&lt;/span&gt;
- Functionality: Does the code work as intended?
- Security: Are there any security risks?
- Performance: Can efficiency be improved?
- Maintainability: Is the code easy to read and modify?
- Standards: Does it follow Python best practices?
&lt;span class="nt"&gt;&amp;lt;/review_criteria&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;output_format&amp;gt;&lt;/span&gt;
## Summary
[Overall assessment and quality score]

## Critical Issues (Fix Immediately)
[High priority items with code examples]

## Improvements (Recommended)
[Medium priority suggestions]

## Minor Enhancements (Optional)
[Low priority, nice-to-have changes]

## Revised Code
[Improved version of the original code]
&lt;span class="nt"&gt;&amp;lt;/output_format&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;examples&amp;gt;&lt;/span&gt;
Good feedback example:
"**Security Issue**: Line 23 uses string concatenation for SQL queries, creating a SQL injection vulnerability. Replace with parameterized queries:cursor.execute("SELECT * FROM users WHERE id = %s", (user_id,))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Creating predictable AI agents requires thoughtful prompt engineering. By defining clear roles, specific goals, and detailed instructions, you can significantly improve the consistency and quality of AI outputs. Remember to iterate on your prompts based on real-world performance and always include relevant examples to guide the AI's behavior.&lt;/p&gt;

&lt;p&gt;The key to success is being explicit about your expectations while providing enough context for the AI to understand the task fully. With practice, you'll develop an intuition for crafting prompts that produce reliable, high-quality results.&lt;/p&gt;

&lt;p&gt;Website: &lt;a href="https://whoschris.dev" rel="noopener noreferrer"&gt;https://whoschris.dev&lt;/a&gt;&lt;br&gt;
LinkedIn: &lt;a href="https://www.linkedin.com/in/christopher-clemmons/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/christopher-clemmons/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>automation</category>
      <category>llm</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How I Built a Real-Time IoT Alert System with DynamoDB and Lambda In 4 Days</title>
      <dc:creator>Christopher </dc:creator>
      <pubDate>Thu, 31 Jul 2025 22:36:42 +0000</pubDate>
      <link>https://dev.to/christopherclemmons/i-built-an-enterprise-ready-cold-chain-alert-system-from-scratch-in-7-days-49dg</link>
      <guid>https://dev.to/christopherclemmons/i-built-an-enterprise-ready-cold-chain-alert-system-from-scratch-in-7-days-49dg</guid>
      <description>&lt;p&gt;Over the week, I built a new project for my portfolio. The purpose of this project is to demonstrate my opinionated approach to developing a cost-optimized, autoscaling and compliant alert monitoring system in the cloud.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a Cold Chain Monitoring Platform?
&lt;/h2&gt;

&lt;p&gt;Simply, it's a system that monitors temperature sensors from warehouses and commercial vehicles, sends alerts and maintains records for compliance. &lt;/p&gt;

&lt;p&gt;Pharmaceutical manufactures loose a lot of money by not being able to stay compliant and losses due to discarding merchandise that were exposes to unsafe temperatures. Temperature excursions can make medication and other chemical products ineffective or even dangerous.&lt;/p&gt;

&lt;p&gt;It's serious. &lt;/p&gt;

&lt;p&gt;This means that if someone isn't tracking the temperature of your medication, you can end up getting a bad batch that may cause a negative reaction when you take it.&lt;/p&gt;

&lt;p&gt;This sounds like a real problem worth solving.&lt;/p&gt;

&lt;h2&gt;
  
  
  Defining the MVP
&lt;/h2&gt;

&lt;p&gt;Breaking this down molecularly allowed me to focus only on the core features. By defining the functional and non-functional requirements ahead of time prevented me from building things I don't need.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ih5v78v06kc92j3gw2p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ih5v78v06kc92j3gw2p.png" alt="Cold Chain Monitoring Platform AWS" width="800" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Functional Requirements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Users can sign up and authenticate using AWS Cognito&lt;/li&gt;
&lt;li&gt;IoT devices send temperature and humidity readings to AWS IoT Core&lt;/li&gt;
&lt;li&gt;Lambda functions process sensor data and store it in DynamoDB&lt;/li&gt;
&lt;li&gt;Users can query the latest 50 sensor readings via a secured API Gateway endpoint&lt;/li&gt;
&lt;li&gt;Alerts are triggered and published to an SNS topic when temperature excursions occur&lt;/li&gt;
&lt;li&gt;Admin users can view excursion counts and individual device status on a dashboard&lt;/li&gt;
&lt;li&gt;An email notification is sent when an excursion is detected&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Non-Functional Requirements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;System must support at least 5,000 devices concurrently&lt;/li&gt;
&lt;li&gt;APIs should respond in under 500ms under normal load&lt;/li&gt;
&lt;li&gt;All services must be deployed using Infrastructure as Code (Terraform)&lt;/li&gt;
&lt;li&gt;The application must enforce JWT-based authentication for all API endpoints&lt;/li&gt;
&lt;li&gt;System must auto-scale based on demand using AWS Lambda concurrency&lt;/li&gt;
&lt;li&gt;All data must be encrypted in transit and at rest&lt;/li&gt;
&lt;li&gt;System uptime should meet 99.9% availability&lt;/li&gt;
&lt;li&gt;Audit logs must be retained for a minimum of 90 days&lt;/li&gt;
&lt;li&gt;Dashboard should be mobile-responsive and accessible&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Project structure
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cold-chain-platform/
├── terraform/
│   ├── modules/
│   │   ├── iot-core/
│   │   ├── lambda-function/
│   │   ├── dynamodb/
│   │   ├── sns/
│   │   ├── eventbridge/
│   │   └── s3-archive/
│   ├── environments/
│   │   ├── dev/
│   │   │   ├── main.tf
│   │   │   ├── variables.tf
│   │   │   ├── terraform.tfvars
│   │   │   └── backend.tf
│   │   └── prod/
│   └── versions.tf
├── lambdas/
│   ├── simulate_sensor/
│   │   ├── index.js
│   │   └── function.zip
 ├── other functions.../
│   │   ├── index.js
│   │   └── function.zip
├── docs/
│   ├── architecture.png
│   ├── api-spec.yaml
│   └── compliance.md
├── .gitignore
├── README.md
└── LICENSE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Client-Layer / Frontend:&lt;/strong&gt; &lt;br&gt;
AWS Amplify (Using React.js + Typescript) for rapid development and deployment of a UI for the monitoring dashboard. Amazon Cognito handles the authentication. The routes on the API Gateway have jwt authorizers that will only allow admins from the application's user pool to sign in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcwvmqe3s62n0hjcs8hvt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcwvmqe3s62n0hjcs8hvt.png" alt=" " width="800" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Business Logic / Backend:&lt;/strong&gt;&lt;br&gt;
Lambda and IoT core processes and retrieves data from sensor. EventBridge is used as a broker to handle the notification events to SNS. In the project, I created an extra Lambda function to simulate temperature excursion events instead of wasting my money buying thousands of thermometers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Layer / Database:&lt;/strong&gt; &lt;br&gt;
I went with DynamoDB because I needed something that could scale easily without having to worry about server management or performance bottlenecks. Since the system is event-driven and real-time, low-latency access was a must.&lt;/p&gt;

&lt;p&gt;DynamoDB also gives me the flexibility to evolve the data model as needed without dealing with rigid schemas or painful migrations. It integrates seamlessly with other AWS services I’m using, like Lambda and SNS, and features like TTL and Streams made it a no-brainer for handling time-based data and triggering actions based on updates.&lt;/p&gt;
&lt;h2&gt;
  
  
  Security first
&lt;/h2&gt;

&lt;p&gt;Each Lambda has its own IAM policies and strict permissions giving it the least amount of privileges possible. Combining AWS amplify with the other resources in this diagram ensures that data is encrypted in transit and at rest.&lt;/p&gt;

&lt;p&gt;Below is a sample of an IAM policy in Terraform attached to a Lambda function only allowing database limited actions to DynamoDB.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aws_iam_policy&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dynamodb_access&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;${var.function_name}-ddb-access&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;     &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;Name&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;custom&lt;/span&gt; &lt;span class="nx"&gt;policy&lt;/span&gt;

  &lt;span class="nx"&gt;policy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;jsonencode&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="nx"&gt;Version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2012-10-17&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;Statement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;Effect&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Allow&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="nx"&gt;Action&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
          &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dynamodb:PutItem&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;reading&lt;/span&gt;
          &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dynamodb:Scan&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;      &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;get_process_reading_records&lt;/span&gt;
          &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dynamodb:GetItem&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;    &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;optional&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;more&lt;/span&gt; &lt;span class="nx"&gt;flexibility&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;Only&lt;/span&gt; &lt;span class="nx"&gt;allow&lt;/span&gt; &lt;span class="nx"&gt;inserting&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;
        &lt;span class="nx"&gt;Resource&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dynamodb_table_arn&lt;/span&gt;      &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;Target&lt;/span&gt; &lt;span class="nx"&gt;DynamoDB&lt;/span&gt; &lt;span class="nx"&gt;table&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  SNS Notifications
&lt;/h2&gt;

&lt;p&gt;I set a dummy temperature threshold to trigger email alerts using EventBridge. The Lambda function uses an &lt;code&gt;IF/ELSE&lt;/code&gt; statement to determine if an email should be sent or not.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcgpcvhpfq95b7241exj5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcgpcvhpfq95b7241exj5.png" alt=" " width="800" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Lambda timeouts&lt;/strong&gt;: I was able to resolve the issue by simply increasing the timeout value. I tested this with 5,000 which is a moderate testing size for a demo.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;simulations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;temp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Random temp between 0–10°C&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;deviceId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`sensor-&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;temperature&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;temp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;humidity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="c1"&gt;// Humidity between 30–60%&lt;/span&gt;
      &lt;span class="na"&gt;battery&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;  &lt;span class="c1"&gt;// Battery 50–100%&lt;/span&gt;
      &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;temp&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ALERT&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;OK&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;               &lt;span class="c1"&gt;// If temp &amp;gt; 8°C → mark as alert&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;TEMPERATURE_READING&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;location&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;facility&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Pfizer DC - Detroit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;zone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Zone-&lt;/span&gt;&lt;span class="p"&gt;${(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;gps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;lat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;42.3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;  &lt;span class="c1"&gt;// Simulate Detroit lat&lt;/span&gt;
          &lt;span class="na"&gt;lon&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;83.0&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="c1"&gt;// Simulate Detroit lon&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another mistake that wasn't obvious is when I received a &lt;code&gt;500 Server Error&lt;/code&gt; with no explanation anywhere. I created a log group in CloudWatch that captured each AWS resource that's involved in the sensor reading lifecycle. I was able to see that the error was cause by me not stringifying the Lambda response from DynamoDB&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;exports&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;handler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;🔒 Event received:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

  &lt;span class="c1"&gt;// Check if authorizer is attached and parsed&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;claims&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;requestContext&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;authorizer&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;jwt&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;claims&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;claims&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;🚨 Missing Cognito claims&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;401&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Unauthorized: No claims&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// 📥 Query the DynamoDB table for up to 50 of the most recent sensor readings&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ScanCommand&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;TableName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DYNAMODB_TABLE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Table name injected via environment variable&lt;/span&gt;
        &lt;span class="na"&gt;Limit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Prevent loading too many records to maintain speed and reduce cost&lt;/span&gt;
      &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// ✅ On success, return the sensor readings as a JSON response&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Items&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="c1"&gt;// ✅ API Gateway requires body to be a string&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// ❌ If something goes wrong (e.g., missing permissions or table), return a 500 error&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Error fetching data from DynamoDB&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Include the raw error for debugging visibility&lt;/span&gt;
      &lt;span class="p"&gt;}),&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Final thoughts and future improvements.
&lt;/h2&gt;

&lt;p&gt;As I continue refining this platform, I’m also thinking about how to harden it for real-world enterprise use. Improving security means enforcing strict IAM roles, using customer-managed KMS keys, and enabling detailed audit logs through CloudTrail. &lt;/p&gt;

&lt;p&gt;For compliance, adding automated AWS Config rules and security checks through tools like AWS Security Hub can help flag misconfigurations early. &lt;/p&gt;

&lt;p&gt;Regarding reliability for real-world use, I’d look at adding retry logic, dead-letter queues, and chaos testing to make sure the system gracefully handles edge cases and unexpected failures. These are the kinds of things that turn a functional prototype into a battle-tested backend that real businesses can trust.&lt;/p&gt;

&lt;p&gt;If you're building something similar or just enjoy talking backend architecture, hit me up — would love to hear what you're working on.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://whoschris.dev" rel="noopener noreferrer"&gt;https://whoschris.dev&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to build a startup service for Node.js server (DEAD SIMPLE)</title>
      <dc:creator>Christopher </dc:creator>
      <pubDate>Mon, 30 Sep 2024 23:12:11 +0000</pubDate>
      <link>https://dev.to/christopherclemmons/how-to-build-a-startup-service-for-nodejs-server-dead-simple-4lmn</link>
      <guid>https://dev.to/christopherclemmons/how-to-build-a-startup-service-for-nodejs-server-dead-simple-4lmn</guid>
      <description>&lt;p&gt;Here is your text converted into rich text format:&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;How to build a startup service for Node.js server (DEAD SIMPLE)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;September 30th, 2024 06:11&lt;/em&gt;&lt;br&gt;&lt;br&gt;
Tags: [work] [4 - Indexes/Computer Science | Computer Science] [system design]&lt;/p&gt;

&lt;p&gt;If you just want an easy way to ensure that your Node.js app stays running no matter what, you came to the right place. This guide will ensure that you have a reliable auto-running Node.js backend for your full stack application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Install pm2&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; pm2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Afterwards, verify the installation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pm2 &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you've verified the installation, go into the root of your Node.js project and add a file called &lt;code&gt;ecosystem.config.js&lt;/code&gt;. This will be what &lt;code&gt;pm2&lt;/code&gt; uses to start up the Node backend automatically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ecosystem.config.js&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;apps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;rcm-server&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;npm&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;start&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;watch&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;NODE_ENV&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;production&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Start pm2 service&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run the following command to bind your app's process to &lt;code&gt;pm2&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pm2 start ecosystem.config.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pm2 startup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And finally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pm2 save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Be sure to run any output command it tells you to ensure it gets saved in &lt;code&gt;pm2/dump.pm2&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That's it. Really.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Simple DETR Object Detection with Python</title>
      <dc:creator>Christopher </dc:creator>
      <pubDate>Thu, 13 Jun 2024 02:32:21 +0000</pubDate>
      <link>https://dev.to/christopherclemmons/simple-detr-object-detection-with-python-539c</link>
      <guid>https://dev.to/christopherclemmons/simple-detr-object-detection-with-python-539c</guid>
      <description>&lt;p&gt;DETR (DEtection TRansformer) is a deep learning model designed for object detection. It utilizes the Transformer architecture, initially created for natural language processing (NLP) tasks, as its core element to tackle the object detection challenge in an innovative and highly efficient way.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;I’d assume you have a background in programming with python. If not it should be installed on your computer before continuing.&lt;/p&gt;

&lt;p&gt;If you need to download Python, you can visit the official Python downloads page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.python.org/downloads/" rel="noopener noreferrer"&gt;Download Python&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create your virtual environment
&lt;/h3&gt;

&lt;p&gt;Create a virtual environment in python so you can run your packages separate from your host’s environment&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python -m venv myenv&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Activate virtual environment
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Windows&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;myenv\Scripts\activate&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mac&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;source myenv/bin/activate&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Install packages
&lt;/h3&gt;

&lt;p&gt;We will need to install a few packages before we get started.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;transformers&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt; &lt;span class="n"&gt;Pillow&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, create an &lt;code&gt;/images&lt;/code&gt; folder in the root of your project. This is where you will save your images to test your AI solution. Im using .jpg files from &lt;a href="http://www.unsplash.com" rel="noopener noreferrer"&gt;www.unsplash.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After saving an image into the /images directory, we can now start to write the code that will find our image and pass it into the &lt;code&gt;Image.open()&lt;/code&gt; method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;transformers&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;DetrImageProcessor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;DetrForObjectDetection&lt;/span&gt; 
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;PIL&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Image&lt;/span&gt; 

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;transformers&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;DetrImageProcessor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;current_dir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abspath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__file__&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;images_dir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abspath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current_dir&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;images&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Root directory:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;images_dir&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;image_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;images_dir&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;airplane.jpg&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;#
&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;image path:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;image_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Reading images from /images&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Processing image...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once this runs with no errors, we can confidently add the rest of our solution which will scan and provide the results of our image detection.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;processor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;DetrImageProcessor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_pretrained&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;facebook/detr-resnet-50&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;revision&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;no_timm&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;DetrForObjectDetection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_pretrained&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;facebook/detr-resnet-50&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;revision&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;no_timm&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;inputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;processor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;images&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;return_tensors&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pt&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;outputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;model&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;inputs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;target_sizes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tensor&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;[::&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]])&lt;/span&gt;

&lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;processor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post_process_object_detection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;outputs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;target_sizes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;target_sizes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;threshold&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.9&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;box&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;scores&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;labels&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;boxes&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
    &lt;span class="n"&gt;box&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;box&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tolist&lt;/span&gt;&lt;span class="p"&gt;()]&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Detected &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id2label&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;()]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; with confidence &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
            &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; at location &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;box&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After running server.py, you should get an output similar to this. The decimal numbers you see after &lt;code&gt;location&lt;/code&gt; are the coordinates of the area in your image that your model detected the object at.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;Reading&lt;/span&gt; &lt;span class="n"&gt;images&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;images&lt;/span&gt;
&lt;span class="n"&gt;Processing&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="bp"&gt;...&lt;/span&gt;
&lt;span class="n"&gt;Detected&lt;/span&gt; &lt;span class="n"&gt;bird&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;confidence&lt;/span&gt; &lt;span class="mf"&gt;0.992&lt;/span&gt; &lt;span class="n"&gt;at&lt;/span&gt; &lt;span class="n"&gt;location&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;55.82&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;32.17&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;225.04&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;225.28&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Potential business value
&lt;/h2&gt;

&lt;p&gt;Models like this can provide a lot of value to software services and products people interact with daily. &lt;/p&gt;

&lt;p&gt;Image detection models can detect things like cancer in clinical trials, assist autonomous vehicles with identifying red light and emergency signals or even prevent unauthorized access to systems and physical resources by detecting the identity of a user.&lt;/p&gt;

&lt;p&gt;Possibilities are endless.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/christopher-clemmons" rel="noopener noreferrer"&gt;Connect with me on LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>python</category>
      <category>objectdetection</category>
    </item>
  </channel>
</rss>
