<?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"><channel><title><![CDATA[Manjula Dube's Blog]]></title><description><![CDATA[This Blog explores tech, accessibility, empathy-driven development, JavaScript, web development, and engineering leadership, offering insights for building incl]]></description><link>https://blogs.manjuladube.com</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 02:59:03 GMT</lastBuildDate><atom:link href="https://blogs.manjuladube.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Scaling your product: Vertical vs. Horizontal – What’s the Difference? 🚀]]></title><description><![CDATA[1️⃣ Vertical Scaling (Scale Up)Vertical scaling means upgrading your existing servers to make them more powerful by adding resources like:🔹 More CPU cores to handle intensive tasks.🔹 Increased RAM for managing more users or larger workloads.🔹 Expa...]]></description><link>https://blogs.manjuladube.com/scaling-your-product-vertical-vs-horizontal-whats-the-difference</link><guid isPermaLink="true">https://blogs.manjuladube.com/scaling-your-product-vertical-vs-horizontal-whats-the-difference</guid><category><![CDATA[scaling software]]></category><category><![CDATA[System Design]]></category><category><![CDATA[scaling]]></category><dc:creator><![CDATA[manjula dube]]></dc:creator><pubDate>Fri, 17 Jan 2025 18:37:23 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1737139010338/13afc1a1-d7c8-4ce5-90d7-456ba637719f.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>1️⃣ <strong>Vertical Scaling (Scale Up)</strong><br />Vertical scaling means upgrading your existing servers to make them more powerful by adding resources like:<br />🔹 More CPU cores to handle intensive tasks.<br />🔹 Increased RAM for managing more users or larger workloads.<br />🔹 Expanded storage to accommodate growing data.  </p>
<p><em>Key Advantages:<br />✅ Simple implementation – no need to manage multiple servers.<br />✅ Ideal for applications with a centralized architecture.</em>  </p>
<p><strong>2️⃣ Horizontal Scaling (Scale Out)</strong><br />Horizontal scaling involves adding more servers to your system, distributing the load across multiple machines.  </p>
<p>Think of it like this: Instead of upgrading one machine, you’re adding more team members to share the work.  </p>
<p><em>Key Advantages:<br />✅ Greater scalability – add as many servers as needed.<br />✅ Redundancy – if one server fails, others keep things running.</em></p>
<h2 id="heading-vertical-scaling-is-ideal-for-low-traffic-scenarios-due-to-its-simplicity-but-it-has-significant-limitations">Vertical scaling is ideal for low-traffic scenarios due to its simplicity, but it has significant limitations:</h2>
<ul>
<li><p><strong>Hard Limits</strong>: You can’t add unlimited CPU or memory to a single server.</p>
</li>
<li><p><strong>No Redundancy</strong>: If the server fails, the app or website goes offline entirely.</p>
</li>
</ul>
<p>For large-scale applications, <strong>horizontal scaling</strong> is often a better choice. It distributes the load across multiple servers and ensures redundancy.</p>
<p>In traditional setups, users connect directly to a single server. If the server goes offline or reaches its load limit, users experience delays or lose access. To address this, a <strong>load balancer</strong> can distribute traffic efficiently, improving reliability and performance.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding Deep and Shallow Copy in Javascript]]></title><description><![CDATA[Shallow copy
Shallow copy is a bit-wise copy of an object. A new object is created that has an exact copy of the values in the original object. If any of the fields of the object are references to other objects, just the reference addresses are copie...]]></description><link>https://blogs.manjuladube.com/understanding-deep-and-shallow-copy-in-javascript</link><guid isPermaLink="true">https://blogs.manjuladube.com/understanding-deep-and-shallow-copy-in-javascript</guid><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[manjula dube]]></dc:creator><pubDate>Sun, 28 Feb 2021 11:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1736262913012/4e5d774d-e97a-41a8-8502-adb6fee7ca74.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<h3 id="heading-shallow-copy">Shallow copy</h3>
<p>Shallow copy is a bit-wise copy of an object. A new object is created that has an exact copy of the values in the original object. If any of the fields of the object are references to other objects, just the reference addresses are copied i.e., only the memory address is copied.</p>
<h3 id="heading-deep-copy">Deep copy</h3>
<p>A deep copy copies all fields, and makes copies of dynamically allocated memory pointed to by the fields. A deep copy occurs when an object is copied along with the objects to which it refers.</p>
<h2 id="heading-lets-take-an-example">Lets take an example</h2>
<p>Shallow Copy: It makes a copy of the reference to X into Y. Think about it as a copy of X’s Address. So, the addresses of X and Y will be the same i.e. they will be pointing to the same memory location.</p>
<p>Deep copy: It makes a copy of all the members of X, allocates different memory location for Y and then assigns the copied members to Y to achieve deep copy. In this way, if X vanishes Y is still valid in the memory.</p>
<p>The correct term to use would be cloning, where you know that they both are totally the same, but yet different (i.e. stored as two different locations in the memory space).</p>
<p>Consider this example:</p>
<p>var employeeDetailsOriginal = { name: 'Manjula', age: 25, Profession: 'Software Engineer' };</p>
<p>Let’s say you want to create a duplicate of this, so that even if you change the original values, you can always return to the original.</p>
<p>I can do this:</p>
<p>var employeeDetailsDuplicate = employeeDetailsOriginal; //Shallow copy!</p>
<p>If we change a value:</p>
<p><a target="_blank" href="http://employeeDetailsDuplicate.name">employeeDetailsDuplicate.name</a> = 'NameChanged';</p>
<p>This statement will also change name from employeeDetailsOriginal, since we have a shallow copy, or a reference to var employeeDetailsOriginal. This means, you’re losing the original data as well.</p>
<p>But, creating a brand new variable by using the properties from the original employeeDetailsOriginal variable, you can create a deep copy.</p>
<p>var employeeDetailsDuplicate = { name: <a target="_blank" href="http://employeeDetailsOriginal.name">employeeDetailsOriginal.name</a>, age: employeeDetailsOriginal.age, Profession: employeeDetailsOriginal.Profession}; //Deep copy!</p>
<p>Now if you change <a target="_blank" href="http://employeeDetailsDuplicate.name">employeeDetailsDuplicate.name</a>, it will only affect employeeDetailsDuplicate and not employeeDetailsOriginal</p>
<p>Diagramatic example</p>
<p><img src="https://cdn-images-1.medium.com/max/2000/0*RGt-o4ovYiIt_9nS." alt /></p>
<h2 id="heading-so-how-to-copy-javascript-object-to-new-variable-not-by-reference">So How to copy JavaScript object to new variable NOT by reference?</h2>
<p>Your only option is to somehow clone the object. For simple JSON objects, the simplest way would be:</p>
<pre><code class="lang-javascript">        <span class="hljs-keyword">var</span> objectIsNew = <span class="hljs-built_in">JSON</span>.parse(<span class="hljs-built_in">JSON</span>.stringify(objectIsOld));
        <span class="hljs-comment">//if you use jQuery, you can use:</span>

        In Jquery you can use:

        <span class="hljs-comment">// Shallow copy</span>
        <span class="hljs-keyword">var</span> objectIsNew = jQuery.extend({}, objectIsOld);

        <span class="hljs-comment">// Deep copy</span>
        <span class="hljs-keyword">var</span> objectIsNew = jQuery.extend(<span class="hljs-literal">true</span>, {}, objectIsOld);
