<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: NIRANJAN LAMICHHANE</title>
    <description>The latest articles on DEV Community by NIRANJAN LAMICHHANE (@niranjannlc).</description>
    <link>https://dev.to/niranjannlc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F577981%2F6afec0bf-fa5e-401b-a390-565d09e3982b.jpeg</url>
      <title>DEV Community: NIRANJAN LAMICHHANE</title>
      <link>https://dev.to/niranjannlc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/niranjannlc"/>
    <language>en</language>
    <item>
      <title>I Built a Nepal Government Complaint Transparency Bot with Hermes Agent (From Zero, in One Hour )</title>
      <dc:creator>NIRANJAN LAMICHHANE</dc:creator>
      <pubDate>Mon, 01 Jun 2026 06:23:59 +0000</pubDate>
      <link>https://dev.to/niranjannlc/i-built-a-nepal-government-complaint-transparency-bot-with-hermes-agent-from-zero-in-one-hour--4gi0</link>
      <guid>https://dev.to/niranjannlc/i-built-a-nepal-government-complaint-transparency-bot-with-hermes-agent-from-zero-in-one-hour--4gi0</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hermes-agent-2026-05-15"&gt;Hermes Agent Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Hello Sarkar Analyzer&lt;/strong&gt; — a Telegram bot that fetches, analyzes, and reports on public complaints filed by citizens with the Nepal Government at &lt;a href="https://gunaso.opmcm.gov.np/complaints" rel="noopener noreferrer"&gt;gunaso.opmcm.gov.np&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Nepal's Hello Sarkar ("Hello Government") portal lets citizens file complaints against any government ministry or department. The data is public — but buried inside a JavaScript-heavy Nuxt.js app that most people never dig into. My bot surfaces that data instantly on Telegram:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/complaints&lt;/code&gt; — live analysis: total complaints, resolved vs pending, resolution rate, top 3 most complained-about departments&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/report&lt;/code&gt; — downloads a full &lt;code&gt;.txt&lt;/code&gt; civic report to your phone&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/about&lt;/code&gt; — project background&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal: make government accountability data accessible to any Nepali citizen with a phone.&lt;/p&gt;




&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Bot commands in action:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/complaints

🏛 Hello Sarkar — Civic Complaint Analysis
📅 2026-06-01 11:30 NPT

📊 Overview
• Total:       847
• ✅ Resolved: 312 (36.8%)
• ⏳ Pending:  535

🏆 Top 3 Most Complained Departments
  1. Ministry of Land Management — 143 complaints
  2. Department of Transport — 98 complaints
  3. Ministry of Local Government — 87 complaints

🔗 gunaso.opmcm.gov.np
Built with Hermes Agent 🤖
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Image  demo :&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsokrgpw2nqajcd2u0f6j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsokrgpw2nqajcd2u0f6j.png" alt="Hermes writing the scraper code" width="800" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpwus1e2wprj0yvpyov6f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpwus1e2wprj0yvpyov6f.png" alt="Xontinue writing code " width="800" height="541"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2e3bkrvtertq7s98gtbx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2e3bkrvtertq7s98gtbx.png" alt=" completed action" width="800" height="548"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7wsdf832aa1hx7o416kd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7wsdf832aa1hx7o416kd.png" alt="Bot running successfully" width="800" height="548"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwhplr09t4polai5t1evc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwhplr09t4polai5t1evc.png" alt="Telegram bot responding to /complaints" width="800" height="619"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Code and  My Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hermes Agent&lt;/strong&gt; by Nous Research — wrote, debugged, and ran all code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Python 3&lt;/strong&gt; — bot runtime&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;python-telegram-bot&lt;/strong&gt; — Telegram interface&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Selenium + headless Chrome&lt;/strong&gt; — JavaScript page rendering&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;BeautifulSoup4&lt;/strong&gt; — DOM parsing &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;WSL2 / Ubuntu&lt;/strong&gt; — development environment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I have no idea  except for hermes agent and wsl2 and how other is used . &lt;/p&gt;

&lt;h2&gt;
  
  
  How I Used Hermes Agent
&lt;/h2&gt;

&lt;p&gt;Here's the honest story: I came to this challenge as someone who had &lt;strong&gt;never used Hermes Agent before&lt;/strong&gt;. I spent the first half of the day just getting it installed.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Setup Journey
&lt;/h3&gt;

&lt;p&gt;I started from absolute zero — no curl, no pip, no WSL2. After installing WSL2, I discovered I was running as root (no &lt;code&gt;sudo&lt;/code&gt;), &lt;code&gt;apt&lt;/code&gt; wasn't in PATH, and pip threw &lt;code&gt;externally-managed-environment&lt;/code&gt; errors. Every step had a new obstacle.&lt;/p&gt;

&lt;p&gt;What got me through it was Hermes Agent's ability to &lt;strong&gt;diagnose its own environment&lt;/strong&gt;. Running &lt;code&gt;hermes doctor&lt;/code&gt; gave me a clear picture of what was working and what wasn't — 18 of 27 tools enabled on a completely fresh setup.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Build
&lt;/h3&gt;

&lt;p&gt;Once running, I gave Hermes this prompt:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Create a Telegram bot that fetches and analyzes public complaints from gunaso.opmcm.gov.np. The site is a Nuxt.js SPA — figure out how to get the data."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Hermes immediately identified the real challenge: the site renders everything in JavaScript. It couldn't just use &lt;code&gt;requests&lt;/code&gt; + BeautifulSoup. So it autonomously:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Wrote a multi-layer scraper that tries 8 known Nepal govt API URL patterns first&lt;/li&gt;
&lt;li&gt;Falls back to &lt;strong&gt;Selenium with headless Chrome&lt;/strong&gt; to actually render the page&lt;/li&gt;
&lt;li&gt;Intercepts real XHR/fetch calls the browser makes to find the live API endpoint&lt;/li&gt;
&lt;li&gt;Parses the rendered DOM as a final fallback&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When it hit a &lt;code&gt;TERMINAL_SSH_PORT&lt;/code&gt; config error blocking code execution, it diagnosed the cause (a bad hostname from earlier SSH setup), fixed the &lt;code&gt;.env&lt;/code&gt; file, and continued — without me telling it what was wrong.&lt;/p&gt;

&lt;p&gt;When the bot crashed with &lt;code&gt;AttributeError: 'list' object has no attribute 'get'&lt;/code&gt; — because the API returned lists-of-lists instead of dicts — Hermes identified the data shape mismatch and rewrote the &lt;code&gt;analyze()&lt;/code&gt; function to handle all three possible shapes: &lt;code&gt;dict&lt;/code&gt;, &lt;code&gt;list&lt;/code&gt;, and raw &lt;code&gt;str&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I wrote zero lines of this bot.&lt;/strong&gt; Every function, every fallback strategy, every bug fix came from Hermes Agent reasoning through the problem autonomously.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Surprised Me
&lt;/h3&gt;

&lt;p&gt;The thing that struck me most was how Hermes handled ambiguity. The Nepal government site doesn't document its API. There's no public endpoint listed anywhere.  &lt;/p&gt;

&lt;p&gt;That layered reasoning — &lt;em&gt;try the smart thing, then the less smart thing, then the brute force thing&lt;/em&gt; — felt genuinely agentic. Not just code generation. Problem solving. &lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Matters for Nepal 🇳🇵
&lt;/h2&gt;

&lt;p&gt;Nepal's Hello Sarkar portal holds real accountability data — which ministries get the most complaints, how long resolutions take, what citizens are suffering through. That data is technically public but practically inaccessible to most people.&lt;/p&gt;

&lt;p&gt;A Telegram bot changes that. Telegram has deep penetration in Nepal. Any citizen, journalist, or civil society researcher can now type &lt;code&gt;/complaints&lt;/code&gt; and get instant civic insight — no browser, no technical knowledge needed.&lt;/p&gt;

&lt;p&gt;Hermes Agent made this possible in a single afternoon, from a country where most AI agent tutorials assume you already have a working dev environment with &lt;code&gt;brew install&lt;/code&gt; everything. Starting from &lt;code&gt;apt not found&lt;/code&gt; and ending with a working Telegram bot connected to live government data — that's the real demo.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built by Niranjan Lamichhane, Kathmandu, Nepal 🇳🇵&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Powered by Hermes Agent + OpenRouter (free tier) + WSL2&lt;/em&gt;&lt;/p&gt;

</description>
      <category>hermesagentchallenge</category>
      <category>devchallenge</category>
      <category>agents</category>
    </item>
    <item>
      <title>Building Multi‑Extension Tokens on Solana and making it compliance goated</title>
      <dc:creator>NIRANJAN LAMICHHANE</dc:creator>
      <pubDate>Fri, 29 May 2026 09:13:13 +0000</pubDate>
      <link>https://dev.to/niranjannlc/building-multi-extension-tokens-on-solana-and-making-it-compliance-goated-49pg</link>
      <guid>https://dev.to/niranjannlc/building-multi-extension-tokens-on-solana-and-making-it-compliance-goated-49pg</guid>
      <description>&lt;p&gt;After 36 days of diving into Solana development, I finally reached the most exciting milestone: &lt;strong&gt;composability&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
Solana’s Token Extensions allow you to combine multiple features into a single mint — without writing complex smart contract logic.  &lt;/p&gt;

&lt;p&gt;In this post, I’ll walk you through two real‑world scenarios:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Day 37&lt;/strong&gt; – A token with &lt;em&gt;transfer fee&lt;/em&gt;, &lt;em&gt;interest‑bearing&lt;/em&gt;, and &lt;em&gt;metadata&lt;/em&gt; extensions.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Day 38&lt;/strong&gt; – A compliance‑gated token with &lt;em&gt;default frozen accounts&lt;/em&gt; (perfect for regulated finance).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All commands are tested on &lt;strong&gt;Devnet&lt;/strong&gt; using the &lt;code&gt;spl-token&lt;/code&gt; CLI. Let’s go!&lt;/p&gt;


&lt;h2&gt;
  
  
  Day 37: The Triple‑Extension Token
&lt;/h2&gt;
&lt;h3&gt;
  
  
  The Goal
&lt;/h3&gt;

