<![CDATA[origin]]>https://codeaashu.hashnode.devhttps://cdn.hashnode.com/uploads/logos/65e39040f57cda771a52aa7a/879ab403-868b-4146-9823-1f4103d2635a.pngoriginhttps://codeaashu.hashnode.devRSS for NodeTue, 15 Sep 2026 02:38:32 GMT60<![CDATA[How to build your own LLM from scratch in 5 Stages: exact pipeline behind GPT and Claude]]>https://codeaashu.hashnode.dev/how-to-build-your-own-llm-from-scratch-in-5-stages-exact-pipeline-behind-gpt-and-claudehttps://codeaashu.hashnode.dev/how-to-build-your-own-llm-from-scratch-in-5-stages-exact-pipeline-behind-gpt-and-claudeMon, 22 Jun 2026 12:09:58 GMTI pulled apart how large language models are actually built - the entire pipeline behind ChatGPT, Claude, and Gemini - and compressed it into one map.

Bookmark this. Save it. By the end you will understand the exact five-stage path from raw internet text to a model that answers like an assistant.

Stay ahead in AI & Tech → Connect on 𝕏 warrioraashuu

That is not hyperbole. Most people think building an LLM is about the architecture. The core lesson here is that the architecture is the part that matters least.


The lie everyone believes about LLMs

Ask most people how you build a model like Claude and they will say "transformers." As if the secret is the neural network design.

It is not. The transformer architecture is largely standardized and freely published. Every major lab uses roughly the same building blocks. If architecture were the moat, everyone would have GPT-4.

Here is the line that reframes everything: in practice it is data, evaluation, and systems that make or break a model - not architectural tweaks. The best models are not just trained. They are engineered.

Article content

So this guide is built around what actually matters. Five stages. The architecture is a footnote inside Stage 1. The other four are where real models are won and lost.


1 - Pretraining - teach model language itself.

Everything starts with one deceptively simple objective: predict the next word. This is autoregressive language modeling. Given a sequence of words, the model learns the probability distribution of what comes next.

Do this across enough text and the model absorbs grammar, facts, and reasoning patterns - not because anyone taught them, but because predicting the next word well requires them.

Article content

Tokenization comes first

Before the model sees text, the text is broken into tokens. The standard method is Byte-Pair Encoding (BPE), and its logic shapes everything downstream.

Article content

The architecture - the part that matters least

The model is a transformer. That is essentially it for this section, and that is the point. You do not win by inventing a cleverer transformer. You win at the other four stages.

The lecture proves it with scaling curves: transformers simply have a better constant and slope than LSTMs - pick the standard tool and move on.


2 - Data - where models are actually won.

If architecture matters least, data matters most. This is the stage that separates a good model from a mediocre one, and the one most people underestimate.

The pipeline starts with Common Crawl - a scrape of the public web so large it is measured in petabytes: 250 billion pages, over a million gigabytes. But raw web data is filthy.

Turning it into training material is a brutal multi-step filter.

Article content

The processing pipeline looks like this:

  • Extract text from HTML - handling special cases like math and boilerplate.

  • Filter undesirable content - NSFW, harmful, personal data.

  • Deduplicate by URL, document, and line - the web repeats endlessly (headers, footers, menus).

  • Heuristic filtering - remove low-quality docs by word count, outlier tokens, dirty tokens.

  • Model-based filtering - predict whether a page could be referenced by Wikipedia.

  • Data mix - classify into categories (code, books, entertainment) and reweight domains using scaling laws.

The refrain worth burning in: data quality trumps quantity. Collecting data well is the key part of practical LLM work - and the most secretive.

Collecting data well is ~the key to a practical LLM - and the most guarded secret in the field.

Closed datasets dwarf open ones: LLaMA 3 trained on 15 trillion tokens; GPT-4 on an estimated 13 trillion.


3 - Scaling laws - spend compute optimally.

You have 10,000 GPUs for a month. What model do you train? Bigger, or trained on more data? Guessing wastes millions. Scaling laws answer it predictably.

The empirical finding: more data and larger models reliably mean better performance, and you can predict a model's performance from its size and data before training it.

The modern pipeline tunes hyperparameters on small models, then extrapolates up the curve to the one huge final run.

Article content

The famous Chinchilla answer: roughly 20 tokens of training data per parameter is compute-optimal. But that is for training cost alone.

Once you account for the cost of running the model - inference - the practical ratio rises sharply, past 150 tokens per parameter. You train a smaller model on far more data because you pay to run it millions of times.

And the meta-lesson, the "bitter lesson": don't over-complicate. Do the simple things and scale them. In the long run, the only thing that matters is leveraging computation.


4 - Post-training - turn a predictor into an assistant.

After pretraining you have something powerful but useless for chat. It completes text, but it does not know it is supposed to answer you.

Ask it a question and it might reply with three more questions - a perfectly plausible next-word continuation.

Article content

Supervised Fine-Tuning (SFT)

You show the model thousands of examples - a prompt followed by a good response - and it learns to imitate that pattern. This is behavior cloning, and it was the key step from GPT-3 to ChatGPT.

The surprising part: you need very little data. A few thousand examples is enough, because SFT only teaches the format of a good answer - the knowledge is already in the pretrained model.

The Alpaca project even generated its data with another LLM: 52,000 instruction-response pairs, used to fine-tune a LLaMA 7B into a capable assistant.

RLHF - align with human preference