</code></pre>
<p>Pure javascript method to deep clone object</p>
<pre><code class="lang-javascript">    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">keepCloning</span>(<span class="hljs-params">objectpassed</span>) </span>{
      <span class="hljs-keyword">if</span> (objectpassed === <span class="hljs-literal">null</span> || <span class="hljs-keyword">typeof</span> objectpassed !== <span class="hljs-string">'object'</span>) {
         <span class="hljs-keyword">return</span> objectpassed;
      }

    <span class="hljs-comment">// give temporary-storage the original obj's constructor</span>
    <span class="hljs-keyword">var</span> temporary-storage = objectpassed.constructor(); 
      <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> key <span class="hljs-keyword">in</span> objectpassed) {
        temporary-storage[key] = keepCloning(objectpassed[key]);
      }

      <span class="hljs-keyword">return</span> temporary-storage;
    }

    <span class="hljs-keyword">var</span> employeeDetailsOriginal = {  <span class="hljs-attr">name</span>: <span class="hljs-string">'Manjula'</span>, <span class="hljs-attr">age</span>: <span class="hljs-number">25</span>, <span class="hljs-attr">Profession</span>: <span class="hljs-string">'Software Engineer'</span> };

    <span class="hljs-keyword">var</span> employeeDetailsDuplicate = (keepCloning(employeeDetailsOriginal));
    employeeDetailsOriginal.name = <span class="hljs-string">"NameChanged"</span>;

    <span class="hljs-built_in">console</span>.log(employeeDetailsOriginal);
    <span class="hljs-built_in">console</span>.log(employeeDetailsDuplicate);
</code></pre>
]]></content:encoded></item><item><title><![CDATA[Top 10 things to know about web accessibility as a Developer in 2020]]></title><description><![CDATA[What is web accessibility ?
Before we dive into what web accessibility is, we should first understand what the word ‘Accessibility’ entails.From my knowledge, “Accessibility means the ability of everyone regardless of their condition to have access t...]]></description><link>https://blogs.manjuladube.com/top-10-things-to-know-about-web-accessibility-as-a-developer-in-2020</link><guid isPermaLink="true">https://blogs.manjuladube.com/top-10-things-to-know-about-web-accessibility-as-a-developer-in-2020</guid><category><![CDATA[Web Development]]></category><category><![CDATA[Web Accessibility]]></category><dc:creator><![CDATA[manjula dube]]></dc:creator><pubDate>Thu, 31 Dec 2020 11:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1736263088814/a490289d-604e-4fb1-8441-3adcaff93285.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-is-web-accessibility">What is web accessibility ?</h2>
<p>Before we dive into what web accessibility is, we should first understand what the word ‘Accessibility’ entails.From my knowledge, “Accessibility means the ability of everyone regardless of their condition to have access to something (e.g internet, transport system).” It's not a switch that can be turned on and off. We need to write semantic HTML right from the start.</p>
<h3 id="heading-1-add-alt-text-to-all-images">1. Add Alt Text to All Images</h3>
<p>Adding alternative text for images is the first principle of web accessibility.This text acts as a replacement for the image if it fails to load. Adding alternative text to the image helps the users who use screen readers. The screen readers will read the alt text and provide the information to the non sighted users.</p>
<p>Alt text should answer this question: What is the content conveyed by the image?</p>
<p><strong>Note:</strong> If the image is purely decorative or if it creates redundancy because the surrounding context already explains the content. Then adding an empty attribute will make screen readers skip it. If you don’t write any alt text, some screen readers will read the file name to the individual. That’s the worst experience you can provide.</p>
<h3 id="heading-2-forms-should-be-accessible">2. Forms should be accessible</h3>
<p>Although building forms can be a difficult task at times, making them moderately accessible isn’t as complicated as you might think. Filling forms on websites and apps for people with disabilities and even for people without disabilities should always be with ease.</p>
<ul>
<li>The first rule to create a truly accessible form is to use native HTML form controls.</li>
</ul>
<pre><code class="lang-javascript">
&lt;input type=<span class="hljs-string">"text"</span>&gt;

&lt;input type="radio"&gt;

&lt;input type="checkbox"&gt;

&lt;button&gt;Submit&lt;/button&gt;
</code></pre>
<p>Since we use the native HTML controls, the name, role, and state of the elements are exposed by default to all assistive technologies. But if you using div's to build custom elements, make sure you do not forget to add ARIA attributes like aria-label, aria-checked, role= “radio” etc.</p>
<ul>
<li>Make sure to use Explicit label wherever possible. 👇</li>
</ul>
<pre><code class="lang-javascript">
&lt;label <span class="hljs-keyword">for</span>=<span class="hljs-string">"fname"</span>&gt;First Name:&lt;/label&gt; 
&lt;input type="text" name="fname" id="fname"&gt;&lt;br&gt;
&lt;label for="lname"&gt;Last Name:&lt;/label&gt; 
&lt;input type="text" name="lname" id="lname"&gt;
</code></pre>
<p>If explicit label is not being used make sure to provide every form control a label using aria-label, aria-labelledby.</p>
<p>For more information read <a class="post-section-overview" href="#https://act-rules.github.io/rules/2ee8b8">visible label</a></p>
<h3 id="heading-3-ensure-all-interactive-features-are-keyboard-accessible">3. Ensure all interactive features are keyboard-accessible</h3>
<p>The most important goal of keyboard accessibility is to make every interactive element, such as links and form controls, available with the Tab key. This is how keyboard-only users navigate through a web page. Testing your website for keyboard accessibility is actually pretty easy: just press the Tab key and navigate from the top of the page to the bottom, highlighting active elements as you go.</p>
<p><em>People who are blind need full keyboard access. Period.</em> — David Macdonald, co-editor of Using WAI ARIA in HTML5</p>
<p><strong>Common Keys Used in Keyboard Operation of Web Pages and Web-based Applications</strong></p>
<p>Tab – move to the next link, form element or button. Shift+Tab – move to the previous link, form element, or button. Enter – activate the current link or button. Space – check or uncheck a checkbox form element. Will also activate a button that currently has focus. Up/Down arrow keys – move between radio buttons or, in some cases, menu links. Right/Left arrow keys – in some cases, move between menu links or adjust sliders in audio and video plugins. Escape – Close the current modal dialog or dropdown menu and return focus to the element that spawned it.</p>
<p><em>If you are interested in reading tips on how to improve your keyboard navigation. Read</em> <a class="post-section-overview" href="#https://www.a11ywithlindsey.com/blog/3-simple-tips-improve-keyboard-accessibility"><em>here</em></a></p>
<h3 id="heading-4-design-usable-focus-states">4. Design usable focus states</h3>
<p><img src="https://thepracticaldev.s3.amazonaws.com/i/erwmmx2jh4yplhdi5kmz.png" alt /></p>
<p>Have you noticed the blue outlines that sometimes show up around links, inputs, and buttons? These outlines are called focus indicators.</p>
<p>Browsers, by default, use a CSS pseudo class to show these outlines on elements when they’re selected. Your designers might find these default focus indicators not very pretty and be tempted just to hide or remove them. However, if you get rid of this default style, be sure to replace it with something else.</p>
<p>Focus indicators help people know which element has the keyboard focus and help them understand where they are when navigating your site.</p>
<h3 id="heading-5-use-correct-markup-on-your-content">5. Use correct markup on your content</h3>
<p>When writing semantic markup, we use HTML tags to tell browsers something about the contents of the element. In semantic markup, tags are no longer just a way to get content to show up on a web page in a human-readable format.</p>
<p>The tags themselves become a way to tell a machine (whether a browser, a computer, a smartphone, or another smart device) something about the meaning of the content.</p>
<p>Headings mark where the content starts — they’re tags given to text to define its style and purpose. Headings also establish the hierarchy of the content of the page.</p>
<p>Titles with big font sizes help a reader understand the order of the content better. Likewise, screen readers also use heading tags to read content. This way, people with low-vision get an overview of the page by reading each heading in a hierarchal flow.</p>
<p>It’s important to use proper structural elements when you develop a site. HTML elements communicate to the browser what kind of content they contain and how the browser should render or treat that content. The components and structure of a page are what arranges an accessibility tree. This tree is what powers screen readers which are used by people who are blind so they can “listen” to a page.</p>
<p>*Not using markup correctly affects accessibility. Don’t use HTML tags for a style effect only. Screen readers navigate web pages by heading structure (true headers, not just text that is styled big and bold) hierarchically. The people that use your site can listen to a list of all of the headings, jump the content by types of titles, or navigate directly to top-level headings</p>
<h3 id="heading-6-do-not-use-disabled-attributes-on-buttons">6. Do not use disabled attributes on buttons</h3>
<p>If you use disabled attributes on button it removes it from the accessibility tree and therefore the screen readers will never know if the exists on the page.</p>
<p>To solve the above problem make sure you style the button visually to make it look disabled and can use <code>pointer-events: none</code> to prevent the clicking on button.</p>
<p>But how do I make sure when the screen readers users use the web page they should understand that the button is disabled.</p>
<p>The solution to your problem 🤘 is using <code>aria-disabled</code> attribute</p>
<pre><code class="lang-javascript">
&lt;button id=<span class="hljs-string">"target"</span> aria-disabled=<span class="hljs-string">"true"</span>&gt;target&lt;/button&gt;
</code></pre>
<h3 id="heading-7-use-display-none-css-property-or-hidden-attribute-carefully">7. Use <code>display: none</code> CSS property or <code>hidden</code> attribute carefully.</h3>
<p>Often there might be a situation that you might want to hide something on some click of the button or link. In this case do remember if you use <code>display: none</code> or <code>hidden</code>, it will also be removed from the accessibility tree. Setting <code>display: none</code> hides the content but also removes it from the accessibility tree so screen readers won’t read it.</p>
<p>There might be situation when you might want to display something only for the screen reader users and want the content to be visually hidden. How will you handle this ?</p>
<p>There's great solution 👇 to hide content visually while keeping it in the accessibility tree for screen readers:</p>
<pre><code class="lang-javascript">
.sr-only {
  <span class="hljs-attr">border</span>: <span class="hljs-number">0</span>; 
  clip: rect(<span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span>); 
  height: <span class="hljs-number">1</span>px; 
  margin: <span class="hljs-number">-1</span>px;
  overflow: hidden;
  padding: <span class="hljs-number">0</span>;
  position: absolute;
  width: <span class="hljs-number">1</span>px;
}
</code></pre>
<h4 id="heading-hiding-content-for-screen-readers">Hiding Content for Screen Readers</h4>
<p>Some content is not important for understanding a web page, but is added to make the design more visually appealing. For example, icons and glyphs can provide a nice visual polish, but tend to be unhelpful — and sometimes downright distracting — for screen reader users. In this scenario we’ll want to hide the content from screen readers while showing it to everyone else.</p>
<p>In this case we’ll use the aria-hidden attribute. aria-hidden is a boolean attribute so it can be set to true or false. Setting the attribute to false is the same as not including it at all, so you’ll generally want to set it to true and use it like this:</p>
<pre><code class="lang-javascript">
&lt;div <span class="hljs-class"><span class="hljs-keyword">class</span></span>=<span class="hljs-string">"my-glyph"</span> aria-hidden=<span class="hljs-string">"true"</span>&gt;&lt;/div&gt;
</code></pre>
<h3 id="heading-8-visual-order-amp-dom-order-should-always-match">8. Visual Order &amp; Dom Order should always match</h3>
<p>Implementing a logical tab order is an important part of providing your users with a smooth keyboard navigation experience. Screen readers and other assistive technologies navigate the page in DOM order. The flow of information should make sense.</p>
<p>Lets see an example</p>
<pre><code class="lang-javascript">
&lt;ol&gt;
  <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span>Basket Ball<span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span></span>
  <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span>Foot Ball<span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span></span>
  <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span>Throw Ball<span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span></span>
