<?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: mohd ibrahim</title>
    <description>The latest articles on DEV Community by mohd ibrahim (@mobrahi).</description>
    <link>https://dev.to/mobrahi</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%2F2621779%2Ff5d4d359-b209-4ff7-87fa-d42623bbb297.jpg</url>
      <title>DEV Community: mohd ibrahim</title>
      <link>https://dev.to/mobrahi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mobrahi"/>
    <language>en</language>
    <item>
      <title>Hackathon Project: How I built an AI Recommender System for SMEs</title>
      <dc:creator>mohd ibrahim</dc:creator>
      <pubDate>Sat, 11 Apr 2026 06:10:05 +0000</pubDate>
      <link>https://dev.to/mobrahi/hackathon-project-how-i-built-an-ai-recommender-system-for-smes-13</link>
      <guid>https://dev.to/mobrahi/hackathon-project-how-i-built-an-ai-recommender-system-for-smes-13</guid>
      <description>&lt;h2&gt;
  
  
  The Inspiration 💡
&lt;/h2&gt;

&lt;p&gt;We’ve all been there: you add five things to a cart, get distracted by a notification, and never look back. For small e-commerce businesses, that "lost cart" is a major hit to the bottom line. I wanted to build a tool that doesn't just track data, but actually predicts who is about to leave and what might make them stay.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is SmartCart AI? 🛒
&lt;/h2&gt;

&lt;p&gt;SmartCart AI is a predictive analytics dashboard designed for e-commerce managers. It takes massive transaction datasets and turns them into three actionable insights:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Churn Prediction: Who is "at-risk" of never coming back?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Customer Health: Visualizing the purchase "pulse" of every user.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Smart Recommendations: What should we offer them next?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Tech Stack 🛠️
&lt;/h2&gt;

&lt;p&gt;Building this required a mix of data engineering and machine learning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Language: Python 3.12&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Frontend: Streamlit (for that snappy, interactive UI)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data Processing: Pandas &amp;amp; NumPy&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Machine Learning: Scikit-Learn&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Random Forest Classifier for churn risk.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Collaborative Filtering for the recommendation engine.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Visuals: Plotly for the behavioral timelines.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The "Aha!" Moment: Solving the Cold Start ❄️
&lt;/h2&gt;

&lt;p&gt;One of the biggest hurdles was the Cold Start problem—how do you recommend products to a brand-new user with no history? I solved this by implementing a "Popularity Fallback" logic: if the AI doesn't know you yet, it shows you what everyone else is loving until it learns your patterns.&lt;/p&gt;

&lt;h2&gt;
  
  
  Under the Hood: How it Works 🧠
&lt;/h2&gt;

&lt;p&gt;The system uses RFM Analysis (Recency, Frequency, Monetary) to score customers. We then feed these features into a Random Forest model.&lt;/p&gt;






&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Quick snippet of the Churn Classification logic
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sklearn.ensemble&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;RandomForestClassifier&lt;/span&gt;

