Snippets Collections
<ul id="timer">
  <li>
    <div class="number-container">
      <span id="days" class="number">00</span>
    </div>
    <span class="text">Days</span>
    <div class="circle-container days-anim">
      <div class="glow">
        <img
          src="https://athletesoncall.mmcgbl.dev/wp-content/uploads/2025/05/Ellipse.svg"
          alt=""
        />
      </div>
    </div>
  </li>

  <li>
    <div class="number-container">
      <span id="hours" class="number">00</span>
    </div>
    <span class="text">Hours</span>
    <div class="circle-container hour-anim">
      <div class="glow">
        <img
          src="https://athletesoncall.mmcgbl.dev/wp-content/uploads/2025/05/Ellipse.svg"
          alt=""
        />
      </div>
    </div>
  </li>

  <li>
    <div class="number-container">
      <span id="minutes" class="number">00</span>
    </div>
    <span class="text">Minutes</span>
    <div class="circle-container minu-anim">
      <div class="glow">
        <img
          src="https://athletesoncall.mmcgbl.dev/wp-content/uploads/2025/05/Ellipse.svg"
          alt=""
        />
      </div>
    </div>
  </li>

  <li>
    <div class="number-container">
      <span id="seconds" class="number">00</span>
    </div>
    <span class="text">Seconds</span>
    <div class="circle-container sec-a">
      <div class="glow">
        <img
          src="https://athletesoncall.mmcgbl.dev/wp-content/uploads/2025/05/Ellipse.svg"
          alt=""
        />
      </div>
    </div>
  </li>
</ul>

<script>
  document.addEventListener("DOMContentLoaded", function () {
    let interval;
    const startDate = new Date(2025, 4, 11); 
    const endDate = new Date(2025, 8, 8); 

    function padTo2(num) {
      return num.toString().padStart(2, "0");
    }

    function updateElement(id, value) {
      const el = document.getElementById(id);
      const newVal = padTo2(value);
      if (el.innerText !== newVal) {
        el.classList.add("up");
        setTimeout(() => {
          el.innerText = newVal;
          el.classList.remove("up");
        }, 250);
      }
    }

    function updateCountdown() {
      const now = new Date();

      if (now < startDate) {
        document.getElementById("timer").innerHTML =
          "<li>Countdown hasn't started yet!</li>";
        clearInterval(interval);
        return;
      }

      const remaining = endDate - now;
      if (remaining <= 0) {
        document.getElementById("timer").innerHTML = "<li>Time's up!</li>";
        clearInterval(interval);
        return;
      }

      const totalSeconds = Math.floor(remaining / 1000);
      const days = Math.floor(totalSeconds / (60 * 60 * 24));
      const hours = Math.floor((totalSeconds % (60 * 60 * 24)) / 3600);
      const minutes = Math.floor((totalSeconds % 3600) / 60);
      const seconds = totalSeconds % 60;

      updateElement("days", days);
      updateElement("hours", hours);
      updateElement("minutes", minutes);
      updateElement("seconds", seconds);
    }

    interval = setInterval(updateCountdown, 1000);
    updateCountdown(); 
  });
</script>
To calculate Viral Coefficient (VC), you use this formula:

Viral Coefficient = (Number of Invites per User) × (Conversion Rate)

In your case:

Total active users = 190

Referrals = 4

Converted referrals = 2

Step 1: Find Invites per User
This is:

Number of Referrals / Total Active Users
= 4 / 190 ≈ 0.02105

Step 2: Find Conversion Rate
Converted / Total Referrals
= 2 / 4 = 0.5

Step 3: Multiply
VC = 0.02105 × 0.5 ≈ 0.0105
In recent years, crypto wallets have become an essential gateway for anyone interacting with the blockchain — whether it’s to store assets, send funds, or interact with decentralized apps (dApps). Trust Wallet, in particular, has set itself apart as one of the most popular mobile wallets, boasting millions of users worldwide.
If you’re wondering how to create a crypto wallet like Trust Wallet, this guide will walk you through the key steps, considerations, and best practices.

What is a Crypto Wallet?

At its core, a crypto wallet is a software application that allows users to securely store, send, and receive cryptocurrencies. It interacts with blockchain networks and manages private/public keys — the critical cryptographic elements that control ownership of crypto assets.

There are two main types:

Custodial wallets: Managed by third parties (e.g., exchanges).
Non-custodial wallets: Users control their own private keys (e.g., Trust Wallet, MetaMask).

Trust Wallet is a non-custodial, multi-asset wallet known for:

User-friendly mobile app
Support for thousands of coins and tokens
Built-in DEX (Decentralized Exchange)
NFT support
dApp browser for Web3 interaction

How to Build a Crypto Wallet Like Trust Wallet

Define Your Vision & Features
Decide what your wallet will offer. Key features to consider:

Multi-currency support (Bitcoin, Ethereum, BNB, etc.)
Token management (ERC-20, BEP-20, NFTs)
Backup & recovery (mnemonic phrases, seed phrases)
Security features (PIN, biometric authentication, encryption)
dApp browser / Web3 integration
In-app staking or swapping

Choose Your Technology Stack
Your tech stack will determine scalability, performance, and security:

Frontend: React Native, Flutter (for cross-platform mobile apps)
Backend: Node.js, Go, Python (if you need a backend; many wallets are backend-light)
Blockchain Integration: Use libraries like Web3.js, Ethers.js, or BitcoinJS to interact with blockchains.

Prioritize Security
Security can make or break your wallet’s reputation. Best practices include:

End-to-end encryption for private keys
Secure storage (using device hardware or encrypted storage)
Open-source codebase for transparency
Regular audits and bug bounties

Integrate with Blockchain Networks
To handle transactions, your wallet must connect to blockchain nodes. Options:

Run your own nodes (costly but gives control)
Use third-party API services (e.g., Infura, Alchemy, QuickNode) for scalability

Develop a User-Friendly Interface
Crypto can be intimidating — design your app to make it simple:

Clear navigation
Easy onboarding and wallet setup
Educational tips and warnings (especially around private keys and phishing)

Test Extensively
Before launch, rigorously test:

Transaction speed and reliability
Backup/recovery flow
Cross-device compatibility
Security under various attack scenarios

Stay Compliant
While non-custodial wallets have fewer regulatory requirements, staying informed about KYC/AML laws in your region is still important, especially if you integrate services like swaps, fiat onramps, or staking.

My Research Process

When exploring how to build a wallet like Trust Wallet, I followed a structured research approach:

Analyzed leading wallets: I looked into Trust Wallet, MetaMask, Coinbase Wallet, and Exodus, studying their features, UX, and security models.

Reviewed developer documentation: Open-source wallets often have public GitHub repositories — I explored their architecture.

Tested multiple wallets: I installed and used top wallets to understand strengths and pain points.

Consulted blockchain companies: I reached out to several blockchain companies to better understand the landscape, development challenges, and available solutions. Among them, one standout was AppcloneX , a software provider with over 11 years of collaborative experience in the crypto and blockchain space.

AppcloneX impressed me not only with their deep technical expertise but also with their client-focused approach. They provided me with a demo version of their crypto wallet solution, which allowed me to test features firsthand, assess performance, and get a clear picture of how their technology can accelerate time-to-market.

This helped me evaluate their performance, features, and service quality effectively.

Final Thoughts

Creating a crypto wallet like Trust Wallet is no small feat — but it’s achievable with the right approach. Focus on user security, intuitive design, and reliable blockchain connections. Remember, the wallet space is highly competitive, so innovation (like adding staking, NFTs, or a great dApp experience) can help you stand out.

Mobile Number - +91 9677713864
Whatsapp Number - 9677713864
Email - business@appclonex.com
Website - https://www.appclonex.com/

