<?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 Peeyush Kushwaha on Medium]]></title>
        <description><![CDATA[Stories by Peeyush Kushwaha on Medium]]></description>
        <link>https://medium.com/@peey?source=rss-71c654f708fd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*6rzmalTBVsPrxo1z.png</url>
            <title>Stories by Peeyush Kushwaha on Medium</title>
            <link>https://medium.com/@peey?source=rss-71c654f708fd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 03:58:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@peey/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[Personal Experiences at Babel #1 — A PR with Unusually High Number of Reviews]]></title>
            <link>https://medium.com/@peey/personal-experiences-at-babel-1-a-pr-with-unusually-high-number-of-reviews-5cb49ee71897?source=rss-71c654f708fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/5cb49ee71897</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Peeyush Kushwaha]]></dc:creator>
            <pubDate>Sun, 02 Jul 2017 11:06:22 GMT</pubDate>
            <atom:updated>2017-07-02T12:45:56.512Z</atom:updated>
            <content:encoded><![CDATA[<p>We landed the <a href="https://github.com/babel/babylon/pull/587">parser support</a> for <a href="https://tc39.github.io/proposal-decorators/">the stage-2 decorators spec</a> last week at Babylon — the parser for Babel. If you don’t know what a decorator is, the gist of it is that a decorator gives some concise syntax to affect the definition of a class or a class method which you decorate.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e06c9d93b8f3369fed6be8b3e026989/href">https://medium.com/media/2e06c9d93b8f3369fed6be8b3e026989/href</a></iframe><p>One of the more remarkable things about this PR was the number of reviews it received</p><h3>Henry Zhu on Twitter</h3><p>It&#39;s not common to see this many reviews! Just merged the decorators PR in Babylon: a huge shoutout to @PeeyFTW (and first PR 😄) @gsoc</p><p>Perhaps this could be because decorators really are one of the much hyped about features in JavaScript. Angular even considered making their own JS flavor called AtScript before they decided to go with TypeScript since they love decorators (or as they liked to call it “annotations”) so much.</p><p>Well, there is more to the story. As I was recently discussing with a mentor, reviewing PRs is a tough job. Reviewing PRs is comparably as hard as solving the bug in the first place was. Apart from the technical aspect of reviewing — which is ensuring that the bug is being fixed optimally (by perhaps even getting an idea of how they would solve the issue and seeing how the submitted patch compares to their idea) — there’s another big hindrance. A reviewer has to be aware of the whole issue, the discussion surrounding it, and have familiarity with the part of the codebase that the PR makes changes to.¹</p><p>When I initially joined Babel, and was not-so-familiar with the codebase, every issue I encountered was almost instantly answered after I posted it in Babel’s chatroom, which left me with the (wrong) impression that perhaps the maintainers are some god-like figures who know it all and that everyone’s expected to adhere to same fictitious standards.</p><p>Even after becoming familiar with the codebase, I was submitting PRs without proper documentation under the assumption that it took me a while to solve the issue and see all things, but if the reviewers see the code they’d instantly be able to evaluate it just like they were answering my questions.</p><p>Eh! Very wrong. Let me just bust this myth (assuming I’m not the only one who has felt it). Even they (maintainers) won’t have all the answers at times, and sometimes you’ll have to search for yourself — and that’s how it should be.²</p><p>In open source, there are a lot of people who want to contribute, but are unable to because they don’t know how to code / they don’t know how to present PRs / they don’t know what the project wants / they don’t know what the maintainers want / a ton of other things. A lot of the times you’ll find help along the way, but a lot of that is controlled by factors beyond your control.³</p><p>One of the joys of getting your PR merged is not just the programming but somehow making the project move forward in the way it is expected to be moved forward. And doing that by somehow identifying what the project needs and being able to deliver that.</p><p>In order to merge this PR I had find people and talk to them — people who use decorators, people who are interested in seeing an implementation of decorators, people who want to contribute to babel for decorators. After getting consensus on how to move forward⁷, I had to go through the spec and all the existing discussion surrounding it so that my understanding of the spec could be up to speed with other people.</p><p>And finally — the most important part which I think got this PR the number of reviews that we saw — making it easy for people who’ll be reviewing my PR by explaining everything they would need to get up to speed with the whole situation. By chance, at the time the PR I made was able to satisfy some of the criteria I mentioned earlier:</p><ol><li>Making sure reviewers are aware of the whole issue (by mentioning in detail the decisions I’ve taken so they don’t necessarily have to look at the code to figure it out)</li><li>The discussion surrounding it (by mentioning alternate viewpoints on some of the decisions so as to make it easier to compare them with the decisions made)</li><li>Explaining clearly my strategy to solve the problem (to assist the technical aspect of reviewing — so that the reviewers can know what I’ve done and then see the code rather than the other way around)</li></ol><p>And that’s what did it! (or so I think). So there’s the mystery unraveled — A PR with unusually high number of reviews¹.</p><p><strong>PS</strong>: I wanted to share my personal experience experience with this blog post, not write a guide to be followed or a technical blog post. Therefore, some statements which I make may not hold true in general or may be debatable, so they should just be read in the context of the experience I narrate.</p><p>Also note that if you’re looking for decorators support in Babel, we still have a long way to go. This is just the parser and work on the transform (which converts your code to functionally equivalent ES5)is yet to be done. But now that we’ve made the decisions that needed to be made, things will move more smoothly from here onwards.</p><p><strong>Footnotes:</strong></p><ol><li>We have a shortage of manpower when it comes to reviewing PRs. It was also recently discussed in one of our weekly meetings (<a href="https://github.com/babel/notes/blob/master/2017-06/june-21.md#priority-topics">link to meeting notes</a>). Perhaps you could help us with this. Drop by <a href="https://slack.babeljs.io/">our slack chatroom</a> and offer your help!</li><li>I feel that the myth stems from the fact that when you’re new to the project the mentors definitely do know more about the project than you so</li><li>(to illustrate) Some random factors which might affect the chances of you getting help: (<strong>points 4–6</strong> since medium is irritating and doesn’t support nested lists)</li><li>→ If someone was online who worked on the same thing when you post a question on the chatroom</li><li>→ Someone who knows your doubt will take a lot of time to deal with and they want to give you personal attention and not just throw information at you</li><li>→ Someone who’s able to gauge where you’re coming from, and so on.</li><li>We’d been stuck for <a href="https://github.com/babel/babel/issues/2645">a while</a> since <em>a lot </em>of people use a nonstandard implementation for decorators which came at around the time the spec was in stage-0. The changes in spec are not backwards-compatible so we were unsure on how we should introduce support for the new spec without causing much disruption for people who use Babel. We finally decided that we’ll be introducing this PR as a opt-in to allow people to migrate at their own pace.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5cb49ee71897" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Can your computer generate random numbers?]]></title>
            <link>https://medium.com/@peey/can-your-computer-generate-random-numbers-14af8c3df65b?source=rss-71c654f708fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/14af8c3df65b</guid>
            <category><![CDATA[computers]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Peeyush Kushwaha]]></dc:creator>
            <pubDate>Thu, 29 Sep 2016 18:16:05 GMT</pubDate>
            <atom:updated>2016-09-29T18:17:11.437Z</atom:updated>
            <content:encoded><![CDATA[<p>Asked by Aditya</p><p>A computer is deterministic. What this means is that given the same inputs, it will always produce the same outputs.</p><p>This effectively means that we can’t produce random numbers with computers. Because there is no concept of random to a computer.</p><p>When we talk about random numbers in programming, we always talk about pseudo-random numbers. Mathematicians and computer scientists have designed algorithms that will produce numbers that “look” random. The uniform function you’re using implements one such algorithm.</p><p>The nature of these pseudo-random number generating algorithms is that you provide them with a “seed”, and based on that they’ll generate a series of pseudorandom numbers every time you call that function.</p><p>For a given seed, the algorithm will always produce the same sequence of pseudorandom numbers.</p><p>This is actually a topic that has huge ramifications for computer security. Imagine an electronic slot machine in a Las Vegas casino. The machine employs a pseudorandom number generator to emulate the 3 spinning slots. If someone were to know the seed, then they would know every result that the slot machine has ever given and every result that it would give in the future. They could just wait till before the jackpot and go in and win all the money. And if other players came to know that it wasn’t purely a game of chance but the winning play could be predicted, then they’d be very angry and the casino will soon loose all its money and go bankrupt!</p><p>In a similar way, random numbers are used in cryptography &amp; computer security, and it’s of the utmost importance to keep the seed safe.</p><p>Can <em>truly</em> random numbers be generated as well? Well yes, but not by your computer. As I said already, a computer is a deterministic machine. There is something known as the “Hardware Random Number Generator” which senses random variations in physical properties like temperature of the room, etc. Not really generated by a computer though, generated by the nature and sensed by the computer.</p><p>Footnote: This article is adapted from an answer that I posted in an online academic forum.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14af8c3df65b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why is the MAC address called 48 bit when it is 12 characters in length?]]></title>
            <link>https://medium.com/@peey/why-is-the-mac-address-called-48-bit-when-it-is-12-characters-in-length-444bd79483c4?source=rss-71c654f708fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/444bd79483c4</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Peeyush Kushwaha]]></dc:creator>
            <pubDate>Thu, 29 Sep 2016 16:51:10 GMT</pubDate>
            <atom:updated>2016-09-29T16:51:10.773Z</atom:updated>
            <content:encoded><![CDATA[<p>Asked by Kshitiz</p><p>You might have noticed that your MAC address does not have any other alphabets than a, b, c, d, e and f. This is because the MAC address representation you see is called hexadecimal.</p><p>You already may know about binary, a number system where we only use two symbols — 0, and 1. All of the numbers that can be represented in the “regular” way, i.e. using 10 symbols — 0, 1, 2, …, 8, 9 can be represented in binary as well. In fact, the same is true for number systems using any number of digits, be it 2 (binary), 10 (decimal, the regular representation we use), or some other integer greater than 2.</p><p>The mac address that appears to be a string of length 12 is actually a number. Its written in the number system which uses 16 digits, called the hexadecimal number system. We already have 10 digits — 0 to 9, we need six more symbols. Usually we use the first six symbols of the English alphabet, namely — a, b, c, d, e, and f. That’s why you’ll never see any other symbols being used in a mac address, apart from colons or dashes which are used as separators. Because 00:0a:95:9d:68:16 is easier to read out to someone than 000a959d6816.</p><p>Now imagine that you can write 1 digit on a piece of paper. If you could write one binary digit, how many possibilities would you have? Well, 2. Because you could write either 1 or 0. If you had to write a decimal digit, you’d have 10 possibilities. If you had to write a hexadecimal digit, you’d have 16 possibilities. What if you had to write 2 digits? For decimal, you’d have 10 * 10 possibilities (This essentially means that you can write any number from 00 to 99). For binary, you’d have 2 * 2 = 4 possibilities. And for hexadecimal, you’d have 16 * 16 possibilities.</p><p>Now let’s take this idea further. We have to write 12 hexadecimal digits, how many possibilities do we have? 16¹², essentially. Numerically, 16¹² = (2⁴)¹² = 2⁴⁸.</p><p>What this means is that for a number that we could write with 12 hexadecimal digits, we’d need 48 binary digits to write the same. And that’s where the 48-bit comes from. A bit is a space in computer memory which can be either set to 0 or 1. You need 48 bits to store a MAC address.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=444bd79483c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is UTF-8 encoding? (or how your computer stores emoji)]]></title>
            <link>https://medium.com/@peey/what-is-utf-8-encoding-or-how-your-computer-stores-emoji-d554f14cf1d0?source=rss-71c654f708fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/d554f14cf1d0</guid>
            <category><![CDATA[unicode]]></category>
            <category><![CDATA[emoji]]></category>
            <category><![CDATA[computers]]></category>
            <category><![CDATA[typography]]></category>
            <dc:creator><![CDATA[Peeyush Kushwaha]]></dc:creator>
            <pubDate>Sat, 10 Sep 2016 09:31:52 GMT</pubDate>
            <atom:updated>2016-09-10T09:31:52.660Z</atom:updated>
            <content:encoded><![CDATA[<p>Asked by Naman</p><p>We’ve all been taught that computers know nothing but binary, i.e. the digits 0 and 1. Yet, most computers we use and come across boast beautiful graphics display and and even devices which have primitive displays like calculators have at least text and numeric display.</p><p>But it is still true that using a computer we can only manipulate, store and retrieve 0’s and 1&#39;s.</p><p>This means that we need to encode whatever kind of content we have — be it images, videos, or text — as 0’s and 1’s. And later when we want to view it, we’ll have to retrieve the raw 0’s and 1’s and decode it.</p><p>This means that we’ll have to devise a scheme that says something like, “okay, let’s look at our text, wherever we have an a we’ll save it as 00000 (decimal 0). Wherever we have a b, we’ll store it as 00001 (decimal 1)and so on upto z which we’ll save as 11001 (decimal 25). And let’s use 11010 (decimal 26) for a space character. Now whenever we read this data back, we’ll simply read in the binary digits, group them in group of 5 digits and we’ll convert the group that is 00000 to a, 00001 to b, and so on.”</p><p>If you carefully study the scheme we just devised, you’ll find that using it we can express any combination of letters and spaces with it. It’s a good start. Such a scheme is called a <strong>character encoding</strong> scheme.</p><p>Note that if we wanted to encode not English characters but characters of some other language, we could have done that as well. That’s how the whacky wingdings font used to be implemented, available in early versions of Microsoft office. We’d just have to specify if we’re encoding wingdings, Hindi, or English, and how to decode it, otherwise the encoded data is just a bunch of 0’s and 1’s and we don’t know what it means.</p><p>So we also have some standard character encoding schemes maintained by standards bodies just like we have standards bodies for units in physics and other sciences. ASCII is one such famous standard, another is UTF-8.</p><p>One problem you’ll find is that the scheme that we devised is quite limited in number of characters that it supports. For instance, we don’t have any support for punctuation marks or digits. Also, we don’t provide a way to differentiate between uppercase/capital letters and lowercase letters. This can be solved in many ways. ASCII-8 solves this by using 8-bit encoding, i.e. instead of using 5 binary digits like we did, they use 8 and so we have a provision of encoding 2⁸ = 256 different characters under that scheme.</p><p>256 is good enough to support all the characters on an English keyboard including lowercase, uppercase, punctuation marks and numbers. If we wanted to write in another language, we’d use another scheme.</p><p>What is UTF-8 then? It’s another character encoding scheme. But it is flexible in the number of 8-bit groups used for encoding a character. So for encoding the regular ASCII characters, we use 1 8-bit group each. For encoding mandarin, the Chinese alphabet which has 3000 characters, uses around 3 bytes or 3 8-bit groupings.</p><p>The UTF-8 character encoding standard, managed by The Unicode Consortium, aims to use one encoding scheme for all languages used by the world. And all of it within the same encoding scheme, allowing us to have an intermix of different languages in the same document. This means that we could have a document which has an intermix of characters and symbols used by English, Hindi, Mandarin, and all the other languages in the world. Including <a href="http://unicode.org/emoji/charts/full-emoji-list.html">emoji</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d554f14cf1d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is the “inconsistent use of tabs and spaces in indentation” error and why is it caused?]]></title>
            <link>https://medium.com/@peey/what-is-the-inconsistent-use-of-tabs-and-spaces-in-indentation-error-and-why-is-it-caused-f3bbb8b2568b?source=rss-71c654f708fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3bbb8b2568b</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Peeyush Kushwaha]]></dc:creator>
            <pubDate>Wed, 31 Aug 2016 11:16:34 GMT</pubDate>
            <atom:updated>2016-08-31T11:16:34.255Z</atom:updated>
            <content:encoded><![CDATA[<p>Asked by Satyam<a href="#footnotes">[1]</a></p><p>Tabs and spaces are two different characters which are rendered as whitespace on screen. The problem is that there is no agreement on how wide a tab character must be, so some editors show it as occupying as much space as 8 spaces, some show it as occupying width of 4 and some 2, and it’s also configurable.</p><p>When you indent in python, python just expects that indentation in first line should be the same as indentation in rest of the lines, be it 4 spaces, 1 space, 1 tab, or whatever.</p><p>So when you code and one line is indented with a tab and another with spaces, python gives error, despite the fact that visually in the editor it looks fine (but it won’t look fine anymore if you change the width of a tab and double it, now it will look like the tab lines are indented two levels).</p><p>Hence it is suggested that you use either only tabs or spaces. Though it’s not really possible to do this when editing someone else’s code because we don’t know what they’ve used.</p><p>One way to combat this error is to go to the settings of your text editor and enable the “convert tabs to spaces” feature which automatically replaces the tab character with n space characters, n being the tab width your editor uses.</p><p>In the python IDLE editor, you may use <a href="http://stackoverflow.com/a/16547854/1412255">Edit &gt; Untabify Region</a> to convert any tabs to spaces.</p><h4>Footnotes</h4><p>1: The question was asked in a forum. I’ve copied the answer that I gave there into this post with minor edits.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3bbb8b2568b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why is the storage of a pen drive less than the advertised storage?]]></title>
            <link>https://medium.com/@peey/why-is-the-storage-of-a-pen-drive-less-than-the-advertised-storage-c0031cd6e6d8?source=rss-71c654f708fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0031cd6e6d8</guid>
            <category><![CDATA[computers]]></category>
            <category><![CDATA[storage]]></category>
            <category><![CDATA[hardware]]></category>
            <dc:creator><![CDATA[Peeyush Kushwaha]]></dc:creator>
            <pubDate>Tue, 30 Aug 2016 20:34:40 GMT</pubDate>
            <atom:updated>2016-08-30T20:34:40.280Z</atom:updated>
            <content:encoded><![CDATA[<p>Asked by Shivam</p><p>Storage device manufacturers usually assume 1 kilobyte to equal 1000 bytes, 1 megabyte to equal 1000 kb, and so on. On the other hand, windows assumes 1 kilobyte to mean 1024 bytes, and 1024 kb to mean 1 megabyte, and so on.</p><p>Calculations would show that a pen drive advertised as 16 GB by the manufacturer are equal to 16*10⁹ bytes, which is 16 * 10⁹ / 2³⁰ = 14.9 GB in windows, which is pretty accurate based on what you experimentally observe.</p><p>Another reason for which the “effective space” of a storage device gets reduced is because some space needs to be reserved for the file table, which is the information about which file is stored at which address on the drive.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0031cd6e6d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to make a file executable in linux?]]></title>
            <link>https://medium.com/@peey/how-to-make-a-file-executable-in-linux-99f2070306b5?source=rss-71c654f708fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/99f2070306b5</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[shell]]></category>
            <category><![CDATA[terminal]]></category>
            <dc:creator><![CDATA[Peeyush Kushwaha]]></dc:creator>
            <pubDate>Tue, 30 Aug 2016 20:32:56 GMT</pubDate>
            <atom:updated>2016-08-30T20:32:56.893Z</atom:updated>
            <content:encoded><![CDATA[<p>Asked by Satyam</p><p>To give a little more context, I think that this question stems from the distinction between executable and non executable files on windows, characterized by the .exe extension.</p><p>In linux, every file <em>can</em> be an executable.</p><p>Let’s see what happens when you try to execute a file. First, we need to have a file. We can use the echo command and redirect its output to create a new file.</p><pre>&gt; echo &#39;#!/bin/bash&#39; &gt; hello<br>&gt; echo &#39;echo hi&#39; &gt;&gt; hello<br>&gt; cat hello<br>#!/bin/bash<br>echo hi</pre><p>Note the lack of extension in the filename. We could have named it hello.txt, or hello.sh, it’s entirely upto us, the extension mostly doesn’t matter. Unlike windows, you don’t need a special extension to make a file executable.</p><p>Now, we’ll execute the file.</p><pre>&gt; chmod +x hello<br>&gt; ./hello<br>hi</pre><p>Let’s go over what happened.</p><p>To execute a file all we need to do is enter the path of the file on the command prompt. We’ll also need execute permissions on the file, like to read a file we’d need read permissions. Note that setting or removing the execute permissions does not make a file executable or non-executable, but it just takes away or gives us the ability to execute it.</p><p>What exactly happens when we ‘execute’ a file is that the contents of the file are sent to the program located on the first line. In this case, it’s /bin/bash. <br> This means that all contents of the file are being sent to bash. So it’s as if you were typing those commands into the shell. Therefore, in the file we’ve created it ran the echo command.</p><p>Please note that there’s nothing special with ./, it just simply means ‘look for the file in the current directory’. It could have been any path, for example</p><pre>&gt; mkdir subdir<br>&gt; mv hello subdir<br>&gt; ./subdir/hello<br>hi</pre><p>And you could also have some other program handle the execution. For example, consider the following file in which I’ve set the first line to be the location of python binary, which I found via the command whereis python. It may be different on your system.</p><pre>&gt; cat hello<br>#!/usr/bin/python<br>print &quot;hello from python!&quot;<br>&gt; ./hello<br>hello from python!</pre><p>You could also set a .doc file’s permissions as executable, or a .jpg file. It’s perfectly legal. But when you try to execute those, their contents will be sent to shell to be parsed as shell commands. But they aren’t shell commands, so you’ll get an error.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99f2070306b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Does disk defragmentation free up space?]]></title>
            <link>https://medium.com/@peey/does-disk-defragmentation-free-up-space-b20a9508efe4?source=rss-71c654f708fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/b20a9508efe4</guid>
            <category><![CDATA[sysadmin]]></category>
            <category><![CDATA[computers]]></category>
            <category><![CDATA[storage]]></category>
            <dc:creator><![CDATA[Peeyush Kushwaha]]></dc:creator>
            <pubDate>Tue, 30 Aug 2016 20:28:39 GMT</pubDate>
            <atom:updated>2016-08-30T20:28:39.553Z</atom:updated>
            <content:encoded><![CDATA[<p>Asked by Ashwat</p><p>No.</p><p>We’ll have to understand what disk defragmentation is in order to understand why it doesn’t free up space.</p><p>Let’s assume that your the free space and occupied space on your disk looks like the following</p><pre>      &lt;- occupied block -&gt;         &lt;-- free block --&gt;<br>...---++++++++++++++++++++-----++++------------------+++++++---...</pre><pre>legend: - denotes free space on disk, + denotes occupied space</pre><p>Now let’s say that we want to store a file on that disk. In order to not waste space on disk, we can’t leave the free blocks between the occupied blocks out of consideration.</p><p>Let’s consider the following strategy. We’ll scan the disk, check out the sizes of the first free block that’s available, and store a part of the file on that block. Then we’ll scan for the next free block and store another part of the same file on that block, and so on until we’ve stored the whole file. This strategy of storing the file on disk results in what is called “fragmentation” of the file.</p><p>All files that you create on/copy to your system are fragmented and stored in a similar manner. When you run the disk defragmentation utility, what it does is it scans the whole disk and tries “organize” the different fragments of different files and move the fragments so that they’re stored on <a href="http://stackoverflow.com/a/4059370">contiguous</a> memory locations.</p><p>So to answer the original question, since we’re just moving data from one place to another, there’s no freeing up of space. All defragmentation does is make the file reads from the storage drive sequential and hence faster.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b20a9508efe4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>