<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by AKM Ahsanuzzaman (Ahsan Aasim) on Medium]]></title>
        <description><![CDATA[Stories by AKM Ahsanuzzaman (Ahsan Aasim) on Medium]]></description>
        <link>https://medium.com/@ahsan.aasim?source=rss-16137c1c32e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zRZZuvz_tUD7lRnpLDmvwg.png</url>
            <title>Stories by AKM Ahsanuzzaman (Ahsan Aasim) on Medium</title>
            <link>https://medium.com/@ahsan.aasim?source=rss-16137c1c32e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 19:48:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ahsan.aasim/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Codeforces F(355495): Appleman and Card Game]]></title>
            <link>https://medium.com/@ahsan.aasim/codeforces-f-355495-appleman-and-card-game-7f4ec194974c?source=rss-16137c1c32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f4ec194974c</guid>
            <category><![CDATA[c-programming]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[codeforces]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[AKM Ahsanuzzaman (Ahsan Aasim)]]></dc:creator>
            <pubDate>Fri, 20 Dec 2024 08:39:05 GMT</pubDate>
            <atom:updated>2024-12-20T08:49:35.957Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yiqz5Y7vfAtbNXKo" /></figure><p>Appleman has a deck of cards, where each card contains an uppercase English letter (like ‘A’, ‘B’, …, ‘Z’). Each character might appear multiple times in the deck. Appleman can pick up to <em>k</em> cards from the deck to maximize his <strong>score</strong>. The <strong>score</strong> is calculated as the <strong>sum of the squares</strong> of the number of cards picked for each character.</p><p>Let me explain clearly <strong>how the score is calculated</strong> in this problem:</p><blockquote>Score=(Number of cards picked for a character)²</blockquote><p>The goal is to <strong>maximize the total score</strong> using <strong>at most <em>k</em> cards</strong>.</p><h3>Step 1: Count the Frequency of Each Character</h3><p>The first step is to calculate how many times each character appears in the given string of cards. Since the characters are uppercase English letters (‘A’ to ‘Z’), we can use a fixed-size array of length 26 to count their frequencies.</p><h4>How?</h4><ul><li>For each character in the string, compute its index using char - &#39;A&#39; (e.g., &#39;A&#39; maps to index 0, &#39;B&#39; maps to 1, ..., &#39;Z&#39; maps to 25).</li><li>Increment the count of the respective index in the frequency array.</li></ul><p><strong>Example:</strong> If the string is “ABBCCCCDDD”:</p><ul><li>Frequencies: A = 1, B = 2, C = 4, D = 3, and the rest are 0.</li></ul><h3>Step 2: Sort the Frequencies in Descending Order</h3><p>To maximize the score, we need to pick cards from the most frequent characters first. Hence, we sort the frequency array in descending order.</p><h4>Why Sorting?</h4><ul><li>Picking cards from characters with the highest frequencies first ensures the highest contribution to the score. For example, choosing 4 cards from ‘C’ gives 4²=16, which is more valuable than choosing 2 cards from ‘B’ (2²=4).</li></ul><p>After sorting, the frequencies look like this: [4, 3, 2, 1, 0, 0, ..., 0].</p><h3>Step 3: Greedy Selection of Cards</h3><p>Now, we iterate through the sorted frequencies and select as many cards as possible from the highest-frequency characters while ensuring we don’t exceed <em>k</em> cards.</p><h4>Process: For each frequency,</h4><ul><li>If the frequency is less than or equal to the remaining <em>k</em>, take all those cards, and compute the score as <em>frequency²</em>.</li><li>If the frequency is greater than <em>k</em>, take only <em>k</em> cards, compute the score as <em>k²</em>, and stop since <em>k</em> cards are used up.</li></ul><h3>The Code</h3><pre>// https://codeforces.com/group/yg7WhsFsAp/contest/355495/problem/F<br>#include &lt;iostream&gt;<br>using namespace std;<br><br>void sortDescending(long long freq[], int size)<br>{<br>    for (int i = 0; i &lt; size - 1; i++)<br>    {<br>        int maxIndex = i;<br>        for (int j = i + 1; j &lt; size; j++)<br>        {<br>            if (freq[j] &gt; freq[maxIndex])<br>            {<br>                maxIndex = j;<br>            }<br>        }<br>        long long temp = freq[i];<br>        freq[i] = freq[maxIndex];<br>        freq[maxIndex] = temp;<br>    }<br>}<br><br>int main()<br>{<br>    int n, k;<br>    cin &gt;&gt; n &gt;&gt; k;<br>    string cards;<br>    cin &gt;&gt; cards;<br><br>    long long freq[26] = {0};<br>    for (int i = 0; i &lt; n; i++)<br>    {<br>        freq[cards[i] - &#39;A&#39;]++;<br>    }<br><br>    sortDescending(freq, 26);<br><br>    long long max_score = 0;<br>    for (int i = 0; i &lt; 26 &amp;&amp; k &gt; 0; i++)<br>    {<br>        if (freq[i] &lt;= k)<br>        {<br>            max_score += freq[i] * freq[i];<br>            k -= freq[i];<br>        }<br>        else<br>        {<br>            max_score += (long long) k * k;<br>            k = 0;<br>        }<br>    }<br><br>    cout &lt;&lt; max_score &lt;&lt; endl;<br><br>    return 0;<br>}</pre><h4>One Fail Attempt</h4><p>Parsing the following to long longwas important to avoid overflow during multiplication when <em>k</em> is large.</p><pre>max_score += (long long) k * k;</pre><p>If you enjoyed this article, feel free to follow me on my social media accounts for more updates and insights on web development:</p><ul><li>LinkedIn: <a href="https://www.linkedin.com/in/ahsan-aasim">https://www.linkedin.com/in/ahsan-aasim</a></li><li>Facebook: <a href="https://www.facebook.com/ahsan.aasim.03">https://www.facebook.com/ahsan.aasim.03</a></li><li>Medium: <a href="https://medium.com/@ahsan.aasim">https://medium.com/@ahsan.aasim</a></li><li>GitHub: <a href="https://github.com/ahsanaasim">https://github.com/ahsanaasim</a></li><li>Upwork: <a href="https://www.upwork.com/freelancers/akmahsanuzzaman">https://www.upwork.com/freelancers/akmahsanuzzaman</a></li></ul><p>Thank you for taking the time to read this article. I wish you all the best in your learning journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f4ec194974c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Codeforces E(355495): Super Prime in C++]]></title>
            <link>https://medium.com/@ahsan.aasim/codeforces-e-355495-super-prime-in-c-85ff32143934?source=rss-16137c1c32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/85ff32143934</guid>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[codeforces]]></category>
            <dc:creator><![CDATA[AKM Ahsanuzzaman (Ahsan Aasim)]]></dc:creator>
            <pubDate>Wed, 14 Aug 2024 08:58:52 GMT</pubDate>
            <atom:updated>2024-08-14T08:58:52.167Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6F1spQa8YJHQGHm3" /><figcaption>Image Source: Unsplash</figcaption></figure><p>Prime numbers are like the building blocks of mathematics. They are numbers greater than 1 that have no divisors other than 1 and themselves. But today, we’re going to explore a special type of prime number called a “Super Prime.”</p><h3>What is a Super Prime?</h3><p>A Super Prime is a prime number that can be written as the sum of two other prime numbers. For example:</p><p>• 5 is a Super Prime because it can be written as 2 + 3, and both 2 and 3 are prime numbers.<br> • 7 is a Super Prime because it can be written as 2 + 5, and both 2 and 5 are prime numbers.</p><p>Our task is to count how many Super Primes exist up to a given number n .</p><h3>Step-by-Step Approach</h3><p>Let’s break down how we can find all the Super Primes up to a number n :</p><ol><li>Find All Prime Numbers Up to n :<br>We need to first identify which numbers up to n are prime. We can use a method called the Sieve of Eratosthenes to do this. It’s like a filter that goes through all numbers and marks the non-prime numbers.</li><li>Check for Super Primes:<br>After we have our list of prime numbers, we need to check each one and see if it can be written as the sum of two smaller primes. If it can, it’s a Super Prime!</li><li>Count the Super Primes:<br>Finally, we count how many of these special primes exist.</li></ol><h3>The Code</h3><p>Here’s a simple C++ program that does all of this:</p><pre>#include &lt;iostream&gt;<br>#include &lt;vector&gt;<br>using namespace std;<br><br>vector&lt;bool&gt; sieve(int n)<br>{<br>    vector&lt;bool&gt; is_prime(n + 1, true);<br>    is_prime[0] = is_prime[1] = false;<br>    for (int i = 2; i * i &lt;= n; i++)<br>    {<br>        if (is_prime[i])<br>        {<br>            for (int j = i * i; j &lt;= n; j += i)<br>            {<br>                is_prime[j] = false;<br>            }<br>        }<br>    }<br>    return is_prime;<br>}<br><br>int countSuperPrimes(int n)<br>{<br>    vector&lt;bool&gt; is_prime = sieve(n);<br>    int count = 0;<br><br>    for (int p = 5; p &lt;= n; p++)<br>    {<br>        if (is_prime[p] &amp;&amp; is_prime[p - 2])<br>        {<br>            count++;<br>        }<br>    }<br><br>    return count;<br>}<br><br>int main()<br>{<br>    int n;<br>    cin &gt;&gt; n;<br>    cout &lt;&lt; countSuperPrimes(n) &lt;&lt; endl;<br>    return 0;<br>}</pre><h3><strong>How Does It Work?</strong></h3><ol><li>Finding Primes:<br>We use the sieve function to create a list of prime numbers up to n . Imagine we have a row of numbers and we mark all the multiples of each prime starting from 2. The ones that aren’t marked are our primes!</li><li>Identifying Super Primes:<br>We then check each prime number p . If p and p-2 are both prime, it means p can be written as the sum of two primes (2 and p-2 ). This makes p a Super Prime.</li><li>Counting:<br>We count all the Super Primes we find and print the result.</li></ol><h3><strong>Example</strong></h3><p>Let’s say n = 10 . Our program would find that there are two Super Primes: 5 and 7.</p><ul><li>5 = 2 + 3</li><li>7 = 2 + 5</li></ul><p>So, the output would be 2.</p><h3><strong>Conclusion</strong></h3><p>This simple program shows how we can use basic programming techniques to explore interesting mathematical concepts like Super Primes. It’s a great example of how math and programming work together to solve fun and challenging problems. Whether you’re just starting out in programming or looking to deepen your understanding of math, this problem is a great way to practice both!</p><p>If you enjoyed this article, feel free to follow me on my social media accounts for more updates and insights on web development:</p><ul><li>LinkedIn: <a href="https://www.linkedin.com/in/ahsan-aasim">https://www.linkedin.com/in/ahsan-aasim</a></li><li>Facebook: <a href="https://www.facebook.com/ahsan.aasim.03">https://www.facebook.com/ahsan.aasim.03</a></li><li>Medium: <a href="https://medium.com/@ahsan.aasim">https://medium.com/@ahsan.aasim</a></li><li>GitHub: <a href="https://github.com/ahsanaasim">https://github.com/ahsanaasim</a></li><li>Upwork: <a href="https://www.upwork.com/freelancers/akmahsanuzzaman">https://www.upwork.com/freelancers/akmahsanuzzaman</a></li></ul><p>Thank you for taking the time to read this article. I wish you all the best in your learning journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85ff32143934" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Codeforces D(355495): Amusing Joke in C++]]></title>
            <link>https://medium.com/@ahsan.aasim/codeforces-d-355495-amusing-joke-in-c-3b0f82515630?source=rss-16137c1c32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b0f82515630</guid>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[codeforces]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[AKM Ahsanuzzaman (Ahsan Aasim)]]></dc:creator>
            <pubDate>Tue, 13 Aug 2024 10:16:34 GMT</pubDate>
            <atom:updated>2024-08-13T10:16:34.966Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yJXFHQdE18GtJKgt" /><figcaption>Image Source: Unsplash</figcaption></figure><p>When it comes to competitive programming, one of the key skills that sets apart a proficient coder from the rest is the ability to break down complex problems into manageable tasks. Today, we’ll walk through a Codeforces problem called “Amusing Joke” that not only tests your understanding of string manipulation but also your ability to approach a problem methodically.</p><p>The problem centers around a scenario where Polycarp, the protagonist, must determine if a pile of shuffled letters can be rearranged to form the exact combination of two given names: the guest’s name and the host’s name. If the pile of letters can be rearranged to match exactly these two names, the answer should be “YES”; otherwise, it should be “NO”.</p><p><strong>Approach to the Solution</strong></p><p>To solve this problem efficiently, we can break down the solution into the following steps:</p><p>1. <strong>Concatenate the Guest and Host Names:</strong> Combine both the guest’s and the host’s names into one single string. This string should contain all the letters that should be present in the pile if it is a valid shuffle.</p><p>2. <strong>Sort the Strings:</strong> Sort both the concatenated string and the string representing the pile of letters. Sorting helps us align the letters in a specific order, making comparison straightforward.</p><p>3. <strong>Compare the Sorted Strings:</strong> If the sorted concatenated string is identical to the sorted pile of letters, it means the pile is a valid shuffle, and we output “YES”. Otherwise, we output “NO”.</p><p>Here is the full code</p><pre>// https://codeforces.com/group/yg7WhsFsAp/contest/355495/problem/D<br>#include &lt;iostream&gt;<br>#include &lt;algorithm&gt;<br>#include &lt;string&gt;<br>using namespace std;<br><br>int main() {<br>    string guest, host, pile;<br>    cin &gt;&gt; guest &gt;&gt; host &gt;&gt; pile;<br>    <br>    string combined = guest + host;<br>    <br>    sort(combined.begin(), combined.end());<br>    sort(pile.begin(), pile.end());<br>    <br>    if (combined == pile) {<br>        cout &lt;&lt; &quot;YES&quot; &lt;&lt; endl;<br>    } else {<br>        cout &lt;&lt; &quot;NO&quot; &lt;&lt; endl;<br>    }<br><br>    return 0;<br>}</pre><p>If you enjoyed this article, feel free to follow me on my social media accounts for more updates and insights on web development:</p><ul><li>LinkedIn: <a href="https://www.linkedin.com/in/ahsan-aasim">https://www.linkedin.com/in/ahsan-aasim</a></li><li>Facebook: <a href="https://www.facebook.com/ahsan.aasim.03">https://www.facebook.com/ahsan.aasim.03</a></li><li>Medium: <a href="https://medium.com/@ahsan.aasim">https://medium.com/@ahsan.aasim</a></li><li>GitHub: <a href="https://github.com/ahsanaasim">https://github.com/ahsanaasim</a></li><li>Upwork: <a href="https://www.upwork.com/freelancers/akmahsanuzzaman">https://www.upwork.com/freelancers/akmahsanuzzaman</a></li></ul><p>Thank you for taking the time to read this article. I wish you all the best in your learning journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b0f82515630" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stuck on a Bug? Try Rubber Duck Debugging!]]></title>
            <link>https://medium.com/@ahsan.aasim/stuck-on-a-bug-try-rubber-duck-debugging-75f4a04ede86?source=rss-16137c1c32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/75f4a04ede86</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[bug-fixing]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[rubber-duck-debugging]]></category>
            <category><![CDATA[debugging-techniques]]></category>
            <dc:creator><![CDATA[AKM Ahsanuzzaman (Ahsan Aasim)]]></dc:creator>
            <pubDate>Sun, 14 Jul 2024 19:58:53 GMT</pubDate>
            <atom:updated>2024-07-14T19:58:53.574Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Ahsan Aasim: Stuck on a Bug? Try Rubber Duck Debugging! Image Source: ChatGPT" src="https://cdn-images-1.medium.com/max/1024/1*5tGBZAVGhhFyCWLorio0Wg.png" /><figcaption>Ahsan Aasim: Stuck on a Bug? Try Rubber Duck Debugging! Image Source: ChatGPT</figcaption></figure><p>As developers, we’ve all faced those frustrating bugs that seem impossible to fix. We try everything, run tests, and check our code repeatedly, but the problem persists. In such times, a simple method called “rubber duck debugging” can help.</p><h3><strong>What is Rubber Duck Debugging?</strong></h3><p>Rubber duck debugging involves explaining your code and the issue you’re facing out loud to an inanimate object, like a rubber duck. The idea is that by talking through the problem, you often end up finding the solution yourself. Speaking out loud forces you to slow down and think about your code more clearly.</p><h3><strong>Real-World Example: Fixing a Bug in a Web Application for EV Charging Stations</strong></h3><p>Let me share a real example where rubber duck debugging helped solve a tricky problem.</p><p>Our team was working on “Charge On Site,” a web application for managing EV charging stations. We had a bug causing the chargers to disconnect unexpectedly. Despite our best efforts, we couldn’t find the root cause.</p><h4><strong>1. Initial Attempts:</strong></h4><ul><li>We reviewed the code related to session management and connection handling.</li><li>We conducted numerous tests to replicate and diagnose the issue.</li><li>We tried different solutions, but the problem kept coming back.</li></ul><h4>2. <strong>Communication with the Manufacturer:</strong></h4><ul><li>We contacted the charger manufacturer to check if the issue was on their side.</li><li>They provided insights and firmware updates, but the problem persisted.</li></ul><h4>3. <strong>Rubber Duck Debugging:</strong></h4><p>Frustrated and out of ideas, I decided to try rubber duck debugging. I grabbed a toy duck from my desk and started explaining the problem:</p><ul><li>I described the application’s workflow and how sessions were managed.</li><li>I detailed the exact steps leading to the disconnection.</li><li>I walked through the code, explaining what each part was supposed to do.</li></ul><p>While explaining the process to the rubber duck, I noticed a crucial detail. The sessions were ending due to a timeout issue that we had overlooked. The chargers were disconnecting because the session timeout settings were incorrect. This detail was hidden deep in the configuration files and wasn’t obvious during our initial reviews.</p><h3>Conclusion</h3><p>Rubber duck debugging might sound strange, but it can be very effective. By explaining the problem out loud, you engage different parts of your brain, helping you see the issue more clearly. In our case, it helped us identify a session timeout configuration problem that we had missed.</p><p>Next time you’re stuck on a bug, grab a rubber duck (or any object) and start explaining. You might be surprised at how quickly you find the solution!</p><p>If you enjoyed this article, feel free to follow me on my social media accounts for more updates and insights on web development:</p><ul><li>LinkedIn: <a href="https://www.linkedin.com/in/ahsan-aasim">https://www.linkedin.com/in/ahsan-aasim</a></li><li>Facebook: <a href="https://www.facebook.com/ahsan.aasim.03">https://www.facebook.com/ahsan.aasim.03</a></li><li>Medium: <a href="https://medium.com/@ahsan.aasim">https://medium.com/@ahsan.aasim</a></li><li>GitHub: <a href="https://github.com/ahsanaasim">https://github.com/ahsanaasim</a></li><li>Upwork: <a href="https://www.upwork.com/freelancers/akmahsanuzzaman">https://www.upwork.com/freelancers/akmahsanuzzaman</a></li></ul><p>Thank you for taking the time to read this article. I wish you all the best in your learning journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75f4a04ede86" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DNS Management: A Two-Tab Approach]]></title>
            <link>https://medium.com/@ahsan.aasim/dns-management-a-two-tab-approach-c2801bb8bd4a?source=rss-16137c1c32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2801bb8bd4a</guid>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[management]]></category>
            <dc:creator><![CDATA[AKM Ahsanuzzaman (Ahsan Aasim)]]></dc:creator>
            <pubDate>Tue, 04 Jun 2024 11:03:04 GMT</pubDate>
            <atom:updated>2024-06-04T11:03:04.088Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tLszG6pTVKWOilwF" /><figcaption>DNS Management: A Two-Tab Approach</figcaption></figure><p>The Domain Name System (DNS) is the unsung hero of the internet, silently translating domain names into the IP addresses websites live on. But for those managing a website, DNS can quickly turn from hero to headache if not handled securely and efficiently.</p><p>In this blog post, we’ll explore a simple yet effective system for managing your DNS records, ensuring both security and streamlined workflows.</p><h3>The Peril of Messy DNS</h3><p>We’ve all been there: a tangled mess of DNS records with unclear purposes and unknown origins. This can lead to a multitude of issues, including:</p><ul><li><strong>Security vulnerabilities:</strong> Unauthorized access to your DNS records can have disastrous consequences, potentially redirecting users to malicious websites or compromising sensitive information.</li><li><strong>Downtime:</strong> Incorrect or outdated DNS records can render your website inaccessible, leading to lost traffic and revenue.</li><li><strong>Inefficiency:</strong> Wading through a sea of uncommented records wastes valuable time when you need to make changes.</li></ul><h3>The Power of Process: A Two-Tab Approach</h3><p>Here’s a simple system to keep your DNS records under control:</p><ol><li><strong>Limited Access, High Security:</strong> Restrict access to modifying DNS records to a select group of trusted individuals. This minimizes the risk of accidental or malicious changes.</li><li><strong>Two-Tab Teamwork:</strong> Utilize a collaborative tool like a Google Sheet with two dedicated tabs:</li></ol><ul><li><strong>DNS Request:</strong> This tab allows anyone on the team to submit a request for adding a new DNS record. Columns can include:</li><li>Type (e.g., A, TXT, MX)</li><li>Name (e.g., @, www)</li><li>Content (The value for the record)</li><li>Priority (For certain record types)</li><li>TTL (Time To Live — how long the record is cached)</li><li>Comment (A crucial field to explain the purpose of the record)</li><li><strong>Current DNS:</strong> This tab is managed by authorized personnel only. It holds the actual, up-to-date list of all DNS records, mirroring the information from the approved requests.</li></ul><h3>Benefits of the Two-Tab Approach</h3><p>This approach offers several advantages:</p><ul><li><strong>Enhanced Security:</strong> Limited access to modifications safeguards your DNS records.</li><li><strong>Improved Efficiency:</strong> A clear request and approval process streamlines adding new records.</li><li><strong>Detailed Documentation:</strong> Comments in the request tab provide context for each record.</li><li><strong>Team Collaboration:</strong> Anyone can initiate a request, fostering open communication.</li></ul><h3>Keeping Your DNS Clean</h3><p>By implementing this two-tab system, you can significantly improve the security and efficiency of your DNS management. Remember, a well-maintained DNS is a critical component of a healthy online presence.</p><p><strong>Bonus Tip:</strong> Regularly review and audit your DNS records to ensure their accuracy and identify any potential security weaknesses.</p><p>By following these steps, you can transform DNS management from a chore into a collaborative and secure process, ensuring your website remains smoothly accessible for years to come.</p><p>If you enjoyed this article, feel free to follow me on my social media accounts for more updates and insights on web development:</p><ul><li>LinkedIn: <a href="https://www.linkedin.com/in/ahsan-aasim">https://www.linkedin.com/in/ahsan-aasim</a></li><li>Facebook: <a href="https://www.facebook.com/ahsan.aasim.03">https://www.facebook.com/ahsan.aasim.03</a></li><li>Medium: <a href="https://medium.com/@ahsan.aasim">https://medium.com/@ahsan.aasim</a></li><li>GitHub: <a href="https://github.com/ahsanaasim">https://github.com/ahsanaasim</a></li><li>Upwork: <a href="https://www.upwork.com/freelancers/akmahsanuzzaman">https://www.upwork.com/freelancers/akmahsanuzzaman</a></li></ul><p>Thank you for taking the time to read this article. I wish you all the best in your learning journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2801bb8bd4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Codeforces B (355495): H4x0r in C++]]></title>
            <link>https://medium.com/@ahsan.aasim/codeforces-b-355495-h4x0r-in-c-54e92971faf0?source=rss-16137c1c32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/54e92971faf0</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[AKM Ahsanuzzaman (Ahsan Aasim)]]></dc:creator>
            <pubDate>Sun, 02 Jun 2024 10:27:36 GMT</pubDate>
            <atom:updated>2024-06-02T10:27:36.457Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*w0UDNBbahQEftMsh" /></figure><h3>Becoming a H4x0r: Translating Text into Hacker Language</h3><p>Have you ever wondered how hackers transform regular text into their secret language? It’s a fascinating exercise in creative encoding, and with a few simple substitutions, we can convert ordinary text into something that looks cryptic and intriguing. In this blog post, we’ll explore how to implement such a transformation in C++.</p><h3>The Hacker’s Cipher</h3><p>Hackers often replace certain characters with digits that resemble those characters. Here’s a common list of substitutions:</p><ul><li>a becomes 4</li><li>i becomes 1</li><li>e becomes 3</li><li>o becomes 0</li><li>s becomes 5</li></ul><p>This transformation can make words look quite different. For instance, “hello” would become “h3ll0” and “password” would become “p4ssw0rd”.</p><h3>Problem Statement</h3><p>Given a string of lowercase English letters, we want to apply the above transformations and output the modified string.</p><h3>Input and Output</h3><ul><li><strong>Input</strong>: A single string consisting of lowercase English letters. The length of the string is guaranteed to be between 1 and 1,000,000 characters.</li><li><strong>Output</strong>: The transformed string with the substitutions applied.</li></ul><h3>Code</h3><pre>// https://codeforces.com/group/yg7WhsFsAp/contest/355495/problem/B<br>#include &lt;iostream&gt;<br>#include &lt;string&gt;<br>using namespace std;<br><br>string cipher = &quot;aieos&quot;;<br>string cipherCode = &quot;41305&quot;;<br><br>int indexOfChar(char c)<br>{<br>    int index = cipher.find(c);<br><br>    if (index != string::npos)<br>    {<br>        return index;<br>    }<br>    else<br>    {<br>        return -1;<br>    }<br>}<br><br>int main()<br>{<br>    string input = &quot;aeios&quot;, output = &quot;&quot;;<br>    cin &gt;&gt; input;<br>    for (int i = 0; i &lt; input.size(); i++)<br>    {<br>        int index = indexOfChar(input[i]);<br>        // cout &lt;&lt; index &lt;&lt; endl;<br>        if (index &gt;= 0)<br>        {<br>            output += cipherCode[index];<br>        }<br>        else<br>        {<br>            output += input[i];<br>        }<br>    }<br>    cout &lt;&lt; output &lt;&lt; endl;<br>    return 0;<br>}</pre><h3>Explanation</h3><ol><li><strong>String Initialization</strong>: We start by defining two strings, cipher and cipherCode, which hold the characters to be replaced and their corresponding replacements.</li><li><strong>Helper Function</strong>: The function indexOfChar takes a character c and returns its index in the cipher string. If the character is not found, it returns -1.</li><li><strong>Main Function</strong>:</li></ol><ul><li>We read the input string.</li><li>We initialize an empty output string.</li><li>We loop through each character in the input string:</li><li>If the character is found in the cipher string, we append the corresponding character from cipherCode to the output.</li><li>If the character is not found, we append the character itself to the output.</li><li>Finally, we print the transformed output string.</li></ul><h3>Example</h3><p>Let’s see how this code works with an example. Suppose the input is “hackers”:</p><ul><li>h -&gt; h (not in the cipher list)</li><li>a -&gt; 4</li><li>c -&gt; c (not in the cipher list)</li><li>k -&gt; k (not in the cipher list)</li><li>e -&gt; 3</li><li>r -&gt; r (not in the cipher list)</li><li>s -&gt; 5</li></ul><p>The output will be “h4ck3r5”.</p><h3>Conclusion</h3><p>This simple yet effective program demonstrates how easily we can encode a string into “hacker language” using basic string operations in C++. Such exercises are not only fun but also help in understanding string manipulation, a fundamental aspect of programming. Whether you are a beginner or an experienced coder, tasks like these can enhance your problem-solving skills and bring a touch of creativity to your coding journey. Happy hacking!</p><p>If you enjoyed this article, feel free to follow me on my social media accounts for more updates and insights on web development:</p><ul><li>LinkedIn: <a href="https://www.linkedin.com/in/ahsan-aasim">https://www.linkedin.com/in/ahsan-aasim</a></li><li>Facebook: <a href="https://www.facebook.com/ahsan.aasim.03">https://www.facebook.com/ahsan.aasim.03</a></li><li>Medium: <a href="https://medium.com/@ahsan.aasim">https://medium.com/@ahsan.aasim</a></li><li>GitHub: <a href="https://github.com/ahsanaasim">https://github.com/ahsanaasim</a></li><li>Upwork: <a href="https://www.upwork.com/freelancers/akmahsanuzzaman">https://www.upwork.com/freelancers/akmahsanuzzaman</a></li></ul><p>Thank you for taking the time to read this article. I wish you all the best in your learning journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54e92971faf0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Codeforces A (355495): 2-Sum in C++]]></title>
            <link>https://medium.com/@ahsan.aasim/codeforces-a-355495-2-sum-in-c-7c969d146391?source=rss-16137c1c32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c969d146391</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[AKM Ahsanuzzaman (Ahsan Aasim)]]></dc:creator>
            <pubDate>Sun, 02 Jun 2024 09:58:51 GMT</pubDate>
            <atom:updated>2024-06-02T09:59:55.135Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Codeforces A (355495): 2-Sum in C++" src="https://cdn-images-1.medium.com/max/1024/0*6Avly0a-bAszX8Ci" /><figcaption>Codeforces A (355495): 2-Sum in C++ (Image Source: ChatGPT)</figcaption></figure><p>To solve the 2-Sum problem, we can utilize a hash set to keep track of the elements we have seen so far. The idea is to iterate through the array and for each element, check if the complement (i.e., X - current_element) exists in the hash set. If it does, then we have found a pair of numbers that sum up to XXX. If we iterate through the entire array without finding such a pair, then no such pair exists.</p><h4>Input Reading:</h4><p>The program reads the integers N and X from the input.<br>It then reads the sequence of N integers into a vector.</p><h4>Hash Set Initialization:</h4><p>We use an unordered_set called seen to keep track of the numbers we have encountered so far.</p><h4>Iteration and Checking:</h4><p>For each number in the sequence, compute its complement (X — num).<br>Check if this complement exists in the seen set.<br>If found, print “YES” and return immediately.<br>Otherwise, add the current number to the seen set.</p><h4>Completion:</h4><p>If the loop completes without finding any pair, print “NO”.</p><h4>Code Block:</h4><pre>// https://codeforces.com/group/yg7WhsFsAp/contest/355495/problem/A<br>#include &lt;iostream&gt;<br>#include &lt;unordered_set&gt;<br>#include &lt;vector&gt;<br><br>void two_sum(int N, int X, const std::vector&lt;int&gt;&amp; sequence) {<br>    std::unordered_set&lt;int&gt; seen;<br>    for (int i = 0; i &lt; N; ++i) {<br>        int num = sequence[i];<br>        int complement = X - num;<br>        if (seen.find(complement) != seen.end()) {<br>            std::cout &lt;&lt; &quot;YES&quot; &lt;&lt; std::endl;<br>            return;<br>        }<br>        seen.insert(num);<br>    }<br>    std::cout &lt;&lt; &quot;NO&quot; &lt;&lt; std::endl;<br>}<br><br>int main() {<br>    int N, X;<br>    std::cin &gt;&gt; N &gt;&gt; X;<br>    std::vector&lt;int&gt; sequence(N);<br>    for (int i = 0; i &lt; N; ++i) {<br>        std::cin &gt;&gt; sequence[i];<br>    }<br>    <br>    two_sum(N, X, sequence);<br>    <br>    return 0;<br>}</pre><p>If you enjoyed this article, feel free to follow me on my social media accounts for more updates and insights on web development:</p><ul><li>LinkedIn: <a href="https://www.linkedin.com/in/ahsan-aasim">https://www.linkedin.com/in/ahsan-aasim</a></li><li>Facebook: <a href="https://www.facebook.com/ahsan.aasim.03">https://www.facebook.com/ahsan.aasim.03</a></li><li>Medium: <a href="https://medium.com/@ahsan.aasim">https://medium.com/@ahsan.aasim</a></li><li>GitHub: <a href="https://github.com/ahsanaasim">https://github.com/ahsanaasim</a></li><li>Upwork: <a href="https://www.upwork.com/freelancers/akmahsanuzzaman">https://www.upwork.com/freelancers/akmahsanuzzaman</a></li></ul><p>Thank you for taking the time to read this article. I wish you all the best in your learning journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c969d146391" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Agile and Scrum: How We Turn Projects into Success Stories]]></title>
            <link>https://medium.com/@ahsan.aasim/mastering-agile-and-scrum-how-we-turn-projects-into-success-stories-da9638858ede?source=rss-16137c1c32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/da9638858ede</guid>
            <category><![CDATA[scrum]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[agile]]></category>
            <dc:creator><![CDATA[AKM Ahsanuzzaman (Ahsan Aasim)]]></dc:creator>
            <pubDate>Fri, 31 May 2024 18:48:31 GMT</pubDate>
            <atom:updated>2024-05-31T18:48:31.994Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z3D8wUZgp_1DuaYJ" /><figcaption>Mastering Agile and Scrum: How We Turn Projects into Success Stories (Image Source: ChatGPT)</figcaption></figure><p>Agile and Scrum make project management as smooth as a well-oiled machine. Imagine breaking down a giant pizza into manageable slices (epics and user stories) so everyone gets a piece they can handle. With SMART tasks and clear goals, we keep things specific and achievable, while constant communication ensures no one drops their slice!</p><h4>Agile</h4><p>In our organization, we utilize Agile and Scrum methodologies for project management. We start by defining epics, which we then break down into smaller user stories. During our sprints, we prioritize these user stories based on their importance and urgency.</p><p>Each user story is articulated using the format:</p><ul><li>As a [role], I will [action] so that [benefit].</li></ul><p>We ensure that each story includes SMART (Specific, Measurable, Achievable, Relevant, Time-bound) tasks and comes with a clear scope document, priority ranking, and acceptance criteria. Additionally, each story in the sprint has a defined deadline.</p><p>We also practice continuous planning and are flexible in updating our plans when uncertainties arise. This adaptability allows us to respond to changes efficiently.</p><h4>Milestones</h4><p>We create releases with selected tasks and stories, setting short milestones within each sprint. This approach helps us stay on track, facilitates easier client communication, and increases client satisfaction. These short milestones act as key indicators of progress, allowing us to review our achievements, make necessary adjustments, and celebrate our successes, thereby maintaining team momentum and focus on the final deadline.</p><h4>Clear communication</h4><p>Clear communication is key to our process. We keep our team informed about project expectations, progress, and any changes to the timeline. We encourage open dialogue, ensuring team members feel comfortable raising concerns or suggesting improvements. Regular meetings and check-ins facilitate this exchange of information, keeping everyone aligned and focused on meeting deadlines. This approach helps us catch issues early, reallocate resources, and maintain high performance and client satisfaction.</p><p>Additionally, we have daily scrums where our clients also participate, which reduces miscommunication and increases performance. This approach helps us catch issues early, reallocate resources, and maintain high performance and client satisfaction.</p><h4>Flexibility</h4><p>Flexibility is crucial to our process. We continuously review progress, velocity, and blockers, and take customer feedback to update our plans and processes. This allows us to adapt quickly to unexpected challenges by reprioritizing tasks, extending deadlines, or scaling back objectives if necessary. We maintain open communication with our team and clients, holding daily scrums with client participation to reduce miscommunication and improve performance. This collaborative approach ensures we find solutions that keep the project moving forward without compromising quality.</p><h4>Conclusion</h4><p>Agile and Scrum keep projects on track like a pizza delivery service: fast, flexible, and always on time. Regular check-ins and client involvement ensure everyone’s happy with their order. We adapt quickly to any changes, keeping projects on schedule and clients satisfied, one slice at a time.</p><p>If you enjoyed this article, feel free to follow me on my social media accounts for more updates and insights on web development:</p><ul><li>LinkedIn: <a href="https://www.linkedin.com/in/ahsan-aasim">https://www.linkedin.com/in/ahsan-aasim</a></li><li>Facebook: <a href="https://www.facebook.com/ahsan.aasim.03">https://www.facebook.com/ahsan.aasim.03</a></li><li>Medium: <a href="https://medium.com/@ahsan.aasim">https://medium.com/@ahsan.aasim</a></li><li>GitHub: <a href="https://github.com/ahsanaasim">https://github.com/ahsanaasim</a></li><li>Upwork: <a href="https://www.upwork.com/freelancers/akmahsanuzzaman">https://www.upwork.com/freelancers/akmahsanuzzaman</a></li></ul><p>Thank you for taking the time to read this article. I wish you all the best in your learning journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da9638858ede" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Codeforces P3 (355494): Thanos Sort in Python]]></title>
            <link>https://medium.com/@ahsan.aasim/codeforces-p3-355494-thanos-sort-in-python-38aeb5c66f7b?source=rss-16137c1c32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/38aeb5c66f7b</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[codeforces]]></category>
            <dc:creator><![CDATA[AKM Ahsanuzzaman (Ahsan Aasim)]]></dc:creator>
            <pubDate>Wed, 22 May 2024 11:12:09 GMT</pubDate>
            <atom:updated>2024-05-22T11:12:09.574Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*hrs2JFq-fUbI-WIf.jpeg" /><figcaption>Image Source : Unsplash</figcaption></figure><p>The “Thanos Sort” problem is a fascinating algorithmic challenge that requires identifying the longest sorted subarray through recursive splitting. Let’s walk through the solution using Python.</p><h4>Problem Statement</h4><p>Given an array of integers where the size is a power of 2, you need to determine the length of the longest subarray that can be obtained by recursively removing either the first half or the second half if the subarray is not sorted.</p><h4>Approach</h4><p>Implement a function to check if a subarray is sorted. If sorted, return its length. Otherwise, recursively check both halves and return the maximum length found.</p><h4>Python Solution</h4><p>Here’s the Python code to solve the problem:</p><pre># https://codeforces.com/group/yg7WhsFsAp/contest/355494/problem/P33<br>def is_sorted(arr):<br>    return all(arr[i] &lt;= arr[i + 1] for i in range(len(arr) - 1))<br><br>def thanos_sort(arr):<br>    if is_sorted(arr):<br>        return len(arr)<br>    mid = len(arr) // 2<br>    return max(thanos_sort(arr[:mid]), thanos_sort(arr[mid:]))<br><br>n = int(input())<br>array = list(map(int, input().split()))<br><br>result = thanos_sort(array)<br>print(result)</pre><h3>Explanation</h3><ol><li>is_sorted Function: This function checks if the array is sorted in non-decreasing order.</li><li>thanos_sort Function:</li></ol><ul><li>If the current array is sorted, it returns its length.</li><li>Otherwise, it splits the array into two halves and recursively checks each half.</li><li>It returns the maximum length of the sorted subarray found in either half.</li></ul><p>If you enjoyed this article, feel free to follow me on my social media accounts for more updates and insights on web development:</p><ul><li>LinkedIn: <a href="https://www.linkedin.com/in/ahsan-aasim">https://www.linkedin.com/in/ahsan-aasim</a></li><li>Facebook: <a href="https://www.facebook.com/ahsan.aasim.03">https://www.facebook.com/ahsan.aasim.03</a></li><li>Medium: <a href="https://medium.com/@ahsan.aasim">https://medium.com/@ahsan.aasim</a></li><li>GitHub: <a href="https://github.com/ahsanaasim">https://github.com/ahsanaasim</a></li><li>Upwork: <a href="https://www.upwork.com/freelancers/akmahsanuzzaman">https://www.upwork.com/freelancers/akmahsanuzzaman</a></li></ul><p>Thank you for taking the time to read this article. I wish you all the best in your learning journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38aeb5c66f7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Security in OCPP 1.6 (Central System)]]></title>
            <link>https://medium.com/@ahsan.aasim/security-in-ocpp-1-6-central-system-95d771a4e197?source=rss-16137c1c32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/95d771a4e197</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ocpp]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[AKM Ahsanuzzaman (Ahsan Aasim)]]></dc:creator>
            <pubDate>Wed, 22 May 2024 07:48:52 GMT</pubDate>
            <atom:updated>2024-05-22T09:58:15.652Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m37cNv47iJVIxGVx" /><figcaption>Implementing Security in OCPP 1.6: Our Simple Approach (The image is generated using ChatGPT)</figcaption></figure><p>In the fast-changing world of electric vehicle (EV) charging, making sure the communication between Charge Points (CP) and the Central System Management System (CSMS) is secure is super important. Here’s how we can do it with the Open Charge Point Protocol (OCPP) 1.6 to keep our charging setup safe.</p><h3>Basic Authentication</h3><ol><li><strong>Charger Configuration</strong>: Each charger is set up with its own username and password. This is essential for a secure initial setup.</li><li><strong>Header Transmission</strong>: When a charger connects to the CSMS, it sends its username and password through headers. This keeps the login details secure as they travel over the network.</li><li><strong>Credential Validation</strong>: When the CSMS gets the connection request, it checks the credentials. Only if they’re correct does the charger get access.</li><li><strong>Password Management</strong>: To boost security, we can change the password from the central system anytime. This allows us to update passwords regularly and respond to any security threats quickly. We also follow the OCTT Test Case 073_UPDATE_PASS_ON_HTTP to ensure our password changes meet industry standards.</li></ol><h3>Security Events</h3><p>Apart from Basic Authentication, we also can implement a system to handle security events, as described in the OCPP guidelines. Here’s how we manage these events:</p><ol><li><strong>Event Notification</strong>: If something unusual is detected, the charger sends a SecurityEventNotification.req to the CSMS, detailing the event.</li><li><strong>Central System Response</strong>: The CSMS replies with a SecurityEventNotification.conf to the charger, acknowledging the event and starting any necessary actions to deal with the threat.</li></ol><h3>Conclusion</h3><p>Securing OCPP 1.6 involves multiple steps. By using Basic Authentication and real-time security event management, we can create a secure environment for our EV charging system.</p><p>If you enjoyed this article, feel free to follow me on my social media accounts for more updates and insights on web development:</p><ul><li>LinkedIn: <a href="https://www.linkedin.com/in/ahsan-aasim">https://www.linkedin.com/in/ahsan-aasim</a></li><li>Facebook: <a href="https://www.facebook.com/ahsan.aasim.03">https://www.facebook.com/ahsan.aasim.03</a></li><li>Medium: <a href="https://medium.com/@ahsan.aasim">https://medium.com/@ahsan.aasim</a></li><li>GitHub: <a href="https://github.com/ahsanaasim">https://github.com/ahsanaasim</a></li><li>Upwork: <a href="https://www.upwork.com/freelancers/akmahsanuzzaman">https://www.upwork.com/freelancers/akmahsanuzzaman</a></li></ul><p>Thank you for taking the time to read this article. I wish you all the best in your learning journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95d771a4e197" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>