<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[The Atomic Engine with Ahmed Adawy]]></title><description><![CDATA[Practical tutorials on reactor physics, scientific Python, numerical methods, and computational physics. Learn how to build nuclear reactor simulators from scratch.]]></description><link>https://adawy2026.substack.com</link><image><url>https://substackcdn.com/image/fetch/$s_!9vBM!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fc6ca1e-6f30-41df-ab7d-4663531d844a_992x992.png</url><title>The Atomic Engine with Ahmed Adawy</title><link>https://adawy2026.substack.com</link></image><generator>Substack</generator><lastBuildDate>Fri, 14 Aug 2026 19:21:22 GMT</lastBuildDate><atom:link href="https://adawy2026.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Ahmed Adawy]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[adawy2026@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[adawy2026@substack.com]]></itunes:email><itunes:name><![CDATA[Ahmed Adawy]]></itunes:name></itunes:owner><itunes:author><![CDATA[Ahmed Adawy]]></itunes:author><googleplay:owner><![CDATA[adawy2026@substack.com]]></googleplay:owner><googleplay:email><![CDATA[adawy2026@substack.com]]></googleplay:email><googleplay:author><![CDATA[Ahmed Adawy]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[🧪 Python Testing with pytest: A Practical Guide to Writing Reliable Tests From simple assertions to building a maintainable automated testing workflow]]></title><description><![CDATA[Writing Python code is only half of the job.]]></description><link>https://adawy2026.substack.com/p/python-testing-with-pytest-a-practical</link><guid isPermaLink="false">https://adawy2026.substack.com/p/python-testing-with-pytest-a-practical</guid><dc:creator><![CDATA[Ahmed Adawy]]></dc:creator><pubDate>Sun, 09 Aug 2026 19:31:45 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9vBM!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fc6ca1e-6f30-41df-ab7d-4663531d844a_992x992.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Writing Python code is only half of the job.</p><p>The other half is knowing that the code <strong>continues to work when the project changes</strong>.</p><p>A function can work perfectly today and break tomorrow after a small refactor.</p><p>A new feature can accidentally affect an older one.</p><p>A seemingly harmless change can introduce a regression somewhere else.</p><p>This is where automated testing becomes essential.</p><h3>Introducing: Python Testing with pytest</h3><p>I&#8217;ve just published the second capsule in my <strong>Ahmed Adawy Tech Capsules</strong> series:</p><blockquote><p><strong>Python Testing with pytest &#8212; A Practical Guide to Writing Reliable Tests</strong></p></blockquote><p>This capsule is designed as a practical introduction to automated testing with Python&#8217;s <code>pytest</code> framework.</p><p>It focuses on the concepts developers actually need when moving from manual checking to a repeatable testing workflow.</p><h3>What you&#8217;ll learn</h3><p>The capsule starts from the fundamentals and progressively builds the testing mindset.</p><p>It covers topics such as:</p><ul><li><p>Why automated testing matters</p></li><li><p>Installing and running pytest</p></li><li><p>Writing your first test</p></li><li><p>Assertions</p></li><li><p>Testing normal behavior</p></li><li><p>Testing edge cases</p></li><li><p>Testing exceptions</p></li><li><p>Verifying exception messages</p></li><li><p>Writing focused tests</p></li><li><p>Arrange / Act / Assert</p></li><li><p>Running individual tests</p></li><li><p>Understanding pytest output</p></li><li><p>Structuring tests for real Python projects</p></li></ul><p>And it doesn&#8217;t stop at simply showing syntax.</p><p>The goal is to understand <strong>why these techniques matter</strong> and how they fit into a real development workflow.</p><h3>A simple example</h3><p>A pytest test can be surprisingly readable:</p><pre><code></code></pre><pre><code><code>def test_add():
    result = add(2, 3)

    assert result == 5</code></code></pre><p>The test tells a story:</p><p><strong>Arrange &#8594; Act &#8594; Assert</strong></p><p>Prepare the input.</p><p>Execute the behavior.</p><p>Verify the result.</p><p>That simplicity is one of the reasons pytest has become such a practical choice for Python testing.</p><h3>Testing failure is testing too</h3><p>Reliable software isn&#8217;t only about successful inputs.</p><p>Invalid behavior needs to be tested as well.</p><p>For example:</p><pre><code></code></pre><pre><code><code>import pytest