SFT has three problems: it is bound by human ability, it teaches hallucination (cloning a "correct" answer the model doesn't actually know teaches it to make things up), and ideal answers are expensive. RLHF fixes this by optimizing for preference, not imitation.

The model generates two answers. A human picks the better one. Those preferences train a reward model, and the LLM is optimized to maximize that reward - classically with PPO.

A simpler modern alternative, DPO, reaches comparable quality with plain supervised learning and is now standard in the open-source community.

Article content

5 - Evaluation & systems - prove it works, make it feasible.

Two things wrap around the whole pipeline. Skip either and you do not have a real model.

Evaluation: measuring something open-ended

During pretraining the metric is perplexity - how many tokens the model is "hesitating" between. Between 2017 and 2023, the best models dropped from hesitating among ~70 tokens to fewer than 10. But perplexity breaks after alignment, so evaluation shifts to benchmarks and comparisons:

  • MMLU & HELM - task suites with gold answers across many domains. MMLU is the most trusted pretraining benchmark.

  • Chatbot Arena - humans blind-compare two models and vote; 300K+ votes power an Elo leaderboard.

  • AlpacaEval - an LLM judges other LLMs. 98% correlation with Chatbot Arena, under 3 minutes and under $10 - but it has biases, like favoring longer answers.

The honest takeaway: evaluating an aligned model is genuinely hard, and no single number captures it. The same model can score 0.637 or 0.488 on MMLU depending only on the prompt format.

Systems: making training physically possible

Everyone is bottlenecked by compute - GPUs are expensive, scarce, and physically limited by communication speed. A 7B model needs ~112GB just to train naively. So the systems layer is not optional; it is what makes the whole thing feasible:

  • Low precision - 16-bit (bf16) instead of 32-bit, halving memory and boosting speed.

  • Operator fusion & tiling - minimize slow trips to global memory; FlashAttention alone gives a ~1.7x end-to-end speedup.

  • Data parallelism - split the dataset across GPUs (sharding optimizer state with ZeRO to save memory).

  • Model parallelism - split the model across GPUs by layer (pipeline) or by matrix (tensor).

  • Sparsity - Mixture of Experts: more parameters, same FLOPs, by activating only a subset per token.

Article content

What this whole pipeline teaches

Walk back through the five stages and the thesis is undeniable. Architecture - the part everyone obsesses over - got the least attention. Data, scaling, alignment, evaluation, and systems are where every real decision gets made.

That is why two labs with the same architecture produce wildly different models. The architecture is shared. Everything that matters is not.


The mistakes that sink LLM projects

  • Obsessing over architecture. The most copied, least differentiating part of the stack.

  • Treating data as a commodity. Dirty data caps your ceiling no matter the compute. Quality over quantity.

  • Skipping the Chinchilla math. A model too big for its data is undertrained and wastes compute.

  • Stopping at SFT. A fine-tuned model imitates; without RLHF or DPO it never learns what people prefer.

  • Trusting perplexity after alignment. Post-training changes the distribution - perplexity stops being meaningful.


Conclusion:

A great model is not trained. It is engineered.

Most people will keep believing that building an LLM is about the architecture, keep reading transformer explainers, and keep missing where the real work happens.

The ones who understand the pipeline will see it clearly: language modeling, then clean data, then optimal scaling, then alignment, then honest evaluation on efficient systems. Five stages. The architecture is one paragraph of one of them.

Pick one stage you have been ignoring, probably data or evaluation. Go deep on it. That is where the difference lives.


Closing

If you found this useful, be sure to follow me aashuu ✦

I publish 3–4 articles each week, breaking down the latest innovations in Tech, AI, and Business.

Stay ahead in AI & Tech → Connect on 𝕏 warrioraashuu

]]>
<![CDATA[Fable 5 (Mythos) Prompting Masterclass by Anthropic]]>https://codeaashu.hashnode.dev/fable-5-mythos-prompting-masterclass-by-anthropichttps://codeaashu.hashnode.dev/fable-5-mythos-prompting-masterclass-by-anthropicSat, 13 Jun 2026 08:40:50 GMTTLDR: Anthropic just published the official playbook for prompting the most powerful AI model on earth — I translated it.

Most people won’t read this guide (it’s buried in the API docs), which is written for developers, and the average Claude user will bounce off it in 30 seconds due to its density.

This article is the plain English version.

Claude Fable 5, also known as Mythos, is a fundamentally different model from everything Anthropic has shipped before. The way you think about prompting structure needs to completely change.

Here’s everything that you need to know.

Table of Contents

I: What Makes Fable 5 (Mythos) Different

II: How to Prompt Fable Properly

III: Optimal Prompting Structure for Fable 5 (+/loops)

IV: What to Watch Out For (caveats)

For reference, this is the playbook I’ve translated. Feel free to review it in-depth and verify my analysis:

https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-fable-5


What Makes Fable 5 (Mythos) Different

A brief overview of the fundamental changes in Fable 5 (Mythos) — important context

1 - Run Time

Every Claude model before Fable 5 worked in relatively short bursts.

Claude Fable 5 is meant to sustain output over extended periods to complete multi-day, goal-directed tasks.

This is one of the biggest shifts. Fable 5 is meant for fully autonomous work (paired with /goal or /loop).

2 - It Gets Things Right First Time

One of the most reported early observations from people using Fable 5 is how rarely they need to iterate. Early testers reported single-pass implementations of systems that previously took days of iteration.

3 - Clarifying Questions

To execute autonomous work loops accurately, Fable 5 may ask a series of clarifying questions before it kicks off its autonomous run.

4 - Agent Management

Fable 5 is built to manage multiple parallel subagents at once (spinning up 50+ agents for complex tasks).

5 - It “Sees” Better

Claude Fable 5 interprets dense technical images, web applications, and detailed screenshots with substantially higher accuracy.

For anyone using Claude to analyse charts, screenshots, documents, or visual data, the improvement here is meaningful.

6 - Coding + Security Audits

It’s no secret that Fable is a coding genius. This new model is especially powerful for codebase review and debugging.

TLDR: You need to think of Fable as a collaboration/consultant partner that leads your work. It is meant to be a genius.


II: How to Prompt Fable Properly

1 - Match Your Effort Level to the Task

Effort is the primary control for the trade-off between intelligence, latency, and cost on Claude Fable 5.

It is recommended to use high as the default for most tasks, with xhigh for the most capability-sensitive work.

Think of it like hiring a consultant. You don’t need them running at full capacity to answer a simple question.

