<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nisarg Pipaliya. on Medium]]></title>
        <description><![CDATA[Stories by Nisarg Pipaliya. on Medium]]></description>
        <link>https://medium.com/@nisargpipaliya2402?source=rss-691c6fdf8260------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ngVgOy4z_ugiB6RCYgIUFw.gif</url>
            <title>Stories by Nisarg Pipaliya. on Medium</title>
            <link>https://medium.com/@nisargpipaliya2402?source=rss-691c6fdf8260------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 01:34:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nisargpipaliya2402/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ClickHouse Explained Simply: Why It’s Different and When to Use It]]></title>
            <link>https://medium.com/@nisargpipaliya2402/clickhouse-explained-simply-why-its-different-and-when-to-use-it-9b298406485d?source=rss-691c6fdf8260------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b298406485d</guid>
            <category><![CDATA[table-engine]]></category>
            <category><![CDATA[olap]]></category>
            <category><![CDATA[analytical-databases]]></category>
            <category><![CDATA[clickhouse]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Nisarg Pipaliya.]]></dc:creator>
            <pubDate>Sat, 11 Oct 2025 10:16:49 GMT</pubDate>
            <atom:updated>2025-10-11T10:16:49.746Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q_KGH2107PbJ5i_YVMsBlw.png" /><figcaption>Logo: Clickhouse.com</figcaption></figure><blockquote><em>“Speed is addictive. Once you experience queries that run in milliseconds, it’s hard to go back.”</em></blockquote><blockquote>This is the world ClickHouse lives in, where analytics run faster, storage is smarter, and scaling feels effortless.</blockquote><p>In this article, we’ll explore:</p><ul><li>What ClickHouse actually is and why it’s special</li><li>How it differs from traditional SQL databases</li><li>How ClickHouse stores data and creates tables</li><li>What “table engines” mean and how to choose the right one</li><li>Who’s using ClickHouse in production and why you might, too</li></ul><h3>What is ClickHouse, really?</h3><p>ClickHouse (short for <em>Clickstream Data Warehouse</em>) is an <strong>open-source columnar database</strong> built for <strong>blazing-fast analytical queries</strong>. Originally developed by <strong>Yandex</strong> to process massive clickstream data, it has since grown into one of the most loved engines for real-time analytics, time-series workloads, and log processing.</p><p>Unlike traditional row-based databases (like MySQL or PostgreSQL), ClickHouse stores data <strong>by column</strong>, not by row. This means that when you run queries that aggregate or filter large datasets such as finding the average session duration or counting users per region, ClickHouse only needs to read the relevant columns, not entire rows. That’s where its speed magic begins.</p><h3>Why is ClickHouse different from other databases?</h3><p>Most traditional databases are optimized for <strong>transactional workloads</strong> (OLTP). They’re great at handling inserts, updates, and deletes across small sets of data. ClickHouse, however, is optimized for <strong>analytical workloads (OLAP) </strong>large, read-heavy queries over millions or billions of records.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2FbL1uC%2F1%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2FbL1uC%2F1%2F&amp;image=https%3A%2F%2Fdatawrapper.dwcdn.net%2FbL1uC%2Fplain-s.png%3Fv%3D1&amp;type=text%2Fhtml&amp;schema=dwcdn" width="600" height="187" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b7d960fea30060d6fb3f2bd4ea2d651/href">https://medium.com/media/7b7d960fea30060d6fb3f2bd4ea2d651/href</a></iframe><p>A simple way to think about it:</p><blockquote><em>If PostgreSQL is a </em>notebook<em> where you write every detail line by line, ClickHouse is a </em>spreadsheet<em> where each column can be scanned independently lightning fast.</em></blockquote><p>ClickHouse also compresses data incredibly well. According to <a href="https://clickhouse.com/docs/en/">ClickHouse Docs</a>, typical compression ratios range between <strong>5× and 10×</strong>, reducing both storage costs and query latency.</p><h3>Table creation</h3><p>When you create a table in ClickHouse, it might look deceptively similar to what you’d do in MySQL or PostgreSQL. But under the hood, there’s one concept that changes <em>everything</em>: the <strong>table engine</strong>.</p><p>A <strong>table engine</strong> in ClickHouse defines <strong>how your data is stored, indexed, partitioned, replicated, and queried</strong>. It’s not just a storage layer it’s the <em>behavioral DNA</em> of your table.</p><p>Let’s start simple:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*GExB_7dukcF5pPyeaTTJEg.png" /></figure><p>That single line -</p><pre>ENGINE = MergeTree()</pre><p>is not just syntax sugar. It decides <strong>how data gets organized on disk, how queries are optimized</strong>, and whether your table supports features like sorting, deduplication, or replication.</p><p>Unlike MySQL (where you’re mostly bound to InnoDB), ClickHouse gives you a <strong>whole family of engines</strong> to pick from - each tailored for specific performance and data needs.</p><h3>What are table engines, and why do they matter?</h3><p>Think of table engines as “personalities” for your tables. Each one changes <em>how your data behaves</em> when it’s inserted, queried, or merged in the background.</p><p>Here are the most common ones you’ll encounter with examples.</p><h4>MergeTree:- The workhorse</h4><p>If you’re just starting with ClickHouse, MergeTree is your go-to engine. It’s the <strong>foundation of most production tables</strong>, supporting sorting, indexing, and partitioning.</p><pre>CREATE TABLE page_views<br>(<br>    view_time DateTime,<br>    user_id UInt64,<br>    url String,<br>    duration Float32<br>)<br>ENGINE = MergeTree()<br>PARTITION BY toYYYYMM(view_time)<br>ORDER BY (user_id, view_time)<br>SETTINGS index_granularity = 8192;</pre><p>💡 <em>What it does:</em></p><ul><li>Sorts data by ORDER BY keys for fast lookups</li><li>Automatically merges small data parts in the background</li><li>Allows time-based partitioning for efficient queries</li></ul><p><strong>Use it for:</strong> analytical workloads, log analytics, dashboards.</p><h4>ReplacingMergeTree:- For deduplication</h4><p>Need to overwrite or deduplicate rows? ReplacingMergeTree does that automatically using a <em>version column</em>.</p><pre>CREATE TABLE user_profiles<br>(<br>    user_id UInt64,<br>    name String,<br>    updated_at DateTime<br>)<br>ENGINE = ReplacingMergeTree(updated_at)<br>ORDER BY user_id;</pre><p>💡 <em>What it does:</em> When merging, it keeps only the most recent version (highest updated_at) per key. This is super useful for <strong>slowly changing dimensions</strong> or log streams where duplicates might appear.</p><p><strong>Use it for:</strong> deduplicating event logs, updating user data snapshots.</p><h4>SummingMergeTree:- For aggregated data</h4><p>If your use case involves <strong>incremental aggregation</strong> (like summing metrics), this engine does it for you.</p><pre>CREATE TABLE daily_sales<br>(<br>    date Date,<br>    product_id UInt64,<br>    total_sales UInt64,<br>    total_revenue Float64<br>)<br>ENGINE = SummingMergeTree((date, product_id))<br>ORDER BY (date, product_id);</pre><p>💡 <em>What it does:</em> During background merges, it automatically <strong>sums numeric columns</strong> with the same sorting key. This reduces raw data volume and accelerates analytical queries.</p><p><strong>Use it for:</strong> metrics, counters, pre-aggregated reports.</p><h4>AggregatingMergeTree:- For materialized views</h4><p>When you need <strong>complex pre-aggregations</strong> (like averages, unique counts, quantiles), AggregatingMergeTree is your best friend.</p><pre>CREATE TABLE session_stats<br>(<br>    user_id UInt64,<br>    avg_duration AggregateFunction(avg, Float32),<br>    unique_pages AggregateFunction(uniq, String)<br>)<br>ENGINE = AggregatingMergeTree()<br>ORDER BY user_id;</pre><p>💡 <em>What it does:</em> Stores aggregated states (not raw values). You then use the -Merge functions to finalize aggregates during query time.</p><p><strong>Use it for:</strong> dashboards, reports, and materialized views.</p><h4>ReplicatedMergeTree:- For high availability</h4><p>In distributed clusters, each shard usually contains a <strong>ReplicatedMergeTree</strong> to ensure redundancy and fault tolerance.</p><pre>CREATE TABLE events_local ON CLUSTER my_cluster<br>(<br>    event_time DateTime,<br>    user_id UInt64,<br>    action String<br>)<br>ENGINE = ReplicatedMergeTree(&#39;/clickhouse/tables/{shard}/events&#39;, &#39;{replica}&#39;)<br>ORDER BY (event_time, user_id);</pre><p>💡 <em>What it does:</em> Keeps replicas in sync across nodes using ZooKeeper or ClickHouse Keeper. If one replica fails, another can take over instantly.</p><p><strong>Use it for:</strong> fault-tolerant, multi-node deployments.</p><h4>Distributed:- For horizontal scaling</h4><p>Finally, the <strong>Distributed</strong> engine ties everything together. It acts like a <em>logical view</em> that routes queries to multiple nodes.</p><pre>CREATE TABLE events_all AS events_local<br>ENGINE = Distributed(&#39;my_cluster&#39;, &#39;default&#39;, &#39;events_local&#39;, rand());</pre><p>💡 <em>What it does:</em></p><ul><li>Distributes queries across shards</li><li>Gathers results automatically</li><li>Enables near-linear scalability</li></ul><p><strong>Use it for:</strong> large clusters, cross-region querying, or sharded datasets.</p><h3>Choosing the right engine</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2FoTIwV%2F1%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2FoTIwV%2F1%2F&amp;image=https%3A%2F%2Fdatawrapper.dwcdn.net%2FoTIwV%2Fplain-s.png%3Fv%3D1&amp;type=text%2Fhtml&amp;schema=dwcdn" width="600" height="349" frameborder="0" scrolling="no"><a href="https://medium.com/media/52167c27a82a99a9339ce0f65bcd4a4b/href">https://medium.com/media/52167c27a82a99a9339ce0f65bcd4a4b/href</a></iframe><p>According to the <a href="https://clickhouse.com/docs/en/engines/table-engines/">ClickHouse documentation on table engines</a>, these can even be <strong>combined, </strong>for example, using a Distributed table that routes to multiple ReplicatedMergeTree tables within shards.</p><blockquote><em>A </em><em>MergeTree table is your data brick. A </em><em>ReplicatedMergeTree keeps those bricks safe. A </em><em>Distributed table builds a castle out of them.</em></blockquote><blockquote>Once you understand how table engines work, everything else in ClickHouse from performance tuning to replication starts to make sense.</blockquote><h3>When should you use ClickHouse?</h3><p>ClickHouse shines when:</p><ul><li>You have <strong>massive datasets</strong> (hundreds of GBs or more).</li><li>You mostly <strong>query</strong> rather than update data.</li><li>You need <strong>low-latency analytics</strong> for dashboards or APIs.</li><li>You want to handle <strong>time-series or log-based</strong> workloads efficiently.</li></ul><p>That’s why companies like <strong>PostHog</strong>, <strong>Sentry</strong>, <strong>Cloudflare</strong>, and <strong>Uber</strong> rely on it. For example, <a href="https://posthog.com/">PostHog</a> uses ClickHouse to power millions of real-time event analytics queries every day, all while keeping costs manageable.</p><h3>How ClickHouse fits into modern data stacks ?</h3><p>ClickHouse isn’t meant to replace your transactional database. Instead, it often <strong>sits beside it</strong>, acting as the analytical backbone. You might ingest data from Kafka or S3, process it with tools like dbt or Airbyte, and serve insights through dashboards, APIs, or even AI pipelines.</p><p>ClickHouse Cloud (its managed version) also makes deployment far easier - offering autoscaling, storage separation, and serverless options straight from <a href="https://clickhouse.com/cloud">clickhouse.com/cloud</a>.</p><h3>Wrapping up, why it matters</h3><p>ClickHouse is more than just “another database.” It’s a rethinking of how we handle analytics at scale-blending <strong>SQL familiarity</strong>, <strong>compression efficiency</strong>, and <strong>speed</strong> that feels almost unfair compared to traditional systems.</p><p>So, next time you’re waiting on a slow dashboard or a sluggish query, maybe it’s time to ask:</p><blockquote><em>“Could ClickHouse handle this better?”</em></blockquote><p>Well, Kudos to you 🎉 you finished this article 😁.</p><p>Follow for more such interesting content and if you find this helpful then do like and share it ✨</p><p>Keep Exploring 🔎</p><p><strong>References &amp; Further Reading:</strong></p><ul><li><a href="https://clickhouse.com/docs/en/">ClickHouse Official Documentation</a></li><li><a href="https://clickhouse.com/docs/en/engines/table-engines/">ClickHouse Table Engines Overview</a></li><li><a href="https://clickhouse.com/docs/en/about-us/how-clickhouse-is-different">ClickHouse vs. Traditional Databases</a></li><li><a href="https://posthog.com/blog/clickhouse-architecture">PostHog ClickHouse Architecture</a></li><li><a href="https://blog.sentry.io/">Sentry Engineering Blog on ClickHouse</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b298406485d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Inter-container file transfer using a single command]]></title>
            <link>https://medium.com/@nisargpipaliya2402/inter-container-file-transfer-using-a-single-command-by-nisarg-pipaliya-7d9efa2e9c16?source=rss-691c6fdf8260------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d9efa2e9c16</guid>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[docker-network]]></category>
            <category><![CDATA[netcat]]></category>
            <dc:creator><![CDATA[Nisarg Pipaliya.]]></dc:creator>
            <pubDate>Fri, 02 Aug 2024 09:23:16 GMT</pubDate>
            <atom:updated>2024-08-02T09:23:16.487Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P3fYtB8_7Zw8tf7nAps2pw.png" /><figcaption>Inter-Container FIle Transfer</figcaption></figure><p>Imagine you are enjoying your regular cup of coffee siiippp aaaahhh!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H2P19GvAE7GRAsihXsNV1w.jpeg" /><figcaption>It’s You enjoying coffee/tea</figcaption></figure><p>It’s a nice morning, and you are ready for work, you open your laptop, and BAM!! have a Docker task assigned to you i.e. you are supposed to transfer a file from a folder “Source” to another folder “Destination” but the catch is, you need to follow the order i.e “Source” to “Container A”, “ContainerA” to “ContainerB” and “ContainerB” to “Destination” folder.</p><p>another condition is you should do it using a single command 🤯🤯 and no shared volume between containerA and containerB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1qGn_W27cN4PoqZgm8dTNA.jpeg" /><figcaption>It’s you opening the communication app</figcaption></figure><p><strong>So now you start thinking about how to do it?</strong></p><p>Let’s break down the problem:</p><blockquote>Step 1: transfer file from “Source” folder to containerA</blockquote><blockquote>Step 2: transfer file from containerA to containerB</blockquote><blockquote>Step 3: transfer file from containerB to “Destination” folder</blockquote><p>So now we can think clearly, as we have divided our work into smaller tasks #DivideAndConquer 😂( Bad Joke Alert)</p><p><strong>For Steps 1 and 3:</strong></p><p>We can use the concept of Bind mount i.e. leverage the functionality of the Docker Storage service to connect the host file system to the Docker container.</p><p>But before we do that, we need to keep the docker containers on the same network as we are supposed to transfer files from one container to another.</p><p>( Can also skip this network creation part, as by default containers will use a bridge network for communication)</p><pre>docker network create pirateNet</pre><p>Let’s choose the image for demo purposes, I am going with the tomcat image, you can choose any.</p><pre>docker run -d --name containerA -p 2222:22 --network pirateNet -v /home/luffy/source:/source tomcat</pre><p>Host Folder:</p><ul><li>/home/luffy/source</li></ul><p>Folder on containerA:</p><ul><li>/source</li></ul><p>Similarly for containerB:</p><pre>docker run -d --name containerB -p 2223:22 --network pirateNet -v /home/luffy/destination:/destination tomcat</pre><p><strong>Let’s dive into the main part i.e. step 2:</strong></p><p>This thing can be done using multiple ways, I am going to discuss two ways you can do it.</p><blockquote>Way 1</blockquote><p>We will use the “Secure Copy Protocol” scp, which is part of “openssh” module.</p><pre>docker exec -i containerA sh -c &#39;sshpass -p &quot;root123&quot; scp $HOME/../source/file_name.txt root@IP_OF_CONTAINER_B:$HOME/../dest</pre><p>To use this command you need “openssh-server openssh-client and sshpass” modules in your docker container.</p><p>To do it:</p><pre>#For ContainerA<br>docker exec -it containerA /bin/bash<br><br>#into the container<br>apt-get install openssh-server openssh-client sshpass<br><br>service ssh start</pre><pre>#For ContainerB<br><br>docker exec -it containerB /bin/bash<br><br>#Into containerB<br>apt-get install openssh-server openssh-client<br><br>service ssh start<br><br><br>#Now we will set id password to login to this system<br>echo &quot;root|root123&quot; | chpasswd<br><br>#Now move to /etc/ssh<br>cd /home/../etc/ssh<br><br>#open sshd_config file in editor<br>vi sshd_config</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*AmgdWMd6Hy6QGbafYn2pMA.png" /><figcaption>sshd_config file</figcaption></figure><p>Now, edit the authentication part, and make <em>“PermitRootLogin yes”</em></p><p>All set to execute the command !!</p><blockquote>Way 2</blockquote><p>Here we are going to use <strong>“Netcat” </strong>for transferring files, thanks to my friend <a href="https://medium.com/u/eefdf5e5b54">Shreya Gandhi</a> for suggesting this approach.</p><p><strong>Setup Netcat on both the containers:</strong></p><p>Make containerB listen for requests and what it is listing should be written to the destination folder,</p><pre>docker exec containerB sh -c &#39;nc -l -p port_bounded_to_container &gt; /destination/file_name.txt&#39;</pre><p>Now stream the source file,</p><pre>docker exec containerA sh -c &#39;nc containerB_IP_address port_bounded_to_container_B &lt; /source/file.txt&#39;</pre><p>To know IP address of containerB</p><pre>docker inspect containerB #Search IP address of containerB from here.</pre><p><strong>For this approach to work set up netcat:</strong></p><p>Run the following command inside containerA and containerB:</p><pre>apt-get update &amp;&amp; apt-get upgrade<br>apt-get install netcat-openbsd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ssZL3Txzq66aMFnjl-kFsA.jpeg" /><figcaption>You-Rock</figcaption></figure><p>Well, Kudos to you 🎉 you finished this article and mastered the art of transferring files from one container to another 😁.</p><p>Follow for more such interesting content and if you find this helpful then do like and share it ✨</p><p>Keep Exploring 🔎</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d9efa2e9c16" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unleashing the Superheroes of Cybersecurity: Microsoft’s Latest Innovations]]></title>
            <link>https://medium.com/@nisargpipaliya2402/unleashing-the-superheroes-of-cybersecurity-microsofts-latest-innovations-fbb808f95859?source=rss-691c6fdf8260------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbb808f95859</guid>
            <category><![CDATA[data-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[cloud-security]]></category>
            <category><![CDATA[microsoft]]></category>
            <dc:creator><![CDATA[Nisarg Pipaliya.]]></dc:creator>
            <pubDate>Tue, 11 Apr 2023 05:59:31 GMT</pubDate>
            <atom:updated>2023-04-11T06:40:41.696Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_NmuCp0QpoZPlItq0bjhtQ.png" /><figcaption>-By Nisarg Pipaliya</figcaption></figure><p>Are you concerned about the security of your online activities? The internet can be a dangerous place, with cybercriminals lurking around every corner. It’s essential to have the right tools and strategies to protect yourself and your organization. In this article, we’ll explore some of Microsoft’s latest security innovations, from <strong><em>AI-powered identity protection to cloud security and vulnerability management</em></strong>. So, buckle up and get ready to meet your cybersecurity superhero!</p><blockquote>So, what exactly is Microsoft Security Co-Pilot?</blockquote><p>It’s a tool designed to help Microsoft customers manage and navigate their security products with ease. Whether you’re a small business owner or part of a large enterprise, Security Co-Pilot can help you stay on top of your security game.</p><p>One of the key features of Security Co-Pilot is its ability to provide personalized security recommendations based on your organization’s specific needs. Security Co-Pilot will do the heavy lifting for you and give you clear, concise recommendations on how to improve your security posture.</p><p>Another great feature of Security Co-Pilot is its integration with other Microsoft security products, such as Microsoft Defender for Endpoint and Microsoft 365 Defender. This integration allows for a seamless experience, making it easy to manage all of your security products in one place. You can even view all of your security alerts and recommendations in a single dashboard, saving you time and hassle.</p><blockquote>But what about use cases?</blockquote><p>Security Co-Pilot is perfect for organizations of all sizes that want to take their security to the next level. It’s especially useful for organizations that don’t have a dedicated security team or don’t have the resources to manage their security products on their own. With Security Co-Pilot, you get a trusted advisor that can guide you through the complicated world of cybersecurity.</p><p>And that’s not all, Microsoft is also making major strides in the field of cybersecurity with some seriously cool improvements to its security platform.</p><p>One of the coolest new features is the expansion of <strong>Microsoft’s Zero Trust</strong> approach, which is like having a security guard at the door of every access request. Microsoft is taking this approach even further by introducing an AI-powered solution called<strong><em> Microsoft Identity Protection</em></strong>, which is basically like having a superhero bodyguard for your accounts. This solution uses machine learning to detect and prevent account compromise attacks in real time, saving you from the bad guys.</p><p>Microsoft is also making major strides in the field of cloud security with <em>Microsoft Cloud App Security</em>, which helps organizations gain visibility and control over cloud applications. It’s like having your own personal cloud sheriff to keep the bad guys out and your data safe.</p><p>And that’s not all, Microsoft is also introducing<em> Microsoft Threat and Vulnerability Management</em>, a solution that identifies and prioritizes vulnerabilities within an organization’s IT environment. It’s like having your own personal vulnerability detector that can help you prioritize and fix issues before they become a problem.</p><p>And let’s not forget about<strong><em> Security Co-Pilot</em></strong>, your trusty sidekick for navigating the murky waters of online security. With the integration of Security Co-Pilot and all of these other amazing security solutions, Microsoft is truly transforming the future of cybersecurity.</p><p>In conclusion, Microsoft’s latest innovations in cybersecurity are nothing short of impressive. From their superhero-inspired Security Co-Pilot to their AI-powered Microsoft Identity Protection and cloud sheriff-like Microsoft Cloud App Security, it’s clear that they’re serious about keeping our digital lives safe. While we can’t deny the importance of staying vigilant against cyber threats, it’s good to know that we have such powerful allies in the fight against online villains. So, stay safe out there, and <strong><em>may the cybersec force </em></strong>be with you!</p><p>To know more refer to <a href="https://www.microsoft.com/en-us/security/blog/2023/03/28/microsoft-secure-explore-innovations-transforming-the-future-of-security/">Microsoft&#39;s official blog by Vasu Jakkal-</a>Corporate Vice President.</p><p>Hey There if loved reading this article please give it a like and share it😁.</p><p>🔍 Keep Exploring 🔍</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbb808f95859" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Inheritance in Python: Unleashing the Power of Class Hierarchies]]></title>
            <link>https://medium.com/@nisargpipaliya2402/inheritance-in-python-unleashing-the-power-of-class-hierarchies-9f43edf4d4aa?source=rss-691c6fdf8260------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f43edf4d4aa</guid>
            <category><![CDATA[oops-interview-questions]]></category>
            <category><![CDATA[rom]]></category>
            <category><![CDATA[oops-concepts]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[inheritance]]></category>
            <dc:creator><![CDATA[Nisarg Pipaliya.]]></dc:creator>
            <pubDate>Mon, 10 Apr 2023 10:07:30 GMT</pubDate>
            <atom:updated>2023-04-10T10:07:30.061Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jlB27L-oEkYFDGTcI70S5A.png" /><figcaption>-By Nisarg Pipaliya</figcaption></figure><p>Inheritance is a powerful concept in object-oriented programming (OOP) that allows a new class to be created by inheriting the properties and methods of an existing class. In Python, inheritance enables the reuse of code and creates new classes with the same behavior and properties as the parent class( which eventually helps us to write our code in modules BAM!!)</p><blockquote>Types of Inheritance in Python</blockquote><blockquote>Single Inheritance</blockquote><p>Single inheritance is the simplest form of inheritance in which a new class is created by inheriting properties and methods from a<em> single parent class</em>. In Python, we use the following syntax to implement single inheritance:</p><pre>class ParentClass:<br>    # properties and methods of parent class<br><br>class ChildClass(ParentClass):<br>    # additional properties and methods that are not in Parent Class</pre><p>ChildClass is a new class, and <strong>ParentClass</strong> is the existing class that we want to inherit from. Hence, we can access all the public methods and variables of the parent class from/in the child class.</p><p>Therefore child class has access to its methods and variables and also to the public methods and public variables of the parent class.</p><p>Well, don’t know what are public, private, or protected — access modifiers are? check this <a href="https://pythonguides.com/python-access-modifiers/">Python resource</a>.(not owned by me)</p><blockquote>Multiple Inheritance</blockquote><p>Multiple inheritance is a type of inheritance in which a new class is created by inheriting properties and methods from <em>multiple parent classes</em>. In Python, we use the following syntax to implement multiple inheritance :</p><pre>class ParentClass1:<br>    # properties and methods of ParentClass1<br><br>class ParentClass2:<br>    # properties and methods of ParentClass2<br><br>class ChildClass(ParentClass1,ParentClass2):<br>    # additional properties and methods that are not in Parent Class</pre><blockquote>Multi-level Inheritance</blockquote><p>Multi-level inheritance is a type of inheritance in which a new class is created by inheriting properties and methods from a<em> parent class, which in turn inherits from another parent class</em>. In Python, we use the following syntax to implement multi-level inheritance:</p><pre>class GrandparentClass:<br>    # properties and methods of GrandparentClass<br>  <br><br>class ParentClass(GrandparentClass):<br>    # properties and methods of ParentClass<br>  <br><br>class ChildClass(ParentClass):<br>    # additional properties and methods that are not in Parent Class<br>    </pre><blockquote>Hierarchical Inheritance</blockquote><p>Hierarchical inheritance is a type of inheritance in which a new class is created by inheriting properties and methods from a <em>single parent class, but multiple child</em> classes are created from the same parent class. In Python, we use the following syntax to implement hierarchical inheritance:</p><pre>class ParentClass:<br>    # properties and methods<br><br>class ChildClass1(ParentClass):<br>    # additional properties and methods that are not in parent class<br><br><br>class ChildClass2(ParentClass):<br>    # additional properties and methods that are not in parent class<br></pre><blockquote>Hybrid Inheritance</blockquote><p>Hybrid inheritance is a type of inheritance that combines two or more types of inheritance. For example, a new class can be created by inheriting properties and methods from multiple parent classes, and then a new class can be created by inheriting this new class. <em>This is also called a diamond problem, and it can lead to method conflicts and ambiguity</em>. ( well not in Python, because to solve this problem it uses a powerful technique that we will discuss later in this article).</p><pre>class Parent:<br>    def dummy_method(self):<br>        print(&quot;Hello from Parent Class&quot;)<br><br>class Child1(Parent):<br>    def extra_method(self):<br>        print(&quot;Hello from Child1 class&quot;)<br>    <br>class Child2(Parent):<br>    def extra_method2(self):<br>        print(&quot;Hello from Child2 class&quot;)<br><br>class ambiguity_child(Child1,Child2):<br>    pass<br><br><br>obj = ambiguity_child()<br><br>obj.dummy_method()</pre><p>this would give you the output as:</p><pre>&gt;&gt;&gt; Hello from Parent Class</pre><p>Whereas the same code in C++ would give you an error.</p><p>Have a look,</p><pre>#include&lt;iostream&gt;<br>using namespace std;<br><br>class Parent{<br>public:<br>    void dummy_method(void)<br>    {<br>        cout&lt;&lt;&quot;Hello from Parent class&quot;&lt;&lt;endl;<br>    }<br>};<br><br>class Child1: public Parent<br>{<br>public:<br>    void extra_method(void)<br>    {<br>        cout&lt;&lt;&quot;Hello from Child1 class&quot;&lt;&lt;endl;<br>    }<br>};<br><br>class Child2: public Parent<br>{<br>public:<br>    void extra_method2(void){<br>        cout&lt;&lt;&quot;Hello From Child2 class&quot;&lt;&lt;endl;<br>    }<br>};<br><br><br>class amibiguity_child: public Child1, public Child2<br>{<br><br>};<br><br>int main(void)<br>{<br>    amibiguity_child obj;<br>    obj.dummy_method();<br>    return 0;<br>}<br><br><br>Output:<br><br>In function &#39;int main()&#39;:<br>38:9: error: request for member &#39;dummy_method&#39; is ambiguous<br>     obj.dummy_method();<br>         ^~~~~~~~~~~~<br>6:10: note: candidates are: void Parent::dummy_method()<br>     void dummy_method(void)<br>          ^~~~~~~~~~~~<br>6:10: note:                 void Parent::dummy_method()</pre><blockquote>Methods in Inheritance</blockquote><p>When a child class inherits from a parent class, it can use the properties and methods of the parent class. The child class can also override or extend the methods of the parent class. There are two types of methods in inheritance:</p><blockquote>Overriding Methods</blockquote><p>When a child class defines a method with the same name as a method in the parent class, it overrides the method of the parent class. Here’s an example:</p><pre>class ParentClass:<br>    def say_hello(self):<br>        print(&quot;Hello from ParentClass&quot;)<br><br>class ChildClass(ParentClass):<br>    def say_hello(self):<br>        print(&quot;Hello from ChildClass&quot;)<br><br>obj = ChildClass()<br>obj.say_hello()<br><br>Output:<br>&gt;&gt;&gt; Hello from ChildClass</pre><blockquote>Extending Methods</blockquote><p>When a child class defines a method with the same name as a method in the parent class, and then adds additional functionality to it, it extends the method of the parent class. In Python, we use the <strong>super()</strong> function to call the method of the parent class. Here’s an example:</p><pre>class ParentClass:<br>    def say_hello(self):<br>        print(&quot;Hello from ParentClass&quot;)<br><br>class ChildClass(ParentClass):<br>    def say_hello(self):<br>        super().say_hello()<br>        print(&quot;How are you?&quot;)<br><br>obj = ChildClass()<br>obj.say_hello()<br><br>Output:<br>&gt;&gt;&gt; Hello from ParentClass<br>&gt;&gt;&gt; How are you?</pre><blockquote>Problems in Inheritance</blockquote><blockquote>Method Conflicts</blockquote><p>When two or more parent classes have methods with the same name, it can lead to conflicts in the child class that inherits from them. In this case, the child class must explicitly choose which method to use, or override the conflicting method.</p><blockquote>Ambiguity</blockquote><p>When a child class inherits from two or more parent classes that have methods with the same name and signature, it can lead to ambiguity in the child class. In this case, the child class must explicitly choose which method to use, or override the conflicting method.</p><blockquote>Tight Coupling</blockquote><p>When a child class depends too much on the implementation details of its parent class, it can lead to tight coupling, which makes the code difficult to maintain and modify.</p><blockquote>Solutions to Inheritance Problems</blockquote><blockquote>Method Resolution Order (MRO)</blockquote><p>The method resolution order is the order in which Python looks for methods in a class hierarchy. Python uses the C3 linearization algorithm to calculate the method resolution order. The method resolution order can be accessed using the <strong>__mro__</strong> attribute of a class as class.__mro__ . Or by using mro function -&gt; Child_class.mro()</p><blockquote>Method Overriding</blockquote><p>Method overriding allows a child class to override a method of the parent class with the same name. This is useful when we want to change the behavior of a method in the child class.</p><blockquote>Method Overloading</blockquote><p>Method overloading allows a class to have multiple methods with the same name but different arguments. This is useful when we want to perform different operations based on the arguments passed to the method.</p><blockquote>Abstract Base Classes</blockquote><p>Abstract base classes provide a way to define a base class that must be inherited by all child classes. Abstract base classes can be used to define a common interface that all child classes must implement.</p><blockquote>Fun fact : every data type or data structure or I must say everything in python that we use is inherited from the Object class(inbuilt class in python).</blockquote><blockquote>Conclusion</blockquote><p>Inheritance is a powerful concept in object-oriented programming that allows a new class to be created by inheriting the properties and methods of an existing class. When using inheritance, we must be aware of the problems that can arise, such as method conflicts, ambiguity, and tight coupling. To solve these problems, we can use techniques such as method resolution order, method overriding, method overloading, and abstract base classes. With these techniques, we can create robust and maintainable code using inheritance in Python.</p><p>If you reached here, you did a great job😁. Give yourself kudos and be proud as today you have learned the concept of inheritance in Python, what problems may occur in inheritance and what is the solution for it.</p><p>If this article helped you learn something new please like it and share it.</p><p>🔍Keep Exploring 🔍</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f43edf4d4aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Does StackOverflows ?]]></title>
            <link>https://medium.com/@nisargpipaliya2402/why-does-stackoverflows-d460291db26f?source=rss-691c6fdf8260------2</link>
            <guid isPermaLink="false">https://medium.com/p/d460291db26f</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[stackoverflow]]></category>
            <category><![CDATA[functioncall]]></category>
            <category><![CDATA[stack]]></category>
            <category><![CDATA[stackoverflowerror]]></category>
            <dc:creator><![CDATA[Nisarg Pipaliya.]]></dc:creator>
            <pubDate>Thu, 06 Apr 2023 17:42:58 GMT</pubDate>
            <atom:updated>2023-04-06T17:48:36.864Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why Does StackOverflows ?🤔</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-hkiWFMckTKBnWQqn697cA.gif" /><figcaption>-By Nisarg Pipaliya</figcaption></figure><p><strong>If you have just started programming, or you are quite good at it. then you must have encountered the question “Why does Stack Overflows?” and what is the actual reason for it?</strong></p><p><strong>if you are a university student then you have been given the reason that “STACK CANNOT HANDLE THE MEMORY GENERATED blah blah blah….”</strong></p><p><strong>( 😅 they are correct no offense)</strong></p><p><strong>but the questions below are not answered :(</strong></p><blockquote><strong>What thing in a program generates this unmanageable memory? and how does it generate this much memory?</strong></blockquote><p><strong>Let’s find it out 🔍</strong></p><p><strong>wait….wait … before finding it out we need to understand how a machine divides the program or code written by a programmer? which will help us to find out the reason for Stackoverflow.</strong></p><p>Note: for simplicity, I have considered C++ syntax for this article.</p><p><strong>When a program is compiled by a compiler, the resulting executable file is divided into four segments :</strong></p><p>· <strong>Code</strong></p><p>· <strong>Data</strong></p><p>· <strong>Heap</strong></p><p>· <strong>Stack</strong></p><p>From these segments the size of Code, Data, and Stack is decided at compile time i.e. they are of fixed size, and size of the heap if defined at runtime.</p><blockquote><strong>Code Segment</strong></blockquote><p><strong>The code segment contains the program&#39;s executable code, also known as the text segment. It contains the instructions that are executed by the processor, such as functions and instructions for data manipulation.</strong></p><blockquote><strong>Data Segment</strong></blockquote><p><strong>The data segment contains initialized global and static variables, as well as constants. This segment is read-write. The data segment is further divided into two sub-segments: the initialized data segment and the uninitialized data segment. The initialized data segment contains initialized global and static variables, while the uninitialized data segment contains uninitialized global and static variables.</strong></p><blockquote><strong>Heap Segment</strong></blockquote><p><strong>The heap segment is used for dynamic memory allocation. It grows upwards in memory and is managed by the programmer. The heap is typically used for data structures that need to be resized dynamically at runtime.</strong></p><blockquote><strong>Stack Segment</strong></blockquote><blockquote><strong>So how stack is utilized in program?</strong></blockquote><p><strong>The stack segment is used to store function parameters, local variables, and the return address of a function. It grows downwards in memory and is managed by the system. When a function is called, the necessary stack space is allocated, and when the function returns, the stack space is deallocated.</strong></p><blockquote><strong>Now what does this mean?</strong></blockquote><p><strong>As the program is divided into segments by compiler, and each of these segments is given logical memory addresses (not actual addresses from the hard disk).</strong></p><p><strong>So when the program is getting executed at that time IP needs to go from one segment to another segment. But why?</strong></p><p><strong>The execution of the program starts from the code segment, and the variable is in the data segment and the variables which are assigned memory dynamically are in the heap, so when execution starts from the code segment and when the program needs to make a jump to data or heap segment for accessing variable or function stored their then it stores the segment address and instruction pointer(IP) for the next instruction after the function call on the stack. now IP can move to that segment performs the operation and then come back to the code segment and continue the execution.</strong></p><p><strong>Fine, so this is the end of the article. Meet you next time :)</strong></p><blockquote><strong>Hey wait what fine? What are these segment address and instruction pointer? 😑</strong></blockquote><p><strong>The segment address is simply the address assigned to the segment (code, data, heap, stack) the logical address(it means that not the actual address from the hard disk ).</strong></p><p><strong>And the instruction pointer is nothing but it is the pointer that contains the logical address of the instruction currently being executed.</strong></p><p><strong>So consider the below written C++ program.</strong></p><pre>#include&lt;iostream&gt; // ignoring this and below line as they are instruction <br>                   // for compiler for bringing necessary functions from <br>                    //iostream library .<br>using namespace std;    // Yes, I am ignoring you.<br><br>void My_fav_function() // assume logical address (LA) 1<br>{                                                      // LA=2 <br>cout&lt;&lt;”This my favourite function “&lt;&lt;endl;             // LA=3<br>}                                                      // LA=4<br><br> int main(void)                                       // LA=5<br>{                                                     // LA=6<br><br>   cout&lt;&lt;”Hey there”&lt;&lt;endl;                           // LA=7<br>   cout&lt;&lt;” Why does stack overflows?” &lt;&lt;endl;         // LA=8<br><br>   My_fav_function();                                  //LA=9 <br><br>   cout&lt;&lt;”Well stack works very hard for execution of the program 😊”&lt;&lt;endl;//LA=10<br>                                                      <br>   return 0;                                          //LA=11<br>}                                                 //LA=12 -&gt; end of program.</pre><p><strong>So now whenever the program is executed the instruction pointer is assigned the value of the “MAIN” method.</strong></p><p><strong>And hence the execution starts from the main method so let’s trace the value of this instruction pointer (assuming that the program was started at time T=0)</strong></p><pre>    TIME  |  Value of Instruction<br>          |     Pointer<br>    ______________________<br>      0   |      5 (refers to LA=5)<br>      1   |      6<br>      2   |      7<br>      3   |      8<br>      4   |      9</pre><p><strong>Now, at this point we are calling “My_fav_function()” therefore we need to assign the instruction pointer the value of the address where this function is stored, so let&#39;s do it what is the problem with this?</strong></p><p><strong>The problem is that, if we assign the address of the function are continue the execution then whenever the function gets completed the IP would not know where to go from here. Or how do I get back to the main function, and continue the execution?</strong></p><blockquote><strong>Who will save IP from this catastrophe 😭?</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jS9LEpZ8vqJU5e8zsGSVSQ.png" /><figcaption>Super-Stack</figcaption></figure><p><strong>So here the stack would store the value of the segment address(mentioned above) and instruction pointer onto it and whenever the “MY_fav_function()” gets over the stack pops the address stored and assign it to IP so, now</strong></p><p><strong>The tables continue as:</strong></p><pre>    TIME   |  Value of IP<br>    ______________________<br>    5      |       1<br>    6      |       2<br>    7      |       3<br>    8      |       4 (now stack will pop the value and assign IP the address of the next instruction which is after function call.)<br>    9      |       10<br>    10     |       11<br>    11     |       12</pre><p><strong>So, here when the functions are called the address is stored on the stack.</strong></p><p><strong>Now when we have a recursive function and the depth ( i.e. how many times a function is called) becomes huge i.e. it generates a huge recursive tree the stack fails to store all these values of IP and runs out of space, so this phenomenon of running out of space while trying to store the value of this instruction pointers is called StackOverflow (well this is how I see it.)</strong></p><blockquote><strong>Into the comment section:</strong></blockquote><blockquote><strong>Which of this two code will generate stackoverflow?</strong></blockquote><p>code 1</p><pre>while(true){<br> cout&lt;&lt;”Hii”&lt;&lt;endl;<br>}</pre><p>code 2</p><pre>funct(){<br>  cout&lt;&lt; “you have been caught into infinite loop dormammu” &lt;&lt;endl;<br>funct();<br>}</pre><p><strong>Hope you liked this article 😊 and if you liked it please give it kudos.</strong></p><p><strong>You can mention the topics on which you would love to read articles in the comment section.</strong></p><p><strong>🔍 Keep exploring 🔍</strong></p><p>Note: the concept of the instruction pointer, segment address and how the stack deals with function calls is a wonderful topic in 8086 Microprocessor programming. here In the example discussed I have considered only IP but in actual processing, it is somewhat different. I have not discussed it here as it is a deep concept and while programming you may not need these deep concepts of how a processor works.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d460291db26f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>