def test_divide_by_zero():
    with pytest.raises(ValueError):
        divide(10, 0)</code></code></pre><p>Now the test verifies that the software doesn&#8217;t merely fail &#8212; it fails <strong>in the expected way</strong>.</p><p>That&#8217;s an important distinction when building dependable applications.</p><h2>Why I created this capsule</h2><p>I wanted this capsule to be useful to someone who already knows basic Python but wants to move toward a more professional development workflow.</p><p>Instead of treating testing as something added at the end of a project, the capsule presents testing as part of the development process itself.</p><p>The bigger idea is simple:</p><blockquote><p><strong>Your tests become a safety net for your code.</strong></p></blockquote><p>The more your project grows, the more valuable that safety net becomes.</p><h2>&#128218; The full capsule</h2><p>The complete capsule goes beyond the introductory material and explores the techniques needed for larger Python projects, including:</p><p><strong>Fixtures &#8226; Parametrization &#8226; Reusable Test Setup &#8226; Advanced Exception Testing &#8226; Test Organization &#8226; Code Coverage &#8226; Continuous Integration &#8226; Real-World Testing &#8226; Professional Testing Practices</strong></p><p>The capsule is approximately <strong>45 pages</strong> and is part of the growing <strong>Ahmed Adawy Tech Capsules</strong> series.</p><h2>&#128640; Who is this for?</h2><p>This capsule is especially useful for:</p><ul><li><p>Python developers</p></li><li><p>Students learning software engineering</p></li><li><p>Developers moving from scripts to larger projects</p></li><li><p>Anyone starting with automated testing</p></li><li><p>Developers who want to introduce pytest into their workflow</p></li></ul><p>You don&#8217;t need to be a testing expert.</p><p>You just need a working understanding of Python and a willingness to start testing your code properly.</p><h2>The bigger goal</h2><p>This capsule is part of a larger project I&#8217;m building:</p><p><strong>Ahmed Adawy Tech Capsules</strong></p><p>Short, focused technical books designed to turn complex engineering concepts into practical, readable learning material.</p><p>One topic.</p><p>One focused capsule.</p><p>One practical engineering skill at a time.</p><h3>&#128214; Python Testing with pytest</h3><p><strong>A Practical Guide to Writing Reliable Tests</strong></p><p><strong>Author:</strong> Ahmed Adawy<br><strong>Series:</strong> Ahmed Adawy Tech Capsules<br><strong>Category:</strong> Python / Testing<br><strong>Level:</strong> Intermediate<br><strong>Length:</strong> ~45 pages</p><p>If you&#8217;re writing Python seriously, automated testing is no longer just a &#8220;nice to have.&#8221;</p><p>It&#8217;s part of building software you can trust.</p><p><strong>Keep testing. Keep improving. Keep building. &#128640;</strong></p><p>#Python #pytest #SoftwareTesting #SoftwareEngineering #Programming #Automation #DeveloperTools</p>]]></content:encoded></item><item><title><![CDATA[A New Technical Capsule: GitHub Actions for Python Projects]]></title><description><![CDATA[A New Technical Capsule: GitHub Actions for Python Projects]]></description><link>https://adawy2026.substack.com/p/a-new-technical-capsule-github-actions</link><guid isPermaLink="false">https://adawy2026.substack.com/p/a-new-technical-capsule-github-actions</guid><dc:creator><![CDATA[Ahmed Adawy]]></dc:creator><pubDate>Sat, 08 Aug 2026 19:03:03 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!5UOj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb92dccac-d0f3-4984-93d0-51563a81c8d4_1055x1491.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A New Technical Capsule: GitHub Actions for Python Projects</p><p>I&#8217;m starting a small experiment with a simple idea:</p><p>What if technical books didn&#8217;t always have to be long?</p><p>That&#8217;s the idea behind Ahmed Adawy Tech Capsules &#8212; focused technical micro-books built around one practical topic at a time.</p><p>The first capsule is now available:</p><p>&#128216; GitHub Actions for Python Projects</p><p>A Practical Guide to CI/CD Automation</p><p>This capsule is about turning repetitive Python project tasks into an automated workflow using GitHub Actions.</p><p>It covers:</p><p>&#8226; Python environment setup</p><p>&#8226; Dependency management</p><p>&#8226; Automated testing with pytest</p><p>&#8226; Coverage reports</p><p>&#8226; Documentation builds</p><p>&#8226; Artifact generation</p><p>&#8226; Workflow organization</p><p>&#8226; CI/CD execution flow</p><p>&#8226; Reusable automation patterns</p><p>I deliberately kept the scope focused.</p><p>No attempt to turn it into a giant DevOps textbook.</p><p>Just a practical guide for developers who want their Python repositories to do more work automatically.</p><p>&#128218; Read the capsule on Leanpub:</p><p>[Leanpub link]</p><p>&#128295; Project repository:</p><p>https://github.com/adawy20262026-oss/ahmed-adawy-tech-capsules</p><p>This is only Capsule #1.</p><p>The goal is to build a growing collection of short, focused technical books around real developer problems.</p><p>If you&#8217;re interested in Python, automation, CI/CD, testing, or developer tooling, I&#8217;d love to have you follow the series.</p><p>&#8212; Ahmed Adawy</p><p>#Python #GitHubActions #CICD #DevOps #TechWriting</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5UOj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb92dccac-d0f3-4984-93d0-51563a81c8d4_1055x1491.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5UOj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb92dccac-d0f3-4984-93d0-51563a81c8d4_1055x1491.png 424w, https://substackcdn.com/image/fetch/$s_!5UOj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb92dccac-d0f3-4984-93d0-51563a81c8d4_1055x1491.png 848w, https://substackcdn.com/image/fetch/$s_!5UOj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb92dccac-d0f3-4984-93d0-51563a81c8d4_1055x1491.png 1272w, https://substackcdn.com/image/fetch/$s_!5UOj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb92dccac-d0f3-4984-93d0-51563a81c8d4_1055x1491.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5UOj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb92dccac-d0f3-4984-93d0-51563a81c8d4_1055x1491.png" width="1055" height="1491" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b92dccac-d0f3-4984-93d0-51563a81c8d4_1055x1491.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1491,&quot;width&quot;:1055,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1248402,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adawy2026.substack.com/i/210380643?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb92dccac-d0f3-4984-93d0-51563a81c8d4_1055x1491.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!5UOj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb92dccac-d0f3-4984-93d0-51563a81c8d4_1055x1491.png 424w, https://substackcdn.com/image/fetch/$s_!5UOj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb92dccac-d0f3-4984-93d0-51563a81c8d4_1055x1491.png 848w, https://substackcdn.com/image/fetch/$s_!5UOj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb92dccac-d0f3-4984-93d0-51563a81c8d4_1055x1491.png 1272w, https://substackcdn.com/image/fetch/$s_!5UOj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb92dccac-d0f3-4984-93d0-51563a81c8d4_1055x1491.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p>]]></content:encoded></item><item><title><![CDATA[ Introducing Ahmed Adawy Tech Capsules: A Professional Markdown-to-PDF Publishing Engine Built with Python]]></title><description><![CDATA[# Introducing Ahmed Adawy Tech Capsules]]></description><link>https://adawy2026.substack.com/p/introducing-ahmed-adawy-tech-capsules</link><guid isPermaLink="false">https://adawy2026.substack.com/p/introducing-ahmed-adawy-tech-capsules</guid><dc:creator><![CDATA[Ahmed Adawy]]></dc:creator><pubDate>Fri, 07 Aug 2026 15:51:07 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9vBM!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fc6ca1e-6f30-41df-ab7d-4663531d844a_992x992.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p># Introducing Ahmed Adawy Tech Capsules</p><p></p><p></p><p></p><p>For the past weeks, I have been building a project that combines technical writing, automation, and software engineering into a single publishing workflow.</p><p></p><p></p><p></p><p>Today I'm happy to introduce **Ahmed Adawy Tech Capsules**.</p><p></p><p></p><p></p><p>A Python-powered publishing engine that transforms Markdown documents into professional technical publications.</p><p></p><p></p><p></p><p>---</p><p></p><p></p><p></p><p>## Why I Built It</p><p></p><p></p><p></p><p>Writing technical content is easy.</p><p></p><p></p><p></p><p>Publishing it professionally is not.</p><p></p><p></p><p></p><p>Most technical writers spend hours formatting documents, creating PDF files, styling pages, generating tables of contents, and maintaining documentation.</p><p></p><p></p><p></p><p>I wanted one command to do everything.</p><p></p><p></p><p></p><p>---</p><p></p><p></p><p></p><p>## Features</p><p></p><p></p><p></p><p>- Professional HTML rendering</p><p></p><p>- Beautiful PDF generation using WeasyPrint</p><p></p><p>- Automatic cover pages</p><p></p><p>- Automatic Table of Contents</p><p></p><p>- Syntax highlighting powered by Pygments</p><p></p><p>- Metadata support</p><p></p><p>- Modular architecture</p><p></p><p>- Library index generation</p><p></p><p>- Streamlit Web Interface</p><p></p><p>- GitHub Actions CI/CD</p><p></p><p>- Automated testing</p><p></p><p></p><p></p><p>---</p><p></p><p></p><p></p><p>## Architecture</p><p></p><p></p><p></p><p>The project follows a modular architecture.</p><p></p><p></p><p></p><p>```</p><p></p><p>Markdown</p><p></p><p>      &#9474;</p><p></p><p>      &#9660;</p><p></p><p>Metadata Parser</p><p></p><p>      &#9474;</p><p></p><p>      &#9660;</p><p></p><p>Markdown Parser</p><p></p><p>      &#9474;</p><p></p><p>      &#9660;</p><p></p><p>HTML Renderer</p><p></p><p>      &#9474;</p><p></p><p>      &#9500;&#9472;&#9472; Cover Renderer</p><p></p><p>      &#9500;&#9472;&#9472; TOC Renderer</p><p></p><p>      &#9500;&#9472;&#9472; Content Renderer</p><p></p><p>      &#9500;&#9472;&#9472; Footer Renderer</p><p></p><p>      &#9474;</p><p></p><p>      &#9660;</p><p></p><p>PDF Generator</p><p></p><p>      &#9474;</p><p></p><p>      &#9660;</p><p></p><p>Professional PDF</p><p></p><p>```</p><p></p><p></p><p></p><p>Each component has a single responsibility, making the project easy to maintain and extend.</p><p></p><p></p><p></p><p>---</p><p></p><p></p><p></p><p>## Current Statistics</p><p></p><p></p><p></p><p>- Python 3.12</p><p></p><p>- 54 automated tests</p><p></p><p>- 94% test coverage</p><p></p><p>- GitHub Actions CI</p><p></p><p>- MIT License</p><p></p><p>- First Stable Release (v1.0.0)</p><p></p><p></p><p></p><p>---</p><p></p><p></p><p></p><p>## Technologies</p><p></p><p></p><p></p><p>- Python</p><p></p><p>- Markdown</p><p></p><p>- WeasyPrint</p><p></p><p>- Pygments</p><p></p><p>- PyYAML</p><p></p><p>- Streamlit</p><p></p><p>- Pytest</p><p></p><p>- GitHub Actions</p><p></p><p></p><p></p><p>---</p><p></p><p></p><p></p><p>## Open Source</p><p></p><p></p><p></p><p>The project is completely open source.</p><p></p><p></p><p></p><p>Contributions, ideas, and feedback are always welcome.</p><p></p><p></p><p></p><p>GitHub Repository:</p><p></p><p></p><p></p><p>https://github.com/adawy20262026-oss/ahmed-adawy-tech-capsules</p><p></p><p></p><p></p><p>---</p><p></p><p></p><p></p><p>## What's Next</p><p></p><p></p><p></p><p>The roadmap includes:</p><p></p><p></p><p></p><p>- 100% test coverage</p><p></p><p>- CLI interface</p><p></p><p>- Multiple themes</p><p></p><p>- EPUB export</p><p></p><p>- PyPI package</p><p></p><p>- Plugin system</p><p></p><p>- AI-assisted publishing</p><p></p><p></p><p></p><p>---</p><p></p><p></p><p></p><p>Thank you for reading.</p><p></p><p></p><p></p><p>If you enjoy technical writing, Python, or documentation tooling, I'd love to hear your thoughts.</p>]]></content:encoded></item><item><title><![CDATA[🚀 Beyond pip install: The Invisible Memory Leak Destroying AI Microservices]]></title><description><![CDATA[There is a specific kind of developer pain that only happens at 2:00 AM.]]></description><link>https://adawy2026.substack.com/p/beyond-pip-install-the-invisible</link><guid isPermaLink="false">https://adawy2026.substack.com/p/beyond-pip-install-the-invisible</guid><dc:creator><![CDATA[Ahmed Adawy]]></dc:creator><pubDate>Mon, 03 Aug 2026 18:20:55 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9vBM!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fc6ca1e-6f30-41df-ab7d-4663531d844a_992x992.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1></h1><p>There is a specific kind of developer pain that only happens at 2:00 AM.</p><p>Your code compiles. Your tests pass with flying colors. You build a sleek Python/AI microservice, write a few clean modules,wrap it up nicely, and push it to production or cloud runtime. Everything looks smooth, the demo works, and for the first few minutes, you feel like a genius.</p><p>Then, under real user traffic, the memory consumption starts creeping up. 100MB... 500MB... 1.5GB... <strong>Crash.</strong> <code>OOMKilled</code> (Out of Memory).</p><p>If you are a Computer Science student, AI Engineer, or Software Developer building data &amp; text pipelines, you&#8217;ve probably blamed garbage collection, blamed Streamlit, or blamed Python itself.</p><p>Here is the truth about what actually broke, and how we solved it.</p><p></p><p>&#128736;&#65039; The Problem: Hidden C-Level Memory Leaks in Python Pipelines</p><p>When we build AI wrappers or document transformation tools (converting Markdown/HTML to professional PDFs using packages like weasyprint, cairo, or heavy ML models), we rely heavily on C-extensions under the hood.</p><p>Python developers trust Python&#8217;s Automatic Garbage Collector (gc). But here is the catch:</p><p></p><p>Python&#8217;s garbage collector only manages Python objects. It has ZERO visibility or control over memory allocated at the C-library level (libgobject, libcairo, or C++ bindings).</p><p></p><p>When your backend processes requests</p><p>continuously:</p><ol><li><p>Python creates C-level pointers for rendering or model inference.</p></li><li><p>The Python object dies after the request finishes.</p></li><li><p>The C-level memory chunk remains allocated in system RAM because the shared library didn&#8217;t explicitly trigger a release.</p></li></ol><p>To the system, your app looks like a memory sponge.</p><p>&#9889; The Solution: Process Isolation &amp; Defensive Pipeline Design</p><p>Instead of fighting C-level garbage collection inside the main runtime thread, the architectural solution lies in Process Isolation &amp; Explicit Context Cleanup.</p><p></p><p>Here is how to solve it natively in Python:</p><p></p><p>1. Isolated Execution via multiprocessing</p><p>By offloading heavy rendering or inference tasks into a temporary worker process,</p><p>system RAM is forcibly reclaimed by the OS the moment the worker process terminates.</p><p>import multiprocessing as mp</p><p></p><p>def isolated_heavy_task(input_data, output_queue):</p><p>    # Heavy C-library calls / PDF rendering / Heavy AI inference happens here</p><p>    result = perform_rendering(input_data)</p><p>    output_queue.put(result)</p><p></p><p>def safe_execution(input_data):</p><p>    queue = mp.Queue()</p><p>    process = mp.Process(target=isolated_heavy_task, args=(input_data, queue))</p><p>    process.start()</p><p>    </p><p>    # Retrieve result and ensure process termination</p><p>    result = queue.get()</p><p>    process.join()  # OS automatically frees 100% of C-level RAM here</p><p>    return result</p><p>2. Explicit Ctypes &amp; Temporary File Flushing</p><p>If you are generating heavy PDF artifacts or manipulating raw text buffers:</p><p></p><p>Never keep binary streams held indefinitely in application memory.</p><p></p><p>Flush explicitly to /tmp storage and use context managers (with) to enforce clean file descriptor closures immediately after execution.</p><p>&#128161; The Takeaway for Engineers &amp; CS Students</p><p>Building software that works on localhost takes a few hours.</p><p>Building software that survives real-world edge cases, shared libraries, and server constraints takes real architectural engineering.</p><p></p><p>Don't just write scripts that execute&#8212;build systems that clean up after themselves.</p><p></p><p>What&#8217;s the most frustrating runtime or memory bug you&#8217;ve ever had to debug in production? Let's discuss in the comments below! &#128736;&#65039;</p>]]></content:encoded></item><item><title><![CDATA[4 Docker Commands I Use Almost Every Day (And You Probably Will Too)]]></title><description><![CDATA[When I first started using Docker, I kept searching for the same commands over and over again.]]></description><link>https://adawy2026.substack.com/p/4-docker-commands-i-use-almost-every</link><guid isPermaLink="false">https://adawy2026.substack.com/p/4-docker-commands-i-use-almost-every</guid><dc:creator><![CDATA[Ahmed Adawy]]></dc:creator><pubDate>Tue, 28 Jul 2026 16:26:47 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!i0qt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8407d88-ceab-43a8-8248-67137ab59e10_698x1600.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><p>When I first started using Docker, I kept searching for the same commands over and over again.</p><p></p><p>Eventually, I realized that I only needed a handful of commands for 90% of my daily work.</p><p></p><p>Here are the four Docker commands I use the most.</p><p></p><p>---</p><p></p><p>## 1. Build an Image</p><p></p><p>```bash</p><p>docker build -t myapp:v1 .</p><p>```</p><p></p><p>This command creates a Docker image from your Dockerfile.</p><p></p><p>I always use version tags instead of `latest` because it makes deployments easier to track and roll back.</p><p></p><p>---</p><p></p><p>## 2. Run a Container</p><p></p><p>```bash</p><p>docker run -d -p 8080:8080 --name myapp_instance myapp:v1</p><p>```</p><p></p><p>What this does:</p><p></p><p>- Runs the container in the background</p><p>- Maps port **8080** on your machine to the container</p><p>- Gives the container a readable name</p><p></p><p>Instead of random container IDs, I can simply reference `myapp_instance`.</p><p></p><p>---</p><p></p><p>## 3. Monitor What's Happening</p><p></p><p>```bash</p><p>docker ps</p><p>```</p><p></p><p>Shows all running containers.</p><p></p><p>Need to inspect logs?</p><p></p><p>```bash</p><p>docker logs -f myapp_instance</p><p>```</p><p></p><p>The `-f` flag streams logs in real time, which is incredibly useful when debugging startup issues.</p><p></p><p>---</p><p></p><p>## 4. Stop and Remove Cleanly</p><p></p><p>```bash</p><p>docker stop myapp_instance &amp;&amp; docker rm myapp_instance</p><p>```</p><p></p><p>One command.</p><p></p><p>No leftover containers.</p><p></p><p>No unnecessary clutter.</p><p></p><p>---</p><p></p><p>## A Small Habit That Saves Time</p><p></p><p>I almost never use anonymous containers during development.</p><p></p><p>Naming containers makes debugging, logging, restarting, and scripting much easier.</p><p></p><p>It seems like a tiny habit, but it saves a surprising amount of time over the long run.</p><p></p><p>---</p><p></p><p>### Quick Reference</p><p></p><p>```bash</p><p>docker build -t myapp:v1 .</p><p>docker run -d -p 8080:8080 --name myapp_instance myapp:v1</p><p>docker ps</p><p>docker logs -f myapp_instance</p><p>docker stop myapp_instance &amp;&amp; docker rm myapp_instance</p><p>```</p><p></p><p>That's it.</p><p></p><p>You don't need to memorize dozens of Docker commands.</p><p></p><p>Master these four first, and you'll already handle most day-to-day Docker workflows with confidence.</p><p></p><p>---</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!i0qt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8407d88-ceab-43a8-8248-67137ab59e10_698x1600.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i0qt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8407d88-ceab-43a8-8248-67137ab59e10_698x1600.jpeg 424w, https://substackcdn.com/image/fetch/$s_!i0qt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8407d88-ceab-43a8-8248-67137ab59e10_698x1600.jpeg 848w, https://substackcdn.com/image/fetch/$s_!i0qt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8407d88-ceab-43a8-8248-67137ab59e10_698x1600.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!i0qt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8407d88-ceab-43a8-8248-67137ab59e10_698x1600.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i0qt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8407d88-ceab-43a8-8248-67137ab59e10_698x1600.jpeg" width="698" height="1600" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b8407d88-ceab-43a8-8248-67137ab59e10_698x1600.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1600,&quot;width&quot;:698,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:73105,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adawy2026.substack.com/i/208854913?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8407d88-ceab-43a8-8248-67137ab59e10_698x1600.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!i0qt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8407d88-ceab-43a8-8248-67137ab59e10_698x1600.jpeg 424w, https://substackcdn.com/image/fetch/$s_!i0qt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8407d88-ceab-43a8-8248-67137ab59e10_698x1600.jpeg 848w, https://substackcdn.com/image/fetch/$s_!i0qt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8407d88-ceab-43a8-8248-67137ab59e10_698x1600.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!i0qt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8407d88-ceab-43a8-8248-67137ab59e10_698x1600.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>If you found this useful, save it for later&#8212;you'll probably need these commands again.</p>]]></content:encoded></item><item><title><![CDATA[Practical Python Implementation: Simulating Lattice-Based Key Generation]]></title><description><![CDATA[--- ---]]></description><link>https://adawy2026.substack.com/p/practical-python-implementation-simulating</link><guid isPermaLink="false">https://adawy2026.substack.com/p/practical-python-implementation-simulating</guid><dc:creator><![CDATA[Ahmed Adawy]]></dc:creator><pubDate>Mon, 27 Jul 2026 21:27:46 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9vBM!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fc6ca1e-6f30-41df-ab7d-4663531d844a_992x992.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>---</p><p></p><p>---</p><p></p><p>Practical Python Implementation: Simulating Lattice-Based Key Generation</p><p>Understanding the mathematical foundation behind post-quantum cryptography using a simple Python implementation.</p><p></p><p>---</p><p></p><p>Why Lattice Cryptography?</p><p>Quantum computers threaten many of today's public-key cryptographic systems, including RSA and Elliptic Curve Cryptography.</p><p>One of the strongest candidates for replacing them is Lattice-Based Cryptography, the mathematical foundation behind algorithms such as CRYSTALS-Kyber, selected by NIST for the post-quantum era.</p><p>Real implementations involve advanced polynomial algebra and high-dimensional lattices.</p><p>However, before diving into those complexities, it's helpful to understand the core mathematical intuition.</p><p></p><p>---</p><p></p><p>The Idea</p><p>Instead of implementing the complete Kyber algorithm, this educational example demonstrates how a hidden lattice basis can generate a public lattice while keeping the private structure secret.</p><p>The example illustrates:</p><p>Mathematical vectors</p><p></p><p>Linear combinations</p><p></p><p>Public and private lattice bases</p><p></p><p>Shared secret generation</p><p></p><p>Why recovering the private basis is computationally difficult</p><p></p><p>The objective is education&#8202;-&#8202;not production cryptography.</p><p></p><p>---</p><p></p><p>Python Example</p><p>import random</p><p>def vector_add(v1, v2):</p><p>    return [x + y for x, y in zip(v1, v2)]</p><p>def scalar_multiply(scalar, vector):</p><p>    return [scalar * x for x in vector]</p><p>private_basis_v1 = [1, 0]</p><p>private_basis_v2 = [0, 1]</p><p>scalar_a = 51</p><p>scalar_b = 73</p><p>public_v1 = vector_add(</p><p>    scalar_multiply(scalar_a, private_basis_v1),</p><p>    scalar_multiply(scalar_b, private_basis_v2)</p><p>)</p><p>secret_multiplier = 142</p><p>shared_secret = scalar_multiply(secret_multiplier, public_v1)</p><p>print(shared_secret)</p><p></p><p>---</p><p></p><p>What Happens&nbsp;Here?</p><p>The script performs the following steps:</p><p>Creates a simple private lattice basis.</p><p></p><p>Produces a transformed public basis.</p><p></p><p>Simulates a shared secret generated on the public lattice.</p><p></p><p>Demonstrates the core intuition behind lattice-based cryptography.</p><p></p><p>Although this example uses only two dimensions, the same concepts scale to hundreds of dimensions in real post-quantum cryptographic systems.</p><p></p><p>---</p><p></p><p>Why This&nbsp;Matters</p><p>The security of lattice cryptography does not rely on prime factorization like RSA.</p><p>Instead, it depends on the computational hardness of mathematical lattice problems such as:</p><p>Shortest Vector Problem (SVP)</p><p></p><p>Closest Vector Problem (CVP)</p><p></p><p>Learning With Errors (LWE)</p><p></p><p>These problems remain difficult even for large-scale quantum computers, making lattice cryptography one of the most promising foundations for future secure communication.</p><p></p><p>---</p><p></p><p>Educational Purpose</p><p>This implementation is intentionally simplified to help students and engineers understand the underlying mathematical concepts before studying full post-quantum algorithms such as:</p><p>CRYSTALS-Kyber</p><p></p><p>Dilithium</p><p></p><p>Falcon</p><p></p><p>Learning the intuition first makes advanced cryptographic research much easier to approach.</p><p></p><p>---</p><p></p><p>Final Thoughts</p><p>Modern cybersecurity is increasingly becoming applied mathematics.</p><p>Understanding the mathematics behind cryptographic algorithms is just as important as learning to implement them.</p><p>Every secure communication protocol begins with mathematical ideas that can often be explained through surprisingly simple code.</p><p></p><p>---</p><p></p><p>If you enjoyed this article, consider following my work for more content on:</p><p>Scientific Python</p><p></p><p>Computational Mathematics</p><p></p><p>AI Engineering</p><p></p><p>Numerical Methods</p><p></p><p>Cybersecurity</p><p></p><p>Post-Quantum Cryptography</p><p></p><p>---</p><p></p><p>#Python #CyberSecurity #PostQuantumCryptography #LatticeCryptography #Cryptography #Mathematics #Programming #SoftwareEngineering #OpenSource #AI #NumPy #ComputerScience</p><p></p><p>---</p>]]></content:encoded></item><item><title><![CDATA[# Why Every Engineering Student Should Build Simulators Instead of Solving More Equations]]></title><description><![CDATA[# Why Every Engineering Student Should Build Simulators Instead of Solving More Equations]]></description><link>https://adawy2026.substack.com/p/why-every-engineering-student-should</link><guid isPermaLink="false">https://adawy2026.substack.com/p/why-every-engineering-student-should</guid><dc:creator><![CDATA[Ahmed Adawy]]></dc:creator><pubDate>Sun, 26 Jul 2026 23:18:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9vBM!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fc6ca1e-6f30-41df-ab7d-4663531d844a_992x992.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p># Why Every Engineering Student Should Build Simulators Instead of Solving More Equations</p><p></p><p>During my journey studying computational engineering, I noticed something surprising.</p><p></p><p>Most textbooks do an excellent job explaining the mathematics behind engineering problems.</p><p></p><p>They derive differential equations.</p><p></p><p>They prove theorems.</p><p></p><p>They analyze physical models.</p><p></p><p>But they rarely answer one practical question:</p><p></p><p>**How do we transform those equations into software?**</p><p></p><p>There is a huge gap between understanding an equation and building a simulator that actually solves it.</p><p></p><p>For example...</p><p></p><p>A neutron diffusion equation on paper eventually becomes:</p><p></p><p>&#8226; A discretized numerical model</p><p>&#8226; A sparse matrix</p><p>&#8226; A linear algebra problem</p><p>&#8226; A Python implementation</p><p>&#8226; A working scientific application</p><p></p><p>That transformation is where real engineering happens.</p><p></p><p>Writing software forces you to understand every assumption, every approximation, and every numerical decision.</p><p></p><p>That's why I believe:</p><p></p><p>&gt; Code is the ultimate proof of understanding.</p><p></p><p>This idea is the motivation behind my current open-source work and technical writing.</p><p></p><p>I'm building educational projects focused on:</p><p></p><p>&#8226; Scientific Python</p><p>&#8226; Numerical Methods</p><p>&#8226; Software Architecture</p><p>&#8226; AI Engineering</p><p>&#8226; Reactor Physics</p><p></p><p>The goal isn't simply to explain theory.</p><p></p><p>The goal is to transform theory into working software that anyone can study, modify, and improve.</p><p></p><p>If engineering education is going to evolve, I think we need more simulation projects&#8212;and fewer isolated equations on paper.</p><p></p><p>What do you think?</p><p></p><p>Should engineering education spend more time teaching students how to build scientific software?</p><p></p><p>#Python #ScientificComputing #AI #Engineering #NumPy #OpenSource #SoftwareArchitecture</p>]]></content:encoded></item><item><title><![CDATA[Mind the Chasm: Bridging the Gap Between Reactor Physics Equations and Python Simulators]]></title><description><![CDATA[If you&#8217;ve ever opened classics like *Introduction to Nuclear Engineering* by Lamarsh or *Nuclear Reactor Analysis* by Duderstadt & Hamilton, you&#8217;ve probably admired the elegance of reactor physics.]]></description><link>https://adawy2026.substack.com/p/mind-the-chasm-bridging-the-gap-between</link><guid isPermaLink="false">https://adawy2026.substack.com/p/mind-the-chasm-bridging-the-gap-between</guid><dc:creator><![CDATA[Ahmed Adawy]]></dc:creator><pubDate>Sat, 25 Jul 2026 11:37:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9vBM!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fc6ca1e-6f30-41df-ab7d-4663531d844a_992x992.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><p>If you&#8217;ve ever opened classics like *Introduction to Nuclear Engineering* by Lamarsh or *Nuclear Reactor Analysis* by Duderstadt &amp; Hamilton, you&#8217;ve probably admired the elegance of reactor physics.</p><p>You&#8217;ll derive the neutron transport equation, study diffusion theory, analyze reactor criticality, and work through sophisticated mathematical models.</p><p>But the moment you open VS Code, PyCharm, or Jupyter Notebook and try to build even a simple reactor simulator, you encounter something textbooks rarely discuss:</p><p>A massive engineering gap.</p><p>The gap isn&#8217;t in the physics.</p><p>It&#8217;s in translating mathematical models into reliable numerical software.</p><p>The journey actually looks like this:</p><p>```</p><p>Continuous Physics</p><p>        &#8595;</p><p>Numerical Discretization</p><p>        &#8595;</p><p>Linear Algebra</p><p>        &#8595;</p><p>Algorithms</p><p>        &#8595;</p><p>Working Python Code</p><p>```</p><p>Most classical textbooks master the first step.</p><p>Scientific software lives in the last four.</p><p>---</p><p># From Differential Equations to Numerical Algorithms</p><p>Consider one of the most fundamental equations in reactor physics: the one-dimensional steady-state neutron diffusion equation with an external source.</p><p>\[</p><p>D\frac{d^2\phi}{dx^2}-\Sigma_a\phi+S=0</p><p>\]</p><p>where</p><p>- **D** is the diffusion coefficient</p><p>- **&#966;** is the neutron flux</p><p>- **&#931;a** is the macroscopic absorption cross section</p><p>- **S** is the external neutron source</p><p>Beautiful.</p><p>Elegant.</p><p>Impossible for a computer to solve directly.</p><p>Computers don&#8217;t understand derivatives.</p><p>They understand numbers.</p><p>---</p><p># Step 1 &#8212; Discretize the Reactor</p><p>Instead of treating space as continuous, we divide the reactor into equally spaced nodes.</p><p>Using the finite difference approximation,</p><p>\[</p><p>\frac{d^2\phi}{dx^2}</p><p>\approx</p><p>\frac{\phi_{i+1}-2\phi_i+\phi_{i-1}}{\Delta x^2}</p><p>\]</p><p>the governing equation becomes</p><p>\[</p><p>D</p><p>\left(</p><p>\frac{\phi_{i+1}-2\phi_i+\phi_{i-1}}</p><p>{\Delta x^2}</p><p>\right)</p><p>-</p><p>\Sigma_a\phi_i</p><p>+</p><p>S_i</p><p>=</p><p>0</p><p>\]</p><p>The differential equation has now become a collection of algebraic equations.</p><p>---</p><p># Step 2 &#8212; Build a Linear System</p><p>Rearranging the terms gives</p><p>\[</p><p>\left(\frac{D}{\Delta x^2}\right)\phi_{i-1}</p><p>-</p><p>\left(</p><p>\frac{2D}{\Delta x^2}</p><p>+\Sigma_a</p><p>\right)\phi_i</p><p>+</p><p>\left(\frac{D}{\Delta x^2}\right)\phi_{i+1}</p><p>=</p><p>-S_i</p><p>\]</p><p>Instead of solving calculus,</p><p>we solve</p><p>\[</p><p>A\Phi=B</p><p>\]</p><p>where</p><p>- **A** is a tridiagonal matrix representing neutron leakage and absorption,</p><p>- **&#934;** is the unknown neutron flux vector,</p><p>- **B** contains the external source.</p><p>This is where reactor physics becomes numerical linear algebra.</p><p>---</p><p># Step 3 &#8212; Solve the System in Python</p><p>Once the mathematical model has been transformed into matrix form, implementing the solver becomes straightforward.</p><p>```python</p><p>import numpy as np</p><p>def solve_1d_reactor_flux(core_length,</p><p>                          num_nodes,</p><p>                          D,</p><p>                          Sigma_a,</p><p>                          source_strength):</p><p>    dx = core_length / (num_nodes - 1)</p><p>    x = np.linspace(0, core_length, num_nodes)</p><p>    A = np.zeros((num_nodes, num_nodes))</p><p>    B = np.zeros(num_nodes)</p><p>    leakage = D / dx**2</p><p>    center = -(2*leakage + Sigma_a)</p><p>    for i in range(1, num_nodes-1):</p><p>        A[i,i-1] = leakage</p><p>        A[i,i]   = center</p><p>        A[i,i+1] = leakage</p><p>        B[i]     = -source_strength</p><p>    # Vacuum boundary conditions</p><p>    A[0,0] = 1</p><p>    A[-1,-1] = 1</p><p>    flux = np.linalg.solve(A,B)</p><p>    return x, flux</p><p>```</p><p>Notice something important.</p><p>We are **not performing matrix inversion**.</p><p>`numpy.linalg.solve()` uses optimized LAPACK routines to solve the linear system directly, which is both faster and numerically more stable than explicitly computing an inverse matrix.</p><p>That distinction matters in scientific computing.</p><p>---</p><p># Where Classical Textbooks and Scientific Software Meet</p><p>Today&#8217;s learning resources usually fall into one of two categories.</p><p>### Classical reactor physics textbooks</p><p>Books by Lamarsh, Duderstadt &amp; Hamilton, and Stacey provide the theoretical foundation needed to understand diffusion theory, neutron transport, reactor kinetics, and nuclear engineering.</p><p>They explain **why the equations work**.</p><p>### Production simulation codes</p><p>Projects like OpenMC, Serpent, and MCNP are industrial-strength scientific codes capable of solving extremely sophisticated neutron transport problems.</p><p>They demonstrate **how professionals simulate reactors**.</p><p>However, for many students and software engineers, there is still a missing middle layer:</p><p>How do you build a simulator yourself?</p><p>How do you translate equations into maintainable Python code?</p><p>How do you organize numerical algorithms into software architecture?</p><p>That bridge is rarely discussed.</p><p>---</p><p># A Different Learning Perspective</p><p>Instead of replacing classical reactor physics books, numerical programming complements them.</p><p>| Resource | Primary Focus |</p><p>|-----------|---------------|</p><p>| Lamarsh | Reactor physics fundamentals |</p><p>| Duderstadt &amp; Hamilton | Mathematical reactor analysis |</p><p>| Stacey | Advanced reactor engineering |</p><p>| Practical Python implementations | Numerical algorithms and simulator architecture |</p><p>These aren&#8217;t competing approaches.</p><p>They&#8217;re different layers of the same discipline.</p><p>Physics explains the model.</p><p>Numerical analysis transforms the model.</p><p>Software engineering turns the numerical method into a maintainable simulator.</p><p>---</p><p># Final Thoughts</p><p>Writing code forces us to confront every assumption hidden inside an equation.</p><p>Boundary conditions.</p><p>Grid spacing.</p><p>Matrix assembly.</p><p>Numerical stability.</p><p>Data structures.</p><p>Algorithmic complexity.</p><p>That is why implementing a physical model is often the deepest form of understanding it.</p><p>Equations describe reality.</p><p>Algorithms make them computable.</p><p>Software makes them useful.</p><p>If you&#8217;re interested in exploring this bridge between reactor physics and practical scientific programming, I&#8217;ve been documenting my own approach in a Leanpub book focused on building reactor simulators from scratch using Python and NumPy.</p><p>I hope it helps make the transition from equations on paper to working simulation software a little less intimidating.</p>]]></content:encoded></item><item><title><![CDATA[Why Raw Python Loops Are Bottlenecking Your AI Models (And How to Fix It)]]></title><description><![CDATA[Python is undisputed king of the Artificial Intelligence and Machine Learning ecosystem.]]></description><link>https://adawy2026.substack.com/p/why-raw-python-loops-are-bottlenecking</link><guid isPermaLink="false">https://adawy2026.substack.com/p/why-raw-python-loops-are-bottlenecking</guid><dc:creator><![CDATA[Ahmed Adawy]]></dc:creator><pubDate>Fri, 24 Jul 2026 22:08:28 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9vBM!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fc6ca1e-6f30-41df-ab7d-4663531d844a_992x992.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Python is undisputed king of the Artificial Intelligence and Machine Learning ecosystem. It&#8217;s elegant, highly expressive, and lets us prototype complex architectures in a few lines of code. But Python has a dark, dirty secret that every AI engineer eventually crashes into: <strong>Native for loops are devastatingly slow.</strong></p><p>&#8203;When you are preprocessing massive datasets, calculating custom loss functions, or manipulating tensor vectors, throwing a standard Python loop at the problem is like driving a tractor on a highway.</p><p>&#8203;Let&#8217;s look at why this happens and how we can achieve a <strong>100x+ speedup</strong> using Hyper-Drive vectorization techniques.</p><h2>&#8203;The Bottleneck: Why Python Loops Fail at Scale</h2><p>&#8203;To understand the latency, we have to look under the hood of the CPython interpreter. Every time a standard Python loop runs:</p><ol><li><p>&#8203;<strong>Dynamic Type Checking:</strong> Python checks the data type of the variable on <em>every single iteration</em>.</p></li><li><p>&#8203;<strong>Interpreter Overhead:</strong> The loop overhead itself adds massive bytecode execution lag.</p></li><li><p>&#8203;<strong>Memory Fragmentation:</strong> Appending to standard Python lists doesn&#8217;t guarantee contiguous memory allocation, destroying CPU cache efficiency.</p></li></ol><p>&#8203;When dealing with 1,000,000 data points in an AI pipeline, this translates to agonizingly slow execution times.</p><h2>&#8203;The Hyper-Drive Solution: Vectorization</h2><p>&#8203;Instead of processing elements sequentially (Single Instruction, Single Data), we shift the workload to optimized low-level machine code via NumPy, utilizing SIMD (Single Instruction, Multiple Data) architectures. This allows the CPU (or GPU) to execute operations on entire arrays simultaneously at native C speeds.</p><h3>&#8203;The Head-to-Head Benchmark</h3><p>&#8203;Let&#8217;s put theory into practice. Here is a clean, production-ready benchmark script comparing a traditional raw Python loop against a vectorized implementation.</p><p>import time</p><p>import numpy as np</p><p># Size of the dataset (1 Million elements)</p><p>N = 1000000</p><p># 1. Slow Pure Python Loop Approach</p><p>def slow_loop(arr):</p><p>    result = []</p><p>    for x in arr:</p><p>        # Simulating a basic linear mathematical transformation</p><p>        result.append(x * 2 + 5)</p><p>    return result</p><p># 2. Fast Vectorized Implementation</p><p>def fast_vectorized(arr):</p><p>    return arr * 2 + 5</p><p>if __name__ == &#8220;__main__&#8221;:</p><p>    # Prepare data allocations</p><p>    data_list = list(range(N))</p><p>    data_array = np.arange(N)</p><p>    print(&#8221;&#128640; Running performance benchmarks...&#8221;)</p><p>    # Timing the pure python loop</p><p>    start = time.time()</p><p>    res_slow = slow_loop(data_list)</p><p>    end = time.time()</p><p>    time_slow = end - start</p><p>    print(f&#8221;&#128721; Pure Python Loop Time: {time_slow:.4f} seconds&#8221;)</p><p>    # Timing the vectorized execution</p><p>    start = time.time()</p><p>    res_fast = fast_vectorized(data_array)</p><p>    end = time.time()</p><p>    time_fast = end - start</p><p>    print(f&#8221;&#9889; Vectorized Hyper-Drive Time: {time_fast:.4f} seconds&#8221;)</p><p>    # Calculating the speedup factor</p><p>    print(f&#8221;&#128293; Speedup Factor: {time_slow / time_fast:.1f}x Faster!&#8221;)</p><h2>The Results: The Numbers Don&#8217;t Lie</h2><p>&#8203;When running this setup on a standard development machine, the output is striking:</p><ul><li><p>&#8203;<strong>Pure Python Loop Time:</strong> ~0.0850 seconds</p></li><li><p>&#8203;<strong>Vectorized Implementation Time:</strong> ~0.0007 seconds</p></li><li><p>&#8203;<strong>Performance Jump:</strong> <strong>~120x Faster!</strong></p></li></ul><p>&#8203;By eliminating the Python interpreter&#8217;s loop overhead, the computation finishes in a fraction of a millisecond. In a real-world AI pipeline training on gigabytes of data, this optimization saves hours of compute time and slashes cloud infrastructure costs.</p><h2>&#8203;Going Deeper: Beyond Vectorization</h2><p>&#8203;Vectorization is just the first step. When building high-performance AI architectures, you eventually need to cross the bridge from high-level Python wrappers down to bare-metal hardware optimization, GPU compilation, and custom machine code.</p><p>&#8203;If you want to master the underlying mathematical frameworks and hardware-level algorithms that power ultra-fast AI execution, check out my comprehensive blueprint book on Leanpub:</p><p>&#128073; <strong><a href="https://leanpub.com/thehyper-drivealgorithmsfromrawpythonformulastohigh-performancegpumachinecodes">The Hyper-Drive Algorithms: From Raw Python Formulas to High-Performance GPU &amp; Machine Code</a></strong></p><p>&#8203;Stop letting unoptimized loops throttle your machine learning models. Vectorize your pipelines, keep your data contiguous, and let the hardware do what it was built to do.</p><p></p>]]></content:encoded></item><item><title><![CDATA[Stop Running Your Docker Containers as Root: A Production-Ready Hardening Guide]]></title><description><![CDATA[The silent security flaw in your Dockerfile and how to fix it in 30 seconds using Node.js and Linux best practices.]]></description><link>https://adawy2026.substack.com/p/stop-running-your-docker-containers</link><guid isPermaLink="false">https://adawy2026.substack.com/p/stop-running-your-docker-containers</guid><dc:creator><![CDATA[Ahmed Adawy]]></dc:creator><pubDate>Wed, 22 Jul 2026 10:22:26 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!aVC-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F694ffca6-037e-4836-b1d6-8061d9c72492_896x1200.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You&#8217;ve finally built your application, tested it locally, wrapped it nicely inside a Docker container, and pushed it to production. It works flawlessly. You feel like a DevOps wizard.</p><p>&#8203;But then, an automated security audit flags your deployment, or worse, a malicious actor exploits a dependency vulnerability and gains absolute control over your host cloud server.</p><p>&#8203;Why? Because of one silent, pervasive mistake: <strong>You ran your Docker container as root.</strong></p><p>&#8203;By default, unless specified otherwise, Docker runs every process inside the container with root privileges. If an attacker manages to break out of your application process via a container breakout vulnerability, they instantly inherit root access to your entire virtual private server (VPS).</p><p>&#8203;In this quick guide, we&#8217;ll dismantle this problem, fix it from scratch, and show you how easy it is to deploy battle-tested, secure containers.</p><h3>&#8203;<strong>The Problem: The Naive Dockerfile</strong></h3><p>&#8203;Look at this common Dockerfile configuration used by thousands of developers daily:</p><p># A standard, but insecure Node.js setup</p><p>FROM node:18-alpine</p><p>WORKDIR /app</p><p>COPY package*.json ./</p><p>RUN npm ci --only=production</p><p>COPY . .</p><p>EXPOSE 3000</p><p># Trapped! Running implicitly as root</p><p>CMD [&#8221;node&#8221;, &#8220;server.js&#8221;]</p><p>If you inspect the running processes inside this container on your VPS, you&#8217;ll notice that node server.js is executed by user ID 0 (root). If your app gets compromised, your host system is compromised.</p><h3>&#8203;<strong>The Solution: Dropping Privileges (Non-Root Hardening)</strong></h3><p>&#8203;Fixing this doesn&#8217;t require complex orchestration tools. It only requires understanding the underlying Linux user environment and leveraging built-in image features. Official images like node already come with a secure, pre-configured non-root user called node.</p><p>&#8203;Here is the production-ready, hardened version of the exact same environment:</p><p>FROM node:18-alpine</p><p>WORKDIR /app</p><p># Copy dependency manifests</p><p>COPY package*.json ./</p><p># Install production dependencies only</p><p>RUN npm ci --only=production</p><p># Copy application source code</p><p>COPY . .</p><p>EXPOSE 3000</p><p># The Magic Line: Instantly switch from root to limited privileges</p><p>USER node</p><p>CMD [&#8221;node&#8221;, &#8220;server.js&#8221;]</p><p>By simply introducing USER node before your execution command, the application drops its root capabilities completely. If a vulnerability is triggered, the blast radius is confined tightly inside a sandboxed, low-privilege environment.</p><h3>&#8203;<strong>The Production Cleanup &amp; Firewall Layer</strong></h3><p>&#8203;Securing your container is only half the battle; you must also secure the Linux environment hosting it. When managing a VPS, ensuring proper networking and storage hygiene is crucial.</p><p>&#8203;<strong>1. Hardening the Network (UFW Firewall)</strong></p><p>&#8203;Never leave your server ports completely exposed to the open web. Before launching your containers, restrict incoming traffic using the Uncomplicated Firewall (UFW) to allow only essential administration and web traffic:</p><p># Deny everything by default, allow standard management and web ports</p><p>sudo ufw default deny incoming</p><p>sudo ufw default allow outgoing</p><p>sudo ufw allow 22/tcp   # SSH</p><p>sudo ufw allow 80/tcp   # HTTP</p><p>sudo ufw allow 443/tcp  # HTTPS</p><p>sudo ufw enable</p><p><strong>2. Reclaiming Disk Space</strong></p><p>&#8203;Building multiple versions of images can quickly fill up your server&#8217;s storage. Run a strict maintenance loop to prune dangling layers, unused containers, and unreferenced volumes:</p><p>docker system prune -a --volumes</p><h3><strong>Stop Guessing Your Production Configs</strong></h3><p>&#8203;Modern software development requires moving fast, but local development and production deployments shouldn&#8217;t feel like two completely different worlds. You shouldn&#8217;t have to wade through 500 pages of dense theoretical text just to spin up a secure, multi-container architecture.</p><p>&#8203;If you want a condensed, zero-fluff reference guide packed with ready-to-use Linux CLI commands, production multi-container docker-compose setups with databases, and ultimate security checklists, check out my latest handbook:</p><p></p><p>&#8203;&#128073; <strong><a href="https://leanpub.com/thearchitectureofthought1">The Production-Ready Docker &amp; Linux Pocket Guide</a></strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aVC-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F694ffca6-037e-4836-b1d6-8061d9c72492_896x1200.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aVC-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F694ffca6-037e-4836-b1d6-8061d9c72492_896x1200.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aVC-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F694ffca6-037e-4836-b1d6-8061d9c72492_896x1200.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aVC-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F694ffca6-037e-4836-b1d6-8061d9c72492_896x1200.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aVC-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F694ffca6-037e-4836-b1d6-8061d9c72492_896x1200.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aVC-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F694ffca6-037e-4836-b1d6-8061d9c72492_896x1200.jpeg" width="896" height="1200" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/694ffca6-037e-4836-b1d6-8061d9c72492_896x1200.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1200,&quot;width&quot;:896,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:142333,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adawy2026.substack.com/i/208037407?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F694ffca6-037e-4836-b1d6-8061d9c72492_896x1200.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aVC-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F694ffca6-037e-4836-b1d6-8061d9c72492_896x1200.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aVC-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F694ffca6-037e-4836-b1d6-8061d9c72492_896x1200.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aVC-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F694ffca6-037e-4836-b1d6-8061d9c72492_896x1200.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aVC-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F694ffca6-037e-4836-b1d6-8061d9c72492_896x1200.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>&#8203;<strong>What is your container security routine?</strong> Do you always implement non-root users in your pipelines, or do you rely entirely on cloud-level firewalls to protect your workloads? Let&#8217;s discuss in the comments below!</p>]]></content:encoded></item><item><title><![CDATA[Beyond the Hype: The Pure Linear Algebra That Turns Words into Geometry]]></title><description><![CDATA[Sub-headline: How LLMs see the world through high-dimensional vector spaces, distance metrics, and raw Python formulas]]></description><link>https://adawy2026.substack.com/p/beyond-the-hype-the-pure-linear-algebra</link><guid isPermaLink="false">https://adawy2026.substack.com/p/beyond-the-hype-the-pure-linear-algebra</guid><dc:creator><![CDATA[Ahmed Adawy]]></dc:creator><pubDate>Sun, 19 Jul 2026 21:20:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!6pHD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80f4a4d7-59b5-4f3d-9d2f-b0c45d5789c4_1080x1604.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When we talk about Generative AI, we often lose ourselves in the magic of the output&#8212;the fluid human-like responses, the automated code generation, and the complex logical reasoning. But underneath this perceived &#8220;magic&#8221; lies a cold, beautiful, and hyper-efficient computational reality: <strong>Everything is just geometry.</strong></p><p>&#8203;Before a Transformer model can generate a single cohesive token, it must first solve a fundamental computer science and mathematical problem: How do we translate the chaotic, non-linear, and nuanced nature of human language into something a machine can calculate deterministically?</p><p>&#8203;The answer isn&#8217;t magic. It is high-dimensional vector spaces and matrix factorization.</p><p>&#8203;In this first comprehensive deep-dive of our series, <strong>&#8220;The Foundations of Text as Space,&#8221;</strong> we are stripping away the high-level API abstractions&#8212;no PyTorch wrappers, no Hugging Face shortcuts&#8212;to look directly at the exact linear algebra that powers modern Large Language Models (LLMs).</p><p>&#8203;Here is the exact structural breakdown of what we are dissecting in Chapter 1:</p><h3>&#8203;<strong>1. High-Dimensional Geometry: Mapping Words to R^n</strong></h3><p>&#8203;Words do not exist as isolated text strings or basic ASCII characters to a neural network; they exist as absolute coordinates in a massive, multi-dimensional real-number space (R^n). We explore exactly how semantic meaning is translated into spatial distance, demonstrating how historical semantic relationships like <em>&#8220;King - Man + Woman = Queen&#8221;</em> are not just clever linguistic metaphors, but actual vector displacements occurring inside a continuous geometric manifold.</p><h3>&#8203;<strong>2. The Linear Algebra of Distance Metrics in AI</strong></h3><p>&#8203;How does an artificial intelligence system actually evaluate and &#8220;understand&#8221; that two distinct sentences share an identical contextual meaning? It calculates the formal mathematical space between them. We dismantle the specific enterprise use cases, structural strengths, and geometric trade-offs of the core mathematical metrics:</p><ul><li><p>&#8203;<strong>Dot Product:</strong> Measuring both directional alignment and vector magnitude concurrently.</p></li><li><p>&#8203;<strong>Cosine Similarity:</strong> The industry standard for orientation-only comparison within unnormalized multi-dimensional vector spaces.</p></li><li><p>&#8203;<strong>Euclidean Distance:</strong> Computing the straight-line metric within high-dimensional grids.</p></li></ul><h3>&#8203;<strong>3. Word2Vec and Matrix Factorization: How Networks Distill Meaning</strong></h3><p>&#8203;Before modern multi-layer Transformers took over the ecosystem, there was a foundational architectural shift centered on capturing raw context efficiently. We revisit the core mechanics of Word2Vec and the inherent mathematical elegance of matrix factorization, showcasing how neural architectures successfully compress massive, sparse co-occurrence statistics into dense, low-rank semantic embeddings.</p><h3>&#8203;<strong>4. Practical Python: Building a Vector Search Engine From Scratch</strong></h3><p>&#8203;We do not believe in pure theory without actual code execution. To close out this foundational chapter, we implement a functional <strong>Custom Vector Search &amp; Semantic Text Similarity Engine from scratch using pure Python</strong>. No external vector database libraries, no pre-built abstractions&#8212;just raw logic, loops, and mathematical arrays to show you exactly how vector retrieval blocks operate under the hood.</p><p>&#8203;Here is a preview of the raw logic implemented in standard Python without external dependencies, calculating the exact mathematical definition of Cosine Similarity:</p><p>def dot_product(v1, v2):</p><p>    return sum(x * y for x, y in zip(v1, v2))</p><p>def magnitude(v):</p><p>    return sum(x ** 2 for x in v) ** 0.5</p><p>def cosine_similarity(v1, v2):</p><p>    prod = dot_product(v1, v2)</p><p>    mag1 = magnitude(v1)</p><p>    mag2 = magnitude(v2)</p><p>    if not mag1 or not mag2:</p><p>        return 0.0  # Handle zero-vector edge case</p><p>    return prod / (mag1 * mag2)</p><p># Quick validation check in a 3D vector space</p><p>apple_vector = [0.89, 0.12, 0.01]</p><p>orange_vector = [0.85, 0.15, 0.05]</p><p>print(f&#8221;Semantic Similarity: {cosine_similarity(apple_vector, orange_vector):.4f}&#8221;)</p><p>In the full chapter text, we scale this exact geometric intuition up to high-dimensional matrices, optimizing the search loops to process entire text corpora efficiently.</p><h3>&#8203;<strong>Get the Full Architectural Blueprint</strong></h3><p>&#8203;This deep-dive is just the beginning. If you want to master the complete mathematical and practical implementation of neural networks from scratch&#8212;moving from mathematical equations directly into highly optimized code&#8212;check out the full book on Leanpub:</p><p>&#8203;&#128073; <strong><a href="https://leanpub.com/thearchitectureofthought1">The Architecture of Thought</a></strong></p><p><strong>https://leanpub.com/thearchitectureofthought1</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6pHD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80f4a4d7-59b5-4f3d-9d2f-b0c45d5789c4_1080x1604.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6pHD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80f4a4d7-59b5-4f3d-9d2f-b0c45d5789c4_1080x1604.jpeg 424w, https://substackcdn.com/image/fetch/$s_!6pHD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80f4a4d7-59b5-4f3d-9d2f-b0c45d5789c4_1080x1604.jpeg 848w, https://substackcdn.com/image/fetch/$s_!6pHD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80f4a4d7-59b5-4f3d-9d2f-b0c45d5789c4_1080x1604.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!6pHD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80f4a4d7-59b5-4f3d-9d2f-b0c45d5789c4_1080x1604.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6pHD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80f4a4d7-59b5-4f3d-9d2f-b0c45d5789c4_1080x1604.jpeg" width="1080" height="1604" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/80f4a4d7-59b5-4f3d-9d2f-b0c45d5789c4_1080x1604.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1604,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:418277,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adawy2026.substack.com/i/207703764?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80f4a4d7-59b5-4f3d-9d2f-b0c45d5789c4_1080x1604.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6pHD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80f4a4d7-59b5-4f3d-9d2f-b0c45d5789c4_1080x1604.jpeg 424w, https://substackcdn.com/image/fetch/$s_!6pHD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80f4a4d7-59b5-4f3d-9d2f-b0c45d5789c4_1080x1604.jpeg 848w, https://substackcdn.com/image/fetch/$s_!6pHD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80f4a4d7-59b5-4f3d-9d2f-b0c45d5789c4_1080x1604.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!6pHD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80f4a4d7-59b5-4f3d-9d2f-b0c45d5789c4_1080x1604.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h3>&#8203;<strong>The Production Reality Check</strong></h3><p>&#8203;Most modern software practitioners know how to call an external .embed() function or run basic queries against an out-of-the-box hosted vector database. However, when production retrieval systems fail, or when your semantic search pipelines return noisy results, high-level intuition ceases to be enough. You need a granular understanding of the geometry of the space your underlying data lives in.</p><p>&#8203;<strong>What are your personal thoughts on high-dimensional vector space limitations?</strong></p><p>When engineering search and retrieval architectures, do you find yourself tuning the distance metrics themselves, or is your primary performance bottleneck situated within the embedding model&#8217;s dimensionality? Let&#8217;s discuss your architectural experiences in the comments below.</p><p>&#8203;<em>This post is part of our comprehensive technical series. Stay tuned for Chapter 2, where we will dive into the pure matrix calculus of Queries, Keys, and Values in the Scaled Dot-Product Attention Mechanism.</em></p>]]></content:encoded></item><item><title><![CDATA[Dismantling the Hardware Bottleneck: Why Pure Python Fails at AI Scale]]></title><description><![CDATA[Introduction: The Cost of Elegance]]></description><link>https://adawy2026.substack.com/p/dismantling-the-hardware-bottleneck</link><guid isPermaLink="false">https://adawy2026.substack.com/p/dismantling-the-hardware-bottleneck</guid><dc:creator><![CDATA[Ahmed Adawy]]></dc:creator><pubDate>Sun, 19 Jul 2026 08:38:14 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!3c4r!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f045ea-574f-4805-815d-e3f16bd28dff_497x811.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Introduction: The Cost of Elegance</p><p>&#8203;Python is the undisputed king of AI and Applied Mathematics due to its expressive and clean syntax. It allows us to write code that looks remarkably close to pure mathematical formulas. But behind this beauty lies a brutal truth: Python imposes a heavy tax on execution speed and memory efficiency.</p><p>&#8203;When we scale our AI workflows to millions of matrix operations, relying on traditional for loops turns your production environment into a crawl. To fix the hardware limitations, we must first understand how Python interacts with the hardware.</p><p>&#8203;The Anatomy of a Slow Loop</p><p>&#8203;Consider the simple task of squaring 10 million elements. A naive Python implementation looks like this:</p><p>def calculate_squares(n):</p><p>    result = []</p><p>    for i in range(n):</p><p>        result.append(i**2)</p><p>    return result</p><p>This takes seconds to execute. Why? Because the Python interpreter is running multiple hidden operations under the hood during <strong>every single iteration</strong>:</p><ul><li><p>&#8203;<strong>Dynamic Type Checking:</strong> Because Python is dynamically typed, it doesn&#8217;t know data types in advance. At every step, it checks the objects, creating massive latency.</p></li></ul><ul><li><p>&#8203;<strong>Memory Fragmentation &amp; Cache Misses:</strong> Python arrays don&#8217;t hold actual numbers; they hold pointers to distinct Python objects scattered randomly across your RAM. This causes the ultra-fast L1/L2/L3 CPU caches to miss constantly, forcing the processor to wait for the slower system RAM.</p></li><li><p><strong>The GIL (Global Interpreter Lock):</strong> This internal lock restricts execution to a single CPU core, rendering multi-threaded mathematical calculations useless in pure Python.</p></li></ul><p>&#8203;CPU-Bound vs. Memory-Bound Bottlenecks</p><p>&#8203;To think like a performance engineer, you must identify your enemy:</p><ul><li><p><strong>CPU-Bound:</strong> Your bottleneck is the processor&#8217;s clock speed, slammed with intense floating-point math.</p></li></ul><ul><li><p>&#8203;<strong>Memory-Bound:</strong> The bottleneck is data bus bandwidth. The CPU spends too much time idling because pure Python scatters data randomly across the memory layout.</p></li></ul><p>&#8203;The Empirical Proof: Benchmarking the Euclidean Norm</p><p>&#8203;In data normalization and real-time vector embedding similarity, calculating the Euclidean Norm (Magnitude) of a large vector is foundational. The formula is straightforward:</p><p>$$||v|| = \sqrt{\sum v_i^2}$$</p><p>When we run a pure Python benchmark script to calculate this norm for a vector of 5,000,000 random floating-point numbers, it typically takes between 0.4 to 0.7 seconds on a standard modern CPU. In high-frequency production systems where this calculation happens billions of times, this latency is unacceptable.</p><p>&#8203;Breaking the Chain</p><p>&#8203;Our enemy isn&#8217;t the hardware; it&#8217;s how Python talks to it. We don&#8217;t need to change our hardware to collapse a 0.5-second execution time down to mere milliseconds&#8212;we need to change our memory strategy.</p><p>&#8203;In the upcoming chapters of my book, we explore our core weapons: <strong>Advanced Vectorization with NumPy</strong>, <strong>JIT Compilation with Numba</strong>, and <strong>Custom CUDA Kernels</strong> to move computing directly to the GPU.</p><p><em>This article is an excerpt from <strong>Chapter 1: The Bottleneck of Pure Python</strong>, part of <strong>The Hyper-Drive Algorithms</strong> book.</em></p><p>&#8203;<em>I have made the complete Chapter 1 available as a <strong>Free Sample</strong> on Leanpub so you can review the full architecture, benchmarks, and code frameworks.</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3c4r!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f045ea-574f-4805-815d-e3f16bd28dff_497x811.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3c4r!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f045ea-574f-4805-815d-e3f16bd28dff_497x811.jpeg 424w, https://substackcdn.com/image/fetch/$s_!3c4r!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f045ea-574f-4805-815d-e3f16bd28dff_497x811.jpeg 848w, https://substackcdn.com/image/fetch/$s_!3c4r!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f045ea-574f-4805-815d-e3f16bd28dff_497x811.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!3c4r!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f045ea-574f-4805-815d-e3f16bd28dff_497x811.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3c4r!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f045ea-574f-4805-815d-e3f16bd28dff_497x811.jpeg" width="497" height="811" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/59f045ea-574f-4805-815d-e3f16bd28dff_497x811.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:811,&quot;width&quot;:497,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:80177,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adawy2026.substack.com/i/207636556?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f045ea-574f-4805-815d-e3f16bd28dff_497x811.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3c4r!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f045ea-574f-4805-815d-e3f16bd28dff_497x811.jpeg 424w, https://substackcdn.com/image/fetch/$s_!3c4r!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f045ea-574f-4805-815d-e3f16bd28dff_497x811.jpeg 848w, https://substackcdn.com/image/fetch/$s_!3c4r!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f045ea-574f-4805-815d-e3f16bd28dff_497x811.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!3c4r!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f045ea-574f-4805-815d-e3f16bd28dff_497x811.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>&#8203;&#128279; <strong><a href="https://leanpub.com/thehyper-drivealgorithmsfromrawpythonformulastohigh-performancegpumachinecodes">Read the Free Sample &amp; Get the Book on Leanpub</a></strong></p>]]></content:encoded></item><item><title><![CDATA[Beyond Equations: Why Simulation is the New Core of Nuclear Engineering]]></title><description><![CDATA[Nuclear physics has long been perceived as a highly theoretical field]]></description><link>https://adawy2026.substack.com/p/beyond-equations-why-simulation-is</link><guid isPermaLink="false">https://adawy2026.substack.com/p/beyond-equations-why-simulation-is</guid><dc:creator><![CDATA[Ahmed Adawy]]></dc:creator><pubDate>Sat, 18 Jul 2026 15:11:24 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Gscs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea29cbba-8452-4d3e-be53-3f96ee5eb368_896x1062.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><p></p><p>Nuclear physics has long been perceived as a highly theoretical field, often confined to static textbooks and academic lectures. However, in the era of digital transformation, the reactor engineer&#8217;s role has shifted from a passive observer to an active designer of simulated reality.</p><p></p><p>In my book, The Atomic Engine: Applied Reactor Physics &amp; Computational Simulation, I bridge the gap between theory and execution. This isn't just about formulas; it&#8217;s about building a functional framework thatintegrates neutron diffusion kinetics with high-performance computational tools like Python, NumPy, and Numba. We explore how PID controllers and thermal-hydraulic modeling work in tandem to ensure reactor stability.</p><p></p><p>Why does this matter? Historical failures, such as Chernobyl, remind us that accidents are rarely just physics errors&#8212;they are failures to anticipate complex system behaviors under transient conditions. My goal with this work is to help you transition from theory to robust, simulation-driven design.</p><p></p><p>Whether you are a researcher, a student, or a practicing engineer, this book provides the technical foundation to build systems that prioritize safety-by-design.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Gscs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea29cbba-8452-4d3e-be53-3f96ee5eb368_896x1062.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Gscs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea29cbba-8452-4d3e-be53-3f96ee5eb368_896x1062.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Gscs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea29cbba-8452-4d3e-be53-3f96ee5eb368_896x1062.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Gscs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea29cbba-8452-4d3e-be53-3f96ee5eb368_896x1062.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Gscs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea29cbba-8452-4d3e-be53-3f96ee5eb368_896x1062.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Gscs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea29cbba-8452-4d3e-be53-3f96ee5eb368_896x1062.jpeg" width="896" height="1062" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ea29cbba-8452-4d3e-be53-3f96ee5eb368_896x1062.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1062,&quot;width&quot;:896,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:152064,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adawy2026.substack.com/i/207560764?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea29cbba-8452-4d3e-be53-3f96ee5eb368_896x1062.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Gscs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea29cbba-8452-4d3e-be53-3f96ee5eb368_896x1062.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Gscs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea29cbba-8452-4d3e-be53-3f96ee5eb368_896x1062.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Gscs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea29cbba-8452-4d3e-be53-3f96ee5eb368_896x1062.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Gscs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea29cbba-8452-4d3e-be53-3f96ee5eb368_896x1062.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Get your copy here:</p><p>https://leanpub.com/theatomicengineappliedreactorphysicscomputationalsimulation</p>]]></content:encoded></item><item><title><![CDATA[Stop Letting Standard Python Choke Your CPU: Unlocking GPU Speeds for AI Math]]></title><description><![CDATA[How to bridge the gap between raw mathematical formulas and blazing-fast bare-metal hardware acceleration.]]></description><link>https://adawy2026.substack.com/p/stop-letting-standard-python-choke</link><guid isPermaLink="false">https://adawy2026.substack.com/p/stop-letting-standard-python-choke</guid><dc:creator><![CDATA[Ahmed Adawy]]></dc:creator><pubDate>Fri, 17 Jul 2026 20:01:46 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!A0uG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fcfbef9-9909-4723-9e90-206201a104fc_497x811.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Python is the undisputed king of AI and Machine Learning development. Its elegance and simplicity make it beautiful to write. But as your models scale and you need to process millions of parameters or run complex mathematical simulations, that elegance comes with a heavy tax: standard Python is notoriously slow.</p><p>&#8203;Traditional for loops and naive code will instantly choke your CPU.</p><p>&#8203;Many developers think the only solution is to rewrite everything in C++ or CUDA. But what if you could turn your raw Python formulas into lightning-fast, production-ready GPU and machine code&#8212;without leaving your Python environment?</p><p>&#8203;Let&#8217;s look at a concrete, practical example.</p><p>&#8203;The Practical Experiment: CPU vs. Accelerated GPU Code</p><p>&#8203;Imagine you need to apply a complex mathematical transformation (like a custom activation function or an element-wise simulation) over a massive dataset of 10 million points.</p><p>&#8203;Here is how standard Python/NumPy runs it on the CPU, versus how we can hyper-drive it directly onto the GPU using Numba&#8217;s JIT (Just-In-Time) compiler with bare-metal parallelism.</p><p>import numpy as np</p><p>import time</p><p>from numba import vectorize, cuda</p><p></p><p># 1. Create a massive dataset (10 Million Elements)</p><p>data = np.linspace(1, 10, 10000000).astype(np.float32)</p><p></p><p># A complex formula simulating heavy mathematical operations</p><p>def raw_math_formula(x):</p><p>    # Standard math that usually bottlenecks the CPU</p><p>    return (x ** 2 + np.sin(x)) / (x + 1)</p><p></p><p># ---- TEST 1: Standard CPU Execution ----</p><p>start_cpu = time.time()</p><p>cpu_result = raw_math_formula(data)</p><p>end_cpu = time.time()</p><p>print(f"Standard CPU Execution Time: {end_cpu - start_cpu:.4f} seconds")</p><p></p><p></p><p># ---- TEST 2: Hyper-Driven GPU Execution ----</p><p># Using Numba to compile the raw formula into native GPU machine code</p><p>@vectorize(['float32(float32)'], target='cuda')</p><p>def gpu_math_formula(x):</p><p>    import math</p><p>    return (x ** 2 + math.sin(x)) / (x + 1)</p><p></p><p># Warm-up the GPU compiler</p><p>_ = gpu_math_formula(data[:10])</p><p></p><p>start_gpu = time.time()</p><p>gpu_result = gpu_math_formula(data)</p><p>end_gpu = time.time()</p><p>print(f"Accelerated GPU Execution Time: {end_gpu - start_gpu:.4f} seconds")</p><h3><strong>What&#8217;s Happening Under the Hood?</strong></h3><p>&#8203;When you run the standard version, Python&#8217;s interpreter overhead and CPU core limitations slow down the calculation.</p><p>&#8203;However, by adding the @vectorize(target=&#8217;cuda&#8217;) decorator, <strong>Numba bypasses the CPU entirely</strong>. It compiles your raw mathematical formula directly into LLVM machine code that runs across thousands of parallel GPU cores simultaneously.</p><p>&#8203;The result? A massive, game-changing speedup for your mathematical pipelines.</p><h3>&#8203;<strong>Ready to Master Bare-Metal Hardware Acceleration?</strong></h3><p>&#8203;If you want to stop thinking like a high-level scripter and start thinking like a performance engineer, this is exactly what my latest book is about.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!A0uG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fcfbef9-9909-4723-9e90-206201a104fc_497x811.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!A0uG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fcfbef9-9909-4723-9e90-206201a104fc_497x811.jpeg 424w, https://substackcdn.com/image/fetch/$s_!A0uG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fcfbef9-9909-4723-9e90-206201a104fc_497x811.jpeg 848w, https://substackcdn.com/image/fetch/$s_!A0uG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fcfbef9-9909-4723-9e90-206201a104fc_497x811.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!A0uG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fcfbef9-9909-4723-9e90-206201a104fc_497x811.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!A0uG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fcfbef9-9909-4723-9e90-206201a104fc_497x811.jpeg" width="497" height="811" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6fcfbef9-9909-4723-9e90-206201a104fc_497x811.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:811,&quot;width&quot;:497,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:80177,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adawy2026.substack.com/i/207473710?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fcfbef9-9909-4723-9e90-206201a104fc_497x811.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!A0uG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fcfbef9-9909-4723-9e90-206201a104fc_497x811.jpeg 424w, https://substackcdn.com/image/fetch/$s_!A0uG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fcfbef9-9909-4723-9e90-206201a104fc_497x811.jpeg 848w, https://substackcdn.com/image/fetch/$s_!A0uG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fcfbef9-9909-4723-9e90-206201a104fc_497x811.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!A0uG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fcfbef9-9909-4723-9e90-206201a104fc_497x811.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>&#8203;&#128640; <strong>&#8220;The Hyper-Drive Algorithms: From Raw Python Formulas to High-Performance GPU &amp; Machine Code&#8221;</strong></p><p>&#8203;This book&#8212;the seventh volume in the acclaimed <em>Ultimate AI Math &amp; Code Series</em>&#8212;is your ultimate engineering blueprint to breaking speed limits.</p><p>&#8203;<strong>What You Will Learn:</strong></p><ul><li><p>&#8203;<strong>Identify the Bottlenecks:</strong> Understand exactly why standard Python fails at scale.</p></li><li><p>&#8203;<strong>Parallelization &amp; Vectorization:</strong> Transform slow Python loops into blazing-fast machine code.</p></li><li><p>&#8203;<strong>GPU &amp; CUDA Programming:</strong> Master low-level optimization techniques to claim absolute, unmatched execution speeds.</p></li></ul><p>&#8203;Don&#8217;t let standard hardware bottlenecks limit your growth as an AI professional. Claim your copy and upgrade your engineering skills today!</p><p>&#8203;&#128073; <strong><a href="https://leanpub.com/thehyper-drivealgorithmsfromrawpythonformulastohigh-performancegpumachinecodes">Get the Book Directly on Leanpub Here!</a></strong></p><p><strong>https://leanpub.com/thehyper-drivealgorithmsfromrawpythonformulastohigh-performancegpumachinecodes</strong></p>]]></content:encoded></item><item><title><![CDATA[Hello World! Why Math is Your Ultimate AI Superpower]]></title><description><![CDATA[Bridging the gap between scary mathematical formulas and clean Python code.]]></description><link>https://adawy2026.substack.com/p/hello-world-why-math-is-your-ultimate</link><guid isPermaLink="false">https://adawy2026.substack.com/p/hello-world-why-math-is-your-ultimate</guid><dc:creator><![CDATA[Ahmed Adawy]]></dc:creator><pubDate>Thu, 16 Jul 2026 21:18:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!at-k!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fde64e5-7436-42d5-9a4f-0375af87e9e1_1600x912.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hello developers, tech enthusiasts, and curious minds!</p><p>&#8203;Welcome to my very first post here on Substack.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://adawy2026.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading &#8203;Applied Math &amp; AI! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>&#8203;If you&#8217;ve ever tried to dive into Machine Learning or Artificial Intelligence, you&#8217;ve probably run into a massive wall of complex mathematical equations. Linear Algebra, Calculus, Probability... to many programmers, these look like a scary, academic "black box."</p><p>&#8203;For a long time, the advice was: "Just import the libraries, run model.fit(), and don't worry about the math."</p><p>&#8203;But here&#8217;s the truth: Without understanding the underlying math, you are driving a supercar without knowing how the engine works. When things break&#8212;and they will&#8212;you won't know how to fix them.</p><p>&#8203;My name is Ahmed Adawy, and my mission here is simple: To demystify the mathematics of AI and make it practical, intuitive, and directly applicable to code.</p><p>&#8203;What to Expect From This Newsletter:</p><p>&#8203;In this newsletter, we won't just look at dry formulas. Instead, we will:</p><p>&#8203;Deconstruct AI Math: Break down complex algorithms into simple concepts.</p><p>&#8203;Code the Concepts: Translate every mathematical idea into clean, real-world Python code using libraries like NumPy.</p><p>&#8203;Build the Foundation: Learn how AI models actually think, optimize, and learn.</p><p>&#8203;Whether you are a software engineer wanting to transition into AI, a student struggling with academic books, or a tech enthusiast looking for depth, you are in the right place.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!at-k!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fde64e5-7436-42d5-9a4f-0375af87e9e1_1600x912.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!at-k!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fde64e5-7436-42d5-9a4f-0375af87e9e1_1600x912.jpeg 424w, https://substackcdn.com/image/fetch/$s_!at-k!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fde64e5-7436-42d5-9a4f-0375af87e9e1_1600x912.jpeg 848w, https://substackcdn.com/image/fetch/$s_!at-k!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fde64e5-7436-42d5-9a4f-0375af87e9e1_1600x912.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!at-k!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fde64e5-7436-42d5-9a4f-0375af87e9e1_1600x912.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!at-k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fde64e5-7436-42d5-9a4f-0375af87e9e1_1600x912.jpeg" width="1456" height="830" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6fde64e5-7436-42d5-9a4f-0375af87e9e1_1600x912.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:830,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:46481,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adawy2026.substack.com/i/207345997?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fde64e5-7436-42d5-9a4f-0375af87e9e1_1600x912.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!at-k!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fde64e5-7436-42d5-9a4f-0375af87e9e1_1600x912.jpeg 424w, https://substackcdn.com/image/fetch/$s_!at-k!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fde64e5-7436-42d5-9a4f-0375af87e9e1_1600x912.jpeg 848w, https://substackcdn.com/image/fetch/$s_!at-k!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fde64e5-7436-42d5-9a4f-0375af87e9e1_1600x912.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!at-k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fde64e5-7436-42d5-9a4f-0375af87e9e1_1600x912.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>&#8203;&#128640; A Sneak Peek Into My Upcoming Book!</p><p>&#8203;This newsletter is born from the core philosophy of my book: "Applied Mathematics &amp; Artificial Intelligence".</p><p>&#8203;If you want to support my journey and get your hands on a comprehensive guide that bridges theory and Python code step-by-step, you can check out the book directly on Leanpub!</p><p>&#8203;&#128073; [Click Here to Check Out the Book on Leanpub] (https://leanpub.com/appliedmathematicsartificialintelligenceyourbridgefromformulastopythoncode)</p><p>&#8203;Thank you for being here at the very beginning. Hit the Subscribe button below to never miss a post, and let&#8217;s make AI math make sense&#8212;together!</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://adawy2026.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading &#8203;Applied Math &amp; AI! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>