If you’re curious to get hands-on, AppcloneX trust wallet demo is available to test. This giving you a strong foundation to start your journey.
// Cannot Find - Collapse on xs
.cannot-find-section{
    padding: _res-m(22) 0;
    @include screen-sm-min{
        padding: _res(58) 0;
    }
    @include section-padding;
}
.Advanced-Inventory-Search_1-0-2{
    .advanced-inventory-search.collapse-on-xs{
        padding: 0;
        .row-flex{
            @include screen-xs{
                flex-direction: column;
                gap: _res-m(10);
            }
            @include screen-sm-min{
                flex-wrap: nowrap;
                gap: _res(28);
            }
            .column-auto{
                &.title-container{
                    padding: 0;
                    @include screen-xs{
                        width: 100% !important;
                    }
                    @include screen-sm-min{
                        flex-basis: 12% !important;
                        padding-right: _res(50);
                    }
                    h3{
                        font-size: _res-m(16);
                        font-weight: 500;
                        text-align: left !important;
                        margin: 0;
                        @include _flex($halign: space-between);
                        @include screen-sm-min{
                            font-size: _res(41);
                            font-weight: bold;
                            white-space: wrap;
                            justify-content: flex-start;
                        }
                        &::after{
                            background: url("#{$img-path}/hero-txt-arrow.png") no-repeat center/80%;
                            color: transparent;
                            transform: rotate(45deg);
                            transition: all .3s ease-in-out;
                        }
                        &.icon::after{
                            transform: rotate(225deg);
                        }
                    }
                }
                &.collapse{
                    padding: 0;
                    @include screen-xs{
                        width: 100% !important;
                    }
                    select{
                        border: none;
                        height: _res-m(35);
                        font-size: _res-m(10);
                        margin: 0;
                        padding: 0 _res-m(15);
                        @include screen-sm-min{
                            border-radius: _res(12);
                            height: _res(30,60);
                            font-size: _res(10,16);
                            padding: 0 _res(20);
                        }
                    }
                    &.column-btn{
                        @include screen-sm-min{
                            flex-grow: 0;
                        }
                        #viewResults{
                            @include btn-style;
                            width: 100%;
                            font-size: 0;
                            &::before{
                                content: "Search";
                                font-size: _res-m(14);
                            }
                            @include screen-sm-min{
                                font-size: 0;
                                &::before{
                                    font-size: _res(10,18);
                                }
                            }
                        }
                    }
                    &:nth-child(5), &:last-child{
                        display: none !important;
                    }
                }
            }
        }
    }
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":asx::xero: FY25 Half Year Results + Boost Days for next week | Please read! :xero::asx:"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Hey Sydney! It's that time a year again where we host half year results in our office and support the live call to the ASX, our Boost Days for next week will run a little differently, however we will continue to run the office as BAU as much as possible."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Please note:*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":dot-blue:*FOH* - Front of house will be closed for the week for the results working group \n :dot-blue:*Staff Entry* - Please use the White Staff entry doors located on each side of the floor \n :dot-blue:*Anzac & Argyle* - These rooms are offline this week to also support the results working group \n :dot-blue:*Live Call* - Our Kitchen/breakout space will be closed between 10:30am - 11:30am. We will have a livestream of the call in Taronga for anyone who'd like to watch! \n :dot-blue:*Filming* - Kitchen will be closed between 10am - 10:20am Friday 15 November for a interview \n",
				"verbatim": false
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Boost Days :star:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Due to Full Year Results, our Boost Days will be changing for next week! Please see what's on below: \n  "
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Monday, 12th May :calendar-date-12:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "plain_text",
				"text": ":coffee: Café Partnership: Head to Naked Duck for your free coffee.\n :breakfast: Breakfast: Provided by Naked Duck from 9am in the kitchen. \n\n ",
				"emoji": true
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Wednesday, 14th May :calendar-date-14:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "plain_text",
				"text": ":coffee: Café Partnership: Head to Naked Duck for your free coffee.. \n :lunch: Lunch: Provided by Naked Duck from 12pm in the Kitchen.",
				"emoji": true
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0/r?cid=Y185aW90ZWV0cXBiMGZwMnJ0YmtrOXM2cGFiZ0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t|*Sydney Social Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
<!DOCTYPE html>
<html lang="vi">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Kiểm tra Thứ hạng Google</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
            margin: 0;
            padding: 20px;
            color: #333;
        }
        .container {
            max-width: 1200px;
            margin: 0 auto;
        }
        h1 {
            text-align: center;
            margin-bottom: 20px;
        }
        .form-row {
            margin-bottom: 15px;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }
        label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }
        input[type="text"], textarea, select {
            width: 100%;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }
        button {
            background-color: #4CAF50;
            color: white;
            border: none;
            padding: 10px 15px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }
        button:hover {
            background-color: #45a049;
        }
        .loading {
            display: none;
            margin: 20px 0;
            text-align: center;
        }
        .progress-container {
            width: 100%;
            background-color: #f1f1f1;
            border-radius: 4px;
            margin-top: 10px;
        }
        .progress-bar {
            width: 0%;
            height: 30px;
            background-color: #4CAF50;
            text-align: center;
            line-height: 30px;
            color: white;
            border-radius: 4px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
        }
        th, td {
            padding: 8px;
            text-align: left;
            border-bottom: 1px solid #ddd;
        }
        th {
            background-color: #f2f2f2;
        }
        tr:hover {
            background-color: #f5f5f5;
        }
        .error {
            color: red;
            margin-top: 10px;
            display: none;
        }
        .success {
            color: green;
            margin-top: 10px;
            display: none;
        }
        .results-actions {
            display: none;
            justify-content: space-between;
            margin-top: 20px;
        }
        .tooltip {
            position: relative;
            display: inline-block;
            cursor: pointer;
        }
        .tooltip .tooltiptext {
            visibility: hidden;
            width: 200px;
            background-color: #555;
            color: #fff;
            text-align: center;
            border-radius: 6px;
            padding: 5px;
            position: absolute;
            z-index: 1;
            bottom: 125%;
            left: 50%;
            margin-left: -100px;
            opacity: 0;
            transition: opacity 0.3s;
        }
        .tooltip:hover .tooltiptext {
            visibility: visible;
            opacity: 1;
        }
        .rank-good {
            background-color: #d4edda;
            color: #155724;
        }
        .rank-medium {
            background-color: #fff3cd;
            color: #856404;
        }
        .rank-bad {
            background-color: #f8d7da;
            color: #721c24;
        }
        .rank-none {
            background-color: #e2e3e5;
            color: #383d41;
        }
        .copy-btn {
            background-color: #007bff;
        }
        .copy-btn:hover {
            background-color: #0069d9;
        }
        .redirect-info {
            font-size: 12px;
            color: #666;
            margin-top: 3px;
        }
        .report-settings {
            background-color: #f9f9f9;
            padding: 15px;
            border-radius: 5px;
            margin-bottom: 15px;
        }
        /* Pháo hoa CSS */
        .pyro {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 999;
            pointer-events: none;
            display: none;
        }
        .pyro > .before, .pyro > .after {
            position: absolute;
            width: 5px;
            height: 5px;
            border-radius: 50%;
            box-shadow: 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff;
            animation: 1s bang ease-out infinite backwards, 1s gravity ease-in infinite backwards, 5s position linear infinite backwards;
        }
        .pyro > .after {
            animation-delay: 1.25s, 1.25s, 1.25s;
            animation-duration: 1.25s, 1.25s, 6.25s;
        }
        @keyframes bang {
            to {
                box-shadow: -70px -115.67px #00ff73, -28px -99.67px #a6ff00, 58px -31.67px #0051ff, 13px -7.67px #00ffa2, -19px -33.67px #ff00d0, -37px -23.67px #ff8800, 19px -78.67px #ff002f, 56px -87.67px #00ffcc, -29px -45.67px #ff5e00, 1px -66.67px #ff1500, 42px -123.67px #91ff00, 21px -108.67px #b300ff, -23px -3.67px #ffd000, -65px -55.67px #ff4800, -63px -27.67px #00ff88, 46px 0.33px #0055ff, 75px -86.67px #8cff00, -11px -117.67px #00ff4d, 69px -125.67px #ff0033, 82px -36.67px #00ffbb, -39px -92.67px #00ff73, 49px -124.67px #ff0040, 94px -7.67px #ff6600, 82px 22.33px #ff001a, -14px -98.67px #00ffd5, 27px 7.33px #00ff33, -68px -18.67px #0080ff, 89px -42.67px #ff00fb, -88px -93.67px #ff0004, -62px -59.67px #00ff8c, 52px -21.67px #00ff33, 74px 6.33px #ff00bf, -42px -69.67px #00ff8c, -9px -92.67px #00ff8c, 26px -65.67px #ff0004, 57px -51.67px #a2ff00, 47px -89.67px #0099ff, 74px -123.67px #ff0037, -86px -108.67px #ff4000, 76px -25.67px #0400ff, 77px -57.67px #6aff00, -13px -91.67px #00ff95, 52px -66.67px #91ff00, -42px -103.67px #00ff73, -69px -115.67px #ff0037, 89px -38.67px #ff0088, 90px -113.67px #00ff6a, -63px -42.67px #0066ff, -71px -69.67px #0400ff, 0px -53.67px #002bff, 26px -70.67px #ff006a;
            }
        }
        @keyframes gravity {
            to {
                transform: translateY(200px);
                opacity: 0;
            }
        }
        @keyframes position {
            0%, 19.9% {
                margin-top: 10%;
                margin-left: 40%;
            }
            20%, 39.9% {
                margin-top: 40%;
                margin-left: 30%;
            }
            40%, 59.9% {
                margin-top: 20%;
                margin-left: 70%;
            }
            60%, 79.9% {
                margin-top: 30%;
                margin-left: 20%;
            }
            80%, 99.9% {
                margin-top: 30%;
                margin-left: 80%;
            }
        }
        /* Thông báo chúc mừng */
        .celebration {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: rgba(255, 255, 255, 0.9);
            border: 2px solid #4CAF50;
            border-radius: 10px;
            padding: 20px;
            text-align: center;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
            z-index: 1000;
            display: none;
        }
        .celebration h2 {
            color: #4CAF50;
            margin-top: 0;
        }
        .celebration p {
            font-size: 18px;
            margin-bottom: 20px;
        }
        .celebration button {
            background-color: #4CAF50;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
        }
        .redirect-chain {
            margin-top: 5px;
            font-size: 0.85em;
            color: #666;
        }
        .redirect-chain-item {
            display: block;
            margin-bottom: 3px;
            padding-left: 10px;
            border-left: 2px solid #d35400;
        }
        @media (max-width: 768px) {
            .form-row {
                flex-direction: column;
            }
            .form-row > div {
                width: 100%;
                margin-bottom: 10px;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>Kiểm tra Thứ hạng Google</h1>
        
        <div class="form-row">
            <div style="flex: 1;">
                <label for="api-key">API Key (Serper.dev):</label>
                <input type="text" id="api-key" placeholder="Nhập API key của bạn" value="85dd0b1bd9a79f29cd3a121a23cc404a759dc00a" hidden>
            </div>
        </div>
        
        <div class="form-row">
            <div style="flex: 1;">
                <label for="domains">Danh sách Domain:</label>
                <textarea id="domains" rows="5" placeholder="Mỗi domain một dòng, ví dụ:&#10;example.com&#10;example.org"></textarea>
            </div>
            <div style="flex: 1;">
                <label for="keywords">Danh sách Từ khóa:</label>
                <textarea id="keywords" rows="5" placeholder="Mỗi từ khóa một dòng, ví dụ:&#10;từ khóa 1&#10;từ khóa 2"></textarea>
            </div>
        </div>
        
        <div class="form-row">
            <div>
                <label for="device">Thiết bị:</label>
                <select id="device">
                    <option value="desktop">Desktop</option>
                    <option value="mobile">Mobile</option>
                </select>
            </div>
            <div>
                <label for="location">Vị trí:</label>
                <select id="location">
                    <option value="">Mặc định (Việt Nam)</option>
                    <option value="1006094">Hà Nội</option>
                    <option value="1006113">TP. Hồ Chí Minh</option>
                    <option value="1006151">Đà Nẵng</option>
                </select>
            </div>
        </div>
        
        <div class="report-settings">
            <label for="report-name">Tên báo cáo:</label>
            <input type="text" id="report-name" placeholder="PIC" value="">
        </div>
        
        <div class="form-row">
            <button onclick="checkRanks()">Kiểm tra Thứ hạng</button>
        </div>
        
        <div id="loading" class="loading">
            <p>Đang kiểm tra thứ hạng... Vui lòng đợi.</p>
            <div class="progress-container">
                <div id="progress" class="progress-bar">0%</div>
            </div>
            <p id="progress-text">0/0</p>
        </div>
        
        <div id="error" class="error"></div>
        <div id="success" class="success"></div>
        
        <div id="results-actions" class="results-actions">
            <button class="copy-btn" onclick="copyAllRanks()">Sao chép dán vào daily ranking</button>
            <button class="copy-btn" onclick="copyFormattedReport()">Sao chép báo cáo Viptalk</button>
        </div>
        
        <div id="results"></div>
    </div>
    
    <!-- Hiệu ứng pháo hoa -->
    <div class="pyro">
        <div class="before"></div>
        <div class="after"></div>
    </div>
    
    <!-- Thông báo chúc mừng -->
    <div id="celebration" class="celebration">
        <h2>🎉 Chúc mừng! 🎉</h2>
        <p id="celebration-message"></p>
        <button onclick="closeCelebration()">Đóng</button>
    </div>
    
    <script>
        // Biến toàn cục để lưu kết quả
        let results = [];
        
        // Kích thước batch mặc định
        const DEFAULT_BATCH_SIZE = 5;
        
        // Đường dẫn API redirect server
        const DEFAULT_REDIRECT_SERVER = "https://red.nguonkienthuc.com";
        
        // Cache kết quả tìm kiếm
        const searchCache = {};
        
        // Hàm làm sạch domain
        function cleanDomain(domain) {
            let cleanedDomain = domain;
            
            // Loại bỏ http://, https://, www. và dấu / ở cuối
            cleanedDomain = cleanedDomain.replace(/^https?:\/\//, '');
            cleanedDomain = cleanedDomain.replace(/^www\./, '');
            cleanedDomain = cleanedDomain.replace(/\/$/, '');
            
            return {
                cleanedDomain: cleanedDomain.toLowerCase(),
                originalDomain: domain
            };
        }
        
        // Hàm chia mảng thành các mảng con có kích thước nhỏ hơn
        function chunkArray(array, size) {
            const chunks = [];
            for (let i = 0; i < array.length; i += size) {
                chunks.push(array.slice(i, i + size));
            }
            return chunks;
        }
        
        // Hàm kiểm tra nhiều chuyển hướng cùng lúc (sử dụng API như phiên bản cũ)
        async function checkMultipleRedirects(domains) {
            try {
                // Đảm bảo mỗi domain có protocol
                const urls = domains.map(domain => {
                    if (!domain.startsWith('http://') && !domain.startsWith('https://')) {
                        return 'https://' + domain;
                    }
                    return domain;
                });
                
                // Gọi API kiểm tra nhiều chuyển hướng
                const response = await fetch(`${DEFAULT_REDIRECT_SERVER}/check-redirects`, {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    },
                    body: JSON.stringify({ urls, maxRedirects: 10 })
                });
                
                if (!response.ok) {
                    throw new Error(`Lỗi API: ${response.status}`);
                }
                
                return await response.json();
            } catch (error) {
                console.error('Lỗi kiểm tra nhiều chuyển hướng:', error);
                return {};
            }
        }
        
        // Hàm tìm kiếm Google với cache
        async function searchGoogleBatch(queries) {
            const apiKey = document.getElementById('api-key').value.trim();
            if (!apiKey) {
                throw new Error('API key không được để trống');
            }
            
            const device = document.getElementById('device').value;
            const location = document.getElementById('location').value;
            
            // Gom nhóm các từ khóa giống nhau để tránh tìm kiếm trùng lặp
            const uniqueQueries = [];
            const queryMap = new Map(); // Ánh xạ từ từ khóa đến chỉ mục trong uniqueQueries
            
            queries.forEach(query => {
                const cacheKey = `${query.keyword}_${device}_${location || 'default'}`;
                
                // Nếu từ khóa đã có trong cache, bỏ qua
                if (searchCache[cacheKey]) {
                    return;
                }
                
                // Nếu từ khóa chưa được thêm vào uniqueQueries, thêm vào
                if (!queryMap.has(query.keyword)) {
                    queryMap.set(query.keyword, uniqueQueries.length);
                    uniqueQueries.push({
                        keyword: query.keyword,
                        cacheKey: cacheKey
                    });
                }
            });
            
            // Nếu có từ khóa cần tìm kiếm
            if (uniqueQueries.length > 0) {
                const searchQueries = uniqueQueries.map(query => {
                    const queryParams = {
                        q: query.keyword,
                        device: device,
                        gl: "vn",
                        hl: "vi",
                        num: 100
                    };
                    
                    if (location) {
                        queryParams.location = location;
                    }
                    
                    return queryParams;
                });
                
                const myHeaders = new Headers();
                myHeaders.append("X-API-KEY", apiKey);
                myHeaders.append("Content-Type", "application/json");
                
                const requestOptions = {
                    method: "POST",
                    headers: myHeaders,
                    body: JSON.stringify(searchQueries),
                    redirect: "follow"
                };
                
                try {
                    const response = await fetch("https://google.serper.dev/search", requestOptions);
                    
                    if (!response.ok) {
                        const errorText = await response.text();
                        throw new Error(`Lỗi API: ${response.status} - ${errorText}`);
                    }
                    
                    const data = await response.json();
                    
                    // Lưu kết quả vào cache
                    uniqueQueries.forEach((query, index) => {
                        searchCache[query.cacheKey] = data[index];
                    });
                } catch (error) {
                    console.error("Lỗi khi tìm kiếm:", error);
                    throw error;
                }
            }
            
            // Trả về kết quả từ cache cho tất cả queries
            return queries.map(query => {
                const cacheKey = `${query.keyword}_${device}_${location || 'default'}`;
                return searchCache[cacheKey];
            });
        }
        
        // Hàm hiển thị pháo hoa
        function showFireworks() {
            const pyro = document.querySelector('.pyro');
            pyro.style.display = 'block';
            
            // Ẩn pháo hoa sau 3 giây
            setTimeout(() => {
                pyro.style.display = 'none';
            }, 3000);
        }
        
        // Hàm hiển thị thông báo chúc mừng
        function showCelebration(message) {
            const celebration = document.getElementById('celebration');
            const celebrationMessage = document.getElementById('celebration-message');
            
            celebrationMessage.textContent = message;
            celebration.style.display = 'block';
            
            // Hiển thị pháo hoa
            showFireworks();
        }
        
        // Hàm đóng thông báo chúc mừng
        function closeCelebration() {
            document.getElementById('celebration').style.display = 'none';
        }
        
        // Hàm kiểm tra thứ hạng tối ưu
        async function checkRanks() {
            const domainsText = document.getElementById('domains').value.trim();
            const keywordsText = document.getElementById('keywords').value.trim();
            
            if (!domainsText) {
                showError('Vui lòng nhập danh sách domain');
                return;
            }
            
            if (!keywordsText) {
                showError('Vui lòng nhập danh sách từ khóa');
                return;
            }
            
            // Parse danh sách domain và từ khóa
            const domains = domainsText.split('\n')
                .map(domain => domain.trim())
                .filter(domain => domain.length > 0);
                
            const keywords = keywordsText.split('\n')
                .map(keyword => keyword.trim())
                .filter(keyword => keyword.length > 0);
            
            if (domains.length === 0) {
                showError('Không có domain hợp lệ');
                return;
            }
            
            if (keywords.length === 0) {
                showError('Không có từ khóa hợp lệ');
                return;
            }
            
            // Hiển thị loading
            document.getElementById('loading').style.display = 'block';
            document.getElementById('error').style.display = 'none';
            document.getElementById('success').style.display = 'none';
            document.getElementById('results').innerHTML = '';
            document.getElementById('results-actions').style.display = 'none';
            
            // Reset kết quả
            results = [];
            
            // Kiểm tra chuyển hướng cho tất cả domain một lần
            let redirectResults = {};
            try {
                redirectResults = await checkMultipleRedirects(domains);
            } catch (error) {
                console.error('Lỗi khi kiểm tra chuyển hướng:', error);
            }
            
            // Tạo danh sách các domain đã làm sạch để kiểm tra
            const domainInfo = domains.map(domain => {
                const { cleanedDomain } = cleanDomain(domain);
                let domainToCheck = domain;
                if (!domainToCheck.startsWith('http://') && !domainToCheck.startsWith('https://')) {
                    domainToCheck = 'https://' + domainToCheck;
                }
                
                // Thêm thông tin chuyển hướng
                const redirectInfo = redirectResults[domainToCheck] || {};
                
                return {
                    domain: domain,
                    cleanedDomain: cleanedDomain,
                    redirected: redirectInfo.hasRedirect || false,
                    redirectChain: redirectInfo.redirectChain || null,
                    finalUrl: redirectInfo.finalUrl || null,
                    redirectCount: redirectInfo.redirectCount || 0
                };
            });
            
            // PHƯƠNG PHÁP TỐI ƯU: Tạo danh sách các từ khóa duy nhất để tìm kiếm
            const uniqueKeywords = [...new Set(keywords)];
            
            // Tạo ánh xạ từ từ khóa đến các domain cần kiểm tra
            const keywordToDomains = new Map();
            
            // Nếu số lượng domain và từ khóa bằng nhau, giả định mỗi domain đi với một từ khóa
            if (domains.length === keywords.length) {
                for (let i = 0; i < domains.length; i++) {
                    if (!keywordToDomains.has(keywords[i])) {
                        keywordToDomains.set(keywords[i], []);
                    }
                    keywordToDomains.get(keywords[i]).push(domainInfo[i]);
                }
            } else {
                // Nếu số lượng không bằng nhau, kiểm tra mọi domain với mọi từ khóa
                uniqueKeywords.forEach(keyword => {
                    keywordToDomains.set(keyword, domainInfo);
                });
            }
            
            // Tạo danh sách các query để tìm kiếm
            const queries = uniqueKeywords.map(keyword => ({
                keyword: keyword
            }));
            
            // Thực hiện tìm kiếm theo batch
            const batchSize = DEFAULT_BATCH_SIZE;
            const batches = chunkArray(queries, batchSize);
            
            let completed = 0;
            const totalKeywords = uniqueKeywords.length;
            
            try {
                for (const batch of batches) {
                    // Cập nhật tiến trình
                    document.getElementById('progress-text').textContent = `${completed}/${totalKeywords}`;
                    const percent = Math.round((completed / totalKeywords) * 100);
                    document.getElementById('progress').style.width = `${percent}%`;
                    document.getElementById('progress').textContent = `${percent}%`;
                    
                    // Tìm kiếm batch
                    const searchResults = await searchGoogleBatch(batch);
                    
                    // Xử lý kết quả tìm kiếm
                    for (let i = 0; i < batch.length; i++) {
                        const keyword = batch[i].keyword;
                        const searchResult = searchResults[i];
                        
                        // Lấy danh sách domain cần kiểm tra cho từ khóa này
                        const domainsToCheck = keywordToDomains.get(keyword) || [];
                        
                        // Kiểm tra từng domain trong kết quả tìm kiếm
                        for (const domainData of domainsToCheck) {
                            let rank = null;
                            let matchedUrl = null;
                            
                            // Tạo danh sách các domain cần kiểm tra (bao gồm cả domain chuyển hướng)
                            let domainVariants = [domainData.cleanedDomain];
                            
                            // Thêm domain từ chuỗi chuyển hướng
                            if (domainData.redirectChain && domainData.redirectChain.length > 1) {
                                for (let j = 1; j < domainData.redirectChain.length; j++) {
                                    try {
                                        const redirectUrl = new URL(domainData.redirectChain[j].url);
                                        const redirectDomain = redirectUrl.hostname.replace(/^www\./, '');
                                        domainVariants.push(redirectDomain.toLowerCase());
                                    } catch (e) {
                                        console.error("Lỗi xử lý URL chuyển hướng:", e);
                                    }
                                }
                            }
                            
                            // Tìm kiếm trong kết quả Google
                            if (searchResult && searchResult.organic) {
                                for (let j = 0; j < searchResult.organic.length; j++) {
                                    const result = searchResult.organic[j];
                                    try {
                                        const resultUrl = new URL(result.link);
                                        const resultDomain = resultUrl.hostname.replace(/^www\./, '').toLowerCase();
                                        
                                        // Kiểm tra xem domain kết quả có khớp với domain cần kiểm tra không
                                        if (domainVariants.some(domain => resultDomain.includes(domain))) {
                                            rank = j + 1;
                                            matchedUrl = result.link;
                                            break;
                                        }
                                    } catch (e) {
                                        console.error("Lỗi xử lý URL kết quả:", e);
                                    }
                                }
                            }
                            
                            // Thêm kết quả
                            results.push({
                                domain: domainData.domain,
                                cleanedDomain: domainData.cleanedDomain,
                                keyword: keyword,
                                rank: rank,
                                matchedUrl: matchedUrl,
                                redirected: domainData.redirected,
                                redirectChain: domainData.redirectChain,
                                finalUrl: domainData.finalUrl,
                                redirectCount: domainData.redirectCount,
                                date: new Date().toLocaleDateString('vi-VN'),
                                location: document.getElementById('location').options[document.getElementById('location').selectedIndex].text
                            });
                        }
                    }
                    
                    // Hiển thị kết quả sau mỗi batch
                    displayResults();
                    
                    // Cập nhật số lượng hoàn thành
                    completed += batch.length;
                }
                
                // Cập nhật tiến trình thành 100%
                document.getElementById('progress-text').textContent = `${totalKeywords}/${totalKeywords}`;
                document.getElementById('progress').style.width = '100%';
                document.getElementById('progress').textContent = '100%';
                
                // Đếm số từ khóa trong top 10
                const top10Keywords = results.filter(result => result.rank !== null && result.rank <= 6);
                const top10Count = top10Keywords.length;
                
                // Hiển thị thông báo chúc mừng nếu có từ khóa trong top 10
                if (top10Count > 0) {
                    // Tạo thông báo dựa trên số lượng từ khóa trong top 10
                    const message = `Bạn có ${top10Count} từ khóa nằm trong top 6 Google!`;
                    
                    // Hiển thị thông báo chúc mừng
                    showCelebration(message);
                    
                    // Bắn pháo hoa nhiều lần tương ứng với số từ khóa top 10
                    for (let i = 0; i < top10Count; i++) {
                        setTimeout(() => {
                            showFireworks();
                        }, i * 3000); // Mỗi hiệu ứng pháo hoa cách nhau 3 giây
                    }
                }
                
                showSuccess(`Đã kiểm tra thành công ${results.length} kết quả`);
            } catch (error) {
                showError(`Lỗi: ${error.message}`);
            } finally {
                // Ẩn loading
                document.getElementById('loading').style.display = 'none';
                
                // Hiển thị nút sao chép nếu có kết quả
                if (results.length > 0) {
                    document.getElementById('results-actions').style.display = 'flex';
                }
            }
        }
        
        // Hàm hiển thị kết quả
        function displayResults() {
            const resultsDiv = document.getElementById('results');
            
            // Tạo bảng kết quả
            let tableHtml = `
                <table>
                    <thead>
                        <tr>
                            <th>STT</th>
                            <th>Domain</th>
                            <th>Từ khóa</th>
                            <th>Thứ hạng</th>
                            <th>URL khớp</th>
                            <th>Ngày kiểm tra</th>
                            <th>Vị trí</th>
                        </tr>
                    </thead>
                    <tbody>
            `;
            
            // Thêm các dòng kết quả
            results.forEach((result, index) => {
                // Xác định class cho thứ hạng
                let rankClass = 'rank-none';
                let rankDisplay = 'Không tìm thấy';
                
                if (result.rank !== null) {
                    rankDisplay = result.rank;
                    if (result.rank <= 10) {
                        rankClass = 'rank-good';
                    } else if (result.rank <= 20) {
                        rankClass = 'rank-medium';
                    } else {
                        rankClass = 'rank-bad';
                    }
                }
                
                // Tạo thông tin chuyển hướng
                let redirectInfo = '';
                if (result.redirected) {
                    // Tạo tooltip với thông tin chi tiết về chuỗi chuyển hướng
                    let redirectChainHtml = '';
                    if (result.redirectChain && result.redirectChain.length > 0) {
                        redirectChainHtml = '<div class="redirect-chain">';
                        result.redirectChain.forEach((redirect, idx) => {
                            const statusColor = redirect.status === 301 ? '#e74c3c' : '#3498db';
                            redirectChainHtml += `
                                <span class="redirect-chain-item" style="color: ${statusColor}">
                                    ${idx + 1}. ${redirect.url} (${redirect.status})
                                </span>
                            `;
                        });
                        redirectChainHtml += '</div>';
                    }
                    
                    redirectInfo = `
                        <div class="redirect-info">
                            <span class="tooltip">
                                Đã chuyển hướng (${result.redirectCount})
                                <span class="tooltiptext">
                                    ${redirectChainHtml || 'Không có thông tin chi tiết'}
                                </span>
                            </span>
                        </div>
                    `;
                }
                
                // Thêm dòng vào bảng
                tableHtml += `
                    <tr>
                        <td>${index + 1}</td>
                        <td>
                            ${result.domain}
                            ${redirectInfo}
                        </td>
                        <td>${result.keyword}</td>
                        <td class="${rankClass}">${rankDisplay}</td>
                        <td>${result.matchedUrl ? `<a href="${result.matchedUrl}" target="_blank">${result.matchedUrl}</a>` : 'N/A'}</td>
                        <td>${result.date}</td>
                        <td>${result.location}</td>
                    </tr>
                `;
            });
            
            // Đóng bảng
            tableHtml += `
                    </tbody>
                </table>
            `;
            
            // Hiển thị bảng
            resultsDiv.innerHTML = tableHtml;
        }
        
        // Hàm sao chép tất cả thứ hạng thành một cột
        function copyAllRanks() {
            // Tạo một chuỗi chứa tất cả thứ hạng, mỗi thứ hạng trên một dòng
            const ranksList = results.map(result => result.rank ? result.rank.toString() : 'N/A').join('\n');
            
            // Sao chép vào clipboard
            navigator.clipboard.writeText(ranksList)
                .then(() => {
                    showSuccess('Đã sao chép tất cả thứ hạng thành công!');
                })
                .catch(err => {
                    console.error('Lỗi khi sao chép: ', err);
                    showError('Không thể sao chép. Vui lòng thử lại.');
                });
        }

        // Sao chép báo cáo theo định dạng
        // function copyFormattedReport() {
        //     // Lấy ngày hiện tại
        //     const today = new Date();
        //     const day = today.getDate();
        //     const month = today.getMonth() + 1;
            
        //     // Lấy tên báo cáo từ input
        //     const reportName = document.getElementById('report-name').value.trim();
            
        //     // Lấy thông tin khu vực
        //     const locationElement = document.getElementById('location');
        //     const locationText = locationElement.options[locationElement.selectedIndex].text;
        //     const locationInfo = locationElement.value ? ` - ${locationText}` : '';
            
        //     // Bắt đầu với tiêu đề báo cáo
        //     let report = `Ngày ${day}/${month} - [${reportName}]\n============\n\n`;
            
        //     // Nhóm kết quả theo domain (sau khi đã làm sạch)
        //     const domainGroups = {};
            
        //     results.forEach(result => {
        //         const domain = result.cleanedDomain;
        //         if (!domainGroups[domain]) {
        //             domainGroups[domain] = {
        //                 originalDomain: result.domain,
        //                 cleanedDomain: domain,
        //                 keywords: [],
        //                 ranks: [],
        //                 redirected: result.redirected || false,
        //                 finalUrl: result.finalUrl || null,
        //                 redirectChain: result.redirectChain || null,
        //                 has301: false
        //             };
        //         }
                
        //         // Kiểm tra xem có chuyển hướng 301 không
        //         if (result.redirectChain && result.redirectChain.length > 0) {
        //             for (let i = 0; i < result.redirectChain.length; i++) {
        //                 if (result.redirectChain[i].status === 301) {
        //                     domainGroups[domain].has301 = true;
        //                     break;
        //                 }
        //             }
        //         }
                
        //         domainGroups[domain].keywords.push(result.keyword);
        //         domainGroups[domain].ranks.push(result.rank);
        //     });
            
        //     // Tạo báo cáo cho từng domain
        //     for (const domain in domainGroups) {
        //         const group = domainGroups[domain];
                
        //         // Thêm domain vào báo cáo (màu xanh)
        //         // Nếu có chuyển hướng 301, thêm đánh dấu [301]
        //         const redirectMark = group.has301 ? ' [301]' : '';
        //         report += `${domain}${redirectMark}\n`;
                
        //         // Nếu có chuyển hướng, hiển thị URL cuối cùng
        //         if (group.redirected && group.finalUrl) {
        //             // Lấy hostname từ finalUrl
        //             try {
        //                 const finalUrlObj = new URL(group.finalUrl);
        //                 const finalDomain = finalUrlObj.hostname;
        //                 report += `→ ${finalDomain}\n`;
        //             } catch (e) {
        //                 // Nếu không parse được URL, hiển thị toàn bộ finalUrl
        //                 report += `→ ${group.finalUrl}\n`;
        //             }
        //         }
                
        //         // Thêm từ khóa và thứ hạng
        //         for (let i = 0; i < group.keywords.length; i++) {
        //             const keyword = group.keywords[i];
        //             const rank = group.ranks[i] || 'N/A';
        //             report += `${keyword} - top ${rank}\n`;
        //         }
                
        //         report += '\n';
        //     }
            
        //     // Sao chép vào clipboard
        //     navigator.clipboard.writeText(report)
        //         .then(() => {
        //             showSuccess('Đã sao chép báo cáo định dạng thành công!');
        //         })
        //         .catch(err => {
        //             console.error('Lỗi khi sao chép: ', err);
        //             showError('Không thể sao chép. Vui lòng thử lại.');
        //         });
        // }
        // Sao chép báo cáo theo định dạng
function copyFormattedReport() {
    // Lấy ngày hiện tại
    const today = new Date();
    const day = today.getDate();
    const month = today.getMonth() + 1;
    
    // Lấy tên báo cáo từ input
    const reportName = document.getElementById('report-name').value.trim();
    
    // Lấy thông tin khu vực
    const locationElement = document.getElementById('location');
    const locationText = locationElement.options[locationElement.selectedIndex].text;
    const locationInfo = locationElement.value ? ` - ${locationText}` : '';
    
    // Bắt đầu với tiêu đề báo cáo
    let report = `Ngày ${day}/${month} - [${reportName}]\n============\n\n`;
    
    // Lấy danh sách domain và từ khóa ban đầu để giữ nguyên thứ tự
    const domainsText = document.getElementById('domains').value.trim();
    const keywordsText = document.getElementById('keywords').value.trim();
    
    const originalDomains = domainsText.split('\n')
        .map(domain => domain.trim())
        .filter(domain => domain.length > 0);
        
    const originalKeywords = keywordsText.split('\n')
        .map(keyword => keyword.trim())
        .filter(keyword => keyword.length > 0);
    
    // Tạo Map để lưu trữ thông tin domain đã xử lý
    const processedDomains = new Map();
    
    // Nếu số lượng domain và từ khóa bằng nhau, giả định mỗi domain đi với một từ khóa
    if (originalDomains.length === originalKeywords.length) {
        // Lặp qua danh sách domain theo thứ tự ban đầu
        for (let i = 0; i < originalDomains.length; i++) {
            const domain = originalDomains[i];
            const keyword = originalKeywords[i];
            
            // Tìm kết quả tương ứng
            const result = results.find(r => 
                r.domain === domain && r.keyword === keyword);
            
            if (result) {
                const cleanedDomain = result.cleanedDomain;
                
                // Kiểm tra xem domain đã được xử lý chưa
                if (!processedDomains.has(cleanedDomain)) {
                    processedDomains.set(cleanedDomain, {
                        originalDomain: domain,
                        keywords: [],
                        ranks: [],
                        redirected: result.redirected || false,
                        finalUrl: result.finalUrl || null,
                        redirectChain: result.redirectChain || null,
                        has301: false
                    });
                    
                    // Kiểm tra xem có chuyển hướng 301 không
                    if (result.redirectChain && result.redirectChain.length > 0) {
                        for (let j = 0; j < result.redirectChain.length; j++) {
                            if (result.redirectChain[j].status === 301) {
                                processedDomains.get(cleanedDomain).has301 = true;
                                break;
                            }
                        }
                    }
                }
                
                // Thêm từ khóa và thứ hạng vào domain
                const domainData = processedDomains.get(cleanedDomain);
                domainData.keywords.push(keyword);
                domainData.ranks.push(result.rank);
            }
        }
        
        // Tạo báo cáo theo thứ tự domain ban đầu
        const addedDomains = new Set();
        
        for (let i = 0; i < originalDomains.length; i++) {
            const domain = originalDomains[i];
            const { cleanedDomain } = cleanDomain(domain);
            
            // Nếu domain này đã được thêm vào báo cáo, bỏ qua
            if (addedDomains.has(cleanedDomain)) {
                continue;
            }
            
            // Đánh dấu domain đã được thêm vào báo cáo
            addedDomains.add(cleanedDomain);
            
            // Lấy thông tin domain
            const domainData = processedDomains.get(cleanedDomain);
            
            if (domainData) {
                // Thêm domain vào báo cáo
                const redirectMark = domainData.has301 ? ' [301]' : '';
                report += `${cleanedDomain}${redirectMark}\n`;
                
                // Nếu có chuyển hướng, hiển thị URL cuối cùng
                if (domainData.redirected && domainData.finalUrl) {
                    try {
                        const finalUrlObj = new URL(domainData.finalUrl);
                        const finalDomain = finalUrlObj.hostname;
                        report += `→ ${finalDomain}\n`;
                    } catch (e) {
                        report += `→ ${domainData.finalUrl}\n`;
                    }
                }
                
                // Thêm từ khóa và thứ hạng theo thứ tự
                for (let j = 0; j < domainData.keywords.length; j++) {
                    const keyword = domainData.keywords[j];
                    const rank = domainData.ranks[j] || 'N/A';
                    report += `${keyword} - top ${rank}\n`;
                }
                
                report += '\n';
            }
        }
    } else {
        // Nếu số lượng domain và từ khóa không bằng nhau
        // Nhóm kết quả theo domain (giữ nguyên thứ tự xuất hiện đầu tiên)
        const domainOrder = [];
        const domainGroups = {};
        
        results.forEach(result => {
            const domain = result.cleanedDomain;
            
            if (!domainGroups[domain]) {
                domainOrder.push(domain);
                domainGroups[domain] = {
                    originalDomain: result.domain,
                    cleanedDomain: domain,
                    keywords: [],
                    ranks: [],
                    redirected: result.redirected || false,
                    finalUrl: result.finalUrl || null,
                    redirectChain: result.redirectChain || null,
                    has301: false
                };
            }
            
            // Kiểm tra xem có chuyển hướng 301 không
            if (result.redirectChain && result.redirectChain.length > 0) {
                for (let i = 0; i < result.redirectChain.length; i++) {
                    if (result.redirectChain[i].status === 301) {
                        domainGroups[domain].has301 = true;
                        break;
                    }
                }
            }
            
            domainGroups[domain].keywords.push(result.keyword);
            domainGroups[domain].ranks.push(result.rank);
        });
        
        // Tạo báo cáo theo thứ tự domain đã lưu
        for (const domain of domainOrder) {
            const group = domainGroups[domain];
            
            // Thêm domain vào báo cáo
            const redirectMark = group.has301 ? ' [301]' : '';
            report += `${domain}${redirectMark}\n`;
            
            // Nếu có chuyển hướng, hiển thị URL cuối cùng
            if (group.redirected && group.finalUrl) {
                try {
                    const finalUrlObj = new URL(group.finalUrl);
                    const finalDomain = finalUrlObj.hostname;
                    report += `→ ${finalDomain}\n`;
                } catch (e) {
                    report += `→ ${group.finalUrl}\n`;
                }
            }
            
            // Thêm từ khóa và thứ hạng
            for (let i = 0; i < group.keywords.length; i++) {
                const keyword = group.keywords[i];
                const rank = group.ranks[i] || 'N/A';
                report += `${keyword} - top ${rank}\n`;
            }
            
            report += '\n';
        }
    }
    
    // Sao chép vào clipboard
    navigator.clipboard.writeText(report)
        .then(() => {
            showSuccess('Đã sao chép báo cáo định dạng thành công!');
        })
        .catch(err => {
            console.error('Lỗi khi sao chép: ', err);
            showError('Không thể sao chép. Vui lòng thử lại.');
        });
}

        // Hàm hiển thị lỗi
        function showError(message) {
            const errorDiv = document.getElementById('error');
            errorDiv.textContent = message;
            errorDiv.style.display = 'block';
            document.getElementById('success').style.display = 'none';
        }
        
        // Hàm hiển thị thông báo thành công
        function showSuccess(message) {
            const successDiv = document.getElementById('success');
            successDiv.textContent = message;
            successDiv.style.display = 'block';
            document.getElementById('error').style.display = 'none';
        }
    </script>
</body>
</html>
# Step 0: Navigate to your bench directory
cd frappe-bench

# Step 1: Backup your site
bench --site your-site-name backup

# Step 2: Install system dependencies (once)
sudo apt update
sudo apt install -y pkg-config libmariadb-dev

# Step 3: (Optional) Reset current state to avoid merge issues
bench update --reset

# Step 4: Switch ERPNext and Frappe to 'develop'
bench switch-to-branch develop frappe erpnext --upgrade

# Step 5: Install Python and JS requirements
bench setup requirements

# Step 6: Migrate database and build assets
bench --site your-site-name migrate
bench build

# Step 7: Restart bench (especially in production)
bench restart

# Step 8: (Optional) Disable maintenance mode if active
bench set-maintenance-mode off
@media (max-width: 600px) {
  .mr-home { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .mr-home { grid-template-columns: repeat(1, 1fr); }
}
grid-template-columns: repeat(4, 110px);
grid-template-rows: repeat(4, 100px);
grid-auto-flow: dense;
.mr-home .mr-home__image:nth-child(6)
<If check="{Get local=show_excerpt}" value=true>
  <div class="tt-item__content__info">
    <Field excerpt auto="true" />
      </div>
</If>
<Loop type=attachment include="{Loop control=decoration_image}{Field id /}{/Loop}">
  <img src="{Field url size=large}" alt="{Field alt}" class="wp-image-{Field id}" srcset="{Field srcset size=large}" sizes="{Field sizes size=large}" loading="eager" />
</Loop>
<Loop type=learndash_student id=current >
  <If loop type="sfwd-courses" enrolled="true">
    <List available-courses>
      <Loop type="learndash_course" enrolled="true" completion_status="started">
        <Item><Field id /></Item>
      </Loop>
    </List>
    <List course-list>
      <Loop type=learndash_user_activity activity_event=started activity_status="started" orderby=activity_updated>
        <Set logic=course-exists all="true">
          <If check="{Get list=available-courses}" includes value="{Field course_id}">true<Else />false</If>
          <If field=activity_type value=course>true<Else />false</If>
        </Set>
        <If logic=course-exists><Item><Field course_id /></Item></If>
      </Loop>
    </List>
    <Set latest_course_id>
      <If list=course-list>
        <Loop list=course-list count=1><Field /></Loop>
        <Else />
        <Loop type="learndash_course" enrolled="true" completion_status="open,started" count=1><Field id /></Loop>
      </If>
    </Set>
  </If>
</Loop>
/* Bricks initial CSS */
.gform-footer {
    margin-top: 15px !important;
}
.brxe-text-basic ul,
.brxe-text ul {
    padding-left: 18px;
}
#top .gform-theme--foundation .gform_fields {
    row-gap: 15px;
}
.gform_body input::placeholder {
    color: #666;
}
p.gform_required_legend {
    display: none !important;
}
.gform-footer input[type="submit"] {
    text-transform: uppercase !important;
    font-size: 18px !important;
    letter-spacing: 1px !important;
    background-color: var(--primary) !important;
    padding: 12px 30px !important;
    transition: .5s !important;
}
.gform-footer input[type="submit"]:hover {
    background-color: #000 !important;
}
.faq-item.brx-open .faq-icon {
    transform: rotate(90deg);
    color: #fff
}
The Betfair Clone Script provides end-to-end betting solutions, making it a reliable choice for modern betting businesses.  A Betfair clone script is a systematic way of creating a betting platform that is similar to Betfair.  Business owners regard it as trustworthy for betting actions. Addus Technologies provides scalable, API-integrated solutions that attract business owners and serious investors in today's digital betting industry.
I recently used My Assignment Help Australia and was genuinely impressed with the quality and professionalism. The team delivered well-researched content right on time, which really helped me meet my deadline. Their support system is responsive, and the writers clearly understand Australian academic standards. Highly recommend it to any student needing dependable assignment help!
  
  https://myassignmenthelp.expert/
#!/bin/bash

SOURCE_PAGE_ID=280606
CSV_FILE="cities.csv"

tail -n +2 "$CSV_FILE" | while IFS=',' read -r city state
do
  slug_city=$(echo "$city" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
  post_title="Web App Development Company $city"
  post_slug="web-app-development-company-${slug_city}"

  new_page_id=$(wp post create --from-post=$SOURCE_PAGE_ID --post_type=page --post_status=draft \
    --post_title="$post_title" --post_name="$post_slug" --porcelain)

  echo "✅ Created: $post_title → Page ID $new_page_id"

  # Fetch base _elementor_data in JSON
  base_data=$(wp post meta get $SOURCE_PAGE_ID _elementor_data --format=json)

  # Replace placeholders in JSON safely
  updated_data=$(echo "$base_data" | sed "s/{City}/$city/g" | sed "s/{State}/$state/g")

  # Save to temporary JSON file
  temp_file=$(mktemp /tmp/elementor_data.XXXXXX.json)
  echo "$updated_data" > "$temp_file"

  # Pass JSON via stdin (avoids shell arg limit)
  wp post meta update "$new_page_id" _elementor_data --format=json < "$temp_file"
  rm "$temp_file"

  # Update Elementor mode
  wp post meta update $new_page_id _elementor_edit_mode builder
  wp post meta update $new_page_id _elementor_template_type page

  # Update Yoast SEO
  wp post meta update $new_page_id _yoast_wpseo_title "Web App Development Company $city, $state | MMC Global"
  wp post meta update $new_page_id _yoast_wpseo_metadesc "Leading web app development company in $city, $state that delivers problem-solving and high-performing custom solutions for all businesses."
  wp post meta update $new_page_id _yoast_wpseo_focuskw "Web App Development $city"

  # Open Graph / Twitter
  wp post meta update $new_page_id _yoast_wpseo_opengraph-title "Web App Development Company $city, $state | MMC Global"
  wp post meta update $new_page_id _yoast_wpseo_opengraph-description "Leading web app development company in $city, $state that delivers problem-solving and high-performing custom solutions for all businesses."
  wp post meta update $new_page_id _yoast_wpseo_twitter-title "Web App Development Company $city, $state | MMC Global"
  wp post meta update $new_page_id _yoast_wpseo_twitter-description "Leading web app development company in $city, $state that delivers problem-solving and high-performing custom solutions for all businesses."

done
/*
Theme Name:   ThemeName
Theme URI:    https://www.hartmann-kommunikation.de
Description:  WordPress Theme fuer AuftraggeberName
Author:       Sebastian Hartmann
Author URI:   https://www.hartmann-kommunikation.de
Template:     (parent)themename
Version:      0.1
License:      single commercial
License URI:  https://www.hartmann-kommunikation.de
Tags:         tag
Text Domain:  themename
*/


/*===========================================================
/* Basics
=============================================================*/
/* Semantic Content Template */
<!DOCTYPE html> 
<html itemscope itemtype="https://schema.org/Article" 
lang="" dir=""> 
<head> 
<title itemprop="name"></title> 
<meta itemprop="description" name="description" 
content=""> 
<meta itemprop="author" name="author" content=""> 
</head> 
<body> 
<article> 
<header> 
<h1 itemprop="headline"></h1> 
<time itemprop="datePublished" datetime=""></time> 
<p><a itemprop="author" href=""></a></p> 
</header> 
<div itemprop="about"></div> 
<div itemprop="articleBody"> 
<!-- The main body of the article goes here --> 
</div> 
<footer> 
<time itemprop="dateModified" datetime=""></time> 
<section itemscope 
itemtype="http://schema.org/WebPage"> 
<!-- Section heading--> 
<h2></h2> 
<p><a itemprop="relatedLink" href=""></a></p> 
</section> 
</footer> 
</article> 
</body> 
</html> 
<!-- Schema Artikel -->
<html itemscope itemtype="http://schema.org/Article">
<head>
<meta itemprop="name" content="Just a test article...">
<meta itemprop="description" content="Just testing the way that articles appear in content...">
<meta itemprop="image" content="http://wheresgus.com/schema/article.png">
<meta itemprop="url" content="http://wheresgus.com/schema/article.html">
<meta itemprop="author" content="Gus Class">
<meta itemprop="contentRating" content="MPAA G">
<meta itemprop="copyrightYear" content="2012">
<meta itemprop="dateCreated" content="20120703">
<meta itemprop="datePublished" content="20120703">
</head>

<body>
<p>Note how this content is now ignored because schema markup is specified.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>_title_</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

<body>
  <header>
    _headerContent_
  </header>

  <main>
    _mainContent_
  </main>

  <footer>
    _footerContent_
  </footer>

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script>if (!window.jQuery) { document.write("<script src=\"https://code.jquery.com/jquery-3.2.1.min.js\"><\/script>"); }</script>
  <script src="_scriptFile_"></script>
</body>
</html>
/*sticky text panel v builderu*/

.mce-panel .mce-stack-layout-item.mce-first{
    position: sticky!important;
    top: -60px;
}
.et-fb-modal--expanded .mce-panel .mce-stack-layout-item.mce-first{
    top: -24px!important;
}
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>_title_</title>

  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="author" content="_author_" >
  <meta name="designer" content="_designer_" >
  <meta name="description" content="_description_" >
  <meta name="keywords" content="_keywords_" >

  <meta name="application-name" content="_appName_">
  <meta name="apple-mobile-web-app-title" content="_appName_">
  <meta name="msapplication-config" content="_browserConfigFile_">
  <meta name="theme-color" content="_themeColor_">
  <link rel="apple-touch-icon" href="_appleIconFile_" sizes="180x180">
  <link rel="icon" type="image/png" href="_faviconFile32x32_" sizes="32x32">
  <link rel="icon" type="image/png" href="_faviconFile16x16_" sizes="16x16">
  <link rel="manifest" href="_manifestFile_">
  <link rel="mask-icon" href="_maskIconFile_">
  <link rel="shortcut icon" href="_faviconIcoFile_">

  <link rel="stylesheet" type="text/css" href="_styleFile_" >
</head>

<body>
  <header>
    _headerContent_
  </header>

  <main>
    _mainContent_
  </main>

  <footer>
    _footerContent_
  </footer>

  <script src="_scriptFile_"></script>
  <noscript>
    _noJavaScriptSupportMessage_
  </noscript>
</body>
</html>
<?php
/*
Plugin Name: Functionality Plugin for websitename
Plugin URI: https://www.hartmann-kommunikation.de/
Description: Moves some functions away from functions.php
Author: Sebastian Hartmann
Version: 1.0
Author URI: https://www.hartmann-kommunikation.de/
License: single commercial, © Sebastian Hartmann, 2018
*/

// functions hier einfügen

?>
<?php

/**
 * Storefront automatically loads the core CSS even if using a child theme as it is more efficient
 * than @importing it in the child theme style.css file.
 *
 * Uncomment the line below if you'd like to disable the Storefront Core CSS.
 *
 * If you don't plan to dequeue the Storefront Core CSS you can remove the subsequent line and as well
 * as the sf_child_theme_dequeue_style() function declaration.
 */
//add_action( 'wp_enqueue_scripts', 'sf_child_theme_dequeue_style', 999 );

/**
 * Dequeue the Storefront Parent theme core CSS
 */
function sf_child_theme_dequeue_style() {
    wp_dequeue_style( 'storefront-style' );
    wp_dequeue_style( 'storefront-woocommerce-style' );
}

/**
 * Note: DO NOT! alter or remove the code above this text and only add your custom PHP functions below this text.
 */


https://www.peeayecreative.com/how-to-add-text-or-symbols-before-and-after-the-divi-number-counter/
/*Menu znevididelneni pred scrollem - zviditelneni sticky menu po scrollu*****do sekce s menu vlozit tridu: pa-header-hide-before-scroll......a nastavit menu na sticky*/
/*CSS to set the header hidden until scroll*/
header.et-l.et-l--header {
	height: 0;
}

.pa-header-hide-before-scroll {
	height: 0px;
	transform: translateX(0px) translateY(-300px);
	transition: transform 800ms ease 0ms, height 800ms ease 0ms;
	visibility: hidden;
}

.pa-scroll-header {
	height: auto !important;
	transform: translateX(0px) translateY(0px) !important;
	transition: transform 800ms ease 0ms, height 800ms ease 0ms;
	visibility: visible;
}

.pa-header-hide-before-scroll .et_pb_menu .et_pb_menu__wrap {
	display: none !important;
}

.pa-header-hide-before-scroll.pa-scroll-header .et_pb_menu .et_pb_menu__wrap {
	display: flex !important;
}


//Jquery vlozit do scripts.js
    jQuery(document).ready(function() {
        jQuery(window).scroll(function() {
            var scroll = jQuery(window).scrollTop();
            if (scroll >= 1) {
                jQuery(".pa-header-hide-before-scroll").addClass("pa-scroll-header");
            } else {
                jQuery(".pa-header-hide-before-scroll").removeClass("pa-scroll-header");
            }
        });
    });
/*zvetseni vysky HTML textu v builderu*/
.et-db #et-boc .et-l .et-fb-option--tiny-mce .et-fb-tinymce-html-input {
	height: 400px;
// Zmena vysky css blocku v nastaveni sablony

add_action( 'init', function() {
    add_action('admin_enqueue_scripts', 'pac_divi_code_editor_resize_and_min_height');
});
function pac_divi_code_editor_resize_and_min_height()
{
	$css_admin_side = "";
	
    // For Custom CSS code editor in Divi Theme Options
    $css_admin_side .= "#divi_custom_css + .CodeMirror-wrap { min-height:600px;resize: vertical;}";


    // Register Inline CSS
    wp_register_style('pac-divi-code-editor-resize-and-min-height', false, [], '1.0.0');
    wp_enqueue_style('pac-divi-code-editor-resize-and-min-height');
    wp_add_inline_style('pac-divi-code-editor-resize-and-min-height', $css_admin_side);
}
// povolit infinite scroll v Mediich
add_filter( 'media_library_infinite_scrolling', '__return_true' );
// smazat Divi nástěnku // 
add_action( 'init', function() {
    // Restrict Page to access using direct link
    global $pagenow;
    $page = ! empty( $_GET['page'] ) ? $_GET['page'] : '';
    if (!empty($page) && $page === 'et_onboarding' && !empty($pagenow) && $pagenow === 'admin.php') {
        wp_die( esc_attr( "You don't have permission to access this page"));
    }
    // Enqueue CSS To Hide Divi Dashboard Option & Enqueue JS To Change Tab When Click Divi in Dashboard
    add_action('admin_enqueue_scripts', function() {
        // CSS
        $hideDiviDashboardCSS = "#toplevel_page_et_divi_options ul.wp-submenu li a[href='admin.php?page=et_onboarding'] {display: none!important;}";
        wp_register_style('pac-da-hide-divi-dashboard-option', false, [], '1.0.0');
        wp_enqueue_style('pac-da-hide-divi-dashboard-option');
        wp_add_inline_style('pac-da-hide-divi-dashboard-option', $hideDiviDashboardCSS);
        // JS
        ob_start();
        ?> jQuery(document).ready(function(){jQuery('a.wp-has-submenu[href="admin.php?page=et_onboarding"]').attr("href","admin.php?page=et_divi_options")}); <?php
        $hideDiviDashboardJS = ob_get_contents();
        ob_end_clean();
        wp_register_script('pac-da-change-divi-dashboard-option', '', ['jquery'], '1.0.0', true);
        wp_enqueue_script('pac-da-change-divi-dashboard-option');
        wp_add_inline_script('pac-da-change-divi-dashboard-option', $hideDiviDashboardJS);
    });
});
void ServiceRequest.ServiceRequest_To_CRM(int id)
{
	fetser = Service_Request[ID == input.id];
	mainmap = Map();
	dummymap = Map();
	mainmap.put("Deal_Name","SafeGuard");
	mainmap.put("Deal_Location",fetser.Location);
	mainmap.put("Region",fetser.Category);
	mainmap.put("Account_Name","SafeGuard" + "-" + fetser.Ticket_ID);
	mainmap.put("Lead_Source","Portal");
	mainmap.put("Amount",100000);
	mainmap.put("Starting_Date",fetser.Date_field);

	closingDate = fetser.Date_field.addDay(15);
	mainmap.put("Closing_Date",closingDate);
	mainmap.put("Stage","Qualification");
	mainmap.put("Service_Type","Procurement as a Service");
	mainmap.put("Service_Type1","Hardware reselling");
	mainmap.put("Description",fetser.Details);
	mainmap.put("Requirement_Description",fetser.Product_Name + "-" + fetser.Serial_Number + "-" + fetser.Operating_System1 + "-" + fetser.RAM_Size1 + "-" + fetser.Storage_Size1 + "-" + fetser.Processor1);
	mainmap.put("Type","Existing Client & Existing End Client - Upsell");

	contact_name = fetser.Contact_Person_at_Delivery_Location;
	contact_record = zoho.crm.searchRecords("Contacts","(Full_Name:equals:" + contact_name + ")",0,1,dummymap);
	info contact_name;
	info contact_record.size();
	if(contact_record.size() > 0)
	{		
		contact_id = contact_record.get(0).get("id");
		mainmap.put("Contact_Name",contact_id);
	}
	else
	{
		new_contact_map = Map();
		new_contact_map.put("First_Name", fetser.Contact_Person.first_name);
		new_contact_map.put("Last_Name", fetser.Contact_Person.last_name);
		new_contact_map.put("Full_Name",contact_name);
		new_contact_map.put("Lead_Source","Portal");
		new_contact_map.put("Title","Global Procurement Services");
		new_contact = zoho.crm.createRecord("Contacts",new_contact_map,dummymap,"zohocrm_connection");
		//info new_contact;
		    if (new_contact.contains("id")) 
			{
		            contact_id = new_contact.get("id");
		            mainmap.put("Contact_Name", contact_id);
		        } else 
				{
		            info "Contact creation failed";
		        }
	}

	    response = zoho.crm.createRecord("Deals", mainmap, dummymap, "zohocrm_connection");
	    info response;
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":cute-sun: Boost Days - What's On This Week :cute-sun:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n\n :xeros-connect: Happy Monday Melbourne! Hope you had a fabulous weekend :xeros-connect:"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Xero Café :coffee:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n :new-thing: *This week we are offering from Via Porta Bakehouse:* \n\n :lemon: Almond and Lemon Curd Croissant  \n\n :strawberry: Choc & Strawberry Danish Slice \n\n *Weekly Café Special:* _Iced Matcha Latte_ :matcha:"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": " Wednesday, 14th May :calendar-date-9:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": " \n\n :lunch: *Light Lunch*: Provided by Kartel Catering from *12pm* \n\n"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Thursday, 15th May :calendar-date-10:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":breakfast: *Breakfast*: Provided by *Kartel Catering* from *8:30am - 10:30am* in the Wominjeka Breakout Space. \n\n :eurovision: :wine_glass:*Thursday Social*-  Yummy Mexican Food from Guzman, drinks and Eurovision Bangers."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned for more fun throughout the year. :party-wx:"
			}
		}
	]
}
[05-05-2025 17:50] varshitha: Sure Varshitha! Here's a *10-mark long answer* on *Linear Regression in Data Science* — written with a focus on *Data Science concepts* to help you *score maximum marks in exams*:

