<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Aditya Nikhil</title>
    <description>The latest articles on Forem by Aditya Nikhil (@adityanikhil).</description>
    <link>https://forem.com/adityanikhil</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F475699%2F87b00928-021e-42c4-a0a4-43f938fadab1.jpeg</url>
      <title>Forem: Aditya Nikhil</title>
      <link>https://forem.com/adityanikhil</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/adityanikhil"/>
    <language>en</language>
    <item>
      <title>This SQL solution is GENIUS!!🤩</title>
      <dc:creator>Aditya Nikhil</dc:creator>
      <pubDate>Fri, 07 Oct 2022 08:06:31 +0000</pubDate>
      <link>https://forem.com/adityanikhil/this-sql-solution-is-genius-3ca6</link>
      <guid>https://forem.com/adityanikhil/this-sql-solution-is-genius-3ca6</guid>
      <description>&lt;p&gt;I recently started off solving SQL problems on Leetcode and I come across atleast one problem every day whose solutions I think are &lt;strong&gt;pure genius&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;It's one such problem I came across today which I'll discuss below, &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://leetcode.com/problems/tree-node/"&gt;Databases (608. Tree Node)&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem statement&lt;/strong&gt;&lt;br&gt;
We need to find the type of each node in a tree. Whether it's a root, inner or a leaf node. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jQPTTGlK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l6s5vu4axj459xawqfsr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jQPTTGlK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l6s5vu4axj459xawqfsr.png" alt="Image description" width="304" height="224"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Input: 
Tree table:
+----+------+
| id | p_id |
+----+------+
| 1  | null |
| 2  | 1    |
| 3  | 1    |
| 4  | 2    |
| 5  | 2    |
+----+------+
Output: 
+----+-------+
| id | type  |
+----+-------+
| 1  | Root  |
| 2  | Inner |
| 3  | Leaf  |
| 4  | Leaf  |
| 5  | Leaf  |
+----+-------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Checkout the description thoroughly from the link above and try get an idea of solving it before checking out below approaches&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. My approach 
&lt;/h2&gt;

&lt;p&gt;I solved it using &lt;code&gt;CASE&lt;/code&gt;. &lt;br&gt;
I don't want to go into nitty gritty details of it but here's an overview,&lt;br&gt;
&lt;strong&gt;1.1&lt;/strong&gt; If p_id is null, then it's a &lt;strong&gt;Root&lt;/strong&gt; node.&lt;br&gt;
&lt;strong&gt;1.2&lt;/strong&gt; If id is in p_id, then it's an &lt;strong&gt;Inner&lt;/strong&gt; node.&lt;br&gt;
&lt;strong&gt;1.3&lt;/strong&gt; Else, it's a &lt;strong&gt;Leaf&lt;/strong&gt; node.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. &lt;a href="https://leetcode.com/problems/tree-node/solution/"&gt;Genius approach&lt;/a&gt; (Atleast I think)
&lt;/h2&gt;

&lt;p&gt;Using &lt;code&gt;If&lt;/code&gt; function&lt;/p&gt;

&lt;p&gt;Here's the code,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT
    atree.id,
    IF(ISNULL(atree.p_id),
        'Root',
        IF(atree.id IN (SELECT p_id FROM tree), 'Inner','Leaf')) Type
FROM
    tree atree
ORDER BY atree.id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's break it down,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sets &lt;code&gt;atree&lt;/code&gt; as an Alias to our Tree table.&lt;/li&gt;
&lt;li&gt;Selects &lt;code&gt;id&lt;/code&gt; from the Tree table.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Here's what's interesting!!!!&lt;/strong&gt;&lt;br&gt;
3.Creates an If function&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;General usage of If function 👇

