<?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"><channel><title><![CDATA[Computing Curiosity]]></title><description><![CDATA[A tech blog written by Sreekesh Iyer about his journey as a Software Developer and his love for tech.]]></description><link>https://blog.sreekeshiyer.com</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1686414717876/wnJ3afVHH.png</url><title>Computing Curiosity</title><link>https://blog.sreekeshiyer.com</link></image><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 03:02:48 GMT</lastBuildDate><atom:link href="https://blog.sreekeshiyer.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Simplifying Reinforcement Learning Terminologies - AWS DeepRacer Edition]]></title><description><![CDATA[If you’re new to machine learning, reinforcement learning, especially, then it’s completely okay to have a hard time understanding these fancy jargons in front of you. Here’s my attempt to simplify these while we work on a little robo-car :)
About AW...]]></description><link>https://blog.sreekeshiyer.com/simplifying-reinforcement-learning-terminologies-aws-deepracer-edition</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/simplifying-reinforcement-learning-terminologies-aws-deepracer-edition</guid><category><![CDATA[AWS]]></category><category><![CDATA[Deep Learning]]></category><category><![CDATA[AWS DeepRacer]]></category><category><![CDATA[neural networks]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Sun, 17 Nov 2024 18:30:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/6NUlOHM40w8/upload/175f449c22066f75d942564351af9a84.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you’re new to machine learning, reinforcement learning, especially, then it’s completely okay to have a hard time understanding these fancy jargons in front of you. Here’s my attempt to simplify these while we work on a little robo-car :)</p>
<h3 id="heading-about-aws-deepracer">About AWS DeepRacer</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1730495336556/afaed30f-1af3-456f-babb-3637eceb21ce.png" alt class="image--center mx-auto" /></p>
<p>A contest that is discontinued after this year, unfortunately, DeepRacer is arguably the most entertaining service available on the AWS Console today. This is the arena where you can train a virtual car to run through a racetrack, and the challenge is to complete 3 laps as quickly as possible without going off-road.</p>
<p>—</p>
<p>Before I get to the jargons, let’s first try to understand</p>
<h3 id="heading-what-is-reinforcement-learning">What is Reinforcement Learning?</h3>
<blockquote>
<p><strong>Reinforcement learning</strong> (<strong>RL</strong>) is an interdisciplinary area of <a target="_blank" href="https://en.wikipedia.org/wiki/Machine_learning">machine learning</a> <a target="_blank" href="https://en.wikipedia.org/wiki/Machine_learning">and optimal cont</a><a target="_blank" href="https://en.wikipedia.org/wiki/Optimal_control">rol</a> <a target="_blank" href="https://en.wikipedia.org/wiki/Optimal_control">concerned with</a> how an <a target="_blank" href="https://en.wikipedia.org/wiki/Intelligent_agent">intelligent agent</a> <a target="_blank" href="https://en.wikipedia.org/wiki/Intelligent_agent">should take actio</a><a target="_blank" href="https://en.wikipedia.org/wiki/Action_selection">ns</a> <a target="_blank" href="https://en.wikipedia.org/wiki/Action_selection">in a dynamic</a> environment in order to <a target="_blank" href="https://en.wikipedia.org/wiki/Reward-based_selection">maximize a reward</a> <a target="_blank" href="https://en.wikipedia.org/wiki/Reward-based_selection">signal</a> ~ Wikipedia</p>
</blockquote>
<p>While I barely made it through that sentence, let’s imagine reinforcement learning as training a dog to fetch the ball for you. Every time the doggo fetches the ball, you give the little guy some treats. You’re giving him <em>positive reinforcement</em>, or as we call it <strong>incentive</strong>, to perform that <strong>action</strong>. This is basically what we do in RL as well. We give a reward to our <em>intelligent agents</em> based on their actions to get a desired result.</p>
<p>In case of AWS DeepRacer, the agent is a car, and the desired result is for it to complete the track without going off-track, as quickly as possible. This means that our rewards need to account for the speed of the car, the nature of the track, the turns and more.</p>
<hr />
<p>Now that we have an understanding of what RL is, let’s try to understand the <em>hyperparameters</em> for our model that may have an impact on our end-results.</p>
<h3 id="heading-batch-size">Batch Size</h3>
<p>Models based on Neural Network train in iterations, meaning they update themselves after every round of learning. This hyperparameter gives you control over <strong>how much</strong> your model learns in every iteration. Keep in mind that all hyperparameters have their benefits and trade-offs. In this case, a larger batch size (say 128 over 64) would mean that the model would have a wider set of experiences to learn through, and generate a steady output, however, over iterations, it would take more memory and time.</p>
<p>In Deepracer context, the batch size can essentially decide on the exploration that your model will <em>remember</em> across various iterations of its training. Larger batch sizes can delay the convergence times but with every iteration, it’ll get your model closer to the optimal path.</p>
<h3 id="heading-entropy">Entropy</h3>
<p>I heard about this term for the first time in Chemistry, and very simply - it’s a measure of randomness. Think about <em>how much</em> you want your model to <em>explore</em> while training. The possibilities it can figure out to eventually find out an optimal result. In case of your robo-car, it can find different ways to cover a track, for example. taking fast, shorter turns, taking slow, longer turns, etc. and it eventually finds out the best option based on the incentive it gets.</p>
<p>You might want to reduce the entropy with time as the model matures, as you’d figure out it’s closer to the optimal path, you wouldn’t want it to diverge from that.</p>
<h3 id="heading-discount-factor">Discount factor</h3>
<p>A value that ranges between 0 and 1, it signifies the importance your model gives to short term gains over the long term rewards. Discounting Factor closer to 1 means that you prefer future success over immediate high rewards on that particular action on the iteration. Whereas a factor closer to 0 means that it’ll prioritise the incentives it just received. In DeepRacer, it’s critical that the car has a long-term foresight so as to ensure it doesn’t land itself is bad positions around curves or turns that can lead to crashes.</p>
<h3 id="heading-learning-rate">Learning rate</h3>
<p>This parameter basically controls how quickly your model reaches the point of convergence. However, with higher learning rates, you run the risk of overshooting, wherein you might get to an optimal path quicker and immediately diverge from it in the next iteration. The key, like most other parameters, is balance. You can adjust the learning rate based on observation of the patterns that your model creates while training. In DeepRacer, this can potentially define how quickly your model is able to adapt to changes, eg. sharp turns after a straight road, where your car is initially intending to run at full speed, but then has to slow down and turn 140 degrees.</p>
<h3 id="heading-number-of-epochs">Number of epochs</h3>
<p>Epoch - can be defined as a collective batch of experiences combined by various episodes in a training window. Your complete process can have many <strong>different</strong> batches, meaning the model has to move on from one set to another. The number of epochs signifies the amount of time your model spends on one such set. This can essentially refine how your model thinks over a certain set of experiences. Longer epochs naturally mean longer training times and compute usage.</p>
<hr />
<p>Hope this was a good read to cover various Deep Learning jargons and simplify your experience working with neural networks going forward. Thank you for reading:)</p>
]]></content:encoded></item><item><title><![CDATA[Setting up a REST API in Python for DynamoDB]]></title><description><![CDATA[Dynamo DB is AWS's NoSQL offering in the vast set of managed databases as a service that they provide. Like most other services, it's fully serverless, flexible and easy to scale.
The Data Model
As we're working on NoSQL here, there's no real restric...]]></description><link>https://blog.sreekeshiyer.com/setting-up-a-rest-api-in-python-for-dynamodb</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/setting-up-a-rest-api-in-python-for-dynamodb</guid><category><![CDATA[AWS]]></category><category><![CDATA[DynamoDB]]></category><category><![CDATA[Python]]></category><category><![CDATA[Python 3]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Thu, 07 Nov 2024 18:30:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1731150423297/e2dab0e7-ed22-435f-ba3f-920ccc984b80.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Dynamo DB is AWS's NoSQL offering in the vast set of managed databases as a service that they provide. Like most other services, it's fully serverless, flexible and easy to scale.</p>
<h2 id="heading-the-data-model">The Data Model</h2>
<p>As we're working on NoSQL here, there's no real restriction on the structure of data. We can operate with key-value pairs as the <em>attributes</em> for each <em>item</em> in a <em>table.</em> Let's look at these keywords again.</p>
<p><strong>Table</strong> - a fairly familiar term, it is essentially a collection of data, in this case, items. It is also the starting point of working with DynamoDB on the console.</p>
<p><strong>Item</strong> - an entry in a table. You could consider it a row in an SQL-equivalent database.</p>
<p><strong>Attribute</strong> - The datapoints that constitute an item. It could contain item-specific attributes, metadata, or virtually anything that can be associated with an item.</p>
<p>You could think of a JSON array as an equivalent to a table in DynamoDB. I'm sure things will get clearer as we create our own table.</p>
<h2 id="heading-setting-up-the-database">Setting up the database</h2>
<p>It's literally a piece of cake to create a new table in DynamoDB from the AWS Console. All you need is a name and a partition key, which is your primary key in this case. This will help you search for items in the table.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1719072967833/c23d8b95-7deb-442f-a2fb-302f830bf993.png" alt class="image--center mx-auto" /></p>
<p>I'm creating a table for all the games that I've played, and I will rate them out of 10 :)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1719070755595/db934c7e-2d51-4d5e-b8a6-809b1218d2ce.png" alt class="image--center mx-auto" /></p>
<p>You can mess with the table directly from the console, let's try adding a new item to see what it looks like.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1719073089193/2f626abb-e98d-4475-9064-c909440f1fec.png" alt class="image--center mx-auto" /></p>
<p>My first entry has to be my favourite RPG (role-playing) game - The Witcher 3. I will add a new attribute for <em>rating</em> and it's going to be a solid 9.8 from me :)</p>
<h2 id="heading-setting-up-an-api">Setting up an API</h2>
<p>Right, it's now time to write some Python code to do all of this without the GUI ;)</p>
<pre><code class="lang-python"><span class="hljs-comment">## app.py</span>
<span class="hljs-keyword">from</span> flask <span class="hljs-keyword">import</span> Flask, jsonify, request
<span class="hljs-keyword">import</span> boto3
<span class="hljs-keyword">from</span> boto3.dynamodb.conditions <span class="hljs-keyword">import</span> Key
<span class="hljs-keyword">import</span> uuid  <span class="hljs-comment"># Import uuid module for generating UUIDs</span>

app = Flask(__name__)

<span class="hljs-comment"># Initialize DynamoDB client</span>
dynamodb = boto3.resource(<span class="hljs-string">'dynamodb'</span>, region_name=<span class="hljs-string">'ap-south-1'</span>)  <span class="hljs-comment"># Replace with your region</span>
<span class="hljs-comment">## Do keep in mind to save your AWS credentials file in the root directory</span>
table = dynamodb.Table(<span class="hljs-string">'games'</span>)  <span class="hljs-comment"># Replace with your table name</span>

<span class="hljs-comment"># Route to get all games</span>
<span class="hljs-meta">@app.route('/games', methods=['GET'])</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">get_games</span>():</span>
    <span class="hljs-keyword">try</span>:
        response = table.scan()
        games = response.get(<span class="hljs-string">'Items'</span>, [])
        <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">'games'</span>: games}), <span class="hljs-number">200</span>
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">'error'</span>: str(e)}), <span class="hljs-number">500</span>

<span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">'__main__'</span>:
    app.run(debug=<span class="hljs-literal">True</span>)
</code></pre>
<p>The beauty of Python is that you can setup a full-fledged API in just a few lines of code. This chunk of code is now sufficient for us to access the table and fetch the data from it. We use the <code>scan</code> function to fetch items from the games table.</p>
<p>You can start the app by using <code>python3 app.py</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1719077540268/88d678a8-5732-4aa2-8b62-621591f86527.png" alt class="image--center mx-auto" /></p>
<p>And you can expect a response that looks like this when you curl for the <code>/games</code> endpoint.</p>
<h3 id="heading-routes-for-creating-and-updating-an-entry">Routes for creating and updating an entry</h3>
<pre><code class="lang-python"><span class="hljs-comment"># Route to create a new game</span>
<span class="hljs-meta">@app.route('/games', methods=['POST'])</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">create_game</span>():</span>
    <span class="hljs-keyword">try</span>:
        game_data = request.get_json()
        name = game_data.get(<span class="hljs-string">'name'</span>)
        rating = game_data.get(<span class="hljs-string">'rating'</span>)
        hours = game_data.get(<span class="hljs-string">'hours'</span>, <span class="hljs-number">0</span>)

        <span class="hljs-comment"># Generate a random UUID for the new game</span>
        id = str(uuid.uuid4())

        <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> name <span class="hljs-keyword">or</span> <span class="hljs-keyword">not</span> rating:
            <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">'error'</span>: <span class="hljs-string">'Missing required fields'</span>}), <span class="hljs-number">400</span>

        <span class="hljs-comment"># Store the game in DynamoDB</span>
        table.put_item(Item={<span class="hljs-string">'id'</span>: id, <span class="hljs-string">'name'</span>: name, <span class="hljs-string">'rating'</span>: rating, <span class="hljs-string">'hours'</span>: hours})

        <span class="hljs-comment"># Return the created game with the generated UUID</span>
        created_game = {<span class="hljs-string">'id'</span>: id, <span class="hljs-string">'name'</span>: name, <span class="hljs-string">'rating'</span>: rating}
        <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">'message'</span>: <span class="hljs-string">'Game added successfully'</span>, <span class="hljs-string">'game'</span>: created_game}), <span class="hljs-number">201</span>
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">'error'</span>: str(e)}), <span class="hljs-number">500</span>