&lt;span class="c1"&gt;# Training the model on RFM features
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;RandomForestClassifier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n_estimators&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;random_state&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X_train&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y_train&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Predicting the probability of churn
&lt;/span&gt;&lt;span class="n"&gt;churn_probability&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;predict_proba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_data&lt;/span&gt;&lt;span class="p"&gt;)[:,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Key Challenges 🚧
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Data Cleaning: Handling 500k+ rows of retail data was a lesson in patience. Cleaning up cancelled invoices and missing IDs was 70% of the work!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Memory Management: Learning to optimize similarity matrices so the app doesn't crash on a standard laptop.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What’s Next? 🚀
&lt;/h2&gt;

&lt;p&gt;This is just the MVP. My roadmap for SmartCart AI includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Integrating directly with Shopify via API.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Adding "Sentiment Analysis" on product reviews to refine recommendations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deploying the model to the cloud for real-time streaming data.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Check it out!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repo:&lt;/strong&gt; &lt;a href="https://github.com/mobrahi/hackathon-smartcart-ai" rel="noopener noreferrer"&gt;https://github.com/mobrahi/hackathon-smartcart-ai&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Demo Video:&lt;/strong&gt; &lt;a href="https://youtu.be/0tyZ6bO2QiQ" rel="noopener noreferrer"&gt;https://youtu.be/0tyZ6bO2QiQ&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;I’d love to hear your thoughts! How are you handling churn in your data projects? Let's discuss in the comments! 👇&lt;/p&gt;

</description>
      <category>python</category>
      <category>machinelearning</category>
      <category>showdev</category>
      <category>datascience</category>
    </item>
    <item>
      <title>😅 5 Beginner Mistakes I Made Learning Python (So You Don’t Have To)</title>
      <dc:creator>mohd ibrahim</dc:creator>
      <pubDate>Fri, 27 Feb 2026 15:58:26 +0000</pubDate>
      <link>https://dev.to/mobrahi/5-beginner-mistakes-i-made-learning-python-so-you-dont-have-to-4939</link>
      <guid>https://dev.to/mobrahi/5-beginner-mistakes-i-made-learning-python-so-you-dont-have-to-4939</guid>
      <description>&lt;p&gt;When I started learning &lt;strong&gt;Python&lt;/strong&gt; (with &lt;strong&gt;Machine Learning&lt;/strong&gt; as the long-term goal), I thought the hardest part would be syntax.&lt;/p&gt;

&lt;p&gt;Plot twist:&lt;/p&gt;

&lt;p&gt;It wasn’t syntax.&lt;/p&gt;

&lt;p&gt;It was me.&lt;/p&gt;

&lt;p&gt;Here are 5 beginner mistakes I made in my first weeks learning Python — and what I’d do differently now.&lt;/p&gt;




&lt;h2&gt;
  
  
  1️⃣ Trying to Jump Into Machine Learning Too Fast
&lt;/h2&gt;

&lt;p&gt;I started learning Python because I wanted to build ML systems.&lt;/p&gt;

&lt;p&gt;So naturally, after learning some basics, I thought:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Okay cool… time to train models.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Yeah… not quite.&lt;/p&gt;

&lt;p&gt;I quickly realized:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I didn’t fully understand loops&lt;/li&gt;
&lt;li&gt;My logic was shaky&lt;/li&gt;
&lt;li&gt;Debugging took forever&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔎 &lt;strong&gt;Lesson learned:&lt;/strong&gt;&lt;br&gt;
Strong Python fundamentals make Machine Learning 10x less painful. Don’t skip the boring stuff.&lt;/p&gt;




&lt;h2&gt;
  
  
  2️⃣ Underestimating &lt;code&gt;if / else&lt;/code&gt; Logic
&lt;/h2&gt;

&lt;p&gt;I thought conditionals were simple.&lt;/p&gt;

&lt;p&gt;Then I wrote programs where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Conditions never triggered&lt;/li&gt;
&lt;li&gt;Conditions always triggered&lt;/li&gt;
&lt;li&gt;Nested logic confused even me&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Python ran the code…&lt;br&gt;
It just didn’t behave the way I expected.&lt;/p&gt;

&lt;p&gt;🔎 &lt;strong&gt;Lesson learned:&lt;/strong&gt;&lt;br&gt;
Programming is precise thinking. Small logic mistakes create big confusion.&lt;/p&gt;




&lt;h2&gt;
  
  
  3️⃣ Ignoring Error Messages (At First 😬)
&lt;/h2&gt;

&lt;p&gt;Whenever I saw a big red error message, my brain did this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Nope.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I used to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Re-run the code without reading the error&lt;/li&gt;
&lt;li&gt;Change random lines hoping it would magically work&lt;/li&gt;
&lt;li&gt;Copy-paste the entire error into Google&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Eventually I realized something important:&lt;/p&gt;

&lt;p&gt;Error messages are not enemies.&lt;br&gt;
They’re clues.&lt;/p&gt;

&lt;p&gt;🔎 &lt;strong&gt;Lesson learned:&lt;/strong&gt;&lt;br&gt;
Slow down. Read the error. It usually tells you exactly what went wrong.&lt;/p&gt;




&lt;h2&gt;
  
  
  4️⃣ Watching Too Many Tutorials
&lt;/h2&gt;

&lt;p&gt;I fell into tutorial mode.&lt;/p&gt;

&lt;p&gt;Watch.&lt;br&gt;
Follow along.&lt;br&gt;
Feel productive.&lt;br&gt;
Forget everything the next day.&lt;/p&gt;

&lt;p&gt;I wasn’t building anything independently.&lt;/p&gt;

&lt;p&gt;🔎 &lt;strong&gt;Lesson learned:&lt;/strong&gt;&lt;br&gt;
After every tutorial, build something small without copying.&lt;/p&gt;

&lt;p&gt;Even a simple calculator or number guessing game helps more than 3 extra videos.&lt;/p&gt;




&lt;h2&gt;
  
  
  5️⃣ Comparing My Progress to Everyone Else
&lt;/h2&gt;

&lt;p&gt;This one hit the hardest.&lt;/p&gt;

&lt;p&gt;I’d see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;People building ML projects&lt;/li&gt;
&lt;li&gt;Fancy dashboards&lt;/li&gt;
&lt;li&gt;AI demos everywhere&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Meanwhile, I was fighting with basic &lt;code&gt;input()&lt;/code&gt; statements.&lt;/p&gt;

&lt;p&gt;It’s easy to feel behind.&lt;/p&gt;

&lt;p&gt;But here’s what I realized:&lt;/p&gt;

&lt;p&gt;Everyone posts their highlights.&lt;br&gt;
Nobody posts their broken &lt;code&gt;if&lt;/code&gt; statements.&lt;/p&gt;

&lt;p&gt;🔎 &lt;strong&gt;Lesson learned:&lt;/strong&gt;&lt;br&gt;
Compare yourself to yesterday-you. Not to the internet.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 What I’m Doing Differently Now
&lt;/h2&gt;

&lt;p&gt;Instead of rushing, I’m:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Focusing on logic first&lt;/li&gt;
&lt;li&gt;✅ Writing small but complete programs&lt;/li&gt;
&lt;li&gt;✅ Reading error messages properly&lt;/li&gt;
&lt;li&gt;✅ Building more, consuming less&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Machine Learning is still the goal.&lt;/p&gt;

&lt;p&gt;But I’m choosing progress over ego.&lt;/p&gt;




&lt;h2&gt;
  
  
  💬 If You’re Learning Python Too…
&lt;/h2&gt;

&lt;p&gt;What beginner mistake slowed you down the most?&lt;/p&gt;

&lt;p&gt;Or which one are you currently fixing?&lt;/p&gt;

&lt;p&gt;Let’s compare notes — I’m still learning too.&lt;/p&gt;




</description>
      <category>python</category>
      <category>beginners</category>
      <category>machinelearning</category>
      <category>learningtocode</category>
    </item>
    <item>
      <title>Introducing Repo-Pulse: Stop Repo Rot Before It Starts</title>
      <dc:creator>mohd ibrahim</dc:creator>
      <pubDate>Sun, 15 Feb 2026 03:40:22 +0000</pubDate>
      <link>https://dev.to/mobrahi/introducing-repo-pulse-stop-repo-rot-before-it-starts-4gbd</link>
      <guid>https://dev.to/mobrahi/introducing-repo-pulse-stop-repo-rot-before-it-starts-4gbd</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/github-2026-01-21"&gt;GitHub Copilot CLI Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I built Repo-Pulse, a high-speed repository health diagnostic tool that calculates an "Overall Health Score" based on documentation, git history, and project hygiene. &lt;/p&gt;

&lt;p&gt;The goal of this project was to solve "Project Debt"—that common situation where a repository is functional but lacks the professional "finishing touches" (like a proper license, a clean .gitignore, or a readable README) that make it open-source ready. Repo-Pulse provides a 30-second "vibe check," generating a weighted health score and offering an automated --fix engine to generate missing boilerplate files instantly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;The tool is designed for easy testing. No credentials required.&lt;/p&gt;

&lt;p&gt;GitHub Repository: &lt;a href="https://github.com/mobrahi/repo-pulse" rel="noopener noreferrer"&gt;https://github.com/mobrahi/repo-pulse&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How to test it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;git clone &lt;a href="https://github.com/mobrahi/repo-pulse.git" rel="noopener noreferrer"&gt;https://github.com/mobrahi/repo-pulse.git&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;pip install -e .&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run repo-pulse to see your current score.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Delete your LICENSE and run repo-pulse --fix to see the auto-remediation engine in action!&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  My Experience with GitHub Copilot CLI
&lt;/h2&gt;

&lt;p&gt;I treated GitHub Copilot (leveraging the Claude 4.5 Haiku model) as my Lead Architect rather than just a code generator.&lt;/p&gt;

&lt;p&gt;How it impacted my development:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Enforcing Quality Gates: Right from the start, I prompted the CLI to maintain strict type-hinting and PEP 8 standards. This turned a "quick hack" into a professional-grade package.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Intelligent Filtering: When building the file-counting logic, Copilot correctly identified that we needed to exclude "noise" directories (like .venv, &lt;strong&gt;pycache&lt;/strong&gt;, and node_modules) to give an accurate project size reading.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Zero-Friction Pivoting: When I decided to add the --fix feature mid-build, the AI seamlessly adapted the existing argparse structure to include the new logic, demonstrating the agility of AI-pair programming.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Error Resilience: Copilot proactively suggested try/except blocks for the Git subprocess calls, ensuring the tool doesn't crash if run in a directory without a Git history.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using the Copilot CLI allowed me to focus 100% on the intent and ux of the tool, while the AI handled the boilerplate and technical edge cases. It turned what would have been a few hours of documentation-diving into a 30-minute creative sprint.&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%2F79tjcw4m6wbmpwpkqasa.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%2F79tjcw4m6wbmpwpkqasa.png" alt="VS Code terminal showing GitHub Copilot CLI initializing a search for project instruction files in the repo-pulse directory." width="800" height="619"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>githubchallenge</category>
      <category>cli</category>
      <category>githubcopilot</category>
    </item>
    <item>
      <title>🔄 Loops in Python: Why My Brain Kept Going in Circles</title>
      <dc:creator>mohd ibrahim</dc:creator>
      <pubDate>Fri, 13 Feb 2026 11:39:56 +0000</pubDate>
      <link>https://dev.to/mobrahi/loops-in-python-why-my-brain-kept-going-in-circles-59bg</link>
      <guid>https://dev.to/mobrahi/loops-in-python-why-my-brain-kept-going-in-circles-59bg</guid>
      <description>&lt;h1&gt;
  
  
  🌀 The "Infinite" Struggle: Making Loops Click
&lt;/h1&gt;

&lt;p&gt;If you thought &lt;code&gt;if/else&lt;/code&gt; was tricky, let me introduce you to the &lt;strong&gt;Loop&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;When I first started, I understood the &lt;em&gt;definition&lt;/em&gt; of a loop, but when it came to actually writing one? My brain just stalled. I either created a loop that never stopped (RIP my computer fans) or a loop that didn't run at all.&lt;/p&gt;




&lt;h2&gt;
  
  
  🤖 For vs. While: The Identity Crisis
&lt;/h2&gt;

&lt;p&gt;I used to stare at the screen wondering: &lt;em&gt;"Which one do I pick?"&lt;/em&gt; Here is how I finally broke them down in my head:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The &lt;code&gt;for&lt;/code&gt; loop: The "List Follower"
&lt;/h3&gt;

&lt;p&gt;I think of a &lt;code&gt;for&lt;/code&gt; loop like a waiter at a table. It knows exactly how many people (items) are there, and it visits each one until the job is done. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Breakthrough:&lt;/strong&gt; Understanding that the variable (like &lt;code&gt;i&lt;/code&gt; or &lt;code&gt;item&lt;/code&gt;) changes &lt;strong&gt;automatically&lt;/strong&gt; every time. You don't have to tell it to move to the next item; it just knows.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. The &lt;code&gt;while&lt;/code&gt; loop: The "Security Guard"
&lt;/h3&gt;

&lt;p&gt;A &lt;code&gt;while&lt;/code&gt; loop is like a security guard: &lt;em&gt;"As long as this condition is true, keep doing the thing."&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Struggle:&lt;/strong&gt; The dreaded &lt;strong&gt;Infinite Loop&lt;/strong&gt;. If you forget to change the condition inside the loop, it stays true forever. My first &lt;code&gt;while&lt;/code&gt; loop printed "Hello" 10,000 times before I figured out how to kill the terminal.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ❌ The "Wrong" Way (The Infinite Loop)
&lt;/h2&gt;

&lt;p&gt;This is what I did the first time. I set a condition, but I forgot to "change the world" inside the loop.&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="c1"&gt;# Goal: Count to 5
&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;5&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;Counting: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;counter&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;span class="c1"&gt;# Whoops! I forgot to add 1 to the counter.
&lt;/span&gt;    &lt;span class="c1"&gt;# This prints "Counting: 1" forever.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;✅ The "Right" Way (The Fix)&lt;br&gt;
The fix is simple, but it’s the logic that matters: you have to "update" the state so the condition eventually becomes False.&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="c1"&gt;# Goal: Count to 5
&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;5&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;Counting: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;counter&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;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;  &lt;span class="c1"&gt;# The magic line that saves your CPU!
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;💡 The "Aha!" Moment&lt;br&gt;
The biggest breakthrough for me was realizing:&lt;/p&gt;

&lt;p&gt;Use for when you know how many times you need to repeat (or you have a list/range).&lt;/p&gt;

&lt;p&gt;Use while when you don't know exactly when you’ll stop (like waiting for a user to type "quit").&lt;/p&gt;




&lt;p&gt;🎯 My New Strategy&lt;br&gt;
Instead of guessing, I now ask myself three questions before I type a single line of code:&lt;/p&gt;

&lt;p&gt;The Start: Where am I beginning?&lt;/p&gt;

&lt;p&gt;The Goal: When do I need to stop?&lt;/p&gt;

&lt;p&gt;The Step: How am I getting closer to that goal in every round?&lt;/p&gt;




&lt;p&gt;💬 Let’s Chat&lt;br&gt;
If you’re learning Python: What was the first "infinite loop" mistake you made? And if you're a pro: What's the one thing you wish someone told you about loops when you started?&lt;/p&gt;

&lt;p&gt;I'm still learning, so I'd love to hear your tips!&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>programming</category>
      <category>logic</category>
    </item>
    <item>
      <title>😅 What I Actually Did in My First Weeks Learning Python &amp; Machine Learning</title>
      <dc:creator>mohd ibrahim</dc:creator>
      <pubDate>Tue, 03 Feb 2026 03:14:58 +0000</pubDate>
      <link>https://dev.to/mobrahi/what-i-actually-did-in-my-first-weeks-learning-python-machine-learning-mh9</link>
      <guid>https://dev.to/mobrahi/what-i-actually-did-in-my-first-weeks-learning-python-machine-learning-mh9</guid>
      <description>&lt;h1&gt;
  
  
  😅 What I &lt;em&gt;Actually&lt;/em&gt; Did in My First Weeks Learning Python &amp;amp; Machine Learning
&lt;/h1&gt;

&lt;p&gt;You know the one: “A few tutorials, some practice… boom, AI engineer.”&lt;/p&gt;

&lt;p&gt;Yeah… no.&lt;/p&gt;

&lt;p&gt;Here’s what really happened in my &lt;strong&gt;first weeks learning Python and ML&lt;/strong&gt; — no hype, just reality.&lt;/p&gt;




&lt;h2&gt;
  
  
  🤯 What I &lt;em&gt;Thought&lt;/em&gt; Learning Python &amp;amp; ML Would Be Like
&lt;/h2&gt;

&lt;p&gt;I honestly believed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I’d jump straight into machine learning models&lt;/li&gt;
&lt;li&gt;Python would feel “natural” after a few days&lt;/li&gt;
&lt;li&gt;Tutorials would magically click&lt;/li&gt;
&lt;li&gt;Progress would be fast and obvious&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead, I mostly stared at my screen asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Why is this not working?”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🧩 What I &lt;em&gt;Actually&lt;/em&gt; Worked On
&lt;/h2&gt;

&lt;p&gt;Spoiler: not machine learning.&lt;/p&gt;

&lt;p&gt;My first weeks were all about &lt;strong&gt;Python basics&lt;/strong&gt; (and struggling with them).&lt;/p&gt;

&lt;p&gt;I spent most of my time on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🧠 Variables, input, output&lt;/li&gt;
&lt;li&gt;🔀 &lt;code&gt;if / elif / else&lt;/code&gt; (my new enemies)&lt;/li&gt;
&lt;li&gt;➕ Simple programs like calculators and BMI checkers&lt;/li&gt;
&lt;li&gt;🐛 Breaking my code… then breaking it again&lt;/li&gt;
&lt;li&gt;📖 Reading error messages I &lt;em&gt;used to ignore&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not glamorous. Very necessary.&lt;/p&gt;




&lt;h2&gt;
  
  
  😲 The Biggest Surprise
&lt;/h2&gt;

&lt;p&gt;Python didn’t surprise me with syntax.&lt;/p&gt;

&lt;p&gt;It surprised me with &lt;strong&gt;how much thinking it demands&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Python forces you to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Think step by step&lt;/li&gt;
&lt;li&gt;Be painfully clear with logic&lt;/li&gt;
&lt;li&gt;Admit when your thinking is wrong&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I learned this pretty fast:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Coding isn’t about typing code — it’s about solving problems without lying to yourself.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  😵 What Was Harder Than Expected
&lt;/h2&gt;

&lt;p&gt;Logic.&lt;br&gt;
Basic logic.&lt;/p&gt;

&lt;p&gt;Things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;❌ Why my &lt;code&gt;if&lt;/code&gt; condition never runs&lt;/li&gt;
&lt;li&gt;❌ Why my answer is always wrong&lt;/li&gt;
&lt;li&gt;❌ Why my program works &lt;em&gt;once&lt;/em&gt; and then refuses forever&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Painful lesson:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Python will happily run your code even if your logic makes zero sense.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Debugging quickly became part of my daily routine.&lt;/p&gt;




&lt;h2&gt;
  
  
  🤖 How This Changed How I See Machine Learning
&lt;/h2&gt;

&lt;p&gt;This phase gave me a reality check.&lt;/p&gt;

&lt;p&gt;I now understand that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Weak Python basics = suffering later in ML&lt;/li&gt;
&lt;li&gt;Machine learning is just logic… but louder&lt;/li&gt;
&lt;li&gt;Skipping fundamentals is a terrible idea&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So instead of rushing into ML, I slowed down — even though it felt uncomfortable.&lt;/p&gt;

&lt;p&gt;Turns out, slowing down is progress too.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 What I’m Focusing on Next
&lt;/h2&gt;

&lt;p&gt;Right now, I’m keeping it simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Stronger Python fundamentals&lt;/li&gt;
&lt;li&gt;✅ Small but complete programs&lt;/li&gt;
&lt;li&gt;✅ Logic first, complexity later&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Machine learning is still the goal.&lt;br&gt;
I’m just choosing the less painful path.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 One Small Lesson I’m Taking Forward
&lt;/h2&gt;

&lt;p&gt;If I had to summarize my first weeks learning Python and Machine Learning in one sentence, it would be this:&lt;/p&gt;

&lt;p&gt;Don’t rush toward “advanced” topics when the basics are still teaching you how to think.&lt;/p&gt;

&lt;p&gt;Learning Python slowed me down in a good way.&lt;br&gt;
It forced me to stop guessing and start reasoning.&lt;/p&gt;

&lt;p&gt;I didn’t build anything impressive yet — but I built patience, debugging skills, and a better way to approach problems.&lt;/p&gt;

&lt;p&gt;That feels like a solid foundation.&lt;/p&gt;




&lt;h2&gt;
  
  
  💬 Let’s Compare Notes
&lt;/h2&gt;

&lt;p&gt;If you’re learning Python or ML right now:&lt;/p&gt;

&lt;p&gt;What part confused you the most at the beginning?&lt;/p&gt;

&lt;p&gt;Or what do you wish you had slowed down on?&lt;/p&gt;

&lt;p&gt;I’d love to learn from your experience.&lt;/p&gt;




&lt;p&gt;👋 If you’re learning Python too, what confused you the most at the beginning?&lt;/p&gt;




</description>
      <category>python</category>
      <category>machinelearning</category>
      <category>beginners</category>
      <category>productivity</category>
    </item>
    <item>
      <title>SENTINEL.EXE | AI-Powered Firewall Defense</title>
      <dc:creator>mohd ibrahim</dc:creator>
      <pubDate>Sat, 31 Jan 2026 15:27:37 +0000</pubDate>
      <link>https://dev.to/mobrahi/sentinelexe-ai-powered-firewall-defense-37mf</link>
      <guid>https://dev.to/mobrahi/sentinelexe-ai-powered-firewall-defense-37mf</guid>
      <description>&lt;h3&gt;
  
  
  About Me
&lt;/h3&gt;

&lt;p&gt;I am Mohd Ibrahim, a Bootcamp Student and AI Explorer. As I head into 2026, I am focusing on bridging the gap between traditional software development and generative AI. With this portfolio project, I wanted to express that AI isn't just a "chatbot" interface—it can be a core engine for creativity, world-building, and dynamic systems in gaming.&lt;/p&gt;




&lt;h3&gt;
  
  
  Portfolio
&lt;/h3&gt;

&lt;h2&gt;
  
  
  🎮 &lt;a href="https://sentinel-exe-548506501812.asia-southeast1.run.app" rel="noopener noreferrer"&gt;Play SENTINEL.EXE Live Here&lt;/a&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; For the best experience, please use a Desktop browser.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;SENTINEL.EXE&lt;/strong&gt; is a cyber-noir Tower Defense game where the player defends a "Human History Core" from sentient logic bombs.&lt;/p&gt;

&lt;p&gt;Players take on the role of the last active security protocol in a dying supercomputer. Your mission is to deploy experimental subroutines (towers) to prevent sentient logic bombs (viruses) from reaching the "Human History Core."&lt;/p&gt;

&lt;p&gt;"In a world of collapsing data, you are the last line of defense."&lt;/p&gt;




&lt;h3&gt;
  
  
  The Tech Stack
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Engine&lt;/strong&gt;: Python 3.12 (Pygame-ce)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI&lt;/strong&gt;: Google Gemini 2.0 Flash (via google-genai SDK)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web Tech&lt;/strong&gt;: WebAssembly (WASM), Pygbag, Flask&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloud&lt;/strong&gt;: Google Cloud Run, Docker, Google Artifact Registry&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Google AI Integration
&lt;/h3&gt;

&lt;p&gt;I treated &lt;strong&gt;Gemini 2.0 Flash&lt;/strong&gt; as a critical system component rather than a gimmick:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Procedural Lore&lt;/strong&gt;: Gemini handles the world-building, generating unique backstories for the supercomputer environment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Event-Driven Architecture&lt;/strong&gt;: To keep the game at a smooth 60 FPS, I implemented an asynchronous pattern where AI calls are offloaded to background threads during "Pre-Wave" states.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Responsible AI &amp;amp; Robustness&lt;/strong&gt;: I built a Fail-Safe Architecture. If the API hits a rate limit or a network error occurs, the system gracefully falls back to a "Local Lore" subroutine, ensuring the game remains fully functional and immersive even offline.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  What I'm Most Proud Of
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I am most proud of the &lt;strong&gt;Robustness Logic&lt;/strong&gt; and the &lt;strong&gt;Thread-Safe AI Integration&lt;/strong&gt;. Offloading Gemini API calls to a background thread allowed me to keep the gameplay smooth while generating dynamic content in real-time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Integrating a cloud-based LLM into a real-time game loop presents significant latency challenges. Successfully implementing a background thread system that allows the game to render while waiting for &lt;strong&gt;Gemini&lt;/strong&gt;'s response—combined with a "Tactical Cooldown" to respect Free Tier rate limits—felt like a major engineering win. It demonstrates that AI-powered games can be both high-concept and technically stable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I'm particularly proud of the &lt;strong&gt;Environment-Aware Logic&lt;/strong&gt;. The game automatically detects if it's running in a browser or on a PC. It switches from a full AI-powered tactical advisor on desktop to a high-performance, local-fallback mode on the web, providing a seamless experience regardless of the platform.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Technical Hurdles
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. The Async Transition (Desktop vs. WebAssembly)
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;The Problem&lt;/strong&gt;: Pygame is traditionally a synchronous, blocking library designed for desktop CPUs. When I first tried to port the game to the web using Pygbag, the browser tab would completely freeze. The Solution: I had to refactor the entire core engine to use asyncio. By implementing await asyncio.sleep(0) inside the main loop, I allowed the browser’s JavaScript engine to "breathe," handling events and rendering frames without locking up the user's interface.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Managing the AI Bottleneck
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;The Problem&lt;/strong&gt;: Calling the Gemini API is a "heavy" I/O operation. If I called the AI directly inside the game loop, the game would "hitch" or pause for 1–2 seconds while waiting for the network response, killing the "real-time" feel of a tower defense game. The Solution: I implemented a multi-threaded/asynchronous approach. I moved the API calls to background threads and used asyncio.to_thread for the lore generation. This ensured that while Gemini was "thinking" of a gritty virus taunt, the towers were still firing and the viruses were still moving at a smooth 60 FPS.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Containerizing a Hybrid App
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;The Problem&lt;/strong&gt;: Running a Pygbag-built static site inside a Python Flask server on Google Cloud Run required a specific folder architecture that differed from my local development environment. I initially ran into ModuleNotFoundError because of how Python handles sub-directory imports. The Solution: I reorganized the project into a strict game/ and app/ structure. I used a custom Dockerfile to serve the Wasm-compiled assets via Flask, ensuring that Google Cloud Run could scale the game infinitely while maintaining the correct MIME types for the .wasm and .js files.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. The 'Ghost Layer' Architecture: Bypassing Static Analysis
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;The Problem&lt;/strong&gt;: The biggest hurdle was deploying a Python game with AI dependencies (Google GenAI) to the web. The Pygbag compiler normally crashes when it sees desktop-only libraries. I solved this by building a 'Ghost Layer' using importlib. This allowed me to dynamically load AI modules only on Desktop, effectively 'hiding' them from the web compiler and ensuring a stable WebAssembly build.&lt;/p&gt;




&lt;h3&gt;
  
  
  How to Play: Operation SENTINEL.EXE
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Objective&lt;/strong&gt;: Protect the Human History Core (the cyan square at the center) from incoming virus packets. If your system integrity hits 0%, the firewall is breached and the data is lost.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Deploying Defenses&lt;/strong&gt;: Click anywhere on the grid to deploy a Firewall Node (Tower).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cost: 50 Ghz (CPU Cycles) per node.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;CPU Cycles (Ghz)&lt;/strong&gt;: This is your primary resource. You gain 10 Ghz for every virus packet purged. Use them wisely—don't run out of "clock speed" when a big wave hits!&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;AI Tactical Advisor&lt;/strong&gt;: Press &lt;strong&gt;[H]&lt;/strong&gt; during gameplay to request a &lt;strong&gt;Tactical Sync&lt;/strong&gt;. Gemini will analyze your current integrity and cycles to provide a one-sentence defense tip. (Note: Has a 15-second cooldown to prevent CPU throttling).&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;** Lore Initialization** : Press &lt;strong&gt;[SPACE]&lt;/strong&gt; at the start menu to have Gemini generate the current wave's sector lore.&lt;/p&gt;

&lt;p&gt;** System Reboot** : If the core is breached, press &lt;strong&gt;[R]&lt;/strong&gt; to re-initialize the firewall and try a new strategy.&lt;/p&gt;




&lt;p&gt;💡 Pro-Tips &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Focus Fire&lt;/strong&gt;: Place nodes near the center to maximize their coverage of the core.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Manage Latency&lt;/strong&gt;: If playing on the web, look for the Local Fallback messages—they demonstrate the game's ability to remain playable even if the AI API is under heavy load.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>devchallenge</category>
      <category>googleaichallenge</category>
      <category>gemini</category>
      <category>devnewyear2026</category>
    </item>
  </channel>
</rss>