The practical guide:

Low or medium: Quick questions, simple rewrites, basic research, anything conversational

High: Default

Xhigh: Your hardest problems. Complex builds, multi-step analysis, anything where quality is non-negotiable

Ultracode: Full autonomous orchestration with Dynamic Workflows (more on this later)

2 - Tell It Why, Not Just What

Fable 5 cannot perform solely on instructions, unlike other models. It needs the “why” behind things, which is why it asks many clarifying questions.

Context lets it connect the task to relevant information rather than inferring intent on its own.

The formula Anthropic recommends:

PROMPT STRUCTURE

“I’m working on [the larger task] for [who it’s for]. They need [what the output enables]. With that in mind: [your actual request].”

3 - Keep Instructions Short

This feels counterintuitive, but it’s one of the most important adjustments to make when moving to Fable 5.

A short brief instruction is as effective as listing each pattern. Over-engineering your prompts on Fable 5 can actually degrade output quality because you’re constraining a model that would have figured out the right approach on its own.

4 - Tell It When to Stop and Check In

Fable 5 is built to run autonomously. Which means if you don’t define the checkpoints, it will define them itself. Sometimes that’s fine. For important or sensitive work, you want to set the boundaries explicitly.

Use this instruction when you want Fable 5 to run autonomously but stop at the right moments:

CHECKPOINT PROMPT

“Pause for me only when the work genuinely requires my input: a destructive or irreversible action, a real scope change, or something only I can provide. Otherwise, keep going and report back when done.”

5 - Build It a Memory System

Claude Fable 5 performs particularly well when it can record lessons from previous runs and reference them. Provide a place to write notes, as simple as a markdown file.

The instruction Anthropic recommends for your memory file:

MEMORY INSTRUCTION

“Store one lesson per file with a one-line summary at the top. Record corrections and confirmed approaches alike, including why they mattered. Don’t save what the repo or chat history already records. Update an existing note rather than creating a duplicate. Delete notes that turn out to be wrong.”


Optimal Prompting Structure for Fable 5 (+/loops)

The exact framework you should use for most prompts (combining all the tips above)

General Structure

Every high-quality Fable 5 prompt has four components:

  1. Context: Files, data, and so on.

  2. Request: What you actually want done.

  3. Output format: Exactly how you want the result delivered.

  4. Constraints: What Fable 5 must not assume on its own

Put together, it looks like this:

OPTIMAL PROMPT STRUCTURE
"I'm working on [the larger task] for [who it's for]. 
They need [what the output enables].
Request: [your specific ask in one clear sentence]
Output format: [exactly how you want the result 
structured and delivered]
Constraints: [what must not happen on 
the way to the result]"

/loops

/loop is one of the most powerful ways to use this new model.

If you’re unfamiliar, setting a /loop just allows your AI to work without manual intervention.

You should structure your /loop prompts like this:

/loop <time interval> + goal

Example: /loop 15 minutes, check if my build is passing, and notify me if it fails.

To stop a loop:

/loop stop [loop name]


What to Watch Out For

Some things to keep in mind when using Fable 5

  • It Runs Longer Than You Expect

This is one of the largest shifts teams encounter when adjusting to Claude Fable 5. Individual requests for hard tasks can run for many minutes at higher-effort settings.

  • It Can Go Beyond What You Asked For

Fable 5 is proactive by design. Claude Fable 5 can occasionally take unrequested actions. Use check-ins/loops to combat this.

  • Your Old Prompts May Work Against You

If you have saved skills or project instructions built for other models like Claude Opus 4.8 or earlier, they may actually produce worse results on Fable 5 than a simple fresh prompt would. Start fresh.

  • Decline Cybersecurity and Life Sciences Requests (and more)

Fable may hallucinate, and decline prompts you think are “safe.”

  • It Can Occasionally Stop Early

If this happens, a simple “go ahead and do it end-to-end” is enough to get it moving again.

  • Token Costs Are Higher

And of course, this is an insanely expensive model. Available on paid plans until June 22; after that, all access will be via API costs.


Closing

If you found this useful, be sure to follow me aashuu ✦

I publish daily articles that break down the latest innovations in Tech, AI, and Business.

For valuable content ✦ Connect on 𝕏 → x.com/warrioraashuu

]]>
<![CDATA[It’s official ✦ Google Summer of Code 2026 is coming]]>https://codeaashu.hashnode.dev/its-official-google-summer-of-code-2026-is-cominghttps://codeaashu.hashnode.dev/its-official-google-summer-of-code-2026-is-comingThu, 04 Dec 2025 11:57:02 GMTYes, it’s official ✦ Google Summer of Code 2026 is coming

🗓 Key dates:
Applications open: March 16, 2026
Applications close: March 31, 2026

And if you are still planning to “start in March”… you’re already late.

The application period is NOT the preparation period.

As a GSoC 2025 contributor, I’ve seen firsthand how much this program can accelerate your learning, network, and career. It was a turning point for me, and I want more people from my network to experience that.

Here’s what I’d do if I were starting today for GSoC 2026:

1️⃣ Start TODAY, not in March
Don’t wait for the official org list.
Most orgs participate every year.
Pick 2–3 orgs & start exploring their ecosystem and see which ones align with your skills (web dev, systems, ML, security, etc.).

2️⃣ Observe before you contribute
- Join their Slack, Discord, IRC, GitHub discussions, whatever they use.
- Just watch how they talk, how they solve issues, how PRs are reviewed.
This will teach you more than any YouTube “GSoC roadmap” video.

3️⃣ Start with “small but visible”
- Fix a typo.
- Improve a README.
- Refactor a tiny function.
- Add missing documentation.
- A “good first issue”
It’s not about “showing skills”…
It’s about showing you can collaborate.
These get your name on the board and show you are active.

4️⃣ Think in terms of a proposal from day one
While you contribute, keep a running document of:
- Problems you notice in the project
- Possible improvements
- Links to your PRs and discussions
Good proposals don’t come from templates.
They come from actually understanding the codebase, talking to mentors, and solving real issues.