&lt;/ol&gt;
</code></pre>
<p>That HTML ends up in the DOM that way (and thus how it is is exposed to assistive technology), and by default, those list items are also visually shown in that order. In most layout situations, the visual order will match that DOM order. Do nothing, and the list items will flow in the block direction of the document. Apply flexbox, and it will flow in the inline direction of the document.</p>
<p>But flexbox and grid also allow you to muck it up. Now take this:</p>
<pre><code class="lang-javascript">
ol { 
  <span class="hljs-attr">display</span>: flex;
  flex-direction: row-reverse;
}
</code></pre>
<p>In the above case, the DOM order still makes sense, but the visual order is all wrong.When you use the tab key to move through the content, there is a disconnect between the visual order and the keyboard navigation (DOM) order. In this simple example it is still although it wrong, but in a situation where <code>flex-box</code> is used to layout a complex interface it could make things horrible &amp; unusable for the users using assistive technologies.</p>
<p><em>Solution is providing</em> <code>tabindex</code>to the element so the visual and dom order matches</p>
<p>But the problem is that tabindex is scoped to the document. If the above code were included in a page, it would completely hijack the tab order. The three items with tabindex would be the first three things on the page to receive keyboard focus, irrespective of their overall location in the DOM structure.</p>
<p>To read more check out this awesome <a class="post-section-overview" href="#https://tink.uk/flexbox-the-keyboard-navigation-disconnect/">article</a></p>
<h3 id="heading-9-use-color-with-care">9. Use color with care.</h3>
<p>The color contrast between background and foreground content (that is, usually text) should be great enough to ensure legibility.</p>
<p>There are several tools you can use to evaluate color contrast, which will assist you in making your page as visually usable as possible to individuals with low vision or varying levels of color blindness.</p>
<h3 id="heading-10-make-dynamic-content-accessible">10. Make dynamic content accessible.</h3>
<p>When web page content updates dynamically (i.e. without a page refresh), screen readers may not be aware of whats happening on the page. This includes screen overlays, in-page updates, popups, and modal dialogs.</p>
<p><strong>Problems:</strong> Keyboard-only users may be trapped in page overlays. Magnification software users might be zoomed in on the wrong section of the page.</p>
<p><strong>Solution</strong></p>
<p>These functions can easily be made accessible. Options include ARIA roles and alerts.</p>
<p>Ensure that video players do not auto-play (non-consensual sound), and that the players can be used with a keyboard. Additionally, all videos must have options for closed captioning and transcripts for the hearing-impaired.</p>
<p>If your site contains a slideshow, make sure that each photo has alt text and can be navigated via the keyboard. If you are using any unique widgets (such as a calendar picker or drag-and-drops), be sure to test for accessibility.</p>
<p>This is one of the great <a class="post-section-overview" href="#https://www.smashingmagazine.com/2018/07/web-with-just-a-keyboard/">article</a> I found on internet which I recommend</p>
<p>Reading resources 📚</p>
<p><a class="post-section-overview" href="#https://webaim.org/">WebAIM</a> Articles, resources, and training on web accessibility. <a target="_blank" href="https://alistapart.com/article/color-accessibility-workflows/">Color Accessibility Workflows</a>: Some neat examples to nail the colors in your design by Geri Coady.</p>
<h3 id="heading-useful-tools">Useful tools</h3>
<p><a class="post-section-overview" href="#https://webaim.org/resources/contrastchecker/">WebAIM Color Contrast Checker</a>: Great contrast color checker that gives you results in real time for regular and large text. <a class="post-section-overview" href="#https://inclusive-components.design/">Inclusive Components</a>: A pattern library in the form of a blog, with a focus on inclusive design. Each post explores a common interface component and comes up with a better, more robust and accessible version of it. <a class="post-section-overview" href="#http://colororacle.org/">Color Oracle</a>: A free color blindness simulator for Windows, Mac, and Linux. It shows you in real time what people with common color vision impairments see. <a class="post-section-overview" href="#http://accessibility.voxmedia.com/">Vox Product Accessibility Guidelines</a>: A comprehensive checklist for designers, engineers, and project managers. <a class="post-section-overview" href="#https://chrome.google.com/webstore/detail/axe-coconut-web-accessibi/iobddmbdndbbbfjopjdgadphaoihpojp?hl=en">AXE Google Chrome Extension</a>: Test any site for accessibility violations using the Chrome inspector. <a class="post-section-overview" href="#https://usecontrast.com/">Contrast</a>: A macOS app for quick access to WCAG color contrast ratios.</p>
<p>Develop responsibly. Thank you.</p>
]]></content:encoded></item><item><title><![CDATA[Hash Table Implementation]]></title><description><![CDATA[To implement a hash table, we create a class.

class HashTable {
  constructor() {
    this.values = {};
    this.length =  0;
    this.size =  0;
  }
}

The constructor contains an object in which we’re going to store the values, the length of the v...]]></description><link>https://blogs.manjuladube.com/hash-table-implementation</link><guid isPermaLink="true">https://blogs.manjuladube.com/hash-table-implementation</guid><category><![CDATA[data structures]]></category><dc:creator><![CDATA[manjula dube]]></dc:creator><pubDate>Thu, 10 Dec 2020 11:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1736263223015/b65c3995-2dbe-452b-9825-29a75b340159.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>To implement a hash table, we create a class.</p>
<pre><code class="lang-javascript">
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">HashTable</span> </span>{
  <span class="hljs-keyword">constructor</span>() {
    <span class="hljs-built_in">this</span>.values = {};
    <span class="hljs-built_in">this</span>.length =  <span class="hljs-number">0</span>;
    <span class="hljs-built_in">this</span>.size =  <span class="hljs-number">0</span>;
  }
}
</code></pre>
<p>The constructor contains an object in which we’re going to store the values, the length of the values, and the entire size of the hash table: meaning how many buckets the hash table contains. Somewhere in these buckets, we can store our data.</p>
<p>Next, before we can do anything else, we need to implement our hashing function. One example of a hashing function:</p>
<pre><code class="lang-javascript">
calculateHash(key) {
  <span class="hljs-keyword">return</span> key.toString().length % <span class="hljs-built_in">this</span>.size;
}
</code></pre>
<p>Let’s say we have the string “Hello” and we create a hash table with the size of 10. “Hello” has the size of 5, so 5 % 10 becomes 5! The string “Hello” is now stored in the bucket with hash 5. If later on, we want to see where the key/value pair with the key “Hello” has been stored, it would return the same hash as the length of “Hello” hasn’t changed, and neither has the size of the hash table!</p>
<pre><code class="lang-javascript">
add(key, value) {
   <span class="hljs-keyword">const</span> hash = <span class="hljs-built_in">this</span>.calculateHash(key);
   <span class="hljs-keyword">if</span> (!<span class="hljs-built_in">this</span>.values.hasOwnProperty(hash)) {
      <span class="hljs-built_in">this</span>.values[hash] = {};
   }
   <span class="hljs-keyword">if</span> (!<span class="hljs-built_in">this</span>.values[hash].hasOwnProperty(key)) {
      <span class="hljs-built_in">this</span>.length++;
   }
   <span class="hljs-built_in">this</span>.values[hash][key] = value;
}
</code></pre>
<p>To add a key/value pair, we first need to calculate the hash with the key provided. If this hash is brand new (meaning that no other key/value pair used it yet and it’s not in the values object), we initialize an empty object for that hash. Next, we check whether the hash has a property with the same key name! If that’s not the case, it means we will add a new key/value pair, and the length of the hash table grows. Lastly, we add the key/value pair to the right hash.</p>
<p>Searching in a hash table goes very fast. As with an array we have to go through all of the elements until we find it, with a hash table we simply get the index. This means that its runtime is constant, O(1).</p>
<pre><code class="lang-javascript">
search(key) {
  <span class="hljs-keyword">const</span> hash = <span class="hljs-built_in">this</span>.calculateHash(key);
  <span class="hljs-keyword">if</span> (<span class="hljs-built_in">this</span>.values.hasOwnProperty(hash) &amp;&amp; <span class="hljs-built_in">this</span>.values[hash].hasOwnProperty(key)) {
    <span class="hljs-keyword">return</span> <span class="hljs-built_in">this</span>.values[hash][key];
  } <span class="hljs-keyword">else</span> {
    <span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>;
  }
} 
}