&lt;p&gt;Create a mint that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Charges a 1% transfer fee (capped at 5 tokens).&lt;/li&gt;
&lt;li&gt;Grows in value over time (interest‑bearing, 5 bps annually).&lt;/li&gt;
&lt;li&gt;Stores its name, symbol, and URI directly on‑chain (metadata).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Step 1 – Create the Mint
&lt;/h3&gt;

&lt;p&gt;One command, no backslashes (Windows‑friendly):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token &lt;span class="nt"&gt;--program-id&lt;/span&gt; TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb create-token &lt;span class="nt"&gt;--decimals&lt;/span&gt; 2 &lt;span class="nt"&gt;--transfer-fee-basis-points&lt;/span&gt; 100 &lt;span class="nt"&gt;--transfer-fee-maximum-fee&lt;/span&gt; 500 &lt;span class="nt"&gt;--interest-rate&lt;/span&gt; 5 &lt;span class="nt"&gt;--enable-metadata&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt; (yours will differ):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Creating token DrcSSbxxb63GiZiaXd1tFPRwwofFV3pJHSpFY1aCvcjN under program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
Address:  DrcSSbxxb63GiZiaXd1tFPRwwofFV3pJHSpFY1aCvcjN
Decimals:  2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the mint address — we’ll call it &lt;code&gt;$MINT&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2 – Initialize Metadata
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token initialize-metadata &lt;span class="nv"&gt;$MINT&lt;/span&gt; &lt;span class="s2"&gt;"ArcCoin"&lt;/span&gt; &lt;span class="s2"&gt;"ARC"&lt;/span&gt; &lt;span class="s2"&gt;"https://raw.githubusercontent.com/solana-developers/opos-asset/main/assets/CompressedCoil/metadata.json"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3 – Verify All Extensions
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token display &lt;span class="nv"&gt;$MINT&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt; (abridged):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;Extensions&lt;/span&gt;
  &lt;span class="s"&gt;Interest-bearing&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Current rate&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;5bps&lt;/span&gt;
  &lt;span class="na"&gt;Transfer fees&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Current fee&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;100bps&lt;/span&gt;
    &lt;span class="na"&gt;Current maximum&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50000&lt;/span&gt;
  &lt;span class="na"&gt;Metadata Pointer&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Metadata address&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;DrcSSbxxb63GiZiaXd1tFPRwwofFV3pJHSpFY1aCvcjN&lt;/span&gt;
  &lt;span class="na"&gt;Metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ArcCoin&lt;/span&gt;
    &lt;span class="na"&gt;Symbol&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ARC&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All three extensions are active ✅&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4 – Create an Account and Mint 1000 Tokens
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token create-account &lt;span class="nv"&gt;$MINT&lt;/span&gt;
spl-token mint &lt;span class="nv"&gt;$MINT&lt;/span&gt; 1000
spl-token balance &lt;span class="nv"&gt;$MINT&lt;/span&gt;   &lt;span class="c"&gt;# 1000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 5 – Test the Transfer Fee
&lt;/h3&gt;

&lt;p&gt;Create a second wallet (if you haven’t already):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;solana-keygen new &lt;span class="nt"&gt;--outfile&lt;/span&gt; second-wallet.json &lt;span class="nt"&gt;--no-bip39-passphrase&lt;/span&gt; &lt;span class="nt"&gt;--force&lt;/span&gt;
solana airdrop 1 second-wallet.json   &lt;span class="c"&gt;# fund for rent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create its token account and transfer 100 tokens:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token create-account &lt;span class="nv"&gt;$MINT&lt;/span&gt; &lt;span class="nt"&gt;--owner&lt;/span&gt; second-wallet.json
spl-token transfer &lt;span class="nv"&gt;$MINT&lt;/span&gt; 100 second-wallet.json &lt;span class="nt"&gt;--expected-fee&lt;/span&gt; 1 &lt;span class="nt"&gt;--allow-unfunded-recipient&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check balances:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token balance &lt;span class="nv"&gt;$MINT&lt;/span&gt;                     &lt;span class="c"&gt;# 900&lt;/span&gt;
spl-token balance &lt;span class="nv"&gt;$MINT&lt;/span&gt; &lt;span class="nt"&gt;--owner&lt;/span&gt; second-wallet.json   &lt;span class="c"&gt;# 99&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The 1 token fee is &lt;strong&gt;withheld&lt;/strong&gt; in the recipient’s account.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6 – Harvest Withheld Fees
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Find recipient’s token account&lt;/span&gt;
spl-token accounts &lt;span class="nt"&gt;--owner&lt;/span&gt; second-wallet.json &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;span class="c"&gt;# Withdraw to your own token account&lt;/span&gt;
spl-token withdraw-withheld-tokens YOUR_TOKEN_ACCOUNT RECIPIENT_TOKEN_ACCOUNT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After harvest:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token balance &lt;span class="nv"&gt;$MINT&lt;/span&gt;   &lt;span class="c"&gt;# 901 (the fee is yours)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Day 37 takeaway&lt;/strong&gt; – three extensions working together, no custom program required.&lt;/p&gt;




&lt;h2&gt;
  
  
  Day 38: Compliance‑Gated Token (Default Frozen)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Goal
&lt;/h3&gt;

&lt;p&gt;Create a mint where &lt;strong&gt;every token account starts frozen&lt;/strong&gt;. Only the freeze authority can thaw (approve) an account. This is how a regulated stablecoin or KYC‑gated platform works at the protocol level.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1 – Create the Mint with &lt;code&gt;--default-account-state frozen&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token create-token &lt;span class="nt"&gt;--program-id&lt;/span&gt; TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb &lt;span class="nt"&gt;--enable-freeze&lt;/span&gt; &lt;span class="nt"&gt;--default-account-state&lt;/span&gt; frozen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Address:  4jC4rjpi5wh1TKd2b8cLyAqFm9a68jmGRF1qPEnkENjm
Decimals:  9
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save as &lt;code&gt;$MINT_FROZEN&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2 – Create Two Token Accounts (Both Will Be Frozen)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token create-account &lt;span class="nv"&gt;$MINT_FROZEN&lt;/span&gt;                &lt;span class="c"&gt;# yours&lt;/span&gt;
spl-token create-account &lt;span class="nv"&gt;$MINT_FROZEN&lt;/span&gt; &lt;span class="nt"&gt;--owner&lt;/span&gt; second-wallet.json   &lt;span class="c"&gt;# second wallet&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3 – Try to Mint (Must Fail)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token mint &lt;span class="nv"&gt;$MINT_FROZEN&lt;/span&gt; 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected error&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Error: Account is frozen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ The enforcement works – even the mint authority cannot bypass it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4 – Thaw Your Account (The “KYC Approval”)
&lt;/h3&gt;

&lt;p&gt;First find your token account address (&lt;code&gt;spl-token accounts&lt;/code&gt;), then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token thaw YOUR_TOKEN_ACCOUNT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 5 – Mint Now Succeeds
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token mint &lt;span class="nv"&gt;$MINT_FROZEN&lt;/span&gt; 100
spl-token balance &lt;span class="nv"&gt;$MINT_FROZEN&lt;/span&gt;   &lt;span class="c"&gt;# 100&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 6 – Transfer to Still‑Frozen Second Account (Must Fail)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token transfer &lt;span class="nv"&gt;$MINT_FROZEN&lt;/span&gt; 50 second-wallet.json &lt;span class="nt"&gt;--allow-unfunded-recipient&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Error: &lt;code&gt;Account is frozen&lt;/code&gt; (destination).&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 7 – Thaw Second Account, Then Transfer Succeeds
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token thaw SECOND_WALLET_TOKEN_ACCOUNT
spl-token transfer &lt;span class="nv"&gt;$MINT_FROZEN&lt;/span&gt; 50 second-wallet.json &lt;span class="nt"&gt;--allow-unfunded-recipient&lt;/span&gt;
spl-token balance &lt;span class="nv"&gt;$MINT_FROZEN&lt;/span&gt; &lt;span class="nt"&gt;--owner&lt;/span&gt; second-wallet.json   &lt;span class="c"&gt;# 50&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Day 38 takeaway&lt;/strong&gt; – compliance is enforced at the runtime level, not in off‑chain code.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Composability is powerful&lt;/strong&gt; – you can mix and match extensions like LEGO bricks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The CLI abstracts complexity&lt;/strong&gt; – one command sets up TLV‑encoded extension data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Default frozen accounts&lt;/strong&gt; are a game‑changer for regulated finance on Solana.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debugging on Windows&lt;/strong&gt; requires absolute paths and careful attention to program IDs (the correct one is &lt;code&gt;TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb&lt;/code&gt; – note the lowercase &lt;code&gt;z&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>blockchain</category>
      <category>100daysofsolana</category>
      <category>web3</category>
    </item>
    <item>
      <title>Intrest bearing token in solana</title>
      <dc:creator>NIRANJAN LAMICHHANE</dc:creator>
      <pubDate>Fri, 29 May 2026 07:48:58 +0000</pubDate>
      <link>https://dev.to/niranjannlc/intrest-bearing-token-in-solana-20p0</link>
      <guid>https://dev.to/niranjannlc/intrest-bearing-token-in-solana-20p0</guid>
      <description>&lt;h2&gt;
  
  
  Create an Interest‑Bearing Token on Solana (Token‑2022) – Step by Step
&lt;/h2&gt;

&lt;p&gt;Learn how to mint a token that earns interest &lt;strong&gt;automatically, every second&lt;/strong&gt;, using Solana’s Token‑2022 program.&lt;br&gt;&lt;br&gt;
No staking, no separate contracts – just a CLI and a wallet.&lt;/p&gt;


&lt;h2&gt;
  
  
  1. Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Solana CLI &amp;amp; SPL Token CLI installed&lt;/li&gt;
&lt;li&gt;A funded wallet (devnet/testnet)&lt;/li&gt;
&lt;li&gt;Basic terminal comfort&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  2. Create the Mint (with 5% interest)
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;--interest-rate&lt;/code&gt; is in &lt;strong&gt;basis points&lt;/strong&gt; (bps).&lt;br&gt;&lt;br&gt;
500 bps = 5% APY.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token create-token &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--program-id&lt;/span&gt; TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--interest-rate&lt;/span&gt; 500
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sample output mint address (yours will differ):&lt;br&gt;&lt;br&gt;
&lt;code&gt;CRXKmUj2dVcJhr6uH5YVduZ352YdUeSxYT2WEvPA66Vu&lt;/code&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  3. Create a Token Account for Your Wallet
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token create-account &amp;lt;MINT_ADDRESS&amp;gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--program-id&lt;/span&gt; TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;(My created account: &lt;code&gt;9nSZ154gJQ8H2qzgLV8mk7K5N4LbngViksUyrzsgncn1&lt;/code&gt;)&lt;/p&gt;