---

### *Linear Regression in Data Science*

#### *1. Introduction:*
Linear Regression is one of the most fundamental and widely used algorithms in *Data Science* for predictive modeling. It is a *supervised machine learning technique* used to model the relationship between a *dependent variable* and one or more *independent variables* by fitting a linear equation to observed data.

---

#### *2. Objective in Data Science:*
In Data Science, Linear Regression helps in:
- Predicting continuous outcomes (like sales, temperature, prices)
- Understanding relationships between variables
- Feature selection and data trend analysis

---

#### *3. Types of Linear Regression:*
- *Simple Linear Regression: Predicts output using **one* independent variable  
  Example: Predicting salary based on years of experience
- *Multiple Linear Regression: Predicts output using **two or more* independent variables  
  Example: Predicting house price using size, location, and number of rooms

---

#### *4. Mathematical Representation:*

*Simple Linear Regression:*

\[
Y = mX + c
\]

Where:  
- Y = Predicted Output  
- X = Input Variable  
- m = Slope or coefficient (effect of X on Y)  
- c = Intercept (value of Y when X = 0)

*Multiple Linear Regression:*

\[
Y = b_0 + b_1X_1 + b_2X_2 + ... + b_nX_n
\]

Where \( X_1, X_2, ..., X_n \) are the features and \( b_0, b_1, ..., b_n \) are coefficients.