<span class="hljs-comment">//create object of type hash table</span>
<span class="hljs-keyword">const</span> ht = <span class="hljs-keyword">new</span> HashTable();
<span class="hljs-comment">//add data to the hash table ht</span>
ht.add(<span class="hljs-string">"Canada"</span>, <span class="hljs-string">"300"</span>);
ht.add(<span class="hljs-string">"Germany"</span>, <span class="hljs-string">"100"</span>);
ht.add(<span class="hljs-string">"Italy"</span>, <span class="hljs-string">"50"</span>);

<span class="hljs-comment">//search</span>
<span class="hljs-built_in">console</span>.log(ht.search(<span class="hljs-string">"Italy"</span>));
</code></pre>
<p>First, we calculate the hash again. As the length of the string and the size of the hash table haven’t changed, the hash remains the same. Then, we check whether the hash is within the object, and whether that hash points to the key we’re looking for. If that’s the case, return the value that that pair stores, else nothing gets returned.</p>
]]></content:encoded></item><item><title><![CDATA[What is Binary Search ?]]></title><description><![CDATA[Binary Search is searching technique which works on Divide and Conquer approach. It used to search any element in a sorted array.
As compared to linear, binary search is much faster with Time Complexity of O(logN) whereas linear search algorithm work...]]></description><link>https://blogs.manjuladube.com/what-is-binary-search</link><guid isPermaLink="true">https://blogs.manjuladube.com/what-is-binary-search</guid><category><![CDATA[data structures]]></category><dc:creator><![CDATA[manjula dube]]></dc:creator><pubDate>Wed, 25 Nov 2020 11:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1736263405115/6397022a-e322-4f85-ac88-cfae8f441a20.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Binary Search is searching technique which works on Divide and Conquer approach. It used to search any element in a sorted array.</p>
<p>As compared to linear, binary search is much faster with Time Complexity of O(logN) whereas linear search algorithm works in O(N) time complexity.</p>
<h4 id="heading-binary-search-step-by-step-process-breakdown">Binary Search Step-By-Step Process Breakdown:</h4>
<p>In this step-by-step process, we’re going to be breaking down how to do a Binary Search on the below given array.”</p>
<pre><code class="lang-javascript"> <span class="hljs-keyword">const</span> binarySearchArray = [<span class="hljs-number">1</span>, <span class="hljs-number">5</span>, <span class="hljs-number">7</span>, <span class="hljs-number">11</span>, <span class="hljs-number">13</span>, <span class="hljs-number">17</span>, <span class="hljs-number">19</span>, <span class="hljs-number">23</span>, <span class="hljs-number">29</span>, <span class="hljs-number">31</span>, <span class="hljs-number">37</span>, <span class="hljs-number">41</span>, <span class="hljs-number">43</span>, <span class="hljs-number">47</span>, <span class="hljs-number">53</span>, <span class="hljs-number">59</span>, <span class="hljs-number">82</span>, <span class="hljs-number">100</span>, <span class="hljs-number">101</span>]
</code></pre>
<h5 id="heading-target-to-find-59">Target to find: 59</h5>
<ul>
<li><p>We are going to need to keep track of the 3 following things as variables to perform a Binary Search: startIndexPosition, middleIndexPosition, and endIndexPosition.</p>
</li>
<li><p>startIndexPosition will always be 0: <code>let stastartIndexPositionrtIndex = 0</code></p>
</li>
<li><p>endIndexPosition can be calculated using <code>array.length</code></p>
</li>
<li><p>We want to get an inital <code>middleIndexPosition</code> using the <code>startIndexPosition</code> and <code>endIndexPosition</code>, and the divide by 2. We can use <code>Math.floor()</code> to round down or <code>Math.ceil()</code> to round up.</p>
</li>
<li><p>We will use while loop in order to iterate the process</p>
</li>
<li><p>If the <code>middleIndexPosition</code> value is less than the target value of 59, we know that our target value will be somewhere to the right of the middleIndexPosition. We can then assign our startIndexPosition variable as the current middleIndexPosition value, ignoring the left half of the array. We should also increment middleIndexPosition by the count of 1 if our target number “59” &gt; <code>middleIndexPosition</code> “31.”</p>
</li>
<li><p>If the <code>middleIndexPosition</code> value is greater than the target value, 59, we know that our target value will be in to the left of the middleIndexPosition. We can then assign our endIndex variable as the current middleIndex value, ignoring the right half of the array. We should also Decrement middleIndexPosition by the count of 1 if our target number “59” &lt; <code>middleIndexPosition</code> “31.”</p>
</li>
<li><p>If the <code>middleIndexPosition</code> value is equal to the target value of 59, we have found our target number “59.”, target is found :)</p>
</li>
<li><p>Hurray we got it done</p>
</li>
</ul>
<h6 id="heading-binary-search-code">Binary Search Code:</h6>
<pre><code class="lang-javascript">
<span class="hljs-keyword">const</span> binarySearch = <span class="hljs-function">(<span class="hljs-params">array, target</span>) =&gt;</span> {
  <span class="hljs-comment">// Define Start and End Index</span>
  <span class="hljs-keyword">let</span> startIndexPosition = <span class="hljs-number">0</span>;
  <span class="hljs-keyword">let</span> endIndexPosition = array.length - <span class="hljs-number">1</span>;

  <span class="hljs-comment">// While Start Index is less than or equal to End Index</span>
  <span class="hljs-keyword">while</span>(startIndexPosition &lt;= endIndexPosition) {

    <span class="hljs-comment">// Define Middle Index, this will keep changing </span>
    <span class="hljs-keyword">let</span> middleIndexPosition = <span class="hljs-built_in">Math</span>.floor((startIndexPosition + endIndexPosition) / <span class="hljs-number">2</span>);

    <span class="hljs-comment">// Compare Middle Index with Target number</span>
    <span class="hljs-keyword">if</span>(target === array[middleIndexPosition]) {
      <span class="hljs-keyword">return</span> <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Found the target"</span> + middleIndexPosition);
    }

    <span class="hljs-comment">// Search Right Side Of Array</span>
    <span class="hljs-keyword">if</span>(target &gt; array[middleIndexPosition]) {
      <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Searching the right side of Array"</span>)
      <span class="hljs-comment">// Assign Start Index and increase the Index by 1 to narrow search</span>
      startIndexPosition = middleIndexPosition + <span class="hljs-number">1</span>;
    }

    <span class="hljs-comment">// Search Left Side Of Array</span>
    <span class="hljs-keyword">if</span>(target &lt; array[middleIndexPosition]) {
      <span class="hljs-comment">// Assign End Index and increase the Index by 1 to narrow search</span>
      <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Searching the left side of array"</span>)
      endIndexPosition = middleIndexPosition - <span class="hljs-number">1</span>;
    }
  }

  <span class="hljs-comment">// If Target Is Not Found</span>
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Not found sorry"</span>);
}
</code></pre>
]]></content:encoded></item><item><title><![CDATA[Introduction to Hash Table]]></title><description><![CDATA[Hash tables are very efficient. Let’s say that we want to look up a specific person in an array: we would have to walk through every item to look for that person! The space complexity would be O(n), as space depends on the size of the array.
To look ...]]></description><link>https://blogs.manjuladube.com/introduction-to-hash-table</link><guid isPermaLink="true">https://blogs.manjuladube.com/introduction-to-hash-table</guid><category><![CDATA[data structures]]></category><dc:creator><![CDATA[manjula dube]]></dc:creator><pubDate>Wed, 25 Nov 2020 11:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1736263503159/a32f907e-db20-45a5-a6d8-2c9ff21422dd.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hash tables are very efficient. Let’s say that we want to look up a specific person in an array: we would have to walk through every item to look for that person! The space complexity would be O(n), as space depends on the size of the array.</p>
<p>To look things up way more efficiently, you can use hash tables! Hash tables are made up of two parts: an object with the table where the data will be stored, and a hash function (or mapping function). This function creates a mapping by assigning the input data to a very specific index within the array! This function takes a key, and always returns the same index for the same key! If we would run the same key through the function twice, it gives us the same index.</p>
<pre><code class="lang-javascript">{
   <span class="hljs-attr">values</span>: {
      <span class="hljs-number">0</span>: { <span class="hljs-string">"Mara"</span>: <span class="hljs-string">"BN"</span> },
      <span class="hljs-number">1</span>: { <span class="hljs-string">"Sarah"</span>: <span class="hljs-string">"US"</span> },
      <span class="hljs-number">3</span>: { <span class="hljs-string">"Emil"</span>: <span class="hljs-string">"SE"</span> },
      <span class="hljs-number">5</span>: { <span class="hljs-string">"Lydia"</span>: <span class="hljs-string">"NL"</span> },
   },
   <span class="hljs-attr">length</span>: <span class="hljs-number">4</span>,
   <span class="hljs-attr">size</span>: <span class="hljs-number">6</span>,
}
</code></pre>
<p>As the hash function always gives the same hash for every key, we can easily look up key/value pairs. Instead of having to map over an entire object, we just pass the key we want to the hash function, which then returns the index where this key/value pair is stored!</p>
<p>However, sometimes the hash function returns the same index for different keys. This is called collision.</p>
<h3 id="heading-checkout-out-hash-table-implememtation-in-javascriptdata-structures-and-algorithm-in-javascripthash-table-implementation"><a target="_blank" href="../../data-structures-and-algorithm-in-javascript/hash-table-implementation/">Checkout out Hash Table Implememtation in Javascript</a></h3>
]]></content:encoded></item><item><title><![CDATA[Data Structures and Algorithms with Manjula ❤️]]></title><description><![CDATA[Data Strutures and Algorithms is not that difficult to learn once you undertsand them in a right way. I am starting to blog while I learn each concept. Often there are questions Do we actually apply these data structures while day to day work in your...]]></description><link>https://blogs.manjuladube.com/data-structures-and-algorithms-with-manjula</link><guid isPermaLink="true">https://blogs.manjuladube.com/data-structures-and-algorithms-with-manjula</guid><category><![CDATA[data structures]]></category><dc:creator><![CDATA[manjula dube]]></dc:creator><pubDate>Wed, 14 Oct 2020 10:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1737139380199/a84a32bf-fff8-4e47-b8df-aef6b5957674.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Data Strutures and Algorithms is not that difficult to learn once you undertsand them in a right way. I am starting to blog while I learn each concept. Often there are questions Do we actually apply these data structures while day to day work in your company. And the answer is YES!!.</p>
<p>You apply it unknowingly for example if you are working with HTML, it actually has a tree data structure. It is quite a misconception that data structure and algorithm that we learn in our courses or in competitive coding are of no use in a software development job.</p>
<p>Actually, It just depends on how you want to solve your problem. If you want to get it done just for the sake of getting it done, then yes high-level tools are always there. But, If you are working on a specific tool that does the work for you, then you might not be aware of what is happening on the background, if you go deeper then you’ll find out that the tools also the same Data Structures and Algorithms to solve the problem which makes it look so easy to you. If you wish to join me along my learnings join me or reach out to me incase of any questions</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Number</td><td>Title</td><td>Best Time Complexity</td><td>Worst Time Complexity</td><td>Best Search Complexity</td><td>Worst Search Complexity</td></tr>
</thead>
<tbody>
<tr>
<td>1</td><td><a target="_blank" href="./data-structures-and-algorithm-in-javascript/binary-search-in-javascript/">Binary Search</a></td><td>O(1)</td><td>O(log n)</td><td>NA</td><td>NA</td></tr>
<tr>
<td>2</td><td><a target="_blank" href="./data-structures-and-algorithm-in-javascript/hash-table/">Hash Tables in Javascript</a></td><td>NA</td><td>NA</td><td>0(1)</td><td>0(N)</td></tr>
<tr>
<td>3</td><td><a target="_blank" href="./data-structures-and-algorithm-in-javascript/binary-search-tree-in-javascript/">Binary Search Tree(Coming Soon)</a></td><td></td><td></td><td></td><td></td></tr>
<tr>
<td>4</td><td>Sorting Algorithms (Coming Soon)</td><td></td><td></td><td></td><td></td></tr>
<tr>
<td></td><td></td><td></td><td></td><td></td><td></td></tr>
</tbody>
</table>
</div>]]></content:encoded></item><item><title><![CDATA[All about aria-current attribute]]></title><description><![CDATA[The aria-current attribute is used when an element within collections is visually styled to indicate it is the current item in the set. This can be an active tab on the nav bar which visually is shown active, or make be a breadcrumb link which is act...]]></description><link>https://blogs.manjuladube.com/all-about-aria-current-attribute</link><guid isPermaLink="true">https://blogs.manjuladube.com/all-about-aria-current-attribute</guid><category><![CDATA[Web Accessibility]]></category><dc:creator><![CDATA[manjula dube]]></dc:creator><pubDate>Wed, 08 Jul 2020 10:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1737139586223/d7603697-c725-4d31-8d89-0db4e0a49925.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The <code>aria-current</code> attribute is used when an element within collections is visually styled to indicate it is the current item in the set. This can be an active tab on the nav bar which visually is shown active, or make be a breadcrumb link which is active. For some more info on this topic read on <a target="_blank" href="https://www.digitala11y.com/aria-current-state/">digitala11y</a></p>
<ul>
<li><p>In short <code>aria-current</code> is an attribute defined in the <a target="_blank" href="https://www.w3.org/TR/wai-aria-1.1/#aria-current">WAI-ARIA</a> specification. This specification extends native HTML, allowing you to change the way an HTML element is "translated" into the accessibility tree.</p>
</li>
<li><p>It can take multiple values, for example: <strong><em>page, step, location, date, time, false, true</em></strong></p>
</li>
</ul>
<h5 id="heading-according-to-the-aria-11-specification-the-aria-current-attribute-can-be-given-one-of-a-predefined-set-of-values">According to the ARIA 1.1 specification, the <code>aria-current</code> attribute can be given one of a predefined set of values:</h5>
<ul>
<li><p>page - represents the current page within a set of pages.</p>
</li>
<li><p>step - represents the current step within a process.</p>
</li>
<li><p>location - represents the current location within an environment or context.</p>
</li>
<li><p>date - represents the current date within a collection of dates.</p>
</li>
<li><p>time - represents the current time within a set of times.</p>
</li>
<li><p>true - represents the current item within a set.</p>
</li>
<li><p>false - does not represent item within a set.</p>
</li>
</ul>
<h4 id="heading-ok-so-the-concept-goes-like-this">Ok, so the concept goes like this:</h4>
<p>Using <code>aria-current</code> the right way.</p>
<ul>
<li>First we will go through <code>aria-current = page</code></li>
</ul>
<p><em>I am taking an example of my website. Below you see talks section is an active page the user is currently on.</em></p>
<p><img src="https://i.ibb.co/YknwVh8/Screenshot-2020-05-26-at-21-09-13.png" alt /></p>
<pre><code class="lang-javascript">
&lt;a aria-current=<span class="hljs-string">"page"</span> <span class="hljs-class"><span class="hljs-keyword">class</span></span>=<span class="hljs-string">"css-wbxg5e active"</span> href=<span class="hljs-string">"/talks"</span> style=<span class="hljs-string">"font-size: 1em;"</span>&gt;<span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">i</span>&gt;</span>Talks<span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span></span>&lt;/a&gt;
</code></pre>
<p>The active sections <code>talks</code> indicates the current page in the main navigation. While visible to sighted users, it also uses <code>aria-current="page"</code> to convey the information to screen reader users.</p>
<ul>
<li><p><code>aria-current="date"</code> and <code>aria-current="time"</code> are very similar to each other. This can be used when implementing date picker, when we display a list of dates, one being today's date, we should use the `aria-current="date" to mark the current date to screen reader users.</p>
</li>
<li><p><code>aria-current="step"</code> If we need to indicate the current step within a step indicator of a multi-step process (e.g.: wizard form, multi-step checkout, etc), aria-current="step" should be used to indicate the current step to screen reader users.</p>
</li>
</ul>
<p>Some resources to checkout if you interested to learn more on <code>aria-current</code>  <a target="_blank" href="http://a11ysupport.io">a11ysupport.io</a>, <a target="_blank" href="http://tink.uk">tink.uk</a></p>
<p>If you want to know more about ARIA attributes checkout <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA">MDN Docs</a></p>
<p>Thank you for reading. Subscribe to my newsletter for more of this ❤️</p>
]]></content:encoded></item><item><title><![CDATA[Be aware of using unauthenticated javascript on web pages]]></title><description><![CDATA[Often we fetch lot of third party libraries from the cdn in our web app(for example bootstrap,jquery etc).
Have you ever encountered an error ?

So this usually happens when you try to load some third party libraries via cdn and the integrity value d...]]></description><link>https://blogs.manjuladube.com/be-aware-of-using-unauthenticated-javascript-on-web-pages</link><guid isPermaLink="true">https://blogs.manjuladube.com/be-aware-of-using-unauthenticated-javascript-on-web-pages</guid><category><![CDATA[Web Accessibility]]></category><dc:creator><![CDATA[manjula dube]]></dc:creator><pubDate>Tue, 19 May 2020 10:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1737139648055/562a94b1-bc7b-4da0-bbd3-6445c96815fe.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Often we fetch lot of third party libraries from the cdn in our web app(for example <code>bootstrap</code>,<code>jquery</code> etc).</p>
<h5 id="heading-have-you-ever-encountered-an-error">Have you ever encountered an error ?</h5>
<p><img src="https://i.ibb.co/fM7BxhK/subresource-integrity.png" alt /></p>
<p>So this usually happens when you try to load some third party libraries via cdn and the integrity value doesn't match.</p>
<h4 id="heading-what-does-that-mean">~What does that mean~ ??</h4>
<p>For example:</p>
<pre><code class="lang-javascript">&lt;script
  src=<span class="hljs-string">"https://code.jquery.com/jquery-3.5.1.js"</span>
  integrity=<span class="hljs-string">"sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc="</span>
  crossorigin=<span class="hljs-string">"anonymous"</span>&gt;&lt;/script&gt;