<span class="hljs-comment"># Route to update an existing game</span>
<span class="hljs-meta">@app.route('/games/&lt;int:id&gt;', methods=['PUT'])</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">update_game</span>(<span class="hljs-params">id</span>):</span>
    <span class="hljs-keyword">try</span>:
        game_data = request.get_json()
        name = game_data.get(<span class="hljs-string">'name'</span>)
        rating = game_data.get(<span class="hljs-string">'rating'</span>)
        hours = game_data.get(<span class="hljs-string">'hours'</span>, <span class="hljs-number">0</span>)

        <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> name <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> rating:
            <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">'error'</span>: <span class="hljs-string">'Nothing to update'</span>}), <span class="hljs-number">400</span>

        update_expression = <span class="hljs-string">'SET '</span>
        expression_attribute_values = {}

        <span class="hljs-keyword">if</span> name:
            update_expression += <span class="hljs-string">' #n = :n,'</span>
            expression_attribute_values[<span class="hljs-string">':n'</span>] = name
        <span class="hljs-keyword">if</span> rating:
            update_expression += <span class="hljs-string">' #r = :r,'</span>
            expression_attribute_values[<span class="hljs-string">':r'</span>] = rating
        <span class="hljs-keyword">if</span> hours:
            update_expression += <span class="hljs-string">' #h = :h,'</span>
            expression_attribute_values[<span class="hljs-string">':h'</span>] = hours

        update_expression = update_expression[:<span class="hljs-number">-1</span>]  <span class="hljs-comment"># remove trailing comma</span>
        response = table.update_item(
            Key={<span class="hljs-string">'id'</span>: id},
            UpdateExpression=update_expression,
            ExpressionAttributeNames={<span class="hljs-string">'#n'</span>: <span class="hljs-string">'name'</span>, <span class="hljs-string">'#r'</span>: <span class="hljs-string">'rating'</span>, <span class="hljs-string">'#h'</span>: <span class="hljs-string">'hours'</span>},
            ExpressionAttributeValues=expression_attribute_values,
            ReturnValues=<span class="hljs-string">'UPDATED_NEW'</span>
        )
        updated_game = response.get(<span class="hljs-string">'Attributes'</span>, {})
        <span class="hljs-keyword">return</span> jsonify(updated_game), <span class="hljs-number">200</span>
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">'error'</span>: str(e)}), <span class="hljs-number">500</span>
</code></pre>
<p>Here, we are using <code>put_item</code> to add an item to the table. For updating a record, we use the function <code>update_item</code>.</p>
<p>If you observe carefully, we are using <strong><em>UpdateExpression</em></strong> where we specify the attributes that we're updating. This allows us to control exactly which attribute gets changed and avoid accidental overwrites.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1719078765444/795f6010-3c5c-42a4-b872-f7353e17b6ab.png" alt class="image--center mx-auto" /></p>
<p>And to delete the record, you can go with something like this -</p>
<pre><code class="lang-python">response = table.delete_item(
    Key={<span class="hljs-string">'id'</span>: id},
    ReturnValues=<span class="hljs-string">'ALL_OLD'</span>  <span class="hljs-comment"># Optional: returns the item that was deleted</span>
)
</code></pre>
<hr />
<p>Well, there you have it, you just setup a REST API with CRUD Functionality for DynamoDB in a matter of minutes thanks to Python.</p>
]]></content:encoded></item><item><title><![CDATA[Integrated AWS Workflows with SageMaker Notebooks]]></title><description><![CDATA[I was recently a part of a hackathon and was found searching for good Jupyter environments on the cloud to be able to work on my ML Project.

Soon enough, I found myself here. However, it took me a while to figure out how powerful it truly can be.

F...]]></description><link>https://blog.sreekeshiyer.com/integrated-aws-workflows-with-sagemaker-notebooks</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/integrated-aws-workflows-with-sagemaker-notebooks</guid><category><![CDATA[AWS]]></category><category><![CDATA[sagemaker ]]></category><category><![CDATA[Jupyter Notebook ]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Sun, 03 Nov 2024 18:30:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1730493615632/dc9ed4e3-c615-4a2b-88c8-b72df70b3619.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I was recently a part of a hackathon and was found searching for good Jupyter environments on the cloud to be able to work on my ML Project.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1730020098556/d772deda-8ced-46d9-ae6e-03983cd986e8.png" alt class="image--center mx-auto" /></p>
<p>Soon enough, I found myself here. However, it took me a while to figure out how powerful it truly can be.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1730021313022/c8e34819-fee1-4739-9e5d-d2979d7a351d.png" alt class="image--center mx-auto" /></p>
<p>For starters, I was able to hook it up to any Repository within seconds. So I did not have to worry about versioning or sharing it with teammates.</p>
<h3 id="heading-direct-access-to-gpu-instances">Direct access to GPU instances</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1730022633938/b5b63774-aa62-4688-ba04-e7fbb9da91fa.png" alt class="image--center mx-auto" /></p>
<p>You’ll need to get an additional approval to make use of the ml.g-series of instances in SageMaker Notebooks, but it didn’t take longer than a minute for me. And just like that, I have access to a Jupyter notebook with TensorFlow and a GPU.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1730042159754/39f221f4-ded0-40fc-b217-a9ec743f1b69.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-integrations-with-other-aws-services">Integrations with other AWS Services</h3>
<p>This is not a Sagemaker feature as much as it is an AWS IAM feature, but when you get hold of the IAM Role that is being used by the Sagemaker Notebook, you can basically open up your Python shell to have access to literally any AWS service via client libraries like boto3.</p>
<p>You can control EC2 instances, invoke Lambda functions, send emails via SES, perform operations on S3 objects and so many other things programmatically through the same Jupyter notebook.</p>
<p>—</p>
<p>So far, it’s been fun watching folks work on Sagemaker Notebooks trying out different ways to automate workflows on AWS using raw Python. Looks like I’ve found my new provider for easy-access Cloud Notebooks.</p>
]]></content:encoded></item><item><title><![CDATA[How AWS Cloud9 has become my side project buddy]]></title><description><![CDATA[I spend 5 days out of a week coding for work, so I'm definitely not motivated to code a lot on weekends. This means that I do not have any software development tools installed on my personal machine. Not even IDEs.
However, being the curious little g...]]></description><link>https://blog.sreekeshiyer.com/how-aws-cloud9-has-become-my-side-project-buddy</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/how-aws-cloud9-has-become-my-side-project-buddy</guid><category><![CDATA[AWS]]></category><category><![CDATA[Cloud]]></category><category><![CDATA[IDEs]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Fri, 31 May 2024 06:30:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1716727001836/043feaaf-45bd-4459-b3e0-36bd3ad37251.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I spend 5 days out of a week coding for work, so I'm definitely not motivated to code a lot on weekends. This means that I do not have any software development tools installed on my personal machine. Not even IDEs.</p>
<p>However, being the curious little geek that I am, I often have the little urge to hop into VSCode and start coding again, whether it's for a mini project, trying out some new tech, preparing for a new article or a talk.</p>
<p>Since my laptop is more used to Netflix than Python now, I don't really feel like installing any dev-tools locally. Here's when Cloud9 comes to my rescue. And here's a few reason why I LOVE IT.</p>
<h2 id="heading-super-easy-to-setup">Super Easy to Setup</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1716704007801/d22c52bc-3f57-40f4-b9f6-81d174614bd0.png" alt class="image--center mx-auto" /></p>
<p>This isn't even a debate. All it takes is a single click after you fill in a couple of boxes; and you're up and running.</p>
<h2 id="heading-gives-you-complete-access">Gives you complete Access</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1716705827202/57db7bd4-53de-4c73-ada3-51ede7c4b9c3.png" alt class="image--center mx-auto" /></p>
<p>I've used online coding platforms for web-development and Jupyter environments and I've been restricted from using admin commands in the shell and install anything new.</p>
<p>Not with Cloud9 though. It's almost complete control of the environment where I can install whichever packages I want and make use of them.</p>
<h2 id="heading-integrated-with-code-whisperer">Integrated with Code Whisperer</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1716705642159/d7bd8831-1df3-45a1-a139-f43d2242ad61.png" alt class="image--center mx-auto" /></p>
<p>This is definitely a great add-on if any Gen-AI code assistant is already a part of your local IDE. I don't use it as extensively but it's a handy tool to have. The results that CodeWhisperer shares are generally very accurate and easy to work with.</p>
<h2 id="heading-environment-sharing">Environment Sharing</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1716704442699/a205dc76-60c0-4524-9ef9-158161ff9e35.png" alt class="image--center mx-auto" /></p>
<p>Much like how LiveShare works in VSCode, you can share the entire setup with your teammates or friends just by creating an IAM User for them.</p>
<hr />
<p>Do you folks use online code editors or IDEs? Let me know your thoughts on Cloud 9 :)</p>
]]></content:encoded></item><item><title><![CDATA[The Linux Backdoor Saga]]></title><description><![CDATA[Almost a week to this and not a lot of drama on Indian Twitter, so I thought I could write about it.
TLDR: Malicious code with a backdoor was added to one of the core packages of Linux affecting almost all Debian and Redhat distros; was later discove...]]></description><link>https://blog.sreekeshiyer.com/the-linux-backdoor-saga</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/the-linux-backdoor-saga</guid><category><![CDATA[Linux]]></category><category><![CDATA[#cybersecurity]]></category><category><![CDATA[Security]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Wed, 03 Apr 2024 15:01:07 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/zvHhKiVuR9M/upload/6550f1be7a6f04c116000b9341acdf36.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Almost a week to this and not a lot of drama on Indian Twitter, so I thought I could write about it.</p>
<p>TLDR: Malicious code with a backdoor was added to one of the core packages of Linux affecting almost all Debian and Redhat distros; was later discovered by a developer at Microsoft because of a 500ms delay in ssh response.</p>
<h2 id="heading-how-did-we-get-here">How did we get here?</h2>
<p>The two latest releases (as of March 9th 2024) on the <em>xz</em> package apparently contained this malicious code. This code wasn't directly visible on the repo, but was disguised as a part of the tests which in turn modify the function in the liblzma library that uses the xz package. You would get this code upon downloading the specific release tarballs.</p>
<p>This was committed by user JiaT75 on GitHub (also known as Jia Tan; real identities, obviously unknown), who has been a regular maintainer on this project for about 2 years. I'm pretty sure there's way more into this story of how well-crafted this was and what the potential motive behind it could be; but that's not for this article.</p>
<h2 id="heading-how-was-this-found">How was this found?</h2>
<p><img src="https://duet-cdn.vox-cdn.com/thumbor/0x0:596x370/2400x1490/filters:focal(298x185:299x186):format(webp)/cdn.vox-cdn.com/uploads/chorus_asset/file/25364589/Screenshot_2024_03_31_at_2.03.45_PM.png" alt="A screenshot of Andres Freund’s post detailing what led him to investigate." /></p>
<p>Andres Freund, a developer at Microsoft, who is also a maintainer at Postgres thought something was suspicious when he observed a <em>~500ms</em> delay in his ssh login process (refer to the image below). He was able to analyse further and remember facing similar issues with valgrind in the past with Postgres testing (absolute legend).</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1712155821930/d7f2c14a-f65d-4594-a8b9-0aa44488721d.png" alt="SSH logs that highlight the SSH delays before and after the malicious change. " class="image--center mx-auto" /></p>
<blockquote>
<p>I've read a lot about this and I still do not know how liblzma and sshd are related. From what I've understood, sshd internally uses liblzma in some Debian distros (long story short).</p>
</blockquote>
<p>I do not know how someone could get to such conclusions with very little detail, gotta respect what Andres has done here. If you want to read more about his analysis, it's available here on <a target="_blank" href="https://www.openwall.com/lists/oss-security/2024/03/29/4">OpenWall</a>. Worth the read even though I didn't understand more than 5% of it 🤣</p>
<h2 id="heading-whats-the-current-update">What's the current update?</h2>
<p>All major distros that had this xz version in their beta releases have been safely reverted, as confirmed by Debian, Fedora and Arch as of March 29th. From what I read, no stable versions of any distros were affected.</p>
<hr />
<p>It's fascinating how little we know about the open source software that we use everyday. Things could've gone south very quickly if not for this discovery from Andres. The maintainers were also proactive on getting changes reverted to safety. Stories like these make us realise how little we know; and as tech enthusiasts, I believe it only makes us curious to keep learning.</p>
]]></content:encoded></item><item><title><![CDATA[My experience with the AWS Community 'New Voices' Program]]></title><description><![CDATA[Hi folks!
The New Year is just around the corner and that means that the applications for the AWS Community Builder Program are soon going to open up!
As a Community Builder this year, I'd like to take you through some of my best experiences - becomi...]]></description><link>https://blog.sreekeshiyer.com/aws-community-new-voices</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/aws-community-new-voices</guid><category><![CDATA[AWS]]></category><category><![CDATA[Public Speaking]]></category><category><![CDATA[AWS Community Builder]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Tue, 26 Dec 2023 12:35:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1703587222781/d76bec69-a368-400e-b1dc-76017ebd2e7a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hi folks!</p>
<p>The New Year is just around the corner and that means that the applications for the <a target="_blank" href="https://aws.amazon.com/developer/community/community-builders/">AWS Community Builder Program</a> are soon going to open up!</p>
<p>As a Community Builder this year, I'd like to take you through some of my best experiences - becoming a part of the AWS New Voices Cohort.</p>
<h2 id="heading-about-aws-new-voices">About AWS New Voices</h2>
<p>The New Voices Program is a very new, building idea of gathering potential speakers from the pool of AWS Community Builders and honing their speaking skills under the guidance of experienced speakers from the community who chip in as coaches.</p>
<h2 id="heading-the-overall-setup">The Overall Setup</h2>
<p>Set up in July 2023, we had a total of 4 sessions (once in a week) in which we had to prepare a small talk of 3-4 minutes where we described how we solved a problem using technology (not necessarily related to AWS)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1703593203972/68cfeea0-ad10-4438-b352-f60c8b6e0200.jpeg" alt class="image--center mx-auto" /></p>
<p>Every new session, a different twist was added to the same topic of discussion to bring in the quality of range to our speaking skills.</p>
<p>Barring the last session, there were no slides. It was all about talking to your audience for a certain period of time, describing how you solved a problem</p>
<p>At the end of the talk, the host along with the Coaches give you actionable feedback that you can work on before you join the next session.</p>
<h2 id="heading-the-power-of-acknowledgement">The Power of Acknowledgement</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1703593691034/acbe1bba-e51c-439a-82c6-62e4bb134447.jpeg" alt class="image--center mx-auto" /></p>
<p>As someone who comes with a history of sheer social anxiety and nervousness on the stage, to be able to stand in front of a crowd and speak today is a blessing.</p>
<p>But it's also still very scary. And definitely not easy for everyone. What helps is the acknowledgement of people listening to you, people telling you that you did a good job and they liked your talk.</p>
<p>This is exactly what I got from this program. At the end of the talk, the host appreciates your effort, talks about the stand-out points in your talk. All the speakers appreciate your work and mention the key highlights where you did well. Everybody <em>jazz hands</em> at you <em>(refer to the cover image)</em> acknowledging the solid work that you did.</p>
<hr />
<p>I'm not sure about the future of the program, how it's going to be structured in 2024, but I'm exited and super happy to be an AWS New Voices <strong>Graduate</strong>. Looking forward to more Community Builders joining in Q1 becoming a part of this program as well :)</p>
<p>Thanks for reading, Happy Holidays!</p>
]]></content:encoded></item><item><title><![CDATA[Getting started with Polars - A Pandas Alternative?]]></title><description><![CDATA[The first thing that you tend to learn when you start with Data Science in Python is the pandas module, which covers literally any kind of data manipulation, transformation and processing for tabular datasets. As a module, it has developed itself ins...]]></description><link>https://blog.sreekeshiyer.com/getting-started-with-polars</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/getting-started-with-polars</guid><category><![CDATA[Polars]]></category><category><![CDATA[Data Science]]></category><category><![CDATA[Python]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Sun, 12 Nov 2023 07:24:08 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/C9Ay328wHgA/upload/167bb5ad77052aa35de505e0d7dfcc41.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The first thing that you tend to learn when you start with Data Science in Python is the <em>pandas</em> module, which covers literally any kind of data manipulation, transformation and processing for tabular datasets. As a module, it has developed itself insanely over the years to the utility that it is today for a data scientist.</p>
<p>Having said that, we haven't had many contenders for Pandas for quite some time at least in the general space. We do have tools with specific use cases, like Spark for Big Data, for example.</p>
<p>With the increase in data volume, people have been hamstrung by the processing time delays with Pandas. Here's where Polars comes in.</p>
<h2 id="heading-what-is-polars">What is Polars?</h2>
<p><img src="https://images.unsplash.com/photo-1433769614376-f7231cd16a55?q=80&amp;w=1000&amp;auto=format&amp;fit=crop&amp;ixlib=rb-4.0.3&amp;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" alt="white bear on black rocks during daytime; image from unsplash" /></p>
<p>Polars, on its website calls itself a "<em>Lightning-fast DataFrame library for Rust and Python</em>". Given the amount of popularity Rust had gained recently, I started noticing a lot more references to Polars lately. Without getting too technical, I'll sum up Polars by saying that it's super fast because it's written in Rust, supports lazy evaluation and can leverage multithreading capabilities of a system if available.</p>
<p>There is enough evidence out there proving how much faster it as compared to Pandas, but in this article, let's just try to explore Polars as just another DataFrame library in Python.</p>
<h2 id="heading-hop-in-to-jupyter">Hop In to Jupyter</h2>
<p>It's time to warm your hands, grab that cup of coffee and open up your favourite Jupyter environment. I've setup a Jupyter server on Napptive to play around.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699722429367/a67b579e-80f7-4756-9108-cb86f258a680.png" alt="Screenshot - Installing Polars in a Jupyter env" class="image--center mx-auto" /></p>
<p>We can start by installing the polars library in our environment.</p>
<h2 id="heading-loading-the-dataset">Loading the Dataset</h2>
<p>We'll start by loading a simple car-sales dataset.</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> polars <span class="hljs-keyword">as</span> pl
df = pl.read_csv(<span class="hljs-string">"car-sales.csv"</span>)
df.head()
</code></pre>
<p>Very similar to what we do in pandas, we use the <code>read_csv</code> method; and we see the first five rows printed out when we use <code>df.head()</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699770414161/93732660-2a7d-46ec-b25f-452a8bdbfb69.png" alt class="image--center mx-auto" /></p>
<p>Next up, if we want a quick statistical summary of the dataset, we can use <code>df.describe()</code> to take a look.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699771905085/53837951-28b0-4582-a9b1-c9cb19934a1e.png" alt class="image--center mx-auto" /></p>
<p>This is obviously only useful for numerical columns.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699772050715/d95b8f1f-9905-4c03-ab00-414e328d51ab.png" alt class="image--center mx-auto" /></p>
<p>This has been almost identical to pandas so far, but if I want to take a look at all the columns in the dataset, we use <code>df.columns</code></p>
<h2 id="heading-data-manipulation-and-filtering">Data Manipulation and Filtering</h2>
<p>Now that we're a little comfortable, we can start getting our hands a little dirty and start working on a few operations and filters with the dataset.</p>
<pre><code class="lang-python"><span class="hljs-comment"># For starters, let's apply a filter to our dataset. </span>
<span class="hljs-comment"># I want to separately take a look at all Honda cars in our dataset.</span>
<span class="hljs-comment"># How would we do that?</span>

honda_cars= df.filter(pl.col(<span class="hljs-string">"Make"</span>) == <span class="hljs-string">'Honda'</span> )
honda_cars.head()
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699772312798/fa2213ef-a54e-48ab-844f-695d5ce6c4a2.png" alt class="image--center mx-auto" /></p>
<p>Now let's say I'm a little low on budget, I want to take a look at cars that cost 5000$ or less. But for this, I'll have to change that price column a bit, because it's currently a string.</p>
<p>Let's first transform the <em>Price</em> column to a float value. We'll need to take out the $ sign and the commas.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Remove the dollar sign and the comma from the Price column</span>
df = df.with_columns(
    pl.col(<span class="hljs-string">"Price"</span>).str.replace(<span class="hljs-string">"\$"</span>, <span class="hljs-string">""</span>).str.replace(<span class="hljs-string">","</span>, <span class="hljs-string">""</span>).cast(pl.Float64),
)
df.head()
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699772574129/13879d14-9327-4f67-a8ee-d250e3773693.png" alt class="image--center mx-auto" /></p>
<p>Now that we have the Prices sorted out, we can apply a filter to show only cost 5000$ or less.</p>
<p>Let's apply this filter.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Just like we did for Honda, let's apply another filter, </span>
<span class="hljs-comment"># this time to see only those cars priced 5000$ or less</span>