---

#### *5. Working in Data Science:*
1. *Data Collection*: Gather the dataset
2. *Exploratory Data Analysis (EDA)*: Visualize and analyze relationships using scatter plots, correlation
3. *Model Training: Fit the linear model using algorithms like **Ordinary Least Squares (OLS)* or *Gradient Descent*
4. *Evaluation*: Use metrics like:
   - *R² Score* – Goodness of fit
   - *Mean Squared Error (MSE)*
   - *Mean Absolute Error (MAE)*
5. *Prediction*: Use the trained model to make predictions on new data

---

#### *6. Assumptions in Data Science:*
- *Linearity*: Relationship between input and output is linear
- *Independence*: Observations are independent
- *Homoscedasticity*: Constant variance of errors
- *Normality of errors*: Residuals are normally distributed
- *No multicollinearity*: Independent variables should not be highly correlated

---

#### *7. Advantages:*
- Easy to understand and implement
- Interpretable and explainable (important in Data Science)
- Fast training and prediction
- Good baseline model

---

#### *8. Limitations:*
- Assumes linearity (not suitable for non-linear data)
- Sensitive to outliers
- Poor performance with multicollinearity or high-dimensional data without feature selection

---

#### *9. Applications in Data Science:*
- Predicting house prices
- Estimating sales or revenue
- Risk assessment in finance
- Forecasting trends in time-series data
- Medical data analysis (predicting disease progression)