✦ If you’re serious about GSoC 2026…

Let’s connect on LinkedIn:
https://www.linkedin.com/in/ashutoshkumaraashu/
I’ll also be sharing more resources, templates, and my honest learnings from GSoC 2025 very soon.

]]>
<![CDATA[DevDisplay - Paradise For Developers!]]>https://codeaashu.hashnode.dev/devdisplay-paradise-for-developershttps://codeaashu.hashnode.dev/devdisplay-paradise-for-developersSun, 06 Apr 2025 11:32:37 GMTThe First Global Platform for Developers to Fulfill All Their Tech Needs.

⚡Imagine One Platform for Global Developers to Fulfill All The Tech Needs! ⚡


💡
Whatever you need as a developer, DevDisplay has it all.
  • Opportunities

  • Resources

  • Project Showcase

  • Portfolio Ideas

  • Resume Building

  • AI Tools Hub

  • AI Career Guide

  • Portfolio Builder

  • Idea Submission

  • Journey Showcase

  • Design Display

  • Dev Discussions

  • DevDisplay UI Library

  • DevDisplay Compiler

  • DevDisplay Competitions

  • Developer Marketplace

  • DevDisplay Ecommerce


💡
We believe innovation is limitless...✦

Suggest new features you'd love to see on DevDisplay! As a tech enthusiast and developer, you're encouraged to think beyond—think outside the box. Suggest and add new, innovative features that could revolutionize the tech world and make a difference in the tech ecosystem. If you spot a gap in the tech industry, DevDisplay can be the solution. You can also give us brutal and honest feedback—Roast Us! It helps us improve and make DevDisplay even better. Here, your ideas matter, your code matters—you matter.

Developers let’s enter to the Paradise - DevDisplay

]]>
<![CDATA[How does the internet work?]]>https://codeaashu.hashnode.dev/how-does-the-internet-workhttps://codeaashu.hashnode.dev/how-does-the-internet-workSun, 07 Jul 2024 19:02:24 GMTTable of contents

Since the explosive growth of web-based applications, every developer stands to benefit from understanding how the Internet works. Through this article and its accompanying introductory series of short videos about the Internet from code.org, you will learn the basics of the Internet and how it works. After going through this article, you will be able to answer the following questions:

  1. What is the Internet?

  2. How does the information move on the internet?

  3. How do the networks talk to each other and the protocols involved?

  4. What’s the relationship between packets, routers, and reliability?

  5. HTTP and the HTML - How are you viewing this webpage in your browser?

  6. How is the information transfer on the internet made secure?

  7. What is cybersecurity and what are some common internet crimes?

🤔 What is the Internet ?

The Internet is a global network of computers connected to each other which communicate through a standardized set of protocols. In the video below, Vint Cerf, one of the “fathers of the internet,” explains the history of how the Internet works and how no one person or organization is really in charge of it.

🚠 Wires, Cables and Wifi

Information on the Internet moves from one computer to another in the form of bits over various mediums, including Ethernet cables, fiber optic cables, and wireless signals (i.e., radio waves). In the video linked below, you will learn about the different mediums for data transfer on the Internet and the pros and cons for each.

📭 IP Addresses and DNS

Now that you know about the physical medium for the data transfer over the internet, it’s time to learn about the protocols involved. How does the information traverse from one computer to another in this massive global network of computers?

In the video below, you will get a brief introduction to IP, DNS, and how these protocols make the Internet work.

📦 Packets, Routing & Reliability

Information transfer on the Internet from one computer to another does not need to follow a fixed path; in fact, it may change paths during the transfer. This information transfer is done in the form of packets and these packets may follow different routes depending on certain factors.

In this video, you will learn about how the packets of information are routed from one computer to another to reach the destination.

🌐 HTTP and HTML

HTTP is the standard protocol by which webpages are transferred over the Internet. The video below is a brief introduction to HTTP and how web browsers load websites for you.

🔑 Encryption and Public Key

Cryptography is what keeps our communication secure on the Internet. In this short video, you will learn the basics of cryptography, SSL/TLS, and how they help make the communication on the Internet secure.

🃏 CyberSecurity and Crime

Cybersecurity refers to the protective measures against criminal activity accomplished through using a network, technological devices, and the internet.In this video, you will learn about the basics of cybersecurity and common cyber crimes.

And that wraps it up for this article.

To learn more about the Internet, go through the episodes of howdns.works and read this cartoon intro to DNS over HTTP.

& all set! 👍🏻

Let's 💌 Connect on 👉🏻 LinkedIn 🌐 Twitter X 🚀 for make a Productive Community. It will cost nothing...

]]>
<![CDATA[OTP Verification using Python]]>https://codeaashu.hashnode.dev/otp-verification-using-pythonhttps://codeaashu.hashnode.dev/otp-verification-using-pythonThu, 04 Jul 2024 10:34:29 GMTIntroduction:

In this project, we have made an OTP verification System with Help of various libraries. First of all, we made use of Tkinter for creating the GUI for our project. Next to that, to generate the random Numbers as OTP we used a random module. At last, forgetting and checking the OTP we used an API Twilio.

A random number will be sent to the stated mobile number with the help of the API and then our project will check whether the OTP is valid or not, and thus this will build an OTP Verification Project using Python.

Explanation:

The main objectives that need to be fulfilled while making this projects are:

  • Creating a GUI for this project

  • Generating a random number as OTP

  • Sending the OTP to the stated Mobile number

  • Checking whether the OTP is valid or not

  • Resending the OTP

We will work on these objectives step by step to complete this project.

First of all, creating a GUI for our project will make use of the “tkinter” module, from “future. moves” we will import the module. The most major step is to create the instance of the tkinter frame i.e. tk(). This will help to display the window and manage all the components of the tkinter application. In addition to this, with the help of “.title()” & “.geometry()” we will set the title and dimensions for the window. With this, we will also draw the Canvas for OTP Verification with the help of “.canvas()” and by using “.place()” we will provide the dimensions as parameters for placing our canvas.