budget_cars = df.filter(pl.col(<span class="hljs-string">"Price"</span>) &lt;= <span class="hljs-number">5000.0</span>)
budget_cars
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699772663026/4ab428ca-5c3b-4489-97a5-6a8c16c636c6.png" alt class="image--center mx-auto" /></p>
<p>And we get exactly what we wanted.</p>
<p>Now let's pretend like I'm a car geek and I'm very curious about those Odometer values across car manufacturers. I'd want to take a look at the average Odometer values and their average prices across car manufacturing brands.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Here's where things get a little different from pandas</span>
<span class="hljs-comment"># Let's write a query to group this data by the car's make, </span>
<span class="hljs-comment"># and see their average Odometer values and price.</span>
q = (
    df.lazy()
    .group_by(<span class="hljs-string">"Make"</span>)
    .agg(
        pl.mean(<span class="hljs-string">"Odometer (KM)"</span>).alias(<span class="hljs-string">"Average Odometer Reading"</span>),
        pl.mean(<span class="hljs-string">"Price"</span>).alias(<span class="hljs-string">"Average Price"</span>)
    )
    )
q.collect()
</code></pre>
<p>Now we see a lot of things going here. The first thing we do is call the <code>lazy</code> function; to trigger lazy evaluations for the query, as we discussed as one of the very popular features of Polars.</p>
<p>We're grouping the table by the <em>Make</em> column; and then we use the <code>agg</code> function where we can say that we want the mean of both <em>Odometer</em> and <em>Price</em> columns.</p>
<p>We then use <code>alias</code> to give those a different column name.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699773493112/7d9d1bd7-c5ea-47cc-800f-e19469077412.png" alt class="image--center mx-auto" /></p>
<p>And look at that! We've got our result :)</p>
<hr />
<p>This was a very brief introduction to the Polars module. While I don't believe it's a direct replacement for Pandas yet (long way to go), it has a huge amount of potential and much like any other open source software, it's ever growing. We'll keep exploring this module as I plan to make this a series of threads for Polars.</p>
<p>Stay tuned for more, until then, peace.</p>
]]></content:encoded></item><item><title><![CDATA[Building a Llama2 Langchain powered Simple Chat Bot hosted on Napptive]]></title><description><![CDATA[Hey folks! 👋
Not so long ago, I came across a post from LangChain on the Threads App about how easy it is to create a chat assistant using Llama2.

Here's the tutorial that you can look into, thanks to Anil-matcha who shared it on GitHub.
I've been ...]]></description><link>https://blog.sreekeshiyer.com/llama2-langchain-napptive</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/llama2-langchain-napptive</guid><category><![CDATA[LLaMa]]></category><category><![CDATA[langchain]]></category><category><![CDATA[Napptive]]></category><category><![CDATA[AI]]></category><category><![CDATA[cloud native]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Sat, 12 Aug 2023 13:21:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1690962450663/78ad1565-5c8a-477a-9331-51ec378fc024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey folks! 👋</p>
<p>Not so long ago, I came across a post from LangChain on the Threads App about how easy it is to create a chat assistant using Llama2.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690733056069/b2f7f000-0dfc-4a72-bbc0-61b85ecb7bd4.jpeg" alt="A Screentshot of a langchain.ai post on the Threads App which talks about building a llama2 langchain powered chatbot in less than 20 lines of code. " class="image--center mx-auto" /></p>
<p>Here's the tutorial that you can look into, thanks to <a target="_blank" href="https://github.com/Anil-matcha">Anil-matcha</a> who shared it on <a target="_blank" href="https://github.com/Anil-matcha/langchain-tutorials">GitHub</a>.</p>
<p>I've been fascinated by how difficult it generally is to physically host an LLM, but first, let's create an app.</p>
<h2 id="heading-creating-a-working-environment-on-napptive">Creating a working environment on Napptive</h2>
<p>I sneaked into the documentation a bit and found out that the model can work just on the CPU, but it does better if you also have a GPU.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690953990336/a16e57e4-da96-4148-a447-e8c45c9d1c4f.png" alt="Screenshot of the Jupyter image on the Napptive catalog" class="image--center mx-auto" /></p>
<p>Since this is all <em>Python</em>, we can create the app on a Jupyter environment as well. The easiest way to create a Jupyter environment on the cloud is by using Napptive.</p>
<p>To learn more about Napptive and an extensive guide on hosting your Jupyter Lab on Napptive, here's <a target="_blank" href="https://questit-editorial.hashnode.dev/hosting-jupyter-napptive">one of my old articles</a> you can refer to.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690954427781/b0504296-9068-49e5-8b3a-2f73cfd275f3.png" alt="Screenshot of the napptive/jupyter config file highlighting the code that you need to expose a new port." class="image--center mx-auto" /></p>
<p>Before you deploy the app though, you'll have to make a couple of changes to the config YAML file. Firstly, expose the port <code>8501</code> for streamlit and create a <code>napptive-ingress</code> trait for it. This is because we'll be using Streamlit for the app UI.</p>
<p>Once that's done, you can deploy the app.</p>
<h2 id="heading-building-the-app">Building the App</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690957598555/efd75a73-9840-4cdd-a9fe-2663a9a248ef.png" alt="Jupyter Notebook Launcher Screenshot" class="image--center mx-auto" /></p>
<p>Once you get into the Jupyter environment, create a new terminal, we have a few things to set up before we get going.</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Install langchain, the llama module and streamlit</span>
pip install langchain llama-cpp-python streamlit
<span class="hljs-comment"># Download Llama2 model from hugging-face</span>
wget https://huggingface.co/TheBloke/Llama-2-13B-chat-GGML/resolve/main/llama-2-13b-chat.ggmlv3.q4_0.bin

mkdir .streamlit
nano .streamlit/config.toml
<span class="hljs-comment">## Add this to the config</span>
[theme]
primaryColor=<span class="hljs-string">"#F63366"</span>
backgroundColor=<span class="hljs-string">"#111827"</span>
secondaryBackgroundColor=<span class="hljs-string">"#6B7280"</span>
textColor=<span class="hljs-string">"#FFFFFF"</span>
font=<span class="hljs-string">"sans serif"</span>
<span class="hljs-comment">## Ctrl + S to save the file, Ctrl + X to exit</span>
</code></pre>
<p>The UI for this is inspired by the Streamlit ChatBot tutorial which you can find <a target="_blank" href="https://blog.streamlit.io/how-to-build-an-llm-powered-chatbot-with-streamlit/">here</a>.</p>
<p>Once the config is setup, create a new file <code>app.py</code></p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> streamlit <span class="hljs-keyword">as</span> st

<span class="hljs-comment"># App title</span>
st.set_page_config(page_title=<span class="hljs-string">"💬 LLama2 Langchain ChatBot"</span>)

<span class="hljs-comment"># Store LLM generated responses</span>
<span class="hljs-keyword">if</span> <span class="hljs-string">"messages"</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> st.session_state.keys():
    st.session_state.messages = [{<span class="hljs-string">"role"</span>: <span class="hljs-string">"assistant"</span>, <span class="hljs-string">"content"</span>: <span class="hljs-string">"How may I help you?"</span>}]

<span class="hljs-comment"># Display chat messages</span>
<span class="hljs-keyword">for</span> message <span class="hljs-keyword">in</span> st.session_state.messages:
    <span class="hljs-keyword">with</span> st.chat_message(message[<span class="hljs-string">"role"</span>]):
        st.write(message[<span class="hljs-string">"content"</span>])

<span class="hljs-comment"># User-provided prompt</span>
<span class="hljs-keyword">if</span> prompt := st.chat_input():
    st.session_state.messages.append({<span class="hljs-string">"role"</span>: <span class="hljs-string">"user"</span>, <span class="hljs-string">"content"</span>: prompt})
    <span class="hljs-keyword">with</span> st.chat_message(<span class="hljs-string">"user"</span>):
        st.write(prompt)
</code></pre>
<p>Initially, we'll just import streamlit, setup an array to store all chat messages in a streamlit-session and then create the UI for the chat.</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> langchain.llms <span class="hljs-keyword">import</span> LlamaCpp
<span class="hljs-keyword">from</span> langchain.callbacks.manager <span class="hljs-keyword">import</span> CallbackManager
<span class="hljs-keyword">from</span> langchain.callbacks.streaming_stdout <span class="hljs-keyword">import</span> StreamingStdOutCallbackHandler
<span class="hljs-keyword">from</span> langchain <span class="hljs-keyword">import</span> LLMChain, PromptTemplate
<span class="hljs-keyword">from</span> langchain.memory <span class="hljs-keyword">import</span> ConversationBufferWindowMemory
</code></pre>
<p>We'll import all the different classes and functions we'll use from Langchain.</p>
<pre><code class="lang-python">callback_manager = CallbackManager([StreamingStdOutCallbackHandler()])

<span class="hljs-comment"># Make sure the model path is correct for your system!</span>
llm = LlamaCpp(
    model_path=<span class="hljs-string">"./llama-2-13b-chat.ggmlv3.q4_0.bin"</span>,
    input={<span class="hljs-string">"temperature"</span>: <span class="hljs-number">0.75</span>, <span class="hljs-string">"max_length"</span>: <span class="hljs-number">2000</span>, <span class="hljs-string">"top_p"</span>: <span class="hljs-number">1</span>},
    callback_manager=callback_manager,
    verbose=<span class="hljs-literal">True</span>,
)


<span class="hljs-comment"># Function for generating LLM response</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">generate_response</span>(<span class="hljs-params">prompt_input</span>):</span>

    template = <span class="hljs-string">"""I am a Large Language Model Llama set up on Langchain.
    {history}
    Human: {human_input}
    Assistant:"""</span>

    prompt = PromptTemplate(input_variables=[<span class="hljs-string">"history"</span>, <span class="hljs-string">"human_input"</span>], template=template)

    chatbot = LLMChain(
        llm=llm,
        prompt=prompt,
        verbose=<span class="hljs-literal">True</span>,
        memory=ConversationBufferWindowMemory(k=<span class="hljs-number">2</span>),
    )
    <span class="hljs-keyword">return</span> chatbot.predict(human_input=prompt_input)


<span class="hljs-comment"># Generate a new response if last message is not from assistant</span>
<span class="hljs-keyword">if</span> st.session_state.messages[<span class="hljs-number">-1</span>][<span class="hljs-string">"role"</span>] != <span class="hljs-string">"assistant"</span>:
    <span class="hljs-keyword">with</span> st.chat_message(<span class="hljs-string">"assistant"</span>):
        <span class="hljs-keyword">with</span> st.spinner():
            response = generate_response(prompt) 
            st.write(response)

    message = {<span class="hljs-string">"role"</span>: <span class="hljs-string">"assistant"</span>, <span class="hljs-string">"content"</span>: response}
    st.session_state.messages.append(message)
</code></pre>
<p>Further, we initialize the LLM Class with the model that we downloaded, write a function that creates the chain to generate responses and lastly, the UI to showcase those responses.</p>
<p>Refer to the snippet below for the entire code from the file <code>app.py</code></p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> streamlit <span class="hljs-keyword">as</span> st
<span class="hljs-keyword">from</span> langchain.llms <span class="hljs-keyword">import</span> LlamaCpp
<span class="hljs-keyword">from</span> langchain.callbacks.manager <span class="hljs-keyword">import</span> CallbackManager
<span class="hljs-keyword">from</span> langchain.callbacks.streaming_stdout <span class="hljs-keyword">import</span> StreamingStdOutCallbackHandler
<span class="hljs-keyword">from</span> langchain <span class="hljs-keyword">import</span> LLMChain, PromptTemplate
<span class="hljs-keyword">from</span> langchain.memory <span class="hljs-keyword">import</span> ConversationBufferWindowMemory

<span class="hljs-comment"># App title</span>
st.set_page_config(page_title=<span class="hljs-string">"💬 LLama2 Langchain ChatBot"</span>)

<span class="hljs-comment"># Store LLM generated responses</span>
<span class="hljs-keyword">if</span> <span class="hljs-string">"messages"</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> st.session_state.keys():
    st.session_state.messages = [{<span class="hljs-string">"role"</span>: <span class="hljs-string">"assistant"</span>, <span class="hljs-string">"content"</span>: <span class="hljs-string">"How may I help you?"</span>}]

<span class="hljs-comment"># Display chat messages</span>
<span class="hljs-keyword">for</span> message <span class="hljs-keyword">in</span> st.session_state.messages:
    <span class="hljs-keyword">with</span> st.chat_message(message[<span class="hljs-string">"role"</span>]):
        st.write(message[<span class="hljs-string">"content"</span>])

<span class="hljs-comment"># User-provided prompt</span>
<span class="hljs-keyword">if</span> prompt := st.chat_input():
    st.session_state.messages.append({<span class="hljs-string">"role"</span>: <span class="hljs-string">"user"</span>, <span class="hljs-string">"content"</span>: prompt})
    <span class="hljs-keyword">with</span> st.chat_message(<span class="hljs-string">"user"</span>):
        st.write(prompt)

callback_manager = CallbackManager([StreamingStdOutCallbackHandler()])

<span class="hljs-comment"># Make sure the model path is correct for your system!</span>
llm = LlamaCpp(
    model_path=<span class="hljs-string">"./llama-2-13b-chat.ggmlv3.q4_0.bin"</span>,
    input={<span class="hljs-string">"temperature"</span>: <span class="hljs-number">0.75</span>, <span class="hljs-string">"max_length"</span>: <span class="hljs-number">2000</span>, <span class="hljs-string">"top_p"</span>: <span class="hljs-number">1</span>},
    callback_manager=callback_manager,
    verbose=<span class="hljs-literal">True</span>,
)


<span class="hljs-comment"># Function for generating LLM response</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">generate_response</span>(<span class="hljs-params">prompt_input</span>):</span>

    template = <span class="hljs-string">"""I am a Large Language Model Llama set up on Langchain.
    {history}
    Human: {human_input}
    Assistant:"""</span>

    prompt = PromptTemplate(input_variables=[<span class="hljs-string">"history"</span>, <span class="hljs-string">"human_input"</span>], template=template)

    chatbot = LLMChain(
        llm=llm,
        prompt=prompt,
        verbose=<span class="hljs-literal">True</span>,
        memory=ConversationBufferWindowMemory(k=<span class="hljs-number">2</span>),
    )
    <span class="hljs-keyword">return</span> chatbot.predict(human_input=prompt_input)


<span class="hljs-comment"># Generate a new response if last message is not from assistant</span>
<span class="hljs-keyword">if</span> st.session_state.messages[<span class="hljs-number">-1</span>][<span class="hljs-string">"role"</span>] != <span class="hljs-string">"assistant"</span>:
    <span class="hljs-keyword">with</span> st.chat_message(<span class="hljs-string">"assistant"</span>):
        <span class="hljs-keyword">with</span> st.spinner():
            response = generate_response(prompt) 
            st.write(response)

    message = {<span class="hljs-string">"role"</span>: <span class="hljs-string">"assistant"</span>, <span class="hljs-string">"content"</span>: response}
    st.session_state.messages.append(message)
</code></pre>
<h2 id="heading-running-the-app">Running the App</h2>
<p>To run this file, create a new Terminal window and run the following command -</p>
<pre><code class="lang-bash">streamlit run app.py
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690961176083/f974de72-4564-4874-b79a-f9d0552f3e56.png" alt="Screenshot of the output when you get &quot;streamlit run app.py&quot;" class="image--center mx-auto" /></p>
<p>If the service is up and running, you'll see a similar message in the shell from Streamlit.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690961259458/8153b555-315f-4caa-9f05-dbf8e756e97c.png" alt="Screenshot of the Jupyter app on the Napptive console highlighting the streamlit URL. " class="image--center mx-auto" /></p>
<p>You can check the app following the link in the <em>streamlit</em> endpoint on the Napptive Console.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690961566232/7c5e26af-dc60-4ea8-a5d6-34417d717c7b.png" alt="Screenshot of the chatbot UI" class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690961516647/598f09ef-b8f3-4171-bd4d-932273540f2d.png" alt="Screenshot of the console output when the LLM chain starts" class="image--center mx-auto" /></p>
<p>While you enter the prompts on Chat, you can also check out what it does on the Terminal.</p>
<h2 id="heading-final-results">Final Results</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690961343411/e884f0e6-6df8-4be4-98ab-5e9af63fe5e6.gif" alt="GIF that shows the input and the result shared by the chatbot" class="image--center mx-auto" /></p>
<p>Here's a demo of what the app looks like.</p>
<blockquote>
<p>The app runs fine, but I've come across a few issues, for starters it's very slow (understandably because it's on CPU) and secondly, sometimes it loops itself where after finishing the response it automatically creates a new question and starts answering it.</p>
</blockquote>
<p><strong>What could've been better?</strong></p>
<p>I didn't spend too much time on the UI, so you can see that the chatbot just dumps the response instead of streaming it word-by-word as you would see on other bots like ChatGPT.</p>
<hr />
<p>That's it for this article, I hope you liked it, stay tuned on this series because I'm pretty sure there's a lot more to come. In the next article, we'll try something similar with the help of AWS Sagemaker :)</p>
<p>As always, thanks for reading, keep spreading your love, Cheers! 🥂</p>
]]></content:encoded></item><item><title><![CDATA[The Role of Seniors in College]]></title><description><![CDATA[Technology is vast. Coming into the industry as a student can easily be overwhelming given the amount of information that is out there.
The most common problem I've seen with students who are pursuing tech-related courses is their lack of awareness v...]]></description><link>https://blog.sreekeshiyer.com/the-role-of-seniors-in-college</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/the-role-of-seniors-in-college</guid><category><![CDATA[Career]]></category><category><![CDATA[mentorship]]></category><category><![CDATA[community]]></category><category><![CDATA[technology]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Sat, 29 Jul 2023 04:00:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/rxpThOwuVgE/upload/8f1f46d32129bda20db49eb18bb1fed6.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Technology is vast. Coming into the industry as a student can easily be overwhelming given the amount of information that is out there.</p>
<p>The most common problem I've seen with students who are pursuing tech-related courses is their lack of awareness vis-à-vis the latest trends in tech, preparation for placements and tech-related activities on their campus.</p>
<p>The teaching faculty has their priority set (and rightly so) on covering their respective syllabus and related academia. The easiest way for one to get any kind of awareness is by communicating with their seniors. But it ain't as easy as it sounds, is it?</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">Most people do not approach their seniors purely because they are hesitant to start a conversation.</div>
</div>

<hr />
<p>Now, let me get this straight. Talking to seniors isn't the only way to get awareness and insights. Heck, I'm pretty sure they haven't sorted things out for themselves. But they can help you with their experiences, things that they found out late, the mistakes that they made and more.</p>
<p>But as a senior, I feel that we have a responsibility to contribute to the community of students in our college. Here's how I suggest you can do that.</p>
<h2 id="heading-foster-awareness-of-college-opportunities">Foster Awareness of College Opportunities</h2>
<p><img src="https://images.unsplash.com/photo-1523240795612-9a054b0db644?ixlib=rb-4.0.3&amp;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80" alt="Three men laughing while looking at the laptop inside a room. Image shared by Priscilla Du Preez on Unsplash" /></p>
<p>Right from picking the best dishes in the canteen to identifying the best professors for specific subjects, or professors who let you go easy on attendance, I feel that you have a better idea than the poor kids coming freshly into your departments.</p>
<p>Just having a word with the juniors, and making them aware of these little opportunities on campus is a great contribution to the community in itself, and besides that, it adds a new friend to your tally. I've had chats with an endless number of people about the companies that come on campus when the placement drives happen and how they can approach them.</p>
<p>Talk about community programs, talk about internships, I'm pretty sure you can talk about your college the entire day, and now you have a set of ears to listen to you as well :)</p>
<h2 id="heading-cultivating-a-tech-driven-campus-culture">Cultivating a Tech-Driven Campus Culture</h2>
<p><img src="https://www.highspot.com/wp-content/uploads/Hackathon-blog-header.png" alt="A team of people working on their individual laptops. Image from Highspot" /></p>
<p>I hear a lot about people not getting opportunities in Tier-3 institutes and/or universities. It's going to take some effort to change that. I feel that a few right steps from seniors can be the ideal ignition to this process.</p>
<p>Start by organizing tech events that allow people to network with each other and facilitate tech-related discussions. The more you talk about tech, the more it will be brought up on different occasions.</p>
<p>As people get more and more aware of the benefits of building a dev profile and solving DSA problems, you'll start seeing a shift in the mindset of people.</p>
<h2 id="heading-raising-the-skill-bar">Raising the Skill Bar</h2>
<p><img src="https://images.unsplash.com/photo-1504384764586-bb4cdc1707b0?ixlib=rb-4.0.3&amp;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80" alt="man using laptop in front of brown chair. Image shared by Alex Kotliarskyi on Unsplash" /></p>
<p>I briefly discussed developing a solid culture in and around the college, but this is arguably the biggest challenge in any institute, to improve the overall skillsets of individuals coming in year after year.</p>
<p>It's not about those one or two individuals who get amazing offers from big companies, but what the majority of people are trying to achieve. That is when a college truly experiences a culture shift.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">If you ask any random person in an intra-college hackathon what stack they are working on, the majority of the folks would say HTML, CSS and probably PHP and MySQL. I speak from experience. Your challenge is to take this to React and MongoDB. Not for one team, not for two teams.</div>
</div>

<p>I was using HTML/CSS/PHP/MySQL and React/MongoDB as references not because one is better than another, but because you start with HTML and CSS as a beginner, and you gradually pick frameworks to work with. The more experienced you get, the better the chances that you are working on a framework.</p>
<p>Conducting workshops and seminars that explain the real-life use cases not just for web frameworks but any technical specialty, in general, will facilitate this kind of growth. Organizing Hackathons is another solid idea.</p>
<hr />
<p>Here's how I look at it. As a senior, especially during the final few months in college, I felt that I should try to create an impact on the community around me. These people in college, they are my people. The ones who are still there and those that will join every year. These are just a few ways through which I was able to give back to this little and wonderful community. Please feel free to share your ideas in the comments too 😊</p>
]]></content:encoded></item><item><title><![CDATA[The Easiest way to install Docker Engine on a Linux Server]]></title><description><![CDATA[If you're working on a local machine, you can easily download and install Docker Desktop for your operating system - Windows, Mac or even Linux Desktops these days.
However, if you're someone like me who does most of the work on the Cloud, or to be s...]]></description><link>https://blog.sreekeshiyer.com/the-easiest-way-to-install-docker-engine-on-a-linux-server</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/the-easiest-way-to-install-docker-engine-on-a-linux-server</guid><category><![CDATA[Docker]]></category><category><![CDATA[Linux]]></category><category><![CDATA[Cloud]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Fri, 28 Jul 2023 14:17:57 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/jOqJbvo1P9g/upload/7f50d9773eb383f2c6aa8e6f67922566.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you're working on a local machine, you can easily download and <a target="_blank" href="https://www.docker.com/products/docker-desktop/">install Docker Desktop</a> for your operating system - Windows, Mac or even Linux Desktops these days.</p>
<p>However, if you're someone like me who does most of the work on the Cloud, or to be specific, remote environments, this may not be the right choice for you.</p>
<p><img src="https://img.memegenerator.net/instances/67014178.jpg" alt="A man screaming &quot;IT IS IN THE CLOUD&quot;. It's a meme, fellas. " class="image--center mx-auto" /></p>
<p>Something that I discovered pretty late is that Docker, for quite some time, has had a super fast solution to install Docker Engine in Linux environments.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690552609683/50351b53-d2e9-4355-a735-1dc55ef6b5a9.png" alt="Screenshot of the website get.docker.com" class="image--center mx-auto" /></p>
<p>If you check the website https://get.docker.com, you will find out that Docker maintains a script to install Docker Engine on Linux.</p>
<blockquote>
<p>As they mentioned, this method is not intended for production environments, which I assume anyway will be working with a specific Docker version.</p>
</blockquote>
<p>The best part about this script is that you need absolutely no package managers to work with.</p>
<h2 id="heading-installing-docker-using-the-script">Installing Docker using the Script</h2>
<pre><code class="lang-bash"><span class="hljs-comment"># Download the script</span>
curl -fsSL https://get.docker.com -o install-docker.sh

<span class="hljs-comment"># Run the script as it tries to figure out the type of Linux</span>
<span class="hljs-comment"># distribution it's dealing with and installs the latest CLI and Engine versions</span>
sudo sh install-docker.sh
</code></pre>
<p>Simply running these two commands will install the latest version of the Docker Engine, its CLI and a few other tools/plugins like Compose, Buildx, etc.</p>
<h2 id="heading-run-docker-without-root-access">Run Docker without Root access</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690553383753/d90fa084-a275-4332-b6d5-199405ab0636.png" alt="Screenshot of the Permission Denied Error when you run docker commands without root access" class="image--center mx-auto" /></p>
<p>Now, if you run any docker command after installing, you'll probably come across a similar error. The quick solution to this is to run the same commands with <em>sudo</em>, but it has been fairly annoying to me. But there's also a quick 1-command fix to this.</p>
<pre><code class="lang-bash">sudo usermod -aG docker &lt;USERNAME&gt;
sudo reboot
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690553752834/3e6fd0f5-d541-4412-98d3-cbf06f717dc4.png" alt="Screenshot of a working docker container ls command" class="image--center mx-auto" /></p>
<p>The flags <code>a</code> and <code>G</code> in the command are to add the user to a group, and just by running the command and rebooting your system, you can run <em>docker</em> commands without root access. Even though this requires one-time super-user access, I feel that it's definitely time-saving.</p>
<hr />
<p>Thanks for reading, I hope you have a good day ahead :)</p>
]]></content:encoded></item><item><title><![CDATA[Self Hosting Supabase on AWS]]></title><description><![CDATA[Hi there, folks!
Supabase is a BaaS (Backend-as-a-service) I've been using for my full-stack projects for almost 2 years. It's an amazing service that is open source, runs on top of Postgres and brings cool features like auth (even third-party auth s...]]></description><link>https://blog.sreekeshiyer.com/self-hosting-supabase-on-aws</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/self-hosting-supabase-on-aws</guid><category><![CDATA[supabase]]></category><category><![CDATA[AWS]]></category><category><![CDATA[ec2]]></category><category><![CDATA[Docker]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Thu, 27 Jul 2023 03:30:13 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1690401624917/5bd8f088-eb20-4be4-9970-8153e8c6bb5d.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hi there, folks!</p>
<p>Supabase is a BaaS (Backend-as-a-service) I've been using for my full-stack projects for almost 2 years. It's an amazing service that is open source, runs on top of Postgres and brings cool features like auth (even third-party auth support for a zillion providers), storage, realtime and much more.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">I have a Flask Series in which I use Supabase as a backend. <a target="_blank" href="https://blog.sreekeshiyer.live/series/flask-dev-to-deployment">Check it out</a>!</div>
</div>

<h2 id="heading-why-self-host-supabase">Why self-host Supabase?</h2>
<p>You can totally work with Supabase on the Cloud, as easy as it gets. But if you are on its Free Tier, you have limited access to some of the features of the application. And that's any service, not just Supabase.</p>
<p>I feel that is why it's great to have the freedom to self-host these service-based applications because you get full control of how they run.</p>
<p>What this does is that it gives you control over the infrastructure on top of which it runs, so you can take care of the scaling process as and when needed.</p>
<blockquote>
<p>Or you don't want to see Ant's emails every week. Yeah, that's about it.</p>
</blockquote>
<hr />
<p>In this article, I'm going to cover how we can quickly get Supabase up and running self-hosted on an AWS EC2 Instance. Let's get going!</p>
<p>The Supabase Documentation already mentions <a target="_blank" href="https://supabase.com/docs/guides/self-hosting/docker">an article</a> on how you can self-host it using Docker. We're going to follow it as well :)</p>
<p>Before getting started, let's take a look at the things we are going to need:</p>
<ul>
<li><p>An AWS Account</p>
</li>
<li><p>Preferably a few AWS credits, you may incur a bill</p>
</li>
</ul>
<p>Let's start by creating our EC2 instance on AWS!</p>
<h2 id="heading-setting-up-the-ec2-instance">Setting up the EC2 Instance</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690397838128/a813ec7e-5171-4f34-adc0-230710bfd3b0.png" alt="A screenshot of the AWS EC2 &quot;Launch New Instance&quot; page which shows a summary of the options you've selected, like instance type, security group, storage, etc." class="image--center mx-auto" /></p>
<p>When you're launching a new EC2 instance, make sure you select the <strong>Ubuntu</strong> AMI, any instance type that has more than <em>4GB</em> RAM, and preferably <em>20GB</em> of storage.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">For a more detailed guide on launching an AWS EC2 Instance, check out <a target="_blank" href="https://blog.sreekeshiyer.live/setting-up-an-apache-web-server-on-aws">this</a> blog.</div>
</div>

<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690398015297/fc612ab8-a81b-44c9-a95a-ef89667c15a6.png" alt="Screenshot showcasing the inbound rules for a Security Group" class="image--center mx-auto" /></p>
<p>Another thing is that you need to ensure you have all TCP ports and IP addresses open for inbound connections in your Security Group (<em>not recommended in production, of course)</em></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690398257014/2ad34abe-b3ac-4431-b5f1-f6689102a6e9.png" alt="Screenshot that shows how you can connect to an EC2 instance using SSH" class="image--center mx-auto" /></p>
<p>Once you've launched the instance, you can connect to it on the browser using EC2 Instance Connect, or if you've got a thing for fancy terminals like me, use SSH along with your key-pair to use your good old Terminal. Keep in mind, you use the <em>Public IPv4 address</em> along with the username <em>ubuntu</em> to connect.</p>
<h2 id="heading-installing-all-dependencies">Installing all dependencies</h2>
<p>Before we start installing dependencies, we're going to update our package list by running <code>sudo apt-get update -y</code></p>
<p>After that, we're going to install Docker.</p>
<h3 id="heading-installing-docker">Installing Docker</h3>
<pre><code class="lang-bash">curl -fsSL get.docker.com -o install-docker.sh
<span class="hljs-comment"># This scripts installs the latest version of Docker Engine in your Linux machine</span>
sudo sh install-docker.sh

<span class="hljs-comment">## If you want to use Docker aommands without sudo or admin privileges</span>
sudo usermod -aG docker ubuntu
<span class="hljs-comment">## After running this command, reboot the instance for it to reflect</span>
</code></pre>
<p>We'll install Docker from its install-docker script on the official Docker website. You can continue using Docker as a super user OR just update the local user group and reboot your EC2 instance. It doesn't take long.</p>
<p>Next up, we're going to set up Supabase!</p>
<h2 id="heading-setting-up-supabase">Setting up Supabase</h2>
<pre><code class="lang-bash"><span class="hljs-comment">## Following from their documentation</span>
<span class="hljs-comment"># Clone their repository</span>
git <span class="hljs-built_in">clone</span> --depth 1 https://github.com/supabase/supabase

<span class="hljs-comment"># Go to the docker folder</span>
<span class="hljs-built_in">cd</span> supabase/docker

<span class="hljs-comment"># Copy the fake env variables</span>
cp .env.example .env
</code></pre>
<p>As mentioned in their documentation, all we need to do is clone the Supabase repository, copy and change the environment variables and get going!</p>
<p>As good practice, NEVER work with the default environment variables.</p>
<pre><code class="lang-bash">nano .env
<span class="hljs-comment">## Once you've made the changes, Ctrl+S to save and Ctrl+X </span>
<span class="hljs-comment">## to quit Nano and return to the shell.</span>

<span class="hljs-comment">## Then run docker compose up command to start the server</span>
<span class="hljs-comment">## This spins up </span>
docker compose up
</code></pre>
<p>You can use <em>Nano</em> to edit the <code>.env</code> file and make changes to your keys. You can follow the documentation to generate new keys and secrets. Once you've done that, you can run <code>docker compose up</code> to get things up and running!</p>
<h2 id="heading-check-out-the-studio">Check out The Studio</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690400040084/ae92b261-4dfe-46db-a517-eacc9ec2c5dd.png" alt="Screenshot that shows that Supabase is up and running on port 3000" class="image--center mx-auto" /></p>
<p>At this point, you can check out if the Supabase Studio runs on http://&lt;YOUR_PUBLIC_IP&gt;:3000/projects</p>
<p>If you want to stop the service, you can do so by pressing <code>Ctrl+C</code> or running <code>docker compose down</code> if you're on a different shell window.</p>
<h2 id="heading-recommended-cleanup">Recommended Cleanup</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690400321315/c790d23b-f9b5-4bd3-b503-771d495df335.png" alt="A warning message from AWS that you get when you try to terminate an EC2 instance. " class="image--center mx-auto" /></p>
<p>Make sure you terminate your EC2 instance after you've stopped using it, or you may have a few unpleasant AWS billing-related emails coming your way.</p>
<blockquote>
<p>Are the AWS billing emails worse than Ant shutting down your Supabase projects every week? Debatable. We can talk about it.</p>
</blockquote>
<hr />
<p>That's it for this article, folks. Hope you liked it, I'll see you in the next one :)</p>
]]></content:encoded></item><item><title><![CDATA[The Journey of IT Engineering: 5 Honest Lessons]]></title><description><![CDATA[It's been a month since I appeared for my final examination to officially complete my degree formalities as an IT Engineering Graduate. Transitioning from a naive 17-year-old kid out of high school to a Software Developer in these 4 years, I'd like t...]]></description><link>https://blog.sreekeshiyer.com/the-journey-of-it-engineering-5-honest-lessons</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/the-journey-of-it-engineering-5-honest-lessons</guid><category><![CDATA[engineering]]></category><category><![CDATA[technology]]></category><category><![CDATA[Career]]></category><category><![CDATA[community]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Thu, 29 Jun 2023 04:00:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/pYWuOMhtc6k/upload/a67f508e69a9ba703c75105e0ca2cbb9.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>It's been a month since I appeared for my final examination to officially complete my degree formalities as an IT Engineering Graduate. Transitioning from a naive 17-year-old kid out of high school to a Software Developer in these 4 years, I'd like to share my experience in the form of these five lessons.</p>
<blockquote>
<p>Writer's Note: I've written this thread in the context of career and life (in India), so you can expect less technical advice.</p>
</blockquote>
<h2 id="heading-performing-under-pressure">Performing Under Pressure</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686820569894/9f610c73-62b1-493f-8152-eae443a29837.jpeg" alt="A picture of 3 people in a corporate meeting with a view of a city skyline captured and edited beautifully, shared by Charles Forerunner on Unsplash." class="image--center mx-auto" /></p>
<p>As a professional, especially in the tech industry, you'll find yourself working most days under the pressure of deadlines, client expectations and many more.</p>
<p>In Engineering, <em>the pressure becomes second nature</em>. You face deadlines for assignments, and journals every other day. At a certain point, I've had more than 10 submissions to cover in a matter of 3 days, which is insane. Yet, I somehow managed to do it.</p>
<p>The key here is to learn how to manage your time and bring the best results even when you're under the pump. This is a skill set that is immensely valued in the work environment.</p>
<h2 id="heading-upskill-through-hard-work">Upskill through hard work</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686822281647/38665961-63a8-4375-8172-482977a2912b.png" alt="A photo of me looking at my laptop with VSCode and live preview on one monitor and Spotify and a backend server running on another screen." class="image--center mx-auto" /></p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">Hard work is underrated in this generation.</div>
</div>