&lt;h2&gt;
  
  
  4. Mint 1000 Tokens
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token mint &amp;lt;MINT_ADDRESS&amp;gt; 1000 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--program-id&lt;/span&gt; TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Observe the Growing Balance
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Check UI balance (applied interest)
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token balance &amp;lt;MINT_ADDRESS&amp;gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--program-id&lt;/span&gt; TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Result right after mint: &lt;code&gt;1000.000362839&lt;/code&gt; – already more than 1000!&lt;/p&gt;
&lt;h3&gt;
  
  
  Inspect mint metadata
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token display &amp;lt;MINT_ADDRESS&amp;gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--program-id&lt;/span&gt; TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You’ll see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SPL Token Mint
  …
  Supply: 1000000000000   (raw supply, 1000 tokens with 9 decimals)
  Decimals: 9
  Interest-bearing:
    Current rate: 500bps
    Average rate: 500bps
    Rate authority: …
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Key insight:&lt;/strong&gt; The on‑chain supply never changes.&lt;br&gt;&lt;br&gt;
The UI balance grows because the program calculates interest per second from the last update time.&lt;/p&gt;
&lt;h3&gt;
  
  
  See raw account data (optional)
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;solana account &amp;lt;MINT_ADDRESS&amp;gt; &lt;span class="nt"&gt;--output&lt;/span&gt; json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Returns a base64‑encoded blob – that’s where the interest rate and timestamp live.&lt;/p&gt;


&lt;h2&gt;
  
  
  6. Wait and Watch Interest Compound
&lt;/h2&gt;

&lt;p&gt;After a few minutes, run &lt;code&gt;spl-token balance&lt;/code&gt; again.&lt;br&gt;&lt;br&gt;
The number will be larger – without any transaction.&lt;/p&gt;


&lt;h2&gt;
  
  
  7. Change the Interest Rate
&lt;/h2&gt;

&lt;p&gt;As the &lt;strong&gt;rate authority&lt;/strong&gt;, you can update the rate anytime.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token set-interest-rate &amp;lt;MINT_ADDRESS&amp;gt; 15000   &lt;span class="c"&gt;# 150% APY&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check display again – &lt;code&gt;Current rate&lt;/code&gt; now shows &lt;code&gt;15000bps&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
Balance will start climbing much faster.&lt;/p&gt;

&lt;p&gt;Later I set it to &lt;code&gt;30000&lt;/code&gt; (300% APY) and balance quickly went to &lt;code&gt;1000.015285823&lt;/code&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  8. Rate Limits
&lt;/h2&gt;

&lt;p&gt;The rate is stored as a 16‑bit signed integer (i16).&lt;br&gt;&lt;br&gt;
Max allowed: &lt;strong&gt;32767 bps&lt;/strong&gt; (~327.67% APY).&lt;br&gt;&lt;br&gt;
Min allowed: &lt;strong&gt;-32768 bps&lt;/strong&gt; (negative interest, for demurrage tokens).&lt;/p&gt;

&lt;p&gt;Trying &lt;code&gt;35000&lt;/code&gt; or &lt;code&gt;100000&lt;/code&gt; will error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;error: number too large to fit in target type
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  My Full Command History (Reference)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spl-token create-token &lt;span class="nt"&gt;--program-id&lt;/span&gt; TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb &lt;span class="nt"&gt;--interest-rate&lt;/span&gt; 500
spl-token create-account CRXKmUj2dVcJhr6uH5YVduZ352YdUeSxYT2WEvPA66Vu &lt;span class="nt"&gt;--program-id&lt;/span&gt; TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
spl-token mint CRXKmUj2dVcJhr6uH5YVduZ352YdUeSxYT2WEvPA66Vu 1000 &lt;span class="nt"&gt;--program-id&lt;/span&gt; TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
spl-token balance CRXKmUj2dVcJhr6uH5YVduZ352YdUeSxYT2WEvPA66Vu &lt;span class="nt"&gt;--program-id&lt;/span&gt; TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
&lt;span class="c"&gt;# 1000.000362839&lt;/span&gt;
spl-token display CRXKmUj2dVcJhr6uH5YVduZ352YdUeSxYT2WEvPA66Vu &lt;span class="nt"&gt;--program-id&lt;/span&gt; TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
solana account CRXKmUj2dVcJhr6uH5YVduZ352YdUeSxYT2WEvPA66Vu &lt;span class="nt"&gt;--output&lt;/span&gt; json
spl-token set-interest-rate CRXKmUj2dVcJhr6uH5YVduZ352YdUeSxYT2WEvPA66Vu 15000
spl-token balance … &lt;span class="c"&gt;# 1000.008316801&lt;/span&gt;
spl-token set-interest-rate CRXKmUj2dVcJhr6uH5YVduZ352YdUeSxYT2WEvPA66Vu 30000
spl-token balance … &lt;span class="c"&gt;# 1000.015285823&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Why This Matters
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Yield‑bearing stablecoins&lt;/strong&gt; without external protocols
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automatic savings tokens&lt;/strong&gt; that reward holders per second
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic rates&lt;/strong&gt; – adjust APY on the fly based on market conditions
&lt;/li&gt;
&lt;li&gt;Fully on‑chain, permissionless, composable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now go build your own interest‑bearing token. Happy hacking! 🚀&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>web3</category>
      <category>100daysofsolana</category>
    </item>
    <item>
      <title>Understanding tokenomics of Solana</title>
      <dc:creator>NIRANJAN LAMICHHANE</dc:creator>
      <pubDate>Thu, 28 May 2026 06:51:24 +0000</pubDate>
      <link>https://dev.to/niranjannlc/understanding-tokenomics-of-solana-2p5o</link>
      <guid>https://dev.to/niranjannlc/understanding-tokenomics-of-solana-2p5o</guid>
      <description>&lt;p&gt;In recent days of #100daysofsolana , i learned worked with transfer-fee-enabled tokens, withheld fees, fee authorities, and Token-2022-specific behavior.&lt;/p&gt;

&lt;p&gt;During this , i specifically struggled with  creating a standard SPL token account instead of a Token-2022 token account, which result in transactions fail, accounts appear incompatible, and CLI commands behave unexpectedly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fezs4kbixnfu93rqh38td.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fezs4kbixnfu93rqh38td.png" alt="Failure " width="798" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From this struggle , i specifically learnt that : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;fees are automatically deducted during transfers,&lt;/li&gt;
&lt;li&gt;fees accumulate in token accounts,&lt;/li&gt;
&lt;li&gt;withheld fees must later be withdrawn. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3tebsei23q4axrhb1ukq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3tebsei23q4axrhb1ukq.png" alt="Withheld fees withdrawn illustrated " width="800" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>web3</category>
      <category>blockchain</category>
      <category>100daysofsolana</category>
    </item>
    <item>
      <title>Solana Account Model — City Analogy</title>
      <dc:creator>NIRANJAN LAMICHHANE</dc:creator>
      <pubDate>Wed, 27 May 2026 07:18:52 +0000</pubDate>
      <link>https://dev.to/niranjannlc/solana-account-model-city-analogy-1lhp</link>
      <guid>https://dev.to/niranjannlc/solana-account-model-city-analogy-1lhp</guid>
      <description>&lt;h2&gt;
  
  
  Think of Solana as a city
&lt;/h2&gt;

&lt;p&gt;Every building in the city has the same basic structure: an address, a size, an owner, and contents inside. That is exactly what an account is — a building. The blockchain is the city map that records who owns what building and what is inside each one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 5 fields — what every building has
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Analogy&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lamports&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;money inside the building&lt;/td&gt;
&lt;td&gt;how much SOL this account holds (1 SOL = 1 billion lamports)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;owner&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;who has the master key&lt;/td&gt;
&lt;td&gt;only this program can change what is inside — everyone else can look but not touch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;data&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;what is stored inside&lt;/td&gt;
&lt;td&gt;raw bytes — could be empty (a wallet) or full of state (token balance, game score)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;executable&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;is it a factory or a house?&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;false&lt;/code&gt; = stores things (wallet, data) · &lt;code&gt;true&lt;/code&gt; = runs code (a program)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;rentEpoch&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;building tax status&lt;/td&gt;
&lt;td&gt;pay 2 years rent upfront and you never pay again — that is rent exemption&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Why are program and data separate buildings?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Ethereum way:&lt;/strong&gt; imagine a McDonald's where the kitchen (code) and the customer orders (data) are locked inside the same room. To change the menu, you demolish the whole building and rebuild it. Every new franchise needs its own separate building with its own separate kitchen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Solana way:&lt;/strong&gt; the kitchen (program account) is one permanent building in the city. It never stores any food orders inside — it is just the recipe book and the chef. Every customer order (data account) is a separate locker room next door, owned by the kitchen. Millions of lockers, one kitchen.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three building types in the city
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Wallet account&lt;/strong&gt; — Your house. You own it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;executable: false&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;data: empty&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;owner: System Program&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Holds SOL. The System Program is like the city government — it owns all plain wallets but you control yours with your private key (signature).&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Program account&lt;/strong&gt; — A factory. Read-only.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;executable: true&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;data: BPF bytecode&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;owner: BPF Loader&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Pure logic. No state lives here. Once deployed it just sits there waiting to be called. Upgrading means redeploying the bytecode — the data accounts are untouched.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data account (PDA)&lt;/strong&gt; — A locker assigned to you.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;executable: false&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;data: your state&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;owner: the program&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Created by the program on your behalf. Stores your token balance, your game score, your profile — whatever the program needs to remember about you. You cannot open it without the program.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  One-line rule to remember forever
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;strong&gt;owner&lt;/strong&gt; field is the master key. Only the program listed as owner can change the data inside or take lamports out. Anyone in the world can send SOL in or read the data — but only the owner can write.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Your wallet is owned by the System Program. When you sign a transaction, you are telling the System Program "I authorise this" — and it acts on your behalf because your signature matches your address.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Walk me through a SOL transfer at the account level — which accounts change and which programs act on them.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>100daysofsolana</category>
      <category>web3</category>
      <category>blockchain</category>
      <category>solana</category>
    </item>
    <item>
      <title>Solana Transactions: not just a “request/response” ,but “atomic on-chain state changes”</title>
      <dc:creator>NIRANJAN LAMICHHANE</dc:creator>
      <pubDate>Wed, 27 May 2026 05:28:51 +0000</pubDate>
      <link>https://dev.to/niranjannlc/solana-transactions-not-just-a-requestresponse-but-atomic-on-chain-state-changes-38pg</link>
      <guid>https://dev.to/niranjannlc/solana-transactions-not-just-a-requestresponse-but-atomic-on-chain-state-changes-38pg</guid>
      <description>&lt;p&gt;In web2 , our rest api call are confined with just request and response framework . In web3 , for this particular solana , our transaction goes through  this full commitment lifecycle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;send() → Processed ✓ → Confirmed ✓ → Finalized ✓
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;State&lt;/th&gt;
&lt;th&gt;What it means&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Processed&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Validator received the transaction&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Confirmed&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2/3 of stake weight agrees&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Finalized&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Permanent — cannot be rolled back&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;sendAndConfirmTransaction()&lt;/code&gt; polls internally through all 3 states and resolves once finalized.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pay to &lt;em&gt;attempt&lt;/em&gt;, not just to &lt;em&gt;succeed&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;Unlike of web2 , on which failed transaction incur nothing ,in web3 , we  pay to &lt;em&gt;attempt&lt;/em&gt;, not just to &lt;em&gt;succeed&lt;/em&gt;. The chain ran the instruction, hit the error, and charged the fee anyway.&lt;/p&gt;