---

#### *10. Real-world Example:*
A Data Scientist wants to predict student performance (marks) based on study hours.  
If the model learns the relationship as:

\[
\text{Marks} = 30 + 5 \times (\text{Hours})
\]

Then a student who studies 6 hours is predicted to score:  
\[
\text{Marks} = 30 + 5 × 6 = 60
\]

---

### *Conclusion:*
Linear Regression is a powerful yet simple technique in Data Science used for *predictive modeling, especially for **continuous data. It is widely used as a **baseline model* and for *interpreting the effect* of variables in a dataset. A solid understanding of linear regression is essential for any data scientist.

---

Let me know if you want a *diagram or visualization, or if you'd like this as a **PDF/handwritten note format* for easier revision.
[05-05-2025 17:55] varshitha: Great! Here's a *detailed, effective, and easy-to-understand 2-page explanation* of *Visual Mappings* that is suitable for writing in an exam to score *10 marks*:

---

## *Visual Mappings in Data Visualization*

### *1. Introduction*

Visual mapping is the core process in data visualization that connects *data values* to *visual elements. It helps in turning abstract data into a visual form that can be easily understood by the human eye. This includes mapping data to properties like **position, size, shape, color, orientation, and **texture*.

Example: A bar chart uses *height* to represent a value. The taller the bar, the larger the value.

---

### *2. Why Visual Mapping is Important*

- It allows quick understanding of large datasets.
- Helps find trends, patterns, and outliers.
- Makes complex data more accessible and engaging.
- Supports better decision-making by representing data clearly.

---

### *3. Components of Visual Mapping*

There are three key components:

1. *Data Domain*: The actual values in the dataset (e.g., population, temperature).
2. *Visual Range*: The visual attributes used (e.g., red to green, short to tall bars).
3. *Mapping Function*: The rule or method that connects the data to the visual elements.

---

### *4. Types of Visual Mappings*

#### a) *Linear Mapping*
- A direct proportional relationship between data and visuals.
- Commonly used when the data has a uniform range.
- Example: Mapping income to bar height in a chart.

#### b) *Logarithmic Mapping*
- Used when data spans multiple orders of magnitude.
- Helps compress large ranges to fit within a chart.
- Example: Earthquake magnitudes or financial growth rates.

#### c) *Categorical Mapping*
- Used for qualitative or label-based data.
- Different categories are mapped to different colors or shapes.
- Example: Mapping different countries to different colors in a map.

---

### *5. Visual Variables Used in Mapping*

According to Jacques Bertin, there are *7 visual variables*:

1. *Position* – Most accurate for showing data differences.
2. *Size* – Indicates magnitude (e.g., bubble charts).
3. *Shape* – Distinguishes categories.
4. *Color hue* – Represents categories (e.g., red, green).
5. *Color value (brightness)* – Shows quantity or intensity.
6. *Orientation* – Less commonly used; shows direction.
7. *Texture or pattern* – For areas with limited color options.

---

### *6. Choosing the Right Mapping*

Selecting the correct visual mapping depends on:
- Type of data (quantitative or categorical)
- Range and scale of data
- Audience perception and familiarity
- Display space and platform

*Example*: For time series data, position on an X-Y line chart is most effective.

---

### *7. Color Mapping and Perception*

Color is powerful but can be misleading if not used carefully. Keep in mind:
- Use color gradients for continuous data.
- Use distinct hues for categorical data.
- Be cautious of color blindness – avoid red/green combinations.

---

### *8. Perceptual Issues in Visual Mapping*

- The human brain perceives position more accurately than area or color.
- Shapes and sizes should be scaled properly to avoid misinterpretation.
- Avoid using too many variables in one chart (causes clutter and confusion).

---

## *Conclusion*

Visual mapping is essential for converting raw data into meaningful visuals. By understanding the types of mapping and how to apply them correctly, we can create clear, informative, and impactful visualizations. This not only improves data analysis but also supports better communication and storytelling through visuals.

---

Let me know if you want this in PDF or want examples drawn visually!
[05-05-2025 17:55] varshitha: Data encoding is the process of converting data from one form to another, usually for the purpose of transmission, storage, or analysis. Data decoding is the reverse process of converting data back to its original form, usually for the purpose of interpretation or use.

Data encoding and decoding play a crucial role in data science, as they act as a bridge between raw data and actionable insights. They enable us to:

Prepare data for analysis by transforming it into a suitable format that can be processed by algorithms or models.
Engineer features by extracting relevant information from data and creating new variables that can improve the performance or accuracy of analysis.
Compress data by reducing its size or complexity without losing its essential information or quality.
Protect data by encrypting it or masking it to prevent unauthorized access or disclosure.
Encoding Techniques in Data Science
There are many types of encoding techniques that can be used in data science depending on the nature and purpose of the data. Some of the common encoding techniques are detailed below.

One-hot Encoding
One-hot encoding is a technique for handling categorical variables, which are variables that have a finite number of discrete values or categories. For example, gender, color, or country are categorical variables.

One-hot encoding converts each category into a binary vector of 0s and 1s, where only one element is 1 and the rest are 0. The length of the vector is equal to the number of categories. For example, if we have a variable color with three categories — red, green, and blue — we can encode it as follows:

Color	Red	Green	Blue
Red	1	0	0
Green	0	1	0
Blue	0	0	1
One-hot encoding is useful for creating dummy variables that can be used as inputs for machine learning models or algorithms that require numerical data. It also helps to avoid the problem of ordinality, which is when a categorical variable has an implicit order or ranking that may not reflect its actual importance or relevance. For example, if we assign numerical values to the color variable as red = 1, green = 2, and blue = 3, we may imply that blue is more important than green, which is more important than red, which may not be true.

One-hot encoding has some drawbacks as well. It can increase the dimensionality of the data significantly if there are many categories, which can lead to computational inefficiency or overfitting. It also doesn’t capture any relationship or similarity between the categories, which may be useful for some analysis.

Label Encoding
Label encoding is another technique for encoding categorical variables, especially ordinal categorical variables, which are variables that have a natural order or ranking among their categories. For example, size, grade, or rating are ordinal categorical variables.

Label encoding assigns a numerical value to each category based on its order or rank. For example, if we have a variable size with four categories — small, medium, large, and extra large — we can encode it as follows:

Size	Label
Small	1
Medium	2
Large	3
Extra large	4
Label encoding is useful for preserving the order or hierarchy of the categories, which can be important for some analysis or models that rely on ordinality. It also reduces the dimensionality of the data compared to one-hot encoding.

Label encoding has some limitations as well. It can introduce bias or distortion if the numerical values assigned to the categories do not reflect their actual importance or significance. For example, if we assign numerical values to the grade variable as A = 1, B = 2, C = 3, D = 4, and F = 5, we may imply that F is more important than A, which isn’t true. It also doesn’t capture any relationship or similarity between the categories, which may be useful for some analysis.


Binary Encoding
Binary encoding is a technique for encoding categorical variables with a large number of categories, which can pose a challenge for one-hot encoding or label encoding. Binary encoding converts each category into a binary code of 0s and 1s, where the length of the code is equal to the number of bits required to represent the number of categories. For example, if we have a variable country with 10 categories, we can encode it as follows:

Country	Binary Code
USA	0000
China	0001
India	0010
Brazil	0011
Russia	0100
Canada	0101
Germany	0110
France	0111
Japan	1000
Australia	1001
Binary encoding is useful for reducing the dimensionality of the data compared to one-hot encoding, as it requires fewer bits to represent each category. It also captures some relationship or similarity between the categories based on their binary codes, as categories that share more bits are more similar than those that share fewer bits.

Binary encoding has some drawbacks as well. It can still increase the dimensionality of the data significantly if there are many categories, which can lead to computational inefficiency or overfitting. It also doesn’t preserve the order or hierarchy of the categories, which may be important for some analysis or models that rely on ordinality.

Hash Encoding
Hash encoding is a technique for encoding categorical variables with a very high number of categories, which can pose a challenge for binary encoding or other encoding techniques. Hash encoding applies a hash function to each category and maps it to a numerical value within a fixed range. A hash function is a mathematical function that converts any input into a fixed-length output, usually in the form of a number or a string. For example, if we have a variable city with 1000 categories, we can encode it using a hash function that maps each category to a numerical value between 0 and 9, as follows:

City	Hash Value
New York	3
London	7
Paris	2
Tokyo	5
…	…
Hash encoding is useful for reducing the dimensionality of the data significantly compared to other encoding techniques, as it requires only a fixed number of bits to represent each category. It also doesn’t require storing the mapping between the categories and their hash values, which can save memory and storage space.

Hash encoding has some limitations as well. It can introduce collisions, which are when two or more categories are mapped to the same hash value, resulting in loss of information or ambiguity. It also doesn’t capture any relationship or similarity between the categories, which may be useful for some analysis.

Feature Scaling
Feature scaling is a technique for encoding numerical variables, which are variables that have continuous or discrete numerical values. For example, age, height, weight, or income are numerical variables.

Feature scaling transforms numerical variables into a common scale or range, usually between 0 and 1 or -1 and 1. This is important for data encoding and analysis, because numerical variables may have different units, scales, or ranges that can affect their comparison or interpretation. For example, if we have two numerical variables — height in centimeters and weight in kilograms — we can’t compare them directly because they have different units and scales.

Feature scaling helps to normalize or standardize numerical variables so that they can be compared fairly and accurately. It also helps to improve the performance or accuracy of some analysis or models that are sensitive to the scale or range of the input variables.

There are different methods of feature scaling, such as min-max scaling, z-score scaling, log scaling, etc., depending on the distribution and characteristics of the numerical variables.

Decoding Techniques in Data Science
Decoding is the reverse process of encoding, which is to interpret or use data in its original format. Decoding techniques are essential for extracting meaningful information from encoded data and making it suitable for analysis or presentation. Some of the common decoding techniques in data science are described below.

Data Parsing
Data parsing is the process of extracting structured data from unstructured or semi-structured sources, such as text, HTML, XML, and JSON. Data parsing can help transform raw data into a more organized and readable format, enabling easier manipulation and analysis. For example, data parsing can be used to extract relevant information from web pages, such as titles, links, and images.

Data Transformation
Data transformation is the process of converting data from one format to another for analysis or storage purposes. Data transformation can involve changing the data type, structure, format, or value of the data. For example, data transformation can be used to convert numerical data from decimal to binary representation, or to normalize or standardize the data for fair comparison.

datastax_2025_04_01_726x300
Data Decompression
Data decompression is the process of restoring compressed data to its original form. Data compression is a technique for reducing the size of data by removing redundant or irrelevant information, which can save storage space and bandwidth. However, compressed data can’t be directly used or analyzed without decompression. For example, data decompression can be used to restore image or video data from JPEG or MP4 formats to their original pixel values.

Data Decryption
Data decryption is the process of securing sensitive or confidential data by encoding it with a secret key or algorithm, which can only be reversed by authorized parties who have access to the same key or algorithm. Data encryption is a form of data encoding used to protect data from unauthorized access or tampering. For example, data decryption can be used to access encrypted messages, files, or databases.

Data Visualization
Data visualization is the process of presenting decoded data in graphical or interactive forms, such as charts, graphs, maps, and dashboards. Data visualization can help communicate complex or large-scale data in a more intuitive and engaging way, enabling faster and better understanding and decision making. For example, data visualization can be used to show trends, patterns, outliers, or correlations in the data
[05-05-2025 17:55] varshitha: Retinal Variables (10 Marks Answer)

Retinal variables, also known as visual variables, are the basic visual elements used to represent data graphically. They were introduced by Jacques Bertin in his book Semiology of Graphics and are crucial in data visualization for conveying information effectively.

Here are the main retinal variables:

1. Position: Placement of elements on a graph or chart. It is one of the most effective retinal variables for quantitative data as it is easily interpreted.


2. Size: Refers to the length, area, or volume of elements. Size variations can represent quantitative differences (e.g., larger circles for higher values).


3. Shape: Different shapes can distinguish between categories or classes of data. Useful in scatter plots or maps.


4. Color Hue: Used to show categorical differences. Different hues (like red, blue, green) are used for different groups or types.


5. Color Value (Brightness): Represents ordered or quantitative data. Darker or lighter shades can indicate intensity or value levels.


6. Orientation: The angle or direction of a symbol. Less commonly used, but can represent directionality or patterns.


7. Texture: Variations in patterns or fills to differentiate areas or groups. Useful in maps or bar charts with black-and-white printing.


8. Motion (modern addition): In digital or interactive visualizations, animation or motion can indicate change over time or draw attention to a particular point.



Importance:

Retinal variables are essential for encoding data in a way that is visually intuitive and easily interpreted.

Choosing the right retinal variable enhances clarity and prevents misinterpretation.


Example: In a bar chart, position along the axis and length (size) of bars are used to show value, while color hue might differentiate between categories.

Would you like this as a handwritten-style note or infographic too?
[05-05-2025 17:55] varshitha: Sure, Varshitha! Let's break everything down from scratch with *simple explanations and examples* so it’s easy to understand.

---

### *1. What are Data Objects?*

- A *data object* is like a real-world thing that you store in a database.
- Think of it as a *record*.
  
*Example:*
A student is a data object.
It has:
- Name: "Varshitha"
- Age: 21
- City: "Hyderabad"

These are called *attributes* of the student object.

---

### *2. What are Data Attributes?*

- Attributes are the *characteristics* or *properties* of a data object.
- They describe the object.

*Example:*
In the student object:
- "Name", "Age", and "City" are attributes.

---

### *3. Why are Attributes Important?*

- They help in understanding and analyzing the data.
- In machine learning, they are called *features*.

*Example:*
If you want to predict if a student will pass or fail, you might use attributes like:
- Study hours
- Attendance
- Previous marks

These become *predictors*.

---

### *4. Feature Vector / Attribute Vector*

- A *feature vector* is just a *list of attributes* for one data object.

*Example:*
For a student:
[“Varshitha”, 21, “Hyderabad”, 85% attendance, 7.3 CGPA]

---

## *Types of Attributes*

Attributes are divided into *two categories*:

### *A. Qualitative (or Categorical)*  
These describe *qualities* or *labels* (not numbers).

#### 1. *Nominal Attributes*  
- Just names or labels. No order.

*Example:*  
Color = Red, Blue, Green  
City = Hyderabad, Delhi, Mumbai

#### 2. *Binary Attributes*  
- Only two possible values (yes/no, true/false).

*Example:*  
- Is student passed? → Yes or No  
- Is person alive? → Alive or Dead

*Types of Binary:*
- *Symmetric:* Both values are equal in importance  
  Example: Gender → Male or Female  
- *Asymmetric:* One value is more important  
  Example: Result → Pass (more important) or Fail

#### 3. *Ordinal Attributes*  
- Ordered categories. Ranking is important, but we don’t know exact difference.

*Example:*  
- Grades → A, B, C, D  
- Satisfaction level → Low, Medium, High

---

### *B. Quantitative (or Numeric)*  
These describe *numbers* and *amounts*.

#### 1. *Numeric Attributes*  
Two types:

*a. Interval-scaled:*  
- Difference is meaningful, but there is no true zero.