<p>You open up Instagram and all you see is motivational reels and podcasts talking about rules and shortcuts so that you can achieve everything in the next 48 hours. Not how it works, sadly. Good things take time.</p>
<p>What I mean by upskilling is to become technically sound. Technology is changing by the minute. Faster than ever these days thanks to AI and what it brings. If you're not up-to-date with what's latest, it'll become challenging for you to get jobs in the long run.</p>
<p>Start with the <a target="_blank" href="https://res.cloudinary.com/zenon-cloudinary/image/upload/v1686822868/Screenshot_734_aftw9m.png">basics</a>. Pick your favorite language, and master a framework and a tech stack that you can use in your side projects and hackathons.</p>
<p>Practice solving problems on Leetcode, Hackerrank or other platforms. It is a critical skill to land an interview in most tech firms.</p>
<p>Explore different domains, Web and App Development, Data Science, DevOps, Cybersecurity and many more. See what you like the most and gain expertise in that field. <strong>Become un-replaceable</strong>.</p>
<h3 id="heading-do-not-rely-on-your-college">Do not rely on your college</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686820882902/30c4dc0a-beaf-4292-9211-625723319543.jpeg" alt="A picture of a library captured and shared by Priscilla Du Preez on Unsplash. " class="image--center mx-auto" /></p>
<p>Most universities (in India) have outdated syllabi which cover barely 10-15% (being optimistic) of what's actually used in the industry. The theory is important and generally well-covered. Practical knowledge is what we mostly fall behind in, and that's where self-learning becomes critical. You need to develop the ability to learn by yourself, something that you'll keep using in your professional life.</p>
<p>If you're in a Tier 3 institute in India, your on-campus placement statistics may not impress you as much. In that case, you'll have to explore opportunities off-campus, for which you'll need a good set of skills and a solid network.</p>
<p>You can always look around for referrals. Having a good network on Twitter or LinkedIn always helps.</p>
<h2 id="heading-experience-responsibility">Experience Responsibility</h2>
<p><img src="https://images.unsplash.com/photo-1556761175-b413da4baf72?ixlib=rb-4.0.3&amp;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80" alt="Three men sitting on chair beside tables captured and shared by Austin Distel on Unsplash." class="image--center mx-auto" /></p>
<p>Arguably the most important thing that I learned in these 4 years.</p>
<p>The respect that you earn and the value that your work creates in an organization are heavily reliant on the levels of responsibility you're able to take as a professional. It's as simple as people describing you as - "They know what they're doing, they <em>get the job done</em>".</p>
<p>The only way you can learn how to manage responsibility is by doing it at relatively easier levels in your college life. Volunteer to organize different technical and non-technical activities in college, it could be a part of fests, cultural programs or virtually anything. This kind of leadership experience helps you build confidence in yourself. Not only does it help you work in teams, but it also makes you a better team manager.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">In my case, I experienced leadership by becoming the Secretary of our Department's Technical Cell and by leading a team in my final-year internship. I learned how to manage people, always speak on behalf of the team and most importantly how to get the job done.</div>
</div>