&lt;p&gt;During my day 19 of 100 days of solona ,  I revealed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Status: Error processing Instruction 0 — custom program error: 0x1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;0x1&lt;/code&gt; = &lt;code&gt;InsufficientFunds&lt;/code&gt; on the System Program&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  What the failed tx showed
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftabvveqpaoz2nac5n3t2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftabvveqpaoz2nac5n3t2.png" alt=" " width="799" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value from my terminal&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Error code&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;custom program error: 0x1&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Fee charged&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0.000005 SOL&lt;/code&gt; (still deducted)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Compute Units&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;150&lt;/code&gt; consumed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Balance change&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;1.468975 → 1.46897&lt;/code&gt; (fee only)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Log message&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Transfer: insufficient lamports 1468970000, need 500000000000&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Final Note : err.logs vs console.error
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;err.logs&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;console.error(err)&lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Source&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Solana runtime (on-chain)&lt;/td&gt;
&lt;td&gt;Node.js&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Tells you&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WHY the chain rejected it&lt;/td&gt;
&lt;td&gt;WHERE your code broke&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Can be undefined?&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Yes — if tx never reached the chain&lt;/td&gt;
&lt;td&gt;No — always present&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Transfer: insufficient lamports…&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SendTransactionError: simulation failed…&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Recommendation :  Always use both:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;JS error:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;     &lt;span class="c1"&gt;// WHERE it broke&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;logs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Chain logs:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;logs&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;       &lt;span class="c1"&gt;// WHY chain rejected&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This much upto my learning journey for now . Will be updating other blog soon too . &lt;/p&gt;

</description>
      <category>solana</category>
      <category>blockchain</category>
      <category>web3</category>
      <category>100daysofsolana</category>
    </item>
    <item>
      <title>Policy Storyteller: Turning Nepali Bills into Human Stories with Gemma 4</title>
      <dc:creator>NIRANJAN LAMICHHANE</dc:creator>
      <pubDate>Mon, 25 May 2026 06:28:32 +0000</pubDate>
      <link>https://dev.to/niranjannlc/policy-storyteller-turning-nepali-bills-into-human-stories-with-gemma-4-5526</link>
      <guid>https://dev.to/niranjannlc/policy-storyteller-turning-nepali-bills-into-human-stories-with-gemma-4-5526</guid>
      <description>&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Policy Storyteller&lt;/strong&gt; helps Nepali citizens understand laws without a law degree.&lt;/p&gt;

&lt;p&gt;Pick a bill → get a &lt;strong&gt;plain-language brief&lt;/strong&gt;, &lt;strong&gt;three diverse personas&lt;/strong&gt; (Terai, hill, city — farmer, student, shopkeeper…), each with a &lt;strong&gt;day-in-the-life scenario&lt;/strong&gt; and &lt;strong&gt;what becomes riskier / safer&lt;/strong&gt; → vote on the story. English or नेपाली.&lt;/p&gt;

&lt;p&gt;Four bills built in: Social Media Act 2081, IT &amp;amp; Cyber Security 2082, School Education 2080, Privacy Act 2075.&lt;/p&gt;

&lt;p&gt;Not legal advice — &lt;strong&gt;digital equity&lt;/strong&gt; for low literacy and patchy 4G.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Repo:&lt;/strong&gt; &lt;a href="https://github.com/NiranjanNlc/PolicyStoryTeller" rel="noopener noreferrer"&gt;https://github.com/NiranjanNlc/PolicyStoryTeller&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flow:&lt;/strong&gt; Choose bill → Generate story (~1–2 min) → Explore brief &amp;amp; personas → Vote. Stories cache in &lt;code&gt;localStorage&lt;/code&gt; per bill + language.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Used Gemma 4
&lt;/h2&gt;

&lt;p&gt;Gemma 4 does &lt;strong&gt;everything&lt;/strong&gt; — no hand-written summaries, no rules engine. A FastAPI backend chains seven focused calls per story:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;Gemma 4 outputs&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Brief&lt;/td&gt;
&lt;td&gt;JSON: summary, who is affected, key points&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Personas&lt;/td&gt;
&lt;td&gt;3 diverse Nepali composites&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scenarios&lt;/td&gt;
&lt;td&gt;2–3 sentences each, NPR &amp;amp; real places&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Risks&lt;/td&gt;
&lt;td&gt;JSON: riskier / safer lists&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Prompts force &lt;strong&gt;Nepal context&lt;/strong&gt; (Nagarpalika, NPR, Dashain, Terai/hill/mountain) and &lt;strong&gt;Devanagari Nepali&lt;/strong&gt; when selected. Pydantic validates JSON; one auto-retry if the model adds markdown fences.&lt;/p&gt;

&lt;p&gt;Via &lt;strong&gt;OpenRouter&lt;/strong&gt; (OpenAI-compatible API) — swap model id in &lt;code&gt;.env&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which Model &amp;amp; Why
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Gemma 4 small (2B/4B)&lt;/strong&gt; — on purpose.&lt;/p&gt;

&lt;p&gt;Civic users are on phones and free tiers. Each job is small JSON or a few sentences — not a 31B reasoning marathon. Seven sequential calls already take ~1–2 minutes; small Gemma keeps that affordable, fast enough, and good enough in Nepali. MoE/dense would be overkill; small Gemma is the tool that can run &lt;em&gt;in&lt;/em&gt; Nepal, not just &lt;em&gt;about&lt;/em&gt; Nepal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stack
&lt;/h2&gt;

&lt;p&gt;React + Vite + Tailwind · FastAPI + Pydantic · OpenRouter · no DB (localStorage + file votes)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;backend &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; copy .env.example .env
uvicorn main:app &lt;span class="nt"&gt;--reload&lt;/span&gt; &lt;span class="nt"&gt;--port&lt;/span&gt; 8000
&lt;span class="nb"&gt;cd&lt;/span&gt; ../frontend &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Learned (quick)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Retry on bad JSON beats switching to a bigger model.&lt;/li&gt;
&lt;li&gt;Tell Gemma &lt;em&gt;who&lt;/em&gt; the reader is (“low legal literacy”) — Nepali output improves a lot.&lt;/li&gt;
&lt;li&gt;Run calls &lt;strong&gt;sequentially&lt;/strong&gt; on free tier or you hit 429 halfway through a story.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/NiranjanNlc/PolicyStoryTeller" rel="noopener noreferrer"&gt;https://github.com/NiranjanNlc/PolicyStoryTeller&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://dev.to/challenges/google-gemma-2026-05-06"&gt;Gemma 4 Challenge&lt;/a&gt; — &lt;em&gt;Build With Gemma 4&lt;/em&gt; · Solo · MIT&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; Educational composites only — verify with official Nepal Government sources.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>gemmachallenge</category>
      <category>gemma</category>
    </item>
    <item>
      <title>NO no Account is not just a database , whose history is traced and logged .</title>
      <dc:creator>NIRANJAN LAMICHHANE</dc:creator>
      <pubDate>Mon, 04 May 2026 13:36:21 +0000</pubDate>
      <link>https://dev.to/niranjannlc/no-no-account-is-not-just-a-database-whose-history-is-traced-and-logged--2092</link>
      <guid>https://dev.to/niranjannlc/no-no-account-is-not-just-a-database-whose-history-is-traced-and-logged--2092</guid>
      <description>&lt;p&gt;In this second week of #100daysofsolana , i got got introduced with the concept of account . I learned it by contrasting with the database of web2 . &lt;br&gt;
However , i am aware that Solana's account model is not  replacement for web2 database, rather it's solving a different problem: storing state in a system where no single entity has control, reads are public, and writes require cryptographic authorization. &lt;br&gt;
On Solana, "every account is an open book the moment it exists". You can query any program address on the internet and instantly see its balance, owner, executable flag, and transaction history—no API key, no permission, no credentials. &lt;br&gt;
In a normal app, our code checks if a user is allowed to edit something. On Solana, the system itself blocks anyone except the account's owner from making changes. To update an account, we must prove you own it by signing the transaction.&lt;br&gt;
In a regular database, we can ask for related data with a JOIN. On Solana, accounts cannot query each other. If we  need connected information, we  fetch each account individually and combine them in your own code. This sounds old‑fashioned, but it's one reason Solana runs so fast.&lt;/p&gt;

