<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/rss/styles.xsl" type="text/xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Ishan Writes</title><description>The Noob writes about tech and anything he wants to :)</description><link>https://www.noobscience.in/</link><language>en-us</language><item><title>Push comes to shove tools</title><link>https://www.noobscience.in/blog/push-comes-to-shove/</link><guid isPermaLink="true">https://www.noobscience.in/blog/push-comes-to-shove/</guid><description>Your tools are extensions of your skills</description><pubDate>Mon, 09 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I&apos;m an experimentalist by nature. I&apos;m the guy who downloads the new thing the day it drops, reads every release post, and has opinions about tools most people haven&apos;t heard of yet. But after working professionally for sometime now, I&apos;ve landed on a concept I keep coming back to: &lt;strong&gt;push comes to shove tools&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;These are the tools you&apos;ve invested so much time into that they&apos;ve become extensions of how you think. You&apos;ve honed your skill in them, and you&apos;ve honed the tools themselves—tweaked configs, built workflows, internalized shortcuts. And here&apos;s the thing people don&apos;t like admitting: &lt;strong&gt;a honed tool outperforms a &quot;better&quot; tool you barely know.&lt;/strong&gt; A Neovim user will never be as fast in VS Code, and a VS Code user will never be as fast in Neovim. That&apos;s just the reality.&lt;/p&gt;
&lt;p&gt;Now, I don&apos;t want to fall into the trap of only using what&apos;s comfortable. If I&apos;d dismissed LLMs when they first showed up, I&apos;d be behind right now—and that&apos;s not a good place to be in 2026. But even LLMs prove the point. It took us &lt;em&gt;years&lt;/em&gt; to figure out how to use them well. In 2023, we were treating them like glorified Stack Overflow—asking questions and hoping the hallucinated answers were close enough. Now we&apos;re architects. We drive the model; we don&apos;t just query it. And the people who thrived? The ones who always cared more about solving the problem than writing the code.&lt;/p&gt;
&lt;p&gt;So gather your push comes to shove tools. Because when you&apos;re debugging something at 2 AM, you&apos;re not reaching for the shiny new thing you installed yesterday. You&apos;re reaching for what you &lt;em&gt;know&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;That said, there is a path to adopting new tools: pick one up, use it relentlessly on personal projects, get as good with it as you are with your current stack, and &lt;em&gt;then&lt;/em&gt; phase the old one out. That&apos;s the only honest way to do it.&lt;/p&gt;
&lt;p&gt;_&lt;em&gt;Written by transcribing, paraphrased in my style of writing by an LLM&lt;/em&gt;_&lt;/p&gt;
</content:encoded><author>Ishan</author></item><item><title>Whiplash and the ideas of success</title><link>https://www.noobscience.in/blog/whiplash-and-the-ideas-of-success/</link><guid isPermaLink="true">https://www.noobscience.in/blog/whiplash-and-the-ideas-of-success/</guid><description>Some ideas about success and analysis of some of the concepts of the film Whiplash</description><pubDate>Sun, 04 Jan 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;After being on my watch list since a very long time, I finally got a chance to watch Whiplash, the critically acclaimed 2014 film about a young drummer and his &lt;em&gt;intoxicating&lt;/em&gt; relation with both his cruel mentor and jazz drumming.
The ending of Whiplash is still to this day considered one of the most well done endings to a film and it leaves the viewer in one of two states.
Some people might see the hard mentor finally smiling on our protagonist as a good ending, a feel good film about perseverance and how you can achieve anything you dream of with just the right amount of luck and a ton and ton of hard work. Hell Andrew, our protagonist literally has bleeding calluses every time he performs brilliantly.
The success of his drumming finally comes down to the literal blood, sweat and tears that rise from the sounds coming from his drum kit.&lt;/p&gt;
&lt;p&gt;However, a sinister yet plausibly a deeper way to look at the ending of the film is of the evil man, finally winning and everything he stood for, that excellence does indeed require a person to sell his soul is true.
At the very end of the film, Andrew has alienated and looks down on his loving father, lost the chance with a girl he loved, constantly in self doubt, fear and to top it all of, in a toxic love hate relation with a man who caused a guy to literally hang himself.
Make no mistake, Andrew has literally sold his soul, everything that was ever good in his life except his drumming in the pursuit of greatness.&lt;/p&gt;
&lt;p&gt;There were many moments through out the film that led me to question if what Andrew did is indeed necessary for success.
If success does indeed require giving up everything that you ever held dear.&lt;/p&gt;
&lt;p&gt;Before I do that however, I want to make it clear that while I do understand that success is subjective, we pretty much all have a common root to what success means.
I won&apos;t be entertaining the idea that if you define success to be alive, then you already are.
Success in our context will mean the same thing it most likely did in Andrew&apos;s mind:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Name, Fame and being the top of the field in what you do&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So with that out of the way, I had some ideas floating around in my head regarding this film and these ideas helped me define what success meant for me.
I won&apos;t be sharing what success means to me, but I will be sharing the ideas that you can use to build your own definition of it.&lt;/p&gt;
&lt;h2&gt;Slow and Fast&lt;/h2&gt;
&lt;p&gt;It is no coincidence that some of the best musicians of the time, including some of the legends in the field of jazz that Andrew looks up to, reached their zenith after years of playing.
While there are many young CEO&apos;s, it is no accident that most of the companies are managed by older people who have been in the field for years.&lt;/p&gt;
&lt;p&gt;Time indeed gives perspective, as Andrew&apos;s father says in the film.&lt;/p&gt;
&lt;p&gt;There&apos;s a version where Andrew&apos;s natural talents could have easily shined, without having to give up basically anything he did.
Yes it would have been arguably harder, he would have had to be the struggling artist for quite a few years before finally being great and recognized, but he would have something that the hurried version of Andrew could possibly never make time for: himself.&lt;/p&gt;
&lt;p&gt;This is where I believe perseverance would have been the key.
Not the kind of perseverance that led Andrew to continue drumming even after taking insults and literally bleeding (while that is still important), but the kind of perseverance what you allow him to have a kind of unnatural belief in himself that he is indeed going to be a great in the field of drumming.
I do believe that there are two kinds of perseverance, a slow one and a fast one.&lt;/p&gt;
&lt;p&gt;The fast one is adrenaline fueled.
It is the kind that gets you to lift that final weight and not put it down till you do, it is the one that lets you run that last minute on the thread mill just so that you can complete the full exercise.
The fast one is indeed important. It is what gets you to actually complete what you were doing.&lt;/p&gt;
&lt;p&gt;The slow one however is arguably cooler and it is something that I am trying to cultivate more and more of.
The slow one is what gets you to hit the gym regularly in the first place.
You cannot always depend on something to go to the gym. You need an internal factor, a compass that allows you to do so in the first place.&lt;/p&gt;
&lt;p&gt;Terence, the mentor describes his method to be effective because it constantly puts pressure to be better.
He never tries to internally motivate his pupils.
I believe that is because Terence relies on this fast kind of perseverance from his students that he has to put up acts of cruelty.
Regardless of if he enjoys it, his teaching method needs him to create almost an atmosphere of self preservation in his class which is perfect for the fast kind of perseverance to kick in, the kind that literally is meant to protect one self.&lt;/p&gt;
&lt;p&gt;The act of isolating the drummers until they perfect the tune was the perfect example of this philosophy in action.
Andrew literally had to be taken to his breaking point, to a point where he was genuinely scared, isolated and weak to be able to pull off the perfect solo.&lt;/p&gt;
&lt;p&gt;A slow kind would have been intrinsic.
The art of perfection would have to be slowly but surely taken in by Andrew.
All Terence could have done was to show Andrew what perfection was and wait for his intrinsic love for music to catch up.
This could have taken years, but years that Andrew was happy, healthy and in a good mental state.&lt;/p&gt;
&lt;h2&gt;Those who can&apos;t, teach.&lt;/h2&gt;
&lt;p&gt;Now I don&apos;t want this to be all encompassing. I know that there are people that genuinely love to teach and are top of their fields and yet choose to teach.
The very act of teaching is essential to the preservation of the human race. The very definition of biological survival is to pass down our knowledge to our offsprings.&lt;/p&gt;
&lt;p&gt;However, in the context of the film, I sometimes question Terence himself.
There was never a moment in the film where Terence&apos;s natural abilities showed.
Why was the tempo off? Notice he never said that the tempo was wrong, he said that it didn&apos;t match his tempo.&lt;/p&gt;
&lt;p&gt;Now I have no idea about Music, but why did Andrew&apos;s idea of perfection, the approval of this man?
It was clear in the film that Andrew&apos;s idea of perfection was pretty flawed.
While shown as a foolish jock in the film, Andrew&apos;s cousin at the dining table bring up a very valid point that Andrew himself seems to have forgotten.
Music is subjective.&lt;/p&gt;
&lt;p&gt;If Terence didn&apos;t have authoritative advantages over Andrew, would he really have had that much influence on him?
Now I know that the very fact that Terence has a job at the Music school is a nod at his skill, but it seems to me that through out the film, Terence&apos;s idea of success was to be the mentor of a great musician, not a great musician himself.&lt;/p&gt;
&lt;p&gt;He is literally offloading his ambitions onto his students.
That&apos;s the very embodiment of those who can&apos;t, teach, or in this case abuse till they get out a good reaction.&lt;/p&gt;
&lt;p&gt;Perhaps if Andrew had not stumbled onto Terence back at the club after quitting, he might have found better mentors.
Because Terence was never a mentor, he was a teacher, a pusher.
What Andrew needed at his skill level was a mentor, someone to guide him, not mould him with abuse.&lt;/p&gt;
&lt;p&gt;Notice through out the film, all Terence ever did was abuse and discipline.
There was never something Andrew actually learnt from him.&lt;/p&gt;
&lt;h2&gt;Where&apos;s the Audience?&lt;/h2&gt;
&lt;p&gt;Art is only valuable if someone holds it to be.
Andrew was shown to be great at the end, but where was the audience to validate this?
Through out the film, we were never shown the audience at all.&lt;/p&gt;
&lt;p&gt;I think this was a subtle hint from the director that the nods to the fact that it indeed was a misplaced sense of meaning that Andrew got from Terence that made him place himself as a great.&lt;/p&gt;
&lt;p&gt;I don&apos;t want to elaborate too much on this, but sometimes we are better than we think we are and if Andrew had paid more attention to the audience then his cruel mentor, he would have actually seen that he indeed is very good at drumming.&lt;/p&gt;
&lt;h2&gt;The Push&lt;/h2&gt;
&lt;p&gt;While all these points that I&apos;ve been making might seem as me piling on top of Terence, I do understand why people like him produce results.
One of the most popular quotes in the movie is when Terence says &quot;There are no two words in the English language more harmful than &apos;good job&quot;&lt;/p&gt;
&lt;p&gt;What he was so passionately putting forth to Andrew was how easily we as humans grow complacent.
All the truly evil acts of Terence through out the film was him essentially not letting Andrew grow complacent: Replacing him with another drummer, constantly showing him how replaceable he is, not validating him in the ending scene which arguably is his &lt;em&gt;magnum opus&lt;/em&gt; in the film&lt;/p&gt;
&lt;p&gt;Terence hates complacency and it shows in every action he makes.&lt;/p&gt;
&lt;p&gt;Complacency is bad yes.
However there is a fine line between stability and complacency.
Complacency is a reaction of over confidence. It is no one can ever be better than me. Stability on the other hand is simply put, confidence.
It is the belief that I am good.&lt;/p&gt;
&lt;p&gt;In ensuring that his students never become complacent, Terence was not only destroying their confidence, but also their sense of self.&lt;/p&gt;
&lt;p&gt;That being said however, we could all always use a push.
Something that jolts us awake and sets us back on the right path.
This push is very important when following the slow perseverance route.&lt;/p&gt;
&lt;h2&gt;Breathe&lt;/h2&gt;
&lt;p&gt;Leave room for yourself to breathe.
Everything in whiplash is so damn fast.&lt;/p&gt;
&lt;p&gt;Ultimately the story of Whiplash in my view is someone who is rushing to success, leaving only chaos and misery on the path.
However, that being said, success does indeed demand sacrifice.
I&apos;m not criticizing the fact that Andrew made sacrifices, I&apos;m just asking myself if the curve of sacrifices and success is a diminishing returns curve.&lt;/p&gt;
&lt;p&gt;Perhaps success can indeed go hand in hand with life with the right amount of sacrifices or perhaps I&apos;m wrong and success indeed does demand the kind of sacrifices Andrew did.
Maybe the reason so many people line up to see their favorite artists, the reason why they are perceived as larger than life is because they are just that.
Someone who literally overcame life, in order to perfect their craft and whether that&apos;s worth it is a deeply personal question.&lt;/p&gt;
</content:encoded><author>Ishan</author></item><item><title>Comfort of Wabi Sabi</title><link>https://www.noobscience.in/blog/wabi-sabi/</link><guid isPermaLink="true">https://www.noobscience.in/blog/wabi-sabi/</guid><description>Comfort of accepting used things</description><pubDate>Sat, 25 Oct 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I love keeping my electronics neat and clean. Generally a pretty shabby person, I seek comfort in the fact that atleast my electronics are clean.
A consequence of which, as you might have excepted, I have a whole cleaning kit for my electronics.
This weekend my Macbook was looking pretty messed up, especially with all of the fingerprints on my screen (which magically seem to appear for no reason what so ever).
So deciding to clean the object I use for 12 hours a day or more, I spray the screen with a special liquid meant for cleaning sensitive screens or atleast advertised to be so.&lt;/p&gt;
&lt;p&gt;Well long story short, I should not have done that. This ended up causing a small scratch on the screen, which upon later reading I found that others have had
experiences worse then what I had with their Macbook screens and cleaning liquids.
I had gotten very lucky.&lt;/p&gt;
&lt;p&gt;Over the next couple of days, I kept using my Macbook as normal, however something in the back of my head just couldn&apos;t let go of the fact that my brand new Macbook is now used in my mind.
I know for a fact that this is wrong grammar but the laptop was essentially no longer new in my head.
This got me interested into why we like new and shiny objects so much.
I didn&apos;t really need to get into a big rabbit hole over it, we know why we like shiny objects: It&apos;s cause they are shiny and new.
It is a universally self explained phenomena.&lt;/p&gt;
&lt;p&gt;This however got me wondering about the opposite: can we come to love used objects too?&lt;/p&gt;
&lt;p&gt;It&apos;s a pretty straight forward yet a beautifully complex topic to think about.
Isn&apos;t the purpose on an object to be used?
If that is true, doesn&apos;t an object being used inherently make it valuable and hence deserve equal amount, if not more amount of love and respect
as compared to the new one?&lt;/p&gt;
&lt;p&gt;Think about your bag that you carry to your school or office, it is something that is so integral to your everyday life, yet if an opportunity to buy a
new bag comes across, you and me would probably jump at it and never think twice about the bag that served you so well.
This really might just me projecting on you the innocent reader, but our seasonal fashion or fast fashion if you may, do validate me to a good extent.&lt;/p&gt;
&lt;h2&gt;Wabi-Sabi&lt;/h2&gt;
&lt;p&gt;This is when I discovered Wabi Sabi.
Here&apos;s Wabi Sabi summarized by an LLM:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;**Wabi-sabi** is a Japanese aesthetic and worldview that finds beauty in imperfection, impermanence, and simplicity.
It values natural wear, irregularity, and the passage of time—seeing these qualities as reflections of authenticity and truth.
Rooted in Zen Buddhism, wabi-sabi encourages mindfulness and appreciation of the transient nature of all things.
In essence, it celebrates the quiet, imperfect beauty of everyday life.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I left in the &lt;code&gt;**&lt;/code&gt; just to rage bait, but that is pretty apt definition of Wabi-Sabi.
I am not familiar with Japanese and this is taken verbatim, but Wabi-Sabi written in Japanese is: 侘寂 (wabi-sabi)&lt;/p&gt;
&lt;p&gt;Wabi (侘) the word suggests a humble, simple, and contented way of life.&lt;/p&gt;
&lt;p&gt;Sabi (寂) the word means the beauty that comes with age&lt;/p&gt;
&lt;p&gt;Together, wabi-sabi roughly translates to the beauty of imperfect, impermanent, and incomplete things.
I love how Zen Buddhism makes everything seem like 10 times more poetic than they are perceived to be, but I do agree.
We don&apos;t appreciate the transient nature of our existence and as an extension of that, the transient nature of everything else around us.&lt;/p&gt;
&lt;p&gt;Another very interesting concept that ties into this is described in the Bhagavad Gita:
The concept of समदुःखसुख (Samaduhkhasukha):&lt;/p&gt;
&lt;p&gt;सम (sama) = equal, balanced
दुःख (duḥkha) = sorrow, pain
सुख (sukha) = happiness, pleasure&lt;/p&gt;
&lt;p&gt;Samaduhkhasukha refers to being level headed and maintaining your cool in both sorrow and happiness.
How we treat our old things talks more about us than how we treat our new things.
How you treat your 3 year old laptop tells me more than how you treat your brand new Macbook.
How you treat your elders talks more about your values than how you treat your friend.&lt;/p&gt;
&lt;p&gt;The concept of Wabi-Sabi has lead to me making some decisions that I am glad I did. Here are some of them:&lt;/p&gt;
&lt;p&gt;I have not updated my blob or my portfolio in over a year and recently I picked up the habit of blogging again.
Normally this would mean that I essentially rewrite my blog&apos;s entire architecture and site. This would most likely result
in me loosing interest and consistency blogging.
I like my current website. I like that it carried me till now. So I shall continue blogging on it.
You are currently reading this blog on a website with legacy.&lt;/p&gt;
&lt;p&gt;After getting my first Macbook, my first instinct was to buy the latest iPhone.
My Andriod phone has served me well and continues to do so.
I am glad I did not buy an iPhone for the sake of it. If I do end up buying one, it shall be with the proper reasons If I do end up buying one, it shall be with proper reasons.&lt;/p&gt;
&lt;p&gt;There are many more cases where this has helped me think things through and appreciate the beauty of used objects more.&lt;/p&gt;
&lt;h2&gt;Pitfalls&lt;/h2&gt;
&lt;p&gt;This is not to say that there are not pitfalls to this kind of thinking.
I do take the shiny object.
I did not stick to older programming practices even after the advent of AI.&lt;/p&gt;
&lt;p&gt;It is equally important to know when to choose the shiny object.
The only ask is to choose it wisely and to always respect the legacy of the used object that led you to obtain the shiny one.&lt;/p&gt;
&lt;p&gt;You don&apos;t break your starter house in Minecraft when building a new one, but don&apos;t live in the mud shack forever as well.&lt;/p&gt;
</content:encoded><author>Ishan</author></item><item><title>Simple Web Augmented Generation</title><link>https://www.noobscience.in/blog/simple_web_rag/</link><guid isPermaLink="true">https://www.noobscience.in/blog/simple_web_rag/</guid><description>A guide to building a simple web application using augmented generation.</description><pubDate>Mon, 10 Mar 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I see a lot of projects using &lt;a href=&quot;https://tavily.com/&quot;&gt;Travily&lt;/a&gt; which is paid to integrate well, a web search
to augment the LLM response.
While this is a pretty great way to integrate web search into your llm application, most times, it is kinda
overkill. Why use something well made when you can make a wonky version on your own? (Sarcastic)&lt;/p&gt;
&lt;p&gt;Well this is mostly just a tutorial of how to go about doing something like this, but if you are building a production application,
you should consider using a more robust solution like &lt;a href=&quot;https://tavily.com/&quot;&gt;Travily&lt;/a&gt;.
Our version does a pretty simple web search and scrapping which may or may not be enough for your needs.
It&apos;s a good starting point though and you will be pretty surprised how good LLM&apos;s are at
responding correctly even with the smallest of context.&lt;/p&gt;
&lt;h2&gt;1. Duckduckgo Search&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://pypi.org/project/duckduckgo-search/&quot;&gt;DDG&lt;/a&gt; is a simple python library wrapper built for
duckduckgo search.
It is an unoffical scraper based api for duckduckgo search.
This however is sufficient for our needs.
We first setup a simple web scraper using &lt;a href=&quot;https://www.crummy.com/software/BeautifulSoup/bs4/doc/&quot;&gt;BeautifulSoup&lt;/a&gt; and &lt;a href=&quot;https://docs.python-requests.org/en/master/&quot;&gt;Requests&lt;/a&gt;.
We then use DDG to query the search results and extract the relevant information.&lt;/p&gt;
&lt;p&gt;We need not care &lt;em&gt;too much&lt;/em&gt; about what we are actually scraping from the website, as long as we have something.
The context would later be filtered out using an embedding model.
So we write some simple regex and tag filtering to extract information of a particular site.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;class Scraper:
    def __init__(self):
        self.ddgs = DDGS()

    def get_urls(self, query, max_results=2):
        return self.ddgs.text(query, max_results=max_results)

    def _get_html(self, url):
        return requests.get(url).text

    def extract_text(self, site):
        html = self._get_html(site[&quot;href&quot;])
        soup = bs4.BeautifulSoup(html, &quot;html.parser&quot;)
        for element in soup.find_all([&quot;script&quot;, &quot;style&quot;, &quot;header&quot;, &quot;footer&quot;, &quot;nav&quot;]):
            element.decompose()
        priority_tags = [&quot;article&quot;, &quot;main&quot;, &apos;div[role=&quot;main&quot;]&apos;, &quot;.content&quot;, &quot;#content&quot;]
        for selector in priority_tags:
            content = soup.select(selector)
            if content:
                text = &quot; &quot;.join(tag.get_text(separator=&quot; &quot;, strip=True) for tag in content)
                return re.sub(r&quot;\s+&quot;, &quot; &quot;, text)
        text = body.get_text(separator=&quot; &quot;, strip=True)
        text = re.sub(r&quot;\s+&quot;, &quot; &quot;, text)
        return text
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We also make sure to remove all the script tags and style tags from the HTML so as to not waste
compute time making embeddings for them.&lt;/p&gt;
&lt;p&gt;Now that we have a very simple scraper, we next need to generate embeddings for the extracted text and
store it in the database&lt;/p&gt;
&lt;h2&gt;2. PGVector&lt;/h2&gt;
&lt;p&gt;PGVector is a PostgreSQL extension that allows you to store and query vector data efficiently.
It provides a set of functions and operators for working with vector data,
including similarity search and distance calculations.&lt;/p&gt;
&lt;p&gt;We will be using PGVector with langchain to store embeddings in the database and perform similarity search on them.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;from langchain_postgres import PGVector

store = PGVector(
embeddings=self.embeddings,
connection=_make_sqlalchemy_uri(),
collection_name=&quot;webrag&quot;,
)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We will now also write a &lt;code&gt;add_embeddings&lt;/code&gt; and &lt;code&gt;search_embeddings&lt;/code&gt; function to add and search embeddings in the database.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;def _add_embeddings(text, url):
    doc = Document(page_content=text, metadata={&quot;source&quot;: url})
    docs = RecursiveCharacterTextSplitter(chunk_size=2000).split_documents([doc])
    return store.add_documents(docs)

def _search_embeddings(query):
    query = embeddings.embed_query(query)
    return store.similarity_search_with_score_by_vector(query, 5)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this code, we essentially create langchain documents from the extracted text,
use a character-based tokenizer to split the text into chunks,
and then add the embeddings to the database.
The search embeddings function takes a query string and returns the top 5 most similar documents from the database.&lt;/p&gt;
&lt;p&gt;We can now combine all of this into a generalized search function that takes a query string and returns the top 5 most similar documents from the database or queries
them from the web.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;def search(query, refresh=False):
    exisiting = _search_embeddings(query)
    if len(exisiting) &amp;gt; 0 and not refresh:
        return exisiting

    urls = scraper.get_urls(query)
    for url in urls:
        text = scraper.extract_text(url)
        if text:
            embeddings = _add_embeddings(text, url[&quot;href&quot;])

    return _search_embeddings(query)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We now get valid data from the web and store it in the database.
This can be improved by adding another table that keeps track of url&apos;s that have already been visited and
skips them if they have already been visited.&lt;/p&gt;
&lt;p&gt;We can now send this as context to a llm to get accurate results.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;question = &quot;Current prime minister of India&quot;
context = search(question)

context_res = &quot;&quot;
for r in context:
    print(&quot;Using source:&quot;, r[0].metadata[&quot;source&quot;], &quot; with confidence:&quot;, r[1])
    context_res += &quot;\n\n&quot; + r[0].page_content

llm = ChatGoogleGenerativeAI(model=&quot;gemini-2.0-flash&quot;, google_api_key=GOOGLE_API_KEY)

prompt_text = prompt.invoke({&quot;context&quot;: context_res, &quot;question&quot;: question})
res = llm.invoke(prompt_text)
print(res)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We now get accurate results from the llm.
A well structured classes based code for the above tutorial is available at &lt;a href=&quot;https://github.com/newtoallofthis123/web_rag&quot;&gt;newtoallofthis123/web_rag&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hope you enjoyed this tutorial!&lt;/p&gt;
</content:encoded><author>Ishan Joshi</author></item><item><title>Awesome Fish functions</title><link>https://www.noobscience.in/blog/awesome-functions/</link><guid isPermaLink="true">https://www.noobscience.in/blog/awesome-functions/</guid><description>Some awesome fish functions that I have accumalated over the years.</description><pubDate>Fri, 03 Jan 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I use fish shell as my default shell and I have recently started writing and accumulating some fish shell functions that you might like
for your own config.&lt;/p&gt;
&lt;p&gt;So here are some of them:&lt;/p&gt;
&lt;h2&gt;Automagical Tmux Session&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;function tm
    set session_name (basename (pwd))

    if tmux has-session -t $session_name
        echo &quot;Tmux session &apos;$session_name&apos; already exists.&quot;
        tmux attach-session -t $session_name
    else
        tmux new-session -s $session_name
    end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Needs: &lt;code&gt;tmux&lt;/code&gt;, Running: &lt;code&gt;tm&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;When run in a dir, it magically opens a new tmux session with the directory name as the session name or attaches to a current tmux session with the directory name.
Very useful, especially in cases when a session manager is an overkill&lt;/p&gt;
&lt;h2&gt;Automagical Zellij&lt;/h2&gt;
&lt;p&gt;I know a lot of people are shifting to zellij, so here is something similar for zellij.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;function zln
    set session_name (basename (pwd))

    set session_exists (zellij list-sessions | grep -w $session_name)

    if test -z &quot;$session_exists&quot;
        echo &quot;Session &apos;$session_name&apos; does not exist. Creating a new session...&quot;
        zellij attach --create $session_name
    else
        zellij attach $session_name
    end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Needs: &lt;code&gt;zellij&lt;/code&gt;, Running: &lt;code&gt;zln&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;Classic Tmux Sessionizer&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;function tz
    set session $(tmux list-sessions | cut -d &apos;:&apos; -f 1 | fzf)
    if test -n &quot;$session&quot;
        tmux attach-session -t $session
    else
        echo &quot;No session selected&quot;
    end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Well you probably don&apos;t need a whole base script just for some simple fzf and cut.&lt;/p&gt;
&lt;p&gt;Needs: &lt;code&gt;fzf,tmux&lt;/code&gt;, Running: &lt;code&gt;tz&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;Fuzzy Nvim Open&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;function nz
    set -l dir $argv[1]
    if test -z &quot;$dir&quot;
    else
        z $dir
    end
    set file $(fzf)
    if test -n &quot;$file&quot;
        nvim $file
    else if test -n &quot;$dir&quot;
        cd $dir
    else
        echo &quot;No file selected&quot;
    end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Uses zoxide to enter a dir before opening fzf to select a file to open in nvim
Saves me a lot of time for quick edits.
Also works if no dir is specified by opening it in the pwd.&lt;/p&gt;
&lt;p&gt;Needs: &lt;code&gt;zoxide,fzf,nvim&lt;/code&gt;, Running: &lt;code&gt;nz [z_dir]&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;Replace File Managers&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;function zz
    set -l dir $argv[1]
    if test -z &quot;$dir&quot;
    else
        z $dir
    end
    set file $(fzf)
    if test -n &quot;$file&quot;
        xdg-open $file
    else if test -n &quot;$dir&quot;
        cd $dir
    else
        echo &quot;No file selected&quot;
    end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Uses zoxide to change directories similar to nz, but opens using xdg-open instead of nvim&lt;/p&gt;
&lt;p&gt;Needs: &lt;code&gt;fzf,zoxide&lt;/code&gt;, Running: &lt;code&gt;zz [dir]&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;Flexible Cat&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;function cat
    if string match -q &quot;*.md&quot; $argv
        glow $argv
    else if file --mime $argv | grep -q &quot;application&quot;
        xxd $argv
    else if file --mime $argv | grep &quot;png&quot;
        wezterm imgcat $argv
    else if test -d $argv
        exa --icons -l $argv
    else
        batcat --style=plain --theme ansi $argv
    end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Okay so this is kinda cursed, but this rebinds cat to use different programs for different file types.
You can change this to your liking and add more programs.&lt;/p&gt;
&lt;p&gt;Needs: &lt;code&gt;glow,xxd,wezterm,exa,batcat&lt;/code&gt;, Running: &lt;code&gt;cat [OPTIONS] [FILES...]&lt;/code&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Those are all I have for now, but let me know if you need more such cursed functions.
Also checkout my YouTube video I made showcasing these:&lt;/p&gt;
&lt;p&gt;&amp;lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube-nocookie.com/embed/AG9TNapzhFc?si=FD9DTIraHxhMOCy0&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot; referrerpolicy=&quot;strict-origin-when-cross-origin&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
</content:encoded><author>Ishan</author></item><item><title>Letting Things Sit</title><link>https://www.noobscience.in/blog/letting-things-sit/</link><guid isPermaLink="true">https://www.noobscience.in/blog/letting-things-sit/</guid><description>My resolution for 2025</description><pubDate>Thu, 02 Jan 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I have a very bad habit of not letting things sitting that I want to try getting rid of in 2025.
By letting things sit I mean consistently sticking to the things that I decide to do and not change it.
It means actually having patience and giving it time.&lt;/p&gt;
&lt;p&gt;The most annoying example I can think of that comes under this category is my habit of changing my neovim config way too often.
So often that I feel that the very purpose of customizing my neovim config is lost.
Something feels like ours only when you give it time.&lt;/p&gt;
&lt;p&gt;This applies not only to my editor example, but also to relationships, electronics and most importantly routines.&lt;/p&gt;
&lt;p&gt;The art of maintaining a routine has been ever elusive to me and I believe that I finally know why: Consistency and Predictability.
I think I am finally at a stage where I can stop experimenting and stick to something.&lt;/p&gt;
&lt;p&gt;Now this has many implications I don&apos;t want to write about on a public blog, but it essentially means quite a bit of self reflection and some major changes.
The effect of this however, would be an overall positive on my blog and my YouTube channel at-least; since I plan on consistent posting on both the platforms.&lt;/p&gt;
&lt;p&gt;So as my new year resolution, I shall stick to stuff; not be swayed that easily and try to bring about an internal locus of validation.&lt;/p&gt;
&lt;p&gt;I know that this will be very hard, but hey no harm in trying :)&lt;/p&gt;
</content:encoded><author>Ishan</author></item><item><title>Consistency</title><link>https://www.noobscience.in/blog/consistency/</link><guid isPermaLink="true">https://www.noobscience.in/blog/consistency/</guid><description>Because this is literally me siting in the garden writing</description><pubDate>Sun, 30 Jun 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;It&apos;s been a while since I last published a blog post, primarily because I&apos;ve been keeping myself
busy doing lots and lots of cool stuff over the past month.
I am writing this blog today, the end of June month, because: a) It&apos;s Sunday today and b) because I wanted
to express what a wonderful month June has been and what all I&apos;ve accomplished.&lt;/p&gt;
&lt;p&gt;Well I am proud to report that I finally have the schedule in place that I&apos;ve oh so been trying to make since the past few months.
I wake up, go to college, come back, blog for a while, then go to the gym: which I&apos;ve been trying to do for atleast 4 days a week.
It has been very helpful and I already feel a lot better. I feel active and overall just better.
I also get stuff done in regards to coding and my job.
My open source work for Summer of Code has also been going pretty well.&lt;/p&gt;
&lt;p&gt;Well what I am trying to say is that I am finally consistent with my schedule and I am very happy about it.
So here&apos;s to consistency and to a better future. 🥂 (It&apos;s apple juice)&lt;/p&gt;
</content:encoded><author>Ishan Joshi</author></item><item><title>Stability</title><link>https://www.noobscience.in/blog/stability/</link><guid isPermaLink="true">https://www.noobscience.in/blog/stability/</guid><pubDate>Sun, 19 May 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I am a tinker at heart. The methods and ways that I learn stuff are quite weird
at times and it shows in the way I use and personalize my development environment.
I use a Lenovo Ideapad laptop with about 10GB of Ram and an AMD processor. Windows 11
came in built with my laptop, although around 6 months ago, I finally made the
long needed shift to Linux.&lt;/p&gt;
&lt;p&gt;So my current setup is an &lt;a href=&quot;https://ubuntu.com/blog/canonical-releases-ubuntu-24-04-noble-numbat&quot;&gt;Ubuntu 24.04 LTS&lt;/a&gt;
laptop, using the default Ubuntu-Gnome Desktop
environment. I sometimes end up using i3, however this is quite rare since wayland seems
to run way better on my laptop. For quite sometime after I made the shift to Linux, I
used to use VSCode with Github Copilot for coding. I was always a terminal guy and after
some learning, I finally started using Neovim and wrote a small config setup for myself.&lt;/p&gt;
&lt;p&gt;My &lt;a href=&quot;https://github.com/newtoallofthis123/nvim-config&quot;&gt;neovim setup&lt;/a&gt; is now quite
a big repo and I use around 70 plugins (Well to be fair, most of them
are colorschemes). I am proud of it and don&apos;t plan on leaving it any soon.
In all this however, I stopped using AI for code completions completely.
I plan on writing a blog post on this soon.
This made a huge impact on me.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;../../assets/nvim_showcase.png&quot; alt=&quot;My Neovim setup&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I also landed on my favourite software on Linux.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Firefox / Brave: For web browsing&lt;/li&gt;
&lt;li&gt;Calibre: For managing my pdf&apos;s&lt;/li&gt;
&lt;li&gt;Warp: For my terminal&lt;/li&gt;
&lt;li&gt;Thunderbird Mail: For my Email&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://flathub.org/apps/org.gnome.gitlab.somas.Apostrophe&quot;&gt;Apostrophe&lt;/a&gt;: For my markdown&lt;/li&gt;
&lt;li&gt;Libreoffice: Office suite&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This setup has been just perfect for me and I slowly trying to stick to it.
This is also partly because I want to work on my attention span and be more mindful and as
much as I like customization, I feel it has to do with my constant need for stimulation.&lt;/p&gt;
&lt;p&gt;So there it is. I finally have a stable setup, that I can use for personal stuff and
work and school.
Kinda perfect, as it should be :)&lt;/p&gt;
</content:encoded><author>Ishan Joshi</author></item><item><title>Hidden pages on a site</title><link>https://www.noobscience.in/blog/hidden-pages/</link><guid isPermaLink="true">https://www.noobscience.in/blog/hidden-pages/</guid><pubDate>Wed, 15 May 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The art and joy of having and maintaining a website is one that is an ever declining trend.
It was just a decade ago when people would have really cool sites that had really awesome and nostalgic animations and colors: it was a treat.
To be fair, I was only 8 a decade ago, so the only websites my 8 year old brain liked were colorful.&lt;/p&gt;
&lt;p&gt;However, if you are among the rare few who actually like having their own little space on the web, first up: &lt;em&gt;Hi! I&apos;m Ishan&lt;/em&gt; and second, I have a really neat trick for you.
&lt;strong&gt;Have hidden pages on your website&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Well the sentence is kinda self explanatory, but what I mean by hidden pages, are pages whose existence only you know about.
If you have a &lt;code&gt;robots.txt&lt;/code&gt; file on your site, be sure to unindex the pages, exclude them from your &lt;code&gt;sitemap.xml&lt;/code&gt;: They should essentially be incognito.&lt;/p&gt;
&lt;p&gt;Now this has many advantages.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You can have semi private stuff on there: Think family photos, a small journal or anything that you would like on the website, but not directly to anyone.
Now even if you take all of these measures, if someone really wanted to index your site, they would. Hence why I called it semi private; but hey, base it off of your security and privacy model.&lt;/li&gt;
&lt;li&gt;Sharable Link: You have an instantly sharable link to stuff that you might need to share often: Think licenses, credits, your setup etc.&lt;/li&gt;
&lt;li&gt;Just cool:
If you are anything like me, you will definitely enjoy the feeling of having something like that exist.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;How do I implement this?&lt;/h2&gt;
&lt;p&gt;Well for my site atleast, there are alot of hidden pages. There are pages leading to some of my notes, personal links etc.&lt;/p&gt;
&lt;p&gt;So to implement this, all you really need to do is to not include a link of the page anywhere on your site, exclude it from the sitemap and robots file and you should be good to go. If you are storing stuff like photos, I recommend that you password protect the page or delay the render of the image to futher prevent indexing.&lt;/p&gt;
&lt;p&gt;I know this post is kinda weird, but hey, this is my blog 😄&lt;/p&gt;
</content:encoded><author>Ishan Joshi</author></item><item><title>New Domain!!</title><link>https://www.noobscience.in/blog/new-domain/</link><guid isPermaLink="true">https://www.noobscience.in/blog/new-domain/</guid><pubDate>Mon, 13 May 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;If you&apos;re on the site, you will notice that it is now &lt;code&gt;noobscience.in&lt;/code&gt;!!
I just purchased the domain and I plan on owning it for the forseeable future.&lt;/p&gt;
&lt;p&gt;I was unable to decide between &lt;code&gt;noobscience.com&lt;/code&gt; and &lt;code&gt;noobscience.in&lt;/code&gt;, however, since I am
Indian and also, the &lt;code&gt;.in&lt;/code&gt; domain was cheaper (almost 15%!): I decided to go with the later.&lt;/p&gt;
&lt;p&gt;It really is a very special thing to own a domain. It is like you own a small part of land rights on the
internet. I know this is a bad metaphor, for one owning a domain is like having a name with nothing
to attach the name to.&lt;/p&gt;
&lt;p&gt;However, owning a site has become more accessible and easier than ever, with startups like Vercel
and Netlify owning huge chunks of the market for the &quot;early devs&quot; to go hosting.&lt;/p&gt;
&lt;p&gt;I use vercel as well and it has been quite a good experince, especially with the usually hectic stuff like
CNAME&apos;s and stuff. Vercel makes it quite easy. Also a free SSL certificate and automatic www redirection?
Who can say no to that!&lt;/p&gt;
&lt;p&gt;Regardless, I am quite excited to be the proud owner of &lt;code&gt;noobscience.in&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Thank you for reading :)&lt;/p&gt;
</content:encoded><author>Ishan Joshi</author></item><item><title>Vim Mistakes</title><link>https://www.noobscience.in/blog/vim/</link><guid isPermaLink="true">https://www.noobscience.in/blog/vim/</guid><description>What you are refering to as Vim is actually Neovim, or as I&apos;ve recently taken to calling it, NeoVim Or Vim...</description><pubDate>Tue, 20 Feb 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Vim oh vim.&lt;/p&gt;
&lt;p&gt;If you don&apos;t know (you probably wouldn&apos;t), but I am a huge fan of all the nerdy
stuff like ricing, linux and all that jazz. However, the one thing that was &lt;em&gt;very&lt;/em&gt;
apparent was that I was not using Vim.
And it was not that I hadn&apos;t tried it before, I has, but I just couldn&apos;t get the
hang of it. That is until recently and I realize the 3 mistakes that I was making.&lt;/p&gt;
&lt;p&gt;So, this blog post is a reminder to myself and to anyone who is trying to get into
Vim or anything in general.&lt;/p&gt;
&lt;h3&gt;1. Don&apos;t Learn Something, Use It&lt;/h3&gt;
&lt;p&gt;This is great advice in general for anything that you are trying to learn. But it
is especially true for Vim. I had tried to learn Vim by watching tutorials on it,
&lt;em&gt;copying&lt;/em&gt; other people&apos;s dotfiles and trying to read the documentation. But none
of that worked. It was only when I started using it for my daily tasks in Neovim
that I was able to get the hang of it.&lt;/p&gt;
&lt;p&gt;Now if you really think about it, this makes sense. All the traditional media points
to the general observation that you learn by doing. And that is true for Vim as well.&lt;/p&gt;
&lt;p&gt;In my case, I got started with vim when I was watching a Streamer called &lt;a href=&quot;https://www.twitch.tv/theprimeagen&quot;&gt;ThePrimeagen&lt;/a&gt; who was using Vim. I was intrigued and I started using it.
He was just so fast and efficient with it while I was struggling to even open a file properly.&lt;/p&gt;
&lt;p&gt;So, if you are still not using Vim, just start using it. It will be hard at first, but
you will get the hang of it.&lt;/p&gt;
&lt;h3&gt;2. Write your own config&lt;/h3&gt;
&lt;p&gt;The most critical mistake I made in my Vim journey was to copy other people&apos;s dotfiles.
They are called &lt;em&gt;dotfiles&lt;/em&gt; for a reason. They are personal to that user&apos;s home directory.
This applies even to the Vim config. I had copied a lot of people&apos;s dotfiles and tried to
achieve way too much way too quickly.&lt;/p&gt;
&lt;p&gt;So here&apos;s how I recommend you approach it instead, or atleast how it worked for me.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install a Vim Motions Plugin in your Editor of choice and learn vim motions. After this stage, even if you don&apos;t want to switch to vim, no problem. Just knowing Vim motions alone is awesome.&lt;/li&gt;
&lt;li&gt;Now that you know Vim motions, install Neovim onto your system and start using it for small tasks. By small, I mean
quite a few small tasks. One more important thing: Don&apos;t use any plugins at this stage. Just use the default Neovim.&lt;/li&gt;
&lt;li&gt;Customize the Experience a bit. Donot install any plugins yet. Just change the colorscheme, the font and the line numbers, stuff like that&lt;/li&gt;
&lt;li&gt;Now that you are comfortable with the default Neovim, start installing plugins. But don&apos;t go overboard. Just install a few plugins that you think you need. For me, it was &lt;code&gt;tree-sitter&lt;/code&gt; , &lt;code&gt;telescope&lt;/code&gt; and &lt;code&gt;nerdtree&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;LSP up baby! Now that you are comfortable with the plugins, start using LSP. This is the stage where you will start to feel the power of Neovim.&lt;/li&gt;
&lt;li&gt;Now that you are comfortable with LSP, start installing more plugins.
You are allowed to go overboard now. I recommend you use a package manager like &lt;code&gt;lazy-nvim&lt;/code&gt; in order to manage your plugins.&lt;/li&gt;
&lt;li&gt;Tweet that you use Neovim BTW.&lt;/li&gt;
&lt;li&gt;Start using tmux and Neovim together. This is the stage where you will start to feel like a hacker.&lt;/li&gt;
&lt;li&gt;And voila! You are a Vim user that never has to leave the terminal.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;3. Don&apos;t Make Vim into VSCode&lt;/h3&gt;
&lt;p&gt;In my personal opinion, the biggest mistake that people make when they start using Vim is that they try to make it into VSCode. They install a ton of plugins, a ton of themes and a ton of other stuff that makes it into a bloated mess.
This is not the way to go.
Vim is supposed to be &lt;em&gt;fast&lt;/em&gt; and meant for &lt;em&gt;you&lt;/em&gt; to be efficient. If you are using Vim and you are not efficient, then you are doing something wrong.
So, don&apos;t make Vim into VSCode. Use it for what it is. A fast and efficient text editor.&lt;/p&gt;
&lt;p&gt;So, these are the 3 mistakes that I made when I started using Vim. I hope that you don&apos;t make the same mistakes that I did.
If you liked this blog, be sure to share it with a noobie that is trying to get into Vim, I know I would have appreciated it when I was starting out.&lt;/p&gt;
&lt;p&gt;-- Ishan&lt;/p&gt;
</content:encoded><author>Ishan</author></item><item><title>Php is awesome!</title><link>https://www.noobscience.in/blog/php/</link><guid isPermaLink="true">https://www.noobscience.in/blog/php/</guid><description>Just started using PHP! Where&apos;s My Lambo?</description><pubDate>Sat, 27 Jan 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;PHP just feels like what my whole web development journey basically condenses down to.
I mean, it just works. I don&apos;t have to worry about anything. I just write some code and it works.&lt;/p&gt;
&lt;p&gt;This is not how I usually like it. I use Languages like Rust and Go for most of my projects and now you are telling me
that an integer is not an integer but a string? What the hell is that? But I don&apos;t know why I like it. It just feels right.
I mean, don&apos;t get me wrong. I am not like a &quot;interpreter&quot; guy. I like my code to be compiled and optimized. But PHP is just
a small little exception.&lt;/p&gt;
&lt;p&gt;One of my favorite things about PHP is that it literally does what it says, it is a &quot;Hypertext Preprocessor&quot;. It is not a
&lt;em&gt;programming language (although it is)&lt;/em&gt;, it is a preprocessor. It is meant to be used with HTML. And that is what I like about it.&lt;/p&gt;
&lt;p&gt;I just fits right into the whole dev process.&lt;/p&gt;
&lt;p&gt;So, for example, let&apos;s say I want to use the &lt;code&gt;?id&lt;/code&gt; query parameter to display a different message on the page. I can do that
with PHP like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?php
$id = $_GET[&apos;id&apos;];