<p>As we walk into our colleges, we are mostly naive 17-year-old kids who have no idea what adult life looks like. We're in our own little world having fun because in most cases, there are people who take care of us in almost all aspects of life. And suddenly, by the time we're done with Engineering, we're 22 and now we've to take care of everything on our own.</p>
<p>Aside from all the leadership skills, this kind of experience also opens you up to different perspectives and makes you a more mature human being, which is critical not just at work, but also in life.</p>
<h2 id="heading-build-lifelong-connections">Build Lifelong Connections</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686811568600/3a23f7bf-d4df-496c-9e46-cfc9df4f3ef0.jpeg" alt="A collage of some of our group photos in college. " class="image--center mx-auto" /></p>
<p>When I came into Engineering, I was an introverted kid who knew no one, didn't speak to anyone and just went on with his business. I used to think this is how I was always going to be.</p>
<p>What you see in this picture are the 7 gems of my life who I met in my Engineering college. I can't say enough that I've been insanely lucky to meet them and be in a group of such nice human beings.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">For a lot of people (probably including me), Engineering is going to be their last degree, in which case the last time they'll be in college. I can only advise you to become friends with as many people as you can, enjoy campus life, and make memories that you'll never forget.</div>
</div>

<p>As I've mentioned several times before, life becomes very different after college, so please make sure you make the most out of these 4 years in every way possible.</p>
<h2 id="heading-give-back-to-the-community">Give back to the Community</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686821645795/2e217e14-88dc-4401-b751-580ce168fea9.jpeg" alt="A photo of myself (left), Dheeraj Lalwani (center) and Aditya Oberai (right) captured by Team PreMagic in JSConf Bengaluru, 2023." class="image--center mx-auto" /></p>
<p>Everything that I know in tech today, I owe to my teachers, online instructors, easy-to-read documentation and the creators of countless YouTube videos and courses out there. I have to mention the great man Brad Traversy. He's the first tech YouTuber I started watching when I worked on my first web-development framework - Laravel. I think he is a legend, especially after getting to know his story and in my mind, he's the best developer out there.</p>
<p>As much as I call it <em>self</em>-learning, it is all possible because of the content that is available today. Most developers of yesteryear would agree how difficult it used to be to work with things when you got stuck working with an old codebase.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">I personally feel that it is my responsibility as a fellow tech enthusiast to share this knowledge with others, making it easier for them to become the developers of the future. We are all a part of this little community, what we call "The Tech Community" and it's always good to give back a little every now and then.</div>
</div>

<p>I have a separate thread coming up later this year about this aspect, but you can start by having coffee chats with your juniors in college, talking about technologies with them, helping them in taking better decisions, telling them to avoid mistakes you made and more.</p>
<hr />
<p>That must've been a long read, and I'm glad you came here. Thank you for giving me a little bit of your time, I hope your coffee was nice and I hope you have an amazing day ahead.</p>
]]></content:encoded></item><item><title><![CDATA[The Speaker's Edge: 3 Key Strategies for Impactful Sessions]]></title><description><![CDATA[Public Speaking is the art of creating an aura around yourself where you can create an impact on people and their minds. In today's world, especially as developers, we need to have a good hold over our soft skills to be able to present a case for our...]]></description><link>https://blog.sreekeshiyer.com/public-speaking-beginners</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/public-speaking-beginners</guid><category><![CDATA[Public Speaking]]></category><category><![CDATA[Soft Skills]]></category><category><![CDATA[personal development]]></category><category><![CDATA[content creation]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Mon, 29 May 2023 10:30:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1685349880713/fa73654f-2e44-4457-9880-692b12020c9d.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Public Speaking is the art of creating an aura around yourself where you can create an impact on people and their minds. In today's world, especially as developers, we need to have a good hold over our soft skills to be able to present a case for ourselves at different stages of our careers.</p>
<p>In this thread, I want to share my story and leave you with 3 strategies to become a good public speaker.</p>
<h2 id="heading-my-story">My story</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1685349194627/0c86f0cc-398f-43e9-a39f-169457a39c19.png" alt class="image--center mx-auto" /></p>
<p>I used to be a guy who was afraid of the stage right from school. Even during the days of my junior college (11th grade), my feet used to shiver when I was on stage. My nervousness was at its peak. And it was pretty much the same through the first half of Engineering.</p>
<blockquote>
<p>My transition from a guy who could barely speak in public to a proper public speaker who now talks live on stage and takes online sessions and workshops happened in the last 12 months.</p>
</blockquote>
<p>The key is self-confidence. I know for a fact that it is challenging to improve your confidence. It takes time. The best way to boost your confidence is by <strong>doing things</strong>. Build that application, create that new design, publish that blog or upload that new video you worked on. When there is a sense of achievement, it creates self-belief within you, so when you talk about it, you back your words with actions, essentially practicing what you preach.</p>
<hr />
<p>If you're starting out or even trying to improve as a speaker, here are some things I'd recommend you to do.</p>
<h2 id="heading-keep-it-simple-and-natural">Keep it Simple and Natural</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1685349152548/63050a87-231f-43b4-89f5-1764aa54b08c.png" alt class="image--center mx-auto" /></p>
<p>First of all, the moment you hop in on stage, take a deep breath. I mean it. Make yourself comfortable. Taking deep breaths generally kicks down the anxiety and ensures that you're not overwhelmed by the occasion.</p>
<p>If you're starting out, speak in the language you're most comfortable with. It could be your native tongue. My native tongue is <em>Tamil</em>, but I'm most comfortable speaking in Hindi and English and generally, I keep it as a mix of the two depending on my audience.</p>
<p>The best conversations happen when they are authentic. I'd highly recommend that you talk about <em>YOUR</em> experiences because they are the most valuable from any speaking event.</p>
<blockquote>
<p>A lot of people talk about voice modulation, but I suggest that you talk in your normal voice at the beginning, you'll discover these things as you progress.</p>
</blockquote>
<h2 id="heading-ask-questions-to-the-audience">Ask questions to the audience</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1685352188043/fbcfe953-e798-48d5-9c37-6a8cb50f9829.png" alt class="image--center mx-auto" /></p>
<p>Most people in the audience refrain from speaking, but there are always a few people who will add immense value to the conversation. So it's best to have their opinions on board.</p>
<p>When you're sharing an experience or an idea, you can ask the audience for similar experiences and thoughts. If the audience does not seem to interact, you can switch to <em>"Yes/No"</em> questions and questions that only require them to <em>raise their hands</em>.</p>
<p>I mention this because this period of getting an answer from the audience buys you some extra time to breathe, recollect your thoughts and probably introduce more ideas in the session.</p>
<h2 id="heading-narrate-your-stories">Narrate your Stories</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1685348946647/7d0f496f-935e-44ad-9255-42c51ecadddd.png" alt class="image--center mx-auto" /></p>
<p>I've said this before. Your experiences are the most valuable assets from your talks. Especially as developers, when we talk about languages, frameworks and tools, it's almost certain that there is written and video documentation for the same thing freely available online.</p>
<p>You can make your sessions unique by talking about your experiences, and your stories because they are specific to you. This might also end up inspiring individuals from the audience to bring their perspectives to the table. It could be anything, an interesting aspect that maybe not a lot of people discovered, a unique approach to something, etc.</p>
<p>I've observed that people love listening to stories and when you're talking to people of your age group, there's a lot that they can relate to as well.</p>
<hr />
<p>As you keep speaking, you'll become more and more confident about your skills. It will take time, but I assure you that you'll get there one day :)</p>
]]></content:encoded></item><item><title><![CDATA[Predicting Insurance Fraud using SMOTE and  MindsDB]]></title><description><![CDATA[Insurance fraud is a significant problem for the insurance industry, leading to serious financial losses and reputation damage. Big data has created more opportunities than ever before for the insurance business to engage in fraudulent operations.
To...]]></description><link>https://blog.sreekeshiyer.com/predicting-insurance-fraud-mindsdb</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/predicting-insurance-fraud-mindsdb</guid><category><![CDATA[mindsdb]]></category><category><![CDATA[MindsDBHackathon]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Thu, 27 Apr 2023 08:08:24 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1682582753771/ebd77a53-01ec-46d0-bf3e-4df6548f6a1f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Insurance fraud is a significant problem for the insurance industry, leading to serious financial losses and reputation damage. Big data has created more opportunities than ever before for the insurance business to engage in fraudulent operations.</p>
<p>To find patterns and anomalies that can point to fraud, we can make use of machine learning and its capabilities to provide conclusive evidence of fraudulent activities.</p>
<h2 id="heading-observing-the-data">Observing the data</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1682533509201/74fae486-0c89-41c4-9392-fa304e547251.png" alt class="image--center mx-auto" /></p>
<p>Our <a target="_blank" href="https://www.kaggle.com/datasets/buntyshah/auto-insurance-claims-data">dataset</a> contains insurance claim logs from an automobile insurance company in the United States. We have customer information, policy identifiers, premium payment information, and other payment-related data. But most importantly, we have information about the incident, including the date, type of collision (not applicable if the car was stolen), time of day, witnesses, injuries, and other details across seven states. There are initially 1000 rows and 41 columns in our dataset.</p>
<p>Our target column is: <code>fraud_reported</code></p>
<p>We can sense that it's a classification problem.</p>
<p>Now ideally, one could just dump this dataset into MindsDB, train a model and get done with the job. But it probably isn't the best approach.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1682534099661/f0793c7c-893a-4b0b-a602-208a29432678.png" alt class="image--center mx-auto" /></p>
<p>Okay, I tried it 😂 and was able to get 88.5% accuracy, which isn't half bad for a classification model given the number of features we were dealing with, but we can certainly get more.</p>
<p>Let's take a step back and open this up on a Jupyter Notebook!</p>
<h2 id="heading-data-preprocessing">Data Preprocessing</h2>
<p>I didn't do too much work here, just the usual stuff, removing irrelevant rows, data transformation, etc.</p>
<pre><code class="lang-python">df = pd.read_csv(path)
df.shape 
<span class="hljs-comment">#! (1000,40)</span>

df.policy_number.nunique() 
<span class="hljs-comment">#! 1000</span>

<span class="hljs-comment">## Removing a useless column (never knew why it was there in the first place)</span>
df = df.drop([<span class="hljs-string">'_c39'</span>],axis=<span class="hljs-number">1</span>)

<span class="hljs-comment">## Convert the policy_bind_date column to a datetime format</span>
df[<span class="hljs-string">'policy_bind_date'</span>] = pd.to_datetime(df[<span class="hljs-string">'policy_bind_date'</span>])

<span class="hljs-comment">## Extract the year, month, and day from the policy_bind_date column</span>
df[<span class="hljs-string">'policy_bind_year'</span>] = df[<span class="hljs-string">'policy_bind_date'</span>].dt.year
df[<span class="hljs-string">'policy_bind_month'</span>] = df[<span class="hljs-string">'policy_bind_date'</span>].dt.month
df[<span class="hljs-string">'policy_bind_day'</span>] = df[<span class="hljs-string">'policy_bind_date'</span>].dt.day

<span class="hljs-comment">## Drop the original policy_bind_date column</span>
df = df.drop(<span class="hljs-string">'policy_bind_date'</span>, axis=<span class="hljs-number">1</span>)

<span class="hljs-comment">## Replace question marks with more sensible information</span>
df[<span class="hljs-string">'collision_type'</span>]=df[<span class="hljs-string">'collision_type'</span>].replace(<span class="hljs-string">"?"</span>,<span class="hljs-string">"Not Applicable"</span>)
df[<span class="hljs-string">'police_report_available'</span>]=df[<span class="hljs-string">'police_report_available'</span>].replace(<span class="hljs-string">"?"</span>,<span class="hljs-string">"Unknown"</span>)