</description>
      <category>100daysofsolona</category>
      <category>blockchain</category>
      <category>web3</category>
    </item>
    <item>
      <title>First experince with programming in web3</title>
      <dc:creator>NIRANJAN LAMICHHANE</dc:creator>
      <pubDate>Sun, 26 Apr 2026 11:34:43 +0000</pubDate>
      <link>https://dev.to/niranjannlc/first-experince-with-programming-in-web3-5bkk</link>
      <guid>https://dev.to/niranjannlc/first-experince-with-programming-in-web3-5bkk</guid>
      <description>&lt;p&gt;Here , i  connect with the devnet of sol with the help of phanthom wallet from browser &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnqfa8le4rqgsriu7dpb7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnqfa8le4rqgsriu7dpb7.png" alt=" " width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>web3</category>
      <category>100daysofsolana</category>
      <category>ai</category>
      <category>programming</category>
    </item>
    <item>
      <title>Learning of W1 of #100DaysOfSolana</title>
      <dc:creator>NIRANJAN LAMICHHANE</dc:creator>
      <pubDate>Sun, 26 Apr 2026 11:27:51 +0000</pubDate>
      <link>https://dev.to/niranjannlc/learning-of-w1-of-100daysofsolana-39fc</link>
      <guid>https://dev.to/niranjannlc/learning-of-w1-of-100daysofsolana-39fc</guid>
      <description>&lt;p&gt;I always have the thrill and wish for learning and experimenting with the web3 . Scattered tutorial and knowledge over different platform has not contributed significantly in  my knowledge building . &lt;br&gt;
So , i decides to enroll and go along with #100DaysOfSolana to bring some sort of structured knowledge in the sector of web3 . Till now , this journey gave me a true eureka moment for understanding different concepts and terminology that I’d heard before but never fully grasped. Let me share three breakthroughs that changed how I see Web3.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Public Key vs. Private Key – Not Just a Username and Password&lt;/strong&gt;&lt;br&gt;
The public key is what others see. They use it to send you crypto or verify that a transaction came from your wallet. In Web2 terms, it’s like a username. But here’s the nuance: Web3 is pseudonymous, not fully anonymous. Your public key is visible on the ledger, but your real-world identity isn’t attached unless you connect it yourself.&lt;/p&gt;

&lt;p&gt;The private key, on the other hand, is yours alone. You use it to sign transactions – proving you own the wallet without revealing the key itself. It’s similar to a Web2 password, but with one huge difference: there’s no “forgot password” option. Lose your private key, lose your funds forever. That’s why people write it down on paper or use hardware wallets. This clarity was my first big aha moment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Devnet – The Playground Before the Real Game&lt;/strong&gt;&lt;br&gt;
For a long time, I wondered: how can developers experiment with cryptocurrency when it has real value and trades live? That confusion vanished when I discovered Solana Devnet.&lt;/p&gt;

&lt;p&gt;On devnet, you can request fake SOL for free using a faucet. You can deploy smart contracts, send transactions, and make mistakes without losing real money. It’s a sandbox. Once your code works on devnet, you test again on testnet, and only then do you go to mainnet – the live blockchain. Now I understand that almost every serious blockchain project starts its life on a devnet or testnet. This made programming with crypto feel safe and exciting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Integers, Not Floats – Avoiding the Rounding Nightmare&lt;/strong&gt;&lt;br&gt;
Another question haunted me: why do blockchains use integers (like lamports for SOL or satoshis for Bitcoin) instead of floating-point numbers?&lt;/p&gt;

&lt;p&gt;The answer clicked when I thought about rounding errors. Different machines round floating-point numbers differently – even by tiny amounts. On a public ledger where thousands of nodes must agree on every balance, those tiny differences would break consensus. One node might see 0.1 + 0.2 = 0.30000000000000004, while another sees a slightly different value. Using integers (e.g., 300,000 lamports) guarantees every node calculates exactly the same result. This small design choice is actually a pillar of trust in blockchain.&lt;/p&gt;

&lt;p&gt;So , in solana we are using the things of lamports and sol, while the result are being shown in the sol , the underlying calculation all are performed in lamports . For conversion , 1 SOL is always equal to 1,000,000,000 (one billion) Lamports. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;br&gt;
These eureka moments didn’t come  easily . It was with the passion  curiosity , dareness to ask the silly question , contigency in the learning , learning from the mistake and resistace to break the thing along making it . &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>web3</category>
      <category>100daysofsolana</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Coffee, Code, and Junie: My Journey to 10x Productivity with JetBrains AI</title>
      <dc:creator>NIRANJAN LAMICHHANE</dc:creator>
      <pubDate>Tue, 03 Feb 2026 14:25:59 +0000</pubDate>
      <link>https://dev.to/niranjannlc/coffee-code-and-junie-my-journey-to-10x-productivity-with-jetbrains-ai-27m4</link>
      <guid>https://dev.to/niranjannlc/coffee-code-and-junie-my-journey-to-10x-productivity-with-jetbrains-ai-27m4</guid>
      <description>&lt;h3&gt;
  
  
  Dream of 10x Developer :
&lt;/h3&gt;

&lt;p&gt;I've always chased that mythical 10x developer status—that magical state where code flows like water, bugs vanish before they form, and architecture emerges perfectly from the chaos.But something was holding me back to achieve this . &lt;br&gt;
I'm an IntelliJ evangelist. The keyboard shortcuts are muscle memory, the UI feels like home, and Android Studio is basically family. But every time I tried AI coding assistants, I hit the same wall—they all lived in VS Code's world. The mental context switching was killing my flow state.&lt;/p&gt;

&lt;p&gt;At this time , the intelij ide announces this hackathon of the Sky limit , providing myself the free credit and opportunity to try out junie and ai assisted coding .Its  like a gift from the coding gods: free access to Junie, an AI assistant built right into my beloved IDE.&lt;/p&gt;

&lt;p&gt;Same time , i was  starting to learn python and data science too .  To get maximum advantage of junie , i install python plugin in intelij ide to give a try to python and data science . Later , i found that Jetbrains have similar product “ Pycharm “ for this purposes. &lt;br&gt;
    Enough about me , lets talk about what I built  with the help of junie . &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fycmeuq0agz5z0ofczt5h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fycmeuq0agz5z0ofczt5h.png" alt="Homepage " width="800" height="429"&gt;&lt;/a&gt;&lt;br&gt;
I built ScrIM Coach, which  is an esports performance analysis tool that transforms raw League of Legends match data into actionable coaching insights. We  analyzes professional team performance using the GRID Esports API to identify strategic patterns, execution gaps, and draft weaknesses. We provide executive summary , detailed analysis , practice planning by analyzing the data to the coach . The coach can also print out the action plan from the insight we have constructed . &lt;/p&gt;

&lt;p&gt;The project is licenced under MIT license in following  &lt;a href="https://github.com/NiranjanNlc/CLOUD9-skylimit-hackathon" rel="noopener noreferrer"&gt;source :&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can try out at : &lt;a href="https://cloud9-skylimit-hackathon-1.onrender.com/" rel="noopener noreferrer"&gt;here &lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  My Favourite part :
&lt;/h3&gt;

&lt;p&gt;Favourite part of me was the BRAVE MODE. I give complete control over the junie to make changes to the project and its file . After providing prompt , i can have long sip of the coffee , read the hackathon details and submission requirement , while junie have completed the tasks . &lt;br&gt;
I'd write a prompt like 'Refactor this to follow clean architecture with proper separation of concerns,' take a long sip of coffee, watch Junie restructure 15 files simultaneously, and return to a codebase that was suddenly... beautiful. The best part? Nothing broke. Tests still passed. The UI still rendered&lt;/p&gt;

&lt;h3&gt;
  
  
  Important Contribution :
&lt;/h3&gt;

&lt;p&gt;The most important contribution junie make in my productivity is during the ui enhancement . Being the backend developer and android engineer previously , pixel perfect ui seems to be not my cup of tea. But using junie , i can not only draft , but also implement pixel perfect ui , in many cases , junie does it by itself , what we have to do is attach the screen shot of what went wrong and what is your desired output . &lt;/p&gt;

&lt;h3&gt;
  
  
  Impressive Refactoring  :
&lt;/h3&gt;

&lt;p&gt;The most powerful ability and impressive things about junie  for me is its ability to refactor without breaking the functionality and UI . I initially designed the working MVp with some trash architecture without following any pattern and standard . I refactor the whole of my mvp to adhere to solid principle and clean code architecture in the single prompt . Interestingly , nothing breaks at all  and i would be able to add new feature after that in more easier and scalable way. &lt;/p&gt;

&lt;h3&gt;
  
  
  UI Magic for Backend Developers:
&lt;/h3&gt;

&lt;p&gt;The most important contribution junie make in my productivity is during the ui enhancement . Being the backend developer and android engineer previously , pixel perfect ui seems to be not my cup of tea. But using junie , i can not only draft , but also implement pixel perfect ui , in many cases , junie does it by itself , what we have to do is attach the screen shot of what went wrong and what is your desired output . &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbwqr0lvkcplw22ep58cu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbwqr0lvkcplw22ep58cu.png" alt="Anaysis output" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Flow State Achievement:
&lt;/h3&gt;

&lt;p&gt;My workflow was made more smoother and i have attained the flow state during my this journey of hackathon . Adding feature , enhancing functionality were just a prompt away  and its debug mode executed by itself makes it produce the code which is actually  working . &lt;/p&gt;

&lt;h3&gt;
  
  
  Most Misused Capability :
&lt;/h3&gt;

&lt;p&gt;Not only i used Junie , I also misused junie , especially in the work of version control . I ordered ( just not prompted) junie to commit the changes it has made with clear commit message and push it to the remote source . Similarly , i often ordered it to combine multiple git commit to the single one  and of course , it obey me like a good servant. &lt;/p&gt;

&lt;h3&gt;
  
  
  Wish it was there :
&lt;/h3&gt;

&lt;p&gt;I wish to make my changes live on my deployed site as soon as i make change in the codebase, because legends debug in production. If inteilij have MCP server support , it would have been few prompt away . Absence of this feature makes me little disappointed at last . &lt;/p&gt;

&lt;p&gt;If you're like me—comfortable in JetBrains' ecosystem but curious about AI assistance—take the leap. The hackathon may be over, but the learning isn't. Junie showed me that the future of development isn't about replacing developers; it's about amplifying our humanity through technology.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>My Data Science Journey: Restaurant Tips Analysis</title>
      <dc:creator>NIRANJAN LAMICHHANE</dc:creator>
      <pubDate>Sun, 28 Dec 2025 08:04:57 +0000</pubDate>
      <link>https://dev.to/niranjannlc/-my-data-science-journey-restaurant-tips-analysis-30ek</link>
      <guid>https://dev.to/niranjannlc/-my-data-science-journey-restaurant-tips-analysis-30ek</guid>
      <description>&lt;p&gt;&lt;strong&gt;Project:&lt;/strong&gt; Exploratory Data Analysis on Restaurant Tips Dataset&lt;br&gt;