if ($id == 1) {
    echo &quot;Hello World!&quot;;
} else {
    echo &quot;Goodbye World!&quot;;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That&apos;s it. It just integrates so well at a server level.&lt;/p&gt;
&lt;p&gt;Anyways, that&apos;s it for my little rant. I am going to go back to my PHP project now. Bye!&lt;/p&gt;
</content:encoded><author>Ishan</author></item><item><title>23 going 24</title><link>https://www.noobscience.in/blog/2024/</link><guid isPermaLink="true">https://www.noobscience.in/blog/2024/</guid><description>What i have planned for 2024</description><pubDate>Mon, 01 Jan 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;2023 was a blast of a year. There were many ups and downs, mostly ups, but bird&apos;s view, it was fabulous.&lt;/p&gt;
&lt;p&gt;2023 was filled with achievements. Some in public, some in my personal life, but yeah, man was this year huge for me. I began college, started actually working on my software journey...you know what, let me do it in bullets so I can feel proud&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Bought a new domain&lt;/li&gt;
&lt;li&gt;Started my site (the one you are now rn!)&lt;/li&gt;
&lt;li&gt;Started college&lt;/li&gt;
&lt;li&gt;Learnt languages other than python&lt;/li&gt;
&lt;li&gt;Typescript, Golang, Rust&lt;/li&gt;
&lt;li&gt;Became a rust fanboy&lt;/li&gt;
&lt;li&gt;Participated and cleared Hacktoberfest&lt;/li&gt;
&lt;li&gt;Participated in my first hackathon and lost&lt;/li&gt;
&lt;li&gt;Decided to go the backend way 😄&lt;/li&gt;
&lt;li&gt;Did 15 problems on Advent of Code&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Man was I productive.&lt;/p&gt;
&lt;p&gt;This year though is going to be bigger and better. I have a lot planned for this year. Here is one more list ( ordered on priority )&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Gonna come up with a product idea&lt;/li&gt;
&lt;li&gt;Gonna concentrate on my health, get some exercise done&lt;/li&gt;
&lt;li&gt;Create a dev tool&lt;/li&gt;
&lt;li&gt;Write a lot more&lt;/li&gt;
&lt;li&gt;Go deeper on stuff I know&lt;/li&gt;
&lt;li&gt;Partipate in GSOC&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Doing all of this is not gonna be easy, but gotta do what I want to / gotta do 😄&lt;/p&gt;
&lt;p&gt;Anyways, Happy New year. Hope this year is cool for you as well.&lt;/p&gt;
&lt;p&gt;PS: Quite proud of the fact that I am able to publish this from my mobile. Thanks Vercel.&lt;/p&gt;
</content:encoded><author>Ishan</author></item><item><title>No Domain Anymore??</title><link>https://www.noobscience.in/blog/nodomain/</link><guid isPermaLink="true">https://www.noobscience.in/blog/nodomain/</guid><description>I am not the biggest fan of this decision (that I took) but well</description><pubDate>Mon, 25 Dec 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Well yes you read that right.&lt;/p&gt;
&lt;p&gt;I am retiring the domain noobscience(dot)rocks this year. Well to understand my thinking behind this move, you need to understand the brief history of my domain and how I got it in the first place.
Well, the TLDR is that I am a student and if you are still interested in reading, don&apos;t worry, I recently disabled copilot in Neovim so I am in no mood of writing long texts either.&lt;/p&gt;
&lt;p&gt;So, if you are student, I am sure you are aware of GitHub Student Developer Pack, the awesome Education benefits that GitHub offers to students.
This includes a free domain for one year offered by the popular service provider Name(dot)com.
Let me make it completely clear, this is not a blog post dissing Name(dot)com. They are execllent at what they do. This has more to do with me and the boundaries that I set up for myself.&lt;/p&gt;
&lt;p&gt;The domain as I had mentioned earlier, the domain was only free for an year and when I was booking it, I had forgotten to see the actual price of it.
Well let&apos;s just say that a small domain like noobscience(dot)rocks is not cheap &lt;em&gt;at all&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;So I guess that marks the end of that.&lt;/p&gt;
&lt;p&gt;It was always a dream of mine to show up in search results. I know &lt;strong&gt;lame&lt;/strong&gt;, but hey, I did achieve that and I am quite grateful for that.&lt;/p&gt;
&lt;p&gt;So, thanks &lt;code&gt;noobscience(dot)rocks&lt;/code&gt;. I may replace you, but you&apos;ll always have a special place in my heart.
As the first domain I ever owned.
So here&apos;s to one and a lot more to come.&lt;/p&gt;
</content:encoded><author>Ishan</author></item><item><title>Changes And More!</title><link>https://www.noobscience.in/blog/changes/</link><guid isPermaLink="true">https://www.noobscience.in/blog/changes/</guid><description>We&apos;re So Back!</description><pubDate>Wed, 20 Dec 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;A Website is a living thing. It&apos;s always changing, always evolving. And so is this one.
However, over the past 4 months, I&apos;ve not really been able to work on this site.
I&apos;ve been really contemplating what I want to do with this site, and I&apos;ve finally come to a conclusion.&lt;/p&gt;
&lt;p&gt;So, welcome to the new site! I&apos;ve decided to move away from the old site, and start fresh.&lt;/p&gt;
&lt;h2&gt;Why?&lt;/h2&gt;
&lt;p&gt;Well, for one, I am a digital hoarder and I like to keep everything I&apos;ve ever made. This site was no exception. I had a lot of old posts, old and bulky
code that was hard to maintain and really a lot of stuff that I didn&apos;t need. So, I decided to start fresh. I&apos;ve also been learning a lot of new things, and I wanted to implement them in this site.
BTW, the site is still written in Astro.&lt;/p&gt;
&lt;p&gt;With the amount of maintainance and work each blog post or project update needed, I was really unmotivated to write anything.
The whole point of my site was to write about my projects and stuff, which I love.&lt;/p&gt;
&lt;h2&gt;What&apos;s New?&lt;/h2&gt;
&lt;p&gt;The site is now a lot more minimalistic. I&apos;ve removed a lot of the clutter, and I&apos;ve also removed the blog posts. I&apos;ve decided to move to a more microblogging style of writing, and I&apos;ll be posting more often.
No more long posts, just short and sweet updates. I&apos;ve also added a new section called &quot;Projects&quot;, where I&apos;ll be posting about my projects.&lt;/p&gt;
&lt;p&gt;All the old utilities like the &lt;a href=&quot;https://nutils.vercel.app/go&quot;&gt;URL Shortener&lt;/a&gt; and &lt;a href=&quot;https://nutils.vercel.app/code&quot;&gt;Pastebin&lt;/a&gt; are no longer on this site, but are instead hosted on a new Next.js site. It is still under heavy development, but you can check it out &lt;a href=&quot;https://nutils.vercel.app&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;What&apos;s Next?&lt;/h2&gt;
&lt;p&gt;Well get ready for a blast. This is a blazingly fast &lt;em&gt;almost static site&lt;/em&gt; that makes it incredibly easy to write and publish posts.
So, easy access, easy writing, and easy publishing. I&apos;m really excited to start writing again, and I hope to catch you in the next post!&lt;/p&gt;
&lt;h2&gt;Thanks!&lt;/h2&gt;
&lt;p&gt;This site is really meant for people like you, who read my posts and use my utilities. So, thank you for being here, and I hope you enjoy the new site!&lt;/p&gt;
</content:encoded><author>Ishan</author></item><item><title>Writing a CMS in Rust</title><link>https://www.noobscience.in/blog/cms/</link><guid isPermaLink="true">https://www.noobscience.in/blog/cms/</guid><description>Before you get mad, hear me out. CMS doesn&apos;t need to have a bloated admin panel. This is the story of how I wrote a CMS in Rust.</description><pubDate>Mon, 21 Aug 2023 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;So, CMS is something that I always loved using. I just like the idea of having a service that controls your service.
I mean, it&apos;s like a service-ception. But, I always hated the idea of having a bloated admin panel.
I mean, why do you need a whole admin panel for a blog that you can manage with a CLI tool?
You can if you want to, but then why not just integrate it with your blog?
If you do that, you would need to do so many things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Need to configure secure routes&lt;/li&gt;
&lt;li&gt;Add authentication&lt;/li&gt;
&lt;li&gt;Manage Access Control&lt;/li&gt;
&lt;li&gt;Basically a lot of things&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, I thought why not just write a CLI tool that handles all the stuff for you and since I had been learning Rust, I thought why not write it in Rust?
Hence, welcome the Noob Handler.&lt;/p&gt;
&lt;h2&gt;Why Write in Rust?&lt;/h2&gt;
&lt;p&gt;I basically love CLI tools. They are a great and &lt;em&gt;easy&lt;/em&gt; way to get things done.
They are also so easy to ship. No need to check some weird windows compatibility or anything.
Just compile it and ship it. That&apos;s it. And, Rust is a great language for writing CLI tools.
It&apos;s fast, it&apos;s easy to write, and it&apos;s easy to ship.
You get an executable on the spot. Moreover, you get an executable that is fast and small in size.
No weird dependencies folder that needs to be shipped or anything.&lt;/p&gt;
&lt;h3&gt;Why not python?&lt;/h3&gt;
&lt;p&gt;Python on the other hand, atleast in my opinion, has the worst executable experience.
To compile a python file, you might end up using a library like &lt;code&gt;pyinstaller&lt;/code&gt; or something.
And, even then, you would end up with a huge executable. I mean, I don&apos;t want to ship a 100MB executable for a CLI tool.
That&apos;s just too much. Moreover, let&apos;s actually look at how pyinstaller works.&lt;/p&gt;
&lt;p&gt;So, you see, pyinstaller works primarily by creating a virtual environment and then installing all the dependencies in that virtual environment.
Then, it creates all the necessary binding to &lt;em&gt;all&lt;/em&gt; the dependencies in cpython. And, then it creates an executable.
This executable is just for name sake. It&apos;s just a wrapper around the virtual environment.
So, when you run the executable, it just runs the virtual environment and then runs the python file.
This slows down the execution time and also increases the size of the executable.
That in the long run is not good for a CLI tool. That brings us to an important conclusion.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Python is not meant to be compiled, it is meant to be interpreted.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Don&apos;t get me wrong, python has these cool libraries like &lt;code&gt;rich&lt;/code&gt; that make writing CLI tools in python a breeze.
I have worked with &lt;code&gt;rich&lt;/code&gt; in the past and it is one of my favorite libraries. However, it is best when
it is used as a script. I use rich to style my scripts and it works great. But, when it comes to writing a CLI tool,
I would rather use a language that is meant to be compiled.&lt;/p&gt;
&lt;h3&gt;Rust is awesome&lt;/h3&gt;
&lt;p&gt;So, welcome Rust.
Rust has a bunch of libraries that make writing CLI tools a breeze.
You have one for asking questions, one for styling, one for parsing arguments, and so on.
It is python with the speed of C and the safety of Haskell. What more can you ask for?
Actually scrap that. You can&apos;t really compare Rust with any other language.
It is it&apos;s own thing and it is great at what it does.&lt;/p&gt;
&lt;p&gt;Here are some things that made me choose Rust:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Great Type System&lt;/li&gt;
&lt;li&gt;Simple to use package manager&lt;/li&gt;
&lt;li&gt;Well documented libraries for CLI tools&lt;/li&gt;
&lt;li&gt;Single Binary executable&lt;/li&gt;
&lt;li&gt;Fast execution&lt;/li&gt;
&lt;li&gt;Good error handling&lt;/li&gt;
&lt;li&gt;Great community&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you feel that I just listed the most generic reasons to use Rust, you are right.
I mean, there is a reason why so many CLI&apos;s are written in Rust.
Infact, there is a whole community for rewriting &lt;code&gt;GNU/Linux&lt;/code&gt; tools in Rust.
So, for example, you might have heard of &lt;code&gt;bat&lt;/code&gt; which is a replacement for &lt;code&gt;cat&lt;/code&gt;.
It has some cool features like syntax highlighting and stuff like that, you have &lt;code&gt;exa&lt;/code&gt; which is a replacement for &lt;code&gt;ls&lt;/code&gt; with some cool features like icons.
You basically have a sub community in rust that is interested in command line tools.&lt;/p&gt;
&lt;h2&gt;What is a CMS?&lt;/h2&gt;
&lt;p&gt;Well, if you are unfamiliar with the term CMS, it stands for Content Management System.
So, the idea behind it is that instead of your content being changed at deployment time, it is changed at runtime.
Let me explain. So, let&apos;s say you use Astro to build your website. You have a bunch of markdown files that you use to generate your website.
Now, let&apos;s say you want to add a new blog post. You would have to add a new markdown file and then deploy your website.
This is the traditional way of doing things. However, with a CMS, you can just add a new blog post from the admin panel and it would be added to your website.
This is because your website will be reading off a remote database and not a local markdown file.&lt;/p&gt;
&lt;p&gt;Now, my current blog is written using markdown files. I have a bunch of markdown files that are run through some remark plugins and then converted to HTML by Astro.
Nothing fancy. This is because my blog posts usually take a lot of time to write and I don&apos;t really write them that often.
Hence, when I do write them, I just add a markdown file and then deploy my website. It&apos;s not that big of a deal.&lt;/p&gt;
&lt;p&gt;However, I have a page called &lt;code&gt;quips&lt;/code&gt; where I write little updates about my life. I write them pretty often and I don&apos;t really want to deploy my website every time I write a new quip.
Hence, I use a MongoDB database to store my quips. I have a simple API that I use to add new quips and then I have a page that fetches all the quips from the database and displays them.
This is a CMS. I am managing my content from a remote database.&lt;/p&gt;
&lt;p&gt;Along with quips, I have two other pages that use a database.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;/code&quot;&gt;NoobPaste Mini&lt;/a&gt;: A simple and minimal pastebin that I use to share code snippets.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/go&quot;&gt;NoobShort&lt;/a&gt;: A simple URL shortener that I use to shorten URLs.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Both of these use a database to store their data. I have a simple API that I use to add new pastes and new URLs.
I actually have a NoobShort CLI that you can check out at &lt;a href=&quot;https://github.com/newtoallofthis123/short_cli&quot;&gt;newtoallofthis123/short_cli&lt;/a&gt;.
It is quite easy to use and it is one of the first CLI&apos;s that I wrote in Rust.
You can just install it using &lt;code&gt;cargo install nshrt&lt;/code&gt; and then you can use it to shorten URLs.&lt;/p&gt;
&lt;p&gt;Anyways, getting back to the topic at hand, I have a bunch of pages that use a database to store their data.
All this is stored using a MongoDB database. I use MongoDB because it is easy to use and it is easy to setup.
So, MongoDB has a very easy to use rust driver called &lt;code&gt;mongodb&lt;/code&gt;. It is well documented and it is easy to use.
I have used it in the past and I have had no issues with it. So, I decided to use it for my CMS.&lt;/p&gt;
&lt;h2&gt;The Plan&lt;/h2&gt;
&lt;p&gt;The plan is simple. I want to write a CLI tool that can be used to manage my content.
I had to manage three types of content with the following B-JSON schemas:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Quips
{
    &quot;_id&quot;: &quot;ObjectId&quot;,
    &quot;hash&quot;: &quot;String&quot;,
    &quot;name&quot;: &quot;String&quot;,
    &quot;content&quot;: &quot;String&quot;,
    &quot;date&quot;: &quot;String&quot;,
    &quot;author&quot;: &quot;String&quot;,
}

// Code
{
    &quot;_id&quot;: &quot;ObjectId&quot;,
    &quot;hash&quot;: &quot;String&quot;,
    &quot;title&quot;: &quot;String&quot;,
    &quot;content&quot;: &quot;String&quot;,
    &quot;lang&quot;: &quot;String&quot;,
    &quot;author&quot;: &quot;String&quot;,
}

// GO
{
    &quot;_id&quot;: &quot;ObjectId&quot;,
    &quot;url&quot;: &quot;String&quot;,
    &quot;slug&quot;: &quot;String&quot;,
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So, the idea was that each of these had the following operations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show&lt;/li&gt;
&lt;li&gt;Add&lt;/li&gt;
&lt;li&gt;Edit&lt;/li&gt;
&lt;li&gt;Delete
The &lt;strong&gt;CRUD&lt;/strong&gt; operations if you may. The CLI would have the following commands:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;handler __doc__ __hash__

handler new __doc__

handler list __doc__
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;strong&gt;doc&lt;/strong&gt; can be either &lt;code&gt;quips&lt;/code&gt;, &lt;code&gt;code&lt;/code&gt;, or &lt;code&gt;go&lt;/code&gt;. The &lt;code&gt;__hash__&lt;/code&gt; is the hash of the document that you want to edit or delete.&lt;/p&gt;
&lt;p&gt;The list was basically show and search combined. It would show all the documents and then you could search for a specific document.
This could be done natively using the &lt;code&gt;inquire&lt;/code&gt; crate, but more on that later.&lt;/p&gt;
&lt;h3&gt;Summary of the Plan&lt;/h3&gt;
&lt;p&gt;So, let&apos;s summarize the plan:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Connect to MongoDB&lt;/li&gt;
&lt;li&gt;Enable CRUD operations on the database&lt;/li&gt;
&lt;li&gt;Add a CLI interface to the CRUD operations&lt;/li&gt;
&lt;li&gt;Add New, Edit, and Delete operations&lt;/li&gt;
&lt;li&gt;Add a list operation&lt;/li&gt;
&lt;li&gt;Make everything as native and as fast as possible&lt;/li&gt;
&lt;li&gt;Make it look pretty&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let&apos;s take all these head on and see how we can implement them.&lt;/p&gt;
&lt;h2&gt;Solving the Problems&lt;/h2&gt;
&lt;p&gt;First up was actually setting up the database. I already had a database with the given collections.
I just used the URI of it and connected to it using the &lt;code&gt;mongodb&lt;/code&gt; crate. It was pretty easy to do.
It looks something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;async fn get_connection() -&amp;gt; Result&amp;lt;Client, mongodb::error::Error&amp;gt; {
    let client = Client::with_uri_str(get_mongo_url()).await?;
    Ok(client)
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;get_mongo_url&lt;/code&gt; function just returns the URI of the database. I have it stored in an environment variable so that
I don&apos;t have to hardcode it in the code. I just use the &lt;code&gt;dotenv&lt;/code&gt; crate to load the environment variables.&lt;/p&gt;
&lt;p&gt;Next up was actually enabling CRUD operations on the database. This was pretty easy to do as well.
So, the &lt;code&gt;mongodb&lt;/code&gt; crate has a &lt;code&gt;Collection&lt;/code&gt; struct that you can use to interact with the database.
I predefine the collections and then I just use the &lt;code&gt;Collection&lt;/code&gt; struct to interact with the database.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Page{
    pub _id: ObjectId,
    pub hash: String,
    pub name: String,
    pub content: String,
    pub date: String,
    pub author: String,
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The collections use &lt;code&gt;serde&lt;/code&gt; to automatically serialize and deserialize the data.
Next, I can use the inbuilt functions of the collections struct like &lt;code&gt;insert_one&lt;/code&gt;, &lt;code&gt;find_one&lt;/code&gt;, &lt;code&gt;find&lt;/code&gt;, &lt;code&gt;delete_one&lt;/code&gt;, and &lt;code&gt;update_one&lt;/code&gt; to interact with the database.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pub async fn get_page(hash: &amp;amp;str)-&amp;gt;Page{
    let collection = get_page_conn().await;
    let result = collection.find_one(doc! {&quot;hash&quot;: hash}, None).await.unwrap();
    result.expect(&quot;Page Not Found&quot;)
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So, that is one of the functions that I use to get a page from the database. I just use the &lt;code&gt;find_one&lt;/code&gt; function to find a page with the given hash.
The &lt;code&gt;doc!&lt;/code&gt; macro is very handy and is used to create a BSON document. It is basically a JSON object that is used to query the database.
If you are starting to see a pattern here, you are right. The mongodb driver for rust is basically an ORM for MongoDB.
One thing that I forgot to mention, all this set up with tokio and futures so that the whole execution is blocked till the database operation is complete.
This makes it easier to avoid type errors and stuff like that.&lt;/p&gt;
&lt;h3&gt;CLI and Inquire&lt;/h3&gt;
&lt;p&gt;Next up was actually adding a CLI interface to the CRUD operations. This was pretty easy to do as well.
I use the &lt;code&gt;clap&lt;/code&gt; crate to parse the arguments and then I use the &lt;code&gt;inquire&lt;/code&gt; crate to ask questions.
The clap crate is pretty easy to use. You just define the arguments in a struct and then you use the clap macros to parse the arguments.
It looks something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#[derive(Parser, Debug)]
#[command(name=&quot;Handler&quot;, author=&quot;Ishan Joshi&quot;, version, about=&quot;A Simple CLI to handle my site&quot;, long_about = None)]

// The Args struct is used to parse the command line arguments
struct Args {
    #[arg(required=true)]
    option: String,

    #[arg(required=false)]
    hash: Option&amp;lt;String&amp;gt;,
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That&apos;s it! It is that simple. This comes with everything, the help command, the version command, and so on.
You can also add your own commands and subcommands. I just use the arg macro to define the arguments.
We get the arguments by calling the &lt;code&gt;Args::parse()&lt;/code&gt; function. This returns a struct with the parsed arguments.&lt;/p&gt;
&lt;p&gt;Although, I don&apos;t like to impose arguments on the user. I like to ask questions. So, I use the &lt;code&gt;inquire&lt;/code&gt; crate to ask questions.
Inquire is a very useful crate that beautifully implements most of standard input and output operations.
So, you can ask for confirmation, ask for a password, ask for a list of options, and so on.
You can even have it open up a text editor for you to write your answer. It is a very useful crate.
So, I used it to write a custom function that takes in a instance of a struct and then asks questions based on the struct.
The quips struct looks something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pub fn ask_page(page: &amp;amp;Page)-&amp;gt;Page{
    println!(&quot;{}&quot;, format!(&quot;Editing {}&quot;, page.name).as_str());
    let name = inquire::Text::new(&quot;Name&quot;).with_default(page.name.as_str()).prompt().unwrap();
    let content = inquire::Editor::new(&quot;Content&quot;).with_file_extension(&quot;.md&quot;).with_editor_command(std::ffi::OsStr::new(&quot;vim&quot;)).with_predefined_text(page.content.as_str()).prompt().unwrap();
    let author = inquire::Text::new(&quot;Author&quot;).with_default(page.author.as_str()).prompt().unwrap();
    let date = inquire::Text::new(&quot;Date&quot;).with_default(page.date.as_str()).prompt().unwrap();
    
    let page = Page{
        _id: page._id.clone(),
        hash: page.hash.clone(),
        name,
        content,
        author,
        date,
    };
    page
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This would give an output like this&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;../../assets/rust_cms_1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Which is pretty cool. I mean, it is a CLI tool, but it looks like a GUI. I love it.&lt;/p&gt;
&lt;p&gt;I also had to implement a search function. I used the &lt;code&gt;inquire&lt;/code&gt; crate for that as well.
I just used the &lt;code&gt;Select&lt;/code&gt; struct to ask for a list of options and passed in the list of pages.
The inquire&apos;s &lt;code&gt;Select&lt;/code&gt; struct is very powerful. It automatically asks the user to start typing and then it filters the list based on the input.
So, I just passed in the list of pages and then I got a list of pages that I could select from.
Searching was solved.&lt;/p&gt;
&lt;h3&gt;Compiling&lt;/h3&gt;
&lt;p&gt;Next, all I had to do was integrate the whole thing together. I just had to call the functions in the right order.
It was quite easy and after a lot of debugging, I finally got it to work. Then, for the moment of truth, I ran &lt;code&gt;cargo build --release&lt;/code&gt; and I got a single binary executable.
It was just 914kb in size! I now have a fully functional CMS that is just 914kb in size.&lt;/p&gt;
&lt;p&gt;The best part? I don&apos;t need to carry or clone anything if I want to use it on another machine.
I only need to download the executable, which I will be hosting on my website, and then I can use it to manage my content.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;So, what can you take away from this? Well, you can take away the fact that you can write a CMS in Rust.
Rust is an awesome tool for writing CLI tools. It is fast, it is easy to use, and it is easy to ship.
After the whole thing, I only ended up writing about 600 lines of code. That is just amazing.&lt;/p&gt;
&lt;p&gt;This was also a good learning experience for me. I learnt a lot about Rust, tokio and futures.
Overall, it was quite cool. So, for conclusion, should you write a CMS in Rust? Well, if you want to, go ahead.
However, sometimes, just sticking with a good web framework is the best option. I mean, you don&apos;t need to write a CMS for everything.
In my case, I had a very small use case and I wanted to write a CLI tool. Hence, I wrote a CMS in Rust.
However, I probably do recommend you writing a CLI CMS, since that teaches you a lot about the language and it&apos;s libraries, plus it is fun.&lt;/p&gt;
&lt;p&gt;Anyways, I hope you enjoyed this post. I know this was a bit more technical than my other posts, but I hope you enjoyed it.
If you want to check out the code, you can check it out at &lt;a href=&quot;https://github.com/newtoallofthis123/noob_handler&quot;&gt;newtoallofthis123/noob_handler&lt;/a&gt;.
You can even clone it, but you can&apos;t really use it since it is configured to work with my database.
Thanks for reading and I will see you in the next one. Bye!&lt;/p&gt;
</content:encoded><author>Ishan</author></item><item><title>Migrating My Site To Astro</title><link>https://www.noobscience.in/blog/migrating-to-astro/</link><guid isPermaLink="true">https://www.noobscience.in/blog/migrating-to-astro/</guid><description>I recently migrated my site from Next.js to Astro. In this post, I&apos;ll be talking about why I did that and how I did that.</description><pubDate>Sat, 24 Jun 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;It feels good doesn&apos;t it? You&apos;ve just finished building your website and you&apos;re ready to show it off to the world. You&apos;ve got your domain, your hosting, and your site is live.
When we as developers build a website, we expect it to work seamlessly for the rest of time.
Now this might be true for a static website, which is hosted on a CDN and doesn&apos;t have any backend code.
However, most sites now a days are dynamic, and have some sort of backend code, which is where the complexities of maintainance come in.
Now it is not really the backend which is to blame. I sometimes find even the frontend to be a pain to maintain.
Especially the front ends which are built using meta frameworks like Gatsby, Next, Nuxt, etc.
Dynamic and interactive websites are great, but they come with a cost.&lt;/p&gt;
&lt;h2&gt;Why I was Migrating My Site&lt;/h2&gt;
&lt;p&gt;This was when my site was built using Next.js and I was using a custom CMS I made using MonoDB to manage the content.
Now this was a very small dynamicity, but it was still a pain to maintain.
I also had to make sure that I don&apos;t exceed the free tier of MongoDB Atlas, which was a pain.
I had to make all sort of changes to the SWR hooks to make sure that the site doesn&apos;t make too many requests to the database.
After all this too, the site was rather slow at times and on top of that, the site was 500GB in size.&lt;/p&gt;
&lt;p&gt;The thing was, the reason I had to introduce this dynamicity was because I wanted to make the content on my site easily manageable.
I wanted to be able to add new quips (called updates) to my site without having to make a new commit to my site.
However, this would be one of the best examples of over engineering.
I didn&apos;t have to make a whole CMS for this.
Now trust me, it was fun to make the CMS, but it was not worth it.
It slowed my site terribly and most of the libraries that were used to render the markdown I was storing in the database were not working properly with Next.js&apos;s new server components.
Moreover, as I will be talking more about later, writing the code using messy scss and weird React hooks made the code really hard to maintain.
I reliazed that in the age of static site generators, I was using a meta framework to build a simple site, with very little dynamicity.&lt;/p&gt;
&lt;p&gt;So, I decided to migrate my site to a static site generator.
The only question was which one?&lt;/p&gt;
&lt;h2&gt;Why I Chose Astro&lt;/h2&gt;
&lt;p&gt;I had used Gatsby in the past, but I didn&apos;t really enjoy it.
Gatsby is an excellent for high performance, commercial sites, but it is not really suited for personal sites.
I mean, it is, but it was not for me.
It was a bit too complex to set up. Powerful, but complex.
This would then, once again lead to over engineering.
Hence, I wanted to use something which was simple, yet powerful.
I had already learned and proved that I could build a site using Next.js, so I wanted to try something new.
I had heard about Astro, and I decided to give it a shot.&lt;/p&gt;
&lt;p&gt;Astro is a static site generator which is really unique.
It provides a lot of features which are not available in other static site generators.
For one, it feels very natural for a Web developer to use Astro.
You can write normal HTML, CSS, and JS in Astro.
However, what makes Astro unique is that it allows you to use React components in your HTML.
Not just react components, but you can use any framework in your HTML.
This is because Astro is framework agnostic.
This means that you can use any framework you want in your Astro site.
Astro uses the concept of islands, which are basically components that can be rendered using a framework of your choice.
This is a much cleaner way of doing things, as you don&apos;t have to worry about all the messy code.&lt;/p&gt;
&lt;p&gt;Hence, Astro seemed like a good choice for me.
So, with that, I started migrating my site to Astro.
However, before that, I needed to identify the pain points in my site.
This would help me not make the same mistakes again.
With that, let&apos;s talk about the pain points I identified in my site.&lt;/p&gt;
&lt;h2&gt;The Pain Points&lt;/h2&gt;
&lt;p&gt;In any analysis, the first step is to identify the pain points.
Now, you might multiple pain points in your site, but you need to identify the ones which are the most important.
So pain points I found in my site were:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Migrating from page/ to app/ in Next.js&lt;/li&gt;
&lt;li&gt;The messy scss&lt;/li&gt;
&lt;li&gt;Long repetitive code&lt;/li&gt;
&lt;li&gt;Really slow build times&lt;/li&gt;
&lt;li&gt;Easily Breakable code&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now these all might sound sort of a given, but let me explain why these were pain points for me.
First off, with the release of Next.js 13.4 and the release of the app/ directory, I had to migrate my site from page/ to app/.
This was easier said then done, as I had a lot of problems with the messy scss my was using.
This led me to using weird React hooks to make sure that the site was responsive.
It was now a pain to migrate to the new server components, as I had to make sure that the site was responsive.
This led to a whole lot of making new directories, layouts and components.
I actually did the whole thing before finally deciding that this site was not worth maintaining.
This is what the final result would be if you don&apos;t take proper steps to write clean and maintainable code.&lt;/p&gt;
&lt;p&gt;You might have different pain points, but these were the ones I had, which turn out to be quite common in Next.js sites.
So, let&apos;s talk about how I solved these pain points.&lt;/p&gt;
&lt;h2&gt;How I Solved These Pain Points&lt;/h2&gt;
&lt;p&gt;The first pain point was the migration from page/ to app/.
This was solved de facto by moving to Astro.
Astro has a much cleaner syntax and a much cleaner way of doing things.
It uses the concept of islands, which are basically components.
These islands can be used to create layouts, pages, and components.
This is a much cleaner way of doing things, as you don&apos;t have to worry about the messy scss.
You can just use the built in classes to style your site.
This was perfect for me, so I decided to move to Astro.&lt;/p&gt;
&lt;p&gt;The second pain point was the messy scss.
The main issue I faced was that I had written a lot of weird React Hooks to manage the responsiveness of the site.
This was primarily because I was writing bad css and scss.
So, for my new site, I decided to use Tailwind CSS.
I had used tailwindcss in the past, but I didn&apos;t really enjoyed it.
However, I decided to give it another shot and I&apos;m glad I did.
I now use Tailwind CSS as my de facto css framework.&lt;/p&gt;
&lt;p&gt;The third pain point was the long repetitive code.
This was solved by using the concept of islands in Astro.
I now have a layout for my blog posts, a layout for my projects, and a layout for my home page.
This has made my code much cleaner and much more maintainable.
I also have a layout for my 404 page, which is a nice touch.
Tailwind CSS also helps with this, as I don&apos;t have to write long repetitive css code.
I can just use the built in classes to style my site.&lt;/p&gt;
&lt;p&gt;The fourth pain point was the really slow build times.
This was solved by using Astro.
Astro has a really fast build time, which is a huge plus.
It also has a really fast dev server, which is also a huge plus.
This has made my development process much faster and much more enjoyable.
I can now make changes to my site and see them instantly.
The build time was very slow in Next.js, which was a huge pain.&lt;/p&gt;
&lt;p&gt;The fifth pain point was the easily breakable code.
Till now, Astro has been really good at this.
I haven&apos;t had any issues with the code breaking.
Tailwind CSS also helps with this, as I don&apos;t have to worry about the css breaking.
All in all, Astro is an amazing framework and I&apos;m glad I decided to use it.&lt;/p&gt;
&lt;h2&gt;Deploying The Switch&lt;/h2&gt;
&lt;p&gt;Now that I had decided to move to Astro, I had to figure out how to deploy it.
I had initally planned on using netlify and I had even set up a netlify.toml file.
But, I decided to go with Vercel, as I found it to be much easier to use.&lt;/p&gt;
&lt;p&gt;I had to make a few changes to my site to make it work with Vercel.
Which was relatively very easy.
All you had to do is the vercel&apos;s server adapter and you&apos;re good to go.
Which you can do by running the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;npx astro add vercel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It&apos;s that simple.
The vercel server adapter, however, only starts to work when you deploy your site.
So, you&apos;ll have to deploy your site to see it in action.
When you are developing locally, you can use the default server adapter, which is the node server adapter.&lt;/p&gt;
&lt;h2&gt;So, is Astro it?&lt;/h2&gt;
&lt;p&gt;Well, it is hard to say.
I have been using Astro for a while now and I have to say, I&apos;m really enjoying it.
It had been far easier to maintain my site with Astro than it was with Next.js.
However, this is true for a site with very little dynamicity.
When I am working on a site with a lot of dynamicity, I will probably use Next.js.
It is just easier to do so.&lt;/p&gt;
&lt;p&gt;However, if you are working on a site with very little dynamicity, Astro is the way to go.
It is much easier to maintain and it is much easier to deploy.
Moreover, if you site has no dynamicity at all, you can also deploy it as a static site.
This is a huge plus, as you don&apos;t have to worry about the server costs.
You can just deploy it as a static site and you&apos;re good to go.&lt;/p&gt;
&lt;p&gt;However, I can&apos;t say that Astro is the best framework out there.
The JavaScript ecosystem is huge and there are a lot of frameworks out there.
It is continuously evolving and there are a lot of new frameworks coming out every day.
So, my advice would be to try out a few frameworks and see which one works best for you.
The thing however, is that with so many frameworks out there, it is quite easy to migrate from one to another.
This is because most of the frameworks use the same concepts.
So, if you know one framework, you can easily migrate to another.&lt;/p&gt;
&lt;h2&gt;My site now&lt;/h2&gt;
&lt;p&gt;So, this site you are currently reading is built using Astro.
I use a few islands to create the layout of the site.
Most importantly the Nav, Footer.
I have still kept a few pages from the old site, like the updates and the url shortener.
These have the same database as the old site, so I didn&apos;t have to change anything.
I just had to make sure that they are migrated to Astro and rewritten using tailwindcss.
This site is till in beta, but Astro has helped me add a lot of new features to it.
I was also able to improve it&apos;s SEO and performance a lot.
Since most of the site is static, it is also very fast.&lt;/p&gt;
&lt;p&gt;You might have also noticed the blog you are currently reading.
I am quite proud of it. I was able to incorporate suggested posts, tags, and a lot of other features.
I was also able to improve the SEO of the blog a lot.
So, you now get the title and image of the blog when you share it on social media.
This is a huge plus, as it helps with the discoverability of the blog.
One more thing that Astro helped me is with the code blocks.
I was able to add syntax highlighting to the code blocks, which is a huge plus.
This makes the blog much more readable and much more enjoyable.&lt;/p&gt;
&lt;p&gt;I am quite happy with the way the site has turned out.
I&apos;ll write another post about the site when it is out of beta.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;So, that&apos;s it for this post.
I know this post was relatively weird, but I just wanted to share my experience with Astro.
The main takeaway from this post is that you should try out a few frameworks and see which one works best for you.
Also, I hope my method of identifying pain points and solving them was helpful.
If you have any questions, feel free to reach out to me on &lt;a href=&quot;https://twitter.com/noobscience1&quot;&gt;Twitter&lt;/a&gt;.
Also, if you want to check out my site which I built using Astro, you can do so &lt;a href=&quot;https://beta.noobscience.rocks&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Thanks for reading, Hope you have a great day!&lt;/p&gt;
</content:encoded><author>Ishan</author></item><item><title>AI AI Generative AI</title><link>https://www.noobscience.in/blog/generative-ai/</link><guid isPermaLink="true">https://www.noobscience.in/blog/generative-ai/</guid><description>There is so much talk about AI everywhere now a days. Is it really a good thing?</description><pubDate>Mon, 19 Jun 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;AI, AI, Generative AI, Generative AI, it&apos;s like the whole world one day woke up and decided to make their whole persona about AI.
I mean, I get it, AI is cool. It was cool when it was pondered about mathematically, it was cool when it gave a us a way to cheat on tests and
auto generate code. What is the limit though?&lt;/p&gt;
&lt;p&gt;I mean, don&apos;t get me wrong. I am not someone who like believes the whole &quot;AI is going to take over the world&quot; thing.
I honestly want AI to advance. It is a wonderful technology that when used right can help us in so many ways.
For example, I am able to write this article 10x faster because of &lt;a&gt;GitHub Copilot&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;AI has helped me learn any new language a lot faster. It has made me confident to explore new frameworks and not shy away from them.
I mean, I am writing this article in &lt;a href=&quot;https://astro.build&quot;&gt;Astro&lt;/a&gt; which is a new framework that I am exploring.
I initially wrote my original site &lt;a&gt;noobscience.rocks&lt;/a&gt; in &lt;a href=&quot;https://nextjs.org&quot;&gt;next.js&lt;/a&gt; and then moved to Astro. All of this because I was coding 10 times faster.&lt;/p&gt;
&lt;p&gt;I am not saying that AI is perfect. It is not. It is still in its infancy. It is still learning. It is still growing.
This is why I am so excited about it. I am excited to see where it goes. I am excited to see what it can do.&lt;/p&gt;
&lt;h2&gt;The Problems&lt;/h2&gt;
&lt;p&gt;However, I am not excited to see people use it as a buzzword.&lt;/p&gt;
&lt;p&gt;Recognize this? This is a bitcoin. It is a cryptocurrency. It is a digital currency. It is a currency that is not controlled by any government.
How many times have you heard the word bitcoin in the past 2 years? I am sure you have heard it a lot.
This is exactly what is happening with AI. It is being used as a buzzword. It is being used to sell products. It is being used to sell services.&lt;/p&gt;
&lt;p&gt;Don&apos;t get me wrong. Incorporating it into your product is a good thing. All I am worried about is that people are going to get sick of it.&lt;/p&gt;
&lt;p&gt;Now the cynic in me is saying that this is a good thing. That so many people using it will accelerate the growth of AI. That it will make it better.
But, the same was said about bitcoin. The same was said about the internet.
I wanted to include both of these examples because they are both very different stories.&lt;/p&gt;
&lt;p&gt;The internet was a technology that was used by a few people. It was used by the military and a few universities. It was not used by the general public.
However, when it was released to the public, it was a huge success. This made it grow faster and better.&lt;/p&gt;
&lt;p&gt;Bitcoin on the other hand was a technology that would only be successful if it was used by a lot of people. It was a currency.
Hence, it had a weird codependence. It needed people to use it to be successful.
So, it inadvertedly became a buzzword. It became a buzzword because it needed to be one.
All the scams, all the scams, all the people who were trying to sell you bitcoin were actually helping bitcoin grow.&lt;/p&gt;
&lt;p&gt;Ironic isn&apos;t it? The thing that was supposed to be the downfall of bitcoin was actually the thing that made it grow.&lt;/p&gt;
&lt;h2&gt;Where does AI fit in?&lt;/h2&gt;
&lt;p&gt;So, where does AI fit in? Is it like the internet or is it like bitcoin?&lt;/p&gt;
&lt;p&gt;Well, in short, it is too early to tell. However I will try to make a prediction. If you have been on linkedin recently, you will see that everyone is talking about AI.
There are prompt engineers left and right, people trying to sell AI courses and services. I mean it is everywhere!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;It is like the whole world one day woke up and decided to make their whole persona about AI.&quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It is an awesome tool. But do you really need to list the fact that you can ask it questions properly as a skill? I mean I get projects that AutoGPT that actually
use advanced prompting and stuff. But, if you are just using it to ask questions, then it is not really a skill.&lt;/p&gt;
&lt;p&gt;I mean, speaking about linkedin, most of the people are scared that AI is going to take their jobs. To be clear, I am not saying that it won&apos;t.
Honestly, with the way things are going, it is going to take a lot of jobs. However, it is also going to create a lot of jobs.
A lot can&apos;t be said about that, especially by a teenager.
The conditions however, don&apos;t look good.
The world just came out of a pandemic. People are still trying to get back on their feet.
The last thing they need is a technology that is going to take their jobs.
We are already starting to see so many people getting layed off.&lt;/p&gt;
&lt;p&gt;Not to mention that the whole world is still trying to figure out how to regulate AI.
AI regulation deserves a whole article on its own. So, I am not going to talk about it here.&lt;/p&gt;
&lt;p&gt;Only time will tell if AI is going to be like the internet or bitcoin. I am hoping that it is going to be like the internet.&lt;/p&gt;
&lt;h2&gt;It is the right time?&lt;/h2&gt;
&lt;p&gt;Sometimes, I wonder if it is even the right time to start corportizing AI. I mean, it is still in its infancy.
We don&apos;t know the black box that is AI. We don&apos;t know how it works, thinks, or even learns.
I still can&apos;t wrap my head around the neural networks and the amount of math that is involved in it.
There are some of the best minds in the world working on it. And, they are still trying to figure it out.
ChatGPT and OpenAI are partially blamed for this. Was it really a good idea to release it to the public?
Again, yes and no. It is a good idea because it will help it grow faster. It is a bad idea because it will help it grow rapidly.
If you are confused, then let me explain.&lt;/p&gt;
&lt;p&gt;It is a good idea because, you now have the whole world to start testing it.
The amount of jailbreaking that has happened with ChatGPT is weird. People have made it do so many things.
The whole Sdney thing with Bing Chat and the whole &quot;I am not a robot&quot; thing is weird as well.&lt;/p&gt;
&lt;p&gt;It is a bad idea because, you are exposing a very powerful technology that can basically summarize humanity (only till 2021 though)
to the whole world. This is at a stage where you don&apos;t fully understand the black box. You can&apos;t predict what it will do.
All the same while you are creating a whole industry that now makes it their job to use this technology&lt;/p&gt;
&lt;p&gt;One more thing that is quite concerning is the fact that all the major LLm&apos;s are owned by a few companies.
This is not a good thing. This is not a good thing at all.&lt;/p&gt;
&lt;h2&gt;Present&lt;/h2&gt;
&lt;p&gt;Every other company now has AI in some form or the other. I mean, I am not complaining. It is awesome.
The header image you are seeing is generated by AI. I took a lot of help from GitHub Copilot to write this article.
I am worried that people are going to get sick of it. I am worried that people are going to start hating it.
You can already see this happening on the most &lt;em&gt;vocal&lt;/em&gt; social media platform, Twitter.
People are always posting about the 10 AI tools that you should be using. They are getting repetitive.&lt;/p&gt;
&lt;p&gt;Don&apos;t get me wrong, some of these new AI tools are awesome. I mean, &lt;a href=&quot;https://tome.ai&quot;&gt;tome.ai&lt;/a&gt;, &lt;a&gt;Firefly&lt;/a&gt;, GitHub Copilot all of these are very awesome tools.
However, they are not the best. You might notice that in some parts of this article, there are places where it is weirdly repetitive, like &quot;Not a good thing&quot;, &quot;Not a good thing at all&quot;.
All those are places I pressed tab and it auto completed it for me. So, I would still prefer to write my own articles.&lt;/p&gt;
&lt;p&gt;One more thing that is being overlooked is the fact the AI is slowly making the internet repetitive.
AI is basically eating the internet and spitting it out. The same old same old content, slowly degraded by the saliency of the AI.&lt;/p&gt;
&lt;h2&gt;What should happen?&lt;/h2&gt;
&lt;p&gt;I think that AI should be used as a tool. As simple as that. There might be a point in the future where AI is so advanced that it can be used as a product.
But, we are not there yet. We are not even close to there yet. Moreover, about jobs, I think that AI will create more jobs than it will take.
I mean, I need more time debugging my code than I need to write it. I need more time to write my articles than I need to research them.
So, AI will probably not take your job, yet.&lt;/p&gt;
&lt;p&gt;However, I believe that AI must be embraced and not feared. It can make your life a whole lot easier.&lt;/p&gt;
&lt;h2&gt;Corporatizing of AI&lt;/h2&gt;
&lt;p&gt;First, it was OpenAI, that started out as a research foundation, then it became a company. Then Microsoft took a huge stake in it.
Then, it was GitHub Copilot, Adobe. Now, it is Google Bard. All the major LLM&apos;s are owned by a few companies.
Now there are some open source models, but they are not as good as the ones that are owned by the companies.
This is partially because of the fact that the companies have more resources to train the models.
In my previous article on &lt;a href=&quot;/blog/costs-of-ai&quot;&gt;the costs of AI&lt;/a&gt;, I talked about how much it costs to train an AI model.
Turns out, it is quite costly, you know what is more costly? Running the model.&lt;/p&gt;
&lt;p&gt;So, eventually the open source models will be left behind. The whole wonderful world of AI will be owned by a few companies.
I won&apos;t talk much about this since I plan to write a whole article on this.
Till, then, I will leave you with this thought.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“A year spent in artificial intelligence is enough to make one believe in God.” —Alan Perlis&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Disclaimer&lt;/h2&gt;
&lt;p&gt;This is a very controversial topic. I am sure that I have offended a lot of people. I am sorry if I did. I am just trying to express my opinion.
At the end of the day, it is just an opinion. I am not an expert in this field. I am just a teenager who is trying to make sense of the world.
The world of AI is very facinating and active. There are a lot of things happening. So, by the time you read this, a lot of things might have changed.
Just know that the article is dated 2023-06-20. So, if you are reading this in the future, then you know that I am not a time traveler.&lt;/p&gt;
</content:encoded><author>Ishan</author></item></channel></rss>