{"componentChunkName":"component---src-templates-tag-js","path":"/tags/engineering/","result":{"data":{"site":{"siteMetadata":{"title":"LoginRadius Blog"}},"allMarkdownRemark":{"totalCount":31,"edges":[{"node":{"fields":{"slug":"/identity/what-is-passkey-authentication/"},"html":"<h2 id=\"what-is-passkey\" style=\"position:relative;\"><a href=\"#what-is-passkey\" aria-label=\"what is passkey permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is Passkey?</h2>\n<p>Passkey authentication provides a highly secure, passwordless login experience tailored for modern authentication needs. Built on FIDO2 and WebAuthn standards, it addresses key vulnerabilities like data breaches and phishing attacks by leveraging cryptographic key pairs.</p>\n<p>Unlike traditional passwords, which are often reused and stored on vulnerable servers, passkeys store private keys securely on user devices. This ensures that even in case of a server breach, user credentials remain safe.</p>\n<p>For developers, <a href=\"https://www.loginradius.com/docs/api/v2/customer-identity-api/passkey/overview/\">passkeys simplify integration</a>, reduce the need for password management, and comply with cutting-edge authentication protocols, paving the way for a passwordless future.</p>\n<h2 id=\"how-do-passkeys-work\" style=\"position:relative;\"><a href=\"#how-do-passkeys-work\" aria-label=\"how do passkeys work permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How Do Passkeys Work?</h2>\n<p>Passkeys operate on a private-public key mechanism. To understand, we need to look at their registration and authentication processes.</p>\n<ol>\n<li>Registration: A user’s device generates a cryptographic key pair via WebAuthn APIs during registration.</li>\n<li>The private key is securely stored on the user’s device and never shared.</li>\n<li>The public key is sent to the server to validate authentication requests.</li>\n<li>Authentication:</li>\n<li>The server issues a cryptographic challenge to the user’s device.</li>\n<li>The device uses the private key to sign the challenge.</li>\n<li>The server verifies the signed challenge using the public key, granting access if the verification is successful.\n</li>\n</ol>\n<p>This process ensures that sensitive data never leaves the user’s device, making passkeys significantly more secure than passwords. Developers can streamline implementation using tools like WebAuthn.js, ensuring compliance with <a href=\"https://www.loginradius.com/platforms/authentication-and-registration\">modern authentication</a> protocols and providing a seamless user experience.</p>\n<h2 id=\"how-are-passkeys-used-on-multiple-devices-with-different-users\" style=\"position:relative;\"><a href=\"#how-are-passkeys-used-on-multiple-devices-with-different-users\" aria-label=\"how are passkeys used on multiple devices with different users permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How Are Passkeys Used on Multiple Devices with Different Users?</h2>\n<p>Passkeys are designed to function seamlessly across devices through cloud services like Apple’s iCloud Keychain and Google’s Password Manager. These services securely synchronize passkeys, enabling users to authenticate without manually transferring credentials.</p>\n<p>For shared devices, passkeys protect each user’s private keys using biometrics or PINs. By adhering to FIDO2 and WebAuthn standards, passkeys ensure cross-platform compatibility, making them a versatile choice for diverse ecosystems. Developers can effortlessly implement these features to cater to multi-user and multi-device scenarios.</p>\n<p><a href=\"https://www.loginradius.com/resource/datasheet/passkeys-passwordless-authentication\"><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 30.307692307692307%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAACXBIWXMAAAsSAAALEgHS3X78AAABn0lEQVQY01XOzWoTURjG8amT+WobJ5lkmpnJdJImmYyZNpqYD1uL7aLqWimldKNIEdooQhFX4u3oSl1YwYIgXYhegCDUTxBcWCKhvYC/J8nKA8/ivLzvj0cyqssY4WX08iWMUpfJcgdjri3Swig00IILqLN1VH8exY3QxCxVX8Es1lHEXHZCEtkCiUyAbPlIQ2wYy484a86gTabRDZMpM0cqVyIZLKD4C6j5GMURYLGJ171OtLiGVruCHJwfYf+BemWJbL6CM+NhZz1UNUWitIZSW8cImgIU7bwY3Y9x4i65qEU2bOJWG7jRRaZFmTNpfwzqlcVxQ7eMmbTI5AqYfpPMcg9rZY9ktCra1QRYw5idx446uAL14g7OuRZ22GA6Xx1hcjo/bLhEotjm2cvX9I+POfrylW/ff/Lj12/+/D1h9eYtJDtEMgN2Hz3h0+cjnu8f8PTFK3Gzz+H7j7x5+44pryx2nDEoBy0ODj8wfP1+n8FgwOnpyeh/beMOklViwq7QvnqDnYeP2br7gM3t+yL3uN3bY2u7h2YXmEi5/AObCM5rWlEs6wAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"CTA\"\n        title=\"CTA\"\n        src=\"/static/5333b92e3e9f12f1f05e1a63df46799f/e5715/cta.png\"\n        srcset=\"/static/5333b92e3e9f12f1f05e1a63df46799f/a6d36/cta.png 650w,\n/static/5333b92e3e9f12f1f05e1a63df46799f/e5715/cta.png 768w,\n/static/5333b92e3e9f12f1f05e1a63df46799f/81501/cta.png 2886w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></a></p>\n<h2 id=\"passkey-vs-password-why-are-passkeys-a-better-choice\" style=\"position:relative;\"><a href=\"#passkey-vs-password-why-are-passkeys-a-better-choice\" aria-label=\"passkey vs password why are passkeys a better choice permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Passkey vs Password: Why are Passkeys a Better Choice?</h2>\n<p>The comparison between passkey vs password underscores why passkeys are revolutionizing authentication:</p>\n<ul>\n<li><strong>Enhanced Security</strong>: Passkeys are inherently resistant to threats like phishing, brute force attacks, and credential reuse. In contrast, passwords often fall victim to these vulnerabilities due to weak user practices or targeted attacks.</li>\n<li><strong>Improved Usability</strong>: Users no longer need to manage or memorize complex password strings, significantly reducing frustration and the likelihood of human error. With passkeys, authentication is both seamless and secure.</li>\n<li><strong>Simplified Developer Workflows</strong>: For developers, passkeys eliminate the burden of managing sensitive password data, streamlining the implementation of secure authentication systems. This reduces the overhead associated with password storage, encryption, and recovery mechanisms.</li>\n</ul>\n<p>Moreover, passkeys mitigate the risks associated with server-side breaches by ensuring that sensitive user credentials are never stored centrally, setting a new standard for modern authentication.</p>\n<h2 id=\"are-passkeys-safer-than-passwords\" style=\"position:relative;\"><a href=\"#are-passkeys-safer-than-passwords\" aria-label=\"are passkeys safer than passwords permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Are Passkeys Safer than Passwords?</h2>\n<p>When asking are passkey logins safe, the answer is unequivocally yes. Passkeys are designed with robust security features to protect users and organizations.</p>\n<p>They provide phishing resistance by eliminating the need to input sensitive credentials manually. Private keys never leave the user’s device, ensuring that even in the event of a server breach, user credentials remain uncompromised.</p>\n<p>Most passkeys are further protected by biometrics such as fingerprints or facial recognition, adding an additional layer of security.</p>\n<p>Moreover, passkeys can complement existing <a href=\"https://www.loginradius.com/platforms/multi-factor-authentication\">multi-factor authentication</a> (MFA) systems, creating a comprehensive and secure framework without increasing user complexity. Passkeys offer developers a scalable and safe authentication alternative that is easier to manage than traditional methods.</p>\n<h2 id=\"why-choose-loginradius-for-passkey-authentication\" style=\"position:relative;\"><a href=\"#why-choose-loginradius-for-passkey-authentication\" aria-label=\"why choose loginradius for passkey authentication permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Why Choose LoginRadius for Passkey Authentication?</h2>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 62.92307692307691%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAYAAACpUE5eAAAACXBIWXMAAAsTAAALEwEAmpwYAAABsElEQVQ4y5WT227bMAyG87IDimEo0F7sIfZGQ/sEC7IcLoICa9LCjh3bsS35JMWn/BMZO3O8DmsJ/BAlWJ9Ik5zEcYwoiiCEYNFeSIm486Xx6Zy+CcMQQRDA8zzs93s4jgPbtmFZFrbbLdbrNSZZlkEpxTqdTkiS5HzJD8x64PPj8Qit9UDnfVVVaNsWZHmeY7VaYfL94RGfPt/i9v4rbr7c4enXM6SqGEQX6JGhCNCrP7sCWpaNH9MZfs4XrDCKcZAp6u71oZqmwdj+AlLoQzuWJWRWcEoEGEPp/jjqK2CappxeURRQRrnxPZGxT+fD1IaA8XoBUlEomr4w2hQgV9qAmss/+xCQIuyBWiuG2WECbfZ1XQ8K8X/gcrm8BnKLGD+Rgj+4/LdOfbT/Ai4Wiz/AogMq44s040jrpu3UoKobXoegcVEYKE0jU+OWnbJCIRQJ9lECN87gyxxxUSIyEkbtG31JRrWYz+eYvDg+pq8HPNk+bNOTbqrxbRrgWZbnSPA+o+xms9m5sV870UzajovliwPL9XAwI+j7Ps9uP7+u6/IMk3a7Hc8yabPZcMq/AdYa4+Jm0qerAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"passkey\"\n        title=\"passkey\"\n        src=\"/static/bf289254152d60f3224403f907600aa4/e5715/passkey.png\"\n        srcset=\"/static/bf289254152d60f3224403f907600aa4/a6d36/passkey.png 650w,\n/static/bf289254152d60f3224403f907600aa4/e5715/passkey.png 768w,\n/static/bf289254152d60f3224403f907600aa4/29007/passkey.png 1600w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Image: A screenshot of LoginRadius Passkeys</p>\n<p>LoginRadius simplifies the <a href=\"https://www.loginradius.com/products/passkeys\">adoption of passkey</a> authentication for developers and businesses. The platform offers developer-friendly tools like SDKs and APIs that make integration faster, supporting compliance with FIDO2 and WebAuthn standards.</p>\n<h3 id=\"key-benefits\" style=\"position:relative;\"><a href=\"#key-benefits\" aria-label=\"key benefits permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Key Benefits</h3>\n<ul>\n<li>Scalability: Built to handle millions of users, ensuring performance at scale.    </li>\n<li>Security Compliance: Adheres to global standards such as GDPR and CCPA.    </li>\n<li>Developer-Friendly: Comprehensive documentation and tools for seamless integration.</li>\n</ul>\n<p>Learn more: <a href=\"https://www.loginradius.com/docs/authentication/tutorial/passkey-authentication/\">How to implement passkey authentication with LoginRadius</a></p>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>As we move into 2025, passkeys will become an integral part of secure authentication systems, widely implemented across industries.</p>\n<p>For developers, they simplify integration by eliminating the need to store and manage sensitive credentials, reducing both risks and operational overhead. For users, passkeys provide consistent and secure access across devices without relying on passwords, enhancing both security and usability.</p>\n<p>This evolution signifies the shift toward a more streamlined and robust passwordless future.</p>\n<h2 id=\"faqs\" style=\"position:relative;\"><a href=\"#faqs\" aria-label=\"faqs permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>FAQs</h2>\n<p><strong>1. What is passkey authentication?</strong>\nA. Passkey authentication replaces passwords with cryptographic key pairs for secure and seamless login.</p>\n<p><strong>2. How do passkeys work?</strong>\nA. Passkeys use private-public key pairs to authenticate users without transmitting sensitive data.</p>\n<p><strong>3. Are passkey logins safe?</strong>\nA. Yes, passkeys are resistant to phishing, brute force attacks, and server breaches.</p>\n<p><strong>4. How are passkeys used on multiple devices?</strong>\nA. Passkeys synchronize across devices via cloud services, ensuring seamless access.</p>\n<p><strong>5. Passkey vs password: Which is better?</strong>\nA. Passkeys offer better security and usability compared to traditional passwords, eliminating many common vulnerabilities.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"December 30, 2024","updated_date":null,"title":"What is Passkey Authentication - A Complete Guide","tags":["Engineering"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.0309278350515463,"src":"/static/9449d4d89f5abbe660ee2295432fd3af/32d53/hacker.png","srcSet":"/static/9449d4d89f5abbe660ee2295432fd3af/69585/hacker.png 200w,\n/static/9449d4d89f5abbe660ee2295432fd3af/497c6/hacker.png 400w,\n/static/9449d4d89f5abbe660ee2295432fd3af/32d53/hacker.png 614w","sizes":"(max-width: 614px) 100vw, 614px"}}},"author":{"id":"Kundan Singh","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/importance-of-rpa/"},"html":"<h4 id=\"robotic-process-automationrpa-process-to-get-the-repetitive-tasks-done-through-bots-and-reduce-manual-efforts\" style=\"position:relative;\"><a href=\"#robotic-process-automationrpa-process-to-get-the-repetitive-tasks-done-through-bots-and-reduce-manual-efforts\" aria-label=\"robotic process automationrpa process to get the repetitive tasks done through bots and reduce manual efforts permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Robotic process automation(RPA) process to get the repetitive tasks done through bots and reduce manual efforts.</h4>\n<p>In definitive words, we can say ** \"Impersonating human activities in a sequential fashion to achieve a designated result without any manual intervention is known as Robotic Process Automation.\"**</p>\n<h2 id=\"why-is-rpa-becoming-an-essential-part-of-every-business\" style=\"position:relative;\"><a href=\"#why-is-rpa-becoming-an-essential-part-of-every-business\" aria-label=\"why is rpa becoming an essential part of every business permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Why is RPA becoming an essential part of every business?</h2>\n<p>There are many benefits of robotic process automation, depending on the industries. I have listed a few common benefits across all the business domains and industries. </p>\n<h3 id=\"a-desideratum\" style=\"position:relative;\"><a href=\"#a-desideratum\" aria-label=\"a desideratum permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>A Desideratum</h3>\n<p>Any business's success depends on how deep they understand the customers, or rather, I should say <strong>targeted customers</strong>. And this is one of the fundamental challenges for companies.</p>\n<p>Intelligent automation through RPA can be implemented to understand user behavior, helping companies in decision making for their targeted customers and growth.</p>\n<h3 id=\"cost-effective\" style=\"position:relative;\"><a href=\"#cost-effective\" aria-label=\"cost effective permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Cost Effective</h3>\n<p>RPA is the most sought after solution in this technology-driven era to reduce the investment being done on manual tasks and get the best of the employees by allowing them to innovate rather than doing monotonous work. Multiple studies say that rolling out RPA, and thoughtful implementation can save approx 30-35% of companies' costs being spent on non-productive and repetitive tasks.</p>\n<h3 id=\"undefeatable-accuracy\" style=\"position:relative;\"><a href=\"#undefeatable-accuracy\" aria-label=\"undefeatable accuracy permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Undefeatable Accuracy</h3>\n<p>A report by ICO (Information Commissioner's office) says that 90% of a data breach between 2017 and 2018 happened due to human error. Human minds have certain limitations. We can't always be attentive 100%. And the moment we lose attention, we become vulnerable to make mistakes.\nBut Robots, once defined/built, can have unlimited attention and can work endlessly without any distractions. And that gives the ability to make no mistakes.</p>\n<h3 id=\"raising-the-bar-on-productivity\" style=\"position:relative;\"><a href=\"#raising-the-bar-on-productivity\" aria-label=\"raising the bar on productivity permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Raising the Bar On Productivity</h3>\n<p>Humans have their limitations, capacity to work. But robots, on the other hand, have no measure of capacity. If developed smartly, they can work for every millisecond. And this gives unlimited possibilities for any company to run their businesses without worrying about productivity.</p>\n<h2 id=\"use-cases-in-different-industriesdomains\" style=\"position:relative;\"><a href=\"#use-cases-in-different-industriesdomains\" aria-label=\"use cases in different industriesdomains permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Use cases in different industries/domains</h2>\n<h3 id=\"rpa-in-business-process-outsourcing\" style=\"position:relative;\"><a href=\"#rpa-in-business-process-outsourcing\" aria-label=\"rpa in business process outsourcing permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>RPA in Business Process Outsourcing</h3>\n<p>Business process outsourcing(BPO) always strives for heftiness in productivity with minimal cost. With the efficient use of RPA, the BPO's can eventually reduce a lot of operating expenses and make more effective utilization of their workforce. As robots can work 24/7, productivity can be increased tremendously. Apart from repetitive work automation, the industry also has a lot of back-office work, which is purely rule-based, and the same can be achieved with better security and audits. Report generation, data analysis are the other tasks that can also be done through RPA. Some more examples can be </p>\n<ul>\n<li>Data entry and validation</li>\n<li>Data extraction</li>\n<li>Creating mass emails</li>\n<li>Updating CRMs</li>\n<li>Updating scorecards</li>\n<li>Automated exchange of information</li>\n</ul>\n<h3 id=\"rpa-in-banking\" style=\"position:relative;\"><a href=\"#rpa-in-banking\" aria-label=\"rpa in banking permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>RPA in Banking</h3>\n<p>Most innovations, along with technological advancement, have been seen in the banking sector. As per the reports, the BFSI domain holds the largest share in the year 2019 to apply RPA. </p>\n<p>RPA has a surfeit of applications in banking covering from customer service to compliance nearly everything. The following are a few examples. </p>\n<ul>\n<li>Customer Service</li>\n<li>KYC process</li>\n<li>Mortgage processing</li>\n<li>Reporting</li>\n<li>General ledger</li>\n<li>Fraud detection</li>\n<li>Compliances</li>\n</ul>\n<h3 id=\"rpa-in-medical-industry\" style=\"position:relative;\"><a href=\"#rpa-in-medical-industry\" aria-label=\"rpa in medical industry permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>RPA in Medical Industry</h3>\n<p>The medical industry across the globe has always been a sector that is continuously striving for improvement. Providing the best health care services for a broad range of population is a real challenge in both operational and organizational. There are numerous use-cases in the medical industry where patients and hospitals can leverage the benefits.\nSuch as :</p>\n<ul>\n<li>Scheduling the appointments</li>\n<li>Managing the supply process like claims and billing</li>\n<li>Regulatory compliances optimization</li>\n</ul>\n<h3 id=\"rpa-in-insurance\" style=\"position:relative;\"><a href=\"#rpa-in-insurance\" aria-label=\"rpa in insurance permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>RPA in Insurance</h3>\n<p>Insurance is an industry which deals with vast amounts of data and processes. With the help, RPA insurance providers are now capable of merging front-end and back-end operations resulting in reducing cost and manual intervention.\n<em>Leslie Willcocks</em> professor at LSE, said that * \"In an insurer we studied, there was a particular process where it used to take two days to handle 500 premium advice notes. It now takes 30 minutes\"*\nThis much processing was made by implementing RPA. Apart from the front-end or back-end automation, there can be many other use-cases, for example</p>\n<ul>\n<li>Valuation and structuring of claims</li>\n<li>Regulatory compliances</li>\n<li>Policy cancellation</li>\n<li>New policy issuance</li>\n</ul>\n<h3 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h3>\n<p>There are many more benefits of robotic process automation, depending on the industries.\nA survey by Deloitte says that RPA continues to meet and exceed expectations across multiple dimensions, including :\n92% on Improved Compliance\n90% Improved quality and accuracy\n86% improvement in productivity and\n59% cost reduction.</p>\n<p>They say that <strong><em>with the current pace, RPA will have achieved near-universal adoption within the next five years.</em></strong></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"October 23, 2020","updated_date":null,"title":"Why RPA is important for businesses","tags":["Engineering","RPA","Automation"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/f2993d36b93dfde7b755c69581762a74/14b42/RPA.jpg","srcSet":"/static/f2993d36b93dfde7b755c69581762a74/f836f/RPA.jpg 200w,\n/static/f2993d36b93dfde7b755c69581762a74/2244e/RPA.jpg 400w,\n/static/f2993d36b93dfde7b755c69581762a74/14b42/RPA.jpg 800w,\n/static/f2993d36b93dfde7b755c69581762a74/9a763/RPA.jpg 1050w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Vikram Jain","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/traversing-the-realms-of-quantum-network/"},"html":"<p>Have you ever wondered how our universe is stitched together? Or how matter behaves at the atomic and subatomic levels? Do you know-how is a quantum computer different from a supercomputer, or what are the functions that it can perform which a typical computer can't? </p>\n<p>Or, have you ever thought of the amplification of photon particles in a laser beam? Our universe is full of occurrences that are hard to explain. However, the answer to all these questions lies in understanding the fundamentals of nature. For that, let us take a look at Quantum mechanics, which explains the functioning of particles together at the smallest level. Quantum mechanics is a branch of physics which is mainly concerned with the behaviour and nature of matter and energy and atomic and subatomic levels. </p>\n<p>With huge advancements in this field, the concept of quantum computers and quantum internet has now come to life. Typical computers are based on binary digits, that is, 0 and 1. Quantum computers, on the other hand, are based on qubits. A qubit or quantum bit is the basic unit for quantum information. They are based on particle's physical properties, such as the spin of an electron, and hence differ in various ways. We know that electron spin can either up or down, but things change when it comes to quantum mechanics. It follows the concept of superposition, according to which an electron can exist in a state in which it has a spin in both directions simultaneously. This may sound strange according to what we observe generally, yet this is how Quantum mechanics work. </p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 31.538461538461537%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAGABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAIF/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/2gAMAwEAAhADEAAAAd2RKC//xAAWEAEBAQAAAAAAAAAAAAAAAAABABH/2gAIAQEAAQUClxv/xAAVEQEBAAAAAAAAAAAAAAAAAAABEP/aAAgBAwEBPwFn/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAFhABAQEAAAAAAAAAAAAAAAAAAQAQ/9oACAEBAAY/AoM//8QAGBAAAwEBAAAAAAAAAAAAAAAAAAEhQRH/2gAIAQEAAT8h5Y4OSJXRaf/aAAwDAQACAAMAAAAQC8//xAAWEQADAAAAAAAAAAAAAAAAAAABEBH/2gAIAQMBAT8QKL//xAAVEQEBAAAAAAAAAAAAAAAAAAABEP/aAAgBAgEBPxAn/8QAGRABAQEBAQEAAAAAAAAAAAAAARExACFh/9oACAEBAAE/EBz4aSb0DDdZPk4oonre/9k='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Quantum \"\n        title=\"Quantum \"\n        src=\"/static/2128303175bf529662552060eff9ccfd/212bf/Phio-Network-by-Quantum-Xchange-1.jpg\"\n        srcset=\"/static/2128303175bf529662552060eff9ccfd/6aca1/Phio-Network-by-Quantum-Xchange-1.jpg 650w,\n/static/2128303175bf529662552060eff9ccfd/212bf/Phio-Network-by-Quantum-Xchange-1.jpg 768w,\n/static/2128303175bf529662552060eff9ccfd/38a9e/Phio-Network-by-Quantum-Xchange-1.jpg 1470w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>The peculiar behaviour that particles display can be useful in various ways. Qubits can store much more information than conventional bits. This can be explained as two bits with one of the four possible values, 00, 01, 10, or 11. Qubits, on the other hand, can be both 0 and 1 at once. This implies they can have all the four values all at once.\nThus, the amount of information you store using qubits increases tremendously. </p>\n<p>Quantum computers have the scope of performing operations even faster than the fastest supercomputers. Quantum computing also promises higher security and encryption. If we see the current encryption methods, all of them have some loopholes due to which information can be compromised sooner or later. Through quantum computing, the information will travel through qubits. The users will know in case someone tries to abstract the information. Thus, quantum computers promise you a very secure future!</p>\n<p>But then, how is all this information transmitted? It is Quantum networks that facilitate the transmission of information through qubits. It is an essential part of quantum computing and quantum communication systems. For quantum communication to be possible, qubits have to move from one quantum processor to the other over long distances. Thus, an\nintra-connection of local quantum networks with quantum internet is required. To understand the quantum network even better, let us take a look at its elements. The classical network and quantum network have a lot in common. </p>\n<p>They are:</p>\n<ul>\n<li>we require quantum processors with at least one qubit. A quantum processor is a small quantum computer capable of performing quantum logic gates on a given number of qubits. These quantum processors, along with one qubit, are known as end nodes, on which the application is run. Some applications might also require more than one qubit to function. </li>\n<li>Transfer of qubits requires communication lines, for which standard telecom fibers can be used.</li>\n<li>optical switches are required to optimize the communication infrastructure as they deliver qubits to the required processors. Fourthly, we require quantum repeaters so that qubits or information can travel through long distances. </li>\n</ul>\n<p>According to the current scenario, IBM has 18 quantum computers, and Google AI Quantum is also advancing towards quantum computing. The current quantum computing period is referred to as the Intermediate-Scale Quantum (NISQ) era by quantum computing scientists. Quantum supremacy is not too far as Quantum computers of over 50 qubits have already been created. </p>\n<p>Google has also demonstrated quantum supremacy with its quantum computer, the Sycamore Processor. It took 200 seconds to perform a computation, which would have required 10,000 years if solved using a traditional computer. Amazon and Microsoft are also a part of bringing global access to quantum computing. This is the future of quantum networking, and according to Deffner, \"We cannot rely on old concepts anymore, but we need something new.\"</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"October 21, 2020","updated_date":null,"title":"Traversing the realms of Quantum Network","tags":["Engineering","Quantum","Networking"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/95ed780fc93f29b754a49f9162413173/ee604/quantum_comp_FB.png","srcSet":"/static/95ed780fc93f29b754a49f9162413173/69585/quantum_comp_FB.png 200w,\n/static/95ed780fc93f29b754a49f9162413173/497c6/quantum_comp_FB.png 400w,\n/static/95ed780fc93f29b754a49f9162413173/ee604/quantum_comp_FB.png 800w,\n/static/95ed780fc93f29b754a49f9162413173/d40e6/quantum_comp_FB.png 941w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Devansh Markan","github":"markandevansh99","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/apache-beam/"},"html":"<p>We'll talk about Apache Beam in this guide and discuss its fundamental concepts. We will begin by showing the features and advantages of using Apache Beam, and then we will cover basic concepts and terminologies.</p>\n<p>Ever since the concept of big data got introduced to the programming world, a lot of different technologies, frameworks have emerged. The processing of data can be categorized into two different paradigms. One is Batch Processing, and the other is Stream Processing. </p>\n<p>Different technologies came into existence for different paradigms, solving various big data world problems, for, e.g., Apache Spark, Apache Flink, Apache Storm, etc. </p>\n<p>As a developer or a business, it's always challenging to maintain different tech stacks and technologies. Hence, Apache Beam to the rescue!</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 49.84615384615385%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAAAsTAAALEwEAmpwYAAACHklEQVQoz2WSW2/TQBCF/VeReOYnIPHEMxL0pVJBkaCiSCBVqSiI0obSplUhbZM0F5qEksS5NY4vseO1vfbHOqagiJFWe5kzc3b3HC12Z4jrE8J+jWjcJhw2SYAkSUjimDTSvZSSWO3TcxknyxnSvJ9hjHcE+w/Q4sAjGDQJVbPotktk9FH4ZZM0HNNgYU2zolj+Icmypl7j+v0XWnuX9PKb6M8fobES0b+l6xJPhpTXcuiFwgrqvCsJUrRep5IrU3nVoLrZovL6Ek0sbBoXH7gq7VIsPuG6U+H8/Ai9VsQ6/kxUvVg2kbNb/FIR7BkPt4Y825/ysdKi16sj5z/xzRae2USzzTGlozd8/7pFu12nPxtyXN/jpLWP4Y1xwwRbqJuHAcbGU+Zrj7k6LbN1afLisE9v6jAY+1Tb4ZJYsy2T8WjAwvNWnlU92+bsIMdxYRPPzz5ehpJBp4lo7qgvaTDs99jJ53m7vceNnmG0KIoUuSCKQiVGpurCc9G7LSajXwT+/C+JUOnclUnvpkLn9CW1coF8YRdh1RRBE0PvpqLc6XlnhQQhFpizKYEQGcHCZTLWcWyTSEHmc5OjTxsc7K5zcbiO+Haf+ek9+qX/VF6NO6ogCLDMmWqsLCZ8jOkto5GOaVkkUihRfiCdhrJkT/nQmyBdHakEkN6I2DeyISziwFnOaRGhkxoRGQl8Z4zn2oSewoULktAniQKFn/MbmpDqVNye7XEAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Timeline of Big Data Frameworks\"\n        title=\"Timeline of Big Data Frameworks\"\n        src=\"/static/1e7f65aaa920379cd8b429236ecf5cb7/e5715/timeline-bigdata-frameworks.png\"\n        srcset=\"/static/1e7f65aaa920379cd8b429236ecf5cb7/a6d36/timeline-bigdata-frameworks.png 650w,\n/static/1e7f65aaa920379cd8b429236ecf5cb7/e5715/timeline-bigdata-frameworks.png 768w,\n/static/1e7f65aaa920379cd8b429236ecf5cb7/07a9c/timeline-bigdata-frameworks.png 1440w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h2 id=\"what-is-apache-beam\" style=\"position:relative;\"><a href=\"#what-is-apache-beam\" aria-label=\"what is apache beam permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is Apache Beam?</h2>\n<p>Apache Beam is an open source, centralised model for describing parallel-processing pipelines for both batch and streaming data. The programming model of the Apache Beam simplifies large-scale data processing dynamics. </p>\n<p>The Apache Beam model offers helpful abstractions that insulate you from distributed processing information at low levels, such as managing individual staff, exchanging databases, and other activities. These low-level information are handled entirely by Dataflow. </p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 76.46153846153847%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEHElEQVQ4y02UC0xTVxjHv0IpYKaQyEOyMWhLawx0Mpgxm2yyKO/yKM4lsoTNMEbcSwLUIkUID43bkBCJzrBBykBgmDhlXQimKE8FlrmFxwUKLVVMnDQUS3m0vbf322lBspP88v9yT/LL951zcoHRy4BdkIFVmw64kQWIZ+BeyxEgi0PwJngSeASvbTzXS4WALRLAzkjArijAhnBYuyCEhYJQAAcRoiHTbY1K9UD8nIv4LcnT7rmn+N6iYF5A9H6vgJMf+vglv7s7MJzv+fr+N3n+eFHsjn2HuPgohov6WC7eedvjRbHArT/nDQBGJyNkyIl4bnM2fcQylTrm0Mmm2ScfNeOQpI4dCJ9c7TnwiPAQSc0ORdRhRViz5YJwerVUMGYqEYxslAlnsVpUgRdFWx0S4Y+sXoYbM+n4ciINWX0GMoaTE9YHkgH7gwg0qg+4cNbWfkk/VorHzUo+mpRh+FwhQDIuEmE7XhJvCQnBtC7jMD7LjFrVnZcaJ/LicT6Sb78NIXQXSKxDH8TYCLSaK7H/ASH4BfCt11MSN1XZaVgjjsLL4sNMhYi/WS7cEQIznwz4LA9wEGDhBYbNGejITUR/RNylW8FQnQVDnfUa+TZvwahxxGC88hZgLbmcSwJgKkVgLQ8jQtcZyjiMUeVBI8LG+kosso4VB8usOMzTL9FqNhLRMrLMMqLDyDqYZQLtoO13T5CXgM2pbsy1BHe2SsTBKhG4Fo/HA5vN5ma322HNYo5jHUSBDqR73sf1x2o0/LuMBr0OtVotmkwm1rlL0/RDEuBkaWkJRkdHt2RUqwambmo4RsrAdW5azOYklmVdQjvVjfTSItoZFu02G9qsNmRoMgfrEv7pfKt3vq51uyo96ybfl8Ap8o97JewFqukeTHQPw+jy/K6Zudk4al6bNm20yaaeLn42SU3KJ2emz80+0Z3WLuozSMq0Bl10dcQp+CHpS8jfEwvyoAQo/J/Qj2rRCMd/6zv4uKsvpruxU3C3sF6slteE93yviqkXfuqTCfDar/k1MaqsUsnPKYXiX5S1op/OVB29Iv0msmDvMaE8KDGg0P/4jrCWJE619TJU+33854Y6f0DR9HxQ2WwfKFHhcFnLrbbEcw0dqSXYIT1vu5WqNNcczD5bFJSwVhwixaLAeCQjN5KErXFbNZUk16ZaNfNUW+/i39d/z+tXNFGDJaqnwyXNppHymw0diYrvOqVKU0dysaEzVblQE5mdV+B3XFsUEK8nMjOR1ZHc6dCLpC9JH9Kh79jV255/lbXvbsyp2Jt79EToJ++lBCaFvOOfKToiUBz6OECdWbnnsiTLs3BfvI8iONmHyHyJzHurw9bebTQuqLb7sNg6BM051bC9vF/9ZbaTU3/sK7gRnQsF5MycXRUR5ETmFP4HPQyC2KrLXHkAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Beam-Model\"\n        title=\"Beam-Model\"\n        src=\"/static/bcda8196d6c879a95ccdd397242e01fb/e5715/beam_architecture.png\"\n        srcset=\"/static/bcda8196d6c879a95ccdd397242e01fb/a6d36/beam_architecture.png 650w,\n/static/bcda8196d6c879a95ccdd397242e01fb/e5715/beam_architecture.png 768w,\n/static/bcda8196d6c879a95ccdd397242e01fb/1cfc2/beam_architecture.png 900w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h2 id=\"features-of-apache-beam\" style=\"position:relative;\"><a href=\"#features-of-apache-beam\" aria-label=\"features of apache beam permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Features of Apache Beam</h2>\n<p>The unique features of Apache  beam are as follows:</p>\n<ol>\n<li>Unified - Use a single programming model for both batch and streaming use cases.</li>\n<li>Portable - Execute pipelines in multiple execution environments. Here, execution environments mean different runners. Ex. Spark Runner, Dataflow Runner, etc</li>\n<li>Extensible - Write custom SDKs, IO connectors, and transformation libraries.</li>\n</ol>\n<h2 id=\"apache-beam-sdks-and-runners\" style=\"position:relative;\"><a href=\"#apache-beam-sdks-and-runners\" aria-label=\"apache beam sdks and runners permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Apache Beam SDKs and Runners</h2>\n<p>As of today, there are 3 Apache beam programming SDKs</p>\n<ol>\n<li>Java</li>\n<li>Python</li>\n<li>Golang</li>\n</ol>\n<p>Beam Runners translate the beam pipeline to the API compatible backend processing of your choice. Beam currently supports runners that work with the following backends.</p>\n<ol>\n<li>Apache Spark</li>\n<li>Apache Flink</li>\n<li>Apache Samza</li>\n<li>Google Cloud Dataflow</li>\n<li>Hazelcast Jet</li>\n<li>Twister2</li>\n</ol>\n<p>Direct Runner to run on the host machine, which is used for testing purposes.</p>\n<h2 id=\"basic-concepts-in-apache-beam\" style=\"position:relative;\"><a href=\"#basic-concepts-in-apache-beam\" aria-label=\"basic concepts in apache beam permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Basic Concepts in Apache Beam</h2>\n<p>Apache Beam has three main abstractions. They are</p>\n<ol>\n<li>Pipeline</li>\n<li>PCollection</li>\n<li>PTransform</li>\n</ol>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 13.999999999999998%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAADCAYAAACTWi8uAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA/klEQVQI1wHzAAz/APXx65U1ZahDOWmr/0Fvr/osX6b/Y4e5ef///z8mWaBRNGWq/zdnq/ktYKf/dJO/bv///zsfVJ5bPWut/0BurvkvYaf/SXSwPvbz7Z3k5ebHAOPg28VLd7VKOmqu/0t2tP8zZKr/cJC8k///73coV5paOGir/0NxsP8xY6n/g57Cjf//73EfUphjPmyu/0l0sv82Zqr/Y4e6TNrX09PS0tP/AHlsWRhcc5MrJU6HZyNSlFUwYqlUDEeaFpWsywAuY60YK16mUyZapE0tX6ZUADWTD5OqygAxZa0cK16lVChcpU0vYadTCEacDf/v1wvf4eMUMeqAEPko5kUAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Beam-Pipeline\"\n        title=\"Beam-Pipeline\"\n        src=\"/static/439968fcb84e700e21b6475c5aa49214/e5715/pipeline-design.png\"\n        srcset=\"/static/439968fcb84e700e21b6475c5aa49214/a6d36/pipeline-design.png 650w,\n/static/439968fcb84e700e21b6475c5aa49214/e5715/pipeline-design.png 768w,\n/static/439968fcb84e700e21b6475c5aa49214/1132d/pipeline-design.png 1158w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h3 id=\"pipeline\" style=\"position:relative;\"><a href=\"#pipeline\" aria-label=\"pipeline permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Pipeline:</h3>\n<p>A pipeline is the first abstraction to be created. It holds the complete data processing job from start to finish, including reading data, manipulating data, and writing data to a sink. Every pipeline takes in options/parameters that indicate where and how to run. </p>\n<h3 id=\"pcollection\" style=\"position:relative;\"><a href=\"#pcollection\" aria-label=\"pcollection permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>PCollection:</h3>\n<p>A pcollection is an abstraction of distributed data. A pcollection can be bounded, i.e., finite data, or unbounded, i.e., infinite data. The initial pcollection is created by reading data from the source. From then on, pcollections are the source and sink of every step in the pipeline.</p>\n<h3 id=\"transform\" style=\"position:relative;\"><a href=\"#transform\" aria-label=\"transform permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Transform:</h3>\n<p>A transform is a data processing operation. A transform is applied on one or more pcollections. Complex transforms have other transform nested within them. Every transform has a generic <code>apply</code> method where the logic of the transform sits in.</p>\n<h2 id=\"example-of-pipeline\" style=\"position:relative;\"><a href=\"#example-of-pipeline\" aria-label=\"example of pipeline permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example of Pipeline</h2>\n<p>Here, let's write a pipeline to output all the jsons where the name starts with a vowel.</p>\n<p>Let's take a sample input. Name the file as <code>input.json</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"json\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk8\">&quot;abhi&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">&quot;score&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk7\">12</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk8\">&quot;virat&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">&quot;score&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk7\">23</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk8\">&quot;dhoni&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">&quot;score&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk7\">45</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk8\">&quot;rahul&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">&quot;score&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk7\">156</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;Edmund&quot;</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;Ojha&quot;</span><span class=\"mtk1\">}</span></span></code></pre>\n<p>The input should be a newline delimited JSON.</p>\n<p>Include the following dependencies in your <code>pom.xml</code></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">&lt;dependency&gt;</span>\n<span class=\"grvsc-line\">    &lt;groupId&gt;org.apache.beam&lt;/groupId&gt;</span>\n<span class=\"grvsc-line\">    &lt;artifactId&gt;beam-sdks-java-core&lt;/artifactId&gt;</span>\n<span class=\"grvsc-line\">    &lt;version&gt;2.24.0&lt;/version&gt;</span>\n<span class=\"grvsc-line\">&lt;/dependency&gt;</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">&lt;dependency&gt;</span>\n<span class=\"grvsc-line\">    &lt;groupId&gt;org.apache.beam&lt;/groupId&gt;</span>\n<span class=\"grvsc-line\">    &lt;artifactId&gt;beam-runners-direct-java&lt;/artifactId&gt;</span>\n<span class=\"grvsc-line\">    &lt;version&gt;2.24.0&lt;/version&gt;</span>\n<span class=\"grvsc-line\">&lt;/dependency&gt;</span></code></pre>\n<p>Let's code the beam pipeline. Follow the steps</p>\n<ol>\n<li>\n<p>Create a pipeline.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk10\">Pipeline</span><span class=\"mtk1\"> </span><span class=\"mtk12\">pipeLine</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">Pipeline</span><span class=\"mtk1\">.</span><span class=\"mtk11\">create</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// OR </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// Pipeline pipeLine = Pipeline.create(options);</span></span></code></pre>\n<p>Create a pipeline which binds all the pcollections and transforms. Optionally you can pass the PipelineOptions <code>options</code> if needed.</p>\n</li>\n<li>\n<p>Read the input file</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk10\">PCollection</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">String</span><span class=\"mtk1\">&gt; </span><span class=\"mtk12\">inputCollection</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">pipeLine</span><span class=\"mtk1\">.</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Read My File&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">TextIO</span><span class=\"mtk1\">.</span><span class=\"mtk11\">read</span><span class=\"mtk1\">().</span><span class=\"mtk11\">from</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;input.json&quot;</span><span class=\"mtk1\">));</span></span></code></pre>\n<p>Use the <code>TextIO</code> transform to read the input files. Every line is a different json record.</p>\n</li>\n<li>\n<p>Apply a transform to filter out the names starting from a vowel</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk10\">PCollection</span><span class=\"mtk1\"> </span><span class=\"mtk12\">filteredCollection</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">inputCollection</span><span class=\"mtk1\">.</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Filter names starting with vowels&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">Filter</span><span class=\"mtk1\">.</span><span class=\"mtk11\">by</span><span class=\"mtk1\">(</span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">SerializableFunction</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">String</span><span class=\"mtk1\">, </span><span class=\"mtk10\">Boolean</span><span class=\"mtk1\">&gt;() {</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Boolean</span><span class=\"mtk1\"> </span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk10\">String</span><span class=\"mtk1\"> </span><span class=\"mtk12\">input</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk10\">ObjectMapper</span><span class=\"mtk1\"> </span><span class=\"mtk12\">jacksonObjMapper</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk11\">ObjectMapper</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk15\">try</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk10\">JsonNode</span><span class=\"mtk1\"> </span><span class=\"mtk12\">jsonNode</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">jacksonObjMapper</span><span class=\"mtk1\">.</span><span class=\"mtk11\">readTree</span><span class=\"mtk1\">(input);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk10\">String</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">jsonNode</span><span class=\"mtk1\">.</span><span class=\"mtk11\">get</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;name&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">textValue</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">vowels</span><span class=\"mtk1\">.</span><span class=\"mtk11\">contains</span><span class=\"mtk1\">(</span><span class=\"mtk12\">name</span><span class=\"mtk1\">.</span><span class=\"mtk11\">substring</span><span class=\"mtk1\">(</span><span class=\"mtk7\">0</span><span class=\"mtk1\">,</span><span class=\"mtk7\">1</span><span class=\"mtk1\">).</span><span class=\"mtk11\">toLowerCase</span><span class=\"mtk1\">());</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            } </span><span class=\"mtk15\">catch</span><span class=\"mtk1\"> (</span><span class=\"mtk10\">JsonProcessingException</span><span class=\"mtk1\"> </span><span class=\"mtk12\">e</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">e</span><span class=\"mtk1\">.</span><span class=\"mtk11\">printStackTrace</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk4\">false</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }))</span></span></code></pre>\n<p>The filter transform takes a SerializableFunction Object where the <code>apply</code> method is overridden. Every json-string record is converted to a JSON. The first character of the <code>name</code> is checked if it's a vowel. The transform is applied to each input JSON record. Based on the boolean value returned, the record is retained or discarded.</p>\n</li>\n<li>\n<p>Write the results to a file</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">inputCollection</span><span class=\"mtk1\">.</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;write to file&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">TextIO</span><span class=\"mtk1\">.</span><span class=\"mtk11\">write</span><span class=\"mtk1\">().</span><span class=\"mtk11\">to</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;result&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">withSuffix</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.txt&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">withoutSharding</span><span class=\"mtk1\">());</span></span></code></pre>\n<p>The results of the <code>Filter</code> transform are stored in a text file using the write method of the <code>TextIO</code> transform. As PCollections are distributed across machines, the results are written to multiple files/shards. To avoid this, we use <code>withoutSharding</code> where all the output is written to a single file.</p>\n</li>\n</ol>\n<p>Output:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"json\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;Edmund&quot;</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;Ojha&quot;</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span><span class=\"mtk12\">&quot;name&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk8\">&quot;abhi&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">&quot;score&quot;</span><span class=\"mtk1\">:</span><span class=\"mtk7\">12</span><span class=\"mtk1\">}</span></span></code></pre>\n<hr>\n<p>Complete Code:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"java\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk10\">Pipeline</span><span class=\"mtk1\"> </span><span class=\"mtk12\">pipeLine</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">Pipeline</span><span class=\"mtk1\">.</span><span class=\"mtk11\">create</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">final</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Set</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">String</span><span class=\"mtk1\">&gt; </span><span class=\"mtk12\">vowels</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">HashSet</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">String</span><span class=\"mtk1\">&gt;(</span><span class=\"mtk12\">Arrays</span><span class=\"mtk1\">.</span><span class=\"mtk11\">asList</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;a&quot;</span><span class=\"mtk1\">,</span><span class=\"mtk8\">&quot;e&quot;</span><span class=\"mtk1\">,</span><span class=\"mtk8\">&quot;i&quot;</span><span class=\"mtk1\">,</span><span class=\"mtk8\">&quot;o&quot;</span><span class=\"mtk1\">,</span><span class=\"mtk8\">&quot;u&quot;</span><span class=\"mtk1\">));</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">pipeLine</span><span class=\"mtk1\">.</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Read My File&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk12\">TextIO</span><span class=\"mtk1\">.</span><span class=\"mtk11\">read</span><span class=\"mtk1\">().</span><span class=\"mtk11\">from</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;input.json&quot;</span><span class=\"mtk1\">))</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        .</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Filter names starting with vowels&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">Filter</span><span class=\"mtk1\">.</span><span class=\"mtk11\">by</span><span class=\"mtk1\">(</span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk10\">SerializableFunction</span><span class=\"mtk1\">&lt;</span><span class=\"mtk10\">String</span><span class=\"mtk1\">, </span><span class=\"mtk10\">Boolean</span><span class=\"mtk1\">&gt;() {</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            </span><span class=\"mtk4\">public</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Boolean</span><span class=\"mtk1\"> </span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk10\">String</span><span class=\"mtk1\"> </span><span class=\"mtk12\">input</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk10\">ObjectMapper</span><span class=\"mtk1\"> </span><span class=\"mtk12\">jacksonObjMapper</span><span class=\"mtk1\"> = </span><span class=\"mtk15\">new</span><span class=\"mtk1\"> </span><span class=\"mtk11\">ObjectMapper</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk15\">try</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk10\">JsonNode</span><span class=\"mtk1\"> </span><span class=\"mtk12\">jsonNode</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">jacksonObjMapper</span><span class=\"mtk1\">.</span><span class=\"mtk11\">readTree</span><span class=\"mtk1\">(input);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk10\">String</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">jsonNode</span><span class=\"mtk1\">.</span><span class=\"mtk11\">get</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;name&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">textValue</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">vowels</span><span class=\"mtk1\">.</span><span class=\"mtk11\">contains</span><span class=\"mtk1\">(</span><span class=\"mtk12\">name</span><span class=\"mtk1\">.</span><span class=\"mtk11\">substring</span><span class=\"mtk1\">(</span><span class=\"mtk7\">0</span><span class=\"mtk1\">,</span><span class=\"mtk7\">1</span><span class=\"mtk1\">).</span><span class=\"mtk11\">toLowerCase</span><span class=\"mtk1\">());</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                } </span><span class=\"mtk15\">catch</span><span class=\"mtk1\"> (</span><span class=\"mtk10\">JsonProcessingException</span><span class=\"mtk1\"> </span><span class=\"mtk12\">e</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                    </span><span class=\"mtk12\">e</span><span class=\"mtk1\">.</span><span class=\"mtk11\">printStackTrace</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk4\">false</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">            }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        }))</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        .</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;write to file&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">TextIO</span><span class=\"mtk1\">.</span><span class=\"mtk11\">write</span><span class=\"mtk1\">().</span><span class=\"mtk11\">to</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;result&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">withSuffix</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.txt&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">withoutSharding</span><span class=\"mtk1\">());</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">pipeLine</span><span class=\"mtk1\">.</span><span class=\"mtk11\">run</span><span class=\"mtk1\">().</span><span class=\"mtk11\">waitUntilFinish</span><span class=\"mtk1\">();</span></span></code></pre>\n<p>For more advanced concepts, refer to the official site - beam.apache.org</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n</style>","frontmatter":{"date":"October 16, 2020","updated_date":null,"title":"Apache Beam: A Basic Guide","tags":["Engineering","Big Data","Streaming","Apache Beam","Java"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/17c96c6367455f79bdb854c4608ebaba/ee604/main.png","srcSet":"/static/17c96c6367455f79bdb854c4608ebaba/69585/main.png 200w,\n/static/17c96c6367455f79bdb854c4608ebaba/497c6/main.png 400w,\n/static/17c96c6367455f79bdb854c4608ebaba/ee604/main.png 800w,\n/static/17c96c6367455f79bdb854c4608ebaba/f3583/main.png 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Abhilash K R","github":"Better-Boy","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/what-is-graphql/"},"html":"<p>GraphQL's popularity has skyrocketed since its release in 2015. It is the modern way of developing and querying APIs. GraphQL is an application programming interface (API) query language and server-side runtime that prioritises giving customers precisely the data they request.</p>\n<p>GraphQL is designed to make fast, scalable, and <a href=\"/what-is-an-api/\">developer-friendly APIs</a>. GraphQL allows developers to build requests that pull data from multiple data sources in a single API call as an alternative to REST.</p>\n<h2 id=\"foundation-of-graphql\" style=\"position:relative;\"><a href=\"#foundation-of-graphql\" aria-label=\"foundation of graphql permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Foundation of GraphQL</h2>\n<p>It was developed internally by <a href=\"https://techcrunch.com/2018/11/06/facebooks-graphql-gets-its-own-open-source-foundation/\">Facebook in 2012</a> before being publicly released in 2015. \"On 7 November 2018, the GraphQL project was moved from Facebook to the newly-established GraphQL Foundation, hosted by the non-profit Linux Foundation.\"</p>\n<h2 id=\"what-is-graphql\" style=\"position:relative;\"><a href=\"#what-is-graphql\" aria-label=\"what is graphql permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is GraphQL?</h2>\n<p>GraphQL is an application-level query language that helps data fetching and serving between client and server runtime by providing a standard protocol for queries. Its strength lies in the fact that it offers a modern, simpler, and efficient way to query and develop APIs. The real deal is its <strong>flexible data fetching</strong> -- the application only loads relevant data from the server. Also, GraphQL is hierarchical in nature; it structures relationships in a simple hierarchical manner to avoid complex queries while fetching data.</p>\n<h2 id=\"why-to-use-graphql\" style=\"position:relative;\"><a href=\"#why-to-use-graphql\" aria-label=\"why to use graphql permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Why to use GraphQL?</h2>\n<p>GraphQL <strong>offers much power and flexibility</strong> over Traditional APIs. One of the few things GraphQL was designed, was to solve Data Fetching/Loading problems.</p>\n<p>Data fetching is one of the most critical factors responsible for the performance of the application. Most of the time, the data provided by the API isn't required to run the application. This problem is termed as <strong>\"Over fetching\"</strong>, which can be a more significant issue in mobile devices. Since devices with slower network connection are bound to take more load time, it creates a <strong>negative impact on end-users.</strong></p>\n<p>In the current scenario, traditional <a href=\"/best-practice-guide-for-rest-api-security/\">REST APIs</a> offer no clean way to solve this problem; GraphQL comes to the rescue. It allows <strong>clients to define the structure of the data</strong> required, and the same structure of the data is returned from the server. Therefore preventing fetching loads and loads of data, ultimately increasing performance.</p>\n<p>API endpoints generally fetch specific data, hence to load a certain data-rich application, there have to be <strong>multiple requests to the server.</strong> But, applications should fetch relevant data in one round trip to avoid <strong>degrading performance.</strong> The flexibility and richness of the GraphQL, allows us to define all the data to fetch in a single request, avoiding multiple Round trips</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 50%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAIAAAA7N+mxAAAACXBIWXMAAAsTAAALEwEAmpwYAAABZklEQVQoz4VRXW8TMRC8//+GEIhfg3hBRaSUBySq43pqm0Caj8udY3s/vONesUlUCfrAarWatWfWq3Fjp0iGbPGAoatJo7G34aZiPhq5Mw574LGST9GctWqPT7a+ypdv5s+v5s03TPf48m4u7XiLfYvLt/Pi9by6yPNTJf8lfo5yIdGUazJlJiSxJNBY6j/cF2LDnxHJEsCdo86JKkXWMhX/FZ8iw6LQ+yV/WC37u+v2um1b7z2AF2KcF64PpupHBWqh96EPIiosRFTA6fxZ0liuvSqgyAT1JgGxuO2QQhaX2WUaITGnAERDsUBRRwBNmjh+3KQhrom7LTko3zj+tIsmt45WTghCF1vpp8G02/FWJO0jFcmRG53YL36lkTYx/ng4hJzoboxXD6Ta78f7YWLV+HUjSzcm+f5ztw0hHaJfrNVxU7b3HBLK+la+JReTVQLHAspyUM3IrFwMyYWqglQ9OVIo9TePzzpP+VoO0QAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Wrapping a REST API in GraphQL\"\n        title=\"Wrapping a REST API in GraphQL\"\n        src=\"/static/7de39de94c321c5ef5ad1991b63fc1ee/e5715/wrapper.png\"\n        srcset=\"/static/7de39de94c321c5ef5ad1991b63fc1ee/a6d36/wrapper.png 650w,\n/static/7de39de94c321c5ef5ad1991b63fc1ee/e5715/wrapper.png 768w,\n/static/7de39de94c321c5ef5ad1991b63fc1ee/e8950/wrapper.png 2000w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span>\n<em>Wrapping REST API in graphQL - Source - Joey Ng'ethe | TwigaTech</em></p>\n<h2 id=\"fundamentals-of-graphql\" style=\"position:relative;\"><a href=\"#fundamentals-of-graphql\" aria-label=\"fundamentals of graphql permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Fundamentals of GraphQL</h2>\n<table>\n<thead>\n<tr>\n<th>Server -></th>\n<th>GraphQL Server -></th>\n<th>Graphql Client -></th>\n<th>Client</th>\n</tr>\n</thead>\n<tbody>\n</tbody>\n</table>\n<hr>\n<p><strong>Schema</strong> - GraphQL follows a type system to define the schema of an API. The syntax for writing schemas is called Schema Definition Language (SDL).</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\"># </span><span class=\"mtk12\">A</span><span class=\"mtk1\"> </span><span class=\"mtk12\">simple</span><span class=\"mtk1\"> </span><span class=\"mtk12\">example</span><span class=\"mtk1\"> </span><span class=\"mtk12\">to</span><span class=\"mtk1\"> </span><span class=\"mtk12\">define</span><span class=\"mtk1\"> </span><span class=\"mtk12\">schema</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">type</span><span class=\"mtk1\"> </span><span class=\"mtk10\">Person</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  name: String!</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  age: Int!</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p><strong>Query</strong> - The data or information that a client needs from a server can be fetched in a request using queries.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"json\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\"># This query fetches all specifically names of all users</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk14\">users</span><span class=\"mtk1\"> </span><span class=\"mtk14\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk14\">name</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"># This query fetches all names of all friends of user </span><span class=\"mtk8\">&quot;Anup&quot;</span><span class=\"mtk1\">.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk14\">user(name</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;Anup&quot;</span><span class=\"mtk14\">)</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk14\">name</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk14\">friend</span><span class=\"mtk1\"> </span><span class=\"mtk14\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk14\">name</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p><strong>Mutation</strong> - Mutations are the way to modify data to the server; these include creating/updating/deleting data. They have similar syntax as queries, with special keywords ahead of them.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"json\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\"># This mutation adds a user with name </span><span class=\"mtk8\">&quot;Anup&quot;</span><span class=\"mtk1\"> and age </span><span class=\"mtk7\">20</span><span class=\"mtk1\">.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">mutation {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk14\">addUser(</span><span class=\"mtk1\"> </span><span class=\"mtk14\">name</span><span class=\"mtk1\"> : </span><span class=\"mtk8\">&quot;Anup&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk14\">age</span><span class=\"mtk1\">: </span><span class=\"mtk7\">20</span><span class=\"mtk14\">)</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk14\">name</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk14\">age</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>Despite its powers, you might not need graphQL in your applications -</p>\n<ul>\n<li>Since it adds unnecessary overhead and complex architecture for simple applications.</li>\n<li>It makes web caching challenging to implement.</li>\n</ul>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>GraphQL is a step forward in the world of applications by providing a significant boost in performance. Another plus point of GraphQL is that it is not meant to replace any existing solution but enhance and co-exist with REST APIs. Simply put, the future of GraphQL looks bright.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk14 { color: #F44747; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n</style>","frontmatter":{"date":"October 01, 2020","updated_date":null,"title":"What is GraphQL? - A Basic Guide","tags":["Engineering","API","GraphQL","Performance"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/926f1c395eca216d1174370ca687b800/ee604/graph.png","srcSet":"/static/926f1c395eca216d1174370ca687b800/69585/graph.png 200w,\n/static/926f1c395eca216d1174370ca687b800/497c6/graph.png 400w,\n/static/926f1c395eca216d1174370ca687b800/ee604/graph.png 800w,\n/static/926f1c395eca216d1174370ca687b800/db955/graph.png 900w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Anup Aglawe","github":"anup-a","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/oauth2/"},"html":"<h1 id=\"getting-started-with-oauth-20\" style=\"position:relative;\"><a href=\"#getting-started-with-oauth-20\" aria-label=\"getting started with oauth 20 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Getting Started with OAuth 2.0</h1>\n<p>OAuth has been a jargon for quite some time now and it is difficult for a beginner to learn it, not because OAuth is hard, but because of the confusing facts found about OAuth on the web. So I wrote this article to explain why and how OAuth is used in very simple terms.</p>\n<p>Let’s start with the basics: OAuth stands for Open Authorization. It’s a process through which an application or website can access private data from another website.\nIt provides applications the ability for “secure designated access.” For example, you can tell Google that it’s OK for abc.com to access your google account or contact without having to give abc.com your google password. </p>\n<p>OAuth never share password data but instead uses authorization tokens to prove an identity between consumers and service providers. OAuth is an authentication protocol that allows you to approve one application interacting with another on your behalf without giving away your password.</p>\n<h3 id=\"now-lets-have-a-look-at-oauth-20-terminology\" style=\"position:relative;\"><a href=\"#now-lets-have-a-look-at-oauth-20-terminology\" aria-label=\"now lets have a look at oauth 20 terminology permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Now Let’s have a look at OAuth 2.0 Terminology.</h3>\n<ul>\n<li><strong>Resource Owner:</strong> The resource owner is the user who authorizes an application to access their account. The application's access to the user's account is limited to the “scope” of the authorization granted (e.g., read or write access).</li>\n<li><strong>Client:</strong> The client is the application that’s trying to access the user's account. It needs to get permission from the user before accessing the account. For example, a client application can present the user with the login page to get an access token for access to a particular resource.</li>\n<li><strong>Authorization Server:</strong> The authorization server validates the user credentials and redirects the user back to the client with an authorization code. The client communicates with the authorization server to confirm its identity and exchanges the code for an access token.</li>\n<li><strong>Resource Server:</strong> A resource server is a server for access-protected resources. It handles authenticated requests from an app that has an access token. </li>\n<li><strong>Scope:</strong> It specifies the level of access that the application is requesting from the client.</li>\n<li><strong>Consent:</strong> The consent screen tells your users who is requesting access to their data and what kind of data you're asking to access. </li>\n</ul>\n<p>We have a pretty good understanding of OAuth 2.0 and Terminology, let’s move further and discuss the OAuth grant type that is widely used in this protocol.</p>\n<p>In total, there are five different grant type flows defined and described to perform authorizations tasks. Those are</p>\n<ul>\n<li>Authorization Code Grant</li>\n<li>Implicit Grant</li>\n<li>Resource Owner Credentials Grant</li>\n<li>Client Credentials Grant</li>\n<li>Refresh Token Grant</li>\n</ul>\n<h3 id=\"authorization-code-grant\" style=\"position:relative;\"><a href=\"#authorization-code-grant\" aria-label=\"authorization code grant permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Authorization Code Grant</h3>\n<p>The Authorization Code Grant Type is the most commonly used grant type.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 56.30769230769231%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAIAAADwazoUAAAACXBIWXMAAAsTAAALEwEAmpwYAAABP0lEQVQoz6VSy27DIBD0/39VD1WkSJHaWw7Oo41xEhw/sF1YMI90AokVVZV66EhGZtnZnR3Irv9Ahs+GIEcRtJyjIeJXgo1Ipzeydo73wljjnpJwPEX8YFZVxTkfhuFOpq69LF7k21Keysl5EKSURVGUZTmOI7bGGKzOOaVUvtnuPj77B9kT23XL12G1GI9MINuYtm3zPO/7fhbvvUdbKdWZV0XB6rrRWmdh6NTqPQluOrHdbBhjaHVTRCSEwIr+0IKg8x7lbBwH8ZvsS90cGQvW8vN5vV6jJ1JRuItomgbkWQJpzcoTkX4YRoRhIAxTJTPBRPxwOOz3e/wj8mxkcaznma/JIYolAKT6KA8RjJ2sSkAcO/u4gjtZk7LR1cTEimnBxJVA80wOwZO245ckpYMPWXJyLvznq0qZNRcTTd8fTX5uA9GrbgAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Authorization Code Grant\"\n        title=\"Authorization Code Grant\"\n        src=\"/static/c45e678b01cae83852178c3e0fd38eda/e5715/image4.png\"\n        srcset=\"/static/c45e678b01cae83852178c3e0fd38eda/a6d36/image4.png 650w,\n/static/c45e678b01cae83852178c3e0fd38eda/e5715/image4.png 768w,\n/static/c45e678b01cae83852178c3e0fd38eda/d9199/image4.png 960w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p><strong>The Story:</strong> A user tries to log in on  abc.com  but he can’t remember his password and he discovers an option to sign in with google, by clicking on this, the user will easily get logged using google account.</p>\n<p><strong>Flow</strong></p>\n<p>The client redirects the user to the authorization server having the following parameters in the query string.</p>\n<p><strong>Step 1</strong></p>\n<ul>\n<li><strong>response_type</strong> having the value code</li>\n<li><strong>client_id</strong> having the client identifier</li>\n<li><strong>redirect_uri</strong> having the client redirect URI. </li>\n<li><strong>scope</strong> a space-delimited list of scopes</li>\n<li><strong>state</strong> having a random string </li>\n</ul>\n<p>After successful authentication, the user will be redirected to the Consent screen where he needs to provide consent to abc.com to access the account detail.\nAuthorization code is generated by the authorization server and sent back to the client with redirect Uri.</p>\n<p><strong>Step 2</strong>\nThe client will now send a POST request to the authorization server with the following parameters:</p>\n<ul>\n<li><strong>grant_type</strong> having the value of authorization_code</li>\n<li><strong>client_id</strong> having the client identifier</li>\n<li><strong>client_secret</strong> having the client secret</li>\n<li><strong>redirect_uri</strong> having the same redirect URI the user redirected back.</li>\n<li><strong>code</strong> having the authorization code from the query string</li>\n</ul>\n<p>In the entire flow, the access token is never exposed to a web browser.</p>\n<h3 id=\"implicit-grant\" style=\"position:relative;\"><a href=\"#implicit-grant\" aria-label=\"implicit grant permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Implicit Grant</h3>\n<p>The Implicit flow was a simplified OAuth flow previously recommended for client-side applications like JavaScript apps where the access token was returned immediately without an extra authorization code exchange step.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 56.30769230769231%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAIAAADwazoUAAAACXBIWXMAAAsTAAALEwEAmpwYAAABHklEQVQoz6WRW0+EMBCF+f//ShOzGk185EEQDQW2UFwKlBl6wwHEXS8bN/EkTQqZr3PmTDD9QwEd473qGo/qEsAs8t5/wGgtl81oRntS5JyjImtP/030WZYl57xt2w0+vIndlXq8U0WmrRsRiazrOkmSqqrGcdSL6C2l1FMUPb+8yg12wGKxu27vb9oslV03qNl/nucE933/pbNznJdpyoSoETGYuqa9fZB6tlcfDnEcM8ao27mZaVqzGAGA2XYp6iJjnibf78MwjKNohf2ibzAgsqwAwG1mgGEYKIyfpb92TnMhj4EhUnqrE+ppz4uC1NqS7eOeCUMYrDFEUqTrkqSUzSK6rDtbrDlA0/UKBvTOB6uTz4f/tL1WCt5o0O8PqYFDZ9VclAAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Implicit Grant\"\n        title=\"Implicit Grant\"\n        src=\"/static/e3f47393896df6a6eaa11af651d2d857/e5715/image2.png\"\n        srcset=\"/static/e3f47393896df6a6eaa11af651d2d857/a6d36/image2.png 650w,\n/static/e3f47393896df6a6eaa11af651d2d857/e5715/image2.png 768w,\n/static/e3f47393896df6a6eaa11af651d2d857/d9199/image2.png 960w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>The Story: In this flow abc.com directly get access token without an extra authorization code exchange steps and able to access resources on a resource server</p>\n<p><strong>Flow</strong></p>\n<p>The client will redirect the user to the authorization server with the following parameters in the query string:</p>\n<ul>\n<li><strong>response_type</strong> having the value token</li>\n<li><strong>client_id</strong> having the client identifier</li>\n<li><strong>redirect_uri</strong> having the client redirect URI. </li>\n<li><strong>scope</strong> a space-delimited list of scopes</li>\n<li><strong>state</strong> having the random string</li>\n</ul>\n<p>It is not recommended to use the implicit flow (and some servers prohibit this flow entirely) due to the inherent risks of returning access tokens in an HTTP redirect without any confirmation that it has been received by the client.</p>\n<h3 id=\"resource-owner-credentials-grant\" style=\"position:relative;\"><a href=\"#resource-owner-credentials-grant\" aria-label=\"resource owner credentials grant permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Resource Owner Credentials Grant</h3>\n<p>The resource owner password credentials grant type is suitable in cases where the resource owner has a trust relationship with the client, such as a highly privileged application. The authorization server should take special care when enabling this grant type and only allow it when other flows are not viable.</p>\n<p>This grant type is suitable for clients capable of obtaining the resource owner’s credentials (username and password, typically using an interactive form). It is also used to migrate existing clients using direct authentication schemes such as HTTP Basic or Digest authentication to OAuth by converting the stored credentials to an access token.</p>\n<p><strong>Flow</strong></p>\n<p>The client will ask the user for their authorization credentials (usually a username and password).\nThe client then sends a POST request with following body parameters to the authorization server:</p>\n<ul>\n<li><strong>grant_type</strong> having the value password</li>\n<li><strong>client_id</strong> having the client’s ID</li>\n<li><strong>client_secret</strong> having the client’s secret</li>\n<li><strong>scope</strong> having a space-delimited list of requested scope permissions.</li>\n<li><strong>username</strong> having  a user’s username</li>\n<li><strong>password</strong> having a user’s password</li>\n</ul>\n<h3 id=\"client-credentials-grant\" style=\"position:relative;\"><a href=\"#client-credentials-grant\" aria-label=\"client credentials grant permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Client Credentials Grant</h3>\n<p>Using this flow the client can request an access token using only its client credentials (or other supported means of authentication).</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 56.30769230769231%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAIAAADwazoUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAh0lEQVQoz8WQTQvCMBBE+///oHgqgocKASGGdLObzDrGr+KxBfsguWzezpDBNzDwGJDn5Cpr5XxzndfIG2u7XE4yTdbgwHOQUgohxBiXr82slKKqIgKAMqp7PB7yeGb/arwetA4WUKZz7XD1K5lCqdVa41a8Qzj+iSVcp51Pcgffwn/8sH3kO1t0jcbKdW8qAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Client Credentials Grant\"\n        title=\"Client Credentials Grant\"\n        src=\"/static/50e12cb65c96fbbf7e1d502e6dacc539/e5715/image3.png\"\n        srcset=\"/static/50e12cb65c96fbbf7e1d502e6dacc539/a6d36/image3.png 650w,\n/static/50e12cb65c96fbbf7e1d502e6dacc539/e5715/image3.png 768w,\n/static/50e12cb65c96fbbf7e1d502e6dacc539/d9199/image3.png 960w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p><strong>The Story:</strong> The client application presents its client credentials (client identifier and client secret) to the authorization server requesting approval to access the protected resource (owned by the client application) on the resource server.\nThe authorization server authenticates the client credential and issues an access token.</p>\n<p><strong>Flow</strong></p>\n<p>The client sends a POST request with following body parameters to the authorization server:</p>\n<ul>\n<li><strong>grant_type</strong> having the value client_credentials</li>\n<li><strong>client_id</strong> having the client’s ID</li>\n<li><strong>client_secret</strong> having the client’s secret</li>\n<li><strong>scope</strong> having a space-delimited list of requested scope permissions.</li>\n</ul>\n<h3 id=\"refresh-token-grant\" style=\"position:relative;\"><a href=\"#refresh-token-grant\" aria-label=\"refresh token grant permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Refresh Token Grant</h3>\n<p>Access tokens eventually expire, however, some grants respond with a refresh token which enables the client to refresh the access token.</p>\n<p><strong>Flow</strong></p>\n<p>The client sends a POST request with following body parameters to the authorization server:</p>\n<ul>\n<li><strong>grant_type</strong> having the value refresh_token</li>\n<li><strong>refresh_token</strong> having the refresh token</li>\n<li><strong>client_id</strong> having the client’s ID</li>\n<li><strong>client_secret</strong> having the client’s secret</li>\n<li><strong>scope</strong> having a space-delimited list of requested scope permissions. </li>\n</ul>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>I hope you got an idea of how OAuth works and why it is needed. Now it’s time for you to go explore, find out more about the OAuth flow and implement it into your application.\nGood Luck and have fun! Thank you for following this article and hope it helped you! Please do buzz me if you want any help: indrasen.kumar@loginradius.com</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"August 24, 2020","updated_date":null,"title":"Getting Started with OAuth 2.0","tags":["Engineering","Oauth","Authentication"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7699115044247788,"src":"/static/e6413c80a3d38d63b14543319d3c54dd/ee604/oauth2.png","srcSet":"/static/e6413c80a3d38d63b14543319d3c54dd/69585/oauth2.png 200w,\n/static/e6413c80a3d38d63b14543319d3c54dd/497c6/oauth2.png 400w,\n/static/e6413c80a3d38d63b14543319d3c54dd/ee604/oauth2.png 800w,\n/static/e6413c80a3d38d63b14543319d3c54dd/40ffe/oauth2.png 960w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Indrasen Kumar","github":"indrasen715","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/working-with-aws-lambda-and-sqs/"},"html":"<p>This blog is a short guide on implementing AWS Lambda and SQS together. First we’ll introduce these technologies and explain why they work well together, then walkthrough some configurations and invocation using a simple Nodejs script.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 448px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 47.09821428571428%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAJCAIAAAC9o5sfAAAACXBIWXMAAAsTAAALEwEAmpwYAAAB2ElEQVQoz2P4DwT//gGJt49uvr207//f3//BQv9RAIj769evO5f2fHh2GS7KAMQfXzx6dnjFpqqgM5WW75fnfL++9/+fX8ha//z+de3cnlntsf2FBtfXhLw60//r412Q5k/P7++r8zteYbUp1+pCi9etmSmX2zzf758Jtu/vv79/gfTxPYvKY5SyglXSg7Vrkg1nVxrum+H97d1dhrf3r+0qsjnT4rUp3+5co9vVpQ0nl3TdXdUM1vv33z+Q5pO7Zq7vdljR6dGVbz67KXDrsvZrpzb8/v6B4d2D67uKbE83uG3Osz3b5HmgyPx8vdPddZ3Ims/tmzO11GB+o31/kdnV1cE31gZfWxP25c0NkObdJQ5nmr0259udbXS9PLvwyqquO2vakTWf2Ttn/yyfE8vid8yMeHCw4fW1FR8eHvzz4yPD+4c3dhRYHS+33Jxnfb7F6/O+SU8XZr3a2gWOBKifD2yZPrXM5OSavLcXpny8POnJwfLb2zJBfgaa//zqidsrmtYXuJyuMH81PeTD3ql/P7+BxhA4Fr99/bh/y6ymPLuefP1zi71vbM17d2//v7+/GcA2gFTcP7Pv8Y7p/z6/gsc8IpbB3M+f3p3eO+/1nb3/wX4BAgCRTp73+XcmigAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"blog aws lambda sqs 1\"\n        title=\"blog aws lambda sqs 1\"\n        src=\"/static/770c89c93d5798dacecb6b81d79b6c00/33b38/blog-aws-lambda-sqs-1.png\"\n        srcset=\"/static/770c89c93d5798dacecb6b81d79b6c00/33b38/blog-aws-lambda-sqs-1.png 448w\"\n        sizes=\"(max-width: 448px) 100vw, 448px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p><strong>What are they?</strong>\nAWS Lambda is a popular choice in serverless computing. As an event-driven platform, AWS Lambda requires users to configure event sources in order to run a function. Their built-in support for many AWS services like S3 and SQS as event sources allow for relatively simple configuration. Note that Lambda functions can also be triggered via HTTP(S) by using AWS API Gateway service.</p>\n<p>AWS SQS (Simple Queue Service) is a queue service with 2 types: standard and FIFO. The major difference is that standard queues guarantee “at-least once” delivery of its messages, while FIFO queues guarantee “exactly-once” delivery. FIFO queues, however, provide lower maximum throughput than standard.</p>\n<p>As previously mentioned, AWS SQS can be an event source for AWS Lambda. This means that when a message is added to the queue, the configured Lambda function will be invoked with an event containing this message.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 434px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 30.184331797235025%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAIAAABM9SnKAAAACXBIWXMAAAsTAAALEwEAmpwYAAABQUlEQVQY001QPUvDUBTNP7KDm9DNRf+Bk7ODCIUqOHUQFFGwXZ3t4gfVglTdLH5UKkoj9MumqWkbm7TJS/LSpHn3PtMUxcMdzr1czrn3CDwC9VGzIQDk/6DKYle8wokZdRgVJ0pDfz7nnhVyAZGrhGkWuD4aFBkLNE2zqSdV7o4S85lE7OUiCYE31IeuzwblwkNy4XU7rpxswdgWhg4QF2ZWAwv0kdmoV5uS8nSduTyI3x6vtIqHNtFr1ZqkqG/ZvceNWCm19JFe9Q1V6JtsdlMIk4LjhXSqVS/n8ullMbcm3++wCZ1tdIunxfW5SmpxkN0MHEMIbQ0KOvEMZ6I74AfIcQoAJpby7zf741Fzqo4QDn3Pk0sF6Wx33KsxwPBnZMhbbeVbN+E3Kox8KHXbnd5fhqFeX1U/252+NpLkL4uQH62JPUSBGRLAAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"blog aws lambda sqs 2\"\n        title=\"blog aws lambda sqs 2\"\n        src=\"/static/9ad82d0a34ee856fd75467a0556ee069/ade6e/blog-aws-lambda-sqs-2.png\"\n        srcset=\"/static/9ad82d0a34ee856fd75467a0556ee069/ade6e/blog-aws-lambda-sqs-2.png 434w\"\n        sizes=\"(max-width: 434px) 100vw, 434px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p><strong>But why use them together?</strong><br>\nCommon reasons include better handling Lambda function invocations and errors. For function invocations, the default concurrency limit is 1000. If a function has reached this limit, any additional invocations will fail with a throttling error. However, with SQS as an event source, events resulting in throttling errors are automatically retried based on set configs. This prevents the loss of events due to unexpected jumps in usage. Additionally, dead-letter queues (DLQ) can be configured as a place where failed events go, to avoid retrying indefinitely. Failed events in DLQ can then be sent somewhere like a DB for analysis.</p>\n<p>One limitation for many use cases was the “at-least once” delivery model of events with standard queues. Essentially, there was no guarantee that an event will only be delivered once to a consuming Lambda function. In cases where each event can strictly only be processed once, one would have to employ various strategies resulting in higher overhead and complexity. But, this is no longer an issue because recently the AWS team added support for FIFO queues as event sources to Lambda functions.</p>\n<p><strong>Walkthrough</strong><br>\nLet’s set up a basic “Hello World” application with SQS and Lambda.</p>\n<p>1. Starting with SQS, add a standard queue.</p>\n<p>2. Now, add a Lambda function:</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 43.69230769230769%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAJCAYAAAAywQxIAAAACXBIWXMAAAsTAAALEwEAmpwYAAABL0lEQVQoz32S627CMAyF+/7vtJeY9g9NCA00Sugl9zRNe7DdFjamEemTj+3EdtpUu889Dl9HXJsGbddBG00YGGthnROt7eKLJjjO/k+2XLU7HHE4K1x6B6U9+pDRuEQNrrgohRgjQgjwBOuUksQVwdZaJ3mOB8pXtc1QLqONE3QGugGkC07fCsZYDMMg8IFxHIWLaqR4jOmeK6WIrlTbwYYIR0nro2jrA43vl81DWhnuUxjrF3+NbTjvUZ3rmhyeIiOPBWNZKFMR/w/lsWeaJqGsOlLRSnUGrXGCSxlxpAQdfEXI3HDG85Ir85+Z55k6PDr+x8zMD82LzzK8khTUBs55uXamD55zXuym82KnrcDTVL8L0pV7rdH1/f19vYTf5opZraZ4W5/Qvr+h23/gBmfyuvrRFaCXAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"blog aws lambda sqs 3 1024x447\"\n        title=\"blog aws lambda sqs 3 1024x447\"\n        src=\"/static/fc4529f0bf774126503634505395642c/e5715/blog-aws-lambda-sqs-3-1024x447.png\"\n        srcset=\"/static/fc4529f0bf774126503634505395642c/a6d36/blog-aws-lambda-sqs-3-1024x447.png 650w,\n/static/fc4529f0bf774126503634505395642c/e5715/blog-aws-lambda-sqs-3-1024x447.png 768w,\n/static/fc4529f0bf774126503634505395642c/2bef9/blog-aws-lambda-sqs-3-1024x447.png 1024w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>3. Create a new execution role with the following configs:<br>\na. Trusted Entity: Lambda<br>\nb. Permissions: AWSLambdaBasicExecutionRole; AWSLambdaSQSQueueExecutionRole</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 512px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 57.03125%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAIAAADwazoUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA7ElEQVQoz4VSi27DIAzk/z+rv7BPqLQuRCSMp8FAdoUu6vrIToplgs/2XSK01uu6xhhrrdt/aK0xl22r0xJOH1JIKed5JqLwCzTa81JKewP0EswMJgiI3vtpmrAL2i3Lgpe4rR2j+gHi/oAi7rAdIKMdeiE3xuD4MPwPGUVKqX1zMPc4cM/EJPG8TC0FOqgjpYSYcx750WT0hvPOB+ucd31X843Zrd5wpBneWuuC04mcJ/YxBcox8SuznshA5sbm06rzZeUvFaQmfFLjczsmQxK2hD1QdxVIEc/Q+e6fEbiG1OGK76BO6walY/IPBgqFRAr7DkMAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"blog aws lambda sqs 4\"\n        title=\"blog aws lambda sqs 4\"\n        src=\"/static/9f83447cdf63a3b11b1098c9e83aa39b/01e7c/blog-aws-lambda-sqs-4.png\"\n        srcset=\"/static/9f83447cdf63a3b11b1098c9e83aa39b/01e7c/blog-aws-lambda-sqs-4.png 512w\"\n        sizes=\"(max-width: 512px) 100vw, 512px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>4. Use newly created role in Lambda function. Remember to save (top right).</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 759px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 39.84615384615385%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAICAIAAAB2/0i6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAA3ElEQVQY04VR23KFIAz0/z9TaLUtCohJUMDTRY+XPnUnLmuYTDahGa1VSmmtu65n5vgflgeaMM/GmGEcnXMppZxzyfniJ0qpkVNOJxqJEfV+mqxzYGjETBQqMQhHlUTG07eTVLbXiVqMKjMMff81E6P1mtIR6RSHlrjEZX09sHcOAdNeqW3bdr7182rbUwc3fgptq1qlMbjznkWqR+bDPD4IJN8Z/DPjGlXrmhpi0Z+9+uisDzB2+cx1NXdgV1i0SLTWgd+2SRYzyY8XS6unhfZueJLb5F+UUq5ZfgG9FdCeWW5mkAAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"blog aws lambda sqs 5\"\n        title=\"blog aws lambda sqs 5\"\n        src=\"/static/bc5c66a5797178bc7f81a10b4acc9df6/ef3e1/blog-aws-lambda-sqs-5.png\"\n        srcset=\"/static/bc5c66a5797178bc7f81a10b4acc9df6/a6d36/blog-aws-lambda-sqs-5.png 650w,\n/static/bc5c66a5797178bc7f81a10b4acc9df6/ef3e1/blog-aws-lambda-sqs-5.png 759w\"\n        sizes=\"(max-width: 759px) 100vw, 759px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>5. Add a trigger:<br>\na. Batch size set to 1, so the Lambda Function will process 1 message at a time.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 512px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 73.046875%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAIAAABr+ngCAAAACXBIWXMAAAsTAAALEwEAmpwYAAABYklEQVQoz41SW26DMBDksr1UD1NV6kd/q0C+m9KQQgwY/H7w6NhWoyI1TUYjawEPs15PVnfjMI5fzbnrKReCcX4/s12eF/t9XhRSKTyPjN3PrPo8HqvqoyzPhECsjVFa36bSHM7HtqmbpizL98MB/U/TZN1tYJsQIuuf30bSTcu8Luu8LNN8G1A673HMrH3NNRfW2Xma14jlf0Q1zBXEhA09pdZaE0+LNZhfUQHrD7A563uKM5/qum07FNXphMmBQsh0ikRslVIyxjdiCDB0tGEMzG2C1to5/6f5RhxatQYThjDQuVS7ycM5Mcmwrr8QxVKmSxMxXiJA8ogQo4gB7QqRzDdi0g191w3DgFHJ8COFAm2HAYbKqAiU6xZxYCOnNPwat+e9R882pMSHFfR+vYIg1gZZU3AUUl4IpP5RXyKpQyoV3irBFMUV0yxFHMG8ln58SkRNCCnrlhQv5eNDu3v6Bl0TYEVofcLmAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"blog aws lambda sqs 6\"\n        title=\"blog aws lambda sqs 6\"\n        src=\"/static/e46348dd03d3c4ba184bd06f4e989f4e/01e7c/blog-aws-lambda-sqs-6.png\"\n        srcset=\"/static/e46348dd03d3c4ba184bd06f4e989f4e/01e7c/blog-aws-lambda-sqs-6.png 512w\"\n        sizes=\"(max-width: 512px) 100vw, 512px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>6. Programmatically enqueue a message into SQS with the following code in Nodejs:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"javascript\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">AWS</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">require</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;aws-sdk&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">AWS</span><span class=\"mtk1\">.</span><span class=\"mtk12\">config</span><span class=\"mtk1\">.</span><span class=\"mtk11\">update</span><span class=\"mtk1\">({</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">region:</span><span class=\"mtk1\"> </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">AWS_SQS_REGION</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">, // TODO</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  accessKeyId: </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">AWS_ACCESS_KEY_ID</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">, // TODO</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  secretAccessKey: </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">AWS_SECRET_ACCESS_KEY</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\"> // TODO</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">});</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">const sqs = new AWS.SQS(</span><span class=\"mtk4\">{</span><span class=\"mtk1\"> </span><span class=\"mtk12\">apiVersion</span><span class=\"mtk1\">: </span><span class=\"mtk8\">&quot;2012-11-05&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk4\">}</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">sqs.sendMessage(</span><span class=\"mtk4\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">MessageBody</span><span class=\"mtk1\">: </span><span class=\"mtk10\">JSON</span><span class=\"mtk1\">.</span><span class=\"mtk11\">stringify</span><span class=\"mtk1\">({</span><span class=\"mtk12\">hello:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;world&quot;</span><span class=\"mtk1\">}),</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">QueueUrl</span><span class=\"mtk1\">: </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">AWS_SQS_URL</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\"> // TODO</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}, (err, data) =&gt; (err) ? console.log(&quot;Error&quot;, err) : console.log(&quot;Success&quot;, data.MessageId));</span></span></code></pre>\n<p>a. Create package.json with `npm init`<br>\nb. Install aws sdk dependency with `npm i aws-sdk --save`<br>\nc. Fill in your specific AWS account details. Find AWS_SQS_URL by selecting the queue you created, while AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY require creating a new IAM user with programmatic access. This user also needs permission to push messages into SQS.<br>\nd. Run script with `node app.js`<br>\ne. Navigate to Monitoring tab in your Lambda function, the invocations graph should have a new data point (may take a few minutes to update).</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 512px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 86.32812499999999%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAARCAIAAABSJhvpAAAACXBIWXMAAAsTAAALEwEAmpwYAAABWklEQVQ4y6VT207CQBDd//8p9UF4EX3BGAOV0qWRXvbe7S60BU9bBCSYFJ1MJzPdMzNn9kKU1sEifJ/NZ/OPJE2ZEPNggXBJqTKFXM1EOBXRm1ZSm0Ibc64EyYzzjLGcMaEAacM0zxkXKWNRFNLlIgqDz/VaGoPVcyVcCKCRCSeHw7lUqi8MR7SqO8VffaFk+jp9HI3v7h8mzy9Pk8loPI4otWWJNeSbojBFZ38SPtDGh0adPaD1NdxVbWdGQmEttKd6Mdhv2tJGM8ZYkiSrOMbY2+12M0AAs9YSjBfHMaUUVkq5HywoQZz3zjlUQrwbLN/Jzu2apq7r498bOpfO7f8kh85NJ8PT6g586nwT4dPM/6PtPXYLuw3m3ns4VVXBge2P9BhiqXdgAW6TrXOq3CBGwDnvtyDLMtTG/cFzgIOw6gQAhLjH/ekSY8tlqnK8QcZAoRkmGBv9vgB7ptYEeBKDOQAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"blog aws lambda sqs 7\"\n        title=\"blog aws lambda sqs 7\"\n        src=\"/static/7c84dcffcf1c9b4f5456154bbcf2f1ff/01e7c/blog-aws-lambda-sqs-7.png\"\n        srcset=\"/static/7c84dcffcf1c9b4f5456154bbcf2f1ff/01e7c/blog-aws-lambda-sqs-7.png 512w\"\n        sizes=\"(max-width: 512px) 100vw, 512px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk17 { color: #808080; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n</style>","frontmatter":{"date":"February 13, 2020","updated_date":null,"title":"Working with AWS Lambda and SQS","tags":["Engineering","General"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":2.127659574468085,"src":"/static/770c89c93d5798dacecb6b81d79b6c00/509ce/blog-aws-lambda.png","srcSet":"/static/770c89c93d5798dacecb6b81d79b6c00/69585/blog-aws-lambda.png 200w,\n/static/770c89c93d5798dacecb6b81d79b6c00/497c6/blog-aws-lambda.png 400w,\n/static/770c89c93d5798dacecb6b81d79b6c00/509ce/blog-aws-lambda.png 448w","sizes":"(max-width: 448px) 100vw, 448px"}}},"author":{"id":"Team LoginRadius","github":"LoginRadius","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/sdk-version-10-0-0/"},"html":"<p>We're delightfully Announcing SDK Version 10.0.0. </p>\n<p>This full-version release includes major changes with several improvements and optimizations, the details have been given below. For complete information please visit <a href=\"https://www.loginradius.com/docs/api/\">LoginRadius API documents</a>.</p>\n<h3 id=\"new-features-added\" style=\"position:relative;\"><a href=\"#new-features-added\" aria-label=\"new features added permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>New Features Added:</strong></h3>\n<ul>\n<li><strong>Added PIN Authentication feature APIs.</strong> : We have added the PIN authentication feature. By enabling this feature Customer can provide PIN code for the authorization process. For more details please refer to the <a href=\"https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/overview/\">PIN Authentication Document</a>.</li>\n<li><strong>Added Consent Management feature APIs. :</strong> The Consent Management feature allows collecting consent details from the new or existing customers so that you can further use that data.</li>\n<li><strong>Added Local SOTT generation (Secured one-time token):</strong> SOTT is used for LoginRadius user registration via the authentication API or via the Javascript Interfaces. Now SOTT can be generated from the SDK. More detail on SOTT Usage can be seen <a href=\"https://www.loginradius.com/docs/api/v2/customer-identity-api/sott-usage\">here</a>.</li>\n</ul>\n<h3 id=\"improvements-and-optimizations\" style=\"position:relative;\"><a href=\"#improvements-and-optimizations\" aria-label=\"improvements and optimizations permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Improvements and optimizations:</strong></h3>\n<ul>\n<li>Added internal parameter validations in the API function.</li>\n<li>ApiKey and ApiSecret usage redundancy removed.</li>\n<li>All LoginRadius related features need to be defined once only and SDK will handle them automatically.</li>\n<li>Improved the naming conventions of API functions for better readability.</li>\n<li>Better Error and Exception Handling for LoginRadius API Response in SDK.</li>\n<li>Completely revamped each SDK and restructured them with the latest API function names and parameters.</li>\n<li>Added detailed description to API functions and parameters for better understanding.</li>\n<li>Updated the SDK demos according to the latest SDK changes.</li>\n</ul>\n<h3 id=\"new-apis\" style=\"position:relative;\"><a href=\"#new-apis\" aria-label=\"new apis permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>New APIs:</strong></h3>\n<p>We have added new APIs in this release, that will complement the existing ones.</p>\n<ul>\n<li>Update Phone ID by UID</li>\n<li>Upsert Email</li>\n<li>Role Context profile</li>\n<li>MFA Resend OTP</li>\n<li>User Registration By Captcha</li>\n<li>Get Access Token via Linkedin Token</li>\n<li>Get Access Token By Foursquare Access Token</li>\n<li>Get Active Session By Account Id</li>\n<li>Get Active Session By Profile Id</li>\n<li>Delete User Profiles By Email</li>\n<li>Verify Multifactor OTP Authentication</li>\n<li>Verify Multifactor Password Authentication</li>\n<li>Verify Multifactor PIN Authentication</li>\n<li>Update UID</li>\n<li>MFA Re-authentication by PIN</li>\n<li>Pin Login</li>\n<li>Forgot Pin By Email</li>\n<li>Forgot Pin By UserName</li>\n<li>Reset PIN By ResetToken</li>\n<li>Reset PIN By SecurityAnswer And Email</li>\n<li>Reset PIN By SecurityAnswer And Username</li>\n<li>Reset PIN By SecurityAnswer And Phone</li>\n<li>Forgot Pin By Phone</li>\n<li>Change Pin By Token</li>\n<li>Reset PIN by Phone and OTP</li>\n<li>Reset PIN by Email and OTP</li>\n<li>Reset PIN by Username and OTP</li>\n<li>Set Pin By PinAuthToken</li>\n<li>Invalidate Pin Session Token</li>\n<li>Submit Consent By ConsentToken</li>\n<li>Get Consent Logs</li>\n<li>Submit Consent By AccessToken</li>\n<li>Verify Consent By AccessToken</li>\n<li>Update Consent Profile By AccessToken</li>\n<li>Get Consent Logs By Uid</li>\n<li>Album With Cursor</li>\n<li>Audio With Cursor</li>\n<li>Check-In With Cursor</li>\n<li>Event With Cursor</li>\n<li>Following With Cursor</li>\n<li>Group With Cursor</li>\n<li>Like With Cursor</li>\n</ul>\n<h3 id=\"removed-apis\" style=\"position:relative;\"><a href=\"#removed-apis\" aria-label=\"removed apis permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Removed APIs:</strong></h3>\n<p>To cope up with the changes around the social platforms, we have removed some existing APIs as they are no longer supported by the social providers. Below are the details of those APIs.</p>\n<ul>\n<li><strong>GetCompanies API:</strong> This API was used to get the list of companies from social sites. we removed this API because it is not supported by the social providers</li>\n<li><strong>Getstatus API:</strong> This API was used to get the status from social sites.</li>\n</ul>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"October 31, 2019","updated_date":null,"title":"SDK Version 10.0.0","tags":["Engineering","SDK","Version"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.3333333333333333,"src":"/static/88ba5be9965365e5417420f1910d9c33/497c6/SDK.png","srcSet":"/static/88ba5be9965365e5417420f1910d9c33/69585/SDK.png 200w,\n/static/88ba5be9965365e5417420f1910d9c33/497c6/SDK.png 400w","sizes":"(max-width: 400px) 100vw, 400px"}}},"author":{"id":"Indrasen Kumar","github":"indrasen715","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/getting-started-with-grpc-part-1-concepts/"},"html":"<p><em>This blog is part 1 of a series on gRPC. Part 1 will go over some important concepts, part 2 will be a walkthrough of a client-server implementation in Go, and part 3 will be about LoginRadius' experience migrating to gRPC!</em></p>\n<p><strong>gRPC</strong></p>\n<p>gRPC, simply put, is just another way to send data across networks. It can be used to communicate between services in a microservice architecture, where a single service can interact with multiple others. Similarly, in client-server models, there can be multiple clients communicating with a common backend server.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 281px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 108.54092526690391%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAWCAYAAADAQbwGAAAACXBIWXMAAAsTAAALEwEAmpwYAAACnklEQVQ4y6VUW2sTURDOP/KHifgmCAUfvCAqeIGCz4pgKahQJKFSawWt3dLUhrSb0GSzTdo07W6yt+x9z37unM1u0jTRgAPDmT2Z+TJz5pspYEriOOanYRiQJAm9Xg/dbpdrp9NBu93m977vX/HPpDAP0LIsiKKIZrOJer3O7VarhVqthoODg8UBZznNk8xv0r8w7TDpxBi7pnGiACn5cs//z/DbRYxqn3GbxQtmGIYhf6dMXc9HHHromAy3V/t4/73P/SKWZToHkIQAqLuapmEwGMA0TeiGCX+oYVv2cONWBfdf700Axn8HtG2bg2RCtpEAUobnFvDyYxflSit5z/DfTSFxHIfzMCu9UqlAEATOwUzsoQnP8xcDpAyp3NkNS09FUREEcwCn+UT0oLdTVZXr5eUlZFnOvxVF4RVkTZyMLyxCFfqNgBYh+bUMPc+D67pcyc6+aZY5fUb3mQ/dXcswXwimhfPeBXTd4G+o6zrXwUDjC2Hynk4qm+hFwDlgCpYCBk5ClcidWZKhz26SPbR4E69k6AUxxGScypIBoWmhfsEQRCzNPNEgZJDPFP630404V3XYCc3SMRwB7ndCPPni4NWmi3eCh8frDppKlGdBdrHqwPLinDoU/ONYw4O1BpY3TnCiOuOm7J2EKB76WN5ysXUcYF0McNgdAzYSwP3TCJrD8ueRlSHurIh4Wmph6cMxnpcaY8DfpyEelhy8+eXhxVcX9z7baKnRKDhGZxBho+7D9lNANir3WVHC3dUabr6tYuNIHQPSgG9LIZbWbDxKgCtn4UJLdvOwh09CGys/ZTR6Vgo4OzC9OzoSsbOzA2F3F42mhL1yGdVqNRm5YC65C5N7kLG0nKwk2jI0dqRk9/t9zsEoivLVlWkW8wfurJ+AZ2SlUAAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Screen Shot 2019 10 30 at 1 31 52 PM\"\n        title=\"Screen Shot 2019 10 30 at 1 31 52 PM\"\n        src=\"/static/d43dcaf192be0d2c6332422eaa55f4f2/6b1e2/Screen-Shot-2019-10-30-at-1.31.52-PM.png\"\n        srcset=\"/static/d43dcaf192be0d2c6332422eaa55f4f2/6b1e2/Screen-Shot-2019-10-30-at-1.31.52-PM.png 281w\"\n        sizes=\"(max-width: 281px) 100vw, 281px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>The gRPC framework was initially developed at Google and is now open-source. It is a modern implementation of the RPC (Remote Procedure Call) protocol, which has been around since the 80s. You will often see gRPC being compared to other technologies like SOAP, REST, and GraphQL.</p>\n<p>Some features:</p>\n<ul>\n<li>HTTP/2 based transport</li>\n<li>Unary calls: single request, single response</li>\n<li>Streaming calls: client, server, and bidirectional</li>\n<li>Layered design for further extension e.g. authentication, load balancing, logging</li>\n</ul>\n<p><em>How is it used to send data?</em></p>\n<p>gRPC is based on the idea of calling a remote procedure just like a local one. A procedure is like a function or a method. So, ideally developers can treat remote and local calls similarly. A great thing about gRPC is that developers do not need to know the details of the remote interaction.</p>\n<p>Here is a diagram from the official grpc <a href=\"https://grpc.io/docs/guides/\">docs</a> showing the flow:</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 62.46153846153847%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAACXBIWXMAAAsTAAALEwEAmpwYAAACh0lEQVQoz3WT+09ScRjG+Uv6rT+g5Q+1ZdkyyQC1ixO1LJzl5hK3Wv1WtvKCm23NVatYmqagycXIazW31BWWFcsmkty8IFJyFBEEuTy950uYkb3bs+85O+d89jzv+x4BtlU8HmdKXvMVDIVgW3DB7HBiyesF5/OBWw/ghrYHBTV1OPe4GRd7X+HCiwFU9r+GgP8oGov9pUg0ymBrgQA+T1sw63bDQ7Cl5WV4SG7fGgrrGpAulWLf5as42q5BZmsnjrd3Q5B0klrrBLPOzyO2w/ONzU3IlC1Ir1FAeF8JiVoHUYcGJzv1CYeDZguevTNCZfwA9fhHNL8dQ/vI2B9AKMzc2l0uzMzNwU4tqOgdQpZKBwlBeGe88gjMgMKbt7E7Nw9pJeexp/gsdokkKGhohG8jxCJOWm0wWb6T4wX4CcyXfOANxAQp0fWS+hgsNwnMv3MXaaVlOHhJjgx5FfbKSnG6VgGT1QorOfKurv4T20V9tHk5OLgV2LlV2Oh0rvgSwDKa0JEWFbLbupgOK9tQpTWw4fBTnXbO4ovFgm/k1P1zGaFwGGHqrT8SRYDeCVBPeW1EIgmgVGNAxlM1xCots53R2oUzKg0WPJ4tRzzEw3Fs2i5SZXMrcq5X41TTAxRT5MJuA2Q9/QngowkTFKNGNBkncG/8E+pH3qNjcgo/CGB2ONgZo3ViYNpLF8XLv1WLQ0VF2H/lGoQdWmRRMjFN+r9rkywvRZ6yO/B1ZobFdi4uwuv3o+K5HgfqG3Hs4ROWTEQDOpFcm2gs/nup42zv+OvYtr8mGdkfDG7dyweHkUnOxNQifmWySTkEFuzkKvUXTE2xSYOoHh6FTN+HcsMgG2r5yyGU0vkLJegoPEJ8Il4AAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Screen Shot 2019 10 30 at 1 35 45 PM 768x480\"\n        title=\"Screen Shot 2019 10 30 at 1 35 45 PM 768x480\"\n        src=\"/static/a8b70d1d23742fa9aae6c6d2791775c6/e5715/Screen-Shot-2019-10-30-at-1.35.45-PM-768x480.png\"\n        srcset=\"/static/a8b70d1d23742fa9aae6c6d2791775c6/a6d36/Screen-Shot-2019-10-30-at-1.35.45-PM-768x480.png 650w,\n/static/a8b70d1d23742fa9aae6c6d2791775c6/e5715/Screen-Shot-2019-10-30-at-1.35.45-PM-768x480.png 768w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Each client service will include a stub, which is like an interface containing the available remote procedures. These stubs are auto-generated files.</p>\n<p><em>But what does proto refer to? And what are stubs? How can we generate them?</em></p>\n<p>To answer these questions, we need to look at another technology called protocol buffers.</p>\n<p><strong>Protocol Buffers</strong></p>\n<p>Protocol buffers (protobufs), are a way to format data for storage and transport. gRPC uses protobufs to format data sent over the wire. It is comparable to other data serialization formats such as JSON, XML, and YAML.</p>\n<p>Some features:</p>\n<ul>\n<li>\n<p>Ability to generate interfaces (stubs) for many languages</p>\n<ul>\n<li>You can create proto definitions once (in a .proto file), and compile it into a variety of different languages including Go, Java, C#, and Python.</li>\n</ul>\n</li>\n<li>\n<p>Requires defining schemas - need to know expected data fields and types</p>\n<ul>\n<li>This is unlike JSON which is flexible.</li>\n</ul>\n</li>\n<li>\n<p>Binary format, meaning data is converted into binary when sent over the wire.</p>\n<ul>\n<li>Binary is smaller, and generally can be decoded faster compared to text-based formats such as JSON.</li>\n</ul>\n</li>\n</ul>\n<p><em>How is it used with gRPC?</em></p>\n<p>Step 1: Create proto definitions - methods, requests, responses.</p>\n<ul>\n<li>For example, in account.proto file, we define 3 rpc methods: Find, Update, and Delete.</li>\n<li>These are the remote procedures that can be called by clients.</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"protobuf\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">service AccountService {</span>\n<span class=\"grvsc-line\">  rpc Find(FindRequest) returns (FindResponse);</span>\n<span class=\"grvsc-line\">  rpc Update(UpdateRequest) returns (UpdateResponse);</span>\n<span class=\"grvsc-line\">  rpc Delete(DeleteRequest) returns (DeleteResponse);</span>\n<span class=\"grvsc-line\">}</span></code></pre>\n<ul>\n<li>Each method can have its own request and response schemas.</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"protobuf\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">message FindRequest {</span>\n<span class=\"grvsc-line\">  string Uid = 1;</span>\n<span class=\"grvsc-line\">}</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">message FindResponse {</span>\n<span class=\"grvsc-line\">  string Uid = 1;</span>\n<span class=\"grvsc-line\">  string Name = 2;</span>\n<span class=\"grvsc-line\">  int32 Age = 3;</span>\n<span class=\"grvsc-line\">  bool isVerified = 4;</span>\n<span class=\"grvsc-line\">}</span></code></pre>\n<ul>\n<li>Note that each field in a message has a unique number. These numbers are used to identify the fields when encoded into binary (recall that protobuf sends data over the wire as binary).</li>\n</ul>\n<p>Step 2: Compile proto file for auto-generated stubs in desired language.</p>\n<ul>\n<li>First, the compiler needs to be <a href=\"https://github.com/protocolbuffers/protobuf\">installed</a>. Refer to blog <em>part 2</em> for detailed instructions.</li>\n<li>The compiler is invoked by the protoc command. In this case, the file account.proto is compiled into Golang with a grpc plugin.</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"batch\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">protoc account.proto --go_out=plugins=grpc:.</span></span></code></pre>\n<ul>\n<li>Different languages may have different ways of compiling proto files. For instance with NodeJS, there are npm libraries which allow programmatically compiling proto files.</li>\n</ul>\n<p>Step 3: Use stubs in server and clients.</p>\n<p><strong>The Big Picture</strong></p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 387px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 92.24806201550389%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAACXBIWXMAAAsTAAALEwEAmpwYAAABw0lEQVQ4y3XUhwrjQAwE0Pz/N4YEEkhI7734eIIxG+5OsPZabUcjeQfP57O73W61zudzNx6Pu9lsVt/X67Xe7/e7I76j4zMajbrD4dDHPx6PbuBxv9+77XZbCR1AdzqdylmCJKTf7/fd8XisPf3lcik/S+ygRUim02ktwmYvqf1iseg2m03Z7IfDYfd6verbQX1CAbvdrhSQWkFpL+j7/da3hPwksA8F/CqhQAHKVfpqtSojJ+XEnpLDoxKhDPdii0Mbp0c4JAHBk5MJ3wif0ETkYC+En8+nJx46pHOgF9gmjB769Xpd32LpCiHntsu4VA6+8CQwiCFidyAf9kwD3U+X8UKWy2XxmC4LaudQIHGQCQhdf3UZOiIgQZm7JMzMxaYqCa1MSd9lgZLqHG6UIjE6UrJ99JLN5/OfH+CfXebQdu9/XebDNx3uu+yhQy0XkMYpXU5A9MpXJhH/0+XwkW6nBO8cmCbROdDyp0CaqfhpikCcWG6S/H6TyaRHTQ8VdG4lfPNXhaQ9wlwOmiGYY24Pe4fhMkMvodGC0JglYd9lyRjTwbyhaa+vDHZKjG90hRA/4TFI2wuTreWwrShLBfSQ/gE1JnSTwHNvmgAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Screen Shot 2019 10 30 at 1 57 55 PM\"\n        title=\"Screen Shot 2019 10 30 at 1 57 55 PM\"\n        src=\"/static/729430686438f756b74979321b48537d/691c3/Screen-Shot-2019-10-30-at-1.57.55-PM.png\"\n        srcset=\"/static/729430686438f756b74979321b48537d/691c3/Screen-Shot-2019-10-30-at-1.57.55-PM.png 387w\"\n        sizes=\"(max-width: 387px) 100vw, 387px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p><strong>Why gRPC?</strong></p>\n<p>One compelling reason to use gRPC is that it provides high performance</p>\n<ul>\n<li>HTTP/2: e.g. requests are multiplexed, so a single long-lived TCP connection can be used by multiple requests at once. This results in less connection overhead.</li>\n<li>Protobufs: e.g. as a binary format, it allows for quick encoding and decoding of data. </li>\n</ul>\n<p><em>How does it differ from REST?</em></p>\n<table>\n<thead>\n<tr>\n<th></th>\n<th><strong>gRPC</strong></th>\n<th><strong>REST</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>API</td>\n<td>Contract-based i.e. stubs</td>\n<td>Resource-based and relies on HTTP verbs i.e. GET/PUT/POST/DELETE</td>\n</tr>\n<tr>\n<td>Network protocol</td>\n<td>HTTP/2</td>\n<td>HTTP/1.1 or HTTP/2</td>\n</tr>\n<tr>\n<td>Data serialization format</td>\n<td>Protocol buffers</td>\n<td>JSON</td>\n</tr>\n<tr>\n<td>Streaming</td>\n<td>Built-in support for client, server, and bi-directional streaming</td>\n<td>REST on HTTP/1.1 does not allow streaming</td>\n</tr>\n</tbody>\n</table>\n<p><strong>Other Considerations</strong></p>\n<p>Here, we briefly go over a few other things to consider with gRPC. These will be covered in more detail in another blog.</p>\n<p><em>Management of proto files</em><br>\nIf you plan to have multiple proto files and client services, you need some way to manage them for distribution and version control. One solution is to keep all proto files in a central git repository, and maintain versions using git tags.</p>\n<p><em>Using proto2 vs. proto3</em><br>\nProtocol buffers have two syntax versions: proto2 and proto3.</p>\n<ul>\n<li>One key feature in proto2 is that it differentiates between required and optional fields, and supports nullable fields.</li>\n<li>In proto3, all fields are optional and nullable fields are no longer supported. If a field is unset, it will be set to a default value e.g. empty string for type string. Because of this, determining whether a field was intentionally set or not requires workarounds such as using wrappers.</li>\n</ul>\n<p><em>Load-Balancing</em><br>\nSomething to note about load-balancing gRPC is that HTTP/2 requires L7 (Application Layer) load-balancers. Recall that in HTTP/2, TCP connections are long-lived and requests are multiplexed. This makes L4 (Connection Layer) load-balancers ineffective. This differs from HTTP/1.1 where TCP connections get cycled and can benefit from L4 load-balancers. </p>\n<p>That's it for now! To learn more, check out the official <a href=\"https://grpc.io\">gRPC</a> and <a href=\"https://developers.google.com/protocol-buffers\">protobuf</a> docs.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n</style>","frontmatter":{"date":"October 30, 2019","updated_date":null,"title":"Getting Started with gRPC - Part 1 Concepts","tags":["Engineering","gRPC"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/ceff66d5b341e58e4b85f5a6c3a7cbad/f006c/grpc.png","srcSet":"/static/ceff66d5b341e58e4b85f5a6c3a7cbad/69585/grpc.png 200w,\n/static/ceff66d5b341e58e4b85f5a6c3a7cbad/f006c/grpc.png 246w","sizes":"(max-width: 246px) 100vw, 246px"}}},"author":{"id":"Andy Yeung","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/3-simple-ways-to-secure-your-websites-applications/"},"html":"<p>It is hard to write 100% holes-free code, no matter how hard you try. Sometimes it is not even your own fault (language implementation, server setups, etc.) and those factors are likely out of your control. That being said, as developers, we should strive to write our code as safe and secure as possible. Here are my suggestions to keep yourself from being woken up in the middle of the night:</p>\n<p>1. <strong>DO NOT trust any user-input, PERIOD.</strong> Not even if it is yours truly. This is the most common attack vector for your web applications, whether it is just a contact form or an API end-point. For example, if a form is implemented to store data in a database, someone can try brute-forcing with classic SQL-injection techniques. Others can certainly try calling your API and see if there are any spotty error-handling issues. Sanitize all inputs as much as you can, and handle all errors behind the scenes properly and gracefully without exposing the actual details to the public.</p>\n<p>2. <strong>UPDATE, UPGRADE and REPEAT.</strong> Chances are, a lot of your code is dependent on third-party libraries (open or closed source, does not matter). It is your job to make sure you are using the latest version for them all. When hackers find out you are using outdated or vulnerable code, you are done. I have seen this happening way too many times than I can count over the years when websites got hacked and outdated plugins or libraries was the main culprit.</p>\n<p>You might be saying, \"Hey, upgrading that library will break my code!!\". Well, what is your job again? Deal with it.</p>\n<p>3. <strong>Web Application Firewall (WAF)</strong> Consider getting one if your server admin lets you, it can potentially save yourself a lot of embarrassments. Just keep in mind though it should not be your only security strategy, as WAFs will not stop all kinds of attacks. It is still your sole responsibility to write good code and repeat step 1 and 2.</p>\n<p><strong>Happyyyyy coding!</strong></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"June 24, 2019","updated_date":null,"title":"3 Simple Ways to Secure Your Websites/Applications","tags":["Engineering"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/a83283c1ebd13e5b72cee8093889ff72/2a4de/hacker.png","srcSet":"/static/a83283c1ebd13e5b72cee8093889ff72/69585/hacker.png 200w,\n/static/a83283c1ebd13e5b72cee8093889ff72/497c6/hacker.png 400w,\n/static/a83283c1ebd13e5b72cee8093889ff72/2a4de/hacker.png 600w","sizes":"(max-width: 600px) 100vw, 600px"}}},"author":{"id":"Karl Wittig","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/failover-systems-and-loginradius-99-99-uptime/"},"html":"<p>Do you remember the Amazon outage that affected several high-profile customers back in 2011? On April 21st, widely-used sites such as Reddit and Quora were brought down, and many others experienced latency or were knocked offline, too. Early that morning, as part of normal scaling activities, Amazon staff performed a network change. However, the change was done incorrectly and, after the staff attempted to correct it through a rollback, the inner mechanisms of the service made it unavailable to serve read and write requests. The ‘inner mechanisms’ responsible for the service unavailability are out of the scope of this article, but they are described in the <a href=\"https://aws.amazon.com/message/65648/\">service disruption summary</a> that Amazon published. What interests us here is the strategies that companies can use to mitigate the negative effects on their products when a service they rely on fails. These strategies make up what is known as a <em>failover system</em>.</p>\n<p>A failover system is a set of mechanisms that perform <em>failover</em>. In computer networking, failover is the process of switching to a redundant or standby server or network upon the <strong><em>abnormal</em></strong> termination of a previously-active server or network. The benefit of a failover system is obvious: with one in place, you can ensure your product or service will be available even when adverse events take place. Uptime—time during which a service is operational—is crucial to the success of your business. If your services are unavailable, you are likely to lose customers and any revenue they would have generated. In an article entitled <a href=\"https://medium.com/netflix-techblog/lessons-netflix-learned-from-the-aws-outage-deefe5fd0c04\">‘Lessons Netflix Learned from the AWS Outage</a>,’ Netflix talks about the manual process they used to deal with the Amazon outage and acknowledges the importance of automating this process in the future so they can keep scaling their service. That is, the company acknowledges the importance of having an automated failover system in place instead of relying on a team of top engineers <strong><em>manually</em></strong> making changes every time there is an issue.</p>\n<p>How is an automated failover system set up? Let us consider the simplest scenario: setting a failover system for one server. By definition of a failover system, in addition to the main server, we need to have another redundant standby server that we can switch to whenever the main one fails. Since the redundant server must provide the same functionality as the first, it must be identical to it. Additionally, we need a tool that ensures client requests are routed to the redundant server in case of failure of the main one. We can achieve this by using a DNS failover tool. DNS is the internet protocol used to translate human-readable hostnames into IP addresses, and a DNS failover tool makes sure the “dictionary” (DNS tables) used for this translation are updated in the event of an outage. DNS failover tools know when to update the tables by periodically checking on the main server’s status. With these three tools—and some configuration—you can set up a simple, automated failover system. Of course, there are other considerations you must take when setting the failover system, such as ensuring the redundant standby server is hosted in a geographic area different from the main server’s location and using different companies to host your services. That way, your services will be less likely to go down simultaneously. </p>\n<p>At LoginRadius, we have set up automated failover systems in all layers of our architecture, which is why we can ensure 99.99% uptime on a monthly basis. With our services, you can be assured your customers will always be able to engage with your business, ensuring you will never lose these customers and any revenue they will generate. </p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"June 24, 2019","updated_date":null,"title":"Failover Systems and LoginRadius' 99.99% Uptime","tags":["Engineering","AWS"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.0050251256281406,"src":"/static/b25cc95f0b8e5c745ef8652dfb386e3b/40823/tech.jpg","srcSet":"/static/b25cc95f0b8e5c745ef8652dfb386e3b/f836f/tech.jpg 200w,\n/static/b25cc95f0b8e5c745ef8652dfb386e3b/2244e/tech.jpg 400w,\n/static/b25cc95f0b8e5c745ef8652dfb386e3b/40823/tech.jpg 719w","sizes":"(max-width: 719px) 100vw, 719px"}}},"author":{"id":"Ruben Gonzalez","github":"rubenprograms","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/a-bot-protection-overview/"},"html":"<p>Bots are tools that are created to automate tedious processes and reduce work. For example, chatbots automate replies to users for customer support, and search bots are used to populate search results on a Google search. However, there are many bots that are crafted for the malicious self-interest of a party. Examples of these hostile bots include DDOS (Direct Denial of Service) botnets and spam bots. This post will provide some information on how to implement bot protection to protect your systems from these nasty bot attacks.</p>\n<h3 id=\"captcha\" style=\"position:relative;\"><a href=\"#captcha\" aria-label=\"captcha permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>CAPTCHA:</h3>\n<p>One of the most popular methods of bot protection that is used today is CAPTCHA, which is provided through companies such as ReCAPTCHA, NuCaptcha and Solve Media. CAPTCHA, which stands for “Completely Automated Public Turing Test to tell Computers and Humans Apart”, is an anti-bot measure which consists of a challenge which a user must complete to verify if the user is human. Examples of challenges include translating images of distorted text, or recognition of objects in an image which match a given word. CAPTCHAs are useful in blocking automated form submissions by bots and are constantly being updated to be more friendly to human users. Some of the latest CAPTCHA implementations only require the user to click on a checkbox to pass their validation check.</p>\n<p>An example of a ReCAPTCHA with distorted text</p>\n<p><img src=\"https://media-s3-us-east-1.ceros.com/editorial-content/images/2018/05/31/c5c224dc0fb2a058625073c470d70c3c/recaptcha-big.png?ver=1552286291?imageOpt=1&#x26;fit=bounds&#x26;width=1077\"></p>\n<p>To implement CAPTCHA using Google’s ReCAPTCHA solution, you can access <a href=\"https://www.google.com/recaptcha/\">Google reCAPTCHA bot protection</a> and login with your Google account. Following that you will be redirected to an interface where you can register your site. Different types of CAPTCHAs can be set up for different events on your domain and can be built to match your use case.</p>\n<p>An example of a ReCAPTCHA with a checkbox validation</p>\n<p><img src=\"https://media.giphy.com/media/10p3VEnw29dD44/giphy.gif?ver=1552286291?ver=1552286291\"></p>\n<p>CAPTCHAs have a variety of uses, and can be used to prevent automated form completions and even prevent access to your domain. Setting up a CAPTCHA detection solution for different scenarios will typically provide a strong bot defense for your system.</p>\n<h3 id=\"spam-honeypots\" style=\"position:relative;\"><a href=\"#spam-honeypots\" aria-label=\"spam honeypots permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Spam Honeypots:</h3>\n<p>Spam honeypots are traps that ensnare bots by placing hidden input fields within a form that reject registration upon being filled in. Bots that use detect form fields through HTML may be programmed to fill in all the input fields in a form including the honeypot. Meanwhile, since the fields are hidden, human users should not be able to see the honeypot and should not be filling in the field.</p>\n<p>The implementation of a honey pot can be as simple as implementing an extra form field onto your page that should not be filled in. Hide the element using CSS and set up logic to prevent users that fill in the field from successfully completing the form. A simple implementation can be done with this code:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">input</span><span class=\"mtk1\"> </span><span class=\"mtk12\">id</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;first-name-input&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;text&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;firstname&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;Fill me in&quot;</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">input</span><span class=\"mtk1\"> </span><span class=\"mtk12\">style</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;display: none;&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">id</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;honeypot-input&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;text&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;honeypot&quot;</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">button</span><span class=\"mtk1\"> </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;button&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">onclick</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;submitForm()&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;button&quot;</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Submit</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">button</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">button</span><span class=\"mtk1\"> </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;button&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">onclick</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;fill()&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;button&quot;</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">Fill Honeypot</span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">button</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">    let submitForm = function() </span><span class=\"mtk4\">{</span><span class=\"mtk1\">         </span><span class=\"mtk12\">let</span><span class=\"mtk1\"> </span><span class=\"mtk12\">honeypot</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">document</span><span class=\"mtk1\">.</span><span class=\"mtk11\">getElementById</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;honeypot-input&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk12\">value</span><span class=\"mtk1\">;         </span><span class=\"mtk11\">if</span><span class=\"mtk1\">(!</span><span class=\"mtk12\">honeypot</span><span class=\"mtk1\">) { </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">   </span><span class=\"mtk3\">// Handle input submit            </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        console.log(“Pass”);         } </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">   </span><span class=\"mtk12\">else</span><span class=\"mtk1\"> { </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">   </span><span class=\"mtk3\">// Handle honeypot error            </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    console.log(“Fail”);  }  </span><span class=\"mtk4\">}</span><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">     let fill = function() </span><span class=\"mtk4\">{</span><span class=\"mtk1\">  </span><span class=\"mtk12\">document</span><span class=\"mtk1\">.</span><span class=\"mtk11\">getElementById</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;honeypot-input&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk12\">value</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&quot;Example&quot;</span><span class=\"mtk1\">;     </span><span class=\"mtk4\">}</span><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>With the implementation of the above code, if a bot is setup to fill in all input fields on your web page, then the hidden honeypot input will be filled in and the bot will be detected. On the other hand, if a normal user attempts to complete the form on the page, the honeypot would be invisible and the registration will be successful.</p>\n<p>Honeypots are a solution to weed out basic bots, but they can be easily circumvented depending on how the honeypot is implemented. Regardless, adding a honeypot still provides an additional layer of defense against bot inputs and will help deter some bot traffic on your site.</p>\n<h3 id=\"lockout-time\" style=\"position:relative;\"><a href=\"#lockout-time\" aria-label=\"lockout time permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Lockout Time:</h3>\n<p>Often times, when bots are created to automate a task, they would be programmed to complete these tasks as quickly as possible to maximize efficiency. As a countermeasure, time lockouts can be set up to prevent bots from repeatedly spamming requests. By setting up a time lockout between requests to your domain, bots which attempt to quickly submit data on your domain will be detected. Meanwhile, human users that are registering onto the site will be working at a slower pace and will not notice the time lockout at all.</p>\n<p>Setting a timer on form completion does not prevent any bots from affecting your domain, but can significantly slow down their efficiency. Combined with ReCAPTCHA or other anti-bot measures, it can be very useful in reducing the impact of bots.</p>\n<h3 id=\"blacklisting-ips\" style=\"position:relative;\"><a href=\"#blacklisting-ips\" aria-label=\"blacklisting ips permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Blacklisting IPs:</h3>\n<p>If an entity accessing your website is from an unexpected location, for example, a Russian IP accessing your domain for an American service, using IP blacklists may be useful to prevent possible bot attacks. IP blacklisting can usually be set up through your hosting services and allows you to customize where users may access your domain.</p>\n<p>There are some issues with blacklisting, though. Choosing which targets to blacklist could be a tedious task. Even with a bot set up to detect users with suspicious activity and block them, there could be a chance of a false positive, which may result in users of your domain being blacklisted.</p>\n<h3 id=\"proof-of-work\" style=\"position:relative;\"><a href=\"#proof-of-work\" aria-label=\"proof of work permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Proof Of Work:</h3>\n<p>If you want to save your site from spams and denial-of-service attacks you can incorporate a layer of Proof Of Work algorithm in your site. Whenever any client will try to connect to your server they need to commit some of their resources to the Proof Of Work algorithm first and then the server should be connected.</p>\n<p>With this approach, any legitimate user would experience just a negligible computational cost, but a spammer/attacker trying to establish a large number of connections would bear the computational cost and time delay, it deters the abuser to do so. There are many POW algorithms which you can use eg:- <a href=\"https://en.wikipedia.org/wiki/Client_Puzzle_Protocol\">Client Puzzle Protocol</a>, Productive Puzzle Protocol, <a href=\"https://en.wikipedia.org/wiki/Guided_tour_puzzle_protocol\">Guided Tour Puzzle Protocol</a></p>\n<h3 id=\"other-forms-of-malicious-bots\" style=\"position:relative;\"><a href=\"#other-forms-of-malicious-bots\" aria-label=\"other forms of malicious bots permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Other Forms of Malicious Bots:</h3>\n<p>Other malicious bots that can impact user experience negatively include, but are not limited to, bots designed for DDOS attacks, spam bots that harvest user data, bots that create links to phishing websites which generate viruses, and malicious bot worms that infect computers.</p>\n<p>Countermeasures for these bots vary depending on what is being prevented. Honeypot data fields can act as a detection method against bots harvesting data, and with proper preventative training, phishing and scam bots can be handled. Third party services may also be used to protect from different forms of bots. For example, to mitigate impacts of DDOS attacks, a user may implement a solution offered by CloudFlare. Another example is the use of an ad blocker to prevent malware from being drive-by downloaded by intrusive ads.</p>\n<h3 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion:</h3>\n<p>Unless your domain is a highly popular website, or is being targeted by technical security violation experts, there is a good chance that utilizing a simple Google ReCaptcha prompt for form completion is enough to handle any malicious bots that attempt to access your website. For domains with significantly more traffic, paid solutions like Cloudflare might also be useful in dealing with malicious bots.</p>\n<p>Keep in mind that although some bots are created for bad purposes, a large number of bots exist to automate beneficial tasks and make it easier for humans. Even though there are a significant amount of bots that are not helpful, it is important to embrace how useful benevolent bots actually are.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk17 { color: #808080; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n</style>","frontmatter":{"date":"May 31, 2019","updated_date":null,"title":"A Bot Protection Overview","tags":["Engineering","Captcha","Spam","Secure","IP"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.2578616352201257,"src":"/static/010dd09dba7a6b0a11d58d980e3f0306/14b42/Productshot.jpg","srcSet":"/static/010dd09dba7a6b0a11d58d980e3f0306/f836f/Productshot.jpg 200w,\n/static/010dd09dba7a6b0a11d58d980e3f0306/2244e/Productshot.jpg 400w,\n/static/010dd09dba7a6b0a11d58d980e3f0306/14b42/Productshot.jpg 800w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Chris Yee","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/what-is-the-difference-between-oauth1-and-oauth2/"},"html":"<p>OAuth2 is an authorization delegation protocol that allows one party’s accessing of an end user’s resources stored with another party without sharing any credentials. OAuth2 is often compared with SAML and OpenID Connect as their purposes and uses overlap, however these comparisons often refer to OAuth2 as OAuth. This has resulted in some confusion regarding OAuth2 and OAuth1.</p>\n<p><a href=\"https://tools.ietf.org/html/rfc5849\">OAuth1</a> was published in 2010, and <a href=\"https://tools.ietf.org/html/rfc6749\">OAuth2</a> is a complete rewrite of OAuth1 released in 2012. The following section will go over the most significant needs that led to this rewrite, along with the change associated to address them.</p>\n<h3 id=\"support-for-non-browser-based-applications\" style=\"position:relative;\"><a href=\"#support-for-non-browser-based-applications\" aria-label=\"support for non browser based applications permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Support for non-browser based applications</h3>\n<p>One of the commonly agreed-upon disadvantages of OAuth1 was the lack of support it offers to non-browser based application clients. OAuth2 has different authorization work flows to address authorization initiated by native application clients. This was one of the main advantages OAuth2 has over OAuth1. However, abuse of the flows in favour of convenience and ease can lead to insecure implementations of OAuth2. When using OAuth2 for mobile, desktop, or single page applications, it is recommended to refer to the IETF paper going over best OAuth2 practices for mobile apps: <a href=\"https://tools.ietf.org/html/rfc8252\">IETF</a>.</p>\n<h3 id=\"ease-of-implementation\" style=\"position:relative;\"><a href=\"#ease-of-implementation\" aria-label=\"ease of implementation permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Ease of implementation</h3>\n<p>OAuth1 was often criticized for the barrier it poses to writing a client as each exchange between client, server, and resource server requires a validation of a shared secret. This secret is used to sign the arguments for the authorization request by the client, subsequently the server signs the arguments with the client’s key to verify the legitimacy of the client. The arguments need to be passed in the exact order and is often finicky to write. Moreover, dealing with cryptographic signing of the requests in addition to this can be a pain.</p>\n<p>OAuth2 has delegated this part of the security to transfer over HTTPS. This means while OAuth1 is protocol-independent, OAuth2 requests must be sent over SSL. Since TLS already provides transport-level message privacy and integrity, some question the merit of arguably redundant client-side signing and argument sorting. Others have brought up concerns with completely delegating security to HTTPS, and mention reasons such as yet-undiscovered zero-day TLS vulnerabilities potentially compromising entire systems.</p>\n<h3 id=\"clear-separation-of-roles\" style=\"position:relative;\"><a href=\"#clear-separation-of-roles\" aria-label=\"clear separation of roles permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Clear separation of roles</h3>\n<p>The conceptualization of OAuth2 defines a resource server in addition to an authorization server. This means there is a clear separation of roles between the server that handles the authorization request, and the server that makes access-control decisions based on the response to the authorization request. This separation of concerns allows support for more flexible use cases.</p>\n<h2 id=\"so-oauth1-or-oauth2\" style=\"position:relative;\"><a href=\"#so-oauth1-or-oauth2\" aria-label=\"so oauth1 or oauth2 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>So, OAuth1 or OAuth2?</h2>\n<p>All of the above points seem to suggest OAuth2 as a superior alternative to OAuth1, and that OAuth1 is obsolete. This is not the case. It is very rare to see a greenfield authorization system using OAuth1, and the only major player still using OAuth1 is Twitter -- they call their version OAuth1.0a. However, as far as security and usability is concerned, OAuth1 is still viable and perhaps even more secure than OAuth2 since it offers additional security on top of TLS-based precautions, and creates barriers in potentially compromising flows. An existing system that uses OAuth1 probably does not need to upgrade to OAuth2. New systems that rely on server-to-server authorization could probably leverage OAuth1 for the additional security as well. On the other hand, use cases that could benefit from a separation of concerns, non-browser support, and ease of client development should go for OAuth2.</p>\n<p>OAuth2 has received its own share of criticisms. For example, in 2012 Eran Hammer, one of the original authors of OAuth2, withdrew his name from the specification and wrote <a href=\"https://gist.github.com/nckroy/dd2d4dfc86f7d13045ad715377b6a48f\">an article</a> calling out its many flaws. However, even in this article he agreed with the usefulness of OAuth2, and that “at the hand of a developer with deep understanding of web security will likely result in a secure implementation”.</p>\n<p>OAuth2 is not necessarily more secure than OAuth1, and using OAuth2 does not inherently lead to better security. Many considerations must go into each specific implementation. For starters, the appropriate grant flow must be chosen with care pertaining to the use case; the redirect_uri must be validated sufficiently; and measures must be taken to prevent access tokens from ending up in the browser history. For additional security considerations, see this <a href=\"https://datatracker.ietf.org/doc/html/draft-ietf-oauth-security-topics-10\">IETF work in progress draft on OAuth Security Best Current Practice</a>.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"May 31, 2019","updated_date":null,"title":"OAuth 1.0 VS OAuth 2.0","tags":["Oauth","Engineering"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/1c2dae61b8f7fee8ab8408c5d18cd8b4/14b42/pexels-photo-373543.jpg","srcSet":"/static/1c2dae61b8f7fee8ab8408c5d18cd8b4/f836f/pexels-photo-373543.jpg 200w,\n/static/1c2dae61b8f7fee8ab8408c5d18cd8b4/2244e/pexels-photo-373543.jpg 400w,\n/static/1c2dae61b8f7fee8ab8408c5d18cd8b4/14b42/pexels-photo-373543.jpg 800w,\n/static/1c2dae61b8f7fee8ab8408c5d18cd8b4/47498/pexels-photo-373543.jpg 1200w,\n/static/1c2dae61b8f7fee8ab8408c5d18cd8b4/0e329/pexels-photo-373543.jpg 1600w,\n/static/1c2dae61b8f7fee8ab8408c5d18cd8b4/2d44f/pexels-photo-373543.jpg 2250w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Ti Zhang","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/azure-ad-as-an-identity-provider/"},"html":"<p>This blog post goes over how you can connect your SAAS/web application with the Azure AD world. Let’s take a look at how Azure AD works as an identity provider to provide your users with the ability to log in. e.g if anyone using Office 365, able to log on with their standard account or a federated one.</p>\n<p>Windows Azure provides a number of identity-based technologies to support such kind of requirements. As a means of illustrating this, we’ll show an example using Azure AD as an Identity Provider (IdP), connecting up to the LoginRadius SAAS application using the LoginRadius Admin Console.</p>\n<ul>\n<li>Log in to the Azure Portal.</li>\n<li>On the Azure active directory tab, click on the App registrations tab.  From the top of the screen, create a new application by clicking on \"New application registration\".</li>\n</ul>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 480px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 86.04166666666667%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAARCAYAAADdRIy+AAAACXBIWXMAAAsTAAALEwEAmpwYAAADAklEQVQ4y22UW0/TcBjG91HYBmOw7ryx4roDJ8EdYCCCRhM1bAE1xksv/DTCDZELrrnjk4wQTTSyrYe1GxuMx/f9z9YSbPKk65L++jzv4e95WW9gtVTG+noV1WoVtVoNlUoFsixjbm4O5+fn4KvVG0LrmlDVDkZ3d7CvO/rNury8xHA4hGepVIEUjSIeiyFGSiQSkCQJXq8XPp8PZ2dn4sUfmgXNtGAYOq6vr4X6/T5ubm4wGo3QbDYxGAzgWX/VgJwrIp9TkM1msbCwIKB+vx9TU1M4Pj4WwGZbh2oYUDsddEhXV1dCvV5POHSA5ZqCcDSIZDKNdDotYNPT05icnBT6engogD9VHW1Nh6HrwpE7Mj9fXFyMIz+u5hCNS1SvjFO3QCDgAI+OjsSL31vkzuii2+0KV+64LP6f75564wUKhSyUrIL5+XkoioJMJoNJjuwCNtsDAlrQNQ3tdlvEZke2Q/6IABYWFYQiEpIUN55MinsoHIaXgD6SDdR6KvSuRjWkO8Vmcc1soGVZY6CcmcMjApWXlrFaLKKyvAI5nkB4KgBpOugAdXLQNU0BsiOzQzuyA/zy7iPqtS28Wd/AXm0TbzdqaDzdxmt6PihXcHpyMgZaY6CqqqJ27obcA35u7Avg3uYW9ref4WBnF+93n6NO0AOa0dNvY+CVGGxLdFmjOnIN2Slf94CfPtRRXVlCiSJnUymEqBERGhuWRLIjW30TpmXSYBuioyyG2LEd4FppDZFYFClqxkwoJBrhp4H2EdjdlLv+L/RMboghoCy7nuKDNrC0ukpDnaTRKWB2dhbeiQmxISz3HJr9WxgUmXeZQVxLjt5qtUSDnLF5spFGJE6bkkghRZF5W2ZmZh4M9nBgkgvTcWhSg9z77ADXajJiiRANs4xkKimg7I4PB7878vA3ukabHHWEO4baJw2LXd/e3tLhsJOCPC/RwZBDkeZwcXER+XxerCA7Pfy7y6N/J9aDo4tlb41HyckIBgOIRCJCUTrKwrQpXE926jh0vWzrf9cfT9jsk9Zcp3IAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"1\"\n        title=\"1\"\n        src=\"/static/20af250efd33089032a385eebeaf2b97/e85cb/1.png\"\n        srcset=\"/static/20af250efd33089032a385eebeaf2b97/e85cb/1.png 480w\"\n        sizes=\"(max-width: 480px) 100vw, 480px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<ul>\n<li>Give your SaaS/Web application a name (company name Demo).  Using the drop-down, select the type of application i.e Web Application / Web API.</li>\n<li>For Sign-On URL fill in the Assertion Consumer Service (ACS) URL for the Service Provider</li>\n</ul>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 532px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 98.49624060150376%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAADAElEQVQ4y52U207iYBSFeQ0PiICcj2KlgICgcOEkc2DexItJJoE5vIFeeuOFMepDTWbujAMILVCgHNfsvbGOGufYZKWltF/X3uvfv01JB1EsFlAqlbC/v49yuYxEIoFIJIJYLAaPx4OtrS3s7OzAsb4Ou30Na2s/tbq6Cq/Xh3wuh1hCgc0f9GJzc1NeisfjCAQCAnE6nQiGQjg8PMTnTx9Rq9VQq1bxgc4PJfdrfL+Kd++rBAyEBZZOpwXscrnoi14BJpNJaK02+NC6BiYz/PaYkGyRkBuhcJjchMUZw3w+H4HdUvKXr9/Q1Pu4abbRaHdxqxuotzr0W8P3Wx1abwjdGNLZxA39tsWiXkSjUYQjUWxsbIgYuE79qlQqaNTr6A/opU4X3Z6BRrMJczTGfA5MZ3PSDJPpwnq72ydg6SUURUGOmlosFiUMdrq8vIzz83N5sE7Q6+trNBoNtNttmOYQo9EII9OksynXw0EfLb1HwGQGMQqD+8hg7mMwGMTS0hIuLi8FaPb7MFiGgU6nI/fmZNHSjFyyZY0dJnN5KNvb2CapqipBhKmnAry4kJd1TUOLnLG7JpXMYFav1xOZ5HQ2naLVIYfZgwpBVEk5m80KkIPhki/vHI7H43tN6UUuka+lbNJkQvnOZ9RDgx3GZCGzOxavRQ5lZWUFJycnUtKfDusRrUclpwq0DpUEMpmMOORyORQGHh0diaOnPXtO98BXr8tIpVQBcih85mnhko+Pjx8Bf+3wATCeiEjCViAM9fv94vC/gE63SyAcCm8AfM3j99/AZOmAeqggpS6S5pL39vbgcDikh7LG/qWHueKuuOJyeUpCtMPwKNrtdnH4EPhXDt++eSH9Y3ecrtvtfpQyrzeGWuIWPNVE2jJfjB67UzkMmhTunbU5cMqnp6fydV68g8EAw+FQAE/LtargLc62nQwjcbfB8gxzwhbw6upqMcs0Wrquy5hZIT13SMn5Aw9SaRX5/C4KhYKArd3m7OxMXPVpY2AoX7PT58T/8Rb3AwJBiS8k3xWZAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"2\"\n        title=\"2\"\n        src=\"/static/0bca64781f2836e8e64d5c3b716adccc/89a37/2.png\"\n        srcset=\"/static/0bca64781f2836e8e64d5c3b716adccc/89a37/2.png 532w\"\n        sizes=\"(max-width: 532px) 100vw, 532px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<ul>\n<li>Go to the App setting at the top of the page and fill in the required fields</li>\n<li>Go to the endpoints at the top of the application registration page and use these app endpoints to set up the azure ad with your saas application.</li>\n</ul>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 493px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 124.13793103448276%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAZCAIAAAC+dZmEAAAACXBIWXMAAA7DAAAOwwHHb6hkAAACDUlEQVQ4y51UiZKqMBD0/39PkGN3ATkTAoRwCAr4XidBV2tZt8pWxwnY03PJ7t9bWJal67odvoQQfd93bScU2raFf71eX/Pxgx0+nFfgDMNQ13VVcXD7rkPQP/V39zCPUnBBnheJedZWn54iyrRZkQOMsSzNYAnNKKUky9I0LcoSvr7LWJ7T/Hw+P5LnKArLqhqGUSZ8Osmau7ZtBCx6gYoa0XRdL1shGly5pymVy7LUZXPOhaibpsERAea/yt6N42g7tus6ruPYtiNxs67rep73qfD1AE9Bki+XC2pLYolM1ilLTZIY30VR1L8A2Uky2hiGoe/7QeDDCY/yFfgezllG+BaqqkIXV3IA+Ct0VgiCXGSoLURRhOxWMjxEgiUki+MkzQgrikFh/AV6YJIMqQ+F7558vgLuo5crGX2SG0IJlgAtwxtLOk2XWWHZwjrnaZqhqYYjZ6OtrYamj/YP4KJlWbf1ZAw1Y1XgVJznlHJel0XBcobeokLoPMpO07QqIzFoGKZh2dbhcLBs2zQN0zwYe2O/N+BB6uMZUMJclPI8J0lCCIHFnmAMURzjf4A1wJLDih84qf1flREG09Nz9rwvfcxfAgWuZIiFz5BLFgQIEW8hVbit5/GYJimuBn6gZMMwAjEglOJBddoC9mclY+732Whob3NOd3w/ht7DO2TMGQ1Dyu+QQcPDCNvyH07xejQWe6IXAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"A 1\"\n        title=\"A 1\"\n        src=\"/static/6da5ac329fe0cd7ccd2c546fb0b7bf96/f88d0/A-1.png\"\n        srcset=\"/static/6da5ac329fe0cd7ccd2c546fb0b7bf96/f88d0/A-1.png 493w\"\n        sizes=\"(max-width: 493px) 100vw, 493px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Here are the meanings of the terms, we have used above: </p>\n<p><strong>Sign-On Url</strong>: This is where you want to send users to when accessing the \"application\". </p>\n<p><strong>Reply URL</strong>: It's the Reply URL which is the address to which Azure AD will send the SAML authentication response.</p>\n<p>On the Service Provider side, the metadata from the tenant, Azure Identity Provider needs to be parsed and added to the configuration file. This is done by downloading the Azure IdP metadata file directly, e.g.</p>\n<p><code>https://login.microsoftonline.com/&#x3C;AzureTenantID>/federationmetadata/2007-06/federationmetadata.xml</code></p>\n<p>This is all you need to know to go about creating a new application on the Azure portal and use Azure Ad as an Identity provider for login. With these and a number of services, Azure offers a solid convergence point for brokering connections with your web applications and workspaces.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"May 30, 2019","updated_date":null,"title":"Azure AD as an Identity provider","tags":["Engineering","Authentication","AzureAD"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/c3f65c00249c3107c5efe318d12ef2f9/bc59e/TN0lxUr0.png","srcSet":"/static/c3f65c00249c3107c5efe318d12ef2f9/69585/TN0lxUr0.png 200w,\n/static/c3f65c00249c3107c5efe318d12ef2f9/497c6/TN0lxUr0.png 400w,\n/static/c3f65c00249c3107c5efe318d12ef2f9/bc59e/TN0lxUr0.png 512w","sizes":"(max-width: 512px) 100vw, 512px"}}},"author":{"id":"Team LoginRadius","github":"LoginRadius","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/how-to-configure-the-actions-on-google-console-for-google-assistant/"},"html":"<p><strong>Time Required :</strong> less than 10 minutes.</p>\n<p><strong>Technologies :</strong> None.</p>\n<p><strong>Prerequisites :</strong> None.</p>\n<p>This tutorial will go over how to configure the ‘Actions on Google’ console so that it can be used for your Google Assistant actions/events that can be accessed anywhere the Google Assistant is available from phones to Google Home products.</p>\n<h3 id=\"steps\" style=\"position:relative;\"><a href=\"#steps\" aria-label=\"steps permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Steps</strong></h3>\n<ol>\n<li>\n<p>Create an Actions project and a Dialogflow agent <a href=\"https://console.actions.google.com/u/0/\">here</a>.</p>\n<ol>\n<li>Add/import project.\n<span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 300px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 93.33333333333333%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAATCAIAAAAf7rriAAAACXBIWXMAAAsTAAALEwEAmpwYAAAChklEQVQ4y21T3U4TQRTeV5IQE2LihTdgDOorGB/BKyPS0r/Z3dmZnZnuFvQ5JBqBhuodDSUY7Q0JSMFAS0lAWn7a0PrNLLs04Mm383P2fOecOXPGevwyNTE9++gFkJp4nhqbnBmbijGp8SDBlB7Hn848fDY7PvVu4slryxcqAuMC4L7k0aghfCGFVKPQxr6SqkgcapXCIAKlLuB51HUcSqlHqW0TJWUpDMMgwKenoBit50slzrkVxMI580D1EmFw5jEoNaDHjnO/aAQOobSwCsyeej7Tppp2I5xFmmiHmQuloyfkJLLDip6P5BYAX5ZkMeQi9FUoVejLkIkASiFDw43JUuFcCnsk+fnL1+3t3z9/1RuN/WazdXDQBA4Pm2Zx2Gq1K9++IwWltD3qYqE4totCsdl0ulwud7vd1tFRv9cbXA+ur81nxn6/PxwOq9VqJpd3qIfCZnN5C0yHuti8T6WXlpYHg0Gn0zk/P+8a6fX6l1dXFxeX0AyGw7W1ai5fABlIyDpyai6zUi7D/dlZ5wLmRq5igQa/arUasW1jf4ecySyvrJye/m009hATefaMwEU0gry+XiuMkpMzI/LqagUWMEXyQyORi5OTk3a7jcxrGxvkPhlnmMtmPy0uHh8f7+3v/4llZ2dnd3e3Xq9vbv7Y2tparVRsxzXBRsgGbt6284QkKBAiBNpZRV2FGWt0GXHdu2Td1oxhdE2TAvgV3YpZmNLoOtPbyHFYilZBn+EZfJjXDYcewqsiJkkkZZDkSG+vKoLQDyggrnqbluhBdCHjfky+C5Bx4SNkIT8uhG9m2PQr9+ad+f8h3+TvebkCGU1bGkrR5K8rhNeUJ3bBdu4DTjPZ3D8brMCpfNAmkwAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Screen Shot 2018 05 30 at 9 47 33 AM 300x280\"\n        title=\"Screen Shot 2018 05 30 at 9 47 33 AM 300x280\"\n        src=\"/static/93d6165c3349226f8330d45e93a4a349/5a46d/Screen-Shot-2018-05-30-at-9.47.33-AM-300x280.png\"\n        srcset=\"/static/93d6165c3349226f8330d45e93a4a349/5a46d/Screen-Shot-2018-05-30-at-9.47.33-AM-300x280.png 300w\"\n        sizes=\"(max-width: 300px) 100vw, 300px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></li>\n<li>Click on Skip(in the upper right corner) choosing a category and click Build -> Actions in the left nav to add your first actions.<br>\n<span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 300px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 59.00000000000001%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAIAAADtbgqsAAAACXBIWXMAAAsTAAALEwEAmpwYAAABzUlEQVQoz4WRO28UMRDH9wtBwaMKSGloKJKKAiEoeHwCivAIBQ30+QoRoqLMJ6AhOV2BckruAimSy758ttf2rmfX3rWX8d4RgYjE6KfRuPiP5z8TPXh7srE129yabr6a3n95fP3J4c1nE8zXHl/N7eeTWy9mNx59XX/4KaK8IlSU2jami1P6dIfeey/Xt8XaG3HnKtYG7m6LjQ88ahpwru2HqAFGUzb+CfuzCjk40QczvT8Q6uG5ZPQDvh2LSAghpbTWohigVrLAwvf/jxqqqKoqyhjUNb41wIIFMQNJofC9N8ZqDUjXdX5oGhh6S1VF1hrv3LIZABSFLLQazQ+P0lOuRalUHMeE5ADaGNM0TV0jtfNelVVEWCVL0xjTWiuV4oUkBZuczb6fHlHGneva1mAO/7lVdMNnQcxFSZiglKFztMC4QP8XWXqeJ33f7Y3tu8/64xd4vav3xgY1zq82EsTY2nt/OTbjw8L8ypgCnxWOyJBL+GuPQVyW6Eu1bbgWrm1BWdt1tm0D1g5XXIFzd78DhxdS4Z1DuMEGFvMkjTNykWbzNI/TfJ7kZ3F2jiR5RjlhxSUJoRGuDjstJ2nqJsnIAnfGxb/krPgTFP8C1VB8EjVHnhIAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Screen Shot 2018 05 30 at 10 02 46 AM 300x177\"\n        title=\"Screen Shot 2018 05 30 at 10 02 46 AM 300x177\"\n        src=\"/static/e88ec1116b696662eacaf7baec40bad6/5a46d/Screen-Shot-2018-05-30-at-10.02.46-AM-300x177.png\"\n        srcset=\"/static/e88ec1116b696662eacaf7baec40bad6/5a46d/Screen-Shot-2018-05-30-at-10.02.46-AM-300x177.png 300w\"\n        sizes=\"(max-width: 300px) 100vw, 300px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></li>\n</ol>\n</li>\n<li>\n<p>Configuration for your action intent in the dialogflow console.</p>\n<ol>\n<li>In the Intent section, enter your training phrases. Start with “talk to”, “speak to”, “ask” and etc, learn more <a href=\"https://developers.google.com/actions/localization/languages-locales\">here.</a>\n<span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 300px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 96%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAATCAIAAAAf7rriAAAACXBIWXMAAAsTAAALEwEAmpwYAAABeklEQVQ4y42Ta06EMBSFu1DjX12GrswYE3+ZuAfMDAwgCVDa0setp+2IzPBwTpqGlH73cbgwzgcPKcE5z7KsaZqyLA+HQ1EUWfYlhMBLIsLejPTwLu9e5fOn8uSsdUxrHWA9QsDatqvruiwrRMmLIsHOAaZG2se3/v6le/rgEbbMGCulVKNWSvk10UzTWYzomBDydCq/gxpa6CKK98Z5S16o0VmHlyykj0IkcrcKcbGxvu/zHN2hPTl5sy+4k3h2XRvRVqpJ0wkbhgGZ0fYxL6qqgtXLVLiqopCzbdu/zGgWh6g5eK4UvhxKuVq4mXwxcQFJH4EhTNdznI0jvrU2xtCa5qYHo0NQYijARKttXNC58/UVyrW/d0JmDCZ2EUpX2OB/GjvakJvDXdejYcAwDw8g0RZtazI/wEgFr0CihDSktKsFLAMMJW/+h/0MRrupZvyheN7nL+DUc8gLUojk301la22GQeC2lOc5SQOzD5/d3pr+5ZzNV4J/AMfIWgitfsxaAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Screen Shot 2018 05 30 at 10 41 30 AM 300x288\"\n        title=\"Screen Shot 2018 05 30 at 10 41 30 AM 300x288\"\n        src=\"/static/31f79bd080a52e3020c126dd4878f487/5a46d/Screen-Shot-2018-05-30-at-10.41.30-AM-300x288.png\"\n        srcset=\"/static/31f79bd080a52e3020c126dd4878f487/5a46d/Screen-Shot-2018-05-30-at-10.41.30-AM-300x288.png 300w\"\n        sizes=\"(max-width: 300px) 100vw, 300px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></li>\n<li>Enter the default text response. This will be the default response for your action until you link your account with LoginRadius and build your customized response. (This will return errors if you leave this empty, even if you handle the response in your code.)<span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 300px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 64.33333333333333%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAIAAAAmMtkJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA8klEQVQoz6VSa4+EIAz0//9NPN+iFOTlUm5kzWa/6O7lJpA0oTPttFQxxr4fxnGaZzlLmXNmzvdg5n3fEVSINsBs1jogf4GUUoyF/ODc2rQEjsHzx6Kl7CutSswUkoMQQ5Ifn4CckpYOMkhSyqZphKhh3fvgvXfXGIax6/oQwulZKSWXZZymdVXWWkwgXENrQ6Qx5tJ2SsYYDEAp0lpLyCwr2rv3n8rrURnNPMcAIewAQmgeAV8Dtk8yNtx2QN+23fu2oH5zTjLmVNc/OEKIL1d9rgoXH4uInHXbZuGfDu9GEcH/88/dkWH1ZSb/BVX+B34BDXz8ZyzoB5EAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Screen Shot 2018 05 30 at 10 42 03 AM 300x193\"\n        title=\"Screen Shot 2018 05 30 at 10 42 03 AM 300x193\"\n        src=\"/static/68f295e6d361c954fa66031be7cc6ccc/5a46d/Screen-Shot-2018-05-30-at-10.42.03-AM-300x193.png\"\n        srcset=\"/static/68f295e6d361c954fa66031be7cc6ccc/5a46d/Screen-Shot-2018-05-30-at-10.42.03-AM-300x193.png 300w\"\n        sizes=\"(max-width: 300px) 100vw, 300px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></li>\n</ol>\n</li>\n</ol>\n<p>By then, you should have finished the setup for google assistant.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"June 18, 2018","updated_date":null,"title":"How to configure the 'Actions on Google' console for Google Assistant","tags":["Engineering","GoogleAssistant"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.3333333333333333,"src":"/static/7c27883a1e132979d413b1d4efcb16b0/14b42/google-home-max-13.jpg","srcSet":"/static/7c27883a1e132979d413b1d4efcb16b0/f836f/google-home-max-13.jpg 200w,\n/static/7c27883a1e132979d413b1d4efcb16b0/2244e/google-home-max-13.jpg 400w,\n/static/7c27883a1e132979d413b1d4efcb16b0/14b42/google-home-max-13.jpg 800w,\n/static/7c27883a1e132979d413b1d4efcb16b0/47498/google-home-max-13.jpg 1200w,\n/static/7c27883a1e132979d413b1d4efcb16b0/0e329/google-home-max-13.jpg 1600w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Vincent Lin","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/eol-end-of-line-or-newline-characters/"},"html":"<p>Which character do you consider as the end of line or newline? Most developers will answer \\n (except for front-end developers, they would say: \"&#x3C;/br>tag\" 😊 ). But this is not true, let's understand why.</p>\n<p><strong>What is an End of Line character:</strong></p>\n<p>It is a character in a string which represents a line break, which means that after this character, a new line will start. There are two basic new line characters:</p>\n<p><strong>LF</strong> (character : \\n, Unicode : U+000A, ASCII : 10, hex : 0x0a): This is simply the '\\n' character which we all know from our early programming days. This character is commonly known as the ‘Line Feed’ or ‘Newline Character’.</p>\n<p><strong>CR</strong> (character : \\r, Unicode : U+000D, ASCII : 13, hex : 0x0d) : This is simply the 'r' character. This character is commonly known as ‘Carriage Return’.</p>\n<p>As matter of fact, \\r has also has a different meaning. In older printers, \\r meant moving the print head back to the start of line and \\n meant starting a new line.</p>\n<p><strong>OS support</strong></p>\n<p>Unix: Unix systems consider '\\n' as a line terminator. Unix considers \\r as going back to the start of the same line.</p>\n<p>Mac (up to 9): Older Mac OSs consider '\\r' as a newline terminator but newer OS versions have been made to be more compliant with Unix systems to use '\\n' as the newline.</p>\n<p>Windows: Windows has a different style of newline, Windows supports the combination of both CR and LF as the newline character - '\\r\\n'.</p>\n<p><strong>How to check</strong><br>\nThere are lots ways to check this. I use Notepad++ as my text editor for this because it is easy to use and is widely used by developers.<br>\nNPP show all characters</p>\n<p>Open any text file and click on the pilcrow (¶) button. Notepad++ will show all of the characters with newline characters in either the CR and LF format. If it is a Windows EOL encoded file, the newline characters of CR LF will appear (\\r\\n). If the file is UNIX or Mac EOL encoded, then it will only show LF (\\n).</p>\n<p><strong>NPP Extended search</strong></p>\n<p>Press the key combination of Ctrl + Shift + F and select 'Extended' under the search mode. Now search '\\r\\n' - if you find this at end of every line, it means this is a Windows EOL encoded file. However, if it is '\\n' at the end of every line, then it is a Unix or Mac EOL encoded file.</p>\n<p><strong>How to convert</strong></p>\n<p>Let's stick with notepad++ for this, too. Open any file that you would like to convert, click on the Edit menu, scroll down to the EOL conversion option, and select the format that you would like to convert the file to.</p>\n<p><strong>Reference</strong></p>\n<ul>\n<li><a href=\"https://www.compart.com/en/unicode/U+000A\">Unicode Character (U+000A)</a></li>\n<li><a href=\"https://www.compart.com/en/unicode/U+000D\">Unicode Character (U+000D)</a></li>\n</ul>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"September 06, 2017","updated_date":null,"title":"EOL or End of Line or newline ascii character","tags":["Engineering","EOL","LF","Linux","Mac","Windows"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7699115044247788,"src":"/static/4f4e5464d0975f41f5388d63c602e499/ee604/eol.png","srcSet":"/static/4f4e5464d0975f41f5388d63c602e499/69585/eol.png 200w,\n/static/4f4e5464d0975f41f5388d63c602e499/497c6/eol.png 400w,\n/static/4f4e5464d0975f41f5388d63c602e499/ee604/eol.png 800w,\n/static/4f4e5464d0975f41f5388d63c602e499/f3583/eol.png 1200w,\n/static/4f4e5464d0975f41f5388d63c602e499/e4d72/eol.png 1280w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Kundan Singh","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/get-your-free-ssl-certificate/"},"html":"<p>These days SSL is a must-have element for websites, but SSL certificates are costly and range from $30 to $500 per year for a single website. Don’t fret! You can get a FREE SSL certificate! Through “<a href=\"https://letsencrypt.org/\">Let's Encrypt</a>\", a free, automated, and open certificate authority, you will be able to acquire the necessary certificate to enable SSL on your website. Check out the below steps you can follow to get an SSL certificate for your site today.</p>\n<p>To obtain this certificate, you will first need to prove ownership of the domain. There are two requirements that you need to meet in order to generate a certificate from “Let's Encrypt”:</p>\n<p><strong>Http-01</strong>:<br>\nYou will need to setup a directory on your web server's root, and the name of this directory should be “.well-know” and with a “acme-validation” directory included within this. Inside these directories, create a file containing the random string that was provided by the ACME server and this file should serve content which is the random string included in the doc.</p>\n<p><strong>Sample Structure</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">/.well-known/acme-validation/&amp;amp;lt;random file name provided by ACME&amp;amp;gt;</span></code></pre>\n<p><strong>Dns-01:</strong></p>\n<p>You will need to create a .TXT record on the subdomain _acme-challenge. For instance, if you would like to obtain an SSL for the domain “example.com”, then you will need to setup a subdomain on this domain - _acme-challenge.example.com - and the content of the .TXT record will be a random string provided by the ACME server.</p>\n<p>Now that you have everything setup, how do you get your FREE SSL? Below, we will go over the various ways to enable SSL for free on your website:</p>\n<p><strong>1. Certbot</strong> : <a href=\"https://certbot.eff.org/\">certbot</a> is a Linux utility that is simple yet powerful. This tool doesn't share private keys with any servers, and it keeps your private key on the client that is being used to generate the cert.  You can install certbot with the following command on ubuntu:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">$ sudo add-apt-repository ppa:certbot/certbot</span>\n<span class=\"grvsc-line\">$ sudo apt-get update</span>\n<span class=\"grvsc-line\">$ sudo apt-get install certbot</span></code></pre>\n<p>The <a href=\"https://certbot.eff.org/\">certbot site</a> has even more details and information for installing this on other systems.</p>\n<p>Once installed, open the DNS Manager (must do!) and call the following command to get the SSL certificate for your domain.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">sudo certbot --text --agree-tos --email &amp;amp;lt;YOUR EMAIL ID&amp;amp;gt; -d &amp;amp;lt;YOUR DOMAIN&amp;amp;gt; --manual --preferred-challenges dns --expand --renew-by-default  --manual public-ip-logging-ok certonly</span></code></pre>\n<p>This command will request that you add the .TXT record on the subdomain _acme-challenge. Once this is added, simply press any key to generate the SSL certificate. It will show the locations of the certified file.</p>\n<p><strong>2. Online using</strong> <a href=\"https://www.sslforfree.com/\"><strong>https://www.sslforfree.com/</strong></a> : This is also a non-profit site and you can get SSL without any installation; just follow the steps to set up the ACME compliant site structure. They provide an easy step-by-step guide for generating the SSL certificate. Once you work through the guide, you will be able to download a copy of your certificate and include on your webserver.</p>\n<p><strong>3. Other ways</strong> : There are lots of other ways to get the “Let's Encrypt” SSL. <a href=\"https://letsencrypt.org/docs/client-options/\">This page</a> contains a list of ACME clients and libraries, so you can choose to work with whichever one that best suits your needs.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n</style>","frontmatter":{"date":"July 13, 2017","updated_date":null,"title":"Get your FREE SSL Certificate!","tags":["Engineering","SSL"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/44e96863451de6352d54342c2dd11bf3/bc59e/letsencrypt.png","srcSet":"/static/44e96863451de6352d54342c2dd11bf3/69585/letsencrypt.png 200w,\n/static/44e96863451de6352d54342c2dd11bf3/497c6/letsencrypt.png 400w,\n/static/44e96863451de6352d54342c2dd11bf3/bc59e/letsencrypt.png 512w","sizes":"(max-width: 512px) 100vw, 512px"}}},"author":{"id":"Kundan Singh","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/open-source-business-email-validator-by-loginradius/"},"html":"<p>While creating Lead Generation form at LoginRadius, Marketers wanted to sure that visitors enter business emails. To that end, I created a list in JSON format to block free mail providers like Gmail, Outlook etc.</p>\n<p>Business mail validator makes sure users enters only business emails in submission forms on a web page. User can’t enter with free email’s that provided by the third party (free email) service provider.</p>\n<p>Ex. Gmail.com, Yahoo.com, Yahoomail.com, Rediff.com etc.</p>\n<p>We can classified business email validation in two ways.</p>\n<h3 id=\"1-client-side\" style=\"position:relative;\"><a href=\"#1-client-side\" aria-label=\"1 client side permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>1. Client side</strong></h3>\n<p>In client side validation we use javascript(js) OR jQuery to validate entered the email at time of submission the html form. So we can follow the following steps to validate it on client side.</p>\n<ul>\n<li>First of all create a simple html page with name emailvalidate.html</li>\n<li>\n<p>Add jQuery script on head section</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk1\"> </span><span class=\"mtk12\">src</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js&quot;</span><span class=\"mtk17\">&gt;&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n</li>\n<li>Call json file content in a script variable like</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    var emailValidator = </span><span class=\"mtk4\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk8\">&quot;123.com&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk4\">true</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk8\">&quot;123box.net&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk4\">true</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk8\">&quot;123india.com&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk4\">true</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        …………………….</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        …………………..</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk8\">&quot;ymail.com&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk4\">true</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk8\">&quot;yandex.com&quot;</span><span class=\"mtk1\">: </span><span class=\"mtk4\">true</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">}</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>Our complete list is available <a href=\"https://github.com/LoginRadius/business-email-validator/blob/master/src/freeEmailService.json\">here</a></p>\n<ul>\n<li>Add validation form function after you have added above code.</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">function validateForm(id) </span><span class=\"mtk4\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                            </span><span class=\"mtk12\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">emailValue</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">jQuery</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;#&#39;</span><span class=\"mtk1\">+</span><span class=\"mtk12\">id</span><span class=\"mtk1\">).</span><span class=\"mtk11\">val</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                            </span><span class=\"mtk12\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">emailArray</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">emailValue</span><span class=\"mtk1\">.</span><span class=\"mtk11\">split</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;@&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                            </span><span class=\"mtk12\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">provider</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">emailArray</span><span class=\"mtk1\">[</span><span class=\"mtk7\">1</span><span class=\"mtk1\">] ? </span><span class=\"mtk12\">emailArray</span><span class=\"mtk1\">[</span><span class=\"mtk7\">1</span><span class=\"mtk1\">] : </span><span class=\"mtk8\">&#39;&#39;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                            </span><span class=\"mtk11\">for</span><span class=\"mtk1\">(</span><span class=\"mtk12\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">domain</span><span class=\"mtk1\"> </span><span class=\"mtk4\">in</span><span class=\"mtk1\"> </span><span class=\"mtk12\">emailValidator</span><span class=\"mtk1\">){</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                            </span><span class=\"mtk11\">if</span><span class=\"mtk1\">(</span><span class=\"mtk12\">emailValidator</span><span class=\"mtk1\">[</span><span class=\"mtk12\">domain</span><span class=\"mtk1\">]){</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                                                        </span><span class=\"mtk15\">if</span><span class=\"mtk1\">(</span><span class=\"mtk12\">domain</span><span class=\"mtk1\"> == </span><span class=\"mtk12\">provider</span><span class=\"mtk1\">){</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                                                        </span><span class=\"mtk11\">alert</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Please Provide Business Email Address.&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                                                        </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk4\">false</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                                                                        }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                                                      }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                           }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span><span class=\"mtk12\">return</span><span class=\"mtk1\"> </span><span class=\"mtk4\">true</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">script</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<ul>\n<li><strong>Create html form</strong></li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">form</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;myForm&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">action</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;emailsubmit.php&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">onsubmit</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;return validateForm(&#39;business_email&#39;);&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">method</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;post&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">input</span><span class=\"mtk1\"> </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;text&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">placeholder</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;Full Name&quot;</span><span class=\"mtk17\">/&gt;&lt;</span><span class=\"mtk4\">br</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">input</span><span class=\"mtk1\"> </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;email&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">id</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;business_email&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;email&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">placeholder</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;Email Address&quot;</span><span class=\"mtk17\">/&gt;&lt;</span><span class=\"mtk4\">br</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">input</span><span class=\"mtk1\"> </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;submit&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;submit&quot;</span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">form</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>Note: if you have already have html form where you want to apply this avalidator, look up for the buysiness_email and replace it accordingly.</p>\n<ul>\n<li>Save the file and try to execute this html page on a browser.</li>\n</ul>\n<h3 id=\"2-server-side\" style=\"position:relative;\"><a href=\"#2-server-side\" aria-label=\"2 server side permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>2. Server side</strong></h3>\n<p>In Server side validation we use php scripting language to validate entered email at time of submission the html form. So we can flow the following steps to validate it.</p>\n<ul>\n<li>Create a php page with name of emailsubmit.php</li>\n<li>Receive email in php post method by following code.</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"php\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;?php</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">$email</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">isset</span><span class=\"mtk1\">(</span><span class=\"mtk12\">$_POST</span><span class=\"mtk1\">[‘email’]) ? </span><span class=\"mtk11\">trim</span><span class=\"mtk1\">(</span><span class=\"mtk12\">$_POST</span><span class=\"mtk1\">[‘email’]):’’;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">if</span><span class=\"mtk1\">(!</span><span class=\"mtk11\">empty</span><span class=\"mtk1\">(</span><span class=\"mtk12\">$email</span><span class=\"mtk1\">)){</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                 </span><span class=\"mtk12\">$tempEmail</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">explode</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;@&#39;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">$email</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                     </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk11\">isset</span><span class=\"mtk1\">(</span><span class=\"mtk12\">$tempEmail</span><span class=\"mtk1\">[</span><span class=\"mtk8\">&#39;1&#39;</span><span class=\"mtk1\">]) && !</span><span class=\"mtk11\">empty</span><span class=\"mtk1\">(</span><span class=\"mtk12\">$tempEmail</span><span class=\"mtk1\">[</span><span class=\"mtk8\">&#39;1&#39;</span><span class=\"mtk1\">])) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                 </span><span class=\"mtk12\">$validEmail</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">json_decode</span><span class=\"mtk1\">(</span><span class=\"mtk11\">file_get_contents</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;freeEmailService.json&#39;</span><span class=\"mtk1\">), </span><span class=\"mtk4\">true</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                     </span><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk11\">is_array</span><span class=\"mtk1\">(</span><span class=\"mtk12\">$validEmail</span><span class=\"mtk1\">) && </span><span class=\"mtk11\">in_array</span><span class=\"mtk1\">(</span><span class=\"mtk12\">$tempEmail</span><span class=\"mtk1\">[</span><span class=\"mtk8\">&#39;1&#39;</span><span class=\"mtk1\">], </span><span class=\"mtk11\">array_keys</span><span class=\"mtk1\">(</span><span class=\"mtk12\">$validEmail</span><span class=\"mtk1\">))) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                     </span><span class=\"mtk11\">echo</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Please use business email address.&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                  }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                }</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span><span class=\"mtk15\">else</span><span class=\"mtk1\">{</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">                     </span><span class=\"mtk11\">echo</span><span class=\"mtk1\"> ‘email is required field.’;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">?&gt;</span></span></code></pre>\n<ul>\n<li>Save file and upload on server</li>\n</ul>\n<p>Feel free to add, edit or modify this script as per your requirements. You can contact us if you have any queries.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk17 { color: #808080; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n</style>","frontmatter":{"date":"April 25, 2017","updated_date":null,"title":"Open Source Business Email Validator By Loginradius","tags":["Engineering"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":0.746268656716418,"src":"/static/bbcfe6f9ef64e0695370aa979325ff56/ab8bb/Open-Source-Business-Validator-By-Loginradius.png","srcSet":"/static/bbcfe6f9ef64e0695370aa979325ff56/69585/Open-Source-Business-Validator-By-Loginradius.png 200w,\n/static/bbcfe6f9ef64e0695370aa979325ff56/ab8bb/Open-Source-Business-Validator-By-Loginradius.png 377w","sizes":"(max-width: 377px) 100vw, 377px"}}},"author":{"id":"Team LoginRadius","github":"LoginRadius","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/16-javascript-hacks-for-optimization/"},"html":"<p>JavaScript or JS helps implement complex things on web pages. Many of the developers know the importance of an minified Javascript file but few are aware of an Optimized Javascript code.</p>\n<p>An optimized code is a combination of smartly programmed logics and small hacks to optimize performance, speed and save time.</p>\n<p>Here are sweet 16 <strong>JS hacks and tips</strong> for developers  for optimizing Javascript to improve JS performance and improve execution time without affecting server resources.</p>\n<h3 id=\"1-use-array-filter\" style=\"position:relative;\"><a href=\"#1-use-array-filter\" aria-label=\"1 use array filter permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>1. Use Array Filter</strong></h3>\n<p>It is a small hack to filter out bucket of elements from the array pool. This method creates an array filled with all array elements that pass a test (provided as a function). According to requirement create a callback function for non-required elements.</p>\n<p>In below example the bucket elements are <em>null</em> and are ready to get filtered out. </p>\n<p>Example:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">schema</span><span class=\"mtk1\"> = [</span><span class=\"mtk8\">&quot;hi&quot;</span><span class=\"mtk1\">,</span><span class=\"mtk8\">&quot;ihaveboyfriend&quot;</span><span class=\"mtk1\">,</span><span class=\"mtk4\">null</span><span class=\"mtk1\">, </span><span class=\"mtk4\">null</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;goodbye&quot;</span><span class=\"mtk1\">]</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">schema</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">schema</span><span class=\"mtk1\">.</span><span class=\"mtk11\">filter</span><span class=\"mtk1\">(</span><span class=\"mtk4\">function</span><span class=\"mtk1\">(</span><span class=\"mtk12\">n</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk12\">n</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> });</span></span></code></pre>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">Output: [&quot;hi&quot;,&quot;ihaveboyfriend&quot;, &quot;goodbye&quot;]</span></code></pre>\n<p>This hack will save some time and lines of codes for developers.</p>\n<h3 id=\"2-using-string-replace-function-to-replace-all-the-values\" style=\"position:relative;\"><a href=\"#2-using-string-replace-function-to-replace-all-the-values\" aria-label=\"2 using string replace function to replace all the values permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>2. Using String replace function to replace all the values</strong></h3>\n<p><em>The String.replace()</em> <em>function</em> allows you to replace strings using String and Regex.</p>\n<p>Basically this function replaces the string at its first occurrence. But to replace all using <em>replaceAll()</em> function, use <em>/g</em> at the end of a Regex:</p>\n<p>Example:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">string</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&quot;login login&quot;</span><span class=\"mtk1\">; </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">string</span><span class=\"mtk1\">.</span><span class=\"mtk11\">replace</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;in&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;out&quot;</span><span class=\"mtk1\">)); </span><span class=\"mtk3\">// &quot;logout login&quot; </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">string</span><span class=\"mtk1\">.</span><span class=\"mtk11\">replace</span><span class=\"mtk1\">(</span><span class=\"mtk5\">/in/</span><span class=\"mtk4\">g</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;out&quot;</span><span class=\"mtk1\">)); </span><span class=\"mtk3\">//&quot;logout logout&quot;</span></span></code></pre>\n<h3 id=\"3use-breakpoints-and-console-for-debugging\" style=\"position:relative;\"><a href=\"#3use-breakpoints-and-console-for-debugging\" aria-label=\"3use breakpoints and console for debugging permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>3. Use breakpoints and Console for Debugging</strong></h3>\n<p>With the help of <strong>breakpoints</strong> or <strong>debugging points</strong> you can set multiple barriers to rectify source of error at every barrier. </p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 22.30769230769231%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAEABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAIF/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEAMQAAAB3KCAf//EABUQAQEAAAAAAAAAAAAAAAAAAAEQ/9oACAEBAAEFAi//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAUEAEAAAAAAAAAAAAAAAAAAAAQ/9oACAEBAAY/An//xAAVEAEBAAAAAAAAAAAAAAAAAAABEP/aAAgBAQABPyEF/9oADAMBAAIAAwAAABADz//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8QP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8QP//EABkQAAMAAwAAAAAAAAAAAAAAAAABEVFhcf/aAAgBAQABPxDafWRYRKf/2Q=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Use breakpoints and Console for Debugging\"\n        title=\"Use breakpoints and Console for Debugging\"\n        src=\"/static/97366362ead42b015964c38bcba209be/212bf/Use-breakpoints-and-Console-for-Debugging-1.jpg\"\n        srcset=\"/static/97366362ead42b015964c38bcba209be/6aca1/Use-breakpoints-and-Console-for-Debugging-1.jpg 650w,\n/static/97366362ead42b015964c38bcba209be/212bf/Use-breakpoints-and-Console-for-Debugging-1.jpg 768w,\n/static/97366362ead42b015964c38bcba209be/c44b8/Use-breakpoints-and-Console-for-Debugging-1.jpg 1360w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Press F11 for next call function and f8 to resume script execution.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 48.92307692307692%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAKABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAQBBf/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAHorNIVaP/EABgQAAMBAQAAAAAAAAAAAAAAAAABEwIg/9oACAEBAAEFApsnom+P/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAFBABAAAAAAAAAAAAAAAAAAAAIP/aAAgBAQAGPwJf/8QAGRAAAwADAAAAAAAAAAAAAAAAARARADFR/9oACAEBAAE/IaahRHjGf//aAAwDAQACAAMAAAAQQw//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/ED//xAAVEQEBAAAAAAAAAAAAAAAAAAAAEf/aAAgBAgEBPxBX/8QAGxAAAwADAQEAAAAAAAAAAAAAAAERIVFxQZH/2gAIAQEAAT8QVVcmW8X0SESVdE48Fe2ZW7P/2Q=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Use breakpoints and Console for Debugging\"\n        title=\"Use breakpoints and Console for Debugging\"\n        src=\"/static/3db112a716ff589748c3b2f4bccf9cf5/212bf/Use-breakpoints-and-Console-for-Debugging-2.jpg\"\n        srcset=\"/static/3db112a716ff589748c3b2f4bccf9cf5/6aca1/Use-breakpoints-and-Console-for-Debugging-2.jpg 650w,\n/static/3db112a716ff589748c3b2f4bccf9cf5/212bf/Use-breakpoints-and-Console-for-Debugging-2.jpg 768w,\n/static/3db112a716ff589748c3b2f4bccf9cf5/c44b8/Use-breakpoints-and-Console-for-Debugging-2.jpg 1360w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>You can also check what dynamic values are generated by a function, using console and can check output on different values.</p>\n<h3 id=\"4-convert-to-floating-number-without-killing-performance\" style=\"position:relative;\"><a href=\"#4-convert-to-floating-number-without-killing-performance\" aria-label=\"4 convert to floating number without killing performance permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>4. Convert to floating number without killing performance</strong></h3>\n<p>Often we use <strong>math.floor</strong>, <strong>math.ceil</strong> and <strong>math.round</strong> for eliminating decimals. Instead of using them <strong>use “~~”</strong> to eliminate decimals for a value.</p>\n<p>It is also helpful in increasing performance when it comes to micro optimizations in a code.</p>\n<p><strong>Example:</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">Use</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">~~ (</span><span class=\"mtk12\">math</span><span class=\"mtk1\">.</span><span class=\"mtk12\">random</span><span class=\"mtk1\">*</span><span class=\"mtk7\">100</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">Instead</span><span class=\"mtk1\"> </span><span class=\"mtk4\">of</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">math</span><span class=\"mtk1\">.</span><span class=\"mtk11\">round</span><span class=\"mtk1\">(</span><span class=\"mtk12\">math</span><span class=\"mtk1\">.</span><span class=\"mtk12\">random</span><span class=\"mtk1\">*</span><span class=\"mtk7\">100</span><span class=\"mtk1\">)</span></span></code></pre>\n<h3 id=\"5-using-length-to-delete-empty-in-an-array\" style=\"position:relative;\"><a href=\"#5-using-length-to-delete-empty-in-an-array\" aria-label=\"5 using length to delete empty in an array permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>5. Using length to delete empty in an array</strong></h3>\n<p>This technique will help you in resizing and emptying an array.</p>\n<p>For deleting n elements in an Array, use <em><strong>array.length</strong></em>. </p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\"> </span><span class=\"mtk12\">array</span><span class=\"mtk1\">.</span><span class=\"mtk12\">length</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">n</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">See</span><span class=\"mtk1\"> </span><span class=\"mtk4\">this</span><span class=\"mtk1\"> example:</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">array</span><span class=\"mtk1\"> = [</span><span class=\"mtk7\">1</span><span class=\"mtk1\">, </span><span class=\"mtk7\">2</span><span class=\"mtk1\">, </span><span class=\"mtk7\">3</span><span class=\"mtk1\">, </span><span class=\"mtk7\">4</span><span class=\"mtk1\">, </span><span class=\"mtk7\">5</span><span class=\"mtk1\">, </span><span class=\"mtk7\">6</span><span class=\"mtk1\">]; </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">array</span><span class=\"mtk1\">.</span><span class=\"mtk12\">length</span><span class=\"mtk1\">); </span><span class=\"mtk3\">// 6 </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">array</span><span class=\"mtk1\">.</span><span class=\"mtk12\">length</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">3</span><span class=\"mtk1\">; </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">array</span><span class=\"mtk1\">.</span><span class=\"mtk12\">length</span><span class=\"mtk1\">); </span><span class=\"mtk3\">// 3 </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">array</span><span class=\"mtk1\">); </span><span class=\"mtk3\">// [1,2,3]</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">For</span><span class=\"mtk1\"> **</span><span class=\"mtk12\">emptying</span><span class=\"mtk1\"> </span><span class=\"mtk12\">array</span><span class=\"mtk1\">** </span><span class=\"mtk12\">use</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">array</span><span class=\"mtk1\">.</span><span class=\"mtk12\">length</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">0</span><span class=\"mtk1\">;.</span></span></code></pre>\n<p><strong>Example:</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">array</span><span class=\"mtk1\"> = [</span><span class=\"mtk7\">1</span><span class=\"mtk1\">, </span><span class=\"mtk7\">2</span><span class=\"mtk1\">, </span><span class=\"mtk7\">3</span><span class=\"mtk1\">, </span><span class=\"mtk7\">4</span><span class=\"mtk1\">, </span><span class=\"mtk7\">5</span><span class=\"mtk1\">, </span><span class=\"mtk7\">6</span><span class=\"mtk1\">]; </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">array</span><span class=\"mtk1\">.</span><span class=\"mtk12\">length</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">0</span><span class=\"mtk1\">; </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">array</span><span class=\"mtk1\">.</span><span class=\"mtk12\">length</span><span class=\"mtk1\">); </span><span class=\"mtk3\">// 0 </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">array</span><span class=\"mtk1\">); </span><span class=\"mtk3\">// []</span></span></code></pre>\n<p>This technique is <strong>mostly preferred</strong> over any other methods to resize/unset the array elements and is one of the <strong>best javascript practices</strong> most of the developers follow.</p>\n<h3 id=\"6-merging-arrays-without-causing-server-load\" style=\"position:relative;\"><a href=\"#6-merging-arrays-without-causing-server-load\" aria-label=\"6 merging arrays without causing server load permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>6. Merging arrays without causing server load</strong></h3>\n<p>If your requirement is of <strong>merging two arrays</strong>, use Array.concat() function</p>\n<p>For merging two arrays:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">array1</span><span class=\"mtk1\"> = [</span><span class=\"mtk7\">1</span><span class=\"mtk1\">, </span><span class=\"mtk7\">2</span><span class=\"mtk1\">, </span><span class=\"mtk7\">3</span><span class=\"mtk1\">]; </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">array2</span><span class=\"mtk1\"> = [</span><span class=\"mtk7\">4</span><span class=\"mtk1\">, </span><span class=\"mtk7\">5</span><span class=\"mtk1\">, </span><span class=\"mtk7\">6</span><span class=\"mtk1\">]; </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">array1</span><span class=\"mtk1\">.</span><span class=\"mtk11\">concat</span><span class=\"mtk1\">(</span><span class=\"mtk12\">array2</span><span class=\"mtk1\">)); </span><span class=\"mtk3\">// [1,2,3,4,5,6]; </span></span></code></pre>\n<p>This function works best for small arrays.</p>\n<p>To <strong>merge large arrays</strong> we use</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk10\">Array</span><span class=\"mtk1\">.</span><span class=\"mtk12\">push</span><span class=\"mtk1\">.</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk12\">arr1</span><span class=\"mtk1\">, </span><span class=\"mtk12\">arr2</span><span class=\"mtk1\">)</span></span></code></pre>\n<p>Reason is using Array.concat() function on large arrays will <strong>consume lot of memory</strong> while creating a separate new array.</p>\n<p>In this case, you can use Array.push.apply(arr1, arr2) which instead will merge the second array in the first one, hence <strong>reducing the memory usage</strong>.</p>\n<p><strong>Example:</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"8\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">array1</span><span class=\"mtk1\"> = [</span><span class=\"mtk7\">1</span><span class=\"mtk1\">, </span><span class=\"mtk7\">2</span><span class=\"mtk1\">, </span><span class=\"mtk7\">3</span><span class=\"mtk1\">]; </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">array2</span><span class=\"mtk1\"> = [</span><span class=\"mtk7\">4</span><span class=\"mtk1\">, </span><span class=\"mtk7\">5</span><span class=\"mtk1\">, </span><span class=\"mtk7\">6</span><span class=\"mtk1\">]; </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">array1</span><span class=\"mtk1\">.</span><span class=\"mtk12\">push</span><span class=\"mtk1\">.</span><span class=\"mtk11\">apply</span><span class=\"mtk1\">(</span><span class=\"mtk12\">array1</span><span class=\"mtk1\">, </span><span class=\"mtk12\">array2</span><span class=\"mtk1\">)); </span><span class=\"mtk3\">// [1,2,3,4,5,6];</span></span></code></pre>\n<p>It will also optimize the performance of your Javascript code irrespective of size of array.</p>\n<h3 id=\"7-use-splice-to-delete-array-elements\" style=\"position:relative;\"><a href=\"#7-use-splice-to-delete-array-elements\" aria-label=\"7 use splice to delete array elements permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>7. Use splice  to delete array elements</strong></h3>\n<p>This is probably the one of the best <strong>optimization tips for javascript</strong>. It <strong>optimizes speed</strong> of your JS code.</p>\n<p>Using splice instead of delete is a good practice, it will save some”null/undefined space” in your code.</p>\n<p>The downside of <strong>using delete</strong> is it will delete the object property, but will <strong>not reindex the array</strong> or update its length, leaving undefined values. Also it consumes a-lot of time in execution.</p>\n<p>Using <em>splice</em></p>\n<p>Example</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"9\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">myArray</span><span class=\"mtk1\"> = [</span><span class=\"mtk8\">&quot;a&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;b&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;c&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;d&quot;</span><span class=\"mtk1\">] </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">myArray</span><span class=\"mtk1\">.</span><span class=\"mtk11\">splice</span><span class=\"mtk1\">(</span><span class=\"mtk7\">0</span><span class=\"mtk1\">, </span><span class=\"mtk7\">2</span><span class=\"mtk1\">) [</span><span class=\"mtk8\">&quot;a&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;b&quot;</span><span class=\"mtk1\">]</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">Result: </span><span class=\"mtk12\">myArray</span><span class=\"mtk1\"> [</span><span class=\"mtk8\">&quot;c&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk8\">&quot;d&quot;</span><span class=\"mtk1\">]</span></span></code></pre>\n<h3 id=\"8-checking-values-in-an-object\" style=\"position:relative;\"><a href=\"#8-checking-values-in-an-object\" aria-label=\"8 checking values in an object permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>8. Checking values in an Object</strong></h3>\n<p>To check whether an object is empty or not,  use</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"10\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk10\">Object</span><span class=\"mtk1\">.</span><span class=\"mtk11\">keys</span><span class=\"mtk1\">(</span><span class=\"mtk12\">YOUR</span><span class=\"mtk1\">\\</span><span class=\"mtk12\">_OBJECT</span><span class=\"mtk1\">).</span><span class=\"mtk12\">length</span><span class=\"mtk1\"> </span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// 0 returns if object is empty</span></span></code></pre>\n<p>Following code return the number of elements in an Object.</p>\n<h3 id=\"9-cache-the-variable\" style=\"position:relative;\"><a href=\"#9-cache-the-variable\" aria-label=\"9 cache the variable permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>9. Cache the variable</strong></h3>\n<p>Caching the variable tremendously <strong>increase javascript performance</strong>.</p>\n<p>Everytime we use document.getElementById() or getElementsByClassName(), JS travels through all elements repeatedly upon each similar element request.</p>\n<p>In Order to boost performance, <strong>cache your selections</strong> to some variable (if using the same selection multiple times).</p>\n<p><strong>Example:</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"11\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">cached</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">document</span><span class=\"mtk1\">.</span><span class=\"mtk11\">getElementById</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;someElement&#39;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">cached</span><span class=\"mtk1\">.</span><span class=\"mtk11\">addClass</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&#39;cached-element&#39;</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>It is a simple <strong>optimization tip</strong> with drastic impact on performance, recommended for <strong>processing large arrays in loop(s)</strong>.</p>\n<p>Check this <a href=\"http://jquery-howto.blogspot.in/2008/12/caching-in-jquery.html\">link</a> for performance results.</p>\n<h3 id=\"10-use-switch-case-instead-of-ifelse\" style=\"position:relative;\"><a href=\"#10-use-switch-case-instead-of-ifelse\" aria-label=\"10 use switch case instead of ifelse permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>10. Use switch case instead of if/else</strong></h3>\n<p>Generally switch cases are used over if/else statements to <strong>perform almost the same tasks</strong>.</p>\n<p>The fact that in switch statements  expression to test is only evaluated once, execution time becomes less for the script compared to if/else where for every if , it has to be evaluated.</p>\n<h3 id=\"11-short-circuits-conditionals\" style=\"position:relative;\"><a href=\"#11-short-circuits-conditionals\" aria-label=\"11 short circuits conditionals permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>11. Short-circuits conditionals</strong></h3>\n<p>Short circuiting  is when a logical operator doesn't evaluate all its arguments.</p>\n<p>The code</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"12\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">if</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">loggedin</span><span class=\"mtk1\">) { </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">welcome</span><span class=\"mtk1\">\\</span><span class=\"mtk11\">_messege</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\"> }</span></span></code></pre>\n<p>Make it short by using combination of a verified variable and a function using <em>&#x26;&#x26;</em> (AND operator) in between both.</p>\n<p> Now above code can be made in one line</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"13\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">loggedin</span><span class=\"mtk1\"> && </span><span class=\"mtk12\">welcome</span><span class=\"mtk1\">\\</span><span class=\"mtk11\">_messege</span><span class=\"mtk1\">();</span></span></code></pre>\n<h3 id=\"12-getting-the-last-item-in-the-array\" style=\"position:relative;\"><a href=\"#12-getting-the-last-item-in-the-array\" aria-label=\"12 getting the last item in the array permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>12. Getting the last item in the array</strong></h3>\n<p><em>Array.prototype.slice(begin, end)</em> is used to cut arrays when you set the start and end arguments.  But if you don't set the end argument, this function will automatically set the max value for the array.</p>\n<p>A smart hack is it can also accept negative values and by setting a negative number as begin argument, you will get the last elements from the array.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"14\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">array</span><span class=\"mtk1\"> = [</span><span class=\"mtk7\">1</span><span class=\"mtk1\">, </span><span class=\"mtk7\">2</span><span class=\"mtk1\">, </span><span class=\"mtk7\">3</span><span class=\"mtk1\">, </span><span class=\"mtk7\">4</span><span class=\"mtk1\">, </span><span class=\"mtk7\">5</span><span class=\"mtk1\">, </span><span class=\"mtk7\">6</span><span class=\"mtk1\">]; </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">array</span><span class=\"mtk1\">.</span><span class=\"mtk11\">slice</span><span class=\"mtk1\">(-</span><span class=\"mtk7\">1</span><span class=\"mtk1\">)); </span><span class=\"mtk3\">// [6] </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">array</span><span class=\"mtk1\">.</span><span class=\"mtk11\">slice</span><span class=\"mtk1\">(-</span><span class=\"mtk7\">2</span><span class=\"mtk1\">)); </span><span class=\"mtk3\">// [5,6] </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">array</span><span class=\"mtk1\">.</span><span class=\"mtk11\">slice</span><span class=\"mtk1\">(-</span><span class=\"mtk7\">3</span><span class=\"mtk1\">)); </span><span class=\"mtk3\">// [4,5,6]</span></span></code></pre>\n<h3 id=\"13-default-values-using--operator\" style=\"position:relative;\"><a href=\"#13-default-values-using--operator\" aria-label=\"13 default values using  operator permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>13. Default values using || operator</strong></h3>\n<p>In JS there is a basic rule of having a default value otherwise process will halt at undefined values.</p>\n<p>To provide default value in a variable use || to stay away from this most common issue.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"15\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">a</span><span class=\"mtk1\"> = </span><span class=\"mtk12\">a</span><span class=\"mtk1\"> || </span><span class=\"mtk8\">&#39;hello&#39;</span></span></code></pre>\n<p>The developer must check whether there are any conflicting values that might be passed to the function to avoid Bugs.</p>\n<h3 id=\"14-beautifying-js-code\" style=\"position:relative;\"><a href=\"#14-beautifying-js-code\" aria-label=\"14 beautifying js code permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>14. Beautifying JS code</strong></h3>\n<p>For beautifying your Javascript  code use <a href=\"http://jsbeautifier.org/\">jsbeautifier</a>. It formats a clumsy JS code into well structured code.</p>\n<p><strong>Code before Beautifying</strong></p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 49.84615384615385%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAKABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAECBf/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhADEAAAAdx0ySg//8QAFhABAQEAAAAAAAAAAAAAAAAAEQAg/9oACAEBAAEFAiIx/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAFBABAAAAAAAAAAAAAAAAAAAAIP/aAAgBAQAGPwJf/8QAGRAAAgMBAAAAAAAAAAAAAAAAABEBIEFR/9oACAEBAAE/IQmwJyn/2gAMAwEAAgADAAAAEOMP/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPxA//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPxA//8QAGRABAAMBAQAAAAAAAAAAAAAAAQAhMRCR/9oACAEBAAE/ELWEGwgODyGHf//Z'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Beautifying JS code 1\"\n        title=\"Beautifying JS code 1\"\n        src=\"/static/bd4a0a76f5894d6ef608215350c6c3a8/212bf/Beautifying-JS-code-2.jpg\"\n        srcset=\"/static/bd4a0a76f5894d6ef608215350c6c3a8/6aca1/Beautifying-JS-code-2.jpg 650w,\n/static/bd4a0a76f5894d6ef608215350c6c3a8/212bf/Beautifying-JS-code-2.jpg 768w,\n/static/bd4a0a76f5894d6ef608215350c6c3a8/80747/Beautifying-JS-code-2.jpg 815w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p><strong>Code after Beautifying</strong></p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 38.92307692307693%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAIABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAIF/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEAMQAAAB3KAD/8QAFRABAQAAAAAAAAAAAAAAAAAAABH/2gAIAQEAAQUCiI//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAUEAEAAAAAAAAAAAAAAAAAAAAQ/9oACAEBAAY/An//xAAXEAADAQAAAAAAAAAAAAAAAAAAEVEx/9oACAEBAAE/IdCQSH//2gAMAwEAAgADAAAAEIPP/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPxA//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPxA//8QAGhAAAgIDAAAAAAAAAAAAAAAAAAERMSFBkf/aAAgBAQABPxBNpgltSGk4f//Z'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Beautifying JS code 2\"\n        title=\"Beautifying JS code 2\"\n        src=\"/static/30ac854d19c1d6de684c9d6f0cf16f1b/212bf/Beautifying-JS-code-1.jpg\"\n        srcset=\"/static/30ac854d19c1d6de684c9d6f0cf16f1b/6aca1/Beautifying-JS-code-1.jpg 650w,\n/static/30ac854d19c1d6de684c9d6f0cf16f1b/212bf/Beautifying-JS-code-1.jpg 768w,\n/static/30ac854d19c1d6de684c9d6f0cf16f1b/f2bdc/Beautifying-JS-code-1.jpg 834w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h3 id=\"15-checking-js-performance\" style=\"position:relative;\"><a href=\"#15-checking-js-performance\" aria-label=\"15 checking js performance permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>15. Checking JS Performance</strong></h3>\n<p>To check how well a Javascript code is performing and share results use jsperf. It is easiest way to create and share testcases.</p>\n<h3 id=\"16-online-javascript-editor\" style=\"position:relative;\"><a href=\"#16-online-javascript-editor\" aria-label=\"16 online javascript editor permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>16. Online javascript editor</strong></h3>\n<p><a href=\"http://jsfiddle.net/\">Jsfiddle</a> and <a href=\"http://jsbin.com/\">jsbin</a> is a tool for experimenting with your Javascript code and other web languages.</p>\n<p>It is also a code sharing site. As you type into one of the editor panels the output is generated in real-time in the output panel.</p>\n<p>These are some useful hacks and tips for optimizing javascript performance. It is not mandatory to use them all the time because cases and conditions will vary. If you have tricks other than these, do share with us in comment section.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk5 { color: #D16969; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n</style>","frontmatter":{"date":"April 07, 2017","updated_date":null,"title":"Javascript tips and tricks to Optimize Performance","tags":["Engineering","JavaScript","Hacks","Array"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.3793103448275863,"src":"/static/f5e8f6ba73e9e3ac28efba4d9492473b/0756a/16-JavaScript-Hacks-to-save-time-and-boost-productivity-768x555.png","srcSet":"/static/f5e8f6ba73e9e3ac28efba4d9492473b/69585/16-JavaScript-Hacks-to-save-time-and-boost-productivity-768x555.png 200w,\n/static/f5e8f6ba73e9e3ac28efba4d9492473b/497c6/16-JavaScript-Hacks-to-save-time-and-boost-productivity-768x555.png 400w,\n/static/f5e8f6ba73e9e3ac28efba4d9492473b/0756a/16-JavaScript-Hacks-to-save-time-and-boost-productivity-768x555.png 768w","sizes":"(max-width: 768px) 100vw, 768px"}}},"author":{"id":"Team LoginRadius","github":"LoginRadius","avatar":null}}}},{"node":{"fields":{"slug":"/growth/10-smart-tips-to-make-you-more-resilient-at-office/"},"html":"<p>WHO has pointed out “stress” as the “<a href=\"http://scitechconnect.elsevier.com/stress-health-epidemic-21st-century/\">global health epidemic of 21st century</a>” and it is estimated that it will cost <a href=\"http://www.businessnewsdaily.com/2267-workplace-stress-health-epidemic-perventable-employee-assistance-programs.html\">nearly $300 billion every year</a> to American businesses. OMG! That’s a hell lot of money invested (wasted if we can solve it the other way). Studies clear how important it is to fight stress and make things fantastically work even during tough times. Now, with most of us working at highly demanding, always-on, and constantly connected work cultures, how is it possible to stay resilient and sail against all the odds? Well, it is possible and keep in mind that being resilient is only mantra to succeed in your lives. Remember Thomas Edison who failed 1000 times to invent a bulb, too resilient was he! So, <strong><em>why can’t we</em></strong> and <strong><em>why don’t we</em></strong> stop being so delicate? Bounce back fellas and let others see you shine at your workplace with these 10 effective attitude-reforming pills.</p>\n<blockquote>\n<p><em>Resilience is not endurance, it is how you bounce back from your situations</em></p>\n</blockquote>\n<h3 id=\"imagine-a-boxing-match\" style=\"position:relative;\"><a href=\"#imagine-a-boxing-match\" aria-label=\"imagine a boxing match permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Imagine A Boxing Match</strong></h3>\n<p>Think that you step into a ring and get hit by another boxer. Now, when it’s time-out, you will examine your damage, and think about the measures you should take. You can also take advice from friends and family as if they are your coach. At last, you bounce back with a plan. That’s what resilience is all about. You always bounce back with all your might you can gather.</p>\n<h3 id=\"practice-alertness\" style=\"position:relative;\"><a href=\"#practice-alertness\" aria-label=\"practice alertness permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Practice Alertness</strong></h3>\n<p>You have to meter your alertness and turn towards ways to improve it. Many companies are on the path to introduce mental training sessions that are related to alertness in their professional preliminaries. Julie Corlis, the executive editor of Harvard Heart Letter shows that practicing mindfulness meditation practices can <a href=\"http://www.health.harvard.edu/blog/mindfulness-meditation-may-ease-anxiety-mental-stress-201401086967\">lower stress rates in employees and enhance resilience and commitment to work</a>. The good news is that many online programmes like B<a href=\"https://www.bemindfulonline.com/\">e Mindful Online</a> and Mind The Moment are available to serve the purpose. There are some good books and apps you can refer like:-</p>\n<p><strong>Books</strong>- <a href=\"https://www.amazon.com/Mindfulness-Eight-Week-Finding-Peace-Frantic-ebook/dp/B005NJ2T1G\">Mindfulness: An Eight-Week Plan for Finding Peace in a Frantic World</a>, <a href=\"http://www.amazon.in/Anti-Stress-Dot---Dot-Beautiful-Colouring/dp/0752265865/ref=sr_1_4?tag=geniuslink0e-21&#x26;ie=UTF8&#x26;qid=1450456674&#x26;sr=8-4&#x26;keywords=books+mindfulness\">Anti-Stress Dot-to-Dot: Beautiful, calming pictures to complete yourself</a></p>\n<p><strong>Some Apps</strong>- Mental Workout (<a href=\"https://itunes.apple.com/us/app/lumosity-daily-brain-games/id577232024?mt=8\">iOS</a> &#x26; <a href=\"https://play.google.com/store/apps/details?id=com.lumoslabs.lumosity\">Android</a>), Simple Habit (<a href=\"https://play.google.com/store/apps/details?id=com.simplehabit.simplehabitapp&#x26;hl=en\">iOS</a> &#x26; <a href=\"https://play.google.com/store/apps/details?id=com.simplehabit.simplehabitapp&#x26;hl=en\">Android</a>), Headspace (<a href=\"https://itunes.apple.com/us/app/headspace-guided-meditation-and-mindfulness/id493145008?mt=8\">iOS</a> &#x26; <a href=\"https://play.google.com/store/apps/details?id=com.getsomeheadspace.android&#x26;hl=en\">Android</a>)</p>\n<h3 id=\"have-a-positive-mental-attitude-pma\" style=\"position:relative;\"><a href=\"#have-a-positive-mental-attitude-pma\" aria-label=\"have a positive mental attitude pma permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Have a Positive Mental Attitude (PMA)</strong></h3>\n<p>Have an optimistic outlook to life to keep you going even when you are down and out. Optimism is not ignoring your problems. Instead, it is thinking that the issues which you are going to face are temporary and you will tackle them with your skills. Believe in yourself and have faith in your instincts when things go wrong. Moreover, realize that the negative things do not last for a long time. This will help you bring back your positivity.</p>\n<h3 id=\"compartmentalize-your-mental-load\" style=\"position:relative;\"><a href=\"#compartmentalize-your-mental-load\" aria-label=\"compartmentalize your mental load permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Compartmentalize your Mental Load</strong></h3>\n<p>Out of 11 million bits of data coming into our brain every second, our conscious mind can only deal with <a href=\"https://www.forbes.com/sites/nickmorgan/2013/03/07/how-to-master-yourself-your-unconscious-and-the-people-around-you-3/#4d40e2fc6762\">40 bits per second</a>. Thus, handle your mind like you handle your mailbox. Treat your brain like a mailbox and compartmentalize your mental load. You should categorize your mental tasks like meetings, problem-solving sessions, and emailing. Try to not to switch randomly between jobs and enjoy one job at a time. It will decrease your mental strain.</p>\n<h3 id=\"embrace-your-stress\" style=\"position:relative;\"><a href=\"#embrace-your-stress\" aria-label=\"embrace your stress permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Embrace your Stress</strong></h3>\n<p>Yes, embrace your stress. Understand that you can smile or you can cry but you cannot escape from stress. So, relax for sometime and then work upon your stress.</p>\n<h3 id=\"improve-your-mental-agility\" style=\"position:relative;\"><a href=\"#improve-your-mental-agility\" aria-label=\"improve your mental agility permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Improve Your Mental Agility</strong></h3>\n<p>Improving mental agility means improving your quickness to understand the situation. You have to decenter stress to manage the problem effectively. Thus, when you tackle a problem, you will take a pause, observe the situation from a neutral point of view and then come up with a solution.</p>\n<h3 id=\"develop-compassion\" style=\"position:relative;\"><a href=\"#develop-compassion\" aria-label=\"develop compassion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Develop Compassion</strong></h3>\n<p>It is very necessary to develop compassion for yourself and for others if you want develop resilience. Greater Good Science Center located at UC Berkeley has researched that <a href=\"http://greatergood.berkeley.edu/article/item/compassion_across_cubicles\">being compassionate improves</a> work relationships and enhances collaboration and cooperation at workplace. Developing compassion also decreases stress and increases happiness. It is difficult for an organization, a team or an individual to succeed without compassion.</p>\n<h3 id=\"applaud-yourself-for-doing-well\" style=\"position:relative;\"><a href=\"#applaud-yourself-for-doing-well\" aria-label=\"applaud yourself for doing well permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Applaud yourself for Doing Well</strong></h3>\n<p>It is a habit which can be practiced everywhere, especially at workplace. Work hard on your bloopers but party harder when you have succeeded. Hence, keep in mind to pat your back for at least a thing you did well at the end of the day. And even if nothing goes right, pat your back for your sincere efforts and learn from your mistakes. It will keep you away from the negative aura.</p>\n<h3 id=\"be-flexible\" style=\"position:relative;\"><a href=\"#be-flexible\" aria-label=\"be flexible permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Be Flexible</strong></h3>\n<p>It is common to experience change in work environments. Projects you are a part of can get altered or may be even dropped however accepting that things do change and if possible embracing those changes can make you more resilient.</p>\n<h3 id=\"stay-healthy-always\" style=\"position:relative;\"><a href=\"#stay-healthy-always\" aria-label=\"stay healthy always permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Stay Healthy Always</strong></h3>\n<p>Now, last but certainly not the least, always stay healthy. Physical fitness is as important as mental fitness. It is easier to handle challenges when you are healthy. Therefore, eat healthy, exercise regularly, avoid drinking and smoking, and get good amount of sleep.</p>\n<p>Being resilient will help you cope with stress in the best way possible. Moreover, companies too are benefited from resilient workforces. Hence, cultivating an organizational work culture which backs compassion and promotes resilience training is a wise business step. However, resilience evolves from your daily habits and attitude and needs determined focus which is applied consistently.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"April 07, 2017","updated_date":null,"title":"10 Smart Tips to Make You More Resilient At Office","tags":["Engineering"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7699115044247788,"src":"/static/f6f9c15e3f70a70626b86aa2882d7a10/0edbf/10-Smart-Tips-to-Make-You-More-Resilient-At-Office.png","srcSet":"/static/f6f9c15e3f70a70626b86aa2882d7a10/69585/10-Smart-Tips-to-Make-You-More-Resilient-At-Office.png 200w,\n/static/f6f9c15e3f70a70626b86aa2882d7a10/497c6/10-Smart-Tips-to-Make-You-More-Resilient-At-Office.png 400w,\n/static/f6f9c15e3f70a70626b86aa2882d7a10/0edbf/10-Smart-Tips-to-Make-You-More-Resilient-At-Office.png 560w","sizes":"(max-width: 560px) 100vw, 560px"}}},"author":{"id":"Rakesh Soni","github":"oyesoni","avatar":"rakesh-soni.jpg"}}}},{"node":{"fields":{"slug":"/engineering/angular-roster-tutorial/"},"html":"<p>If you're not familiar with Angular I'd highly recommend heading over to the <a href=\"https://angularjs.org/\">Angular JS</a> resource site and checking out what all the fuss is about. Once you've got a basic understanding of Angular and how to get it up and running this tutorial will show you some of the basic, but awesome features supported by Angular.</p>\n<p>Today I'm going to be building out a roster for my fantasy football team. If that's not your cup of tea then by all means feel free to substitute the content for whatever floats your boat.</p>\n<h2 id=\"players-array\" style=\"position:relative;\"><a href=\"#players-array\" aria-label=\"players array permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Players Array</h2>\n<p>There might not be an I in team, but there are certainly players, so before we do anything in the HTML we'll have to make all the necessary components in the controller. First up let's make an array of all the players we want to include (initially at least) on our team.</p>\n<p>Every player is a special little snowflake, and our player objects should reflect that! With this in mind we will make each player an object with his or her own properties like: name, position and team. Here's an example of what our array might look like.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">$scope</span><span class=\"mtk1\">.</span><span class=\"mtk12\">players</span><span class=\"mtk1\"> = [</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    {</span><span class=\"mtk12\">name:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Tom Brady&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">position:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;QB&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">team:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Patriots&quot;</span><span class=\"mtk1\">},</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    {</span><span class=\"mtk12\">name:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Tony Romo&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">position:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;QB&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">team:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Cowboys&quot;</span><span class=\"mtk1\">},</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    {</span><span class=\"mtk12\">name:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Peyton Manning&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">position:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;QB&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">team:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Broncos&quot;</span><span class=\"mtk1\">},</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    {</span><span class=\"mtk12\">name:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Rob Gronkowsi&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">position:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;TE&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">team:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Patriots&quot;</span><span class=\"mtk1\">},</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    {</span><span class=\"mtk12\">name:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;JJ Watt&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">position:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;DE&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">team:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Texans&quot;</span><span class=\"mtk1\">},</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    {</span><span class=\"mtk12\">name:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Lavonte David&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">position:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;LB&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">team:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Buccaneers&quot;</span><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">];</span></span></code></pre>\n<h2 id=\"repetitive-department-of-repetition\" style=\"position:relative;\"><a href=\"#repetitive-department-of-repetition\" aria-label=\"repetitive department of repetition permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Repetitive department of repetition</h2>\n<p>Now that we have our roster we can go back to the HTML and make use of Angular's ng-repeat directive. We put the ng-repeat on the element we want to be repeated, keeping in mind that all of its children will also get repeated.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!--</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    {{</span><span class=\"mtk12\">player</span><span class=\"mtk1\">.</span><span class=\"mtk12\">name</span><span class=\"mtk1\">}} - {{</span><span class=\"mtk12\">player</span><span class=\"mtk1\">.</span><span class=\"mtk12\">position</span><span class=\"mtk1\">}}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">--&gt;</span></span></code></pre>\n<p>Okay so if you're new to Angular there's a couple of things going on here. First like I said we've got the ng-repeat placed on the li (the thing we want repeated) which will create a new li for each player in the players array we defined earlier in the controller. Next up the data binding is being implemented here with each player name as well as position being used as the values for the list item.</p>\n<p>While we're on the topic of data binding, let's throw this in just for fun. Pretty simple, it will calculate the length of your roster and keep it updated as any changes are made.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!--</span><span class=\"mtk12\">You</span><span class=\"mtk1\"> </span><span class=\"mtk12\">have</span><span class=\"mtk1\"> {{</span><span class=\"mtk12\">players</span><span class=\"mtk1\">.</span><span class=\"mtk12\">length</span><span class=\"mtk1\">}} </span><span class=\"mtk12\">on</span><span class=\"mtk1\"> </span><span class=\"mtk12\">your</span><span class=\"mtk1\"> </span><span class=\"mtk12\">roster</span><span class=\"mtk1\">.--&gt;</span></span></code></pre>\n<h2 id=\"easiest-search-functionality-of-your-life\" style=\"position:relative;\"><a href=\"#easiest-search-functionality-of-your-life\" aria-label=\"easiest search functionality of your life permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Easiest Search Functionality of Your Life</h2>\n<p>Next let's add some search functionality to our list. Sounds like a lot of work, probably have to iterate over the array elements, match them to the argument being passed in and... just kidding. With Angular it's a breeze.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!--</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">...</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">{{</span><span class=\"mtk12\">player</span><span class=\"mtk1\">.</span><span class=\"mtk12\">name</span><span class=\"mtk1\">}} - {{</span><span class=\"mtk12\">player</span><span class=\"mtk1\">.</span><span class=\"mtk12\">position</span><span class=\"mtk1\">}}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">--&gt;</span></span></code></pre>\n<p>Donezo.</p>\n<h2 id=\"the-shape-of-italy\" style=\"position:relative;\"><a href=\"#the-shape-of-italy\" aria-label=\"the shape of italy permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>The shape of Italy</h2>\n<p>Let's imagine one of our fantasy players isn't performing too well (ahem Peyton...) and we want to give him the boot (get it now?).</p>\n<p>We'll add a little delete button beside each of our players' names, and since we're doing it for each of them guess how we're going to implement it? That's right with ng-repeat we already have on the list items!</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!--{{</span><span class=\"mtk12\">player</span><span class=\"mtk1\">.</span><span class=\"mtk12\">name</span><span class=\"mtk1\">}} - {{</span><span class=\"mtk12\">player</span><span class=\"mtk1\">.</span><span class=\"mtk12\">position</span><span class=\"mtk1\">}}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    ×</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">--&gt;</span></span></code></pre>\n<p>I'll also tack on a little button with an \"x\" as the content (as a side note, when you want to do this use × instead of \"x\" it looks much nicer). Then we'll attach an ng-click with a delete function where we pass in $index.</p>\n<p>$index is a neat little feature available with certain Angular directives, and ng-repeat is one of them. It will be assigned the index value (starting at 0) of the position it holds within the array being used with the ng-repeat.</p>\n<p>That's all we need in the HTML, so now back in the controller we create a $scope function by the same name used in the HTML and give it a parameter of index. The body of the function is a single line which makes use of the array.splice method where we pass in the index of the item we want to delete, and then 1 to denote that it's only 1 item we want removed.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">$scope</span><span class=\"mtk1\">.</span><span class=\"mtk11\">delete</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">function</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">index</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">$scope</span><span class=\"mtk1\">.</span><span class=\"mtk12\">players</span><span class=\"mtk1\">.</span><span class=\"mtk11\">splice</span><span class=\"mtk1\">(</span><span class=\"mtk12\">index</span><span class=\"mtk1\">, </span><span class=\"mtk7\">1</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">};</span></span></code></pre>\n<h2 id=\"acquisitions\" style=\"position:relative;\"><a href=\"#acquisitions\" aria-label=\"acquisitions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Acquisitions</h2>\n<p>Now since we just cut someone from the team, we've gotta find their replacement. Let's chuck a few text inputs in there, give them all a respective ng-model to bind with their value and finally another button with an ng-click but this time calling an addPlayer function.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;!--</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    Name:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    Position:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    Team:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">Add</span><span class=\"mtk1\"> </span><span class=\"mtk12\">Player</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">--&gt;</span></span></code></pre>\n<p>This one's a lil' different from delete, but still super simple. Working from the inside out, we will create a new player object which gets the name, position and team properties from the ng-models on the HTML and then push that object to the players array. After that we clear those values just for some good housekeeping practice.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">$scope</span><span class=\"mtk1\">.</span><span class=\"mtk11\">add</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">function</span><span class=\"mtk1\"> () {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">$scope</span><span class=\"mtk1\">.</span><span class=\"mtk12\">players</span><span class=\"mtk1\">.</span><span class=\"mtk11\">push</span><span class=\"mtk1\">({</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">name:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">$scope</span><span class=\"mtk1\">.</span><span class=\"mtk12\">new_name</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">position:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">$scope</span><span class=\"mtk1\">.</span><span class=\"mtk12\">new_position</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">        </span><span class=\"mtk12\">team:</span><span class=\"mtk1\"> </span><span class=\"mtk12\">$scope</span><span class=\"mtk1\">.</span><span class=\"mtk12\">new_team</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    });</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">$scope</span><span class=\"mtk1\">.</span><span class=\"mtk12\">new_name</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">$scope</span><span class=\"mtk1\">.</span><span class=\"mtk12\">new_position</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">$scope</span><span class=\"mtk1\">.</span><span class=\"mtk12\">new_team</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">};</span></span></code></pre>\n<h2 id=\"nothing-lasts-forever\" style=\"position:relative;\"><a href=\"#nothing-lasts-forever\" aria-label=\"nothing lasts forever permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Nothing Lasts Forever</h2>\n<p>Now since this was all done purely on the front end, and didn't make use of cookies, localstorage, or sessionstorage none of this will persist (aka be saved). For that kind of support you'd need some sort of back end, which is beyond the scope of this article.</p>\n<p>This was a very rudimentary example of what's possible with Angular JS, so if this interested you at all please dig a little deeper and play around with Angular some more!</p>\n<p>That brings us to the end of this tutorial. Feel free to check out the finished (yet unstyled) product <a href=\"https://codepen.io/anon/pen/pgoJwq\">here on Codepen</a></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n</style>","frontmatter":{"date":"January 12, 2016","updated_date":null,"title":"Angular Roster Tutorial","tags":["Engineering","AngularJS","PlayersArray","Array","Search"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/2773860898be140904449814ad319431/ee604/roster-angularjs-1.png","srcSet":"/static/2773860898be140904449814ad319431/69585/roster-angularjs-1.png 200w,\n/static/2773860898be140904449814ad319431/497c6/roster-angularjs-1.png 400w,\n/static/2773860898be140904449814ad319431/ee604/roster-angularjs-1.png 800w,\n/static/2773860898be140904449814ad319431/40ffe/roster-angularjs-1.png 960w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Zakary Hughes","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/part-2-creating-a-custom-login-form/"},"html":"<p>In this tutorial I will demonstrate how to build a custom login form scratch. This time instead of using the default function call Wordpress provides us, we will create this login form and the styling from scratch, making it a very customized form. I will be providing the CSS I am using, however you may style this however you wish.</p>\n<h2 id=\"building-a-custom-login-form\" style=\"position:relative;\"><a href=\"#building-a-custom-login-form\" aria-label=\"building a custom login form permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Building a Custom Login Form</h2>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 574px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 79.79094076655052%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAQCAIAAACZeshMAAAACXBIWXMAAAsTAAALEwEAmpwYAAACqUlEQVQoz3WT+0/TUBTH9zf5s3+C/uoP/qI/GcXEGEw0RoOGRQQEnYowg6hBTciiJC5KFCW8ApOBymMPxrpH6R5tt/be3tt7uz7Weruhos6Tkyb3tJ/z7TnnnoD2f6MYGTrWoAahfwRAU1XInmYDER2xYKAjBlvkyHzq4uuNiqz6GVo8w3SMou/LsXXJoOgAZu9YygMFCJngDi+dm4qffL4SXtjVFISwVqmCuYVqLC6duZC60pMBbWXG6DpqOpgSBABkUaRp+2J9eDYZ/LQ1OcstLolM80bf3u1hrncge38sf/5SWiipAUYSggq8Gp0pc3mFUl3TECHYMommo69JKZdV1zakdEYJDnCR6f3vW7IkweBgVigDH8YYhUbzE5PF/ntcOoM9z6vVGwBagmBcu8nt5Ug6ow89KOSLdHScn1uo9PZnI9NCw0ABhFi1sG+YW1oVRx7nhx7mKizxQLbvbuFlpNLVvatqlut5K3EgVI13H+UXU/x2osZIVm9bWSuV1a7u1OmzydAYz/ztjLyZ0B6N8+Gn++vfgOc1Lcumpu00bdfVKUUQ+K0NtAYIHVv/si6GJ4Rnr0rT0dLok2LwTm5+WWm67nYSQWSzWj7M1Y+f2Pw8XzUMDH7B7W4XimpwkIu8KVPWQETlmsGAxWXlyNG1WJyJe7xAwhN+w9hQ2kP9fUlY8bbFALfZ9J2Z7TgAmrG4iglTdqlqEt20bUz+hSGEhFLTtAmhhDYIMRzHcVmvPC+xh0/1pI5dT9wK5QdDuWxO+ft6MphS6rmu5ZttmRbTZ6SqWpd7s1ejfGhLxKa5siruJGt+zzrAh6wtqwIrkcbtiOPYloU6/PahLD+Xo7VPbBMoxXVFU/w48hcLHnz5B4wQqss1sSrWanVZkplLoiSLsqKAjsv3AxaRT4JDSnKaAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"wp-login-boring\"\n        title=\"wp-login-boring\"\n        src=\"/static/e6f31dc6cf2ee195c1d37e9a67322d0c/86389/wp-login-boring.png\"\n        srcset=\"/static/e6f31dc6cf2ee195c1d37e9a67322d0c/86389/wp-login-boring.png 574w\"\n        sizes=\"(max-width: 574px) 100vw, 574px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>This is what WordPress gives us out of the box.. Boring, right?</p>\n<p>I am going to show this part once again because it is probably the easiest to implement for beginners. I covered this in Part 1, but we'll go through it again just in case you're skipping ahead</p>\n<p>To start our page theme you will need to do the following</p>\n<p>1. Install WordPress\n2. Navigate to your wp-content/themes folder and choose a theme to edit or install a new one\n3. create a file called page-login-custom.php in the theme directory (Notice we are now making a new Page Theme)\n4. Next open that file with a text editor of your choosing and add the following at the top of the php file</p>\n<p>--></p>\n<p>To initialize this page template make sure to activate the theme you've selected and then navigate to a page or post. On the right hand side of your page/post editor you should now see a dropdown available for template. Change your template to Login Custom and that will attach that page theme to this page/post.</p>\n<p>Now for the custom code. Below I have provided an example of some code that I have customized to make my custom login form.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">form</span><span class=\"mtk1\"> </span><span class=\"mtk12\">method</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;post&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">action</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;wp-user-form&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">input</span><span class=\"mtk1\"> </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;text&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;log&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">size</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;20&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">id</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;user_login&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">tabindex</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;11&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">:</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">Remember me</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">input</span><span class=\"mtk1\"> </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;submit&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;user-submit&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">tabindex</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;14&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">class</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;user-submit&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">input</span><span class=\"mtk1\"> </span><span class=\"mtk12\">type</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;hidden&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">name</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;redirect_to&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span></code></pre>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 743px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 30.153846153846153%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAIAAABM9SnKAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAUklEQVQY053PSw6AMAhAQe5/Vpu0hM9CW6xF3WBjdLbkBQC7tMGCNgd9rKoi4mUNbO6IETGX4vEaPJ5zxn2WByLaao23vWxOaWFmf8++gB/NbQe5NGSblvZQtAAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"login-2-custom\"\n        title=\"login-2-custom\"\n        src=\"/static/4fa351920dfdb37fdbc4cac1f740f52e/f2793/login-2-custom.png\"\n        srcset=\"/static/4fa351920dfdb37fdbc4cac1f740f52e/a6d36/login-2-custom.png 650w,\n/static/4fa351920dfdb37fdbc4cac1f740f52e/f2793/login-2-custom.png 743w\"\n        sizes=\"(max-width: 743px) 100vw, 743px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Let's take a look at that custom form</p>\n<h2 id=\"handling-the-login-form-response\" style=\"position:relative;\"><a href=\"#handling-the-login-form-response\" aria-label=\"handling the login form response permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Handling the Login Form response</h2>\n<p>To handle the Login Form response use the exact same method we used in part 1. Remember to place that function within your functions.php file within your theme unless you're building a plugin.</p>\n<p>In this example we have built a custom WordPress login form that you could customize and style to your desire. In the next section I will be demonstrating how to build a lost password form that is fully customized. Our custom lost password form will send an email to the user as well as handle creating a new password for the user.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk17 { color: #808080; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n</style>","frontmatter":{"date":"December 08, 2015","updated_date":null,"title":"Part 2 - Creating a Custom Login Form","tags":["Engineering","Login"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/3e9f0e12bae5ff4eea3aa1dae7083c47/6d161/cust-login-2-150x150.png","srcSet":"/static/3e9f0e12bae5ff4eea3aa1dae7083c47/6d161/cust-login-2-150x150.png 150w","sizes":"(max-width: 150px) 100vw, 150px"}}},"author":{"id":"Zoie Carnegie","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/optimize-jquery-sizzle-element-selector/"},"html":"<p>Almost every active website worldwide uses jQuery, you can check stats <a href=\"http://trends.builtwith.com/javascript/jQuery\">here</a> , but using it without optimization might make the DOM very slow. The same goes for other javascript libraries, such as SizzleJS. To ensure the performance of your DOM, you have to follow some best practices for it.</p>\n<p>In this article I am going to list down some of the most critical factors that you need to watch out. Even though this not a complete list; taking care of these will help you optimize those jQuery Selector.</p>\n<h3 id=\"lets-start\" style=\"position:relative;\"><a href=\"#lets-start\" aria-label=\"lets start permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Let's start!</strong></h3>\n<h4 id=\"always-cache-your-selector\" style=\"position:relative;\"><a href=\"#always-cache-your-selector\" aria-label=\"always cache your selector permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Always cache your selector</h4>\n<p>Whenever you apply any selector in jQuery or <a href=\"http://sizzlejs.com/\">SizzleJS</a>,  the selector engine goes through the whole DOM to find the specified element.</p>\n<p>For example, if you use the code below, it will go through the whole DOM twice in order to find \".myClass\" selector.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk11\">$</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.myClass&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">show</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">$</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.myClass&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">addClass</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;anotherClass&quot;</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>But instead of that, if you make all the methods in a chained format like this. It will only try to find that class once.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk11\">$</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.myClass&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">show</span><span class=\"mtk1\">().</span><span class=\"mtk11\">addClass</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;anotherClass&quot;</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>Or if you want to use this element in other places; you can do so by doing it in this way.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">myElem</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">$</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.myClass&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">myElem</span><span class=\"mtk1\">.</span><span class=\"mtk11\">show</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">myElem</span><span class=\"mtk1\">.</span><span class=\"mtk11\">addClass</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;anotherCLass&quot;</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>In both of these cases, the selector will be executed only once. Some selectors are very slow to traverse and passing them again and again will make your DOM very slow.</p>\n<p>Read on the next point to understand,  how the type of selector affects performance.</p>\n<h4 id=\"prioritizing-selectors-based-on-their-performance\" style=\"position:relative;\"><a href=\"#prioritizing-selectors-based-on-their-performance\" aria-label=\"prioritizing selectors based on their performance permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Prioritizing selectors based on their performance</h4>\n<p>Selector's type affects the performance of your site. SizzleJS is a smart selector engine that also uses native js APIs for finding specific element. This is the main reason why ID selector and tag selector perform faster than others. But, if you prefer using jQuery, it’s pretty much the same. Modern browsers also have an API to find an element by class name but, let’s just focus on jQuery and SizzleJS.</p>\n<ul>\n<li>The order of selector's performance (fast -> slow) is</li>\n<li>ID selector ($(\"#ID\")) = Fastest</li>\n<li>Tag ($(\"Tag\")) = Fast</li>\n<li>Class ($(\".Class\")) = Average</li>\n<li>Attribute ($(\"[Attribute='Value']\")) = Slow</li>\n<li>Pseudo ($(\":pseudo\")) = Slower</li>\n</ul>\n<p>You can verify performance. In some exceptional cases, the selection of those tags does not matter; It’s all in the combination of the selectors. Because, it affects the performance of your site, let's discuss this on next point.</p>\n<h4 id=\"selecting-id-selector-first-and-then-other-ones\" style=\"position:relative;\"><a href=\"#selecting-id-selector-first-and-then-other-ones\" aria-label=\"selecting id selector first and then other ones permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Selecting ID selector first and then other ones</h4>\n<p>If you have the combination of selectors, then the sequence of selectors matter for optimization. For example:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk11\">$</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;#someId div .someClass&quot;</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>The same code can be written as:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk11\">$</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;#someId&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">find</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;div .someClass&quot;</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>Both of these variant represent the same thing but in the term of performance, second one is better. The reason for that is because in the first code, Sizzle will go through the DOM 3 times to find #someId, div, and .someClass.</p>\n<p>In the second one, the selector engine will go through the DOM again but, this time, it’ll only look for #someId and then find the rest inside that element without going through the DOM again.</p>\n<p>See how this will affect performance.</p>\n<h4 id=\"being-more-specific-in-right-hand-side-instead-of-left-hand-side\" style=\"position:relative;\"><a href=\"#being-more-specific-in-right-hand-side-instead-of-left-hand-side\" aria-label=\"being more specific in right hand side instead of left hand side permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Being more specific in right hand side instead of left hand side</h4>\n<p>Sizzle executes selector from right to left so it will definitely  improve performance if applied in right except left.</p>\n<p><strong>Unoptimized code:</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk11\">$</span><span class=\"mtk1\">( </span><span class=\"mtk8\">&quot;div.myclass .myChildClass&quot;</span><span class=\"mtk1\"> );</span></span></code></pre>\n<p><strong>Optimized code:</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk11\">$</span><span class=\"mtk1\">( </span><span class=\"mtk8\">&quot;.myclass td.myChildClass&quot;</span><span class=\"mtk1\"> );</span></span></code></pre>\n<p>If you don’t see the difference, find the div and td.</p>\n<h4 id=\"selection-inside-a-parent-always-improves-performance\" style=\"position:relative;\"><a href=\"#selection-inside-a-parent-always-improves-performance\" aria-label=\"selection inside a parent always improves performance permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Selection inside a parent always improves performance</h4>\n<p>When you have a context, or any level of parent, then you can select an element inside that parent. It will perform better this way than selecting it directly. Because, in this case, the selector engine goes through the DOM once to find the parent.</p>\n<p>For example, assuming you are trying to find “.child” class:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk11\">$</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.child&quot;</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>Is slower than</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"8\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">parent</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">$</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;#parent&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk12\">parent</span><span class=\"mtk1\">.</span><span class=\"mtk11\">find</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.child&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">show</span><span class=\"mtk1\">();</span></span></code></pre>\n<p>You can also specify context by following syntax</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"9\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk11\">$</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.child&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk12\">parent</span><span class=\"mtk1\">).</span><span class=\"mtk11\">show</span><span class=\"mtk1\">();</span></span></code></pre>\n<h4 id=\"excessive-selector-slows-down-your-query\" style=\"position:relative;\"><a href=\"#excessive-selector-slows-down-your-query\" aria-label=\"excessive selector slows down your query permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Excessive selector slows down your query</h4>\n<p>The selector engine always checks every selector you have specified and it might traverse slowly. That being said, always make sure to specify minimum selectors in order to maintain the performance.</p>\n<p>For example, you are  trying to find “.myClass” using both of these code variants,</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"10\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk11\">$</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;#div div span.myClass&quot;</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>Is slower than</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"11\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk11\">$</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;#div&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">find</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.myClass&quot;</span><span class=\"mtk1\">);</span></span></code></pre>\n<h4 id=\"\" style=\"position:relative;\"><a href=\"#\" aria-label=\" permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a></h4>\n<p><strong>The .children() tag is quicker than .find()</strong></p>\n<p>In case, you are trying to find a children element, it is recommended to use .children() instead of .find(). Using .find() will tell jQuery to look on every level of children, while .children() will find only the first level children. Therefore .children() is faster than .find().</p>\n<p>For example, you are trying to find “.child” inside $parent and it is the first level children of the $parent.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"12\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">parent</span><span class=\"mtk1\">.</span><span class=\"mtk11\">find</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.child&quot;</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>Is slower than</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"13\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">parent</span><span class=\"mtk1\">.</span><span class=\"mtk11\">children</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.child&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">show</span><span class=\"mtk1\">();</span></span></code></pre>\n<h4 id=\"-1\" style=\"position:relative;\"><a href=\"#-1\" aria-label=\" 1 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a></h4>\n<p>Use minimum DOM append</p>\n<p>DOM manipulation is very heavy so always try to ignore or minimize using it.</p>\n<p>For example, by using the code below, it will make the process sluggish because you didn’t apply any selector caching. Resulting in going through  the DOM ten times and appending an element.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"14\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">for</span><span class=\"mtk1\">( </span><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">i</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">0</span><span class=\"mtk1\">; </span><span class=\"mtk12\">i</span><span class=\"mtk1\"> &lt; </span><span class=\"mtk7\">10</span><span class=\"mtk1\">; </span><span class=\"mtk12\">i</span><span class=\"mtk1\">++) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk11\">$</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.myClass&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">append</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>But instead of using the above code, using the code below will solve the whole issue of appending and traversal. Not only that, it will merge the 10 times manipulation of DOM into a single call.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"15\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">myClassInnerHtml</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">for</span><span class=\"mtk1\">( </span><span class=\"mtk4\">var</span><span class=\"mtk1\"> </span><span class=\"mtk12\">i</span><span class=\"mtk1\"> = </span><span class=\"mtk7\">0</span><span class=\"mtk1\">; </span><span class=\"mtk12\">i</span><span class=\"mtk1\"> &lt; </span><span class=\"mtk7\">10</span><span class=\"mtk1\">; </span><span class=\"mtk12\">i</span><span class=\"mtk1\">++ ){</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk12\">myClassInnerHtml</span><span class=\"mtk1\"> += </span><span class=\"mtk8\">&quot;&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">$</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;.myClass&quot;</span><span class=\"mtk1\">).</span><span class=\"mtk11\">append</span><span class=\"mtk1\">(</span><span class=\"mtk12\">myClassInnerHtml</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>All the tips I have mentioned above is highly dependant on your requirement but one thing is for sure; Optimization will definitely improve your process.  ‘SizzleJS’ is most the powerful and quick element selector. But, without writing optimized code you can’t prevent the DOM from freezing. With that being said,  jQuery is awesome but without optimized code it can get more DOM freezes and frustrate your users.</p>\n<p>I hope this help you optimize your element selecting. Thank you and have a great coding.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n</style>","frontmatter":{"date":"November 05, 2015","updated_date":null,"title":"Optimize jQuery & Sizzle Element Selector","tags":["Engineering","JQuery"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/792265a42f42bb24e4108f2d9f5488be/6d161/jquery-sizzle-element-selector-150x150.png","srcSet":"/static/792265a42f42bb24e4108f2d9f5488be/6d161/jquery-sizzle-element-selector-150x150.png 150w","sizes":"(max-width: 150px) 100vw, 150px"}}},"author":{"id":"Kundan Singh","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/alternate-authentication-asp/"},"html":"<p><strong>Introduction</strong></p>\n<p>Authentication and authorization both are most important things for any system and application. This blog starts with authentication and authorization concepts and after that explains the three default important ways and three custom authentication ways for doing authentication and authorization i.e. windows, forms ,passport, multipass, JWT  and SAML authentication. Plus, in this blog I will explain some fundamental concepts about the different authentication system.</p>\n<p><strong>Authentication and Authorization</strong></p>\n<p>Authentication is the process for checking the identity of a user based on the user’s credentials. Generally, user’s credentials are  in the form of user ID and password, and we check their credentials from database or equivalent alternative, if it exists then user is a valid candidate for next process - authorization.</p>\n<p>Authorization also known as “Permission Control” will come after authentication. Authorization is the process of deciding what kind of resource a user can access based on their identity and checking whether the authenticated user has sufficient rights to access the requested resources. Typically a resource can be an ASP.NET web page, media files (MP4, GIF, JPEG etc), compressed file (ZIP, RAR) etc.</p>\n<p><strong>ASP.NET default authentication Providers</strong></p>\n<p><strong>1. Form Authentication</strong></p>\n<p>Normally, form authentication is based on cookies, the authentication and permission settings are stored in cookies. However, we can also use form authentication without cookies, and in cookie-less form authentication we can use query string for passing user details. Remember, the key concept is always ONLY allow the user with correct credential also enough permission to view certain resources, so we need to capture their information and compare with what we have stored in the database. And no matter what kind of form authentication we use, after we receive the data on server end, we will compare them with the data stored in any storage method/provider. For example, we can store username and password in the web.config file, a JSON file, or a database table.</p>\n<p>Forms authentication flow:</p>\n<ol>\n<li>When a user requests a page for the application, ASP.NET checks session cookie. If the cookie exists and valid, ASP.NET assumes the user is authenticated and processes the request.</li>\n<li>If session cookies does not exists or not valid then it redirect to login form.</li>\n<li>User will enter username and password and if they are valid then he will get authenticated and authorized.</li>\n</ol>\n<p> <strong>2. Passport Authentication</strong></p>\n<p>Passport authentication is a centralized authentication service provided by Microsoft. The .NET Passport single sign-in service. When we use passport authentication then user authentication in your application is managed by Microsoft's passport service. Passport authentication uses encrypted cookies to manage the authentication.</p>\n<p><strong>How Password authentication works</strong> Users do not need to retype their sign-in name and password when moving from site to site. Those .NET Passport–enabled sites will issue a set of encrypted cookies in the .NET Passport central servers' domain to facilitate silent and seamless sign-in across sites. In some cases, sites owners will first redirect their end-users to .NET Passport sign-in and to authenticate upon first viewing of their site. If the users are logged in already, they'll get authenticated by ASP.NET, and if they are not logged in they will get redirected to passport servers (i.e hotmail, Live etc.)  to login first. If user successfully authenticates himself, it will return a token to your website.</p>\n<p><strong>3. Windows Authentication</strong></p>\n<p>We use windows authentication when we are creating a web application for a limited number of users who already have Windows account and this type of authentication is quite useful in an intranet environment. This authentication method uses local users windows account 'credentials' for to validate the user. Dot Net web application generally hosted on IIS(Internet Information Server) so the requests go directly to IIS to provide the authentication process in a Windows-based authentication model.</p>\n<p>The entire responsibility of authentication is done by IIS. It first takes the user’s credentials from the domain login. If this process fails, IIS displays an alert dialog box so the user can enter or re-enter his login information.</p>\n<p>Windows authentication have some advantages and disadvantages:</p>\n<p><strong>Windows authentication Advantage</strong></p>\n<ol>\n<li>Developers need to write less line of code for managing user's authentication.</li>\n<li>Users can use their existing windows accounts for login.</li>\n</ol>\n<p><strong>Windows authentication dis-Advantage</strong></p>\n<ol>\n<li>You can't control windows authentication process.</li>\n<li>Windows authentication only works on Microsoft OS you can't use it on others OS.</li>\n</ol>\n<p> <strong>4. Custom authentication Provider</strong></p>\n<ol>\n<li><strong>Multipass</strong></li>\n</ol>\n<p>Multipass authentication is a single sign on authentication. Suppose you have multiple sites and you want to create a single account for a user on both sites then you can use Single Sign-On. Single Sign-On is authentication system it allow user to share his authentication details with your there site. This allows a seamless experience for your users without forcing them to create a separate account on your second site. A multipass is simply a hash of keys and values, provided as an AES encrypted JSON hash.</p>\n<ol start=\"2\">\n<li><strong>JWT (JSON Web token)</strong></li>\n</ol>\n<p>JWTs represent a set of claims as a JSON object that is encoded in a JWS and/or JWE structure. This JSON object is called “JWT Claims Set”. The JSON object consists of zero or more name/value pairs (or members), where the names are strings and the values are arbitrary JSON values. These members are the claims represented by the JWT.</p>\n<p>Your JWTs can contain any information you want; the user's name, birthdate, email, etc. You do this with claims based authorization. You then just tell your provider to make a JWT with these claims from the claims principle.</p>\n<ol start=\"3\">\n<li><strong>SAML (Security Assertion Markup Language)</strong></li>\n</ol>\n<p>SAML - Security Assertion Markup Language SAML. SAML is developed by the Security Services Technical Committee of \"Organization for the Advancement of Structured Information Standards\" (OASIS). SAML is an XML-based framework for exchanging user authentication. The purpose of SAML is to enable Single Sign-On for web applications across various domains.</p>\n<p>SAML have three components: assertions, protocol, and binding. Assertions are authentication, attribute, and authorization. Authentication assertion validates the user's identity. Attribute assertion contains specific information about the user. And authorization assertion identifies user role and permissions.</p>\n<p>SAML works with multiple protocols including Hypertext Transfer Protocol (HTTP), Simple Mail Transfer Protocol (SMTP), File Transfer Protocol (FTP) and also supports SOAP</p>\n<p><strong>Summary</strong></p>\n<p>Different authentication methods are available, and website’s owner always gets confused about which authentication method they should use, here I have explained some of the popular authentication and authorization methods, hope it made it a little bit clear for you. And I will provide some in-depth details about each type of authentication in my next blog, <strong>happy coding</strong>.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"October 01, 2015","updated_date":null,"title":"Types of Authentication in Asp.Net","tags":["Engineering","Authentication","Asp.Net","Multipass","JWT","JSON Web Token"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/09593e63090dd5b6ec6f5258209a953b/6d161/alternate-authentication-asp-dot-net1-150x150.png","srcSet":"/static/09593e63090dd5b6ec6f5258209a953b/6d161/alternate-authentication-asp-dot-net1-150x150.png 150w","sizes":"(max-width: 150px) 100vw, 150px"}}},"author":{"id":"Team LoginRadius","github":"LoginRadius","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/my-name-is-darryl-this-is-how-work/"},"html":"<p>Ever wondered how I work? No? Well, too bad, I'm still gonna write about it. Hello and welcome to a blog post dedicated to me. In this episode, I'm going to tell you about the tools I use, the things I do to get design inspiration, and what I do when I get stuck on a project.</p>\n<p>Let's get started!</p>\n<h2 id=\"tools-i-use\" style=\"position:relative;\"><a href=\"#tools-i-use\" aria-label=\"tools i use permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Tools I use</h2>\n<h4 id=\"coffee\" style=\"position:relative;\"><a href=\"#coffee\" aria-label=\"coffee permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Coffee</h4>\n<p>Let's face it, you all know this is the number 1 priority for pretty much everyone you know. Getting my fuel up and over driving my brain... And hope to god I don't break down in the middle of the day.</p>\n<h4 id=\"sublime-text-3\" style=\"position:relative;\"><a href=\"#sublime-text-3\" aria-label=\"sublime text 3 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Sublime Text 3</h4>\n<p>The Photoshop to my coding skills. Sure, there are other text editors out there but this one really knows what it's doing. I have come to the point where I've installed so many Sublime Packages that I cannot function without them.</p>\n<p>Some of those packages are:</p>\n<ol>\n<li><strong>Emmet</strong> Boy, oh boy, Let me tell you about Emmet. But, it would take a long time to explain what it is, so just go to their <a href=\"http://emmet.io/\">site</a>. It's basically premade snippets for pretty much everything you need.</li>\n<li><strong>SidebarEnhancement</strong>Sublime's sidebar is a little bit underdeveloped. Then again, that's what packages are for, right? This nifty little package ehances your sidebar with more options to choose from like: '<em>Reveal...</em>' (which opens the file folder).</li>\n<li><strong>ColorHighlighter</strong>If you're the kind of person who remembers the hex code for colors, you are one talented individual. Ya see, it's hard to visualize colors using hex code. ColorHighlighter puts a background on those colors for you to easily visualize what kind of color #00427c is (regal blue, btw).</li>\n<li><strong>SFTP</strong>This one is a cool package. It lets you edit, sync, and save on-upload files from any of your sftp or ftp servers. But only if you configure it properly. If you use any preprocessors and you're worried that you have to upload the processed file manually. Worry no more as you can make sftp monitor that file if it has changed and automatically upload it. Pretty neat, huh?</li>\n</ol>\n<p><em>And since we're talking about sublime and packages, <a href=\"/beginners-guide-for-sublime-text/\">check out this nifty blog about sublime text and their packages.</a></em></p>\n<h4 id=\"codekit\" style=\"position:relative;\"><a href=\"#codekit\" aria-label=\"codekit permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Codekit</h4>\n<p>If you don't know what is codekit, you should. It compiles everything from SASS to HAML to Coffeescript. It also auto refresh your browser on every save. It... it just works. Bower is also built-in so you have access to over 6,000 components. Best part? No command line usage. Just drop your project files and go.</p>\n<h2 id=\"what-i-do-to-get-inspired\" style=\"position:relative;\"><a href=\"#what-i-do-to-get-inspired\" aria-label=\"what i do to get inspired permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What I do to get inspired.</h2>\n<p>As a normal human being — and not an extraterrestrial or alien as you tiny humans may call it. I tend to get stuck in a design black hole. It is where every ideas you have is just 1 big blank canvas — or as some artists call it \"modern art\". So what do I do when I don't have any ideas? It's simple really. The first website I go to is <a href=\"http://dribbble.com\">dribbble.com</a>. Dribble used to be an invite-only social network for designers. I think they probably opened their doors to everyone. I'm not really sure. But, I am sure that most of the designers there are still the best of the best. What I really like about it is when some designers show how their designs interact with users. With the help of GIF or <a href=\"https://codepen.io/\">codepen</a>. Speaking of codepen, That's the place I go to if I am in need of some CSS trickery. At some point, I do get inspiration from that place too. If dribbble can't help my —oh so in the dark— brain, I go to Pinterest. Pinterest have their own design category with a bunch of different sub categories from Graphic Design to UI/UX. The best thing about it? It links back to another site with more design inspiration. YAY for Pinterest.</p>\n<h3 id=\"getting-out-of-a-sticky-situation\" style=\"position:relative;\"><a href=\"#getting-out-of-a-sticky-situation\" aria-label=\"getting out of a sticky situation permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Getting out of a sticky situation</h3>\n<p>Now that my brain is full of design food. How do I put it to work? There's this thing called a notebook. If you don't know what that is. It looks like this. <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 261px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 73.9463601532567%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAQFAv/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAFubVWho2V//8QAGxAAAgIDAQAAAAAAAAAAAAAAAgMBEQAEExT/2gAIAQEAAQUCfscs9bLS0jAly2R1IErrP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8BP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8BP//EAB0QAAICAQUAAAAAAAAAAAAAAAARAQISIUFhgZH/2gAIAQEABj8CWHY2O1fCc9K7QcCP/8QAHBABAAIDAAMAAAAAAAAAAAAAAQARITFRQWGB/9oACAEBAAE/IbVEvWo4b5rEG5seIRXT2xIrfEoQFBon/9oADAMBAAIAAwAAABC4z//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8QP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8QP//EAB4QAQACAQQDAAAAAAAAAAAAAAERIQAxQVGhYXHw/9oACAEBAAE/EFn00pfqNesfEnBHTAQDYFUnN4MVEaF+VG2P2lpMr4njAZgQBQZ//9k='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"notebook\"\n        title=\"notebook\"\n        src=\"/static/dabb81722b8957c787f016d75fc760ff/677e6/notebook.jpg\"\n        srcset=\"/static/dabb81722b8957c787f016d75fc760ff/677e6/notebook.jpg 261w\"\n        sizes=\"(max-width: 261px) 100vw, 261px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span> This is where I start sketching or wireframing all the things I need before moving on to the digital format. And there you have it. A sneak peek on how I work. I hope that this gave you an idea on how to improve your everyday design life. A word of advice. <em>There are a thousand ways to do 1 thing. If someone told you it can't be done; prove them wrong.</em></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"September 22, 2015","updated_date":null,"title":"Hi, My Name is Darryl, and This is How I Work","tags":["Tools","Engineering"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/c79f21489b740148a259277d35e3bbd5/630fb/darryl-how-i-work-300x300.png","srcSet":"/static/c79f21489b740148a259277d35e3bbd5/69585/darryl-how-i-work-300x300.png 200w,\n/static/c79f21489b740148a259277d35e3bbd5/630fb/darryl-how-i-work-300x300.png 300w","sizes":"(max-width: 300px) 100vw, 300px"}}},"author":{"id":"Team LoginRadius","github":"LoginRadius","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/ab-use-css2-sibling-selectors/"},"html":"<p>Hey there, spider. It’s me again, your amazing blog writer, Darryl. Have you ever wanted to select the second or third child of an element without using CSS3 nth-child —which aren’t working on grandpa browsers. Let’s face it, a lot of human beings are afraid of change that they tend to stick to what they know.</p>\n<p>I’m not a pro “support the older browser” kind of guy because I still think that people won’t upgrade if we keep spoiling them. But for the sake of knowing a workaround I’m gonna teach you how to ab-use sibling selectors for better compatibility.</p>\n<h3 id=\"what-are-sibling-selectors\" style=\"position:relative;\"><a href=\"#what-are-sibling-selectors\" aria-label=\"what are sibling selectors permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What are sibling selectors.</h3>\n<p>Sibling selectors consists of a squiggly line ( ~ ) and a plus sign ( + ).</p>\n<p>Squiggly line selects all the siblings below that element where you use that sign. Plus sign select only the next sibling.</p>\n<h3 id=\"great-give-me-the-deets\" style=\"position:relative;\"><a href=\"#great-give-me-the-deets\" aria-label=\"great give me the deets permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Great, give me the deets.</h3>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 64.3076923076923%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAIAAAAmMtkJAAAACXBIWXMAAAsTAAALEwEAmpwYAAABNklEQVQoz5VSTU/DMAzNj+fInb/CmQMnrogDSKMd0qaNItYmaeLYCc/JVpD40HhKEzfx87MtmyHkbjv06z7nXH6CiDjvI9EcAhE5p/YYJXI2lCRE8rOXrBBZ1ifgnVLSL3GMlJgTC7MYeDWFSlQOQmy229WqWz136/VL1/evw1Adcssun2DaAUbio2aqUlHTCUhKbYiJ+rCIWgv5VFgeAxODWQ4w1LVYEkd4KdhtZM4FdY4RbIjrOpKJ67MGhatGge0ihyQwPIknfWxr6aVpLanFHJNZasJNOd2U+otYV3dvl7f7i5vd9eNkWpMW5D8B9ae3+LAP97uwmZJBR1yD99baydpyNgw6+n44gDZOEyLk/wBDkkJUzBW/zdl3KNnPM5QnyHqPHQN4JhntMdC01mEkvoY8Ex9I3Pu7f8F4aAAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"lr-home\"\n        title=\"lr-home\"\n        src=\"/static/dc8135cd3405bb1ca1bf6b09196fa2ab/e5715/lr-home.png\"\n        srcset=\"/static/dc8135cd3405bb1ca1bf6b09196fa2ab/a6d36/lr-home.png 650w,\n/static/dc8135cd3405bb1ca1bf6b09196fa2ab/e5715/lr-home.png 768w,\n/static/dc8135cd3405bb1ca1bf6b09196fa2ab/2ba99/lr-home.png 1221w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Have you ever seen our <a href=\"https://docs.loginradius.com/\">support docs</a>?  </p>\n<p>Would you believe me if I tell you that from “Getting Started” to the “Social Sharing” section, they are all siblings with the same class and everything… well except for the css code and the search, we’ll get to that later.</p>\n<p>Anyhoo, how did I do it? It’s easy, since I know that the sibling I want to get was the first child. I just used the :first child pseudo element to style the first element.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"css\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk6\">.sibling:first-child</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">/*styles for first sibling*/</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>Then again, that’s not a sibling selector, that’s a pseudo element. Calm your feets, this is the part where we ab-use those selectors.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"css\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk6\">.sibling:first-child</span><span class=\"mtk1\"> ~ </span><span class=\"mtk6\">.sibling</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">/*styles for the rest of the sibling*/</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>Why would we do this? This is so it doesn’t add the style for the rest of the sibling to the first-child and vice versa. Less CSS to overwrite and eliminates the use of !important.</p>\n<h3 id=\"lets-go-crazy\" style=\"position:relative;\"><a href=\"#lets-go-crazy\" aria-label=\"lets go crazy permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Let’s go crazy.</h3>\n<p>How do we get the third child without using :nth-child pseudo element? It’s simple. Get the first child and ab-use your plus sign(+) sibling selector.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"css\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">&lt;</span><span class=\"mtk6\">div:first-child</span><span class=\"mtk1\"> + </span><span class=\"mtk6\">div</span><span class=\"mtk1\"> + </span><span class=\"mtk6\">div</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">/*styles*/</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>The best part is. It’s backwards compatible.</p>\n<p>What about the 12th child? Well, you can just painfully type all those “+ div”.</p>\n<p>Now, why would we do this? To support IE8, which I don’t like supporting but, maybe you do.</p>\n<p>Keep experimenting with this technique and be free from any restrictions of IE8.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk6 { color: #D7BA7D; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n</style>","frontmatter":{"date":"August 18, 2015","updated_date":null,"title":"How to ab-USE CSS2 sibling selectors","tags":["Engineering","Selector","CSS"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/945890eb5408214619f2dbcdf3da2fcf/7d145/sibling-selectors.png","srcSet":"/static/945890eb5408214619f2dbcdf3da2fcf/69585/sibling-selectors.png 200w,\n/static/945890eb5408214619f2dbcdf3da2fcf/497c6/sibling-selectors.png 400w,\n/static/945890eb5408214619f2dbcdf3da2fcf/7d145/sibling-selectors.png 610w","sizes":"(max-width: 610px) 100vw, 610px"}}},"author":{"id":"Team LoginRadius","github":"LoginRadius","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/api-debugging-tools/"},"html":"<p><strong>Are you having trouble with accessing API endpoint?</strong>   <strong>Unsure why your API is not returning data?</strong> Most modern browsers have tools or plugins that allows you to quickly and easily test your API calls and see the sample returned data. In this post we go through some tools available for common browsers and web tools that will cut down the total troubleshooting time.</p>\n<h2 id=\"google-chrome\" style=\"position:relative;\"><a href=\"#google-chrome\" aria-label=\"google chrome permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Google Chrome</h2>\n<p>Chrome offers a wide variety of apps that are quick and easy to install through the <a href=\"https://chrome.google.com/webstore/\">Chrome app webstore</a>. <a href=\"http://www.getpostman.com/\">Postman</a> is one of those app and it offers a very robust REST API testing solution. It allows you to quickly create and format a wide range of API calls, and keeps a record of previously accessed APIs for easy reference and reuse. Postman have an easy to understand interface that allows you to quickly reformat the included parameters, headers, and form data. Returned data can be viewed in multiple different formats depending on your preferences.</p>\n<p>Another added benefit of Postman is its built-in support for common authentication procedures like: Basic Auth, Digest Auth, and OAuth 1.0/2.0. These \"helpers\" allow you to bypass some of the common tasks that can be troublesome in the mentioned protocols such as signing your request(OAuth 1.0) or requesting an Access token(OAuth 2.0).</p>\n<h2 id=\"mozilla-firefox\" style=\"position:relative;\"><a href=\"#mozilla-firefox\" aria-label=\"mozilla firefox permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Mozilla Firefox</h2>\n<p>Poster or RestClient are both useful tools that allow you to test out your API calls within Mozilla Firefox. They offer many similar systems as Postman, allowing you to set various parts of your API quickly and easily. With built in features to set such as Base URL, Auth method, Timeout, Action, Content, headers, and query parameters; It returns a complete response object allowing you to troubleshoot APIs before integrating them into your systems. Both RestClient and Poster allow you to save your requests for future use.</p>\n<h2 id=\"other-systems\" style=\"position:relative;\"><a href=\"#other-systems\" aria-label=\"other systems permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Other Systems</h2>\n<p><strong>Runscope:</strong> This is a powerful tool that allows you to set up test cases for your APIs. Which makes it easy for you to not only handle many of the features as described in the above two systems, but to also schedule these requests to perform periodically. This allows you to monitor your APIs and have email notifications sent out when specific conditions are met. You can also mask the API requests to run them from different locations worldwide allowing you to test user cases from a global audience.</p>\n<p><strong>SoapUI:</strong> This is an extremely robust solution that can handle your entire testing environment. It also have built in features to test out RESTful API calls, as well as SOAP calls. This solution is very extensive and has many options that cover the full suite of features detailed in the above technologies. On top of that, they have a well formatted instructions available on their site, detailing how to setup and configure the program.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"May 26, 2015","updated_date":null,"title":"API Debugging Tools","tags":["Engineering","GoogleChorme","MozilaFirefox","SoupUI","RunScope"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/949b6e4da71216d7a55b82e01a8bcaa1/630fb/api_debugging-tools-300x300.png","srcSet":"/static/949b6e4da71216d7a55b82e01a8bcaa1/69585/api_debugging-tools-300x300.png 200w,\n/static/949b6e4da71216d7a55b82e01a8bcaa1/630fb/api_debugging-tools-300x300.png 300w","sizes":"(max-width: 300px) 100vw, 300px"}}},"author":{"id":"Karl Wittig","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/getting-started-phonegap/"},"html":"<p>PhoneGap now also known as Apache Cordova, is a powerful tool for mobile development which allows you to develop in HTML/JS markup and quickly generate out various mobile compatible apps. This prevents your developers from having to learn and understand multiple platform specific languages and instead use the PhoneGap framework which is based in HTML to create the app and then generate it into any one of the following platforms:</p>\n<ol>\n<li>iOS</li>\n<li>Android</li>\n<li>Windows Phone</li>\n<li>Windows</li>\n<li>Firefox OS</li>\n<li>Amazon Fire OS</li>\n<li>Blackberry</li>\n</ol>\n<p>With time saved on learning development languages for the above platforms your team can focus on the features of your app.</p>\n<h2 id=\"setting-up-your-environment\" style=\"position:relative;\"><a href=\"#setting-up-your-environment\" aria-label=\"setting up your environment permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Setting up your Environment</strong></h2>\n<ol>\n<li>Download and install <a href=\"http://nodejs.org/download/\">node.js</a>, This will be used to install the Cordova/PhoneGap framework.</li>\n<li>Download and install a <a href=\"http://git-scm.com/downloads\">Git Client</a>, This is used by the Cordova/PhoneGap framework when creating projects.</li>\n<li>Open command prompt and verify that both of the above systems have been installed by running <em>npm</em> and <em>git.</em></li>\n<li>Install the Cordova/PhoneGap system by running the following command in your command prompt (Note: this may take a few minutes)</li>\n</ol>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">C:\\&gt;npm install -g cordova</span></code></pre>\n<p>Verify your installation of Cordova/PhoneGap by running <em>cordova</em> in command prompt. This should display a list of the available Cordova commands.</p>\n<h2 id=\"setting-up-your-project\" style=\"position:relative;\"><a href=\"#setting-up-your-project\" aria-label=\"setting up your project permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Setting up your Project</strong></h2>\n<ol>\n<li>Create a directory which will contain your PhoneGap/Cordova project code.</li>\n<li>Open the created directory in command line and create a project with the command <strong>cordova create &#x3C; sitename ></strong></li>\n</ol>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">C:\\&gt;rootdir\\cordova create FirstSite</span></code></pre>\n<ol start=\"3\">\n<li>\n<p>This will create a project in the root folder with the specified site-name. This project will contain:</p>\n<ol>\n<li>\"hooks\" directory- Contains special scripts that can be used to customize Cordova commands.</li>\n<li>\"platforms\" directory- This contains the app specific projects that you will include below.</li>\n<li>\"plugins\" directory- Contains add-on code for interfacing with native features. You can create your own custom interface or use one of pre-compiled plugins.</li>\n<li>\"www\" directory- Contains the PhoneGap/Cordova structure and some standard js and css files.</li>\n<li>config.xml file- This file contains meta data for controlling common features of your apps like the app title, description and author.</li>\n</ol>\n</li>\n<li>\n<p>Add platforms to the project with the <em>cordova platform add <platform></em> command. <strong>Note:</strong> adding platforms requires that the relevant dependencies are installed in your system for example adding android requires that you have installed the Android SDK. Available platforms for a windows environment are:</p>\n<ul>\n<li>wp7</li>\n<li>wp8</li>\n<li>windows8</li>\n<li>amazon-fireos</li>\n<li>android</li>\n<li>blackberry10</li>\n<li>firefoxos</li>\n</ul>\n<p>And for Mac:</p>\n<ul>\n<li>ios</li>\n<li>amazon-fireos</li>\n<li>android</li>\n<li>blacberry10</li>\n<li>firefoxos</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">C:\\&gt;rootdir\\cordova platform add android</span></code></pre>\n</li>\n<li>\n<p> You can now get a list of the added platforms by running the following command:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">C:\\&gt;rootdir\\cordova platform ls</span></code></pre>\n</li>\n<li>\n<p>You can remove a specific platform from the list with the following command:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">C:\\&gt;rootdir\\cordova platform remove android</span></code></pre>\n</li>\n<li>Once you have added in the desired platforms build the platform specific apps by running the following command: </li>\n</ol>\n<p><strong>Note:</strong> Building platforms requires that the relevant dependencies are installed in your system for example building android requires that you have installed the Android SDK</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">C:\\&gt;rootdir\\cordova build</span></code></pre>\n<ol start=\"8\">\n<li>You can use these built projects found in the \"platforms\" directory in platform specific IDEs or emulate the projects directly with the following command:</li>\n</ol>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">C:\\&gt;rootdir\\cordova emulate android</span></code></pre>\n<p>At this point you have a basic PhoneGap project configured and your desired platforms added and you can get started with adding or building out additional features and content in the \"www\" directory and run the command in step 7 above to create the platform specific projects. You can find detailed instructions on setting up additional features and implementing PhoneGap on the PhoneGap site.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n</style>","frontmatter":{"date":"March 31, 2015","updated_date":null,"title":"Getting Started with Phonegap","tags":["Engineering","PhoneGap","Mobile"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/d8c820456aa3a57aa0a36aab4d27f8fc/40725/dev-sprites2.png","srcSet":"/static/d8c820456aa3a57aa0a36aab4d27f8fc/69585/dev-sprites2.png 200w,\n/static/d8c820456aa3a57aa0a36aab4d27f8fc/497c6/dev-sprites2.png 400w,\n/static/d8c820456aa3a57aa0a36aab4d27f8fc/40725/dev-sprites2.png 580w","sizes":"(max-width: 580px) 100vw, 580px"}}},"author":{"id":"Team LoginRadius","github":"LoginRadius","avatar":null}}}},{"node":{"fields":{"slug":"/engineering/guid-query-mongo-shell/"},"html":"<p>If you have stored a GUID through the C# driver to mongoDB and now you want to run a query by GUID, you can't query directly because mongoDB doesn't recognize GUID so when we query through mongo shell no result will be returned. To use the power of mongo shell for querying data on mongo by GUID, you should follow these steps.</p>\n<p><strong>1. Convert GUID data to Base64</strong></p>\n<p>Convert you GUID data to base64 , you can use any online tool for this. </p>\n<p>So suppose your GUID is: 00112233-4455-6677-8899-aabbccddeeff</p>\n<p>Then the base 64 version will be: MyIRAFVEd2aImaq7zN3u/w==</p>\n<p><strong>2. Query by BinData object in mongo shell</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">db.Users.find({&quot;useUniqueId&quot;: new BinData(3,&quot;MyIRAFVEd2aImaq7zN3u/w==&quot;)}).limit(1)</span></code></pre>\n<p>Actually BinData constructor takes 2 parameters:</p>\n<p>New BinData(subtype,data)</p>\n<ul>\n<li>Subtype: represent subdata type like we pass 3 for UUID or GUID</li>\n<li>Data: base64 encoded string data</li>\n</ul>\n<p>mongoDB's C# driver stores data to mongo by converting it into binary data rather than string.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n</style>","frontmatter":{"date":"February 23, 2015","updated_date":null,"title":"GUID Query Through Mongo Shell","tags":["Engineering","GUID","Mongo"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/ea7595df20b2f7c29ed276dc27b05c9b/630fb/mongo-db-guid.png","srcSet":"/static/ea7595df20b2f7c29ed276dc27b05c9b/69585/mongo-db-guid.png 200w,\n/static/ea7595df20b2f7c29ed276dc27b05c9b/630fb/mongo-db-guid.png 300w","sizes":"(max-width: 300px) 100vw, 300px"}}},"author":{"id":"Kundan Singh","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/social-provider-social-sharing-troubleshooting-resources/"},"html":"<p>Social Sharing is an extremely powerful tool to expand your user base and product recognition, customizing and implementing this to be efficient on your site can be quiet difficult. Most of the most relevant Social Providers have setup testing and troubleshooting tools that can help to identify where you have gone astray. Below is a brief overview of some useful tools that have been setup to assist with implementing custom Social Sharing options.</p>\n<p><strong>Facebook Open Graph Object Debugger</strong></p>\n<p>Setting up custom sharing with Facebook uses Facebook Open Graph meta tags, which are cached on Facebooks end and can lead to some confusion when making updates to your customizations. In order to identify the cached details that are being used for your implementation Facebook provides the <a href=\"https://developers.facebook.com/tools/debug/\">Open Graph Debugger tool</a>. All you need to do is input your sites URL and click on Debug.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 33.23076923076923%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAHCAIAAACHqfpvAAAACXBIWXMAAAsTAAALEwEAmpwYAAABEUlEQVQY031OzUoDMRjMYwp6UevFalkQFaXIVj316mUREW89aGmFevIhfAAvxUtpu7v52fxsNsnGL7vFi+gwmY9MmMmH4rv38+Hb0WACenw9PR3Oejev3Xi8e3Lf7T91zh6i2+lhPNm/fDnoj/cunrd6yXaU7ETJ1eARzb8Wi2XOComJoFRgGpRQjgnPcQEKPgGT/VACGZMZ4UgIriQgiFJKSAm01vraA+s/4L2vqgotUyaVts4aYyAT1BjnXP0vIKx1hUazj8/5Cn6xAc66hg1M6NqUbnobbY0QpgFsnWas4AKWD5srISRcwChLXcLRupnhptoBhDDEMGVpTlcpyQnDpGh1nRF4gAqpSmj8Tcb5N7DNejePYCDlAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"karlblog1-1_001\"\n        title=\"karlblog1-1_001\"\n        src=\"/static/d11e7e649e1674275bddfee5448235a1/e5715/karlblog1-1_001.png\"\n        srcset=\"/static/d11e7e649e1674275bddfee5448235a1/a6d36/karlblog1-1_001.png 650w,\n/static/d11e7e649e1674275bddfee5448235a1/e5715/karlblog1-1_001.png 768w,\n/static/d11e7e649e1674275bddfee5448235a1/09e48/karlblog1-1_001.png 974w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>This will then crawl your page and display some useful information on the currently scraped details and warnings and error messages. It also give you the option at this point to refresh this scrapped data with any changes that you have made to our existing cached details.</p>\n<p><strong>Google Structured Data Testing Tool</strong></p>\n<p>Google uses a combination of a few different methods in order to define the customized sharing options:</p>\n<ul>\n<li>Structured Data Markup- HTML markup detailed on <a href=\"http://schema.org/\">Schema.org</a>.</li>\n<li>Open Graph Tags- Turn your page into a rich data object, commonly used to customize Facebook sharing details. Information on the markup is available on <a href=\"http://ogp.me/\">ogp.me</a></li>\n<li>Title or Meta Description- HTML attributes that provide details on the site.</li>\n<li>Googles best guess- If none of the above are included, Google will crawl your page and try to interpret the most suitable details to include in the share.</li>\n</ul>\n<p>The <a href=\"http://www.google.com/webmasters/tools/richsnippets\">structured data testing tool</a> allows you to view what Google has interpreted from your webpage. Start by entering the URL of the page that you are sharing and click on preview.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 34%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAHCAIAAACHqfpvAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAoUlEQVQY05WOQQ7CMAwE8/93cOUXnHgDSCCEKGqD1MTBjh0nJC0CbrQjH6y1V7vmernfb53zMI5u7RgCwIdl74RZ8xtVTQswEknxWYRLzkQUPAQIhFQW0JLBWt/36H2MXJ1VEBb9krQUcSOej7HvWGpFngua+Zw0z48izZZ/0eoteDoM243f7wK2uCq3ZAAabJj21RhJGSn9/ZsqpDK1+PAC4g+ZJ6XuOd4AAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"karlblog1-2\"\n        title=\"karlblog1-2\"\n        src=\"/static/dd1f70043ff6d04f5929ee89bc99618a/e5715/karlblog1-2.png\"\n        srcset=\"/static/dd1f70043ff6d04f5929ee89bc99618a/a6d36/karlblog1-2.png 650w,\n/static/dd1f70043ff6d04f5929ee89bc99618a/e5715/karlblog1-2.png 768w,\n/static/dd1f70043ff6d04f5929ee89bc99618a/cec12/karlblog1-2.png 1187w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>You will be able to view the scrapped data as well as a listing of the meta tags that have been included on the page.</p>\n<p><strong>LinkedIn Share Generator Tool</strong></p>\n<p>LinkedIn also uses Open Graph Tags to determine the content that will be shared with your sharing interface. You can view the relevant tags and details <a href=\"https://developer.linkedin.com/documents/setting-display-tags-shares\">here</a>.</p>\n<p>You can view the details that will be shared by generating out the sharing button on LinkedIn's <a href=\"https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/plugins/share-plugin\">build a share button tool</a>.</p>\n<p>Insert the URL in the \"URL to be shared field\" and click on Get Code. This will generate a sample share icon in the preview section.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 70.61538461538463%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAOCAIAAACgpqunAAAACXBIWXMAAAsTAAALEwEAmpwYAAABUUlEQVQoz5VS7W7CMAzs+7/RXoM/SIUNxqS2tE3aJP5okibM0D+og41Zp5Pl5OSLnUIrtdmW5ampq7rrlHVoAawDYecAAJFoBWJSo221KeTQAI4OtHEOaXS4sAEyDoE4XMMLfPDTLSQ1iB+NLghaMlu2BzLvOOxx2IHwuAddwrBzunR6Z+2XNQepM3zG2MRQx1D5qS2sHc/NsamPdX1kGoN3c0SlKnAqJ04zXSHJkifKmReEgIU879x2bdt3veq6vu+1uE/pkvPl94hxLugWiDIe673POSeRrkPK+Yc4Fswso1iObso/W96JrbN1VbHMn+nZvXmeHeDjztMkRBOTXEpJaL63K9waftucYsprsXSslCyVBwuyUG1BNvmqbfGrjOsMDMAU4kj+vvPKwlosfXzKPYXKkGCc4j8Gxq+ZfGKbOcQof3fyt+8b1giP8qvE+28+tDAIk2yrEQAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"karlblog1-3\"\n        title=\"karlblog1-3\"\n        src=\"/static/76bff32aa54cddfeea81c47168b6afb4/e5715/karlblog1-3.png\"\n        srcset=\"/static/76bff32aa54cddfeea81c47168b6afb4/a6d36/karlblog1-3.png 650w,\n/static/76bff32aa54cddfeea81c47168b6afb4/e5715/karlblog1-3.png 768w,\n/static/76bff32aa54cddfeea81c47168b6afb4/12bff/karlblog1-3.png 1032w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>To test the share functionality click on the generated icon to display the share interface as determined by the provided URL.</p>\n<p><strong>Twitter Button Generator Tool</strong></p>\n<p>Twitter also uses multiple systems to determine the content that will be tweeted by the tweet buttons. The most commonly used meta tags, which allow you to set any of the available customizable fields in your tweet.</p>\n<p>To test the tweet you can use Twitters <a href=\"https://about.twitter.com/resources/buttons\">button generator</a>. Select the \"Share a link\" option under \"Choose a button\".</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 36.15384615384615%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAHCAIAAACHqfpvAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA9klEQVQY05WNS0vFMBCF+///jgu116vowq0Lb6kVRQThNk3a0DwmzeTl9FYE0Y3DmTOHA19SleS5AS6njJDDktGV4CmUsCTvtvDluJToS8LoQU8De3+tbp7Hu47vDsfrTuxadn7o90+iboa6YWcPH5cN23Tx2F+1fN+JuuWE3L7I+7e5ki5NELlBYVGYMGh/EjLl+cm/G2FwhEQiZFNVSgmISk5GzWA0udVqAQtaUSAHa6h31pDKz1nhGKNzDgBCCOU/s8IpZzZO1mjtlp4NYK2y7siYlNJ7z+U88MFa+ze8fp7oBdqCIcQYKNBBxExtzhRiiL/hT/LYj6oTuH1qAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"karlblog1-4\"\n        title=\"karlblog1-4\"\n        src=\"/static/5b35f749339283559e53a994e2647b96/e5715/karlblog1-4.png\"\n        srcset=\"/static/5b35f749339283559e53a994e2647b96/a6d36/karlblog1-4.png 650w,\n/static/5b35f749339283559e53a994e2647b96/e5715/karlblog1-4.png 768w,\n/static/5b35f749339283559e53a994e2647b96/1ff84/karlblog1-4.png 1040w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Input your site URL in the \"share URL\" field, This will cause the Tweet button under \"Preview and code\" to be updated.</p>\n<p>Click on the generated button to see a sample of the Tweet that has be defined by your URL.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"February 09, 2015","updated_date":null,"title":"Social Provider Social Sharing Troubleshooting Resources","tags":["Engineering","SocialSharing","Facebook","Google","LinkedIn"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/ca57c9bd893c5ad9ae9e68ee6a62ddd8/ee604/social.png","srcSet":"/static/ca57c9bd893c5ad9ae9e68ee6a62ddd8/69585/social.png 200w,\n/static/ca57c9bd893c5ad9ae9e68ee6a62ddd8/497c6/social.png 400w,\n/static/ca57c9bd893c5ad9ae9e68ee6a62ddd8/ee604/social.png 800w,\n/static/ca57c9bd893c5ad9ae9e68ee6a62ddd8/f3583/social.png 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Karl Wittig","github":null,"avatar":null}}}},{"node":{"fields":{"slug":"/engineering/hello-developers-and-designers/"},"html":"<p>Welcome to our new initiative to contribute and spread the learnings/findings we had working with <a href=\"https://docs.loginradius.com/api\">LoginRadius API</a>!</p>\n<p>We always try to come up with new ideas/process during our development and research sessions..sometimes they are funny but awesome. <strong>:)</strong>. We'll share those ideas and experiences.look forward for your comments/feedback!</p>\n<p>--</p>\n<p>LoginRadius Engineering team</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"May 02, 2014","updated_date":null,"title":"Hello developers and designers!","tags":["Engineering"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/61bc9402fec623803bf04d21e948e84a/2a4de/desdev.png","srcSet":"/static/61bc9402fec623803bf04d21e948e84a/69585/desdev.png 200w,\n/static/61bc9402fec623803bf04d21e948e84a/497c6/desdev.png 400w,\n/static/61bc9402fec623803bf04d21e948e84a/2a4de/desdev.png 600w","sizes":"(max-width: 600px) 100vw, 600px"}}},"author":{"id":"Team LoginRadius","github":"LoginRadius","avatar":null}}}}]}},"pageContext":{"tag":"Engineering"}},"staticQueryHashes":["1171199041","1384082988","2100481360","23180105","528864852"]}