<span class="hljs-comment"># Remove irrelevant columns</span>
df=df.drop([<span class="hljs-string">'incident_date'</span>],axis=<span class="hljs-number">1</span>)
</code></pre>
<p>After this, I did a little bit of feature engineering to transform categorical data into numerical.</p>
<pre><code class="lang-python"><span class="hljs-comment"># A simple form of OneHot Encoding to get numerical data out of categorical</span>
df=pd.get_dummies(df,columns=[<span class="hljs-string">'policy_csl'</span>, <span class="hljs-string">'insured_education_level'</span>,<span class="hljs-string">'insured_occupation'</span>, <span class="hljs-string">'insured_hobbies'</span>, <span class="hljs-string">'insured_relationship'</span>, <span class="hljs-string">'incident_type'</span>, <span class="hljs-string">'collision_type'</span>, <span class="hljs-string">'incident_severity'</span>, <span class="hljs-string">'incident_state'</span>, <span class="hljs-string">'insured_zip'</span>, <span class="hljs-string">'authorities_contacted'</span>, <span class="hljs-string">'auto_make'</span>, <span class="hljs-string">'auto_model'</span>, <span class="hljs-string">'policy_state'</span>, <span class="hljs-string">'insured_sex'</span>,<span class="hljs-string">'capital-loss'</span>, <span class="hljs-string">'capital-gains'</span>, <span class="hljs-string">'incident_city'</span>, <span class="hljs-string">'incident_location'</span>, <span class="hljs-string">'property_damage'</span>, <span class="hljs-string">'police_report_available'</span>], drop_first=<span class="hljs-literal">True</span>)
</code></pre>
<p>After this, we come across an interesting metric:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1682580603069/33bb41e8-a3d2-4ea2-acd3-69d065d5f0d0.png" alt class="image--center mx-auto" /></p>
<p>As you'd expect, the number of fraud cases is way lesser than the non-fraud ones.</p>
<blockquote>
<p>This begs the question, is it safe to drop them as-is to a machine learning model?</p>
</blockquote>
<h2 id="heading-applying-smote">Applying SMOTE</h2>
<p>Most machine learning (prediction) models work ideally when the number of samples in each class is almost equal. These algorithms are made to minimize errors and maximize accuracy.</p>
<p>When there is a significant imbalance of class, it would give significantly less priority to the minority class while making the prediction.</p>
<p>Even in our dataset, if you'd predict every row as non-fraud, you'd still be <strong>75.3% accurate</strong>, which is still a good score, but it ain't a machine learning model.</p>
<p>While there are different <em>resampling</em> techniques to fix this issue, I decided to go with SMOTE, which stands for <em>"Synthetic Minority Oversampling Technique"</em>.</p>
<h3 id="heading-what-is-smote">What is SMOTE?</h3>
<p>This technique is used to generate synthetic data for minority classes, in our case, the <code>fraud</code> class.</p>
<p>It randomly picks a point from the minority class and calculates the k-nearest neighbours to that point. These points are added between the chosen point and the neighbours.</p>
<p>Before applying SMOTE, I'm going to use a RandomForestClassifier to generate the best features from our dataset. These are features that contribute the most to the "fraud_reported" result.</p>
<pre><code class="lang-python"><span class="hljs-comment">### Generating best features</span>

<span class="hljs-comment"># Load data and split into features (X) and target (y)</span>
X = df.drop(<span class="hljs-string">'fraud_reported'</span>, axis=<span class="hljs-number">1</span>)

<span class="hljs-comment"># Create random forest classifier object</span>
rfc = RandomForestClassifier(n_estimators=<span class="hljs-number">300</span>)

<span class="hljs-comment"># Train model</span>
rfc.fit(x, y)

<span class="hljs-comment"># Get feature importances</span>
importances = rfc.feature_importances_

<span class="hljs-comment"># Sort feature importances in descending order</span>
indices = np.argsort(importances)[::<span class="hljs-number">-1</span>]

top_500_indices = indices[:<span class="hljs-number">500</span>]
top_500_features = X.columns[top_500_indices]

<span class="hljs-comment"># Update X to include only top 500 features</span>
X = X[top_500_features]
</code></pre>
<p>Finally, I'll apply fit this in a SMOTE class instance.</p>
<pre><code class="lang-python">%pip install imblearn
<span class="hljs-keyword">from</span> imblearn.over_sampling <span class="hljs-keyword">import</span> SMOTE

x_upsample, y_upsample  = SMOTE(random_state=<span class="hljs-number">42</span>).fit_resample(x, y)
</code></pre>
<p>Now that we're done with the preprocessing and feature engineering, I'm going to dump this dataset into a CSV file.</p>
<pre><code class="lang-python">new_df = pd.concat([x_upsample, y_upsample], axis=<span class="hljs-number">1</span>)

<span class="hljs-comment"># Save the merged dataframe to a CSV file</span>
new_df.to_csv(<span class="hljs-string">'updated_fraud_insurance_claims_dataset.csv'</span>, index=<span class="hljs-literal">False</span>)
</code></pre>
<h2 id="heading-setting-up-mindsdb">Setting up MindsDB</h2>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=ASH89Cc3RW8">https://www.youtube.com/watch?v=ASH89Cc3RW8</a></div>
<p> </p>
<p>Instead of using MindsDB on the free provided cloud instance, I took the fancy route to self-host it on an AWS EC2 instance. I liked it so much that I made a video about it.</p>
<h2 id="heading-creating-a-model-on-mindsdb">Creating a Model on MindsDB</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1682581565014/304cb9dc-daae-42d1-8605-a59e6cf353e9.png" alt class="image--center mx-auto" /></p>
<p>I simply used their UI to upload the dataset I just generated.</p>
<pre><code class="lang-sql"><span class="hljs-keyword">CREATE</span> <span class="hljs-keyword">MODEL</span> mindsdb.insurance_claims_fraud_predictor
<span class="hljs-keyword">FROM</span> files
    (<span class="hljs-keyword">SELECT</span> * <span class="hljs-keyword">from</span> fraud_dataset)
