<?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 Ishmam Fardin on Medium]]></title>
        <description><![CDATA[Stories by Ishmam Fardin on Medium]]></description>
        <link>https://medium.com/@ishmamf?source=rss-82b1d9627376------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LW7XaU2xpY5A92lPruzvHw.jpeg</url>
            <title>Stories by Ishmam Fardin on Medium</title>
            <link>https://medium.com/@ishmamf?source=rss-82b1d9627376------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 08 Apr 2026 19:12:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ishmamf/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[How to Understand Recursion and Apply it]]></title>
            <link>https://medium.com/@ishmamf/how-to-understand-recursion-and-apply-it-0231aefc4986?source=rss-82b1d9627376------2</link>
            <guid isPermaLink="false">https://medium.com/p/0231aefc4986</guid>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[recursion]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Ishmam Fardin]]></dc:creator>
            <pubDate>Mon, 21 Apr 2025 01:05:24 GMT</pubDate>
            <atom:updated>2025-08-16T02:05:49.009Z</atom:updated>
            <content:encoded><![CDATA[<h4>Not another fibonacci example walkthrough</h4><h4>Backstory</h4><p>Recursion has been very difficult for me to understand ever since I took my data structures and algorithms class, all the way up to the start of my Fall 2024 semester. When watching YouTube videos on recursion and explanations of examples, the solutions and ideas made sense, but the concept was still difficult to apply to problems I had never seen before. I’d fall into the trap of thinking about every single recursive call and get lost when trying to follow my own code.</p><p>I’ve also found that many videos and articles explaining recursion use very simple examples like <em>Fibonacci</em>, which are great introductions but fall short in helping people generalize the concept.</p><p>After spending over 100 hours using a functional language (Scheme), where you can <em>only</em> use recursion and have to prove why functions are correct, I want to share my insights and hope readers find them helpful in understanding recursion better.</p><h4>What to Expect</h4><p>I’ll start by explaining how to recognize when recursion is needed and the purpose it serves. If you understand <em>why</em> your problem requires recursion, solving it becomes much simpler. I’ll then discuss the thought process for solving recursive problems and finally walk through three moderately challenging examples to really drive the concept home.</p><p>I won’t go into theory or topics like recurrence relations in depth, though they might be implicitly discussed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7xVtiWp7KtkE46759B6AiA.png" /></figure><h4>When to Use Recursion</h4><p>It usually becomes clear that recursion is needed when you notice a pattern of “going down one path” or when you can identify smaller components that build up to the final result. Many combination or permutation problems typically use recursion as well.</p><p>What does “going down one path” mean? It means you’re exhausting one direction until you can’t go any further, and then doing the same for the next direction. You’re essentially going depth-first and repeating the same pattern. When you see yourself solving the same problem repeatedly, you likely need recursion.</p><p>The less obvious clue is identifying the sub-problem: being able to recognize a simpler version of the problem. Usually, it’s something like, “Would having the result of the problem with one less than my current position help solve my current position? And for that result, would having one less help? And so on…” Essentially, it’s the same problem but slightly smaller each time.</p><p>Identifying the sub-problem makes the entire problem much easier. The purpose of recursion is to break down a big problem into very small parts and then build the solution back up. Understanding what the sub-problem is gives you an idea of what pattern to apply and what possible base cases to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R2Gt8eyH9_Ha_arcwZEpLg.png" /></figure><h3>Thought Process</h3><p>Alright so you have a feeling that you have a problem that requires recursion.</p><h4>Sub problems</h4><p>The first step is to think about the sub‑problems and decisions you need to make. It varies from problem to problem, but in trees you can see that a tree is composed of smaller trees: a left subtree and a right subtree.</p><p>In other cases, you can think of the smaller component as the new value that results from making a decision. In Fibonacci, the smaller components are <em>n − 1</em> and <em>n − 2</em>, which correspond to two decisions. In LCS (Longest Common Subsequence), the smaller component is the substring of the current string, where you decide which string(s) to break down.</p><p>This will become clearer in the examples later on.</p><h4>Base Cases</h4><p>Possible base cases are usually the points at which you cannot make any more decisions. For any recursive problem, you are given a limit of some form. If the limit involves an amount of money or a number of items, one base case would be when you exceed the threshold; when you no longer have enough money or items to make a decision. In graphs, the base case occurs when you exit the grid; in trees, it occurs when you reach a null node.</p><p>Think about situations in which you can no longer make a decision, or about the smallest possible component for your sub‑problems.</p><p>What you return in base cases are important, because the type of data you’re returning needs to be consistent with all your other recursive calls. For example, if you’re returning a list in your base case that holds variables that represent something, your other recursive calls would need to be lists and represent the same thing.</p><p>If you know your base cases, creating the recursive calls is a bit easier because you know what you’re aiming to return for them.</p><p>Another reason base cases help is that you can think about the call that immediately follows the base case and figure out what logic to apply. If the logic works for the call right before the base case, it should work for every other call.</p><h4>Assume Recursive Call Works</h4><p>One of my biggest breakthroughs with recursion was trusting that the recursion will return what I want it to. If you know your base cases and what sub‑problems you’re solving, you shouldn’t have to worry about testing every single call to see whether it returns the correct value.</p><p>You can, of course, test your program to verify that you are solving the right sub‑problems and that you have covered all base cases, but you shouldn’t need to test every call.</p><p>If you don’t know or can’t trust what the recursive calls are returning, it becomes difficult to handle the current call. In Fibonacci, if you don’t know that a recursive call returns the value at the (n − 1)‑th position, how do you know you need to add it to the other recursive call? If your recursive program returns a list and you don’t know what the list represents, how would you implement logic at the current call that uses this value?</p><p>What a value represents is based on the sub‑problems you decided on, so if you can’t trust the recursive call, you should probably re‑evaluate your sub‑problems and base cases.</p><h4>[Optional] Think about different types of cases for any given position</h4><p>Some problems require you to execute certain logic based on what value is returned or what your parameter is. Usually there’s a structure of some sort, so you need to handle each component and consider what types of inputs you can run into.</p><h4>More Tips</h4><p>Recursion might be hard to grasp because we’re so used to for loops and other iterative approaches. It can help to remember that recursion breaks the input down and then puts the pieces back together. If you’re familiar with stacks, recursion follows the same process: you “iterate,” in a sense, while breaking down the input by adding to the stack. When you hit your base case, you can start popping values from the stack (i.e., returning from recursive calls). In a sense, you’re going backward, similar to unwinding a for loop.</p><p>I touched upon typical ways of breaking down inputs earlier, but to put them back together you need to see the results of recursive calls as values you can use in your logic. If it helps, try to think about what values you need at any given call for your problem.</p><p>If this section confuses you, feel free to ignore it; I added it mainly to provide insight into how to shift your perspective from iteration to recursion.</p><h3>Examples</h3><h4>Leetcode Problem: <a href="https://leetcode.com/problems/count-nodes-equal-to-average-of-subtree/">Count nodes equal to average of tree</a></h4><p>Given the root of a binary tree, return the number of nodes where the value of the node is equal to the <strong>average</strong> of the values in its <strong>subtree</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b6zNiX7p_6tM5LiJn0YqKw.jpeg" /></figure><h4><strong>Understanding Problem</strong></h4><p>The problem wants you to figure out how many valid nodes there are in a tree. What makes a node valid? Getting the average of all the nodes in a tree, and if the root node is equal to the average, it’s a valid node. A tree is compromised of many smaller trees so you need to compute the average for all sub trees. Looks like a recursion problem 👀</p><h4><strong>Sub Problems</strong></h4><p>Since this is a tree we know our sub problems would be a left sub tree and a right sub tree. Now we think, what does our sub problem represent? The problem wants number of nodes that has the root node as the average of the tree, so the sub problem would represent number of nodes that has root node as average in the sub trees.</p><h4><strong>Base cases</strong></h4><p>The smallest possible sub problem is when our root node is null, in which case the number of valid nodes is 0. Another base case is when root node is a leaf node, in which case the number of valid nodes is 1.<br>The issue is we can’t just return the count from a sub tree, because we need to keep track of all the values we traversed on our sub tree so that we can get the average of all nodes in the overall tree for the root. Hence when we go down a sub tree, we need to return the sum and the count of all the nodes in the sub tree.</p><p>Hence in the base case, we’d return 3 values, the number of valid nodes, the sum of all nodes, and count of all nodes.</p><h4><strong>Assume Recursive Call Works</strong></h4><p>Since we have our base cases, we should try to think of what will we do once we got our base case values. Let’s assume we’re at the call right before a leaf node, and that both our left and right subtrees are leaf nodes. In other problems, if this strategy (thinking in terms of call right before base case) doesn’t apply, you should at least trust what kind of values the recursive call is returning. We know for any given call in this problem, we’d get back a sum, number of nodes, number of valid nodes for all nodes in the sub tree.</p><p>Anyways, back to assuming we’re at a call right before base case. The recursive call on the left sub tree returns a sum, number of nodes, and number of valid nodes. Same with the call on the right sub tree. <br>Now the easy part, figuring out what to do with these values. We already know what we’re supposed to return at each call, so to get the sum of all the nodes in this current tree we need to add the sums from the left sub tree, right subtree, and add our root node value.</p><p>To get total number of nodes, we add the number of nodes from left subtree, number of nodes from right sub tree, and add 1 for root node. We then figure out if the root node is a valid node, so we compute the average and check if it’s equal to the root node value. We increment the total number of valid nodes (add total valid nodes from left and right subtrees) if it’s valid, otherwise just return the total number of valid nodes.</p><p>Figuring out the logic was straight forward only because we were able to trust that the recursive call returns what we wanted. Having descriptive names helps a lot as well. Also helpful to understand that whatever is being returned from the recursive calls, you need to keep the current call consistent with it when returning.</p><p>You can use this tool to follow the calls on an example: <a href="https://staying.fun/en/features/algorithm-visualize?code=c01cbd4e303294798fb4cbe8e31d2b79fe0f15915f4e8473d4bfb83a32702ddc">Link</a></p><pre>def averageOfSubtree(self, root: TreeNode) -&gt; int:<br>     <br>    def dfs(node):<br>        if not node:<br>            # if null, it&#39;s not possible to have valid nodes because<br>            # there aren&#39;t any nodes, which also means no sum either<br>            return [0, 0, 0] # sum, total nodes, valid nodes<br>        if not node.left and not node.right:<br>            # leaf nodes only have one node, which is themselves<br>            # hence sum is current node value and count is 1<br>            # leaf node would be a valid node since the average would<br>            # equal itself hence it&#39;s 1<br>            return [node.val, 1, 1] # sum, total nodes, valid nodes<br>        # get sum, count, and number of valid nodes in left sub tree<br>        leftSum, leftCount, leftValid = dfs(node.left)<br>        # get sum, count, and number of valid nodes in right sub tree<br>        rightSum, rightCount, rightValid = dfs(node.right)<br>        # total sum including self<br>        total = leftSum + rightSum + node.val<br>        # count of all nodes including self<br>        count = leftCount + rightCount + 1<br>        # total number of valid nodes<br>        totalValid = leftValid + rightValid<br>        # average of all nodes<br>        average = total//count<br>        <br>        # if average equals root node value, we add 1 to number<br>        # of total valid nodes<br>        if average == node.val:<br>            return [total, count, totalValid + 1]<br>        else:<br>            return [total, count, totalValid]<br><br>    return dfs(root)[2]</pre><h4>Leetcode Problem: <a href="https://leetcode.com/problems/target-sum/">Target Sum</a></h4><p>You are given an integer array nums and an integer target. You want to apply one of the two operations to each element in nums , add element or subtract element. Return the number of different ways you can evaluate to target. <br>For example: <br>nums = [1, 1, 1] , target = 1<br>output = 3<br>Explanation: <br>1. +1 -1 +1<br>2. -1 +1 +1<br>3. +1 +1 -1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yo2M9xu61D_URIV3SgoTaA.jpeg" /></figure><h4>Understanding Problem</h4><p>We have an option to either add or subtract each value within the nums list. The problem requires us to go through every item in the list and make a decision for each one. It seems we need to exhaust every possible combination to find the total number of ways to get to the target.</p><p>Some ways to combine the numbers might be:</p><ul><li>add every item</li><li>subtract every item</li><li>add every item, and only subtract the last one</li><li>…and so on.</li></ul><p>We can see a pattern here: for each number, we make a choice, and then we move on to the next number and face the exact same kind of choice. That signals we should use recursion.</p><h4><strong>Sub Problems</strong></h4><p>Since we process the list one element at a time, our subproblem can be defined by where we are in the list. It needs to find the number of ways to reach the target using the <em>rest of the list</em> given our current sum (that was decided on choosing addition or subtraction). If we know the total number of ways to get to target if we add the current number, and the total number of ways to get to target if we subtract the current number, we can know total number of ways to get to target by adding or subtracting the current number by adding the two values we computed.</p><h4>Base Cases</h4><p>What’s the simplest, smallest possible subproblem? It’s when we’ve made a decision for <strong>every single number</strong> in the nums list. This happens when our index i is equal to the length of nums.</p><p>At this point, our path of additions and subtractions is complete. We just need to check if we succeeded.</p><ul><li>If our currSum equals the target, it means this specific combination of + and - was successful. We found one valid way, so we return 1.</li><li>If our currSum does not equal the target, this path was a dead end. It contributes 0 ways to the total.</li></ul><h4>Assume Recursive Call Works</h4><p>Now, let’s assume our recursive call works. For any number nums[i] (that isn&#39;t a base case), we have two choices. We need to explore both and add up their results.</p><ol><li><strong>The “Add” Path</strong>: We can choose to <strong>add</strong> nums[i]. Our new sum becomes currSum + nums[i]. We then make a recursive call, dfs(i + 1, currSum + nums[i]), to find out how many ways there are to reach the target using the rest of the numbers, starting from this new state. We trust that this call will give us the correct count for this branch.</li><li><strong>The “Subtract” Path</strong>: We can choose to <strong>subtract</strong> nums[i]. Our new sum becomes currSum - nums[i]. Similarly, we make the recursive call dfs(i + 1, currSum - nums[i]) and trust it to return the count of valid ways for <em>this</em> branch.</li></ol><p>We essentially keep branching from each decision until we’ve gone through every item in the list.</p><p>Think of the call right before base case. Lets say when we add the last item, it reaches target and when we subtract, we don’t reach the target. The adding call would return 1 and the subtracting call would return 0. To get total number of ways for this sub-list of just itself (aka a list with only the last number) we get 1 + 0 (totaling the number of ways if we add and number of ways if we subtract).</p><p>So total number of ways from our current position (i) is simply the number of ways from the &quot;Add&quot; path plus the number of ways from the &quot;Subtract&quot; path. We&#39;re essentially adding up all the valid outcomes from the two branches of our decision tree.</p><pre>def findTargetSumWays(self, nums: List[int], target: int) -&gt; int:<br><br>    def dfs(i, currSum):<br>        # our only limit is when we iterated through every number <br>        # in the list<br>        if i == len(nums):<br>            # since we tried every item, we can check if we reached target<br>            # if we did, that means we found 1 way to get to the target<br>            if currSum == target:<br>                return 1<br>            else:<br>                return 0<br><br>        addSum = currSum + nums[i]<br>        subSum = currSum - nums[i]<br>        return dfs(i+1, addSum) + dfs(i+1, subSum)<br><br>    return dfs(0, 0)</pre><h4>Max Interior Node</h4><p>Use cases to write max-interior, which takes a binary tree of numbers<br>with at least one interior node and returns the symbol associated with an interior node with a maximal leaf sum.<br>&gt; (define tree-a (interior-node ‘a (leaf-node 2) (leaf-node 3))) <br>&gt; (define tree-b (interior-node ‘b (leaf-node -1) tree-a))<br>&gt; (define tree-c (interior-node ‘c tree-b (leaf-node 1)))<br>&gt; (max-interior tree-b) returns ‘a<br>&gt; (max-interior tree-c) returns ‘c<br>The last invocation of max-interior might also have returned a, since both the a and c nodes have a leaf sum of 5.</p><h4>Understanding the Problem</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*cXkG10STbRZjYMPp8zOknw.png" /></figure><p>The image should help with understading what the problem is asking. Essentially there are interior nodes which are made up of leaf nodes or other interior nodes. It holds 3 pieces of information, a letter (to identify it), a left interior/leaf node, and a right interior/leaf node. Out of all the interior nodes in the tree, we want to find the letter associated with the largest sum totaled from adding up all the values in the interior node.</p><p>You can already tell this uses recursion because there are smaller components (an interior node is made up of other nodes). We also have to repeat a process at every node.</p><h4>Sub-Problems</h4><p>The sub problems are the left and right nodes. If we know what the max value/sum of the left node is and the max value/sum of the right node is, we simply have to add each side together, and compare all the values to get the overall max sum. However, there are a few different cases we can run into and have to handle them accordingly.</p><h4>Base Case</h4><p>Since the tree is only made up of interior nodes, the smallest possible case is an interior node with a left leaf node and a right leaf node, which you just add together the values. Technically you can have leaf node as a base case, where it just returns the value, but for my implementation in scheme, it was simpler to have an interior node (with only leaf nodes) as base case.</p><p>If you’re wondering what leaf-sum is, it’s just a function that gets the value of the leaf node — makes my life easier to create a function for that simple task in scheme.</p><h4>Assume Recursive Call Works</h4><p>The question you want to ask is what are we returning and what does that data represent? We want the max interior node of the whole tree, and we know that the sub problem to this is finding the max interior node of the left interior node of the root and the max interior node of the right interior node of the root (to keep it simple, we can just say left subtree and right subtree).</p><p>If we know the max of left subtree, and max of the right subtree, we can figure out what’s the max for the overall tree by comparing the 3 values (left max, right max, and left sum + right sum). However, keep in mind, we don’t want to return the value, we want to return the key itself.</p><p>To make this possible, we need to return 3 values at each call. The key, the max sum of the current subtree, and the sum overall of the current subtree. We now know what values to expect from our recursive calls and also what values to return.</p><p>The code might look a bit complex due to number of lines, but conceptually it’s pretty simple. We have 4 cases.</p><p>The base case, where we have two leaf nodes in the interior node. The max interior node of this interior node is just itself since there are no other interior nodes. We simply add the two leaf node values together to get sum, and return [key, sum, sum] (where the first sum represents max sum, and the second instance of sum represents the total sum).</p><p>The second case is when the left subtree is a leaf node and the right subtree is an interior node. Again the logic is pretty simple since we know our right subtree is returning the max sum and the total sum of the right subtree. To find the max interior node at this tree, we add the right subtree total sum and the left subtree (just leaf node value) to get current sum, and see whether right subtree max sum is greater than the current sum. If current sum is greater, we return the current key, and current sum twice (similar to base case). If right subtree max is bigger, we return key of the right subtree max sum, the max sum, and the current sum.</p><p>The third case is when the right subtree is a leaf node and the left subtree is an interior node. You do the same thing we did for the second case.</p><p>The final case is when both the left and the right subtree are interior nodes. In this case, you need to add the total sum of the left subtree and the total sum of the right subtree to get current sum. Then get the max of left subtree max, right subtree max, and current sum. If right subtree max is the largest, we return the key associated with right subtree max, right subtree max, and current sum. If left subtree max is the largest, we return the key associated with left subtree max, left subtree max, and current sum. Otherwise we return current key, current sum, current sum.</p><p>We were only able to figure out the logic easily because we could trust that our recursive calls were returning those 3 values.</p><p>Scheme Implementation</p><pre>(define (max-interior tree)<br>  (letrec ((helper<br>  (lambda (tree)<br>    (cases bintree tree<br>      (interior-node (key left right)<br>       (let* ((left-sum (leaf-sum left))<br>              (right-sum (leaf-sum right)))<br>         (cond <br>           ((and (is-leaf-node left) (is-leaf-node right))<br>             (list key (+ left-sum right-sum) (+ left-sum right-sum)))<br>           ((is-leaf-node left)(let* ((right-call (helper right))<br>                                      (right-max (cadr right-call))<br>                                      (right-total-sum (caddr right-call)))<br>                                 (<br>                                      if (&gt;= (+ right-total-sum left-sum) right-max)<br>                                   (list key (+ right-total-sum left-sum) (+ right-total-sum left-sum))<br>                                   (list (car right-call) right-max (+ right-total-sum left-sum)))))<br>           ((is-leaf-node right)(let* ((left-call (helper left))<br>                                       (left-max (cadr left-call))<br>                                       (left-total-sum (caddr left-call)))<br>                                  (<br>                                    if (&gt;= (+ left-total-sum right-sum) left-max)<br>                                   (list key (+ left-total-sum right-sum) (+ left-total-sum right-sum))<br>                                   (list (car left-call) left-max (+ left-total-sum right-sum)))))<br>           (else (let* ((left-call (helper left))<br>                        (right-call (helper right))<br>                        (left-max (cadr left-call))<br>                        (right-max (cadr right-call))<br>                        (left-total-sum (caddr left-call))<br>                        (right-total-sum (caddr right-call))<br>                        (current-sum (+ left-total-sum right-total-sum)))<br>                   (find-max (list key current-sum current-sum)<br>                       (list (car left-call) left-max current-sum)<br>                       (list (car right-call) right-max current-sum)))))))<br>    (else &#39;ignore)))))<br>(car (helper tree))))</pre><p>Python Implementation</p><pre>def max_interior(tree):<br>    def helper(tree):<br>        key = tree.key<br>        left = tree.left<br>        right = tree.right<br>        <br>        left_sum = getLeafNodeVal(left) # equavalent of leaf-sum in scheme implementation<br>        right_sum = getLeafNodeVal(right)<br>        <br>        # Case 1: Both children are leaf nodes<br>        if is_leaf_node(left) and is_leaf_node(right):<br>            total = left_sum + right_sum<br>            return [key, total, total]<br>        <br>        # Case 2: Left is leaf, right is interior<br>        elif is_leaf_node(left):<br>            right_call = helper(right)<br>            right_max = right_call[1]<br>            right_total_sum = right_call[2]<br>            current_sum = right_total_sum + left_sum<br>            <br>            if current_sum &gt;= right_max:<br>                return [key, current_sum, current_sum]<br>            else:<br>                return [right_call[0], right_max, current_sum]<br>        <br>        # Case 3: Right is leaf, left is interior<br>        elif is_leaf_node(right):<br>            left_call = helper(left)<br>            left_max = left_call[1]<br>            left_total_sum = left_call[2]<br>            current_sum = left_total_sum + right_sum<br>            <br>            if current_sum &gt;= left_max:<br>                return [key, current_sum, current_sum]<br>            else:<br>                return [left_call[0], left_max, current_sum]<br>        <br>        # Case 4: Both children are interior nodes<br>        else:<br>            left_call = helper(left)<br>            right_call = helper(right)<br>            left_max = left_call[1]<br>            right_max = right_call[1]<br>            left_total_sum = left_call[2]<br>            right_total_sum = right_call[2]<br>            current_sum = left_total_sum + right_total_sum<br>            <br>            return find_max(<br>                [key, current_sum, current_sum],<br>                [left_call[0], left_max, current_sum],<br>                [right_call[0], right_max, current_sum]<br>            )<br>    <br>    result = helper(tree)<br>    return result[0]  # Return just the key</pre><h3>Conclusion</h3><p>Thanks for getting this far into the reading. I hope the formula to solving a recursive problem and the examples helped in understanding recursion better. It’s still not always easy to create recursive solutions given finding sub problems and base cases aren’t always trivial. Sometimes there are more abstractions, sometimes it’s unclear what the base cases should be, and so on.</p><p>However, with most things, knowledge isn’t enough. You need to apply it to new problems and build the intuition.</p><p>Good luck, especially to those taking Paradigms at CCNY.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0231aefc4986" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Foolish Captain’s Despair]]></title>
            <link>https://medium.com/@ishmamf/a-foolish-captains-despair-715e9dec6221?source=rss-82b1d9627376------2</link>
            <guid isPermaLink="false">https://medium.com/p/715e9dec6221</guid>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[mental-health]]></category>
            <category><![CDATA[poetry]]></category>
            <category><![CDATA[literature]]></category>
            <dc:creator><![CDATA[Ishmam Fardin]]></dc:creator>
            <pubDate>Mon, 30 Sep 2024 00:02:03 GMT</pubDate>
            <atom:updated>2025-04-26T09:17:02.655Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s another story about a captain and his ship… except this captain has a map and the ship isn’t about to sink, well at least not right now.</p><p>The captain makes a lot of mistakes, that not only makes the journey longer but also causes cracks and tares on the ship. Sometimes he feels the sudden vibration, or a slight decrease in elevation, but it’s not prominent enough for him to make drastic changes.</p><p>He patches up the cracks he can find, though patching up a hole may solve the issue of water flowing in, that part would still be vulnerable.</p><p>The captain wonders why he continues to make the same stupid STUpid STUPID mistakes. He has a map, a functional ship with everything he needs, and he’s a captain…so logically he believes the only problem lies with him.</p><p>Through the journey, he experiences foggy nights, storms, and turbulent seas. Surprisingly, the captain enjoys it, not because there’s some challenge or fun surrounding it, but because he can feel the chaos with all his senses which he cannot do with his inner quarrels.</p><p>For some reason, he feels comfort within the turmoil caused by the weather and the sea. Perhaps it gives him a sense of power, being able to sit in a physical manifestation of madness, or maybe he feels thats where he belongs because having sunshine and rainbows doesn’t reflect himself.</p><p>It’s a weird quirk that makes him question, what kind of captain likes such things?</p><p>The captain’s eyes go dull, with light stretching and the water blurring, not from looking out to sea for so long, but looking within and holding back tears.</p><p>Despite the captain’s efforts, he fears the ship might be slowly sinking. Not to the point where it’s noticeable now, but could build up in the foreseeable future.</p><p>He has a map, yet he feels the hopelessness of being lost. He’s unsure of what it will take for him to become the captain he longs to be, and only has the dream of his destination to keep him going.</p><p>Memories of when he first set out to sea as a captain appears, he was so confident and naive. He believed in himself even though he had no reason to, he felt like he can do anything and figure it out… The cracks in his soul is now too much to bear.</p><p>Regardless, he continues to still believe in his ship.</p><p>That the ship with all of its cracks and tares will endure, and is headed in the direction of the destination. All the glory is there for him to be taken, and the foolish captain will find out that he wasn’t that foolish after all.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=715e9dec6221" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ultimate Guide to Taipy GUI]]></title>
            <link>https://medium.com/@ishmamf/ultimate-guide-to-taipy-gui-6779d197880c?source=rss-82b1d9627376------2</link>
            <guid isPermaLink="false">https://medium.com/p/6779d197880c</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[taipy]]></category>
            <category><![CDATA[gui̇de]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Ishmam Fardin]]></dc:creator>
            <pubDate>Sun, 09 Jun 2024 21:55:48 GMT</pubDate>
            <atom:updated>2024-09-08T19:54:34.513Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Taipy is an open-source Python library for easy, end-to-end application development, featuring what-if analyses, smart pipeline execution, built-in scheduling, and deployment tools.</blockquote><h3>Prologue</h3><p>Roughly 2–3 weeks ago, I attended a data science hackathon at Georgia Institue of Technology called Hacklytics. My team and I chose the sports track and had plans to have graphs/visualizations that were interactive and Machine Learning technologies to output relevant information.</p><p>Given this was a data science hackathon, we didn’t want emphasis on the frontend, however, we also wanted it to look somewhat appealing. One of the prizes was “Best Use of Taipy” and at a glance it seemed similar to a technology we were familiar with, Streamlit. We believed it would be a good chance to try out a new technology, wouldn’t be too hard to implement, and we have more chances at winning.</p><p>We were wrong on the second part, the technology was new (so less help available), documentation was difficult to navigate, and unlike streamlit, it wasn’t as intuitive. Hence the motivation to write this article.</p><h3>Configuration</h3><h4>Installation</h4><p>Downloading Taipy is simple, run the command pip install taipy and it should be within your environment.</p><p>In main.py, you should add the following imports:</p><pre>from taipy.gui import Gui<br>import taipy as tp</pre><h4>Themes</h4><pre>light_theme = {<br>    &quot;palette&quot;: {<br>        &quot;background&quot;: {<br>            &quot;default&quot;: &quot;#d580ff&quot;  <br>        },<br>        &quot;primary&quot;: {&quot;main&quot;: &quot;#ffffff&quot;}<br>    }<br>}<br><br>dark_theme = {<br>    &quot;palette&quot;: {<br>        &quot;background&quot;: {<br>            &quot;default&quot;: &quot;#471061&quot;  <br>        },<br>        &quot;primary&quot;: {&quot;main&quot;: &quot;#000000&quot;}<br>    }<br>}</pre><p>Taipy uses other libraries out there for their own configurations. For themes, they follow <a href="https://mui.com/material-ui/customization/theming/">Material UI</a>’s practices. These two variables are the parameters for light and dark mode. Background sets the color of the whole background while primary is meant for the text color. I am not too familiar with the Material UI library but for simple cases you can look at this part of the <a href="https://github.com/Avaiga/taipy/blob/develop/frontend/taipy-gui/src/themes/stylekit.ts">Taipy github</a> to change the theme as you see fit. It gives you a good sense of what you can change and update.</p><h4>Initializing</h4><pre>app = Gui()<br><br>if __name__ == &#39;__main__&#39;:<br>    <br>    app.run(title=&quot;SoccerStatusTech&quot;, use_reloader=True, port=3636, light_theme=light_theme, dark_theme=dark_theme)</pre><p>The first line creates the GUI instance. app.run() tells the program to run Taipy (it seems to be built on top of flask). Title sets the name of the site at the top for your browser, use_reloader doesn’t require you to refresh the page manually when you make changes, then the rest is configuring your theme and port.</p><h4>Multi-Page Functionality</h4><p>The intriguing part about Taipy is how it reads instructions through markdown. It’s not the typical markdown where you’re bolding with astrics or highlighting code with backticks, but a different syntax within a markdown file that Taipy reads and outputs on the frontend.</p><p>In your repository, create a directory called pages . Within this directory, create the following: root.py root.md and directories for all your pages</p><pre>Repository<br>-&gt;  main.py<br>-&gt;  pages<br>    -&gt;  root.py<br>    -&gt;  root.md<br>    -&gt;  directories for each page </pre><p>Here’s how our group structured ours:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*vsFxsLAh_Vpehc8mViW3WA.png" /></figure><p>You might be thinking that root.py is the home page, but it’s actually what’s consistent throughout all the pages, like a navbar for instance. I initially neglected the root files but it ended up creating weird user experiences when navigating through the pages.</p><p>Within root.py , add the following:</p><pre>from taipy.gui import Markdown<br><br>root = Markdown(&#39;root.md&#39;)</pre><p>Markdown essentially reads the instructions from the markdown file. For all your pages, you should have a python file and a markdown file.</p><p>For example, for home page, I have a home.py file and a home.md file. In each python file for each page, you should have a the code you put for the root.py file but different variable names and accessing the associated markdown. In home.py , I would have</p><pre>from taipy.gui import Markdown<br><br>home_md = Markdown(&#39;home.md&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*DSd5iR64J2lRin04mh654w.png" /></figure><p>Finally now to connect all your pages, go to your main.py file add/update the following:</p><pre>from pages.home.home import home_md<br>from pages.prediction.predictions import predictions_md<br>from pages.charts.charts import charts_md<br>from pages.root import root<br><br>pages = {<br>    &#39;/&#39;:root,<br>    &#39;home&#39;:home_md,<br>    &quot;statistics&quot;:charts_md,<br>    &quot;predictions&quot;:predictions_md,<br>}<br><br>app = Gui(pages=pages)<br><br># I added in the variables we created from the python files in pages <br># directory, as well as, the pages dictionary to map endpoints to <br># associated GUI instructions. </pre><p>First you should access all the variables you created in your python files in pages.</p><p>Like most web apps, I thought the the slash would signify that as being the homepage. To reiterate, it isn’t. Create a pages dictionary, the slash should map to root, the other endpoints naming convention is up to you. Each endpoint should map to their corresponding page / variable.</p><p>The last part is to update the initialization of GUI, set pages parameter to your pages dictionary.</p><h3>Markdown Syntax &amp; More</h3><p>So far we’ve covered only configuration. We will now touch upon the weird syntax that’s used within markdown.</p><h4>Navbar &amp; Darkmode</h4><pre>&lt;br/&gt;<br>&lt;|layout|columns=1fr auto 1fr|class_name=container align_columns_center|<br>&lt;|part|<br>**&lt;|SoccerStatusTech|text|height=50px|width=50px|style=&quot;font-size: 50px;&quot;|&gt;**<br>|&gt;<br>&lt;|part|class_name=align_item_stretch|<br>&lt;|navbar|class_name=fullheight|&gt;<br>|&gt;<br>&lt;|part|class_name=text_right|<br>&lt;|toggle|theme|&gt;<br>|&gt;<br>|&gt;</pre><p>We used this piece of code in root.md. It’s a mix of XML, HTML/CSS, markdown, and probably some other syntax I don’t know.</p><ul><li>&lt;br/&gt; does a line break</li><li>&lt;|layout|&gt; structures how you want things to be placed. It’s similar to a div or span in css where you have multiple parts and want them in the same row</li><li>similar to html, you want the parts to be within the closed brackets. Weirdly, if you have stuff within setting the element type, you have to end it with |&gt; and not just &gt;</li><li>&lt;|part|&gt; lets the interface know it’s an element of a layout</li><li>columns=1fr auto 1fr|class_name=container align_columns_center is setting css rules for the layout. 1fr means the first part takes up one fraction of available space, and auto adjusts based off content.</li><li>class_name=align_item_stretch and other <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/align-items">css properties</a> don’t have dashes, instead it uses underscores.</li><li>For <strong>text</strong>, &lt;|&quot;your text without quotes go here&quot; |text|height=50px|width=50px|style=”font-size: 50px;”|&gt; , for other configurations you can check <a href="https://docs.taipy.io/en/release-2.2/manuals/gui/viselements/text/">documentation</a></li><li>For <strong>navbar</strong>, &lt;|navbar|&gt; uses the endpoints from your main.py</li><li>For <strong>darkmode/lightmode</strong> functionality, &lt;|toggle|theme|&gt; creates a toggle with an icon for dark and light theme</li><li>Make sure you close each property properly</li></ul><h4>Drop Down, Cards, and Buttons</h4><pre>&lt;|text-center|<br>&lt;br/&gt;<br>&lt;|card|<br>&lt;h3&gt;Choose your team&lt;/h3&gt;<br>&lt;|layout|gap=10px|class_name=container align_center|<br>&lt;center&gt;<br>&lt;|{value1}|selector|lov=Arsenal;Aston Villa;Bournemouth;Brentford;Burnley;Wolverhampton;Brighton Hove;Chelsea;Crystal Palace;Everton;Fulham;Liverpool;Luton Town;Man City;Man United;Newcastle;Nottingham;Sheffield Utd;Tottenham;West Ham|dropdown|label=Team 1|&gt;<br>&lt;/center&gt;<br><br>&lt;center&gt;<br>&lt;|{value2}|selector|lov=Arsenal;Aston Villa;Bournemouth;Brentford;Burnley;Wolverhampton;Brighton Hove;Chelsea;Crystal Palace;Everton;Fulham;Liverpool;Luton Town;Man City;Man United;Newcastle;Nottingham;Sheffield Utd;Tottenham;West Ham|dropdown|label=Team 2|&gt;<br>&lt;/center&gt;<br>|&gt;<br>&lt;|Generate|button|on_action=button_pressed|class_name=button|<br>|&gt;</pre><p>The following code was used in home.md which is the landing page we want users to see, and where we get inputs.</p><ul><li>a card is essentially just a square box that you can place information in. You create a card by having a &lt;|card| at the start and then place the parts within it, ending with |&gt; .</li><li>Dropdown menus are bit more complex where the first value is the name you want to set the selector as so you can access it in your python file. Essentially, your identifier, letting you access the user input from the state. The second value is justselector letting Taipy know it’s a drop down selection, and the third part is your options. lov stands for list of values and you just state the options separated by semi colons. Finally the last part is your label, which is essentially what the user sees before selecting an option.</li><li>Buttons are pretty simple, You start with the button name, in my case, it’s generate . You can have submit, update, add, etc. depending on what your button does and what you want the user to see. Second part is just button letting Taipy know it’s a button, and the third part is on_action which will set off the events you want. You can set on_action equal to anything, like “clicked_button” or “submit”, but in your python file, you’d need a function that starts with the same name.</li></ul><h4>Graphs, Charts, &amp; Toggles</h4><pre>&lt;|part|render={showToggles}|<br>&lt;center&gt;<br>&lt;|{selected_team}|toggle|lov={values}|on_change=toggle_choice|&gt;<br>&lt;/center&gt;<br>|&gt;<br>&lt;br/&gt;<br>&lt;|layout|column=1 1|<br>&lt;|part|render={showGraphs}|<br>&lt;|{data}|chart|type=pie|values=Count|labels=Country|title=Percentage of Players by Nationality|&gt;<br>|&gt;<br>&lt;|part|render={showGraphs}|<br>&lt;|{dataframe}|chart|type=bar|x=Season|y[1]=W|y[2]=L|layout={layout}|&gt;<br>|&gt;<br>|&gt;<br>&lt;|part|render={showGraphs}|<br>&lt;|{allFrame}|chart|mode=lines|x=Season|y[1]=Goals Scored|y[2]=Goals Conceded|y[3]=Points|&gt;<br>|&gt;</pre><ul><li>In the following markdown, I started with a toggle button. First section is the label, basically the text the user sees on the toggle itself. Next is toggle to let the user know that it’s a toggle, and right after is the list of the values (lov). The last section is the on_change.</li><li>The values within curly braces are the names of variables within the state that holds certain information. values is a list that holds two items, team 1 and team 2, selected_team is a new variable defined in the markdown that allows us to access which team was clicked on in python file.</li></ul><p>All the charts follow a similar pattern, each one are in a part where they have a parameter called render which lets us know whether to show graph or not. showGraphs is initially False but when a user clicks on a team on the toggle, it’s set to True.</p><p>The first section on the chart is the data itself, which could be a dataframe (pandas) or a dictionary with values that are lists. Second section is chart to let Taipy know it’s a chart, third section is the type of chart, so in this instance (below), it’s a pie chart. values , labels, and title are self explanatory.</p><p>&lt;|part|render={showGraphs}| &lt;|{data}|chart|type=pie|values=Count|labels=Country|title=Percentage of Players by Nationality|&gt; |&gt;</p><p>Other charts follow a similar pattern, though for bar and line graphs you’d have to specify x and y and optionally, label that is defined in python file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QwP0SYot2aZllTts" /></figure><h3>State</h3><p>I probably should’ve covered this first given how prevalent it is in the code. State is how you get the information from the user interactions on the frontend. When creating a function for an on_change the function has a parameter called state allowing you to access inputs or modifying values.</p><p>If you want to define variables in curly brackets , you’d create a variable in the python file and access it in the markdown with curly braces.</p><p>Here is the python code for the markdown we looked at earlier.</p><pre>layout = {<br>    &quot;yaxis&quot;: {<br>      &quot;side&quot;: &quot;left&quot;,<br>      &quot;title&quot;: &quot;Games&quot;<br>    },<br>    &quot;title&quot;: {<br>        &quot;text&quot; : &quot;Win vs Losses Throughout the Season(s)&quot;<br>    }<br>}<br><br>dataframe = {&quot;Season&quot;:[], &quot;W&quot;:[], &quot;L&quot;:[]}<br>allFrame = {&quot;Season&quot;:[], &quot;Goals Scored&quot;:[], &quot;Goals Conceded&quot;:[], &quot;Points&quot;:[]}<br><br>data = {&quot;Country&quot;:[], &quot;Count&quot;:[]}<br>logo = &#39;&#39;<br>selected_team = &#39;&#39;<br>def toggle_choice(state):<br><br>    state.logo, countries = nationalityChart(state.selected_team, state.response) <br><br>    state.data = {<br>        &quot;Country&quot;: list(countries.keys()),<br>        &quot;Count&quot;: list(countries.values())<br>    }<br><br>    state.dataframe = df[df[&#39;Team&#39;]==state.selected_team].copy()<br>    state.allFrame = df[df[&#39;Team&#39;]==state.selected_team].copy()<br>    state.showGraphs = True</pre><p>The layout was defined in python , and was able to get accessed in the markdown within the curly braces.</p><p>Within the def toggle_choice(state), we were able to change the interface logic, such as showing data only for the team that was selected, setting a logo for the team, and rendering all the graphs by setting showGraphs to true.</p><p>State seems to be something that you can only access within on_change functions , though at the start before you run your application , you’re able to add values to the state so you can access in other pages.</p><p>You do so by using GUI.add_shared_variables which allow you to access variables and data across other pages. It’s not technically using state here , since there isn’t anything changing, but makes states easier to manage when user interactions occur.</p><pre>response = requests.get(API_URL, headers=headers)<br><br>value1=&quot;select a team&quot;<br>value2=&quot;select a team&quot;<br><br>showToggles = False<br><br>app = Gui(pages=pages)<br><br>values = [&#39;team1&#39;,&#39;team2&#39;]<br><br>Gui.add_shared_variables(values, showToggles, response)</pre><h3>Conclusion and Source Code</h3><p>What we thought would be an easy tool to use , turned out to be difficult and took a long time to figure out how to put it together. The most difficult part was sharing data across multiple pages, such as knowing whether the generate button was pressed or not, which teams were selected, etc. We had to learn the technology as well as build our application at the same time within a constrained amount of time.</p><p>For full transparency, I feel that there’s still a lot of gaps in what I know about the library, but I hope what I shared provides some insights or guidance on helping you build your Taipy project.</p><p>Github: <a href="https://github.com/IshmamF/SoccerStatusTech">https://github.com/IshmamF/SoccerStatusTech</a><br>Project Showcase: <a href="https://devfolio.co/projects/soccerstatustech-fde8">https://devfolio.co/projects/soccerstatustech-fde8</a></p><p>Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6779d197880c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with PHP]]></title>
            <link>https://medium.com/@ishmamf/getting-started-with-php-1beff50296e8?source=rss-82b1d9627376------2</link>
            <guid isPermaLink="false">https://medium.com/p/1beff50296e8</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Ishmam Fardin]]></dc:creator>
            <pubDate>Mon, 08 Apr 2024 01:50:40 GMT</pubDate>
            <atom:updated>2024-04-08T01:51:37.382Z</atom:updated>
            <content:encoded><![CDATA[<p>PHP originally stood for “Personal Home Page” and eventually evolved to be “PHP: Hypertext Preprocessor”, a recursive acronym. PHP can be embedded within HTML making it suitable for the web. It also has strong integration with databases, and runs on a server where it sends html/css/js to the browser. The article assumes you have some programming background. The aim is to get you up to speed with the basics very quickly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*adzKuY90hx12Dx4I.png" /></figure><h3>How to Practice PHP :</h3><p>You can run PHP within <a href="https://www.w3schools.com/php/php_install.asp">W3Schools web editor</a> or find a video tutorial to setup PHP on your editor/compiler on your local computer. Here’s a link to a mac setup I used: <a href="https://youtu.be/1ZxKPA2jJvw?si=a4WS2372n0Zf9LfA">https://youtu.be/1ZxKPA2jJvw?si=a4WS2372n0Zf9LfA</a>.</p><h3>Basic Syntax:</h3><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;title&gt;Document&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;?php <br>        echo &quot;&lt;p&gt;hello world&lt;/p&gt;&quot;; <br>        // comment 1 line<br>        # comment 1 line <br>        /* comment on <br>          multuple lines */ <br>        $string = &quot;my fav number is 7&quot;;<br>        echo $string;<br>        $bool = true;<br>        $float = 3.21;<br>        $int = 12;<br>    ?&gt; <br>    &lt;?php $booleanVar = true ?&gt;<br>    &lt;?php if ($booleanVar) {; ?&gt; // able to apply logic to html<br>    &lt;p&gt;Hello world&lt;/p&gt;<br>    &lt;?php }; ?&gt;<br>    &lt;?php <br>        // create an array/list <br>        $values = [1,3,2,4]; <br>        $values2 = array(1,3,2,4);<br>        // if statements are simple<br>        if ($values[2] + $values[1] == 3) {<br>           echo 23;  <br>        }<br>        else {<br>           echo 10;<br>        }<br>    ?&gt;<br>    &lt;p&gt; &lt;?php echo $values[0] /*can access list within html tags*/ ?&gt;&lt;/p&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><ul><li>PHP opening tags start with &lt;?php&gt; and end with ?&gt; , the echo outputs the strings to the browser (since this is within an HTML template). Sometimes these strings could have html/css instructions within them.</li><li>Instead of echo, you can also use PHP for the logic aspect with html properties within it. The code for a PHP tag trails on the next PHP tag even if there are semi colons.</li><li>Variables in PHP are dynamically typed and start with a dollar sign, meaning you don’t have to explicitly say that it’s an int or a string. Arrays can be called with list comprehension similar to python, with square brackets.</li><li>How to comment is shown in the example code (#, // , /* */ )</li><li>Every line should end with a semicolon</li><li>If the file is pure PHP, then you only need an opening php tag (&lt;?php)</li></ul><p><strong>Executing the Code Outputs the Following:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hZv4reRRVUgJ5oHt3f8eBQ.png" /></figure><h3>Functions &amp; Loops:</h3><pre>&lt;?php <br><br><br>function addTwoNums ($x, $y) {<br> echo $x . &quot; + &quot; . $y . &quot; = &quot; . ($x + $y) . &quot;&lt;br&gt;&quot;;<br> return $x + $y;<br>}<br><br>for ($i = 0; $i&lt;10; $i++) {<br> echo $i . &quot;&lt;br&gt;&quot;;<br>}<br><br>$n = 0;<br>while ($n &lt; 3) {<br><br>  echo $n . &quot;\n&quot;;<br><br>  $n += 1;<br>}<br><br>echo &quot;&lt;br&gt;&quot;;<br><br>addTwoNums(4,6);<br><br>$fruitColors = [<br>    &quot;apple&quot; =&gt; &quot;red&quot;,<br>    &quot;banana&quot; =&gt; &quot;yellow&quot;,<br>    &quot;grapes&quot; =&gt; &quot;purple&quot;,<br>    &quot;berries&quot; =&gt; &quot;blue&quot;,<br>    &quot;orange&quot; =&gt; &quot;orange&quot;,<br>];<br><br>foreach ($fruitColors as $fruit =&gt; $color) {<br>    echo &quot;The color of &quot; . $fruit . &quot; is &quot; . $color . &quot;&lt;br&gt;&quot;;<br>}<br><br>?&gt;</pre><ul><li>Functions are defined by calling function followed by name of function and putting parameters in parentheses.</li><li>Loops are called how you would normally call them in most languages as shown above.</li><li>The foreach loop takes an array and allows you to only get the item without having to use index and access a specific position within array. Within foreach parenthesis , call the array then as then a name you want to call each item as. If it’s a dictionary, you would have to create two variable names , where the first variable is the key and the second variable is the value.</li><li>Somethings to note, to concatinate an integer an a string, use . (period) and to set/use dictionaries in PHP, you use =&gt; between a key and a value , within square brackets.</li></ul><p><strong>Executing the Code Outputs the Following:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*-BrfwdkVrC1NDDnya4X36Q.png" /></figure><h3>Superglobal Variables:</h3><p>Super globals are variables that are built in already and allow you to access information about certain things like incoming http requests, user interaction such as uploaded files, session information, etc.</p><ul><li>$GLOBALS — An array of global variables, essentially variables that can be accessed anywhere including within functions and other files.</li><li>$_SERVER — Has information regarding headers, request method, file path, server name, etc.</li><li>$_REQUEST — Contains submitted form and cookie data, it includes $_GET, $_POST, and $_COOKIE.</li><li>$_POST — An array of data that is collected from a POST request. Allows you to access data once a user submits a form (information from a post request).</li><li>$_GET — An array of data that is collected from a GET request. Allows you to retrieve data from user submissions, query parameters, etc.</li><li>$_FILES — An array of items collected from files uploaded via HTTP POST method.</li><li>$_ENV / $_SESSION / $_COOKIE— Variables are self explanatory, they allow you to get the associated information.</li></ul><pre>&lt;html&gt;<br>&lt;body&gt;<br><br>&lt;form method=&quot;POST&quot; action=&quot;&lt;?php echo $_SERVER[&#39;PHP_SELF&#39;];?&gt;&quot;&gt;<br>&lt;!--$_SERVER[&#39;PHP_SELF&#39;] provides file name of the script executing the script--&gt;<br>  Name: &lt;input type=&quot;text&quot; name=&quot;fname&quot;&gt;<br>  &lt;input type=&quot;submit&quot;&gt;<br>&lt;/form&gt;<br><br>&lt;?php<br>if ($_SERVER[&quot;REQUEST_METHOD&quot;] == &quot;POST&quot;) // checks request method used<br>{<br>  $name = htmlspecialchars($_POST[&#39;fname&#39;]); // gets information from POST request<br>  # htmlspecialchars cleans the string input for html injections <br>  if (empty($name)) { <br>    // Empty is a built in function<br>    echo &quot;Name is empty&quot;;<br>  } else {<br>    echo $name;<br>  }<br>}<br>?&gt;<br><br>&lt;/body&gt;<br>&lt;/html&gt;</pre><h3>MYSQL Functions:</h3><p>PHP has MYSQL built into it making accessing the database seamless.</p><p>To initialize the database , you use new PDO($datasource, $username, $password) where the variable names have your associated credentials.</p><p>To access and use MYSQL functions, you use the arrow notation -&gt; followed by the name of the function you want to use.</p><p>prepare checks the syntax for SQL injections and saves it to the server for later use. The question mark is a place holder for a parameter you might want to use to filter your query.</p><p>execute carries out the SQL query, and substitutes input values with the question mark.</p><p>fetchAll retrieves all the data where the column is an index number and rows are a dictionary/array of the query data. fetch retrieves only one row.</p><pre>$dbms = new PDO($datasource, $username, $password)<br>$query = $dbms-&gt;prepare(&quot;SELECT * FROM files WHERE location = ?&quot;)<br><br>$locations = $query-&gt;execute($_POST[&#39;location&#39;])<br><br>result1 = $locations-&gt;fetchAll(PDO::FETCH_NUM)<br>result2 = $locations-&gt;fetch(PDO::FETCH_NUM)</pre><h4>Any and all feedback are appreciated!</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1beff50296e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What I learned and resonated with from a Machine Learning Engineer at OpenAI]]></title>
            <link>https://medium.com/@ishmamf/what-i-learned-and-resonated-with-from-a-machine-learning-engineer-at-openai-d81dae376f79?source=rss-82b1d9627376------2</link>
            <guid isPermaLink="false">https://medium.com/p/d81dae376f79</guid>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[career-advice]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Ishmam Fardin]]></dc:creator>
            <pubDate>Thu, 18 Jan 2024 20:53:24 GMT</pubDate>
            <atom:updated>2024-01-20T15:09:05.863Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve recently came across an interview done by Code Academy, where they brought upon a machine learning engineer, Ted Sanders, from OpenAI. <br>In this article I’ll be sharing what I took away from it.</p><p><a href="https://www.youtube.com/live/dVOhmLIAeBU?si=EoTlg1SM9CDqFR6h">Pro Tips with Ted Sanders, OpenAI</a></p><h3>What I Resonated With:</h3><p>Ted Sanders talks about how he started, and how his background wasn’t out of the ordinary when it comes to coding. He picked up Electrical engineering because it incorporated physics, he learned a little bit of programming in college and during his masters, and from there pivoted into data science at Netflix.</p><p>It could be him being humble in the interview since he had awards and scholarships for mathematics (it seems) during college. You do need a level of smarts to pursue a PhD in physics.</p><p>Regardless, I relate to his struggles and some parts of his background. He shares how he cried freshmen year when he couldn’t get code to work, how he didn’t really know what he wanted to do, and how he wasn’t some whiz who started young at 16.</p><p>Personally I tried a little (VERY MARGINAL) programming when I was in middle school. I recall trying to create shapes and snow mans in Khan Academy in some JavaScript language and there was some mobile app that taught me how to send an alert. It fascinated me, but I got bored of drawing shapes and at the time, I was dealing with the struggles of middle school / life in general. I did some scratch in high school, which honestly, doesn’t “scratch” (pun intended) the surface of programming in my opinion.</p><p>I didn’t start truly programming till the second year of college, when I was finally able to take computer science classes (didn’t meet math/science pre requisites prior) and I still don’t know what field of computer science I want to pursue. I did try to do CS50 I think at some point before this but I gave up when I couldn’t do a basic nested loop!</p><h3>What I’ve Learned and Took Away:</h3><h4>Patience</h4><p>Hearing about his humble beginnings, it helped me understand what is possible with some time. He wasn’t someone special or super smart during the start of his journey, and yet he found himself in environments that only consisted of super smart or special people. All it took was a decade of learning and some persevering!</p><h4>Curiosity</h4><p>He got into AI because he was curious about random things like what&#39;s the trajectory of technology or how do we know what’s true. I think his interest with probability and statistics, math, and physics influenced his curiosity a lot. The idea in which what you’ve exposed yourself to, what generally interests you, or philosophical questions you think about can actually connect with unrelated things like technology is interesting.</p><p>It seems throughout his journey, he always gravitated towards what looked interesting to him despite not knowing where he would end up — and that helped him land and succeed in roles that are difficult.</p><h4>AI won’t replace programming or Juniors (maybe)</h4><p>His main view is that AI will help juniors more than seniors. He does think it’s possible where Seniors no longer need juniors because they have AI to do the trivial / smaller tasks. However, he leans towards more as AI being a tool to help juniors succeed in their roles since they don’t always have to ask seniors for help — they can ask ChatGPT.</p><p>He also doesn’t think AI will replace programming altogether, or maybe it might just replace the idea we have of programming, but create more opportunities and fields. For example, in the early days, people would use punch cards and assembly, but now those are pretty much obsolete (in the sense that not a lot of people use it).</p><p>It will most likely lead to a position where there’s higher levels of abstraction in terms of giving instructions to computers and fewer lines of code.</p><h4>Build Skills Complimentary to AI</h4><p>He says a mistake that most might make is, since there&#39;s a lot of hype with AI, people think they should focus on only learning prompt engineering/calling via APIs and AI in general. Instead you should try to learn skills that could be used with AI, but not directly AI.</p><p>An example he uses that makes that idea clearer is earlier in the days when electricity was introduced and factories were to take advantage of it. If you’re a shoe factory owner like Nike, electricity could change how the factory is run and other processes but it won’t help you make great shoes. You would have to learn other skills like designing and sales to get the outcome you want.</p><p>It looks to me he views AI to be an integral tool and utility of society that could aid big ideas.</p><p>Personally I have more of a data science background, and I believe in his sentiment that building skills outside of AI is key to being successful when starting out. I was initially fascinated by what AI could do like predicting the progression of Alzheimer&#39;s disease (since my grandma has a form of dementia) and predicting a song based on how similar the lyrics are to your text / the sentiment comparison.</p><p>However, despite the cool functionalities of AI, I want to learn more about how I can make it usable to other people, how I can allow users to have more functionality beyond predicting / classifying things — like saving user data for future reference for users, the updating information, deploying, etc.</p><h4>Learn multiple languages &amp; Rely on ChatGPT if you’re a beginner</h4><p>He briefly mentions that to be a well rounded programmer you shouldn’t be monolingual because a lot of concepts are repeated across different languages.</p><p>I agree with that sentiment, because I officially started out with C++ and it was difficult and learning the fundamentals, I didn’t understand what those concepts achieve. Like when learning math, you don’t know how useful math concepts are because you’re always learning the theory and not the application. I did create small programs but it didn’t do anything interesting.</p><p>However, when I switched to python, a lot of the fundamentals carried over, and I was able to learn quickly as well as create data visualizations, predictive models, and scripts that helped solve some issue. Then learning JavaScript, HTML, CSS, Java I found more utility with programming and was able to build some cool apps/websites.</p><p>He said ChatGPT is really great for beginners because when starting out you can ask a lot of dumb questions you’d be scared to ask in public. It helps understand the fundamentals and get up to speed.</p><p>In my experience, ChatGPT has helped me explain a lot of concepts for me and understand what stupid mistake I made that caused a bug. However, I think a mistake that can be made is using it as a shortcut for programming. I think early on its best to not rely heavily on ChatGPT so you can build that problem solving ability.</p><h3>Conclusion:</h3><p>If you’re worried about AI replacing programmers, you shouldn’t, though I think the level of expertise needed is increased. We should focus on building skills that interest us (or profitable ones depending on your situation) that can be boosted with AI. We shouldn’t feel rushed (it’s something I’m still trying to overcome) and continue to persevere through the many obstacles in the tech industry. We might feel a certain way about our abilities right now but in the future, 10 years down the line, we’ll be proud of making the tough choices now, following our curiosity, and building our skills, because we will be in positions that we once thought allowed only unique/special individuals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*parhwiY6oDJfy5Cg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d81dae376f79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Relational Model | “A First Course In Database Systems” | Chapter 2 Key Takeaways]]></title>
            <link>https://medium.com/@ishmamf/relational-model-a-first-course-in-database-systems-chapter-2-key-takeaways-d10a2d3f1689?source=rss-82b1d9627376------2</link>
            <guid isPermaLink="false">https://medium.com/p/d10a2d3f1689</guid>
            <category><![CDATA[relational-databases]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[relational-algebra]]></category>
            <dc:creator><![CDATA[Ishmam Fardin]]></dc:creator>
            <pubDate>Sat, 13 Jan 2024 02:26:43 GMT</pubDate>
            <atom:updated>2024-01-13T02:26:43.059Z</atom:updated>
            <content:encoded><![CDATA[<h3>Data Models</h3><p>Data models are a way to describe information. It’s described through structure (relational model), a limited set of operations that provide programmers the ability to describe at a high level and have management systems that are efficient, and constraints.</p><p>Other models are mentioned and spoken in depth like XML but relational models are emphasized more in the chapter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5lHx6E1MceUNXvR7" /></figure><h3>Relational Models</h3><p>Relational models consists of structure (basically tables), the operations are associated with relational algebra , and constraints can be anything like last row must have a specific value.</p><p>It’s preferred over other models because of ease of use. It provides a simple approach to structuring data, and allows for anything to be modeled. It also provides a limited set of operations.</p><p><strong>Terminology:</strong><br>relation = table<br>attribute = column<br>schema = relation + attributes<br>tuple = row of data in a table<br>domain = data type<br>instance = set of tuples<br>key constraints = set of attributes where no two tuples share the same values</p><p>order of tuples and attributes doesn’t impact the relation, though you should update the schema.</p><p><strong>Keys:<br></strong>If you have a set of attributes defined as S and a relation defined as R, two tuples in R cannot have the same attribute values within the set S, unless one of them is NULL. Otherwise it’s not a DBMS</p><p><strong>Example:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*Gnts_Lj3DA77UYoTrv2ZFQ.png" /></figure><p>Relation would be Movies; attributes would be title, year, length, genre; schema would be Movies(title, year, length, genre); tuple would be (Gone with the wind, 1939, 231, drama), and domain could be string for title and genre, while int for year and length. A key constraint can be title and year since you can safely assume that no two movies within the same year will have the same name.</p><h3>SQL</h3><p>Pronounced Sequel, allows for describing and manipulation of relational model database.</p><p>There are 3 kinds of relations: tables, views (set by a computation), temporary tables. To set datatypes for attributes you use the following mentioned below.</p><p><strong>Data Types:<br></strong>CHAR(n) : fixed length string made up of n characters<br>VARCHAR(n) : same as CHAR(n) except no padding of blank spaces if it’s smaller<br>BIT(n) : same as CHAR(n) except it’s a string of bits<br>BIT VARING(n) : same as VARCHAR(n) except it’s a string of bits<br>INT or INTEGER : self explanatory<br>DATE : quoted string of a format YEAR-MONTH-DAY (ex: DATE ‘2003–07–27’)<br>TIME: quoted string of a format HOUR:MINUTE:SECONDS.MILLISECONDS<br>(ex: TIME ‘16:26:03.2’)<br>FLOAT or REAL : floating point numbers<br>DOUBLE PRECISION : floating point numbers with higher precision <br>DECIMAL(n,d) : can set real numbers to a fixed decimal point where n is the number of digits and d is the number of positions from the right</p><p><strong>CREATE TABLE</strong><br>When creating table you use the declaration CREATE TABLE followed by relation name and a parenthesis that has attribute name + space + data type, each separated by commas. <br>ex: CREATE TABLE movie(title VARCHAR(100), year INT)<br>ex:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*78yJal6jUk-rf1Tygh2kxQ.png" /></figure><p><strong>DROP TABLE R<br></strong>Deletes a whole table (where R is the name of a table)</p><p><strong>ALTER TABLE<br></strong>Ability to do the bullet points below<br>- ADD ATTRIBUTE data type &lt;- create a column/attribute<br>- DROP ATTRIBUTE &lt;- delete a column/attribute<br>(ATTRIBUTE should be the name of a column/attribute)<br>ex: <br>ALTER TABLE movies ADD date DATE <br>ALTER TABLE movies DROP date</p><p><strong>DEFAULT VALUE:<br></strong>Replace empty or unknown values with a default/value of your choosing.</p><p>To set a default for an attribute that’s already created:<br>ALTER TABLE relation ALTER COLUMN attribute data type SET DEFAULT value; <br>ex: ALTER TABLE movies ALTER COLUMN year INT SET DEFAULT 2024</p><p>To set a default for a new attribute:<br>ALTER TABLE relation ADD attribute data type DEFAULT value; <br>ex: ALTER TABLE movies ADD date DATE DEFAULT ‘2024–01–10’</p><p><strong>SET KEYS:<br></strong>To set the keys for a relation, use either PRIMARY KEY or UNIQUE.</p><p>PRIMARY KEY and UNIQUE are pretty much the same thing except when using PRIMARY KEY, none of the values can be NULL.</p><p>ex: CREATE TABLE Movies (<br> title CHAR(100) PRIMARY KEY,<br> year INT, <br> genre VARCHAR(10)<br>) ;</p><p>ex: CREATE TABLE Movies (<br> title CHAR(100) ,<br> year INT , <br> genre VARCHAR(10),<br> PRIMARY KEY(title,year)<br>) ;</p><h3>Relational Algebra</h3><p>Relational algebra allows you to query data and manipulate it allowing you to create new relations. It’s useful because it’s less powerful compared to programming languages like C or Java making it easy to use and highly optimized. Algebra is a mix of variables and operators that create an expression. In relational algebra, variables are substitute for relations and constants are finite relations.</p><p><strong>SET OPERATIONS:<br></strong>If there are two arbitrary sets, R &amp; S, then…<br>- Union between R &amp; S is a set with elements in R or S and elements only appear once (if they show up in both)<br>- Intersection between R &amp; S is a set with elements that are both in R and S<br>- Difference between R &amp; S, such as R — S, is a set with elements that has elements from R but no elements from S. The opposite is true if it’s S — R.</p><p>In order to be able to do set operations both R &amp; S must have the same structure in terms of attributes, data type, and order of attributes.<br>If corresponding attributes are the same but have different names, you can rename to meet the criteria.</p><p><strong>PROJECTION &amp; SELECTION:<br></strong>Projection operator creates a new relation from a relation that&#39;s already made and is a subset of the relation’s attributes. If you had a relation, movies(title,year,genre,rating), a projection could be just genre, where its a set (meaning no duplicates) of the genre column or it could be just title and year.</p><p>Selection operator creates a new relation from a relation that’s already made and is a subset of the relations tuples, where the tuples meet a condition. For example, if you had a relation of all movies, but wanted all movies from a certain year, you’d use selection operator.</p><p><strong>CARTESIAN PRODUCT:<br></strong>A set formed by taking set R and set S, and the first element of R is used followed by the first element of S, and then second element of S, and so on. Then taking second element of R, and first element of S, and so on. It’s essentially a union of the tuples of two sets. If there are attributes in common, you need to create new attributes with different names, like R.B and S.B. <br>Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*DWCWxzoiFf8u_bBEOfHIhg.png" /></figure><p><strong>THETA AND NATURAL JOINS:<br></strong>Natural join is first putting all the attributes from R &amp; S together, they should have an attribute in common. Then on that common attribute if they share common values, you’re able to pair the tuples from set R and set S.</p><p>Theta join is first doing the cross product of set R &amp; S, then selecting the tuples that meet a condition.</p><p><strong>RENAMING &amp; ADDITIONAL INFORMATION:<br></strong>It’s usually convenient to rename attributes to make operations easier and/or making the relation easier to understand.</p><p>The previous operations mentioned can be used with each other to form queries, and you can have the same query with different combinations of operations such as the intersection of R &amp; S is the same as R — (R-S).</p><p><strong>CONSTRAINTS:<br></strong>Constraints can be used in various ways, such as keys mentioned previously, or asserting that the values in one relation shows up in another relation or domain contraints or even value constraints.<br>Example: <br>The following is to constrain the gender values to only be M or F</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*nyMSACTPAstKmMDBg-DnHw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d10a2d3f1689" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Database Management System | “A First Course In Database Systems” | Chapter 1 Key Takeaways]]></title>
            <link>https://medium.com/@ishmamf/database-management-system-a-first-course-in-database-systems-key-takeaways-124e8ffb1ad8?source=rss-82b1d9627376------2</link>
            <guid isPermaLink="false">https://medium.com/p/124e8ffb1ad8</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[database-management]]></category>
            <dc:creator><![CDATA[Ishmam Fardin]]></dc:creator>
            <pubDate>Wed, 03 Jan 2024 01:45:29 GMT</pubDate>
            <atom:updated>2024-01-03T01:46:58.817Z</atom:updated>
            <content:encoded><![CDATA[<p>Throughout the month, I’ll be reading an introduction to database book called “A First Course In Database Systems” by Ullman et al and highlighting key takeaways from what I’ve read.</p><p>Through this journey, I hope to not only make sure I fully grasp what I’m reading by teaching/sharing it with the world (aka just the internet), but also hope my insights bring more clarity or knowledge about databases to whoever reads my posts!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DvXM_pN7tGmgsVlYHxLLXA.png" /></figure><h3>Database Management System</h3><p>For starters, a database is a collection of information that is stored and persists for a period of time.</p><p>A database management system (DBMS) enable the creation, querying, modification, and administration of databases. Additionally, also allows for setting a schema (structure/rules), storing large amounts of data over a long period, effectively recovering data, and controlling access.</p><p>The earliest forms of commercial DBMS was the file system. Although it supported some functionalities of what makes a DBMS like creation of databases allowing for storage of substantial quantities of information, it was difficult to query complex processes and manage control access, and it had no recovery unless you backed up data.</p><p>Many early DBMS faced similar limitations, primarily with querying. Which changed with the introduction of the relational model and SQL.</p><p>As companies and projects begin to grow, so does their data and data management. Large organizations tend to have many different database systems, with some being legacy databases.</p><p>To deal with the different systems, there are two approaches most companies take:</p><ul><li>Having Data warehouses which adds and stores all the data in one place giving a unified view of all the information.</li><li>Using a middleware/mediator which allows for databases to communicate/share with each other on the fly</li></ul><p>In a DBMS, an administrator uses data definition language (DDL) to set rules and structure of how data would look like, formatted, etc…</p><h4>Storage and Buffers</h4><p>Storage and Buffer managers are like a library where the vast amount of books in a room is the disk, while the librarian is the storage manager who brings relevant books to someone interested in something and places it on specific part (buffer) on a table (main memory).</p><p>Storage managers know where everything is, and it’s role is to move the files from disk to the main memory. The buffer manager’s role is to organize the space on the main memory and ensure there’s a spot for the data, you’re looking for, to go to.</p><h4>Transactions:</h4><p>A group of database operations is called a transaction which should pass the ACID test; Automaticity (if one part of the transaction fails, the whole transaction fails, and no changes are made), Consistency (in terms of rules and constraints), Isolation (one transaction does not impact another directly), and Durability (changes can never be lost).</p><p>A transaction must log every change (in the event a crash happens), provide concurrency control by having a scheduler that ensures the sub operations of multiple transactions occur in order, and deadlock resolution which is intervene and cancel transactions when no more resources are available.</p><h4>Query Processing:</h4><p>The Query Processor in a DBMS helps efficiently execute queries which comprises a Query Compiler that transforms queries into a structured series of operations through parsing (structuring text into a tree), preprocessing (transforms tree into a tree of algebraic operations), and optimization (transforms into best plan for the operations), and an Execution Engine that implements these operations while coordinating with other DBMS components.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=124e8ffb1ad8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Focus on value]]></title>
            <link>https://medium.com/@ishmamf/focus-on-value-af5ae6155c8f?source=rss-82b1d9627376------2</link>
            <guid isPermaLink="false">https://medium.com/p/af5ae6155c8f</guid>
            <dc:creator><![CDATA[Ishmam Fardin]]></dc:creator>
            <pubDate>Mon, 23 Oct 2023 02:23:03 GMT</pubDate>
            <atom:updated>2023-10-23T02:23:03.810Z</atom:updated>
            <content:encoded><![CDATA[<p>I don’t think documenting my day and logging what I accomplished or dreaded is going to help someone figure things out for themselves. My plan was to showcase the battles of me becoming the most disciplined and focused person, and then ultimately achieving my goals, to give a realistic and valuable insight into how to do the same. However, if I’m Spending 10 minutes on the entry, so that I can stay consistent, sharing what I did , aka , working on the tasks specific to me wouldn’t really be relatable to someone else. Yeah, I try to give advice, but it has my own jargon that takes up someone else’s time, without giving them anything.</p><p>It might be because I’m mixing my interest of journaling my everyday with my interest of helping people. So I’ve Decided I’m Going to do my journaling privately, and if I’ve learned something new, found something cool/insightful, gained new experiences, or lived through a challenge that I think could help someone, I’ll Share that here.</p><p>I don’t Think anyone’s Reading this right now, and they may never will. One day, though, my writing will lift someone up, give them the vision they need to get through their challenge, and/or carve a genuine smile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*miqmSACnQ1YOfM4blp_fjw@2x.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af5ae6155c8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Malicious Spam Detector, Software Design, and Music&Mental Health Project Planning]]></title>
            <link>https://medium.com/@ishmamf/malicious-spam-detector-software-design-and-music-mental-health-project-planning-18e66d7041fd?source=rss-82b1d9627376------2</link>
            <guid isPermaLink="false">https://medium.com/p/18e66d7041fd</guid>
            <dc:creator><![CDATA[Ishmam Fardin]]></dc:creator>
            <pubDate>Sun, 22 Oct 2023 03:28:22 GMT</pubDate>
            <atom:updated>2023-10-22T03:28:22.381Z</atom:updated>
            <content:encoded><![CDATA[<p>Malicious Spam Detector, Software Design, and Music&amp;Mental Health Project Planning</p><p>Today was a lot better than the past two days. I’ve been able to hold my focus for a lot longer and indulge in less time waste. It seems the times where I take in a lot of carbohydrates is when my focus drifts. Another thing I need to work on is getting adequate sleep.</p><p>5:30 am to 6:00 am I tried to stay awake, and even meditate. I knew if I fell asleep, it would be a big mistake. 6:08 am I left to go pray, came home around 6:40, and then went did 50 pushups and ran until 7:30. From 7:30 to 8, I took a colder shower and moisturized. From 8am to 12pm I was able to stay focused on completing a 1 hour tutorial on a spam classifier. It took the full 4 hours because I was researching what every function and things I didn’t understand, and experimenting with the code a little. It’s also interesting that, even though the tutorial was in Hindi, I was able to understand it. From 12 to 1, I went on my phone, watched a youtube video, prayed, and ate a piece of salmon and a veggie patty. From 1 pm to 6 pm I was working on my Software Design homework, however, I had to take a 30–40 minute nap. From 6pm to 9pm, I joined a call with my group to discuss plans for our project, where we take input about someones day, and predict the emotion of their day, and based off the emotion and the content of their day, we provide songs that are related to it.</p><p>There were times, where I had to help my family with groceries or laundry, or one rule I have is that, if I’m tired, I should go for a walk. I don’t regret any of that, so overall it’s been great. It’s interesting I was getting tired after I ate salmon and veggie patty, foods I assumed were low carb and wouldn’t impact my energy levels.</p><p>Avoiding carbs till later seems to really help with staying focused. After 9pm I was wasting time and well now here I am talking about.</p><p>Many areas I can still improve, though today, I did better than yesterday, and that’s all that matters to me right. I’ll improve everyday, even if it’s slightly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18e66d7041fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Uneventful]]></title>
            <link>https://medium.com/@ishmamf/uneventful-3bca7db49371?source=rss-82b1d9627376------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bca7db49371</guid>
            <dc:creator><![CDATA[Ishmam Fardin]]></dc:creator>
            <pubDate>Sat, 21 Oct 2023 02:33:54 GMT</pubDate>
            <atom:updated>2023-10-21T02:33:54.318Z</atom:updated>
            <content:encoded><![CDATA[<p>If I’m being honest, I don’t really want to write this blog today, and I didn’t really want to write yesterday, but this journey needs the honest, good and bad. I woke up late today, at around 10:30 am, because the day prior I stayed up wasting time. First 30 minute was reading medium articles since I needed to wait for the bathroom to free up, so I can take a shower. Took cold shower, and then did a leetcode question + some review until 12pm. From 12pm to 1pm was mentorship meeting with Google SWE, 1pm to 2pm was friday prayer. Then 2pm to 6pm was CUNYTechPrep work + class, where we learned more about decisions trees and random forests, and it’s implementation. Also discussed the trajectory of our project, which would be to create a machine learning application that takes in input about someones day, classify whether it was happy or sad, and then suggest a song that had lyrics similar to it. It could be a happy or sad song, based on the user input.</p><p>After that, I helped my sister with her computer science homework and watched some programming videos, and well…. the rest of the day didn’t go as planned. It seems after 7pm ish, it becomes more difficult for me to stay focused or not waste time. Goal is to make 100% efficient use of every second, so I’ll have to do better. I’ll figure something out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bca7db49371" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>