&lt;strong&gt;Duration:&lt;/strong&gt; Full EDA Process&lt;br&gt;
&lt;strong&gt;Dataset:&lt;/strong&gt; 243 restaurant transactions, 7 variables&lt;br&gt;
&lt;strong&gt;Status:&lt;/strong&gt; ✅ COMPLETED&lt;/p&gt;


&lt;h2&gt;
  
  
  📊 PROJECT OVERVIEW
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Dataset Information
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; Restaurant tips dataset&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Initial Size:&lt;/strong&gt; 244 rows × 7 columns&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Final Size:&lt;/strong&gt; 243 rows × 7 columns (after cleaning)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Variables:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Numerical: &lt;code&gt;total_bill&lt;/code&gt;, &lt;code&gt;tip&lt;/code&gt;, &lt;code&gt;size&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Categorical: &lt;code&gt;sex&lt;/code&gt;, &lt;code&gt;smoker&lt;/code&gt;, &lt;code&gt;day&lt;/code&gt;, &lt;code&gt;time&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Project Goal
&lt;/h3&gt;

&lt;p&gt;Understand what factors influence tipping behavior in restaurants through comprehensive exploratory data analysis.&lt;/p&gt;


&lt;h2&gt;
  
  
  🧹 PHASE 1: DATA CLEANING (Investigation 1.3)
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1.1 Missing Values Investigation
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Hypothesis:&lt;/strong&gt; "The Null Hypothesis" - Why might data be missing?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I Did:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Checked for missing values
&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isnull&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isnull&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;any&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isnull&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;  &lt;span class="c1"&gt;# Percentage
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Results:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;0 missing values&lt;/strong&gt; in all columns&lt;/li&gt;
&lt;li&gt;This indicated excellent data collection quality&lt;/li&gt;
&lt;li&gt;No imputation or removal needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Learning Moment:&lt;/strong&gt; Not all datasets have missing data, but always check!&lt;/p&gt;




&lt;h3&gt;
  
  
  1.2 Duplicate Detection
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Hypothesis:&lt;/strong&gt; Could identical transactions exist legitimately?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I Did:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Found duplicates
&lt;/span&gt;&lt;span class="n"&gt;num_duplicates&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;duplicated&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;duplicates&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;duplicated&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;keep&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;

&lt;span class="c1"&gt;# Removed them
&lt;/span&gt;&lt;span class="n"&gt;data_clean&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drop_duplicates&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Results:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Found &lt;strong&gt;1 duplicate row&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Bill: $13.00, Tip: $2.00, Female, Smoker, Thursday, Lunch, Party of 2&lt;/li&gt;
&lt;li&gt;Row 198 and Row 202 were IDENTICAL&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Decision:&lt;/strong&gt; Removed as likely data entry error&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Result:&lt;/strong&gt; 244 rows → 243 rows&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key Insight:&lt;/strong&gt; Identical transactions on same day/time are statistically improbable - likely errors.&lt;/p&gt;




&lt;h3&gt;
  
  
  1.3 Outlier Investigation
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Hypothesis:&lt;/strong&gt; "The Outlier Tribunal" - Are extreme values errors or legitimate?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I Did:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Created boxplots
&lt;/span&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;boxplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tip&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;boxplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;total_bill&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

&lt;span class="c1"&gt;# Calculated IQR boundaries
&lt;/span&gt;&lt;span class="n"&gt;Q1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tip&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;quantile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.25&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;Q3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tip&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;quantile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.75&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;IQR&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Q3&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;Q1&lt;/span&gt;
&lt;span class="n"&gt;upper_boundary&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Q3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1.5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;IQR&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Found outliers
&lt;/span&gt;&lt;span class="n"&gt;outliers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tip&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;upper_boundary&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Mathematical Formula:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IQR = Q3 - Q1
Upper Boundary = Q3 + (1.5 × IQR)
Lower Boundary = Q1 - (1.5 × IQR)

For Tips:
Q1 = $2.00
Q3 = $3.56
IQR = $1.56
Upper Boundary = $5.90
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Outliers Found:&lt;/strong&gt;&lt;br&gt;
| Bill    | Tip    | Tip % | Verdict         |&lt;br&gt;
|---------|--------|-------|-----------------|&lt;br&gt;
| $50.81  | $10.00 | 19.7% | ✅ Legitimate   |&lt;br&gt;
| $48.33  | $9.00  | 18.6% | ✅ Legitimate   |&lt;br&gt;
| $39.42  | $7.58  | 19.2% | ✅ Legitimate   |&lt;br&gt;
| $48.27  | $6.73  | 13.9% | ✅ Legitimate   |&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Decision:&lt;/strong&gt; Kept all outliers - they represent large parties with reasonable tip percentages&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Insight:&lt;/strong&gt; Outliers aren't always errors! Verify with context (tip percentage in this case).&lt;/p&gt;


&lt;h2&gt;
  
  
  🔬 PHASE 2: BIVARIATE ANALYSIS (Investigation 2.2)
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Overview: Testing 7 Relationships
&lt;/h3&gt;

&lt;p&gt;For each relationship, I followed the scientific method:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Hypothesis&lt;/strong&gt; - Make a prediction&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visualization&lt;/strong&gt; - Create appropriate chart&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Analysis&lt;/strong&gt; - Interpret the pattern&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conclusion&lt;/strong&gt; - Accept or reject hypothesis&lt;/li&gt;
&lt;/ol&gt;


&lt;h3&gt;
  
  
  2.1 Relationship #1: Total Bill → Tip
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;My Hypothesis:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"As total_bill increases, tip will increase WEAKLY"&lt;/li&gt;
&lt;li&gt;Reasoning: "Tip is 'keep the change' - not percentage based"&lt;/li&gt;
&lt;li&gt;Confidence: MEDIUM&lt;/li&gt;
&lt;li&gt;Expected: Weak/no relationship&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What I Did:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;scatter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data_clean&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;total_bill&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;data_clean&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tip&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;xlabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Total Bill ($)&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ylabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Tip ($)&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;title&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Relationship Between Total Bill and Tip Amount&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;show&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Results:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pattern: &lt;strong&gt;Strong upward linear trend&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Correlation: &lt;strong&gt;r = 0.67&lt;/strong&gt; (Strong positive)&lt;/li&gt;
&lt;li&gt;Points tightly clustered around imaginary line&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Hypothesis Verdict:&lt;/strong&gt; ❌ &lt;strong&gt;REJECTED&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I Learned:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;My hypothesis was WRONG - and that's okay!&lt;/li&gt;
&lt;li&gt;Reality: People tip 15-20% of bill (percentage-based, not "keep change")&lt;/li&gt;
&lt;li&gt;Mechanism: Bill × 15-20% = Tip (mathematical relationship)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key insight:&lt;/strong&gt; "Learning happens with mistakes" - being wrong is part of science!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Business Insight:&lt;/strong&gt; Higher bills = higher tips. Restaurants should encourage higher spending.&lt;/p&gt;




&lt;h3&gt;
  
  
  2.2 Relationship #2: Party Size → Total Bill
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;My Hypothesis:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"As party size increases, total_bill increases STRONGLY"&lt;/li&gt;
&lt;li&gt;Reasoning: "More people = more food (obvious!)"&lt;/li&gt;
&lt;li&gt;Confidence: HIGH&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What I Did:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;scatter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data_clean&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;size&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;data_clean&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;total_bill&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Results:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pattern: &lt;strong&gt;Grouped upward trend&lt;/strong&gt; (vertical columns)&lt;/li&gt;
&lt;li&gt;Correlation: &lt;strong&gt;r = 0.60&lt;/strong&gt; (Medium-strong positive)&lt;/li&gt;
&lt;li&gt;Party size = discrete (1,2,3,4,5,6), not continuous&lt;/li&gt;
&lt;li&gt;Size 2 most common, with widest bill range ($10-$40)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Hypothesis Verdict:&lt;/strong&gt; ✅ &lt;strong&gt;CONFIRMED&lt;/strong&gt; (but weaker than expected)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Insight:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Party size predicts bill, but doesn't determine it completely"&lt;/li&gt;
&lt;li&gt;A couple can outspend a group of 4 depending on what they order&lt;/li&gt;
&lt;li&gt;What people ORDER matters more than HOW MANY people&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2.3 Relationship #3: Party Size → Tip
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;My Hypothesis:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"As party size increases, tip increases STRONGLY"&lt;/li&gt;
&lt;li&gt;Reasoning: "More people → bigger bill → percentage-based tip → more tip"&lt;/li&gt;
&lt;li&gt;Confidence: HIGH&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Results:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pattern: &lt;strong&gt;Upward trend from size 1-4, then FLATTENS at 5-6&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Correlation: &lt;strong&gt;r = 0.49&lt;/strong&gt; (Medium-weak)&lt;/li&gt;
&lt;li&gt;Non-linear relationship!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Hypothesis Verdict:&lt;/strong&gt; ⚠️ &lt;strong&gt;PARTIALLY CORRECT&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Surprising Discovery:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tips increase up to party size 4&lt;/li&gt;
&lt;li&gt;Tips PLATEAU at sizes 5-6 (don't increase further!)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Possible Explanations:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Automatic gratuity&lt;/strong&gt; - Restaurants add mandatory 15-18% for large parties&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Social loafing&lt;/strong&gt; - "Someone else will tip well, so I don't need to"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Different occasions&lt;/strong&gt; - Large parties = kids/families (tip standard)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Splitting complications&lt;/strong&gt; - Harder to calculate when splitting 6 ways&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Key Insight:&lt;/strong&gt; Large parties tip differently than expected - real behavioral economics!&lt;/p&gt;




&lt;h3&gt;
  
  
  2.4 Relationship #4: Day of Week → Tip
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;My Hypothesis:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Highest: Sunday (weekend celebration mood)&lt;/li&gt;
&lt;li&gt;Lowest: Wednesday (people just filling stomach)&lt;/li&gt;
&lt;li&gt;Expected difference: MEDIUM&lt;/li&gt;
&lt;li&gt;Confidence: MEDIUM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What I Did:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;sns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;boxplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;day&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tip&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;data_clean&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Sun&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Mon&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Tue&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Wed&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Thur&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Fri&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Sat&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Results:&lt;/strong&gt;&lt;br&gt;
| Day       | Avg Tip | Verdict        |&lt;br&gt;
|-----------|---------|----------------|&lt;br&gt;
| Saturday  | $3.00   | 🏆 Highest     |&lt;br&gt;
| Sunday    | $2.90   | High           |&lt;br&gt;
| Mon/Tue/Wed| $2.25  | 🔻 Lowest (tie)|&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hypothesis Verdict:&lt;/strong&gt; ⚠️ &lt;strong&gt;PARTIALLY WRONG&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I Got Wrong:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Predicted Sunday highest → Actually Saturday highest&lt;/li&gt;
&lt;li&gt;Predicted Wednesday lowest → Correct (tied with Mon/Tue)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key Observations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Saturday has most high-tip outliers (special occasions, date nights)&lt;/li&gt;
&lt;li&gt;Sunday has LARGEST box (most variation) - diverse crowd&lt;/li&gt;
&lt;li&gt;Weekdays cluster together (consistent lower tipping)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key Insight:&lt;/strong&gt; &lt;br&gt;
"Sunday = diverse people = diverse tipping = large variation in tips"&lt;/p&gt;


&lt;h3&gt;
  
  
  2.5 Relationship #5: Time (Lunch vs Dinner) → Tip
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;My Hypothesis:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dinner will have higher tips&lt;/li&gt;
&lt;li&gt;Reasoning: "Night time = people more generous; lunch = people in rush"&lt;/li&gt;
&lt;li&gt;Confidence: MEDIUM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Results:&lt;/strong&gt;&lt;br&gt;
| Time   | Avg Tip | Difference |&lt;br&gt;
|--------|---------|------------|&lt;br&gt;
| Dinner | $3.00   | —          |&lt;br&gt;
| Lunch  | $2.20   | -$0.80     |&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hypothesis Verdict:&lt;/strong&gt; ✅ &lt;strong&gt;CONFIRMED!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Insight:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;$0.80 difference&lt;/strong&gt; - this is the BIGGEST categorical effect!&lt;/li&gt;
&lt;li&gt;Time of day is the STRONGEST categorical predictor&lt;/li&gt;
&lt;li&gt;Lunch customers are rushed, less satisfied with service&lt;/li&gt;
&lt;li&gt;Dinner is relaxed, celebratory atmosphere&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Business Recommendation:&lt;/strong&gt; Prioritize dinner service quality!&lt;/p&gt;


&lt;h3&gt;
  
  
  2.6 Relationship #6: Sex (Male vs Female) → Tip
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;My Hypothesis:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Males will tip MORE&lt;/li&gt;
&lt;li&gt;Reasoning: "Female waitresses + male customers trying to impress"&lt;/li&gt;
&lt;li&gt;Confidence: MEDIUM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Results:&lt;/strong&gt;&lt;br&gt;
| Sex    | Avg Tip | Difference |&lt;br&gt;
|--------|---------|------------|&lt;br&gt;
| Female | $3.20   | —          |&lt;br&gt;
| Male   | $3.00   | -$0.20     |&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hypothesis Verdict:&lt;/strong&gt; ❌ &lt;strong&gt;REJECTED!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I Got Wrong:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Females actually tip SLIGHTLY more (or it's basically equal)&lt;/li&gt;
&lt;li&gt;The difference is minimal ($0.20)&lt;/li&gt;
&lt;li&gt;Sex is NOT a strong predictor&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key Insight:&lt;/strong&gt; Gender stereotypes about tipping don't hold up in data!&lt;/p&gt;


&lt;h3&gt;
  
  
  2.7 Relationship #7: Smoker vs Non-Smoker → Tip
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;My Hypothesis:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Non-smokers will tip MORE&lt;/li&gt;
&lt;li&gt;Reasoning: "Smokers save money for cigarettes instead of tipping"&lt;/li&gt;
&lt;li&gt;Confidence: LOW&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Results:&lt;/strong&gt;&lt;br&gt;
| Smoker Status | Avg Tip | Difference |&lt;br&gt;
|---------------|---------|------------|&lt;br&gt;
| Smokers       | $3.00   | —          |&lt;br&gt;
| Non-smokers   | $2.80   | -$0.20     |&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hypothesis Verdict:&lt;/strong&gt; ❌ &lt;strong&gt;REJECTED!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Honest Reflection:&lt;/strong&gt; "Cannot figure out why" - and that's okay!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Possible Explanations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Smokers sit outside/at bar (different atmosphere?)&lt;/li&gt;
&lt;li&gt;Correlation, not causation (maybe age/demographic differences)&lt;/li&gt;
&lt;li&gt;Small difference ($0.20) might be random chance&lt;/li&gt;
&lt;li&gt;Need more data to understand&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key Insight:&lt;/strong&gt; Not every pattern has an obvious explanation - intellectual honesty matters!&lt;/p&gt;


&lt;h2&gt;
  
  
  📈 PHASE 3: CORRELATION ANALYSIS
&lt;/h2&gt;
&lt;h3&gt;
  
  
  What I Did:
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Correlation matrix
&lt;/span&gt;&lt;span class="n"&gt;correlation_matrix&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data_clean&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;total_bill&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tip&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;size&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]].&lt;/span&gt;&lt;span class="nf"&gt;corr&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;sns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;heatmap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;correlation_matrix&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;annot&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cmap&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;coolwarm&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Results:
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pair&lt;/th&gt;
&lt;th&gt;Correlation&lt;/th&gt;
&lt;th&gt;Strength&lt;/th&gt;
&lt;th&gt;Interpretation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;total_bill ↔ tip&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.67&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Strong&lt;/td&gt;
&lt;td&gt;🏆 Strongest predictor&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;size ↔ total_bill&lt;/td&gt;
&lt;td&gt;0.60&lt;/td&gt;
&lt;td&gt;Medium-Strong&lt;/td&gt;
&lt;td&gt;More people = more food&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;size ↔ tip&lt;/td&gt;
&lt;td&gt;0.49&lt;/td&gt;
&lt;td&gt;Medium-Weak&lt;/td&gt;
&lt;td&gt;Non-linear (plateaus)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Key Insight:&lt;/strong&gt; &lt;br&gt;
"Tip percentage is fixed as that of total bill" - this explains the 0.67 correlation perfectly!&lt;/p&gt;


&lt;h2&gt;
  
  
  🎨 PHASE 4: PAIRPLOT (Visual Summary)
&lt;/h2&gt;
&lt;h3&gt;
  
  
  What I Did:
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;sns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pairplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data_clean&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
             &lt;span class="nb"&gt;vars&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;total_bill&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tip&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;size&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
             &lt;span class="n"&gt;hue&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;time&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# Color by lunch/dinner
&lt;/span&gt;             &lt;span class="n"&gt;diag_kind&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;hist&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Observations:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;From diagonal (distributions):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Most common tip: ~$2-3&lt;/li&gt;
&lt;li&gt;Most common bill: ~$15-20&lt;/li&gt;
&lt;li&gt;Most common party size: 2 people&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;From scatter plots:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;total_bill vs tip: Clear upward trend (confirms r=0.67)&lt;/li&gt;
&lt;li&gt;size vs others: Grouped patterns (discrete variable)&lt;/li&gt;
&lt;li&gt;Lunch (blue) vs Dinner (orange): Overlap mostly, but dinner shifts slightly higher&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Overall Impression:&lt;/strong&gt; Relationships are SOMEWHAT CLEAR - not perfect, but strong enough to be meaningful&lt;/p&gt;


&lt;h2&gt;
  
  
  🎯 KEY FINDINGS SUMMARY
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Strongest Predictors (Ranked):
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Total Bill&lt;/strong&gt; (r=0.67) 🥇&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Explains ~45% of tip variation (r² = 0.67² = 0.45)&lt;/li&gt;
&lt;li&gt;Clear linear relationship&lt;/li&gt;
&lt;li&gt;Percentage-based tipping (15-20%)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Time of Day&lt;/strong&gt; ($0.80 difference) 🥈&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dinner tips $0.80 more than lunch&lt;/li&gt;
&lt;li&gt;Strongest categorical effect&lt;/li&gt;
&lt;li&gt;Reflects rushed vs relaxed dining&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Party Size&lt;/strong&gt; (r=0.49 with tip) 🥉&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Medium effect, but NON-LINEAR&lt;/li&gt;
&lt;li&gt;Plateaus at size 5-6&lt;/li&gt;
&lt;li&gt;Different behavior for large groups&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Day of Week&lt;/strong&gt; ($0.75 difference)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Saturday highest ($3.00)&lt;/li&gt;
&lt;li&gt;Weekdays lowest (~$2.25)&lt;/li&gt;
&lt;li&gt;Weekend vs weekday effect&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Sex&lt;/strong&gt; ($0.20 difference) - WEAK&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimal difference&lt;/li&gt;
&lt;li&gt;Nearly equal tipping&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Smoker Status&lt;/strong&gt; ($0.20 difference) - WEAK&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimal difference&lt;/li&gt;
&lt;li&gt;Unexplained pattern&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;
  
  
  💡 BUSINESS RECOMMENDATIONS
&lt;/h2&gt;

&lt;p&gt;Based on data analysis, restaurant owners should:&lt;/p&gt;
&lt;h3&gt;
  
  
  1. &lt;strong&gt;FOCUS ON INCREASING BILL AMOUNT&lt;/strong&gt; 🎯
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt; Strongest correlation (0.67) - higher bills directly lead to higher tips&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Actions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Upsell appetizers, drinks, desserts&lt;/li&gt;
&lt;li&gt;Create combo deals that increase bill&lt;/li&gt;
&lt;li&gt;Train servers on suggestive selling&lt;/li&gt;
&lt;li&gt;Offer premium menu items&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Expected Impact:&lt;/strong&gt; 10% increase in average bill → ~10% increase in tips&lt;/p&gt;