Source Code:

# Importing the libraries
import twilio.rest
import random
from future.moves import tkinter
from tkinter import messagebox

# Creating Window
root = tkinter.Tk()
root.title("OTP Verification")
root.geometry("600x550")

# Twilio account details
account_sid = ""
auth_token = ""


# resend the OTP
def resendOTP():
    n = random.randint(1000, 9999)
    client = twilio.rest.Client(account_sid, auth_token)
    client.messages.create(to=[""], from_=" ", body=n)


# Checking the OTP
def checkOTP():
    global n
    try:
        user_input = int(user.get(1.0, "end01c"))
        if user_input == n:
            messagebox.showinfo("showinfo", "Login Success")
            n = "done"
        elif n == "done":
            messagebox.showinfo("showinfo", "Already entered")
        else:
            messagebox.showinfo("showinfo", "wrong OTP")
    except:
        messagebox.showinfo("showinfo", "Invalid OTP")


# Drawing the canvas
c = tkinter.Canvas(root, bg="white", width=400, height=300)
c.place(x=100, y=60)

# Label widget
login = tkinter.Label(root, text="OTP Verification", font="bold,20", bg="white")
login.place(x=210, y=90)

# Entry widget
user = tkinter.Text(root, borderwidth=2, wrap="word", width=29, height=2)
user.place(x=190, y=160)

# Sending the otp
n = random.randint(1000, 9999)
client = twilio.rest.Client(account_sid, auth_token)
client.messages.create(to=[""], from_="", body=n)

# Submit button
submit_button = tkinter.Button(root, text="Submit", command=checkOTP(), font=('bold', 15))
submit_button.place(x=258, y=250)

# Resend Button
resend_button = tkinter.Button(root, text="Resend OTP", command=resendOTP(), font=("bold", 15))
resend_button.place(x=240, y=400)

# Event Loop
root.mainloop()

We will create a submit button and resend button with the help of “.Buttons()” to trigger the submit and resend command. With the help of this module, we will create the label widget stating OTP verification and an entry widget to provide space for the user to write.

After doing so we will see that our GUI will get ready for the project. Now, to provide the actual functionality we will use API i.e. Twilio.

In this, firstly we will use the “random. randint()” of the random module to generate the random number which will later be considered as OTP.

The next step is to send the OTP. For this process, firstly you have to make a Twilio account

After this, you will be provided with an account sid and auth token. With the help of “twilio.rest.Client(account sid, auth token)” you will first allow your query to metadata. For sending the message we will use “client. messages.create(to=[“”], from_=” “, body=” “)” . And all of this functionality is stated under UDF resendOTP()

The next step is to check the OTP. For this, firstly we will store the user input and now will run a try and except block in which under the try block we will compare that if user input is the same as the generated random number then a message box will appear stating login successfully and the random number stored variable will get updated. And again if the user entered the same OTP then the message box will say that the user has already logged in and finally when the user will enter the wrong OTP then the message box will throw the message of invalid OTP. The syntax for the message box is “messagebox. showinfo ()”. All of this is covered under UDF checkOTP().

After entering the OTP the user can click the submit button and if he/she wants the OTP again then the one can click on the Resend OTP button. In the end, we will run a mainloop for all the functionalities to get executed.

Output

& all set! 👍🏻

Let's 💌 Connect on 👉🏻 LinkedIn 🌐 Twitter X 🚀 for make a Productive Community. It will cost nothing...

]]>
<![CDATA[Basic User Authentication System in C]]>https://codeaashu.hashnode.dev/basic-user-authentication-system-in-chttps://codeaashu.hashnode.dev/basic-user-authentication-system-in-cTue, 11 Jun 2024 06:57:08 GMTIntroduction:
  • Introduce the concept of user authentication systems.

  • Mention the importance of user authentication in software applications.

  • Briefly describe the purpose and functionality of the code.

Code Overview:

  • Explain the purpose of each header file included (stdio.h, stdlib.h, string.h).

  • Define the maximum number of users, maximum username length, and maximum password length using #define.

  • Define a structure User to store user information (username and password).

  • Declare an array of User structs to hold user data and a variable numUsers to track the number of registered users.

Functions:

Signup Function:

  1. Check if the maximum user limit has been reached.

  2. Prompt the user to enter a username and password.

  3. Store the user's information in the array of users.

  4. Increment numUsers and display a success message.

void signup() {
    // Code for signup function
}

Login Function

  1. Prompt the user to enter their username and password.

  2. Iterate through the array of users to find a matching username and password.

  3. If found, display a success message; otherwise, indicate a failed login.

int login() {
    // Code for login function
}

Title: Building a Basic User Authentication System in C

Subtitle: A Beginner's Guide to Building a Secure User Authentication System in C

Introduction

  • Introduce the concept of user authentication systems.

  • Mention the importance of user authentication in software applications.

  • Briefly describe the purpose and functionality of the code.

Code Overview

  • Explain the purpose of each header file included (stdio.h, stdlib.h, string.h).

  • Define the maximum number of users, maximum username length, and maximum password length using #define.

  • Define a structure User to store user information (username and password).

  • Declare an array of User structs to hold user data and a variable numUsers to track the number of registered users.

Functions

  1. Signup Function

    • Check if the maximum user limit has been reached.

    • Prompt the user to enter a username and password.

    • Store the user's information in the array of users.

    • Increment numUsers and display a success message.

        void signup() {
            // Code for signup function
        }
  1. Login Function

    • Prompt the user to enter their username and password.

    • Iterate through the array of users to find a matching username and password.

    • If found, display a success message; otherwise, indicate a failed login.

      int login() {
          // Code for login function
      }

Main Function:

  1. Present a menu to the user with options for signup, login, and exit.

  2. Handle user input using a do-while loop and a switch statement.

  3. Call the appropriate functions based on the user's choice.