PREDICT fraud_reported;
</code></pre>
<p>I then ran this simple SQL query to create a model on MindsDB.</p>
<h2 id="heading-making-predictions-on-mindsdb">Making Predictions on MindsDB</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1682581751539/610aaa3e-5fed-4514-bf09-fdd20b5765a6.png" alt class="image--center mx-auto" /></p>
<p>As you can see, we have a much better accuracy than before. Our accuracy is now <strong>94%.</strong></p>
<pre><code class="lang-sql"><span class="hljs-keyword">SELECT</span> t.policy_number,t.fraud_reported <span class="hljs-keyword">AS</span> EXPECTED_TARGET, m.fraud_reported <span class="hljs-keyword">AS</span> PREDICTED_FRAUD_REPORTED, m.fraud_reported_explain
<span class="hljs-keyword">FROM</span> files.fraud_dataset <span class="hljs-keyword">AS</span> t
<span class="hljs-keyword">JOIN</span> mindsdb.insurance_fraudulent_claims_predictor <span class="hljs-keyword">AS</span> m
<span class="hljs-keyword">LIMIT</span> <span class="hljs-number">10</span>;
</code></pre>
<p>After this, I just ran some batch predictions on the same data using this query.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1682581935630/1a52717e-eb71-418a-9c66-db89f0384702.png" alt class="image--center mx-auto" /></p>
<p>As you'd expect, we get the right result 9 out of 10 times.</p>
<hr />
<p>It was fun working on Machine Learning after a long time, thanks to this hackathon from MindsDB and Hashnode. It was fun working with it, I even tried to make a tiny contribution to their documentation.</p>
<p>Looking forward to more of these competitions. Until next time, cheers!</p>
]]></content:encoded></item><item><title><![CDATA[DevBytes - Scrolling the better way]]></title><description><![CDATA[As we say goodbye to an era of newspapers with our attention spans shrinking past 15 seconds, we certainly need apps that can show us the latest news in less time. One such application I discovered recently is DevBytes.
About DevBytes
Much to the del...]]></description><link>https://blog.sreekeshiyer.com/devbytes</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/devbytes</guid><category><![CDATA[devbytes]]></category><category><![CDATA[news]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Tue, 21 Mar 2023 14:30:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1679392623360/1402e50d-1f24-4177-b143-d88cc96dabe1.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>As we say goodbye to an era of newspapers with our attention spans shrinking past 15 seconds, we certainly need apps that can show us the latest news in less time. One such application I discovered recently is <strong><em>DevBytes</em></strong>.</p>
<h1 id="heading-about-devbytes">About DevBytes</h1>
<p>Much to the delight of developers who can't stay on the same screen for more than 10 seconds, <strong>DevBytes</strong> is a Tech News Application that brings you the latest news and updates in the form of flash-cards along with bells and whistles like hiring updates, crypto-watch and more in a small bundle of 6 MB.</p>
<p>Rated 4.6 with more than 100K downloads on the Google Play Store, DevBytes certainly has earned its hype for an app that is famous for <em>"Latest Programming &amp; tech news in 64 words"</em>.</p>
<h1 id="heading-first-impressions">First Impressions</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1679378754367/9202ff23-0e32-4996-b295-663f4c5e9f08.png" alt class="image--center mx-auto" /></p>
<p>The onboarding procedure is rather simple, the app tells you to pick an alter-ego to get an idea of your interests and then also lets you manually pick another few topics to curate your feed. You can also optionally sign in using Google or Twitter.</p>
<blockquote>
<p>Spoiler alert: I had to choose Sheldon Cooper.</p>
</blockquote>
<p>Here are some of the app's features that caught my eye instantly.</p>
<h2 id="heading-the-daily-digest">The Daily Digest</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1679384234529/57d7ec14-3209-4d16-9994-7a51d3d99f6f.jpeg" alt class="image--center mx-auto" /></p>
<p>The Daily Digest contains a set of hand-picked news articles with the most important news of the day. This list is also maintained keeping your interested topics in mind.</p>
<p>What you'll also notice is that all of these articles are less than 64 words.</p>
<blockquote>
<p>You hear that? Yeah, that's your attention span saying thanks.</p>
</blockquote>
<p>My favourite bit is that it also sometimes contains memes like this one.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1679390585309/54da6518-24c9-4f9f-819b-b86107a1fb2f.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-the-feed">The Feed</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1679390223185/881ab473-0f6c-436d-8e0c-0e267c8b0a48.jpeg" alt class="image--center mx-auto" /></p>
<p>We are in an era of infinite content and we need some amount of curation to get the best out of it. The Feed gives you a choice to maintain a separate category of articles that are purely from your selected interests. As the app suggests, "Your content, your choice".</p>
<h2 id="heading-coding-snippets">Coding Snippets</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1679391200262/ea537cc7-178d-475d-8665-06c549e843a1.png" alt class="image--center mx-auto" /></p>
<p>Another useful thing about this app is that it also supports code snippets that come along with the articles in small cards. You can also copy this code to the clipboard and share it with your friends if you find it interesting!</p>
<h2 id="heading-crypto-watch-and-hiring-news">Crypto Watch and Hiring News</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1679390730930/dd646631-4f74-4d27-9c7e-49b8ef5e9e35.png" alt class="image--center mx-auto" /></p>
<p>The app also provides a separate tab to monitor your favourite Cryptocurrencies in real-time. Quite a nifty feature to have.</p>
<p>And while you're scrolling through the news, you will also come across hiring updates for various tech roles in different companies.</p>
<h2 id="heading-swiping-the-other-way">Swiping the other way</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1679390182596/e03bcbff-bae2-4af5-8ed2-f94b9f419b73.jpeg" alt class="image--center mx-auto" /></p>
<p>Keeping the best for the last, this is one such feature that you'll instantly notice as you launch the application where you're told to swipe down instead of swiping up. We're traditionally almost maintained a muscle memory of swiping up through content in different social media apps.</p>
<p>I feel that this in a way breaks that habit of swiping up and going back to those apps just for scrolling needlessly. Not to mention that scrolling on this app will make you learn more as well.</p>
<hr />
<p>With its user-friendly interface, daily digest, custom feed, code snippets and other features like hiring news and crypto-watch, DevBytes is the perfect app for those who want to stay informed while on the go. If you're interested in trying out DevBytes for yourself, you can download it for free from the Google Play Store by clicking on this <a target="_blank" href="https://play.google.com/store/apps/details?id=com.candelalabs.devbytes">link</a>.</p>
<p>You can also get DevBytes on the Google Chrome browser via their <a target="_blank" href="https://chrome.google.com/webstore/detail/devbytes-tech-and-ai-news/hplbpdkajdhlggncdpdmnkjldopmoomg/related">Web Extension</a>.</p>
]]></content:encoded></item><item><title><![CDATA[The Ultimate Debugging Guide]]></title><description><![CDATA[Software development is inevitably accompanied by errors. Perfection is unattainable in coding. However, the way we handle errors is crucial to our growth as developers. This article presents a concise guide with practical steps for debugging errors ...]]></description><link>https://blog.sreekeshiyer.com/the-ultimate-debugging-guide</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/the-ultimate-debugging-guide</guid><category><![CDATA[DebuggingFeb]]></category><category><![CDATA[debugging]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Sat, 11 Mar 2023 13:30:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1678516298160/9599c902-f1c0-4673-87fe-28976d1ca16d.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Software development is inevitably accompanied by errors. Perfection is unattainable in coding. However, the way we handle errors is crucial to our growth as developers. This article presents a concise guide with practical steps for debugging errors in various programming languages and frameworks. Join me as we explore!</p>
<h1 id="heading-about-me">👋About Me</h1>
<p>Hi, my name is Sreekesh and I'm a Software Developer and a Content Writer. I've been learning and working with full-stack web development for almost 3 years. I'm a final year undergrad student from the University of Mumbai, India.</p>
<p>In this article, I'll try to change your mindset of approaching errors and problems in your code and working your way towards solutions in a hassle-free manner. I've participated in numerous hackathons and I've explored different ways to debug errors especially when it's a race against time.</p>
<h1 id="heading-the-approach">🛣️The Approach</h1>
<p>We're gonna follow a series of simple steps to find a solution to the error we're facing.</p>
<h2 id="heading-understanding-the-error">Understanding the Error</h2>
<p><img src="https://user-images.githubusercontent.com/11704436/82099646-77571000-9725-11ea-83d1-51608e4dce3f.png" alt="NextJS Production build displaying error with code · Discussion #12956 ·  vercel/next.js · GitHub" class="image--center mx-auto" /></p>
<p>One of the silliest mistakes people make is blindly copying the error and putting it on the browser or ChatGPT. The key here is to first understand which part of your code is producing the error, what your code was intended to do and which end of the workflow is causing the issue.</p>
<h3 id="heading-backtracking-to-the-error">Backtracking to the error</h3>
<p><img src="https://i.redd.it/vh3uiughhv471.png" alt="console.log(&quot;I'm here 1&quot;) : r/ProgrammerHumor" class="image--center mx-auto" /></p>
<p>When it isn't clear which part of the workflow is causing the issue, you can walk through the code in reverse, i.e. from the final line all the way through to the start. Feel free to make use of <code>console.log</code> or other <em>print</em> statements in your language to log outputs at different stages of your program. This will provide you clarity about the exact lines that are giving you trouble.</p>
<h3 id="heading-exception-handling">Exception Handling</h3>
<p><img src="https://pbs.twimg.com/media/FPKOWxUWYAMOGs9.jpg:large" alt="Java Code Daily on Twitter: &quot;Master Yoda is wise in the ways of Java  exception handling. &lt;(-_-)&gt; https://t.co/5k5vPh9URm&quot; / Twitter" class="image--center mx-auto" /></p>
<p>Utilize try-catch statements to gain a comprehensive grasp of your program's workflow and guarantee a crystal-clear understanding of potential code-breaking points. By implementing this strategy, you increase code readability and facilitate comprehension for others.</p>
<h2 id="heading-making-good-use-of-google-search">Making good use of Google Search</h2>
<p><img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RxSqway4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/90r8c0h1l15lcpyz6ge2.jpg" alt="Alt Text" class="image--center mx-auto" /></p>
<p>Famously known as Google-ing, the idea is to be efficient at finding things out of Google Search. All you have to do is put your error out on google search and take a look at the results. The chances are, you'll find yourself in a StackOverflow thread, an old GitHub Repository Issue Discussion or literally on the documentation website.</p>
<p>Google-ing doesn't make you any less of a developer. The best developers I know are the ones that use Google the most. Much like any other tools like StackOverflow or ChatGPT, which is where we are heading.</p>
<h2 id="heading-reading-the-documentation">Reading the Documentation</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678534826123/e10efce1-5e29-4f98-82cc-d37fa66a9eb2.png" alt class="image--center mx-auto" /></p>
<p>You'll find most solutions related to syntax errors, typos in function names, etc. in the documentation. Sometimes, you miss out on an argument, or there's a typo in the function name and sometimes functions and objects are deprecated by libraries and replaced by other utilities. When you grow as a developer, you'll find yourself interacting more with the documentation and less hobbling around search results.</p>
<h2 id="heading-taking-help-from-stackoverflow-and-chat-gpt">Taking help from StackOverflow and Chat GPT</h2>
<p><img src="https://lr.mint.lgbt/img/u9guj7us56da1.jpg" alt="The future we have to look forward to with Chat GPT. - r/ProgrammerHumor" class="image--center mx-auto" /></p>
<p>StackOverflow is still the holy place where most of your errors will be solved. The knowledge base of that website purely out of support from community members is insanely huge. However, we now have friends from OpenAI that make use of websites like StackOverflow and bring results to us even quicker.</p>
<p>Given how fast ChatGPT is in finding things out, it is a handy tool for debugging. In fact, in a lot of cases, ChatGPT alone could fix your problems. However, I wouldn't recommend this for now, because it doesn't seem to manage versions (it sometimes shares dated/deprecated code) as well as one would expect.</p>
<h2 id="heading-taking-help-from-discord-communities">Taking help from Discord Communities</h2>
<p><img src="https://media.wired.com/photos/61bbc0d63acd2dde36a80100/191:100/w_2400,h_1256,c_limit/Gear-How-to-Use-DIscord-2F885XY.jpg" alt="How to Use Discord: A Beginner's Guide | WIRED" class="image--center mx-auto" /></p>
<p>Discord has to be my favourite community platform. Most frameworks and tools that I use (like Next.js, Supabase, Flutter and more) have already set up their Discord servers where people talk about the software, and its issues, there are spaces where people can share their errors and more. This is why I feel that you should explore different communities on Discord because they can certainly help you in the debugging process.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678538479027/a8d3e7a5-d471-448b-9b1d-f6f4787779d8.png" alt class="image--center mx-auto" /></p>
<p>Here's Supabase's Discord server for instance. There's a forum channel set up for doubts and issues. You'll have a similar experience with your frameworks as well, the open-source community is very friendly and amazing when it comes to supporting at this level.</p>
<h1 id="heading-debugging-donts">🚩Debugging Don'ts</h1>
<p>Errors are, in a way, your friends. Because every new error teaches you something, even though you might find them annoying. While you are on the warpath to solve that annoying error, I want you to steer clear of these things that can potentially destroy your learning process.</p>
<h4 id="heading-ignoring-error-messages">❌ Ignoring Error Messages</h4>
<h4 id="heading-copy-paste-results-from-stackoverflow-or-chatgpt-without-a-second-thought">❌ Copy-paste results from StackOverflow or ChatGPT without a second thought.</h4>
<h4 id="heading-deleting-code-without-clarity">❌ Deleting Code without clarity.</h4>
<h4 id="heading-not-sleeping-until-you-fix-the-error">❌ Not sleeping until you fix the error.</h4>
<h4 id="heading-not-documenting-the-lessons-youve-learned">❌ Not documenting the lessons you've learned.</h4>
<h1 id="heading-final-advice">Final Advice</h1>
<p><img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pdnyHNq2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g69w1x5tvzyaqsys71mt.jpg" alt class="image--center mx-auto" /></p>
<blockquote>
<p>The difference between a Junior and a Senior Developer is the number of errors they've come across.</p>
</blockquote>
<p>Enjoy getting new errors. As I mentioned, they are a part of the process and inevitable. Going through this process of debugging is very rewarding and gives you a sense of achievement at the end of the day.</p>
<hr />
<p>I hope I was able to provide practical and effective steps for debugging errors in various programming languages and frameworks. I hope that this guide will help developers approach errors with a positive outlook and that they will find the solutions they need to create effective and efficient code. Embrace the process, keep learning, and keep growing!</p>
]]></content:encoded></item><item><title><![CDATA[Introducing IntroAI - Introductions by OpenAI]]></title><description><![CDATA[Are you confused about the things to mention while introducing yourself in an interview, like you holding the record for the longest sleep duration? Or do you just want to say Hi on Twitter because your friend Mike got famous because he tweeted about...]]></description><link>https://blog.sreekeshiyer.com/introai</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/introai</guid><category><![CDATA[AI]]></category><category><![CDATA[chatgpt]]></category><category><![CDATA[interview]]></category><category><![CDATA[LinkedIn]]></category><category><![CDATA[WeMakeDevs]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Fri, 27 Jan 2023 14:29:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1674829279541/28c67d29-49a4-472e-9836-862f2b176c80.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p>Are you confused about the things to mention while introducing yourself in an interview, like you holding the record for <em>the longest sleep duration</em>? Or do you just want to say Hi on Twitter because your friend Mike got famous because he tweeted about the advantages of the span tag in HTML?</p>
</blockquote>
<p>Then say Hi to <em>IntroAI</em> - a website powered by the OpenAI API that can generate introductions for you in different tones (like funny, or professional) and based on your specified context (in a technical interview, or for a LinkedIn About section).</p>
<h1 id="heading-the-inspiration">The Inspiration</h1>
<p>I was scrolling through Twitter one fine morning and I came across this tweet.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://twitter.com/nutlope/status/1617917548372332545?s=20&amp;t=NNq8UzdBFuI64ptpBYdqPQ">https://twitter.com/nutlope/status/1617917548372332545?s=20&amp;t=NNq8UzdBFuI64ptpBYdqPQ</a></div>
<p> </p>
<p>I watched that entire video and saw what that guy did with the OpenAI API and Vercel Edge functions, and it was simply amazing. I think you should take a look at <a target="_blank" href="https://youtu.be/JcE-1xzQTE0">it</a> as well. He made the website twitterbio.com which generates Twitter bios based on context with the help of the OpenAI API.</p>
<p>This inspired me to think of other ideas and the possibilities that this tech opened up.</p>
<h1 id="heading-the-thought-process">The Thought Process</h1>
<p><img src="https://media.istockphoto.com/id/1344939844/photo/hand-holding-drawing-virtual-lightbulb-with-brain-on-bokeh-background-for-creative-and-smart.jpg?b=1&amp;s=612x612&amp;w=0&amp;k=20&amp;c=-wlvWS-XTNTxhD6_ewD5T8vRsiTrvnId8b7uf-5-Ucw=" alt class="image--center mx-auto" /></p>
<p>I'm a Full Stack Developer and I've been working with Next.js and TailwindCSS for more than a year, which is why I was easily able to understand what Hassan was doing in the video. The tricky part was to understand the part where he wrote a function to create an OpenAIStream which he then calls from the Edge function.</p>
<p>I've always been fascinated by the capabilities of AI and tools like ChatGPT are amazing utilities for our day-to-day activities. There had to be more use cases for the API, especially in the context of text generation.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674829408480/a148a47f-a0c0-40d0-8b94-52d587180db8.png" alt class="image--center mx-auto" /></p>
<p>Sitting on the train, I had this lightbulb moment, which took me back to a seminar I had taken for my juniors just a day before, for preparing for their placement season, viz. building a profile, preparing for interviews, etc.</p>
<blockquote>
<p><strong>Introductions!</strong> And you won't believe how many people have issues with making one for themselves! This thought was an absolute game-changer. It was the ideal add-on to the existing project that was out there. All that was left was to launch VSCode.</p>
</blockquote>
<h1 id="heading-the-result">The Result</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674827585372/e370289a-5614-46d6-8cf2-206ea022ec47.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1674827087863/741a88f6-6d05-4fe2-8c95-8d747a576916.png" alt class="image--center mx-auto" /></p>
<p><em>Want to see how AI introduces you? Check it out</em> <a target="_blank" href="https://introai.me"><em>here</em></a><em>!</em></p>
<p>You can also get the source code on my GitHub <a target="_blank" href="https://www.github.com/sreekeshiyer/introai">repository</a>.</p>
<hr />
<p>It's fascinating how such a simple idea could result in such a nice-looking product. I'm glad I was able to build this.</p>
<p>Thanks for reading, let me know your thoughts about the project. I'll see you at the next one. Until then, take care :)</p>
]]></content:encoded></item><item><title><![CDATA[Dev Retro 2022: Sreekesh's Hustle Mania]]></title><description><![CDATA[This year has been no less than a riveting game of test cricket for me. Ebbs and flows, twists and turns every other day. It gives me an immense feeling of gratitude and satisfaction as I write this article trying to reflect on what has happened in t...]]></description><link>https://blog.sreekeshiyer.com/dev-retro-2022</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/dev-retro-2022</guid><category><![CDATA[#DevRetro2022]]></category><category><![CDATA[Developer]]></category><category><![CDATA[2022]]></category><category><![CDATA[hustle]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Fri, 09 Dec 2022 09:30:44 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1670530564170/qzyngCFoL.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This year has been no less than a riveting game of test cricket for me. Ebbs and flows, twists and turns every other day. It gives me an immense feeling of gratitude and satisfaction as I write this article trying to reflect on what has happened in these last 12 months.</p>
<p>To understand what went behind all the events that transpired in 2022, it is important to know what happened in 2021. Let's take a short recap of 2021 before we take a look at this year.</p>
<h1 id="heading-2021-recap">2021 Recap</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670530210014/qR6Su1RBg.jpg" alt class="image--center mx-auto" /></p>
<p>I'll try to keep this as short as I can. 2021 was tough for me, physically and mentally. But it taught me that I've got some incredible strength of perseverance and commitment within me.</p>
<p>It was another year that was taken away by the pandemic, everything was confined to the 4 walls of my room. But that didn't stop me. I was determined to follow the process despite not seeing results at times. I made sure that 2021 was THE MOST productive year of my life.</p>
<p><img src="https://pbs.twimg.com/media/FHyavEzVIAMqVO4?format=png&amp;name=small" alt="A screenshot that shares the list of technologies I learned in 2021" class="image--center mx-auto" /></p>
<p>I found this screenshot from my <a target="_blank" href="https://twitter.com/sreekeshiyer/status/1476223905324945417?s=20&amp;t=C3usbqRpv9yNa1l9VkFMnw">old recap tweet</a> and you possibly get an idea of how many different technologies I was able to learn because I was at home all day, most of which I learned in the second half of the year.</p>
<hr />
<blockquote>
<p>By the end of 2021, I was confident, technically sound, immensely sleep deprived and breathing caffeine in and out.</p>
</blockquote>
<p>Realizing what I had been missing in the last year, I decided to put a conscious effort towards sleeping well and maintaining my fitness in 2022. I also decided to build connections and network with a lot of people this year. We'll see how that goes :)</p>
<h1 id="heading-taking-my-first-online-coding-workshop">Taking my First Online Coding Workshop</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670510961543/VXJ6V7ONL.png" alt="TailwindCSS Workshop" class="image--center mx-auto" /></p>
<p>Very early in January this year, thanks to the <a target="_blank" href="https://editorial.questit.tech">Quest IT Cell</a>, I was able to conduct my first-ever coding workshop where I talked about TailwindCSS and how easy it is to create UI with it. I was joined by a small group of students who were very new to web development but showed a lot of interest.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670511055157/uglo58CBr.png" alt="Resume Website using TailwindCSS" class="image--center mx-auto" /></p>
<p>After talking about the different use cases of Tailwind, we started coding and ended up creating a Resume Website, styling it with TailwindCSS and deploying it to Netlify.</p>
<blockquote>
<p>It was a great feeling, especially doing this for the first time. Got some really good feedback, and I was very motivated to keep doing more of these.</p>
</blockquote>
<h1 id="heading-crossing-100-wpm">Crossing 100 WPM</h1>
<p><img src="https://pbs.twimg.com/media/FSvT0aCVEAAIodT?format=png&amp;name=small" alt="Livechatinc typing speed test screenshot" class="image--center mx-auto" /></p>
<p>I crossed 100WPM for the first time on 15th May 2022. Something quite normal for a lot of tech nerds that I know, but this was a huge achievement for me, because of one reason.</p>
<p>I've been typing on the same old Microsoft Keyboard right from 2009 all the way through to 2020. I did not have any professional training in keyboard typing, which is why it is very <em>unconventional</em>.</p>
<blockquote>
<p>I do not use more than 7 fingers while typing (ideally, you'd use all 10)</p>
</blockquote>
<p>Just muscle memory took me to 84-85 WPM. But it took 2 weeks of consistent practice to take me past three figures.</p>
<h1 id="heading-solving-250-problems-on-leetcode">Solving 250 Problems on Leetcode</h1>
<p><img src="https://pbs.twimg.com/media/FTltjuiUAAAxNi0?format=png&amp;name=small" alt="Image" class="image--center mx-auto" /></p>
<blockquote>
<p>I'm not a fan of how one's performance in solving a complex Leetcode/CodeChef question is directly mapped to their skill level (because that's how most people land interviews and eventually, jobs). This is just my opinion, I'm sure a lot of you might disagree, and I can completely understand that.</p>
</blockquote>
<p>Regardless, I needed a job too, which meant that I needed to step my game up in DSA and Problem Solving. From being nowhere at the end of 2021, I worked consistently for 3-4 months and solved a variety of easy and medium problems. I also participated in multiple Leetcode weekly contests.</p>
<p>I have to admit, it is a good use of logic, common sense and an understanding of data structures when you solve these kinds of problems. The satisfaction of solving a problem after wrapping your brains around it for a good half an hour is also unmatched!</p>
<h1 id="heading-winning-a-hackathon">WINNING A HACKATHON</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1656054331252/2QfdI8PvI.png?auto=compress,format&amp;format=webp" alt="cfg winners 2022.png" /></p>
<p>In June, my team was adjudged the <strong>Winner</strong> of <em>Code For Good 2022</em>, a tech-for-social-good hackathon organized by <a target="_blank" href="https://www.jpmorganchase.com/">J.P. Morgan Chase &amp; Co</a>. This hackathon was also the final stage of their Software Engineer recruiting process.</p>
<p>We were a team of 8 initially, but due to some circumstances, we were left to a count of just 4 teammates by the time the problem statements were shared. The events that followed in the next 24 hours are no short of an absolute miracle. Staying up all night, we managed to present a complete solution to the judges.</p>
<blockquote>
<p>The developing experience, the energy, the interactions with mentors and eventually the reactions from the judging panels after listening to our presentation, oh boy, I was floating on air at one point!</p>
</blockquote>
<p>If you're interested to know more about this story, take a look at this <a target="_blank" href="https://blog.sreekeshiyer.live/winner-code-for-good-2022">article</a> where I described my experience in detail.</p>
<h1 id="heading-taking-a-break">Taking a Break</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670525779336/t0tl_AHu3.jpg" alt class="image--center mx-auto" /></p>
<p>After all the drama that transpired in the hackathon in June, I decided to take a small break from all the hustle. It had been a very productive yet very taxing period of six months for me. I did not entirely disconnect myself from everything, but I made sure I got my life back on track and fixed my sleep schedule, diet, etc. A little bit of greenery helped as well.</p>
<h1 id="heading-a-job-offer-from-jp-morgan-chase-andamp-co">A Job Offer from JP Morgan Chase &amp; Co.</h1>
<p><img src="https://blog.sreekeshiyer.live/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1660980612040%2FtP2EX4Bn1.png%3Fw%3D1600%26h%3D840%26fit%3Dcrop%26crop%3Dentropy%26auto%3Dcompress%2Cformat%26format%3Dwebp&amp;w=3840&amp;q=75" alt="How I got my first job at J.P. Morgan Chase &amp; Co." /></p>
<p>A few days after college resumed, I got to know that I was one of the students to be offered a Software Engineer Full-Time Role at J.P. Morgan Chase &amp; Co.</p>
<p>This, being my first job offer, was a huge moment for my parents. I cannot describe their happiness in words, let alone mine. It felt like all of those extra hours I put into upskilling myself paid off. I'm excited to join the company in 2023.</p>
<p>If you're interested in the recruitment process, please take a look at <a target="_blank" href="https://blog.sreekeshiyer.live/jpmc-my-first-job">this</a> article.</p>
<h1 id="heading-taking-an-in-person-devops-session">Taking an in-person DevOps Session</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670526760308/fEvCaBg_S.png" alt="This is a photo of me taking a DevOps session in a supabase t shirt :) " class="image--center mx-auto" /></p>
<p>Once I was back into business, I took a DevOps fundamentals session for my juniors in college. I talked about the understanding of DevOps technologies, Agile Terminologies, CI/CD Pipelines, etc.</p>
<p>It was a very different experience because I was doing this for the first time in person. The butterflies you feel initially, and then gradually breathing into the session, was a surreal feeling.</p>
<h1 id="heading-taking-the-big-stage-for-the-first-time">Taking the big stage for the first time</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670528332313/P85auVF4C.jpg" alt class="image--center mx-auto" /></p>
<p>Our college has this auditorium, a quite large seminar hall where a lot of sessions and talks are conducted. I've always had this fascination with speaking at the helm but never had the courage to do so.</p>
<p>All of that was about to change. I was invited to deliver a talk about preparing for campus placements in coordination with a friend and a college alumnus.</p>
<p>It was the first time I had ever taken hold of the microphone in front of a 100+ audience. Suddenly, once I started speaking, there was no nervousness. I was able to talk well and convey my ideas. The response from the audience was also great.</p>
<p>To my further surprise, the feedback I received from the faculty was amazing.</p>
<blockquote>
<p>Public speaking hasn't been one of my strengths. The last time I took the stage before this, well, that has never happened. I consider this to be one of my biggest achievements, to be able to deliver in front of a crowd.</p>
</blockquote>
<h1 id="heading-runner-up-in-hashnode-4articles4weeks">Runner Up in Hashnode 4Articles4Weeks</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670529137122/2D_q2F2cE.png" alt class="image--center mx-auto" /></p>
<p>I found myself jumping on my couch when I saw that our Community Manager had mentioned me in her new post.</p>
<blockquote>
<p>If you asked me a year before, I wouldn't have even imagined an idea of a "Write-a-thon", forget winning in one.</p>
</blockquote>
<p>This competition really tested my brainstorming skills and consistency. If not for this contest, I do not think I would have come up with the <a target="_blank" href="https://blog.sreekeshiyer.live/css-using-instagram">Improving CSS using Instagram</a> idea. And guess what, the article did so well. It was liked by everyone.</p>
<p>To be able to make it to the runners-up is a huge acknowledgement of the amount of effort I have put into Content Writing.</p>
<p>Hashnode has had a huge role to play in my development as a Content Writer in the last 14 months.</p>
<h1 id="heading-creating-a-tech-community">Creating a Tech Community</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670528954270/9xf0vOtP1.png" alt class="image--center mx-auto" /></p>
<p>During my interactions with my juniors, I felt that I would make a good mentor, despite being a college student. It felt a little unfortunate that my reach was restricted to a small set of students.</p>
<p>In late November, I decided to create my Community on Discord. It's called <em>One Byte Social.</em></p>
<p>The idea behind this community is to provide everyone in tech with an environment that promotes growth and skill enhancement, where they can network with other people and share their work. I'm glad to share that it now has more than <strong>200 members</strong>.</p>
<p>I look forward to sharing resources, hosting online sessions and providing mentorship to newcomers in tech in the future. We recently hosted a Twitter Space and also interacted via a Discord call.</p>
<p>If this sounds interesting to you, feel free to join us <a target="_blank" href="https://discord.gg/FrqVVvbxnm">here</a>.</p>
<hr />
<h1 id="heading-what-i-learned-from-2022">What I learned from 2022</h1>
<p>Life has taught me a lot this year. I'd like to share some of those learnings with you, hoping that it helps.</p>
<ul>
<li><p>Motivation is temporary. Discipline has to take over at some point.</p>
</li>
<li><p>Good sleep is underrated. It fixes a lot of other things that you probably don't even realize.</p>
</li>
<li><p>Prioritize your health, physical and mental. You might have enough money to buy a villa in Norway but it's pretty much useless if you don't have the health to enjoy it.</p>
</li>
<li><p>It's never over until it <em>is</em> over. Do not throw your chances away because you think you are <em>unlucky</em>. You never know.</p>
</li>
<li><p>One way to deal with competition is to make it irrelevant.</p>
</li>
</ul>
<p>And lastly, one of the most important things, if not the most important -</p>
<ul>
<li>Focus on the process. Your results are impacted by a lot of things that are beyond your control. If you are result-oriented, you'll never figure out what's right. Back yourself to do some amazing things in life provided you stick to your process, that is your right path.</li>
</ul>
<blockquote>
<p>No matter how lost you feel, if you stay true to yourself, the path will always find you again.</p>
<p>~ Enola Holmes' mother</p>
</blockquote>
<hr />
<p>With about 21 days left, I have to say that this is it for my dev journey this year.</p>
<blockquote>
<p>It has been a lot of hustle and I can sense a lot of tired neurons upstairs.</p>
</blockquote>
<p>I'll go through my ongoing examinations and probably just relax for the rest of the month. Thank you very much for reading through my journey.</p>
<p>Wishing everyone Happy Holidays, I'll see you in 2023. Cheers<em>🥂</em></p>
]]></content:encoded></item><item><title><![CDATA[Deploying a Flask Application to Render - A Free Heroku Alternative]]></title><description><![CDATA[Very recently, Heroku has decided to remove their free tier, so we'll now need a paid plan to host our applications on Heroku, starting November 28, 2022.
In this thread, let's look at a free alternative for Heroku, a relatively new company Render, t...]]></description><link>https://blog.sreekeshiyer.com/deploy-flask-to-render</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/deploy-flask-to-render</guid><category><![CDATA[#week4]]></category><category><![CDATA[4articles4weeks]]></category><category><![CDATA[render]]></category><category><![CDATA[Python]]></category><category><![CDATA[Flask Framework]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Sun, 11 Sep 2022 08:53:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1662886266106/Q7DUBjbSo.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Very recently, Heroku has decided to remove their free tier, so we'll now need a paid plan to host our applications on Heroku, starting November 28, 2022.</p>
<p>In this thread, let's look at a free alternative for Heroku, a relatively new company Render, that provides cloud infrastructure to deploy software and services. </p>
<h1 id="heading-what-well-need">What we'll need</h1>
<ol>
<li>A <a target="_blank" href="https://www.github.com">GitHub</a> Account</li>
<li>A <a target="_blank" href="https://www.render.com">Render</a> Account</li>
</ol>
<h1 id="heading-creating-a-simple-flask-application">Creating a simple Flask Application</h1>
<p>Flask is one of my favourite Python frameworks because it's minimal and easy to use. The boilerplate code for Flask is barely 3-4 lines.</p>
<p>Let's create a standard endpoint that returns <code>Hello world</code>.</p>
<p>If you don't wish to start from scratch, you can clone <a target="_blank" href="https://github.com/sreekeshiyer/sample-flask-app">this</a> GitHub repository and proceed to the <a target="_blank" href="https://sreekeshiyer.hashnode.dev/deploy-flask-to-render#heading-deploying-to-render">final</a> step</p>
<h2 id="heading-creating-a-python-virtual-environment">Creating a Python Virtual Environment</h2>
<p>Before we install Flask, we need to create a virtual environment that can store all our Python dependencies. </p>
<p>Let's open up the Command line and run these commands based on our Operating System to set up a virtual environment.</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Creating a new folder</span>
mkdir sample-flask-app
<span class="hljs-built_in">cd</span> sample-flask-app

<span class="hljs-comment"># Linux</span>
sudo apt-get install python3-venv    <span class="hljs-comment"># If needed</span>
python3 -m venv .venv
<span class="hljs-built_in">source</span> .venv/bin/activate

<span class="hljs-comment"># macOS</span>
python3 -m venv .venv
<span class="hljs-built_in">source</span> .venv/bin/activate

<span class="hljs-comment"># Windows</span>
py -3 -m venv .venv
<span class="hljs-comment"># Use forward slashes if you are using Git Bash</span>
.venv\scripts\activate
</code></pre>
<h2 id="heading-installing-dependencies">Installing Dependencies</h2>
<p>After that, let's update the python package manager <code>pip</code> and install <code>flask</code>.</p>
<pre><code class="lang-bash">python -m pip install --upgrade pip
python -m pip install flask gunicorn
</code></pre>
<p>If you're wondering what <code>gunicorn</code> is, it's a tool that serves your Python code, i.e. your Flask app in production. </p>
<h2 id="heading-setting-up-the-flask-application">Setting up the Flask Application</h2>
<p>Once we have our environment set up with the required dependencies, we can move forward to create our Flask Application.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662881003426/3jns3ZW29.png" alt="image.png" /></p>
<p>To do so, create a python file with the name <code>app.py</code> in our project folder and open it in your favourite text editor <em> cough </em> I mean VSCode. </p>
<p>Now, let's write the code for creating a Flask application.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Importing Flask</span>
<span class="hljs-keyword">from</span> flask <span class="hljs-keyword">import</span> Flask, jsonify

<span class="hljs-comment"># Creating an instance of the Flask class</span>
app = Flask(__name__)

<span class="hljs-comment"># Creating a new endpoint with this instance as a function decorator</span>
<span class="hljs-meta">@app.route('/')</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">hello_world</span>():</span>
    <span class="hljs-keyword">return</span> jsonify({
        <span class="hljs-string">"message"</span>: <span class="hljs-string">"Hello World."</span>
    })

<span class="hljs-comment"># Starting the Server</span>
<span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">'__main__'</span>:
    app.run()
</code></pre>
<p>We can run <code>python app.py</code> on our command line to see whether everything works fine. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662881779193/Nh5LUUVSV.png" alt="image.png" /></p>
<p>In a new shell window, we can use the <code>curl</code> command to see if the endpoint is working or look up <code>localhost:5000</code> on the browser.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662881841438/zg1ujl9P7.png" alt="image.png" /></p>
<p>Now we know that our application is working fine. We can proceed towards deploying it.</p>
<h1 id="heading-creating-a-requirementstxt-file">Creating a requirements.txt file</h1>
<p>When we deploy our application to Render, it runs on a remote cloud virtual machine. To ensure that the remote instance knows the dependencies we're using, we need to keep it updated in a separate file.</p>
<p>Let's run <code>pip freeze &gt; requirements.txt</code> on our command-line.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662882543550/jd9EpQG-z.png" alt="image.png" /></p>
<p>We can see there is a new file <code>requirements.txt</code> that has been created.</p>
<p>On opening this file, we can look at the dependencies that are stored in our python environment. </p>
<p>We can remove all the sub-dependencies that may have popped up and just keep <code>Flask</code> and <code>gunicorn</code>.</p>
<h1 id="heading-pushing-the-code-to-github">Pushing the code to GitHub</h1>
<p>Firstly, we need to create a new empty Repository on GitHub.
Then, we'll have to initialize a local Git Repository on our system.</p>
<p>Run these commands in the same project folder to push your code to GitHub</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Initializing a Git repository</span>
git init

<span class="hljs-comment"># Creating a .gitignore file, adding the .venv directory to .gitignore</span>
cat &lt;&lt; EOF | sudo tee .gitignore 
.venv
EOF

<span class="hljs-comment"># Adding Files to the staging area, making a commit</span>
git branch -M main
git add .
git commit -m <span class="hljs-string">"Ready for deployment"</span>

<span class="hljs-comment"># Connecting the local repository to the public GitHub repository we previously created.</span>
git remote add origin &lt;link_to_github_repository.git&gt;

<span class="hljs-comment"># Pushing the changes</span>
git push -u origin main
</code></pre>
<p>Our code is now on GitHub!</p>
<h1 id="heading-deploying-to-render">Deploying to Render</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662882677441/rSkVinQuV.png" alt="Screenshot_581.png" />
Once you sign up on <a target="_blank" href="https://www.render.com">Render</a>, you'll be redirected to the Render Dashboard. Click on "Web Service" to proceed with our Deployment. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662883467650/vASp5v1CK.png" alt="image.png" /></p>
<p>We can either connect our GitHub account or drop the link to a Public repository. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662883525220/oCMWuW5j-.png" alt="image.png" /></p>
<p>All we need to do now is to choose a name for our service and a region. I'll go with Singapore since that's the closest to my location. </p>
<p>Once that is done, click "Create Web Service" to deploy your application.</p>
<h1 id="heading-results">Results</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662885730450/o4bQRyPAl.png" alt="image.png" /></p>
<p>In a few minutes, your application will be deployed on Render!
You can look up the API using the provided domain name.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662885688130/hsJbj82EM.png" alt="image.png" /></p>
<hr />
<p>Congratulations, you've successfully deployed your Flask App to Render for free! I look forward to using Render for more server-side applications in the future. I hope you do as well. </p>
<p>Thanks for reading.</p>
]]></content:encoded></item><item><title><![CDATA["Women in Politics" - A Hackathon Winning Solution]]></title><description><![CDATA[I was recently a part of a social good hackathon Code For Good 2022 earlier this year. It was a part of the recruitment process of J.P. Morgan Chase & Co. for the Software Engineer position. 
What is Code For Good?

CodeForGood is a social-good hacka...]]></description><link>https://blog.sreekeshiyer.com/women-in-politics-a-hackathon-winning-solution</link><guid isPermaLink="true">https://blog.sreekeshiyer.com/women-in-politics-a-hackathon-winning-solution</guid><category><![CDATA[#week3]]></category><category><![CDATA[4articles4weeks]]></category><category><![CDATA[hackathon]]></category><category><![CDATA[Next.js]]></category><category><![CDATA[Strapi]]></category><dc:creator><![CDATA[Sreekesh Iyer]]></dc:creator><pubDate>Sat, 03 Sep 2022 16:31:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1662222839680/2PNO4KIC8.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I was recently a part of a social good hackathon <em>Code For Good 2022</em> earlier this year. It was a part of the recruitment process of J.P. Morgan Chase &amp; Co. for the Software Engineer position. </p>
<h1 id="heading-what-is-code-for-good">What is Code For Good?</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662213373709/PLzkwXcQ0.png" alt="image.png" /></p>
<p>CodeForGood is a social-good hackathon organized by JP Morgan Chase and Co. every year to provide software solutions to Social-Good Organizations (further referred to as SGOs).</p>
<p>The participants of this event (at least for India) are Second and Third Year Engineering Students who're in the process of recruitment for a Full-Time Role or a 6-month Internship at the company. These are students from Engineering Colleges across the country who have qualified from the Coding and Video-Interview Rounds.</p>
<p>For more about my experience in CFG, read <a target="_blank" href="https://sreekeshiyer.hashnode.dev/winner-code-for-good-2022">this</a> article.</p>
<h1 id="heading-the-problem-statement">The Problem Statement</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662217506854/aGLXbeo1L.png" alt="image.png" />
The organization assigned to my team was <strong>Center for Gender and Politics (CGAP)</strong>. They promote gender equality in politics with the help of awareness campaigns, blogs, etc. They function across South Asia. </p>
<p>They wanted a software solution to increase their audience to spread awareness about their initiative.</p>
<h1 id="heading-our-approach">Our Approach</h1>
<p>Given that we only had <strong>24 hours</strong> to work on a solution, we thought of working on an approach where we tried to solve as many problems for the organization as possible. Here are some of the things that we initially listed down, which we thought we could fix.</p>
<ul>
<li>CGAP already had a blog as a part of its website. It just needed a better, more interactive user interface.</li>
<li>CGAP had volunteers who collected stories across South Asia, sometimes in their regional languages. They had them stored scattered in Google Drive. They would like to work with a centralized database.</li>
<li>CGAP's blogs were newsletters generated by a MacOS tool in PDF form, i.e. images put one after the other. It wouldn't be SEO friendly. An ideal solution would be to switch to Markdown, which would also help in incorporating meta tags to help improve SEO. </li>
</ul>
<h1 id="heading-the-tech-stack">The Tech Stack</h1>
<p>As a team, we decided to proceed with the following technologies given the simplicity of setup and working procedure. </p>
<ul>
<li>Frontend: Next.js</li>
<li>Backend: Strapi.io (comes bundled with an API and an SQLite database by default)</li>
<li>Python for Web Scraping</li>
</ul>
<h1 id="heading-our-solution">Our Solution</h1>
<h2 id="heading-web-scraping-using-python">Web Scraping using Python</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662217987996/dG0sbnfyl.png" alt="image.png" /></p>
<p>We used The Guardian's public API alongside Python to automate the scraping of stories from the internet. The idea was to showcase that we can automate the collection of stories across South Asia. </p>
<p>According to CGAP, this is the first step of getting stories on their blog. It is also the step that takes the longest due to its complexity. Any measures in automating this would save a lot of time.</p>
<h2 id="heading-volunteer-recruitment-using-a-chat-bot">Volunteer Recruitment using a Chat Bot</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662218350667/RakXhLFf1.png" alt="Screenshot_574.png" /></p>
<p>We thought that providing an AI chatbot would be an intuitive approach to onboard volunteers. The submissions would be stored in a CSV file, making it easier for the administration to manage them.</p>
<h2 id="heading-the-backend">The Backend</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662218222636/kS2w4-nb8.png" alt="image.png" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662219067164/aiIcIgjD5.png" alt="image.png" /></p>
<p>We wanted a centralized database to simplify the collection and management of stories. The fact that Strapi comes with an admin panel also meant that it would make it easier for the volunteers to write articles, monitor and publish them. </p>
<p>Publishing articles from the backend was necessary because the collection of stories is handled from the backend too. </p>
<h2 id="heading-the-frontend">The Frontend</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662218576795/TbpQOa6uM.png" alt="image.png" /></p>
<p>We aimed at having a relatively minimalist UI design for our blog front end since our primary focus was on functionality. We were able to split blogs into different categories to showcase them. </p>
<p>We were also showcasing articles written in regional languages. </p>
<h2 id="heading-volunteer-dashboard">Volunteer Dashboard</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662218754276/ShyqoqA_b.png" alt="image.png" /></p>
<p>We also had an Authentication System for Volunteers to Sign In and monitor their progress in their blogs. The stage of progress was also dynamic, i.e. retrieved from the database.</p>
<h2 id="heading-bonus-text-summarization">Bonus: Text Summarization</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662218891646/FQh0jRi4f.png" alt="image.png" /></p>
<p>We also added a simple feature for summarizing the text to be added to article excerpts. CGAP wanted article excerpts to be somewhere around 50-60 words.</p>
<h1 id="heading-results">Results</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662219821463/lYo32P9Oj.png" alt="image.png" /></p>
<p>It was a lot of work to do in less than 24 hours alongside all the brainstorming, setup and making a presentation. I feel that completing this project as a team of 4 people was a huge accomplishment. The appreciation and positive feedback from the jury made it even more special.</p>
<p>Making it through the night, going through to the final round and winning the competition is another story. This hackathon has given me a lot of memories to cherish.</p>
]]></content:encoded></item></channel></rss>