`If(10&amp;gt;27, YES, NO)` 
It states that if condition `10&amp;gt;27` is true then **YES** else **NO**.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, &lt;br&gt;
&lt;code&gt;IF(ISNULL(atree.p_id),'Root'&lt;/code&gt;&lt;br&gt;
states that, &lt;br&gt;
if &lt;code&gt;p_id&lt;/code&gt; is null, then set it as &lt;strong&gt;Root&lt;/strong&gt;.&lt;br&gt;
(And just like that our condition from &lt;strong&gt;1.1&lt;/strong&gt; was satisfied)&lt;br&gt;
4.Yet another If function embedded inside the &lt;code&gt;first If function as an Else condition&lt;/code&gt;,&lt;br&gt;
&lt;code&gt;IF(atree.id IN (SELECT p_id FROM tree), 'Inner','Leaf')&lt;/code&gt;&lt;br&gt;
This states that,&lt;br&gt;
If &lt;code&gt;id&lt;/code&gt; is in &lt;code&gt;p_id&lt;/code&gt; set it as 'Inner' else as 'Leaf'.&lt;/p&gt;

&lt;p&gt;(And just like that our conditions 1.2, 1.3 were satsified🤩)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The genius behind this solution is designing it by utilizing of simple functions ordered in a perfect way.&lt;/em&gt;&lt;br&gt;
&lt;em&gt;As complex as it may seem, as simple it is I believe.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you made it till here, let me know what you think of this and also mention down in the comments if there are any more problems/solutions you find interesting.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JETsegxe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bam4dpqk3k6e1ln6g64c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JETsegxe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bam4dpqk3k6e1ln6g64c.png" alt="Image description" width="498" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sql</category>
      <category>mysql</category>
      <category>leetcode</category>
      <category>database</category>
    </item>
    <item>
      <title>Stay consistent with learning ML </title>
      <dc:creator>Aditya Nikhil</dc:creator>
      <pubDate>Fri, 26 Nov 2021 15:07:18 +0000</pubDate>
      <link>https://forem.com/adityanikhil/stay-consistent-with-learning-ml-590c</link>
      <guid>https://forem.com/adityanikhil/stay-consistent-with-learning-ml-590c</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Machine learning has created such a massive hype over the past decade that no other technology has ever created. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Well I can clearly anticipate that, &lt;strong&gt;AI's&lt;/strong&gt; definitely here to stay for a little bit longer than we thought. Now as the field is growing, competition's growing too.&lt;/p&gt;

&lt;p&gt;No matter what the background of the individual, everybody's ready to learn ML. And I think, it's a good thing &lt;strong&gt;UNLESS&lt;/strong&gt; the individual starts feeling intimidated and afraid tending to leave the course mid way. There are several reasons causing this to happen, which is quite common and it did happened to me too, resulting in constant procrastination.&lt;/p&gt;

&lt;p&gt;So here are few things which helped me to stay consistent and motivated with learning ML,&lt;/p&gt;

&lt;h3&gt;
  
  
  1. What's your motivation?
&lt;/h3&gt;

&lt;p&gt;4 years ago before I started my undergraduate studies, I was constantly trying out new things like programming, game development and of course web dev too. The issue was, I never could keep myself stick with one thing at a time. My mind was always, revolving around new things. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZdeBxZuv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/auof7wg6adfqbqugvemb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZdeBxZuv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/auof7wg6adfqbqugvemb.png" alt="Sophia" width="640" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Until, &lt;em&gt;Sophia the robot&lt;/em&gt; was released. I was so fascinated seeing a robot behave like a human. I heard the term &lt;em&gt;Artificial Intelligence&lt;/em&gt; for the first time and the term itself was so intriguing that I couldn't resist myself learning it. &lt;br&gt;
Though there were not many courses back then unlike now except for Andrew NG's, that didn't stop me from learning it.&lt;/p&gt;

&lt;p&gt;I might not be near to building a robot as powerful as Sophia but I do believe I could one day. That's my motivation and still keeps me going to learn more and to build more. &lt;/p&gt;

&lt;p&gt;So ask yourself, &lt;strong&gt;What's your motivation to learn ML?&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Ask questions
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;I used to be very shy at asking doubts even at the forums. 😅&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I used to feel, people might think that my doubt is too lame or very generic or silly. But that's all in my mind(overthinking). &lt;br&gt;
&lt;em&gt;Trust me, people are too busy thinking about themselves.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Hence, you stop learning and hanging with your unsolved doubt and never moving forward. &lt;br&gt;
Here are few forums where I think you can post your doubts, no matter how silly you think they are but people are kind enough to answer them for you,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://community.wandb.ai/"&gt;https://community.wandb.ai/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://datascience.stackexchange.com/"&gt;https://datascience.stackexchange.com/&lt;/a&gt; 

&lt;ul&gt;
&lt;li&gt;Make sure to check if your question's been previously answered by someone else before you post here. &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.kaggle.com/discussion"&gt;&lt;/a&gt;&lt;a href="https://www.kaggle.com/discussion"&gt;https://www.kaggle.com/discussion&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Reward yourself with a project
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Okay, you learnt a new algorithm but now what? It's time to implement it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Implementing an algorithm is more fun after learning it. It's not just the algorithm but utilizing it to perform a certain task. Why is it fun?&lt;br&gt;
Because, that's what you learnt it for, right?&lt;br&gt;
You're now fully able to implement any algorithm you learnt to perform a given task. &lt;br&gt;
It does feel more rewarding than you think it is. ✨&lt;br&gt;
Do participate in hackathons or OSS(open Source Software) programs to put your ability to test. Here are a few hackathons and OSS programs which definitely you should try,&lt;br&gt;
For starters,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gssoc.girlscript.tech/"&gt;GSSoC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gwoc.girlscript.tech/"&gt;GWoC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://swoc.scriptindia.org/#/"&gt;SWoC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//fellowship.mlh.io"&gt;MLH&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="//summerofcode.withgoogle.com"&gt;GSoC&lt;/a&gt;&lt;br&gt;
Above listed are some of the OSS programs which definitely you should participate in. You'll end up learning A LOT!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://machinehack.com/hackathon"&gt;Machine Hack&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="//Kaggle.com"&gt;Kaggle&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://datahack.analyticsvidhya.com/"&gt;Analytics Vidhya&lt;/a&gt;&lt;br&gt;
Above are some communities which conduct hackathons quite frequently. There's always discussion groups associated with these hackathons, feel free to ask questions. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep finding and working on unique projects and &lt;em&gt;publish them&lt;/em&gt;, which we're going to discuss next!&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Learn in public 🔥
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Like I said, I am a very shy person and this task feels daunting too. 😂(But don't worry, it isn't.)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;No matter how big or small your work is, do talk about it. Do share it. By this I don't mean it in a way like sharing memes over instagram. NO!&lt;br&gt;
Do post about your work on community platforms like &lt;a href="//medium.com"&gt;Medium&lt;/a&gt;, &lt;a href="https://community.wandb.ai/"&gt;WandB&lt;/a&gt;, &lt;a href="//dev.to"&gt;Dev&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;About your post, make sure it fits in any of these categories,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Winning hackathon solution to an ML problem&lt;/li&gt;
&lt;li&gt;A concise implementation of something&lt;/li&gt;
&lt;li&gt;A new technology which you found useful &lt;/li&gt;
&lt;li&gt;A new research you like to talk about &lt;/li&gt;
&lt;li&gt;And finally, tips/techniques that helped you to help the community. (Just like this one😉)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Doing this, it makes you an active member in the community and opens door for numerous opportunities. 🤩🤩&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Hence, these are few things which helped me stay consistent with whatever I do. Hope they help you too. Please feel free to share your thoughts in the comments down below, I'd love to hear them.&lt;/p&gt;

&lt;p&gt;Above all, &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Dont rush, take it one step at a time😉&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can connect with me here,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="//linkedin.com/in/adityanikhil"&gt;Linkedin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//github.com/adityanikhil"&gt;Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@cracksunday.com"&gt;Medium&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://adityanikhil.github.io/main/"&gt;Portfolio&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>machinelearning</category>
      <category>deeplearning</category>
      <category>datascience</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to get rid of Overwhelming</title>
      <dc:creator>Aditya Nikhil</dc:creator>
      <pubDate>Sat, 26 Sep 2020 15:24:35 +0000</pubDate>
      <link>https://forem.com/adityanikhil/how-to-get-rid-of-overwhelming-13ga</link>
      <guid>https://forem.com/adityanikhil/how-to-get-rid-of-overwhelming-13ga</guid>
      <description>&lt;p&gt;I really need some support and motivation to move forward, it's so intimidating and daunting looking at the amount of participation and everything. Am hoping someone to shed some light to help me move forward.&lt;br&gt;
Also I am all into AI and data science, and I cannot find much projects related to these areas where I can help. Everything's all about NodeJS, or databases and stuff. I kind of feel like am no use here.&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
      <category>help</category>
    </item>
  </channel>
</rss>