</code></pre>
<pre><code class="lang-javascript">&lt;link rel=<span class="hljs-string">"stylesheet"</span> href=<span class="hljs-string">"//something.net/6.26.0/styles/desktop.css"</span>&gt;
</code></pre>
<h4 id="heading-lets-understand-it-bit-better">~Lets understand it bit better~</h4>
<p>The integrity and crossorigin attributes are used for <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity">Subresource Integrity (SRI)</a> checking. This allows browsers to ensure that resources hosted on third-party servers have not been modified in anyway. Use of SRI is recommended as a best-practice, whenever libraries are being loaded from a third-party source. If the script or stylesheet doesn’t match its associated integrity value, the browser would refuse to execute the script or apply the stylesheet and would console and integrity error.</p>
<ul>
<li><p>The integrity attribute is a content verification. It confirms that the content being loaded is the same as what you intended .This also gives you an assurity that fetched resource has been delivered without unexpected manipulation(which could otherwise happen by an attacker)</p>
</li>
<li><p>The fact that it is blocking the load would indicate that it does not match. <em>Did you perhaps change the version but kept the same integrity value?</em> If yes please fix that</p>
</li>
</ul>
<h4 id="heading-what-could-be-the-problem-if-you-dont-fix-it">What could be the problem if you don't fix it ?</h4>
<p>If your script has no integrity attribute, and is third party library, there might be a point that attacker might attack the third party page and change its javascript and css, inorder to obtain some valuable information.</p>
<p><a target="_blank" href="https://shkspr.mobi/blog/2018/11/major-sites-running-unauthenticated-javascript-on-their-payment-pages/">Here's</a> a nice article for more details</p>
<p>If you want to read more about <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity">Subresource Integrity and its importance</a></p>
]]></content:encoded></item><item><title><![CDATA[Using target="_blank" the right way ✅]]></title><description><![CDATA[Recently Working on my side project, I came across and curious fact of target='_blank' attribute used in </a>
What actually happens while you open a link in new window by specifying target='_blank' ?

The page we're linking to gains limited access to...]]></description><link>https://blogs.manjuladube.com/manage-loading-state-while-your-content-loads-in-react</link><guid isPermaLink="true">https://blogs.manjuladube.com/manage-loading-state-while-your-content-loads-in-react</guid><category><![CDATA[Web Security]]></category><dc:creator><![CDATA[manjula dube]]></dc:creator><pubDate>Mon, 11 May 2020 10:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1737139710691/599f9437-f5e3-4fe7-87d5-92ecf674e6ae.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<p>Recently Working on my side project, I came across and curious fact of <code>target='_blank'</code> attribute used in <code>&lt;/a&gt;</code></p>
<h5 id="heading-what-actually-happens-while-you-open-a-link-in-new-window-by-specifying-targetblank">What actually happens while you open a link in new window by specifying <code>target='_blank'</code> ?</h5>
<ul>
<li><p>The page we're linking to gains limited access to the linking page via the <code>window.opener</code> object.</p>
</li>
<li><p>The newly opened page can now change the window.opener.location to some phishing page. In this case, Users trust the page that is already opened, and in this case they won't get suspicious.</p>
</li>
</ul>
<h5 id="heading-lets-try-and-undertsand-it-in-depth">Lets try and undertsand it in depth 🔒</h5>
<p>Create a fake "phishing" page with adorable cat pictures, which everyone likes ❤️, get it shared on Facebook (which will open a link via _blank).</p>
<p>Create a "phishing" website at <a target="_blank" href="https://phishingwebsite/facebook.com/service.html">https://phishingwebsite/facebook.com/service.html</a> and put the below code on your "phishing" page.</p>
<pre><code class="lang-html">
window.opener.location = 'https://phishingwebsite/facebook.com/service.html';
</code></pre>
<p>which will redirect the Facebook tab to your phishing page created by the attacker, asking the user to re-enter their Facebook password, the user is not on Facebook anymore but this fake Facebook-lookalike web page. This fake page looks exactly like Facebook and it asks to login because you were signed out for some reason. The user without even thinking, enters the details.</p>
<h4 id="heading-what-just-happend">What just happend??</h4>
<p>You've just sent your private credentials to someone who can now login in your Facebook account and do anything, like quickly changing the credentials, posting random post.</p>
<h4 id="heading-lets-see-how-we-can-fix-this">Lets see how we can fix this 🔑</h4>
<p>Add rel attribute with <code>noopener</code> value to the <code>&lt;a&gt;</code></p>
<pre><code class="lang-html">
<span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>= <span class="hljs-string">'/share'</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"noopener"</span> <span class="hljs-attr">target</span>=<span class="hljs-string">"_blank"</span>/&gt;</span>
</code></pre>
<p>Some old browsers for example (IE11) do not support <code>"noopener"</code> so add <code>noreferrer</code> as a value to rel</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>= <span class="hljs-string">'/share'</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"noopener noreferrer"</span> <span class="hljs-attr">target</span>=<span class="hljs-string">"_blank"</span>/&gt;</span>
</code></pre>
<h6 id="heading-browsers-support-to-relnoopener">Browsers support to <code>rel=noopener</code></h6>
<p><img src="https://i.ibb.co/4mf5kLg/Screenshot-2020-05-27-at-19-47-26.png" alt /></p>
<p>To conclude my post, <code>rel="noopener noreferrer"</code> should be added to links containing <code>target="_blank"</code> as a precaution against reverse tabnabbing.This ensures window.opener is null in both Chrome and Firefox. In Safari Technology Preview 68, <code>target="_blank"</code> on anchors implies <code>rel="noopener"</code> by default.</p>
<p>Thank you for reading my thoughts on this issue. Subscribe to my newsletter for more of this.</p>
]]></content:encoded></item><item><title><![CDATA[Must Watch Javascript 2019 Tech Talks by awesome Women in Tech from 2019]]></title><description><![CDATA[Before 2020 ends I would like to take the opportunity to thank these awesome women in tech, Who according to me delivered amazing tech talks for this year.If you haven't yet watched them, do it before new year.
Also feel free to mention the amazing o...]]></description><link>https://blogs.manjuladube.com/must-watch-javascript-2019-tech-talks-by-awesome-women-in-tech-from-2019</link><guid isPermaLink="true">https://blogs.manjuladube.com/must-watch-javascript-2019-tech-talks-by-awesome-women-in-tech-from-2019</guid><category><![CDATA[WomenInTech  web  development]]></category><dc:creator><![CDATA[manjula dube]]></dc:creator><pubDate>Tue, 24 Dec 2019 11:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1737141227099/da4a8f3d-c19c-4e21-a7a9-ee68586d3648.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Before 2020 ends I would like to take the opportunity to thank these awesome women in tech, Who according to me delivered amazing tech talks for this year.If you haven't yet watched them, do it before new year.</p>
<p>Also feel free to mention the amazing one's which you find interesting in the comments ♥️</p>
<h4 id="heading-debugging-the-debugger-by-princiya-sequeira-react-rally-2019httpswwwyoutubecomwatchvqklmzaobky4"><a target="_blank" href="https://www.youtube.com/watch?v=QklMZaObKY4"><em>Debugging the Debugger by Princiya Sequeira | React Rally 2019</em></a></h4>
<p>This talk is the inception of debugging the Firefox devtools’ debugger which is built using React and Redux. All of us love to ‘console’ log our code, but there are other effective techniques that will help accelerate the debug loop cycle.</p>
<p>In this talk, Princiya will present the various available browser devtools debugging techniques using practical examples from the community to debug the development of the debugger project!</p>
<h4 id="heading-exploring-the-hidden-potential-of-sound-data-by-charlie-gerard-dotjs-httpswwwdotconferencescom201912charlie-gerard-exploring-the-hidden-potential-of-sound-datahttpswwwdotconferencescom201912charlie-gerard-exploring-the-hidden-potential-of-sound-data"><em>[Exploring the hidden potential of sound data by Charlie Gerard | dotJS] (</em><a target="_blank" href="https://www.dotconferences.com/2019/12/charlie-gerard-exploring-the-hidden-potential-of-sound-data"><em>https://www.dotconferences.com/2019/12/charlie-gerard-exploring-the-hidden-potential-of-sound-data</em></a><em>)</em></h4>
<p>Even though we don’t really think about it, sound is a very rich source of information. Leveraging the properties of sound with machine learning, we can gain insights about an environment or an activity performed. Acoustic activity recognition has the potential to create new interactions and better smart systems, and in this talk, Charlie explores how to experiment with this technology in JavaScript, using the Web audio API and Tensorflow.js.</p>
<h4 id="heading-the-future-of-web-animation-sarah-drasner-jsheroes-2019httpswwwyoutubecomwatchvhjgni3dxcve"><a target="_blank" href="https://www.youtube.com/watch?v=hjgni3dXcVE"><em>The Future of Web Animation - Sarah Drasner | JSHeroes 2019</em></a></h4>
<p>In this talk, you'll start learning some bleeding edge techniques such as native-like page transitions with client side rendering, but then we'll push it further. The intersection of health and animation with biofeedback sensors, the future of 3d in the browser complete with interviews with people who are writing these specs .This talk will show that in terms of animation on the web, we're just getting started.</p>
<h4 id="heading-tink-a-next-generation-package-manager-by-kat-marchan-jsconf-euhttpswwwyoutubecomwatchvshici8-6gs"><a target="_blank" href="https://www.youtube.com/watch?v=SHIci8-6_gs"><em>Tink: A Next-Generation Package Manager by Kat Marchán | JSConf EU</em></a></h4>
<p>With nearly 1,000,000 packages, the npm ecosystem is the largest out there, by far – but the ecosystem and its package manager were created in more humble times, for small projects and packages centered around the Node.js ecosystem itself. It’s about time we redefined package management for modern web development, and that redefinition is tink: a package unwinder for JavaScript brought to you by npm itself. With tink, you’ll find unprecedented speeds, deep compatibility with everything from Node.js to bundlers, and a UX workflow optimized for the modern web developer.</p>
<h4 id="heading-building-the-new-facebook-with-react-and-relay-by-ashley-watkins-react-confhttpswwwyoutubecomwatchvkt3xkdbzw7m"><a target="_blank" href="https://www.youtube.com/watch?v=KT3XKDBZW7M"><em>Building The New Facebook With React and Relay by Ashley Watkins | React Conf</em></a></h4>
<p>Ashley discusses some of the technologies and strategies powering FB5, the new <a target="_blank" href="http://facebook.com">facebook.com</a>. Topics covered include Facebook's approach to CSS-in-JS, data-driven dependencies, phased code downloading, and more.</p>
<h4 id="heading-api-modernization-building-bridges-as-you-cross-them-by-shelley-vohr-jsconf-budapest-2019httpswwwyoutubecomwatchvgi2vo-uqg5w"><a target="_blank" href="https://www.youtube.com/watch?v=GI2Vo-UQG5w"><em>API Modernization: Building Bridges As You Cross Them by Shelley Vohr | JSConf Budapest 2019</em></a></h4>
<p>In this talk you will learn updates ranging from asynchronous JS to idiomatic getters and setters, as well as allowing developers to access new platform-dependent functionalities. Our APIs can and often are implemented across two or more languages on their way to the end user, and so we'll walk through some examples of how to effectively gather context and write reusable code to make updating simpler.</p>
<h4 id="heading-work-less-and-do-more-google-sheets-for-nodejs-developers-franziska-hinkelmann-and-anu-srivastavhttpswwwyoutubecomwatchvthyp5apom1k"><a target="_blank" href="https://www.youtube.com/watch?v=ThYp5apom1k"><em>Work Less and Do More: Google Sheets for Node.js Developers - Franziska Hinkelmann and Anu Srivastav</em></a></h4>
<p>In this talk you will see how you can string together your emails, docs, charts, all of it—into one gorgeous report, ready to email off. You can combine all your data— from GitHub metrics, monitoring data, to surveys — with this wide-ranging platform that involves “human” tools, such as a Calendar and Contacts. Thanks to a helpful client library, Node.js is the glue that you can use to code up all the business work, so that you can get back to the business of coding.</p>
<h4 id="heading-the-front-end-stands-alone-by-keerthana-krishnan-js-kongress-2019httpswwwyoutubecomwatchv4y7lnvilnge"><a target="_blank" href="https://www.youtube.com/watch?v=4Y7LnVILnGE"><em>The Front-End Stands Alone by Keerthana Krishnan | JS Kongress 2019</em></a></h4>
<p>With the advent of serverless architecture, front-end developers can now easily build and deploy their applications without a lot of overheads. This session aims to look at how to build a basic web application with serverless architecture and why it’s becoming more popular.</p>
<h4 id="heading-accessibility-in-the-age-of-components-by-ayesha-mazumdar-react-boston-2019httpswwwyoutubecomwatchvu1th3qs-ea"><a target="_blank" href="https://www.youtube.com/watch?v=U1th3Qs-E_A"><em>Accessibility in the Age of Components by Ayesha Mazumdar | React Boston 2019</em></a></h4>
<p>We often build component libraries to improve consistency, collaboration, and customization for a given product. But what if a component library could also scale accessibility across the entire organization? Building accessible components can help distribute responsibility across all of design and engineering, without needing everyone to be an expert on the nitty-gritty details. In this session, we'll go through specific component examples and use cases to help you and your team contribute to a better, more inclusive web.</p>
<h4 id="heading-a-journey-to-the-center-of-a-slow-react-app-by-pavithra-kodmad-react-india-2019httpswwwyoutubecomwatchvpsrtngpe-nuampfeatureyoutube"><a target="_blank" href="https://www.youtube.com/watch?v=PsRtnGpe-nU&amp;feature=youtu.be"><em>A Journey to the Center of a Slow React App by Pavithra Kodmad | React India 2019</em></a></h4>
<p>What are the major factors that slow down a web application written in React? Can we mitigate them? If so, what are the tradeoffs. Pavitra will be speaking about perf improvements we made in our large application. From state management to measuring correctly to dealing with legacy frontend, this talk will cover a variety of reasons why things got slow. And how to deal with it.</p>
<p>Thank you for Reading!! Happy New Year</p>
]]></content:encoded></item><item><title><![CDATA[Don’t let the community drive away the force & enthusiam in YOU:)]]></title><description><![CDATA[Creating Inclusive Tech Communities

I’ve been organising events in my spare time for over 2 years now. I am organizer of Mumbai Women Coders with few other talented organizers (Dipti Gandhi, Arwa Lokhandwala) . Later got connected to few other commu...]]></description><link>https://blogs.manjuladube.com/dont-let-the-community-drive-away-the-force-enthusiam-in-you</link><guid isPermaLink="true">https://blogs.manjuladube.com/dont-let-the-community-drive-away-the-force-enthusiam-in-you</guid><category><![CDATA[community]]></category><category><![CDATA[technology]]></category><dc:creator><![CDATA[manjula dube]]></dc:creator><pubDate>Wed, 19 Jul 2017 10:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1737139485888/ef523b1b-7a31-4d53-a529-98e56da8b97d.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h4 id="heading-creating-inclusive-tech-communities">Creating Inclusive Tech Communities</h4>
<p><img src="https://images.unsplash.com/photo-1531206715517-5c0ba140b2b8?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=crop&amp;w=900&amp;q=80" alt /></p>
<p>I’ve been organising events in my spare time for over 2 years now. I am organizer of Mumbai Women Coders with few other talented organizers (Dipti Gandhi, Arwa Lokhandwala) . Later got connected to few other community in Mumbai. At first, I didn’t understand why I would want to make my events appeal to more people, I already had a steady stream of attendees. As time went on inclusivity climbed higher and higher up my list of priorities as I realised its importance. You will always find people opposing you against you even when things are in place. Learn to face them because tons of people in the community still appreciate you and value your work.</p>
<h4 id="heading-lessons-learned">Lessons learned</h4>
<p>The world is full of lots of different people in the community and it would be a shame if they don’t attend your event or interact with your community for reasons you can easily fix. If the leaders can’t fix it. Its simple just walk and move on.</p>
<p><em>Be vocal when things go wrong around you. No matter what, your talent and work will always speak for yourself. Be humble &amp; calm.</em></p>
<p>You’ve probably heard of high-tech cities such as Bangalore, Hyderabad, and Pune. In those cities the tech industry is super innovative. Everywhere you look new startups are growing and expanding, right along with the tech meet ups and conferences that are part of the business. Communities are doing great in all of these cities. Trying to do the same in the financial capital city like Mumbai, it was not an easy one(Ups and Downs). But Remember “With great power comes the great responsibility”. Community is more of making it play ground with positive vibes around you, helping each other &amp; communities around and driving the force in each one of us. Its more like getting more and more people involved and let them take up responsibility.</p>
<p>But if you cannot see that happening raise your voice, If that still bothers you. Let it go. Let the power take over your work &amp; knowledge. Mind you power will not sustain for longer time, but our knowledge and good work in the community will always sustain. People will always remember it. Spread the word and utilise your learnings &amp; knowledge else where. But make sure you are vocal about the wrong ones.</p>
<h4 id="heading-last-thought">Last thought</h4>
<p>Be an individual who is vocal when things go wrong. Sail the boat even when you alone because you know you are right and will reach at the right place sooner or later with amazing people around you. Let the bad ones play politics as usual. Just stay calm and move on. The only difference they drive the community with their power, we drive it with our work &amp; contributions.</p>
<p><img src="https://miro.medium.com/max/700/1*i_dj0YnDhhlI51f2z5CCng.jpeg" alt /></p>
<h4 id="heading-remember">Remember</h4>
<p>Trees only with the strong roots laughs in the storm :)</p>
]]></content:encoded></item></channel></rss>