Explain
int main() {
    int choice, accountNumber, toAccount;
    float amount;

    do {
        printf("\nBanking System Menu:\n");
        printf("1. Create Account\n");
        printf("2. Deposit\n");
        printf("3. Withdraw\n");
        printf("4. Transfer\n");
        printf("5. View Transactions\n");
        printf("6. Exit\n");
        printf("Enter your choice: ");
        scanf("%d", &choice);
}

Conclusion:

  1. Summarize the purpose and functionality of the code.

  2. Highlight the importance of user authentication in software development.

  3. Encourage further exploration and customization of the code for real-world applications.

Final Thoughts:

  • Share any additional resources or references related to user authentication in C.

  • Invite feedback and questions from readers.


Does this layout with the code functions presented in a more attractive format work for your blog post?

]]>
<![CDATA[Building a Basic Banking System in C]]>https://codeaashu.hashnode.dev/building-a-basic-banking-system-in-chttps://codeaashu.hashnode.dev/building-a-basic-banking-system-in-cSat, 08 Jun 2024 07:43:08 GMTTable of contents

Introduction:

  • Discuss the importance of banking systems in managing financial transactions.

  • Introduce the concept of a basic banking system implemented in C.

  • Outline the functionalities to be covered in the code.

Code Overview:

  • Explain the purpose of each header file included (stdio.h, stdlib.h, string.h).

  • Define constants for maximum accounts and maximum transactions.

  • Define structures for transactions and accounts, including arrays to store transaction history.

Functions:

  • Create Account Function

    • Create a new account with a unique account number, name, and zero balance.

    • Add the account to the accounts array.

void createAccount() {
    // Code for createAccount function
}

Deposit Function

  • Add a specified amount to the balance of a given account.

  • Record the deposit transaction in the account's transaction history.

void deposit(int accountNumber, float amount) {
    // Code for deposit function
}

Withdraw Function

  • Deduct a specified amount from the balance of a given account.

  • Check for sufficient balance before processing the withdrawal.

  • Record the withdrawal transaction in the account's transaction history.

          void withdraw(int accountNumber, float amount) {
              // Code for withdraw function
          }
    

Transfer Function

  • Transfer a specified amount from one account to another.

  • Check for sufficient balance in the sender's account before processing the transfer.

  • Record transfer transactions in both sender and recipient accounts' transaction histories.

void transfer(int fromAccount, int toAccount, float amount) {
    // Code for transfer function
}

View Transactions Function

  • Display the transaction history for a given account.
void viewTransactions(int accountNumber) {
    // Code for viewTransactions function
}

Main Function

  1. Present a menu to the user with options for banking operations.

  2. Handle user input using a do-while loop and a switch statement.

  3. Call the appropriate functions based on the user's choice.

int main() {
    // Code for main function
}

Conclusion

  • Summarize the functionalities and capabilities of the basic banking system implemented in C.

  • Discuss potential enhancements or additional features that could be added to the system.

Encourage further exploration and customization of the code for practical applications


Does this structure with the code functions presented in a more attractive format suit your blog post about the banking system in C?

Output:

]]>
<![CDATA[Simple Database Management in C]]>https://codeaashu.hashnode.dev/simple-database-management-in-chttps://codeaashu.hashnode.dev/simple-database-management-in-cSat, 08 Jun 2024 05:29:48 GMTIntroduction
  • Discuss the significance of databases in data organization.

  • Introduce the code's purpose in managing basic databases.

Code Overview

  • Define structures for columns and tables.

  • Implement functions for creating tables, inserting data, and selecting data.

Functions

  • Create Table

    • Creates a new table with specified columns.
void createTable() {
    // Code for createTable function
}

Insert Data

  • Inserts data into a specified table.
void insertData() {
    // Code for insertData function
}

Select Data

  • Displays data from a specified table.
void selectData() {
    // Code for selectData function
}

Main Function

  • Presents a menu for database operations.

  • Handles user input and calls appropriate functions.

int main() {
    // Code for main function
}

In Short:

  • Implements basic database management functionalities in C.

  • Users can create tables, insert data, and view data easily.

  • Code is structured for simplicity and efficiency in managing databases.

  • Summarizes the code's purpose and functionalities.

  • Encourages further exploration and customization of the code for specific database needs.


Is this brief blog with code snippets suitable for your needs?

Output:

]]>
<![CDATA[Understanding Huffman Coding in C]]>https://codeaashu.hashnode.dev/understanding-huffman-coding-in-chttps://codeaashu.hashnode.dev/understanding-huffman-coding-in-cSat, 08 Jun 2024 05:07:25 GMTIntroduction:
  • Briefly explain Huffman coding and its importance in data compression.

Code Overview:

  • Define structures for nodes and the min heap.

  • Implement functions for creating nodes, min heap operations, and building the Huffman tree.

Functions:

  • Create Node

    • Creates a new node with specified data and frequency.
struct Node* createNode(char data, int frequency) {
    // Code for createNode function
}

Min Heap Operations

Explain// Functions for min heap operations
void swapNode(struct Node** a, struct Node** b);
void minHeapify(struct MinHeap* minHeap, int idx);
int isSizeOne(struct MinHeap* minHeap);
struct Node* extractMin(struct MinHeap* minHeap);
void insertMinHeap(struct MinHeap* minHeap, struct Node* node);
void buildMinHeap(struct MinHeap* minHeap);

Build Huffman Tree

struct Node* buildHuffmanTree(char data[], int frequency[], int size) {
    // Code for buildHuffmanTree function
}

Print Huffman Codes

void printCodes(struct Node* root, int arr[], int top) {
    // Code for printCodes function
}

Main Function:

  • Initializes data and frequency arrays.

  • Calls the Huffman coding function and prints the codes.

In Short:

  • Demonstrates Huffman coding in C for data compression.

  • Utilizes a min heap to build the Huffman tree efficiently.

  • Prints the Huffman codes for characters based on their frequencies.