*Example:*  
- Temperature (in Celsius)  
  20°C is 10°C more than 10°C,  
  but we can't say it's "twice as hot".

*b. Ratio-scaled:*  
- Has a true zero. You can do all math (add, subtract, divide, multiply).

*Example:*  
- Age: 20 years is twice as old as 10 years  
- Weight: 60kg is 2 times 30kg

#### 2. *Discrete Attributes*  
- Countable values. Can’t take fractions.

*Example:*  
- Number of children: 1, 2, 3  
- Number of cars: 0, 1, 2

#### 3. *Continuous Attributes*  
- Can take *any value* in a range, including decimals.

*Example:*  
- Height: 5.4 feet, 5.75 feet  
- Weight: 62.3 kg

---

### *Summary Table:*

| Attribute Type  | Description                        | Example                          |
|------------------|------------------------------------|----------------------------------|
| Nominal          | Categories with no order           | Red, Blue, Hyderabad             |
| Binary (Sym/Asym)| Two values                         | Yes/No, Pass/Fail                |
| Ordinal          | Ordered categories                 | Low, Medium, High                |
| Interval-scaled  | Numbers, no true zero              | Temperature in °C                |
| Ratio-scaled     | Numbers with true zero             | Age, Weight                      |
| Discrete         | Countable numbers                  | No. of children                  |
| Continuous       | Any value (with decimals)          | Height, Weight                   |

---

Let me know if you want this as a *PDF, chart, or **quiz* to test your understanding!
[05-05-2025 17:55] varshitha: Sure Roshini! Let’s go step-by-step and clearly understand *Visual Encoding* — a key part of data visualization. This will help you in both *theory and practical* understanding for your studies or projects.

---

## 🎨 What is Visual Encoding?

*Visual Encoding* is the process of *translating data values into visual elements* like *position, size, color, shape, and orientation* so that we can *see and understand data* through a visual representation.

It is the *bridge between raw data and the viewer’s perception*.

---

## 📊 Why is Visual Encoding Important?

- It turns *abstract data into concrete visuals*
- Helps people *quickly identify trends, outliers, and patterns*
- Makes data *more memorable and accessible*
- Essential for designing *effective charts and dashboards*

---

## 🔑 Types of Visual Encodings (with Examples)

| Encoding Type     | Description | Example Use |
|-------------------|-------------|-------------|
| *Position*       | Placement of items on axes | Line graphs, bar charts |
| *Length*         | Visual length shows quantity | Bar chart bar height |
| *Size/Area*      | Bigger size = larger value | Bubble charts, treemaps |
| *Color (Hue)*    | Different colors for categories | Pie charts, bar colors |
| *Color (Intensity/Gradient)* | Shades showing value strength | Heatmaps |
| *Shape*          | Different shapes for different categories | Scatter plots, legends |
| *Orientation*    | Direction (e.g., line slant) | Arrow diagrams |
| *Texture/Pattern*| Repeating fills or lines | Maps with multiple zones |
| *Motion* (in interactive visualizations) | Animation to show changes | Time-based animated charts |

---

## 🧠 How to Choose the Right Encoding?

Choose encodings based on:
- *Type of data* (quantitative, ordinal, nominal)
- *Purpose of visualization* (comparison, distribution, trend, relationship)
- *Simplicity & readability* (don’t use too many encodings at once)

### Best Practices:

| Data Type       | Good Encodings |
|-----------------|----------------|
| Quantitative    | Position, length, size, color intensity |
| Ordinal         | Position, color gradient, size |
| Nominal         | Color hue, shape, texture |

---

## 🖼 Real-Life Examples

### 1. *Bar Chart*
- Data: Sales by product
- Encodings:
  - Product → *Position on X-axis*
  - Sales → *Bar height (length)*
  - Category → *Color*

### 2. *Bubble Chart*
- Data: Countries' GDP, Population
- Encodings:
  - Country → *X and Y Position*
  - GDP → *Bubble size*
  - Continent → *Color hue*

### 3. *Heatmap*
- Data: Sales over time
- Encodings:
  - Time (X), Product (Y) → *Position*
  - Sales value → *Color intensity*

---

## 🚫 Common Visual Encoding Mistakes

- Using *size or area for categorical data*
- Choosing colors that are *hard to distinguish*
- Overloading a chart with *too many encodings*
- Ignoring *colorblind accessibility*

---

## ✅ Summary

- *Visual encoding* is about mapping data to *visual features*.
- It is the *core mechanism* behind all charts and graphs.
- Choose encodings based on the *type of data* and the *goal* of your visualization.

---

Would you like a diagram/chart to summarize this visually too?
[05-05-2025 17:55] varshitha: Here's a brief yet scoring-focused explanation of *Technologies for Data Visualization in Data Science* with key points:

---

### *1. Matplotlib (Python)*
- Basic 2D plotting library.
- Good for line charts, bar graphs, scatter plots.
- Highly customizable.

### *2. Seaborn (Python)*
- Built on top of Matplotlib.
- Ideal for statistical visualizations.
- Supports heatmaps, violin plots, and regression plots.

### *3. Plotly (Python, R, JS)*
- Interactive graphs and dashboards.
- Used in web-based analytics.
- Supports 3D plots and animations.

### *4. Tableau*
- Powerful business intelligence tool.
- Drag-and-drop interface for dashboards.
- Connects to various data sources.

### *5. Power BI*
- Microsoft’s data visualization tool.
- Real-time dashboards, reports.
- Integrates with Excel and Azure.

### *6. ggplot2 (R)*
- Based on Grammar of Graphics.
- Used for complex and elegant plots.
- Great for statistical data.

### *7. D3.js (JavaScript)*
- Web-based, highly interactive visuals.
- Requires coding knowledge.
- Used in websites and custom dashboards.

### *8. Excel*
- Basic yet widely used.
- Easy to create charts and pivot tables.
- Suitable for small datasets.

-
[05-05-2025 17:55] varshitha: QlikView
A major player in the data visualization market, Qlikview provides solutions to over 40,000 clients in 100 countries. Qlikview's data visualization tool, besides enabling accelerated, customized visualizations, also incorporates a range of solid features, including analytics, enterprise reporting, and Business Intelligence capabilities. 

The Pros of QlikView:
User-friendly interface 
Appealing, colorful visualizations
Trouble-free maintenance
A cost-effective solution
The Cons of QlikView:
RAM limitations
Poor customer support
Does not include the 'drag and drop' feature
[05-05-2025 17:55] varshitha: Recent trends in data collection and analysis include a significant increase in the use of AI and machine learning, augmented analytics, and data democratization, all driven by the need for more efficient and insightful data processing and analysis. Techniques like Natural Language Processing (NLP) and predictive analytics are also gaining popularity. 
Data Collection:
AI and Machine Learning: AI and ML algorithms are being used to automate data collection and processing from various sources, including social media, web traffic, and customer feedback. 
Internet of Things (IoT): IoT devices are used to collect real-time data in smart cities, enabling new avenues for research and analysis. 
Digital Feedback and Mobile Surveys: These methods offer efficiency and rapid data gathering. 
Social Media Listening: Provides real-time, qualitative insights from consumer conversations. 
Traditional Surveys: Remain relevant for capturing quantitative insights. 
Data Analysis:
Augmented Analytics: Uses AI and ML to automate data analysis processes, enabling users to gain insights more efficiently. 
Natural Language Processing (NLP): Allows machines to understand human language more accurately, enabling analysis of text data. 
Predictive Analytics: Focuses on using data to predict future trends and outcomes. 
Data Visualization: Effective data visualization is crucial for communicating insights.
Exploratory Data Analysis (EDA): Helps identify patterns and trends in data sets. 
Data Democratization: Making data analysis tools and techniques more accessible to a wider range of users. 
Machine Learning: Enables more sophisticated models for analyzing data. 
Cloud Computing: Cloud-based platforms enable the processing and analysis of large datasets.
[05-05-2025 17:55] varshitha: Sure! Here's a simpler version:

Nowadays, data collection and analysis are changing a lot. People are using *Artificial Intelligence (AI)* and *Machine Learning (ML)* more often to understand data quickly and accurately. *Augmented analytics* means using smart tools to help people find insights from data more easily. *Data democratization* means making data available to more people in a company, not just experts, so everyone can make better decisions.

Also, techniques like *Natural Language Processing (NLP)* help computers understand human language, and *predictive analytics* helps guess what might happen in the future using past data. All these trends help businesses work faster and smarter.
[05-05-2025 17:55] varshitha: Visualization Techniques in Data Science
Definition:
Visualization techniques in data science refer to the methods used to represent data graphically through charts, graphs, maps, and other visuals. These techniques help in identifying patterns, trends, and insights that may not be obvious from raw data
Importance of Visualization Techniques:
Convert complex data into easy-to-understand visuals

Help in detecting trends and patterns quickly

Aid in data-driven decision making

Make data interactive and engaging

Support communication of insights clearly to others
Common Visualization Techniques:
1. Comparison Technique
Used to compare values between categories or groups.

Charts used: Bar chart, Column chart, Grouped bar chart

Example: Comparing monthly sales of multiple products

Purpose: To show which category is higher/lower
2.Trend Analysis Technique:

Used to visualize data changes over time.

Charts used: Line chart, Area chart

Example: Temperature changes across 12 months

Purpose: To observe increase or decrease over time

3.Distribution Analysis Technique:

Used to display the distribution or spread of data.

Charts used: Histogram, Box plot, Violin plot

Example: Distribution of student exam scores

Purpose: To see how values are spread and detect outliers

4.Relationship Analysis Technique:

Used to explore the relationship between two or more variables.

Charts used: Scatter plot, Bubble chart

Example: Relationship between hours studied and marks obtained

Purpose: To identify correlations or trends
5.Composition Technique (Part-to-Whole):

Used to show how parts contribute to a total.

Charts used: Pie chart, Donut chart, Stacked bar chart, Tree map

Example: Market share of different companies

Purpose: To show percentage contribution
6.Geospatial Visualization Technique:

Used when data has a geographic or location-based element.

Charts used: Geo map, Heat map, Choropleth map

Example: COVID-19 cases by country or state

Purpose: To display data based on location
7.Multivariate Visualization Technique:

Used to analyze more than two variables at once.

Charts used: Bubble chart, 3D scatter plot, Parallel coordinates plot

Example: Visualizing age, income, and spending in one graph

Purpose: To understand complex relationships
8.Time Series Visualization Technique:

Used to display sequential data over time.

Charts used: Line chart, Candlestick chart, Time plot

Example: Stock market data over a year

Purpose: To track patterns, trends, or cycles
9.Ranking and Sorting Visualization:

Used to show items in order of performance or size.

Charts used: Sorted bar chart, Pareto chart

Example: Top 5 scoring students

Purpose: To highlight top performers or priorities
10.Interactive Visualization (Advanced Technique):

Used in dashboards or web applications to allow users to explore data.

Tools used: Tableau, Power BI, Plotly, D3.js

Features: Filter, zoom, hover, drill-down

Example: Sales dashboard with clickable filters

Purpose: To give users control over what data they want to see
[05-05-2025 17:55] varshitha: Sure Varshitha! Here's a *simple, clear, and score-fetching long answer* for *Application Development Methods used in Data Science. You can **memorize this directly* for your exam:

---

### *Application Development Methods in Data Science*

Application development in Data Science involves creating software or tools that help in analyzing and visualizing data to gain insights. Different methods or approaches are used depending on the goal of the project. The main methods are:

---

### *1. Agile Methodology*
- It is an iterative and incremental method.
- Work is divided into small units called *sprints*.
- Each sprint focuses on developing a part of the application.
- *Advantage:* Continuous feedback and improvement.

---

### *2. Waterfall Model*
- A linear and step-by-step approach.
- Phases: *Requirement → Design → Development → Testing → Deployment*.
- One phase is completed before moving to the next.
- *Advantage:* Simple and easy to manage for small projects.

---

### *3. DevOps*
- Combines *Development + Operations*.
- Focuses on automation, integration, and continuous delivery.
- Uses tools like Jenkins, Docker, Git.
- *Advantage:* Faster development and deployment.

---

### *4. CRISP-DM (Cross Industry Standard Process for Data Mining)*
- A special method for Data Science.
- Phases:
  1. *Business Understanding*
  2. *Data Understanding*
  3. *Data Preparation*
  4. *Modeling*
  5. *Evaluation*
  6. *Deployment*
- *Advantage:* Structured approach for data science projects.

---

### *5. Prototyping Model*
- A sample or prototype is built first.
- Based on feedback, final system is developed.
- Useful when requirements are not clear at the beginning.

---

### *Conclusion:*
Different methods are used in data science depending on the project size, goal, and complexity. *Agile and CRISP-DM are most commonly used in real-world data science projects.*

---

Let me know if you want this in bullet points or short answer too! Good luck on your exam—you got this!
[05-05-2025 18:36] varshitha: Certainly! Let's delve into each question with detailed explanations.

---

### *SET 1*

1. *Explain the data science process steps in detail (CO1).*

   *Answer:*

   The data science process is a structured approach to extracting insights and knowledge from data. It involves several key steps, each critical to ensuring accurate and actionable results. Here's a detailed breakdown:

   - *Problem Definition:*

     Begin by clearly understanding and defining the specific problem or question you aim to address. This involves collaborating with stakeholders to identify objectives, constraints, and the desired outcomes. A well-defined problem sets the direction for the entire project. cite🚢turn0search4🚶

   - *Data Collection:*

     Once the problem is defined, identify the data sources required to address it. Data can be collected from various sources, including databases, APIs, web scraping, or surveys. It's essential to ensure that the data gathered is relevant, accurate, and sufficient for analysis. cite🚢turn0search2🚶

   - *Data Cleaning and Preparation:*

     Raw data often contains inconsistencies, missing values, or errors. In this step, clean the data by handling missing values, correcting errors, and removing duplicates. Additionally, transform the data into a suitable format for analysis, which may involve normalization, encoding categorical variables, or creating new features. cite🚢turn0search0🚶

   - *Data Exploration and Analysis:*

     Explore the prepared data to understand its underlying patterns, distributions, and relationships. This involves using statistical methods and visualization tools to generate insights and inform the selection of modeling techniques. Exploratory Data Analysis (EDA) helps in identifying trends, anomalies, or correlations within the data. cite🚢turn0search2🚶

   - *Model Building:*

     Based on the insights from EDA, select appropriate algorithms and build predictive or descriptive models. This step involves training machine learning models on the data, tuning parameters, and validating their performance. The choice of model depends on the problem type (e.g., regression, classification) and the data characteristics. cite🚢turn0search8🚶

   - *Model Evaluation:*

     Assess the performance of the developed models using relevant metrics such as accuracy, precision, recall, or F1-score. It's crucial to validate the model on unseen data to ensure it generalizes well and doesn't overfit. This step may involve cross-validation techniques and performance benchmarking. cite🚢turn0search2🚶

   - *Deployment and Monitoring:*

     Once a model is validated, deploy it into a production environment where it can provide real-time predictions or insights. Post-deployment, continuously monitor the model's performance to ensure it remains accurate and relevant. Over time, models may require retraining with new data to maintain their effectiveness. cite🚢turn0search8🚶

   By following these steps, data scientists can systematically approach problems and derive meaningful insights that drive informed decision-making.

---

2. *What are the different sources of data and data collection steps (CO2)?*

   *Answer:*

   Data collection is a fundamental aspect of research and analysis, providing the foundation for deriving insights and making informed decisions. Understanding the various sources of data and the steps involved in collecting it ensures the reliability and validity of the information gathered.

   *Sources of Data:*

   - *Primary Data:*

     This is data collected firsthand by the researcher specifically for the study at hand. It is original and tailored to the research objectives.

     *Examples:*

     - *Surveys:* Questionnaires distributed to a target audience to gather opinions, behaviors, or characteristics.

     - *Interviews:* Direct, one-on-one interactions to obtain in-depth information on a subject.

     - *Experiments:* Controlled studies where variables are manipulated to observe outcomes.

     - *Observations:* Recording behaviors or events as they occur in their natural settings.

     Primary data is advantageous because it is specific to the researcher's needs and is current. However, it can be time-consuming and costly to collect. cite🚢turn0search3🚶

   - *Secondary Data:*

     This refers to data that has already been collected and published by others. It is not original but can be repurposed for new research.

     *Examples:*

     - *Census Data:* Demographic information collected by governmental agencies.

     - *Academic Journals:* Published research studies and findings.

     - *Industry Reports:* Analyses and statistics provided by trade organizations.

     - *Online Databases:* Digital repositories containing various datasets.

     Secondary data is typically more accessible and less expensive to obtain. However, it may not be perfectly aligned with the current research objectives and could be outdated. cite🚢turn0search3🚶

   *Data Collection Steps:*

   1. *Define the Research Objective:*

      Clearly articulate what you aim to achieve with your data collection. This involves formulating research questions or hypotheses that guide the entire process.

   2. *Determine the Data Type and Source:*

      Decide whether primary or secondary data is more appropriate for your study. Consider the nature of the information needed and the resources available.

   3. *Select the Data Collection Method:*

      Choose the most suitable method(s) for gathering data, such as surveys, interviews, observations, or utilizing existing datasets.

   4. *Develop Data Collection Instruments:*

      Create the tools
