<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blog on The Smoking Duck Blog</title><link>https://blog.aabouzied.com/</link><description>Recent content in Blog on The Smoking Duck Blog</description><generator>Hugo</generator><language>en-US</language><copyright>Copyright © 2021, Ahmed Abouzied.</copyright><atom:link href="https://blog.aabouzied.com/index.xml" rel="self" type="application/rss+xml"/><item><title>هكذا تكلم شات جي بي تي</title><link>https://blog.aabouzied.com/thus-spoke-chatgpt/</link><pubDate>Sat, 03 Oct 2026 22:25:00 +0200</pubDate><guid>https://blog.aabouzied.com/thus-spoke-chatgpt/</guid><description>&lt;p&gt;في كتاب غلس قريته مؤخراً عايز اغلس عليك بيه. اسمه Moral Responsibility and Artificial Intelligence المسؤلية الاخلاقية و الذكاء الاصطناعي (مش الذكاء السوبر و لا حاجة كما ادعي البرتقالي XD). كتبه راجل فيلسوف معاصر بيناقش حاجة بصراحة مهمة. مين يتحمل المسؤولية لما الذكاء الصناعي الشات جي بي تي دا يعمل حاجة غلط؟&lt;/p&gt;&#10;&lt;p&gt;هتقولي ببساطة اللي قال للذكاء الصناعي يعمل حاجة غلط هو المسؤول. لا .. الأمر ليس بهذه البساطة.&lt;/p&gt;&#10;&lt;p&gt;الجملة الشهيرة المتحذلقة &amp;ldquo;ممكن تستخدم السكينة في انك تقطع خيار و ممكن تستخدمها في إيذاء حد&amp;rdquo; الامر كله في ايدك. ماشي دي السكينة، بس الذكاء الصناعي اعقد من ذلك. مش بيشتغل بهذه الطريقة. الذكاء الصناعي المشكلة فيه انك ممكن تقوله يعمل حاجة صح يروح هو يعمل حاجة غلط. او تقوله يعمل شيء في ظاهره شيء كويس، يروح هو يعمله بأسلوب غلط.&lt;/p&gt;</description></item><item><title>عصر شاشات الظلام</title><link>https://blog.aabouzied.com/the-new-dark-ages/</link><pubDate>Thu, 01 Oct 2026 22:05:00 +0200</pubDate><guid>https://blog.aabouzied.com/the-new-dark-ages/</guid><description>&lt;p&gt;في كتاب لم يُطرح بعد في الاسواق عزيزي مستخدم الفيسبوك اسمه &lt;a href="https://www.penguinrandomhouse.com/books/829140/the-new-dark-ages-by-james-marriott/"&gt;The new dark ages&lt;/a&gt;. ممكن تعملُّه preorder و يوصلك لما ينزل. لقيته علي &lt;a href="https://www.audible.com/pd/The-New-Dark-Ages-Audiobook/B0GZ7GVTSV"&gt;Audible&lt;/a&gt; نسخة كتاب مسموع بصوت الكاتب نفسه .. و هو في الحقيقة كتاب متميز و بيقول كلام صادم.&lt;/p&gt;&#10;&lt;p&gt;بيقول ان معدلات ال literacy بتقل بشكل عجيب. ال literacy هي القدرة علي القراءة و الكتابة (عكس الأمية يعني). طيب هل دا حقيقي؟ حرفيا؟ لا طبعا الناس لسة بتعرف تقرا و معدلات التعليم مش بتقل .. اظن كمان العكس.&lt;/p&gt;</description></item><item><title>goprove: A prover for Golang</title><link>https://blog.aabouzied.com/goprove-a-prover-for-golang/</link><pubDate>Thu, 26 Mar 2026 00:00:00 +0000</pubDate><guid>https://blog.aabouzied.com/goprove-a-prover-for-golang/</guid><description>&lt;p&gt;Now that AI is writing a lot of production code. We need to have as many checks and validators as possible to validate the code AI writes. That&amp;rsquo;s why I want to share &amp;ldquo;goprove&amp;rdquo;. A project I have been cooking for more than a month (by hand, AI helped a lot with testing for edge cases though).&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://goprove.dev/"&gt;goprove.dev&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;It&amp;rsquo;s a &amp;ldquo;prover&amp;rdquo; for Golang. A prover that mathematically proves that your Go code is safe against certain issues such as nil pointer panics and integer overflows. Go was not built for safe mission-critical software. You will not be building a medical ICU monitor in Go (well, I certainly hope not XD). That&amp;rsquo;s a C++ job with all the tools that prove C++ code and certify it against explicit safety certification standards. And Rust has been catching up to this game.&lt;/p&gt;</description></item><item><title>Let’s build a Golang knowledge specific RAG system with a local llama LLM</title><link>https://blog.aabouzied.com/golang-knowledge-specific-rag/</link><pubDate>Fri, 27 Dec 2024 09:40:45 +0000</pubDate><guid>https://blog.aabouzied.com/golang-knowledge-specific-rag/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;&#10;&lt;p&gt;In this article, we’re going to build a Golang knowledge specific RAG AI Chat system using open source and free components with the ability to make more documents available for it. This RAG system can be used for example for internal documentation, where we can make a chat LLM answer questions based solely on our documentation. Also, it means that it will be able to answer more specific questions that general use case chat LLMs fail with due to not being trained on the internal specific data set.&lt;/p&gt;</description></item><item><title>On Fact-checking RAG Outputs</title><link>https://blog.aabouzied.com/on-fact-checking-rag-outputs/</link><pubDate>Thu, 26 Dec 2024 18:36:34 +0000</pubDate><guid>https://blog.aabouzied.com/on-fact-checking-rag-outputs/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;&#10;&lt;p&gt;In this article, we explore the challenges and methods of &lt;strong&gt;fact-checking RAG&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;(Retrieval-Augmented-Generation) output.&lt;/p&gt;&#10;&lt;p&gt;We begin with a &lt;strong&gt;philosophical rant&lt;/strong&gt; about what exactly a fact is. And why I think knowledge is better represented in an “index” &lt;strong&gt;(encyclopedia) rather than in a “knowledge graph”&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;p&gt;Following that, we go into &lt;strong&gt;practical experiments&lt;/strong&gt;, including:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Implementing a &lt;strong&gt;fact extractor&lt;/strong&gt; using &amp;ldquo;GPT-4o-mini&amp;rdquo;.&lt;/li&gt;&#10;&lt;li&gt;Utilizing &amp;ldquo;DeBERTa&amp;rdquo; for &lt;strong&gt;detecting contradictions&lt;/strong&gt; between two sentences.&lt;/li&gt;&#10;&lt;li&gt;Building a &lt;strong&gt;fact-checker pipeline&lt;/strong&gt;.&lt;/li&gt;&#10;&lt;li&gt;Finally, we test these tools in a controlled environment using a single-document Retrieval-Augmented Generation (RAG) setup to &lt;strong&gt;detect if the RAG system has given us false information&lt;/strong&gt;.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;&lt;strong&gt;The code accompanying this article can be found&lt;/strong&gt; &lt;a href="https://github.com/ahmedaabouzied/rag-systems/tree/main/fact_checking"&gt;&lt;strong&gt;here on Github.&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>An Experiment with RAG Search Accuracy</title><link>https://blog.aabouzied.com/experiment-rag-search-accuracy/</link><pubDate>Fri, 20 Dec 2024 06:30:13 +0000</pubDate><guid>https://blog.aabouzied.com/experiment-rag-search-accuracy/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;&#10;&lt;p&gt;In a previous article, we explored the foundations of a basic Retrieval-Augmented Generation (RAG) system by building a straightforward implementation and loading it with articles from the Go blog. This simple setup allowed us to test the concept of enhancing search accuracy by combining a document corpus with advanced retrieval techniques.&lt;/p&gt;&#10;&lt;p&gt;Now, we’re taking that experiment further. In this article, we’ll delve into optimizing RAG search accuracy through more advanced techniques and comparisons. Specifically, we’ll discuss:&lt;/p&gt;</description></item><item><title>A train hopping trip</title><link>https://blog.aabouzied.com/a-train-hopping-trip/</link><pubDate>Fri, 31 May 2024 12:17:40 +0200</pubDate><guid>https://blog.aabouzied.com/a-train-hopping-trip/</guid><description>&lt;h2 id="a-long-awaited-trip"&gt;A long awaited trip&lt;/h2&gt;&#10;&lt;p&gt;Recently I finally got the chance to go on a trip I have always wanted. Hopping only on trains across different european cities with no hotels or hostels needed. Only sleeper trains. And what an experience it was!&lt;/p&gt;&#10;&lt;p&gt;I have had this trip in mind since I was in college in Egypt. The trip would be only using trains. No flights involved and no hotels. Utilizing sleeping trains at night and roaming around cities either on foot or with trains with nice scenery in the mornings. Yet, when I was in college I was too busy and I could not afford such a trip anyways as a college student. Now that I&amp;rsquo;m older, with a bit more resources, and that I live in Europe, I thought it&amp;rsquo;s a good time to finally put the plan to action. And there is no mind in treating myself with 1st class seets and sleeper compartments for extra comfort since the budget allows it.&lt;/p&gt;</description></item><item><title>It's windows all over (a song)</title><link>https://blog.aabouzied.com/its-windows-all-over-a-song/</link><pubDate>Wed, 21 Jun 2023 01:00:00 +0000</pubDate><guid>https://blog.aabouzied.com/its-windows-all-over-a-song/</guid><description>&lt;h2 id="the-song"&gt;The song&lt;/h2&gt;&#10;&lt;p&gt;The &lt;a href="https://youtu.be/WEjqxOinvdg"&gt;nice song&lt;/a&gt; is called &amp;ldquo;Shababeik&amp;rdquo; which means windows.&#10;Sung by &lt;a href="https://en.wikipedia.org/wiki/Mohamed_Mounir"&gt;Mohamed Mounir&lt;/a&gt;. The poet&#10;Magdy Naguib thought about it while he was politically imprisoned for opposing&#10;the controversial yet widely influencial Egyptian president&#10;&lt;a href="https://en.wikipedia.org/wiki/Gamal_Abdel_Nasser"&gt;Nasser&lt;/a&gt; who ruled from&#10;1954 till 1962. The poet was deeply affected by being imprisoned with no trial as&#10;a form of political tyranny. Although he was a supporter of Nasser and just wanted&#10;to express opinion, he was still falsly imprisoned.&lt;/p&gt;</description></item><item><title>On the internet conquest of happiness</title><link>https://blog.aabouzied.com/on-the-internet-conquest-of-happiness/</link><pubDate>Sun, 02 Jan 2022 00:00:01 +0000</pubDate><guid>https://blog.aabouzied.com/on-the-internet-conquest-of-happiness/</guid><description>&lt;h2 id="you-outgrow-your-town"&gt;You outgrow your town&lt;/h2&gt;&#10;&lt;p&gt;Sympathetic surroundings are essential to happiness. I think it’s common enough&#10;to find oneself in a situation of recalling the song &lt;a href="https://youtu.be/XFkzRNyygfk"&gt;“Creep” by Radiohead&lt;/a&gt;&#10;and to be specific the part “What the hell am I doing here?&amp;quot;. I dare say that&#10;you -the reader- share the experience with me of finding no one to share&#10;the interest in a specific subject you deeply care about. You find the people&#10;and the environment surrounding you to be not just ignorant about that&#10;subject, but also discouraging. A young person who wishes to read a serious&#10;book is discouraged by their parents. Teachers tell them off in the fear&#10;that these books may disorient their thoughts. And let’s not ignore the mere&#10;reason that this fear for the young person from such book induced by the&#10;parent, teacher or even friends is due to the mere fact that they have never&#10;read such books and they have neither the interest nor the will to read such&#10;books. They find that the young person’s interest in such books or topics&#10;peculiar and not useful. The young person then, of course, will themself&#10;lonesome and unhappy. For they seek to meet others with similar interests.&lt;/p&gt;</description></item><item><title>On the memory of a song</title><link>https://blog.aabouzied.com/on-the-memory-of-a-song/</link><pubDate>Mon, 26 Apr 2021 01:00:00 +0000</pubDate><guid>https://blog.aabouzied.com/on-the-memory-of-a-song/</guid><description>&lt;h2 id="the-song"&gt;The song&lt;/h2&gt;&#10;&lt;p&gt;A few years ago, I used to listen to the song &amp;ldquo;Comme Moi&amp;rdquo; by Edit Piaf a lot. I had it playing on a loop. I was living in a rented apartment with a flatmate that I met by mere coincidence, but he became one of the closest friends I&amp;rsquo;ve ever had. I was committed to a healthy lifestyle then. I paid daily visits to a nearby gym. The coach was a very peculiar man. Short, bulky, and with a strange voice, he gave a fun aspect to gym visits. He had very sharp and strange opinions. Very fanatic about football, he used to yell in a funny way at the players on the TV while we exercised, making us all drop the weights and laugh deeply.&lt;/p&gt;</description></item><item><title>Time Preference</title><link>https://blog.aabouzied.com/time-preference/</link><pubDate>Sat, 23 Jan 2021 12:17:40 +0200</pubDate><guid>https://blog.aabouzied.com/time-preference/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;&#10;&lt;p&gt;Time preference is an economic term that describes an individual&amp;rsquo;s affinity to wait on gratification that would be received in the present time in order to receive more gratification in the future. Given the limited amount of time a human has and the fact that a human&amp;rsquo;s life is very fragile, delaying instant gratification is often a hard decision to make. However, if humans always go for instant gratification, very little progress can be achieved. In this blog post, I&amp;rsquo;ll be discussing the impact of time preference on the life of individuals and why we should always restrain our instincts to go for the easy guaranteed instant gratification.&lt;/p&gt;</description></item><item><title>On Sarcasm</title><link>https://blog.aabouzied.com/on-sarcasm/</link><pubDate>Fri, 22 Jan 2021 01:53:22 +0200</pubDate><guid>https://blog.aabouzied.com/on-sarcasm/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;&#10;&lt;p&gt;In this blog post, I argue that sarcasm as a form of humor comes within a feeling of superiority. It is a passive act that renders a human falsely satisfied with their reaction to an event or an idea. Yet this reaction (sarcasm) is merely a lazy counter-argument that doesn’t help improve the overall outcome of the interaction.&lt;/p&gt;&#10;&lt;h2 id="a-form-of-humor"&gt;A form of humor&lt;/h2&gt;&#10;&lt;p&gt;Sarcasm is undoubtedly a strong form of humor. I myself often find it really funny and engaging. Yet we can&amp;rsquo;t think critically about sarcasm without investigating the triggers of humor _ the funny effect _ in it.&lt;/p&gt;</description></item><item><title>Problem solving: Minesweeper</title><link>https://blog.aabouzied.com/problem-solving-minesweeper/</link><pubDate>Thu, 02 Apr 2020 05:25:44 +0000</pubDate><guid>https://blog.aabouzied.com/problem-solving-minesweeper/</guid><description>&lt;h2 id="problem-statement"&gt;Problem Statement&lt;/h2&gt;&#10;&lt;p&gt;As stated on &lt;a href="https://app.codesignal.com/arcade/intro/level-5/ZMR5n7vJbexnLrgaM"&gt;CodeSignal&lt;/a&gt; :&lt;/p&gt;&#10;&lt;p&gt;In the popular Minesweeper game you have a board with some mines and those cells that don&amp;rsquo;t contain a mine have a number in it that indicates the total number of mines in the neighboring cells. Starting off with some arrangement of mines we want to create a Minesweeper game setup.&lt;/p&gt;&#10;&lt;h2 id="input-and-output-examples"&gt;Input and output examples&lt;/h2&gt;&#10;&lt;h4 id="for-input-"&gt;For Input :&lt;/h4&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;matrix = [[true, false, false],&#10; [false, true, false],&#10; [false, false, false]]&#10;&lt;/code&gt;&lt;/pre&gt;&lt;h4 id="output-"&gt;Output :&lt;/h4&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;minesweeper(matrix) = [[1, 2, 1],&#10; [2, 1, 1],&#10; [1, 1, 1]]&#10;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="solution"&gt;Solution:&lt;/h2&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;std&lt;span style="color:#ff79c6"&gt;::&lt;/span&gt;vector&lt;span style="color:#ff79c6"&gt;&amp;lt;&lt;/span&gt;std&lt;span style="color:#ff79c6"&gt;::&lt;/span&gt;vector&lt;span style="color:#ff79c6"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#8be9fd"&gt;int&lt;/span&gt;&lt;span style="color:#ff79c6"&gt;&amp;gt;&amp;gt;&lt;/span&gt; minesweeper(std&lt;span style="color:#ff79c6"&gt;::&lt;/span&gt;vector&lt;span style="color:#ff79c6"&gt;&amp;lt;&lt;/span&gt;std&lt;span style="color:#ff79c6"&gt;::&lt;/span&gt;vector&lt;span style="color:#ff79c6"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#8be9fd"&gt;bool&lt;/span&gt;&lt;span style="color:#ff79c6"&gt;&amp;gt;&amp;gt;&lt;/span&gt; matrix) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; std&lt;span style="color:#ff79c6"&gt;::&lt;/span&gt;vector&lt;span style="color:#ff79c6"&gt;&amp;lt;&lt;/span&gt;std&lt;span style="color:#ff79c6"&gt;::&lt;/span&gt;vector&lt;span style="color:#ff79c6"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#8be9fd"&gt;int&lt;/span&gt;&lt;span style="color:#ff79c6"&gt;&amp;gt;&amp;gt;&lt;/span&gt; res;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ff79c6"&gt;for&lt;/span&gt; (&lt;span style="color:#8be9fd"&gt;int&lt;/span&gt; y &lt;span style="color:#ff79c6"&gt;=&lt;/span&gt; &lt;span style="color:#bd93f9"&gt;0&lt;/span&gt;; y &lt;span style="color:#ff79c6"&gt;&amp;lt;&lt;/span&gt; matrix.size(); y&lt;span style="color:#ff79c6"&gt;++&lt;/span&gt; ){&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; std&lt;span style="color:#ff79c6"&gt;::&lt;/span&gt;vector&lt;span style="color:#ff79c6"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#8be9fd"&gt;int&lt;/span&gt;&lt;span style="color:#ff79c6"&gt;&amp;gt;&lt;/span&gt; row;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ff79c6"&gt;for&lt;/span&gt; (&lt;span style="color:#8be9fd"&gt;int&lt;/span&gt; x &lt;span style="color:#ff79c6"&gt;=&lt;/span&gt; &lt;span style="color:#bd93f9"&gt;0&lt;/span&gt;; x &lt;span style="color:#ff79c6"&gt;&amp;lt;&lt;/span&gt; matrix[y].size(); x&lt;span style="color:#ff79c6"&gt;++&lt;/span&gt;){&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#8be9fd"&gt;int&lt;/span&gt; count &lt;span style="color:#ff79c6"&gt;=&lt;/span&gt; &lt;span style="color:#bd93f9"&gt;0&lt;/span&gt;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ff79c6"&gt;for&lt;/span&gt; (&lt;span style="color:#8be9fd"&gt;int&lt;/span&gt; a &lt;span style="color:#ff79c6"&gt;=&lt;/span&gt; &lt;span style="color:#ff79c6"&gt;-&lt;/span&gt;&lt;span style="color:#bd93f9"&gt;1&lt;/span&gt;; a &lt;span style="color:#ff79c6"&gt;&amp;lt;=&lt;/span&gt; &lt;span style="color:#bd93f9"&gt;1&lt;/span&gt;; a&lt;span style="color:#ff79c6"&gt;++&lt;/span&gt;){&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ff79c6"&gt;for&lt;/span&gt;(&lt;span style="color:#8be9fd"&gt;int&lt;/span&gt; b &lt;span style="color:#ff79c6"&gt;=&lt;/span&gt; &lt;span style="color:#ff79c6"&gt;-&lt;/span&gt;&lt;span style="color:#bd93f9"&gt;1&lt;/span&gt;; b &lt;span style="color:#ff79c6"&gt;&amp;lt;=&lt;/span&gt; &lt;span style="color:#bd93f9"&gt;1&lt;/span&gt;; b&lt;span style="color:#ff79c6"&gt;++&lt;/span&gt;){&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#8be9fd"&gt;int&lt;/span&gt; c &lt;span style="color:#ff79c6"&gt;=&lt;/span&gt; a &lt;span style="color:#ff79c6"&gt;+&lt;/span&gt; y, d &lt;span style="color:#ff79c6"&gt;=&lt;/span&gt; b &lt;span style="color:#ff79c6"&gt;+&lt;/span&gt; x;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ff79c6"&gt;if&lt;/span&gt; (c &lt;span style="color:#ff79c6"&gt;==&lt;/span&gt; y &lt;span style="color:#ff79c6"&gt;&amp;amp;&amp;amp;&lt;/span&gt; d &lt;span style="color:#ff79c6"&gt;==&lt;/span&gt; x){&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ff79c6"&gt;continue&lt;/span&gt;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ff79c6"&gt;if&lt;/span&gt; (&lt;span style="color:#bd93f9"&gt;0&lt;/span&gt; &lt;span style="color:#ff79c6"&gt;&amp;lt;=&lt;/span&gt; c &lt;span style="color:#ff79c6"&gt;&amp;amp;&amp;amp;&lt;/span&gt; c &lt;span style="color:#ff79c6"&gt;&amp;lt;&lt;/span&gt; matrix.size() &lt;span style="color:#ff79c6"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style="color:#bd93f9"&gt;0&lt;/span&gt; &lt;span style="color:#ff79c6"&gt;&amp;lt;=&lt;/span&gt; d &lt;span style="color:#ff79c6"&gt;&amp;amp;&amp;amp;&lt;/span&gt; d &lt;span style="color:#ff79c6"&gt;&amp;lt;&lt;/span&gt; matrix[&lt;span style="color:#bd93f9"&gt;0&lt;/span&gt;].size()) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; count &lt;span style="color:#ff79c6"&gt;+=&lt;/span&gt; matrix[c][d] &lt;span style="color:#ff79c6"&gt;?&lt;/span&gt; &lt;span style="color:#bd93f9"&gt;1&lt;/span&gt; &lt;span style="color:#ff79c6"&gt;:&lt;/span&gt; &lt;span style="color:#bd93f9"&gt;0&lt;/span&gt;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; row.push_back(count);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; res.push_back(row);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ff79c6"&gt;return&lt;/span&gt; res;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Problem solving: Box Blur</title><link>https://blog.aabouzied.com/problem-solving-box-blur/</link><pubDate>Wed, 01 Apr 2020 05:25:44 +0000</pubDate><guid>https://blog.aabouzied.com/problem-solving-box-blur/</guid><description>&lt;h2 id="problem-statement"&gt;Problem Statement&lt;/h2&gt;&#10;&lt;p&gt;As stated on &lt;a href="https://app.codesignal.com/arcade/intro/level-5/5xPitc3yT3dqS7XkP"&gt;CodeSignal&lt;/a&gt; :&lt;/p&gt;&#10;&lt;p&gt;The pixels in the input image are represented as integers. The algorithm distorts the input image in the following way: Every pixel x in the output image has a value equal to the average value of the pixel values from the 3 × 3 square that has its center at x, including x itself. All the pixels on the border of x are then removed.&lt;/p&gt;</description></item><item><title>On Memory Management in C++</title><link>https://blog.aabouzied.com/on-memory-management-in-c-/</link><pubDate>Fri, 13 Sep 2019 05:25:44 +0000</pubDate><guid>https://blog.aabouzied.com/on-memory-management-in-c-/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;&#10;&lt;p&gt;Due to it&amp;rsquo;s being type unsafe , it&amp;rsquo;s very difficult to develop a garbage collector for c++. It&amp;rsquo;s rather something that the C++ community often boosts about. It&amp;rsquo;s true that it makes the compiled programs very lean and smaller in size. However it adds work to the development process. You&amp;rsquo;d have to handle the memory yourself as a c++ developer.&lt;/p&gt;&#10;&lt;h2 id="types-of-memory"&gt;Types of memory&lt;/h2&gt;&#10;&lt;p&gt;There are mainly three types of memory that can be used by the developer :&lt;/p&gt;</description></item><item><title>On Cancel Propagation in Web Servers</title><link>https://blog.aabouzied.com/on-cancel-propagation-in-web-servers/</link><pubDate>Fri, 24 May 2019 09:33:35 +0200</pubDate><guid>https://blog.aabouzied.com/on-cancel-propagation-in-web-servers/</guid><description>&lt;h2 id="on-cancellation"&gt;On Cancellation&lt;/h2&gt;&#10;&lt;p&gt;Consider the common situation of a web server making a call to the database then returning the data to the client .&lt;/p&gt;&#10;&lt;p&gt;What would happen if the client cancelled the request in the middle ?This could be due to that it lost connection or just simply if the user cancels the request from the browser while it&amp;rsquo;s still loading by closing the browser or simply clicking &lt;code&gt;x&lt;/code&gt;. The &lt;code&gt;Server&lt;/code&gt; and &lt;code&gt;Database&lt;/code&gt; layers would still process the request and take resources and all this effort would render no profit since the data would not be sent to the client.&lt;/p&gt;</description></item></channel></rss>