Conclusion

  • Summarizes the code's purpose in generating Huffman codes.

  • Discusses the role of Huffman coding in efficient data representation.

Final Thoughts

  • Encourages further exploration of data compression techniques and algorithms.

Is this brief explanation with code snippets sufficient for your needs regarding Huffman coding in C?

Output:

]]>
<![CDATA[Building a Library Management System in C]]>https://codeaashu.hashnode.dev/building-a-library-management-system-in-chttps://codeaashu.hashnode.dev/building-a-library-management-system-in-cFri, 07 Jun 2024 13:29:36 GMT
  • Introduction

    Explain the purpose of the Library Management System and its importance in organizing library resources efficiently.

    Code Overview

    Provide an overview of the code structure and key functionalities of the Library Management System:

    • Structures: Define the Book structure to store book details.

    • Functions: Explain the functions for adding, displaying, deleting, updating, issuing, returning books, and generating reports.

  • Functions

    Add Book

    Allows users to add new books to the library.

    1.   void addBook() {
            // Implementation for adding a book
        }
      

      Display Books

      Displays the list of books in the library.

    void displayBooks() {
        // Implementation for displaying books
    }
    

    Delete book

    Enables users to delete a book from the library.

    void deleteBook() {
        // Implementation for deleting a book
    }
    

    Update Book

    Allows users to update the details of a book.

    void updateBook() {
        // Implementation for updating a book
    }
    

    Issue Book

    Enables users to issue a book from the library.

    void issueBook() {
        // Implementation for issuing a book
    }
    

    Return Book

    void returnBook() {
        // Implementation for returning a book
    }
    

    Generate report

    void generateReport() {
        // Implementation for generating a report
    }
    

    Main Function

    Contains the menu-driven interface for interacting with the Library Management System.

    Conclusion

    Summarize the functionality of the Library Management System and its benefits in organizing library resources effectively.

    Final Thoughts

    Encourage readers to explore and customize the code for additional features and functionalities.


    This structure provides a comprehensive overview of the Library Management System code and its functionalities in a structured and informative manner.

    Output:

    ]]>
    <![CDATA[Building a Number Guessing Game in C]]>https://codeaashu.hashnode.dev/building-a-number-guessing-game-in-chttps://codeaashu.hashnode.dev/building-a-number-guessing-game-in-cFri, 07 Jun 2024 13:07:40 GMTIntroduction

    Introduce the Number Guessing Game and its objective to guess a random number within a specified range.

    Code Overview

    Explain the code structure and key functionalities of the Number Guessing Game:

    • Random Number Generation: Use rand() and srand(time(0)) to generate a random number between 1 and 100.

    • Guessing Mechanism: Implement the guessing logic and track the number of attempts.

    Main Function

    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    
    int main() {
        // Variable declarations
        int number, guess, attempts = 0;
        srand(time(0)); // Seed the random number generator
    
        // Generate a random number between 1 and 100
        number = rand() % 100 + 1;
    
        // Game introduction
        printf("Welcome to the Guessing Game!\n");
        printf("Guess a number between 1 and 100\n");
    
        // Guessing loop
        do {
            printf("Enter your guess: ");
            scanf("%d", &guess);
            attempts++;
    
            // Compare the guess with the random number
            if (guess > number) {
                printf("Too high! Try again.\n");
            } else if (guess < number) {
                printf("Too low! Try again.\n");
            } else {
                printf("Congratulations! You guessed the number in %d attempts.\n", attempts);
            }
        } while (guess != number);
    
        return 0;
    }
    

    Explanation

    • Random Number Generation: Seed the random number generator using srand(time(0)) and generate a random number between 1 and 100.

    • Game Loop: Prompt the user to guess the number and provide feedback based on their guess (too high, too low, or correct).

    • Victory Condition: Display a congratulatory message when the user guesses the number correctly and indicate the number of attempts.

    Conclusion

    Summarize the functionality of the Number Guessing Game and its entertainment value as a simple yet engaging game.

    Final Thoughts

    Encourage readers to explore and modify the game, such as changing the range of numbers or adding features like a high-score tracker.


    This structure provides a clear explanation of the Number Guessing Game code and its functionality, making it accessible and informative for readers.

    Output:

    ]]>
    <![CDATA[Building an OTP-Based Login System in C]]>https://codeaashu.hashnode.dev/building-an-otp-based-login-system-in-chttps://codeaashu.hashnode.dev/building-an-otp-based-login-system-in-cFri, 07 Jun 2024 07:56:21 GMTIntroduction

    Introduce the concept of an OTP-based login system and its importance in enhancing security for user authentication.

    Code Overview

    Explain the structure of the code and its key components:

    • User Structure: Define a structure to store user phone numbers, OTPs, and OTP verification status.

    • Functions: Implement functions for user signup, OTP generation, and login authentication.

    Functions

    Signup

    Allows users to sign up by entering their phone number.

    void signup() {
        // Implementation for user signup
    }
    

    Generate OTP

    Generates a random 4-digit OTP for a user.

    void generateOTP(struct User *user) {
        // Implementation for OTP generation
    }
    

    Login

    Enables users to log in using their phone number and OTP verification.

    int login() {
        // Implementation for user login
    }
    

    Main Function

    Contains the menu-driven interface for user interaction:

    int main() {
        // Main function code
    }
    

    Explanation

    • Signup: Allows users to register by entering their phone numbers.

    • OTP Generation: Generates a random 4-digit OTP for user verification.

    • Login: Verifies user login using the generated OTP.

    Conclusion

    Summarize the functionality of the OTP-based login system and its benefits in enhancing security for user authentication.

    Final Thoughts

    Encourage readers to explore advanced authentication mechanisms and security practices for robust user authentication systems.


    This structure provides a clear explanation of the OTP-based login system code and its functionality, making it informative and accessible for readers interested in user authentication in C programming.

    Output:

    ]]>
    <![CDATA[Creating a Simple Snake Game in C]]>https://codeaashu.hashnode.dev/creating-a-simple-snake-game-in-chttps://codeaashu.hashnode.dev/creating-a-simple-snake-game-in-cFri, 07 Jun 2024 07:40:02 GMTIntroduction

    Introduce the concept of the Snake game and its popularity as a classic arcade game. Explain that the blog will guide readers through creating a basic version of the Snake game in C.

    Code Overview

    Explain the structure of the code and its key components:

    • Setup: Initialize game variables such as snake position, length, food position, and gameover status.

    • Draw: Display the game screen, including the snake, food, walls, and game instructions.

    • Input: Handle user input to control the snake's movement using WASD or arrow keys.

    • Logic: Implement game logic for snake movement, food consumption, collision detection with walls, and self-collision detection.

    • Main Function: Manage the game loop and interactions between setup, draw, input, and logic functions.

    Functions

    Setup

    Initialize game variables such as snake position, length, food position, and gameover status.

    c
    
    void setup() {
        // Implementation for game setup
    }
    

    Draw

    Display the game screen, including the snake, food, walls, and game instructions.

    c
    
    void draw() {
        // Implementation for drawing game screen
    }
    

    Input

    Handle user input to control the snake's movement using WASD or arrow keys.

    c
    
    void input() {
        // Implementation for handling user input
    }
    

    Logic

    Implement game logic for snake movement, food consumption, collision detection with walls, and self-collision detection.

    c
    
    void logic() {
        // Implementation for game logic
    }
    

    Main Function

    Contains the game loop to continuously update and render the game until the gameover condition is met.

    c
    
    int main() {
        // Main function code
    }
    

    Explanation

    • Setup: Initializes game variables and positions for starting the game.

    • Draw: Displays the game screen with the snake, food, walls, and instructions.

    • Input: Handles user input to control the snake's movement.

    • Logic: Implements game rules for snake movement, food consumption, and collision detection.

    • Main Function: Manages the game loop and interactions between different game components.

    Conclusion

    Summarize the implementation of the Snake game in C and encourage readers to explore further enhancements and features.

    Final Thoughts

    Encourage readers to experiment with adding features like score tracking, levels, and graphical improvements to enhance the game experience.


    This structure provides a clear explanation of the Snake game code and its functionality, making it informative and accessible for readers interested in game development in C programming.

    Output:

    ]]>
    <![CDATA[Building a Student Grade Tracker in C]]>https://codeaashu.hashnode.dev/building-a-student-grade-tracker-in-chttps://codeaashu.hashnode.dev/building-a-student-grade-tracker-in-cFri, 07 Jun 2024 06:15:05 GMTIntroduction

    Introduce the concept of a Student Grade Tracker and its importance in educational institutions. Explain that the blog will guide readers through creating a basic version of a Student Grade Tracker in C.

    Code Overview

    Explain the structure of the code and its key components:

    • Structures: Define structures for subjects and students to store grades and student information.

    • Functions: Implement functions for adding students, updating grades, calculating GPA, and generating reports.

    • Main Function: Manage the program's menu-driven interface and user interactions.

    Functions

    Add Student

    Allows users to add a new student along with their subject grades.

    void addStudent() {
        // Implementation for adding a new student
    }
    

    Calculate GPA

    Calculates the GPA for a given student based on their subject grades.

    void calculateGPA(struct Student *student) {
        // Implementation for calculating GPA
    }
    

    Update Grades

    Allows users to update grades for a specific student.

    void updateGrades() {
        // Implementation for updating grades
    }
    

    Generate Report

    Generates a report displaying students' names and their respective GPAs.

    void generateReport() {
        // Implementation for generating report
    }
    

    Main Function

    Contains the program's main logic and menu-driven interface.

    int main() {
        // Main function code
    }
    

    Explanation

    • Add Student: Allows users to add new students and their grades.

    • Calculate GPA: Calculates GPA based on subject grades for each student.

    • Update Grades: Allows users to update grades for existing students.

    • Generate Report: Displays a report of students' names and GPAs.

    • Main Function: Manages the program's menu and user interactions.

    Conclusion

    Summarize the implementation of the Student Grade Tracker in C and its functionality. Encourage readers to explore enhancements such as adding more features and improving the user interface.

    Final Thoughts

    Encourage readers to use this code as a foundation for building more advanced student management systems with additional functionalities.


    This structured blog post provides a clear explanation of the Student Grade Tracker code and its functionalities, making it accessible for readers interested in developing educational tools using C programming.

    Output:

    ]]>
    <![CDATA[Building a Voting System in C]]>https://codeaashu.hashnode.dev/building-a-voting-system-in-chttps://codeaashu.hashnode.dev/building-a-voting-system-in-cThu, 06 Jun 2024 18:26:01 GMTIntroduction

    Introduce the concept of a Voting System and its significance in elections or polls. Explain that the blog will guide readers through creating a basic version of a Voting System in C.

    Code Overview

    Explain the structure of the code and its key components:

    • Structures: Define a structure for candidates to store their names and votes.

    • Main Function: Contains the main logic for managing candidates, voters, and voting results.

    Implementation

    Candidate Structure

    struct Candidate {
        char name[50];
        int votes;
    };
    

    Main Function

    int main() {
        // Main function code
    }
    

    Voting Process

    • Input: Collect the number of candidates and voters, and their respective names.

    • Voting: Allow voters to choose a candidate and record their votes.

    • Tallying Votes: Count the votes for each candidate and determine the winner.

    Conclusion

    Summarize the implementation of the Voting System in C and its functionality. Discuss the importance of fair and accurate voting systems in various contexts.

    Final Thoughts

    Encourage readers to explore enhancements such as adding more features like candidate details, voter authentication, or graphical interfaces to improve the Voting System.

    This structured blog post provides a clear explanation of the Voting System code and its functionalities, making it accessible for readers interested in developing voting applications using C programming.

    ChatGPT can make mistakes. Consider checking important information.

    Output:

    ]]>