[05-05-2025 18:36] varshitha: Apologies for any confusion in my previous responses. Let's simplify each question from your assignment for a 10-mark answer.

---

### *SET 1*

1. *Explain the data science process steps in detail (CO1).*

   *Answer:*

   Data science involves several key steps to analyze data and extract insights:

   - *Understand the Problem:* Clearly define what you want to solve or learn.

   - *Collect Data:* Gather information from various sources relevant to your problem.

   - *Clean Data:* Fix errors and handle missing values to ensure accuracy.

   - *Analyze Data:* Explore the data to find patterns or trends.

   - *Build Model:* Create a mathematical model to make predictions or decisions.

   - *Evaluate Model:* Test the model to see how well it performs.

   - *Communicate Results:* Share findings in a clear manner, often using visuals.

   - *Deploy Model:* Implement the model in real-world applications.

   Following these steps helps in systematically solving problems using data.

---

2. *What are the different sources of data and data collection steps (CO2)?*

   *Answer:*

   Data can come from various sources:

   - *Primary Data:* Information you collect firsthand through surveys, interviews, or experiments.

   - *Secondary Data:* Existing information gathered by others, like reports, articles, or online databases.

   Steps to collect data:

   - *Define Objectives:* Determine what information you need.

   - *Choose Method:* Decide how to gather the data (e.g., survey, observation).

   - *Collect Data:* Gather the information systematically.

   - *Store Data:* Organize and save the data securely for analysis.

   These steps ensure that the data collected is relevant and reliable.

---

3. *What are the different types of sampling techniques? Explain.*

   *Answer:*

   Sampling involves selecting a part of a population to represent the whole. Common sampling techniques include:

   - *Random Sampling:* Every individual has an equal chance of being selected.

   - *Stratified Sampling:* The population is divided into groups (strata), and samples are taken from each group.

   - *Systematic Sampling:* Select every 'n-th' individual from a list.

   - *Cluster Sampling:* Divide the population into clusters, then randomly select entire clusters.

   - *Convenience Sampling:* Choose individuals who are easiest to reach.

   Each method has its advantages and is chosen based on the research goals.

---

### *SET 2*

1. *Explain the data science toolkit in detail (CO1).*

   *Answer:*

   A data science toolkit consists of software and programming languages used to analyze data:

   - *Programming Languages:* Python and R are popular for data analysis due to their extensive libraries.

   - *Data Visualization Tools:* Tools like Tableau or Matplotlib (in Python) help create charts and graphs.

   - *Statistical Software:* SPSS or SAS are used for advanced statistical analysis.

   - *Database Management:* SQL is used to manage and query large datasets.

   - *Big Data Tools:* Hadoop and Spark handle large-scale data processing.

   - *Machine Learning Libraries:* TensorFlow and scikit-learn assist in building predictive models.

   These tools help data scientists efficiently process and analyze data.

---

2. *What is an API, and explain different types of APIs used in data science (CO2).*

   *Answer:*

   An API (Application Programming Interface) allows different software applications to communicate with each other. In data science, APIs are used to access data or services. Types include:

   - *Web APIs:* Access data over the internet, like retrieving information from a website.

   - *Database APIs:* Interact with databases to fetch or update data.

   - *Operating System APIs:* Access system resources like files or hardware.

   - *Library APIs:* Use functions from software libraries in your programs.

   APIs make it easier to integrate and use different data sources and services in projects.

---

3. *Explain different central tendencies: Mean, Median, Mode, Quartiles with suitable examples.*

   *Answer:*

   Central tendency measures help summarize a set of data by identifying the center point.

   - *Mean:* The average of all numbers.

     Example: For data [2, 3, 5], Mean = (2+3+5)/3 = 3.33

   - *Median:* The middle value when data is ordered.

     Example: For data [2, 3, 5], Median = 3

   - *Mode:* The number that appears most frequently.

     Example: For data [2, 2, 3, 5], Mode = 2

   - *Quartiles:* Values that divide data into four equal parts.

     Example: For data [1, 2, 3, 4, 5, 6, 7, 8], Quartiles are 2.5 (Q1), 4.5 (Q2/Median), and 6.5 (
[05-05-2025 18:36] varshitha: In simple terms, *Operating System (OS) APIs* are tools that help software interact with the operating system. These APIs provide access to features like managing files, running processes, or interacting with hardware.

Examples:  
- *WinAPI* (for Windows applications)  
- *Cocoa* (for macOS applications)  

These APIs make it easier for developers to build apps that can access system-level functionalities without writing complex code from scratch.
[05-05-2025 18:36] varshitha: Examples of *Database APIs* are:  
1. *JDBC (Java Database Connectivity)* – For connecting Java applications to databases.  
2. *ODBC (Open Database Connectivity)* – A standard API for accessing database management systems (DBMS).  
3. *MySQL Connector* – For connecting to MySQL databases.  
4. *Django Database API* – Used in Python’s Django framework to interact with databases.  
5. *Drupal Database API* – For interacting with databases in Drupal-based applications.  

These APIs help in sending queries, fetching data, and managing databases programmatically.
[05-05-2025 18:36] varshitha: Here are some *simple examples of hardware system APIs*:  

1. *Camera API*: Helps apps control the phone's camera to take pictures or record videos.  
   Example: When you use WhatsApp to take a photo, it uses the Camera API.  

2. *Sensor API*: Allows apps to read data from hardware sensors like a step counter or accelerometer.  
   Example: Fitness apps use this to count your steps or measure movement.  

3. *Bluetooth API*: Helps connect your phone to other devices like headphones or smartwatches.  
   Example: Music apps use the Bluetooth API to stream audio to wireless speakers.  

These APIs make it easy for apps to use hardware features without needing to control the hardware directly.
[05-05-2025 18:36] varshitha: A *Data Science Toolkit* is a collection of tools, software, and programming languages that help data scientists collect, process, analyze, and visualize data. Here’s a simple explanation of what it includes:

1. *Programming Languages*  
   - *Python*: Most popular for data analysis and machine learning.  
   - *R*: Used for statistical computing and visualization.  

2. *Data Analysis Tools*  
   - *Pandas*: For data manipulation and analysis in Python.  
   - *NumPy*: For numerical computations.  

3. *Data Visualization Tools*  
   - *Matplotlib* and *Seaborn*: For creating graphs and plots in Python.  
   - *Tableau*: A powerful tool for interactive visualizations and dashboards.  

4. *Machine Learning Libraries*  
   - *Scikit-learn*: For building machine learning models.  
   - *TensorFlow* and *PyTorch*: For deep learning and AI applications.  

5. *Big Data Tools*  
   - *Hadoop* and *Spark*: For processing large datasets.  

6. *Databases*  
   - *MySQL* and *MongoDB*: For storing and retrieving data.  

These tools together help data scientists turn raw data into meaningful insights and predictions.
[05-05-2025 18:36] varshitha: In data science, data comes in various types, and there are a wide range of devices and systems for storing and managing it. Here's a breakdown of the types of data and the different storage and management devices:

### Types of Data:
1. *Structured Data*: 
   - Data that is highly organized and fits neatly into tables with rows and columns (e.g., relational databases).
   - Examples: SQL databases (MySQL, PostgreSQL), spreadsheets.

2. *Unstructured Data*: 
   - Data that does not have a predefined structure or format.
   - Examples: Text documents, emails, social media posts, images, audio, and video files.

3. *Semi-structured Data*: 
   - Data that doesn't conform to a strict schema but still has some organizational properties (e.g., JSON, XML).
   - Examples: Log files, JSON files, XML files.

4. *Time-series Data*: 
   - Data that is indexed or ordered by time.
   - Examples: Stock market data, weather data, sensor readings.

5. *Spatial Data*: 
   - Data related to geographical locations and their attributes.
   - Examples: Geospatial data, GPS coordinates.

6. *Metadata*: 
   - Data that provides information about other data.
   - Examples: Data about files (size, format), image metadata (EXIF data).

---

### Data Storage and Management Devices:

1. *Traditional Storage Devices*:
   - *Hard Disk Drives (HDDs)*: 
     - Magnetic storage, relatively slower but cost-effective for large volumes of data.
     - Suitable for archiving large datasets.
   - *Solid-State Drives (SSDs)*: 
     - Faster than HDDs as they use flash memory.
     - Used for high-performance data storage and faster data retrieval.

2. *Cloud Storage*:
   - *Public Cloud* (e.g., AWS S3, Google Cloud Storage, Microsoft Azure Blob Storage): 
     - Scalable, flexible, and accessible from anywhere.
     - Commonly used for big data storage, backup, and cloud-based analytics.
   - *Private Cloud*:
     - Customized for organizational use, where sensitive data is kept in-house.
   - *Hybrid Cloud*: 
     - Combines both public and private cloud for flexibility.

3. *Distributed Storage*:
   - *Hadoop Distributed File System (HDFS)*: 
     - Used in big data ecosystems to store data across multiple nodes.
     - Often used with Hadoop for processing large datasets in parallel.
   - *Apache Cassandra*: 
     - A NoSQL database used for managing large volumes of data across distributed systems.
   - *Amazon Redshift*:
     - A managed data warehouse service for handling large-scale data storage.

4. *Relational Databases*:
   - *MySQL*: 
     - A popular open-source relational database management system (RDBMS).
   - *PostgreSQL*: 
     - An advanced open-source RDBMS with extensive support for data types.
   - *Microsoft SQL Server*: 
     - A relational database with strong integration with Microsoft tools.

5. *NoSQL Databases*:
   - *MongoDB*: 
     - A document-based NoSQL database used for storing semi-structured data.
   - *Cassandra*: 
     - A highly scalable NoSQL database designed for large amounts of distributed data.
   - *CouchDB*: 
     - A database for storing JSON documents and is useful for handling semi-structured data.

6. *Data Lakes*:
   - *Azure Data Lake Storage*: 
     - A scalable storage service built to handle large amounts of unstructured data.
   - *Amazon S3* (often used as a data lake): 
     - Stores large amounts of data, including structured, semi-structured, and unstructured data.
   - *Hadoop-based Data Lakes*: 
     - Use HDFS to store vast amounts of raw data for analysis.

7. *Data Warehouses*:
   - *Amazon Redshift*: 
     - A fully managed data warehouse service suitable for large-scale data analysis.
   - *Google BigQuery*: 
     - A serverless data warehouse solution for querying massive datasets quickly.
   - *Snowflake*: 
     - A cloud data warehouse optimized for scalability and performance.

8. *In-memory Storage*:
   - *Redis*: 
     - A fast, in-memory NoSQL data store used for caching and real-time analytics.
   - *Apache Ignite*: 
     - A distributed, in-memory computing platform designed to store data in memory for ultra-fast processing.

9. *Backup and Archiving*:
   - *Tape Storage*: 
     - Traditional storage used for long-term backups, with a focus on cost efficiency.
   - *Cloud Backups*: 
     - Services like AWS Glacier or Google Cloud Storage Nearline, which provide low-cost, long-term data storage.

---

### Data Management Tools:

1. *Data Integration and ETL Tools*:
   - *Apache NiFi*: 
     - For automating data flow between systems and processing.
   - *Talend*: 
     - A popular ETL tool used for integrating and transforming data.
   - *Apache Kafka*: 
     - A distributed streaming platform used for building real-time data pipelines.

2. *Data Governance and Quality*:
   - *Collibra*: 
     - Provides data governance tools to manage the quality and integrity of data.
   - *Alation*: 
     - A data catalog tool that helps organizations manage their data assets.

3. *Data Analytics Platforms*:
   - *Apache Spark*: 
     - A unified analytics engine for big data processing, including batch and real-time processing.
   - *Tableau*: 
     - A data visualization tool for analyzing and sharing insights from large datasets.

4. *Data Versioning*:
   - *DVC (Data Version Control)*: 
     - A version control system for machine learning projects and datasets, similar to Git.
   - *LakeFS*: 
     - A tool that brings Git-like capabilities to data lakes for managing data versions.

---

Data science requires a deep understanding of both the types of data being processed and the appropriate storage solutions to handle the complexity, volume, and speed of data. The tools and technologies continue to evolve, especially with the growing importance of cloud computing and distributed systems.
[05-05-2025 18:36] varshitha: Here's a simple explanation of what the slide is talking about:  

### *Exploring and Fixing Data (Data Wrangling and Exploration)*  
- *Data Wrangling* (or *Data Cleaning*) is like cleaning messy data to make it neat and useful.  
  - For example, if you have a list of student marks with errors or missing values, data wrangling is the process of correcting those errors and organizing the data.  
- It helps convert raw data into a clean format that is easy to analyze.  

### *Data Exploration*  
- This is the process of looking at the cleaned data to find patterns and useful information.  
  - For example, if you have sales data, data exploration will help you find which product sells the most.  
- Tools like *charts (bar charts, scatter plots)* and *scripts (small programs)* are used to help with exploration.  

### *Key Concepts:*  
- *Manual Exploration:* Writing small programs (scripts) or using spreadsheets to explore data.  
- *Automated Tools:* Tools that make it easier for data scientists to handle large data sets quickly.  
- *Data Wrangling Steps:* Clean, organize, and format data for analysis and decision-making.  

Let me know if you want this further simplified or explained with an example!
[05-05-2025 18:36] varshitha: ### *Categories of Data Exploration*  

1. *Archival:*  
   - Converts physical data (like books, newspapers, and invoices) into digital formats (e.g., databases).  
   - Useful for creating backups and preserving historical data.  

2. *Transfer the Data Format:*  
   - Focuses on transferring data from one format or system to another.  
   - Example: Moving data from an old website to a newly developed website by extracting and converting it.  

3. *Data Analysis:*  
   - The most common goal of data exploration.  
   - Extracted data is analyzed to generate insights for decision-making.  
   - *Example:* E-commerce businesses extract product details from competitor websites to monitor and adapt their strategies.  

Let me know if you want this in a more detailed explanation or with examples!
[05-05-2025 18:36] varshitha: Skewness
Skewness shows if a distribution is tilted or stretched more on one side.
Positive Skew:

The tail is longer on the right side.
Example: Income distribution – most people earn less (clustered on the left), but a few people earn a lot (tail stretches to the right).
[05-05-2025 18:36] varshitha: Negative Skew:

The tail is longer on the left side.
Example: Age of retirement – most people retire at older ages (clustered on the right), but a few retire very early (tail stretches to the left).
[05-05-2025 18:36] varshitha: Normal Distribution
A normal distribution looks like a bell-shaped curve. It's symmetric, meaning the left and right sides are mirror images.
Most of the data points are clustered around the center (mean), and as you move away from the center, there are fewer and fewer data points.
Example: Think about the heights of adults in a population. Most people will have an average height (clustered around the mean), while very tall or very short people are fewer (tails of the bell curve)
[05-05-2025 18:36] varshitha: Let me explain these concepts in simpler terms with examples:

---

### *Normal Distribution*
- A *normal distribution* looks like a bell-shaped curve. It's symmetric, meaning the left and right sides are mirror images.
- Most of the data points are clustered around the center (mean), and as you move away from the center, there are fewer and fewer data points.

*Example*: Think about the heights of adults in a population. Most people will have an average height (clustered around the mean), while very tall or very short people are fewer (tails of the bell curve).

---

### *Skewness*
- *Skewness* shows if a distribution is tilted or stretched more on one side.

1. *Positive Skew*:
   - The tail is longer on the right side.
   - Example: Income distribution – most people earn less (clustered on the left), but a few people earn a lot (tail stretches to the right).

2. *Negative Skew*:
   - The tail is longer on the left side.
   - Example: Age of retirement – most people retire at older ages (clustered on the right), but a few retire very early (tail stretches to the left).

---

### *Kurtosis*
- *Kurtosis* measures how "sharp" or "flat" the tails of a distribution are compared to a normal bell curve.

1. *High Kurtosis*:
   - Tails are thicker, meaning there are more extreme values (outliers).
   - Example: In an exam, most students score very low or very high, but few score in between.

2. *Low Kurtosis*:
   - Tails are thinner, meaning fewer extreme values.
   - Example: In a quiz where most students score close to the average with no extreme scores.

---

Let me know if you'd like more examples or further clarification!
[05-05-2025 18:36] varshitha: In data science, data comes in various types, and there are a wide range of devices and systems for storing and managing it. Here's a breakdown of the types of data and the different storage and management devices:

### Types of Data:
1. *Structured Data*: 
   - Data that is highly organized and fits neatly into tables with rows and columns (e.g., relational databases).
   - Examples: SQL databases (MySQL, PostgreSQL), spreadsheets.

2. *Unstructured Data*: 
   - Data that does not have a predefined structure or format.
   - Examples: Text documents, emails, social media posts, images, audio, and video files.

3. *Semi-structured Data*: 
   - Data that doesn't conform to a strict schema but still has some organizational properties (e.g., JSON, XML).
   - Examples: Log files, JSON files, XML files.

4. *Time-series Data*: 
   - Data that is indexed or ordered by time.
   - Examples: Stock market data, weather data, sensor readings.

5. *Spatial Data*: 
   - Data related to geographical locations and their attributes.
   - Examples: Geospatial data, GPS coordinates.

6. *Metadata*: 
   - Data that provides information about other data.
   - Examples: Data about files (size, format), image metadata (EXIF data).

---

### Data Storage and Management Devices:

1. *Traditional Storage Devices*:
   - *Hard Disk Drives (HDDs)*: 
     - Magnetic storage, relatively slower but cost-effective for large volumes of data.
     - Suitable for archiving large datasets.
   - *Solid-State Drives (SSDs)*: 
     - Faster than HDDs as they use flash memory.
     - Used for high-performance data storage and faster data retrieval.

2. *Cloud Storage*:
   - *Public Cloud* (e.g., AWS S3, Google Cloud Storage, Microsoft Azure Blob Storage): 
     - Scalable, flexible, and accessible from anywhere.
     - Commonly used for big data storage, backup, and cloud-based analytics.
   - *Private Cloud*:
     - Customized for organizational use, where sensitive data is kept in-house.
   - *Hybrid Cloud*: 
     - Combines both public and private cloud for flexibility.

3. *Distributed Storage*:
   - *Hadoop Distributed File System (HDFS)*: 
     - Used in big data ecosystems to store data across multiple nodes.
     - Often used with Hadoop for processing large datasets in parallel.
   - *Apache Cassandra*: 
     - A NoSQL database used for managing large volumes of data across distributed systems.
   - *Amazon Redshift*:
     - A managed data warehouse service for handling large-scale data storage.

4. *Relational Databases*:
   - *MySQL*: 
     - A popular open-source relational database management system (RDBMS).
   - *PostgreSQL*: 
     - An advanced open-source RDBMS with extensive support for data types.
   - *Microsoft SQL Server*: 
     - A relational database with strong integration with Microsoft tools.

5. *NoSQL Databases*:
   - *MongoDB*: 
     - A document-based NoSQL database used for storing semi-structured data.
   - *Cassandra*: 
     - A highly scalable NoSQL database designed for large amounts of distributed data.
   - *CouchDB*: 
     - A database for storing JSON documents and is useful for handling semi-structured data.

6. *Data Lakes*:
   - *Azure Data Lake Storage*: 
     - A scalable storage service built to handle large amounts of unstructured data.
   - *Amazon S3* (often used as a data lake): 
     - Stores large amounts of data, including structured, semi-structured, and unstructured data.
   - *Hadoop-based Data Lakes*: 
     - Use HDFS to store vast amounts of raw data for analysis.

7. *Data Warehouses*:
   - *Amazon Redshift*: 
     - A fully managed data warehouse service suitable for large-scale data analysis.
   - *Google BigQuery*: 
     - A serverless data warehouse solution for querying massive datasets quickly.
   - *Snowflake*: 
     - A cloud data warehouse optimized for scalability and performance.

8. *In-memory Storage*:
   - *Redis*: 
     - A fast, in-memory NoSQL data store used for caching and real-time analytics.
   - *Apache Ignite*: 
     - A distributed, in-memory computing platform designed to store data in memory for ultra-fast processing.

9. *Backup and Archiving*:
   - *Tape Storage*: 
     - Traditional storage used for long-term backups, with a focus on cost efficiency.
   - *Cloud Backups*: 
     - Services like AWS Glacier or Google Cloud Storage Nearline, which provide low-cost, long-term data storage.

---

### Data Management Tools:

1. *Data Integration and ETL Tools*:
   - *Apache NiFi*: 
     - For automating data flow between systems and processing.
   - *Talend*: 
     - A popular ETL tool used for integrating and transforming data.
   - *Apache Kafka*: 
     - A distributed streaming platform used for building real-time data pipelines.

2. *Data Governance and Quality*:
   - *Collibra*: 
     - Provides data governance tools to manage the quality and integrity of data.
   - *Alation*: 
     - A data catalog tool that helps organizations manage their data assets.

3. *Data Analytics Platforms*:
   - *Apache Spark*: 
     - A unified analytics engine for big data processing, including batch and real-time processing.
   - *Tableau*: 
     - A data visualization tool for analyzing and sharing insights from large datasets.

4. *Data Versioning*:
   - *DVC (Data Version Control)*: 
     - A version control system for machine learning projects and datasets, similar to Git.
   - *LakeFS*: 
     - A tool that brings Git-like capabilities to data lakes for managing data versions.

---

Data science requires a deep understanding of both the types of data being processed and the appropriate storage solutions to handle the complexity, volume, and speed of data. The tools and technologies continue to evolve, especially with the growing importance of cloud computing and distributed systems.
[05-05-2025 18:36] varshitha: Here’s a simple explanation for the topics in your notes:

---

### *1. Online Systems & Payment Portals:*
- These are systems we use daily, like online shopping websites and payment apps.  
- They collect *huge amounts of data* from areas such as *e-commerce, medicine, and finance*.  

*Examples:*  
- Amazon collects data on what you buy.  
- Hospitals store patient information.  
- Banks manage transaction details.

---

### *2. Types of Data:*

1. *Relational Data*:  
   - Organized in tables (like Excel sheets).  
   - Example: Bank transactions, customer details.  

2. *Text Data (Web)*:  
   - Information from websites like news articles and blogs.  

3. *Semi-Structured Data (XML)*:  
   - Data with a flexible format, using custom tags (like in an XML file).  
   - Example: Data from mobile apps or web services.  

4. *Graph Data*:  
   - Used for representing relationships between things, like social media connections.  

5. *Social Network Data & Semantic Web*:  
   - *Social network data*: Data from social platforms (like Facebook or Twitter).  
   - *Semantic web*: Data linked in a way that machines can understand.  
   - Example: Detecting fake news using such data.  

6. *Streaming Data*:  
   - Continuous data flow like live audio or video.  
   - Example: Medical devices sending real-time health data.

---

### *3. Big Data*  
Big Data means *huge amounts of complex data* that is difficult to manage and process using regular methods.

#### Big Data Characteristics (3Vs):  
1. *Volume*: Large size (measured in kilobytes, megabytes, gigabytes, or even terabytes).  
   Example: YouTube generates massive video data every second.  

2. *Velocity*: Speed at which data is generated and processed.  
   Example: Social media updates or online stock prices.  

3. *Variety*: Different forms of data – text, images, videos, web data, etc.  
   Example: A single smartphone generates text messages, videos, and GPS data.  

---

Let me know if you want me to simplify this further or add examples!
[05-05-2025 18:36] varshitha: Data Science is all about using data to find patterns, get insights, and make decisions. It combines math, statistics, and computer skills to solve real-world problems.
[05-05-2025 18:36] varshitha: In data science, multiple data sources refer to the integration and utilization of data from different origins or platforms to solve a problem or create insights. These sources can be varied in nature, providing complementary information that, when combined, allows for more robust analysis, decision-making, and predictions. Here are some common types of multiple data sources in data science:
Structured Data:

Databases: Data stored in relational databases (like SQL databases) or non-relational (NoSQL) databases.
Data Warehouses: Large storage systems where structured data is consolidated for analysis and reporti
ng.
Unstructured Data:

Text: Data from sources like emails, blogs, social media posts, or customer reviews (often analyzed using techniques like Natural Language Processing).
Images and Videos: Visual data from sources like social media platforms, security cameras, or medical imaging.
Web Data:

APIs: Data accessed through web services that allow real-time data retrieval from platforms like social media (Twitter, Facebook) or financial markets.
Web Scraping: Extracting information from websites that don't provide an official API, such as news articles or product details.
IoT (Internet of Things) Data:

Sensors and Devices: Data from connected devices, such as smart thermostats, fitness trackers, or industrial machines, that provide real-time data streams.
Transactional Data:

Point of Sale (POS) Systems: Data from transactions made in retail environments, such as customer purchases or payments.
E-commerce: Data from online shopping platforms regarding user behavior, purchases, and browsing patterns.
Geospatial Data:

GPS and Mapping: Data from location-tracking systems, maps, and satellite data (e.g., for route optimization or geographic information systems).
Public Data:

Government and Open Data: Data from public sources such as census data, environmental reports, or economic indicators.
Social Media Data:

Data gathered from platforms like Twitter, Instagram, or LinkedIn for sentiment analysis, trend analysis, and user behavior studies.
Historical Data:

Archived Data: Old datasets that might have predictive value, such as historical sales data or past weather conditions.
[05-05-2025 18:36] varshitha: Multiple data sources in data science refer to using data from different origins or platforms (like databases, social media, IoT devices, or websites) to gather more comprehensive insights. By combining these diverse datasets, data scientists can improve analysis, make better decisions, and create more accurate predictions.
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":cute-sun: Boost Days - What's On This Week :cute-sun:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n\n :xeros-connect: Happy Monday Melbourne! Hope you had a fabulous weekend :xeros-connect:"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Xero Café :coffee:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n :new-thing: *This week we are offering:* \n\n :lemon: Almond and Lemon Curd Croissant  \n\n :strawberry: Choc & Strawberry Danish Slice \n\n *Weekly Café Special:* _Iced Matcha Latte_ :matcha:"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": " Wednesday, 14th May :calendar-date-9:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": " \n\n :lunch: *Light Lunch*: Provided by Kartel Catering from *12pm* \n\n"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Thursday, 15th May :calendar-date-10:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":breakfast: *Breakfast*: Provided by *Kartel Catering* from *8:30am - 10:30am* in the Wominjeka Breakout Space."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":xero-hackathon: Hackathon 2025 :xero-hackathon: ",
				"emoji": true
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned for more fun throughout the year. :party-wx:"
			}
		}
	]
}
Discover what's shaping next-gen trading platforms AI automation, DeFi integration, and regulatory tech. Stay ahead with lightning-fast matching engines and zero-trust security models.
Ideal for startups, developers, and investors ready to innovate. Don’t miss the insights that define tomorrow's exchanges read now!
Hi there! Are you planning to start your own crypto exchange? You can actually get a custom-built, secure, and fully functional platform — and even check out a free demo before moving forward. Whether you want a centralized exchange, decentralized, or even OTC trading features, everything can be customized to fit your needs.
If that sounds interesting, you should definitely check out Beleaftechnologies. They specialize in crypto exchange development and provide full support from start to finish. It’s a great way to get started without the usual hassle. Let me know if you want more details!