&lt;h3&gt;
  
  
  2. &lt;strong&gt;PRIORITIZE DINNER SERVICE&lt;/strong&gt; 🌙
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt; Dinner tips $0.80 (36%) more than lunch&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Actions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Allocate best servers to dinner shift&lt;/li&gt;
&lt;li&gt;Focus marketing on dinner hours&lt;/li&gt;
&lt;li&gt;Create special dinner ambiance&lt;/li&gt;
&lt;li&gt;Dinner-specific promotions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Expected Impact:&lt;/strong&gt; Shift focus to higher-margin time period&lt;/p&gt;


&lt;h3&gt;
  
  
  3. &lt;strong&gt;OPTIMIZE FOR PARTY SIZES 2-4&lt;/strong&gt; 👥
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt; These sizes have best tip-to-effort ratio&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Actions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Table arrangements favor 2-4 person parties&lt;/li&gt;
&lt;li&gt;Special deals for couples/small groups&lt;/li&gt;
&lt;li&gt;Don't overinvest in large party accommodations (tips plateau)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Expected Impact:&lt;/strong&gt; Maximize tips per table/server time&lt;/p&gt;


&lt;h3&gt;
  
  
  4. &lt;strong&gt;WEEKEND FOCUS&lt;/strong&gt; 📅
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt; Saturday/Sunday have higher tips&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Actions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Premium staffing on weekends&lt;/li&gt;
&lt;li&gt;Weekend specials/events&lt;/li&gt;
&lt;li&gt;Higher-end menu items on weekends&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  5. &lt;strong&gt;DON'T DISCRIMINATE BY SEX/SMOKER&lt;/strong&gt; ⚖️
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt; These factors have minimal effect&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Insight:&lt;/strong&gt; Treat all customers equally - demographics don't significantly predict tipping&lt;/p&gt;


&lt;h2&gt;
  
  
  🧠 PERSONAL LEARNING JOURNEY
&lt;/h2&gt;
&lt;h3&gt;
  
  
  What I Learned About Data Science:
&lt;/h3&gt;
&lt;h4&gt;
  
  
  1. &lt;strong&gt;The Scientific Method Works!&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Make hypothesis → Test → Analyze → Conclude&lt;/li&gt;
&lt;li&gt;Being wrong is GOOD - that's how we learn!&lt;/li&gt;
&lt;li&gt;Quote: "Learning happens with mistakes"&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  2. &lt;strong&gt;Hypotheses Can Be Wrong&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;My Wrong Predictions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;❌ Thought tipping was "keep the change" → Actually percentage-based&lt;/li&gt;
&lt;li&gt;❌ Thought Sunday would have highest tips → Actually Saturday&lt;/li&gt;
&lt;li&gt;❌ Thought males tip more → Actually nearly equal&lt;/li&gt;
&lt;li&gt;❌ Thought smokers tip less → Actually slightly more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Lesson:&lt;/strong&gt; Don't trust assumptions - test with data!&lt;/p&gt;
&lt;h4&gt;
  
  
  3. &lt;strong&gt;Correlation ≠ Causation&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Smokers tip more, but WHY?&lt;/li&gt;
&lt;li&gt;Could be confounding variables (age, location, etc.)&lt;/li&gt;
&lt;li&gt;Need more data to understand mechanisms&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  4. &lt;strong&gt;Context Matters&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Outliers aren't always errors&lt;/li&gt;
&lt;li&gt;$10 tip on $50 bill = 20% (normal!)&lt;/li&gt;
&lt;li&gt;Always calculate percentages/ratios for context&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  5. &lt;strong&gt;Data Quality First&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Clean data = reliable analysis&lt;/li&gt;
&lt;li&gt;Check for: missing values, duplicates, outliers&lt;/li&gt;
&lt;li&gt;This dataset was excellent (0 missing!)&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  6. &lt;strong&gt;Visualization is Powerful&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Scatter plots → see relationships&lt;/li&gt;
&lt;li&gt;Box plots → compare groups&lt;/li&gt;
&lt;li&gt;Correlation matrix → see everything at once&lt;/li&gt;
&lt;li&gt;Pairplot → ultimate summary&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  7. &lt;strong&gt;Different Charts for Different Data&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Numerical vs Numerical → Scatter plot&lt;/li&gt;
&lt;li&gt;Categorical vs Numerical → Box plot / Bar chart&lt;/li&gt;
&lt;li&gt;All at once → Pairplot, Correlation matrix&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  What I Learned About Python/Tools:
&lt;/h3&gt;
&lt;h4&gt;
  
  
  Python Libraries:
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pandas&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;           &lt;span class="c1"&gt;# Data manipulation
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;            &lt;span class="c1"&gt;# Numerical operations
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;  &lt;span class="c1"&gt;# Basic plotting
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;seaborn&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;sns&lt;/span&gt;         &lt;span class="c1"&gt;# Statistical plotting
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  Key Functions Mastered:
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Pandas:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;head&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;              &lt;span class="c1"&gt;# First 5 rows
&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;               &lt;span class="c1"&gt;# Dimensions
&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;          &lt;span class="c1"&gt;# Statistics
&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isnull&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;      &lt;span class="c1"&gt;# Missing values
&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;duplicated&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# Duplicates
&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drop_duplicates&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;   &lt;span class="c1"&gt;# Remove duplicates
&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;column&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;           &lt;span class="c1"&gt;# Select column
&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;          &lt;span class="c1"&gt;# Filter rows
&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;groupby&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;    &lt;span class="c1"&gt;# Group and aggregate
&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;corr&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;              &lt;span class="c1"&gt;# Correlation matrix
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Matplotlib:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;scatter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;        &lt;span class="c1"&gt;# Scatter plot
&lt;/span&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;xlabel&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;             &lt;span class="c1"&gt;# X-axis label
&lt;/span&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ylabel&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;             &lt;span class="c1"&gt;# Y-axis label
&lt;/span&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;title&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;              &lt;span class="c1"&gt;# Title
&lt;/span&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;               &lt;span class="c1"&gt;# Grid lines
&lt;/span&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;show&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;               &lt;span class="c1"&gt;# Display plot
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Seaborn:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;sns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;boxplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;category&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;number&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;sns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;heatmap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;corr_matrix&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;annot&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;sns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pairplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;vars&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col1&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;col2&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;hue&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;category&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Important Concepts:
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;1. Order Matters!&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# WRONG
&lt;/span&gt;&lt;span class="n"&gt;outliers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tip&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tip_pct&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tip&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;total_bill&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;outliers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tip_pct&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;  &lt;span class="c1"&gt;# ERROR!
&lt;/span&gt;
&lt;span class="c1"&gt;# RIGHT
&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tip_pct&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tip&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;total_bill&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;outliers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tip&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;outliers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tip_pct&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;  &lt;span class="c1"&gt;# WORKS!
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Matplotlib vs Seaborn:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;matplotlib = Low-level, flexible, more code&lt;/li&gt;
&lt;li&gt;seaborn = High-level, easy, pretty defaults&lt;/li&gt;
&lt;li&gt;Use both together!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Data Types Matter:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;float64 / int64 = Can do math&lt;/li&gt;
&lt;li&gt;object = Text, can't do math&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Skills I Developed:
&lt;/h3&gt;

&lt;p&gt;✅ &lt;strong&gt;Technical Skills:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data cleaning and preprocessing&lt;/li&gt;
&lt;li&gt;Exploratory data analysis&lt;/li&gt;
&lt;li&gt;Statistical thinking&lt;/li&gt;
&lt;li&gt;Data visualization&lt;/li&gt;
&lt;li&gt;Python programming&lt;/li&gt;
&lt;li&gt;Using Jupyter notebooks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;✅ &lt;strong&gt;Analytical Skills:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hypothesis formation&lt;/li&gt;
&lt;li&gt;Pattern recognition&lt;/li&gt;
&lt;li&gt;Critical thinking&lt;/li&gt;
&lt;li&gt;Drawing insights from data&lt;/li&gt;
&lt;li&gt;Making business recommendations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;✅ &lt;strong&gt;Soft Skills:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scientific method application&lt;/li&gt;
&lt;li&gt;Intellectual honesty ("I don't know")&lt;/li&gt;
&lt;li&gt;Learning from mistakes&lt;/li&gt;
&lt;li&gt;Persistence through challenges&lt;/li&gt;
&lt;li&gt;Clear communication of findings&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📊 COMPLETE VISUALIZATIONS CREATED
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;✅ Scatter Plot: total_bill vs tip&lt;/li&gt;
&lt;li&gt;✅ Scatter Plot: size vs total_bill
&lt;/li&gt;
&lt;li&gt;✅ Scatter Plot: size vs tip&lt;/li&gt;
&lt;li&gt;✅ Box Plot: tip by day of week&lt;/li&gt;
&lt;li&gt;✅ Box Plot: tip by time (lunch/dinner)&lt;/li&gt;
&lt;li&gt;✅ Box Plot: tip by sex&lt;/li&gt;
&lt;li&gt;✅ Box Plot: tip by smoker status&lt;/li&gt;
&lt;li&gt;✅ Correlation Matrix Heatmap&lt;/li&gt;
&lt;li&gt;✅ Pairplot (all relationships)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Total:&lt;/strong&gt; 9 professional visualizations&lt;/p&gt;




&lt;h2&gt;
  
  
  🎓 FINAL REFLECTION
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What Worked Well:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Systematic approach (hypothesis → test → analyze)&lt;/li&gt;
&lt;li&gt;Using appropriate visualizations for each relationship&lt;/li&gt;
&lt;li&gt;Being open to being wrong&lt;/li&gt;
&lt;li&gt;Thorough data cleaning before analysis&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What I'd Do Differently:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Could explore interaction effects (e.g., day × time)&lt;/li&gt;
&lt;li&gt;Could calculate tip percentages earlier for context&lt;/li&gt;
&lt;li&gt;Could test non-linear relationships more formally&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Most Surprising Finding:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;"Party size plateaus at 5-6 people!"&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Expected linear relationship&lt;/li&gt;
&lt;li&gt;Discovered real-world behavioral economics&lt;/li&gt;
&lt;li&gt;Shows the value of looking at data, not just assumptions&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Most Important Lesson:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;"Total amount of spending is the determining factor"&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple but powerful&lt;/li&gt;
&lt;li&gt;Actionable for businesses&lt;/li&gt;
&lt;li&gt;Data-driven decision making&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;End of Journey Summary&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"The only real mistake is the one from which we learn nothing." - Henry Ford&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"In God we trust. All others must bring data." - W. Edwards Deming&lt;/em&gt;&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