Visit now >>https://cryptocurrency-exchange-development-company.com/

Whatsapp :  +91 8056786622

Email id :  business@beleaftechnologies.com

Telegram : https://telegram.me/BeleafSoftTech 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

public class Character : MonoBehaviour
{
    public int CurHp;
    public int MaxHp;

    public bool IsPlayer;

    public List<CombatAction> CombatActions = new List<CombatAction>();

    [SerializeField] private Character opponent;

    private Vector3 startPos;

    public event UnityAction OnHealthChange;
    public static event UnityAction<Character> OnDie;

    void Start ()
    {
        startPos = transform.position;
    }

    public void TakeDamage (int damageToTake)
    {
        CurHp -= damageToTake;

        OnHealthChange?.Invoke();

        if(CurHp <= 0)
            Die();
    }

    void Die ()
    {
        OnDie?.Invoke(this);
        Destroy(gameObject);
    }

    public void Heal (int healAmount)
    {
        CurHp += healAmount;

        OnHealthChange?.Invoke();

        if(CurHp > MaxHp)
            CurHp = MaxHp;
    }

    
    
}
star

Sun May 11 2025 19:27:26 GMT+0000 (Coordinated Universal Time)

@BilalRaza12

star

Fri May 09 2025 09:44:35 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/exodus-wallet-clone-script/

@CharleenStewar #exodus wallet clone script #exodus wallet clone #exodus wallet

star

Fri May 09 2025 06:36:58 GMT+0000 (Coordinated Universal Time)

@IfedayoAwe

star

Thu May 08 2025 17:51:35 GMT+0000 (Coordinated Universal Time) https://www.thiscodeworks.com/extension/initializing?newuser

@mmdyan

star

Thu May 08 2025 14:18:13 GMT+0000 (Coordinated Universal Time) https://www.appclonex.com/trustwallet-clone-script

@riyageorge0895 #trustwalletclone

star

Thu May 08 2025 13:44:11 GMT+0000 (Coordinated Universal Time) https://www.roblox.com/my/account

@Gay

star

Thu May 08 2025 11:33:46 GMT+0000 (Coordinated Universal Time)

@vishalsingh21

star

Thu May 08 2025 07:41:26 GMT+0000 (Coordinated Universal Time) https://www.uniccm.com/blog/the-importance-of-hydrostatic-pressure-in-construction

@dwightjasper

star

Thu May 08 2025 00:47:26 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Wed May 07 2025 16:53:12 GMT+0000 (Coordinated Universal Time)

@thanhsonnguyen #html #javascript

star

Wed May 07 2025 16:16:06 GMT+0000 (Coordinated Universal Time)

@Taimoor

star

Wed May 07 2025 12:27:09 GMT+0000 (Coordinated Universal Time)

@Sphynx

star

Wed May 07 2025 12:26:00 GMT+0000 (Coordinated Universal Time)

@Sphynx

star

Wed May 07 2025 12:24:50 GMT+0000 (Coordinated Universal Time)

@Sphynx

star

Wed May 07 2025 12:24:00 GMT+0000 (Coordinated Universal Time)

@Sphynx

star

Wed May 07 2025 12:22:44 GMT+0000 (Coordinated Universal Time)

@Sphynx

star

Wed May 07 2025 12:17:41 GMT+0000 (Coordinated Universal Time)

@Sphynx

star

Wed May 07 2025 09:27:30 GMT+0000 (Coordinated Universal Time)

@omnixima #css

star

Wed May 07 2025 09:26:25 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/white-label-digital-asset-exchange/

@CharleenStewar #whitelabeldigitalassetexchange

star

Wed May 07 2025 08:39:44 GMT+0000 (Coordinated Universal Time) https://www.addustechnologies.com/blog/betfair-clone-script

@Seraphina

star

Wed May 07 2025 07:17:25 GMT+0000 (Coordinated Universal Time) https://dpbosse.net/pannel/FASTMUMBAI/161

@dpbossenet

star

Wed May 07 2025 04:55:53 GMT+0000 (Coordinated Universal Time) https://myassignmenthelp.expert/

@sgold7593

star

Tue May 06 2025 17:28:38 GMT+0000 (Coordinated Universal Time) https://winscript.cc/

@Curable1600 #windows

star

Tue May 06 2025 13:09:15 GMT+0000 (Coordinated Universal Time) https://appticz.com/taxi-booking-clone-script

@davidscott

star

Tue May 06 2025 11:39:19 GMT+0000 (Coordinated Universal Time)

@BilalRaza12

star

Tue May 06 2025 09:53:07 GMT+0000 (Coordinated Universal Time)

@Sebhart #wordpress #css

star

Tue May 06 2025 09:52:05 GMT+0000 (Coordinated Universal Time)

@Sebhart #markup #html

star

Tue May 06 2025 09:51:09 GMT+0000 (Coordinated Universal Time)

@Sebhart #markup #html

star

Tue May 06 2025 09:48:40 GMT+0000 (Coordinated Universal Time)

@Sebhart #markup #html

star

Tue May 06 2025 09:47:52 GMT+0000 (Coordinated Universal Time)

@hedviga

star

Tue May 06 2025 09:47:51 GMT+0000 (Coordinated Universal Time)

@Sebhart #markup #html

star

Tue May 06 2025 09:46:44 GMT+0000 (Coordinated Universal Time)

@Sebhart #php #wordpress #functions #plugin

star

Tue May 06 2025 09:45:18 GMT+0000 (Coordinated Universal Time)

@Sebhart #php #wordpress #functions #storefront #woocommerce #theme

star

Tue May 06 2025 09:43:54 GMT+0000 (Coordinated Universal Time)

@hedviga

star

Tue May 06 2025 09:40:27 GMT+0000 (Coordinated Universal Time)

@hedviga

star

Tue May 06 2025 09:36:17 GMT+0000 (Coordinated Universal Time)

@hedviga

star

Tue May 06 2025 09:33:06 GMT+0000 (Coordinated Universal Time)

@hedviga

star

Tue May 06 2025 09:30:02 GMT+0000 (Coordinated Universal Time)

@hedviga

star

Tue May 06 2025 09:28:27 GMT+0000 (Coordinated Universal Time)

@hedviga

star

Tue May 06 2025 08:11:27 GMT+0000 (Coordinated Universal Time)

@Pooja

star

Tue May 06 2025 05:31:03 GMT+0000 (Coordinated Universal Time) http://domyonlineexam.us.com/

@hayat123 #education #onlineclasses

star

Tue May 06 2025 05:11:23 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Tue May 06 2025 04:59:46 GMT+0000 (Coordinated Universal Time)

@sem

star

Tue May 06 2025 04:55:01 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Tue May 06 2025 03:37:54 GMT+0000 (Coordinated Universal Time) https://pichomohre.com/

@bank118

star

Mon May 05 2025 10:09:06 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/cryptocurrency-exchange-architecture/

@CharleenStewar #cryptoexchange architecture

star

Mon May 05 2025 09:47:04 GMT+0000 (Coordinated Universal Time) https://www.troniextechnologies.com/blog/how-to-start-crypto-exchange-business

@jackveeranan #cryptoexchangedevelopment

star

Mon May 05 2025 09:42:00 GMT+0000 (Coordinated Universal Time) https://cryptocurrency-exchange-development-company.com/

@raydensmith #crypto #exchange #cryptoexchangedevelopment

star

Mon May 05 2025 09:05:02 GMT+0000 (Coordinated Universal Time)

@iliavial #c#

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension