1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9423],{70358:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/author/[...slug]",function(){return r(72842)}])},30850:function(e,t,r){"use strict";r.d(t,{Z:function(){return ArticleCardPreview}});var a=r(24246);r(27378);var i=r(23615),l=r.n(i),s=r(98052),n=r.n(s),o=r(27693),c=r.n(o),m=r(42221),u=r(84866),g=r(72900);function ArticleCardPreview(e){let{article:t,lazyLoad:r}=e,i=(0,u.getFeaturedContributor)(t);i||(i={name:"Guest Contributor",slug:"guest",img_profile:"/assets/images/logo-sa-small.png"}),i.img_profile||(i.img_profile="/assets/images/logo-sa-small.png");let l=t.img_feature;if(!l){let e=t.tags.map(e=>e.slug);l=t.title.match(/javascript/i)||e.includes("javascript")?"/assets/images/logo-javascript.png":e.includes("node")?"/assets/images/logo-node.png":e.includes("python")?"/assets/images/logo-python.png":e.includes("java")?"/assets/images/logo-java.png":e.includes("bash")||e.includes("unix")?"/assets/images/logo-unix.png":"/assets/images/logo-sa.png"}let s=g.articleUrl(t.slug);return"byte"===t.type&&(s=g.byteUrl(t.slug)),(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex flex-col rounded-lg shadow-lg overflow-hidden",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)("a",{href:s,children:r?(0,a.jsx)(m.ZP,{height:"12rem",offset:100,once:!0,children:(0,a.jsx)("img",{className:"h-48 w-full object-cover",src:l,alt:""})}):(0,a.jsx)("img",{className:"h-48 w-full object-cover",src:l,alt:""})})}),(0,a.jsxs)("div",{className:"flex-1 bg-white p-6 flex flex-col justify-between",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-sm leading-5 font-medium text-primary",children:n()(t.type)}),(0,a.jsxs)("a",{className:"block hover:no-underline",href:s,children:[(0,a.jsx)("h3",{className:"mt-2 text-xl leading-7 font-semibold text-gray-900 hover:underline",children:t.title}),t.body_html&&(0,a.jsx)("p",{className:"mt-3 text-base leading-6 text-gray-500 break-words",children:(0,u.getExcerpt)(t.body_html,{words:50,append:"..."})})]})]}),(0,a.jsxs)("div",{className:"mt-6 flex items-center",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)("a",{href:g.authorUrl(i.slug),children:r?(0,a.jsx)(m.ZP,{height:"2.5rem",offset:100,once:!0,children:(0,a.jsx)("img",{className:"h-10 w-10 rounded-full",src:i.img_profile,alt:i.name})}):(0,a.jsx)("img",{className:"h-10 w-10 rounded-full",src:i.img_profile,alt:i.name})})}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)("p",{className:"text-sm leading-5 font-medium text-gray-900",children:(0,a.jsx)("a",{href:g.authorUrl(i.slug),className:"hover:underline",children:i.name})}),(0,a.jsxs)("div",{className:"flex text-sm leading-5 text-gray-500",children:[(0,a.jsx)("time",{dateTime:c()(t.published_at).format("YYYY-MM-DD"),children:c()(t.published_at).format("MMM DD, YYYY")}),t.read_time_min&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"mx-1",children:"\xb7"}),(0,a.jsxs)("span",{children:[t.read_time_min," min read"]})]})]})]})]})]})]})})}ArticleCardPreview.propTypes={article:l().object.isRequired,lazyLoad:l().bool}},42361:function(e,t,r){"use strict";r.d(t,{Z:function(){return IconArrowNarrowLeft}});var a=r(24246);r(27378);var i=r(23615),l=r.n(i);function IconArrowNarrowLeft(e){let{className:t}=e;return(0,a.jsx)("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M7.707 14.707a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l2.293 2.293a1 1 0 010 1.414z",clipRule:"evenodd"})})}IconArrowNarrowLeft.propTypes={className:l().string}},52738:function(e,t,r){"use strict";r.d(t,{Z:function(){return IconArrowNarrowRight}});var a=r(24246);r(27378);var i=r(23615),l=r.n(i);function IconArrowNarrowRight(e){let{className:t}=e;return(0,a.jsx)("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"})})}IconArrowNarrowRight.propTypes={className:l().string}},54451:function(e,t,r){"use strict";r.d(t,{Z:function(){return IconGlobe}}
1);var a=r(24246);r(27378);var i=r(23615),l=r.n(i);function IconGlobe(e){let{className:t}=e;return(0,a.jsx)("svg",{className:t,fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM4.332 8.027a6.012 6.012 0 011.912-2.706C6.512 5.73 6.974 6 7.5 6A1.5 1.5 0 019 7.5V8a2 2 0 004 0 2 2 0 011.523-1.943A5.977 5.977 0 0116 10c0 .34-.028.675-.083 1H15a2 2 0 00-2 2v2.197A5.973 5.973 0 0110 16v-2a2 2 0 00-2-2 2 2 0 01-2-2 2 2 0 00-1.668-1.973z",clipRule:"evenodd"})})}IconGlobe.propTypes={className:l().string}},41901:function(e,t,r){r(99729),r(73915);let a=r(27693),i=r(72900),l=r(84866),getAuthorSite=e=>{if(e)return e.website||i.twitter(e.twitter)||i.github(e.github)||i.facebook(e.facebook)||void 0},getOgType=e=>["article","content","guide"].includes(e)?"article":null,removeEmpties=e=>Object.keys(e).reduce(function(t,r){let a=e[r];return null!=a&&(t[r]=a),t},{});t.Bm=e=>{let t,r,s;let n="summary";(e.twitter_image||e.img_feature||e.img_banner)&&(n="summary_large_image");let o=e.tags||[],c=o.map(e=>e.name).join(", ");s="course"===e.type||"project"===e.type?i.courseUrl(e.slug,{absolute:!0}):"byte"===e.type?i.byteUrl(e.slug,{absolute:!0}):i.articleUrl(e.slug,{absolute:!0});let m=e.meta_description||l.getExcerpt(e.body_html||e.description_html,{characters:160,append:"..."});t={"og:site_name":"Stack Abuse","og:type":getOgType(e.type),"og:title":e.title,"og:description":e.og_description||m,"og:url":s,"og:image":i.imgUrl(e.og_image)||i.imgUrl(e.img_feature)||i.imgUrl(e.img_banner)||void 0},r={description:e.meta_description||m,"twitter:card":n,"twitter:title":e.twitter_title||e.title,"twitter:description":e.twitter_description||m,"twitter:url":s,"twitter:image":i.imgUrl(e.twitter_image)||i.imgUrl(e.img_feature)||i.imgUrl(e.img_banner)||void 0,"twitter:site":"@StackAbuse","twitter:creator":"@StackAbuse"};let u=l.getFeaturedContributor(e);return u&&(r["twitter:label1"]="Written by",r["twitter:data1"]=u.name),"article"===e.type&&(t["article:published_time"]=a(e.published_at).utc().format(),t["article:modified_time"]=a(e.updated_at).utc().format(),t["article:tag"]=o.map(e=>e.name),t["article:publisher"]="https://stackabuse.com",u&&(t["article:author"]=getAuthorSite(u)),r["twitter:label2"]="Filed under",r["twitter:data2"]=c),{properties:t=removeEmpties(t),names:r=removeEmpties(r)}},t.aw=e=>{let t;t="byte"===e.type?i.byteUrl(e.slug,{absolute:!0}):i.articleUrl(e.slug,{absolute:!0});let r=l.getExcerpt(e.body_html,{characters:160,append:"..."}),s={"@context":"https://schema.org","@type":"Article",publisher:{"@type":"Organization",name:"Stack Abuse",logo:{"@type":"ImageObject",url:"https://stackabuse.com/assets/images/favicon.svg"}},headline:e.title,url:t,image:{"@type":"ImageObject",url:i.imgUrl(e.img_feature)},description:e.meta_description||r,mainEntityOfPage:{"@type":"WebPage","@id":"https://stackabuse.com/"},dateCreated:a(e.created_at).utc().format(),datePublished:a(e.published_at).utc().format(),dateModified:a(e.updated_at).utc().format()},n=l.getFeaturedContributor(e);return n&&(s.author={"@type":"Person",name:n.name,url:i.authorUrl(n.slug,{absolute:!0}),sameAs:[n.website||null,n.facebook?i.facebook(n.facebook):null,n.twitter?i.twitter(n.twitter):null,n.github?i.github(n.github):null].filter(e=>e)},n.img_profile&&(s.author.image={"@type":"ImageObject",url:i.imgUrl(n.img_profile)})),s},t.Kv=e=>{let t=i.courseUrl(e.slug,{absolute:!0}),r=l.getExcerpt(e.description_html,{characters:160,append:"..."}),s=e.tags||[],n=(e.contents||[]).reduce((e,t)=>e+=t.read_time_min,0),o={"@context":"https://schema.org","@type":"Course",provider:{"@type":"Organization",name:"Stack Abuse",logo:{"@type":"ImageObject",url:"https://stackabuse.com/assets/images/favicon.svg"}},offers:{"@type":"Offer",category:e.price>0?"Paid":"Free",price:e.price/100,priceCurrency:"USD"},hasCourseInstance:{"@type":"CourseInstance",courseMode:"Online",courseWorkload:"PT"+Math.ceil(n/60)+"H"},name:e.title,headline:e.title,url:t,keywords:s.map(e=>e.name).join(", "),image:{"@type":"ImageObject",url:i.imgUrl(e.img_feature||e.img_banner)},description:e.meta_description||r,dateCreated:a(e.created_at).utc().format(),datePublished:a(e.published_at).utc().format(),dateModified:a(e.updated_at).utc().format()},c=l.getFeaturedContributor(e);return c&&(o.author={"@type":"Person",name:c.name,url:i.authorUrl(c.slug,{absolute:!0}),sameAs:[c.website||null,c.facebook?i.facebook(c.facebook):null,c.twitter?i.twitter(c.twitter):null,c.github?i.github(c.github):null].filter(e=>e)},c.img_profile&&(o.author.image={"@type":"ImageObject",url:i.imgUrl(c.img_profile)})),o},t.Fb=e=>({"@context":"https://schema.org","@type":"Series",publisher:{"@type":"Organization",name:"Stack Abuse",logo:{"@type":"ImageObject",url:"https://stackabuse.com/assets/images/favicon.svg"}},url:i.tagUrl(e.slug,{absolute:!0}),name:e.name,mainEntityOfPage:{"@type":"WebPage","@id":"https://stackabuse.com/"}}),t.YI=e=>
1({"@context":"https://schema.org","@type":"Person",sameAs:[e.website||null,e.facebook?i.facebook(e.facebook):null,e.twitter?i.twitter(e.twitter):null,e.github?i.github(e.github):null].filter(e=>e),name:e.name,url:i.authorUrl(e.slug,{absolute:!0}),mainEntityOfPage:{"@type":"WebPage","@id":"https://stackabuse.com/"},image:{"@type":"ImageObject",url:i.imgUrl(e.img_profile)}})},72842:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return v},default:function(){return Author}});var a=r(24246),i=r(88038),l=r.n(i),s=r(79894),n=r.n(s),o=r(23615),c=r.n(o),m=r(27693),u=r.n(m),g=r(80030),d=r(41901),h=r(30850),p=r(34925),f=r(75635),x=r(54451),b=r(24063),y=r(42361),j=r(52738),w=r(72900);Author.propTypes={author:c().object,page:c().number};var v=!0;function Author(e){let{author:t,page:r}=e,i=w.authorUrl(t.slug,{absolute:!0}),s=w.authorUrl("".concat(t.slug,"/page/").concat(r),{absolute:!0}),o=w.authorUrl("".concat(t.slug,"/page/").concat(r+1),{absolute:!0}),c=w.authorUrl("".concat(t.slug,"/page/").concat(r+1)),m=w.authorUrl("".concat(t.slug,"/page/").concat(r-1));t.img_profile||(t.img_profile="/assets/images/logo-sa-small.png");let v="".concat(t.name," - Stack Abuse");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(l(),{children:[(0,a.jsx)("title",{children:v}),r>1?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("link",{rel:"canonical",href:s}),(0,a.jsx)("meta",{property:"og:url",content:s}),(0,a.jsx)("meta",{name:"twitter:url",content:s})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("link",{rel:"canonical",href:i}),(0,a.jsx)("meta",{property:"og:url",content:i}),(0,a.jsx)("meta",{name:"twitter:url",content:i})]}),(0,a.jsx)("link",{rel:"next",href:o}),(0,a.jsx)("meta",{property:"og:site_name",content:"Stack Abuse"}),(0,a.jsx)("meta",{property:"og:type",content:"profile"}),(0,a.jsx)("meta",{property:"og:title",content:"".concat(t.name," - Stack Abuse")}),(0,a.jsx)("meta",{name:"twitter:card",content:"summary"}),(0,a.jsx)("meta",{name:"twitter:title",content:"".concat(t.name," - Stack Abuse")}),(0,a.jsx)("meta",{name:"twitter:site",content:"@StackAbuse"}),(0,a.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify((0,d.YI)(t),null,2)}})]}),(0,a.jsxs)(g.Z,{container:!0,children:[(0,a.jsxs)("div",{className:"grid grid-cols-12 sm:gap-x-2 lg:gap-x-3 pt-6",children:[(0,a.jsxs)("div",{className:"col-span-12 lg:col-span-3",children:[(0,a.jsx)("img",{className:"object-cover shadow-lg rounded-lg h-60 w-60",src:t.img_profile,alt:t.name}),(0,a.jsxs)("div",{className:"inline-flex py-4",children:[t.twitter&&(0,a.jsx)("a",{href:w.twitter(t.twitter),children:(0,a.jsx)(b.Z,{className:"h-6 w-6 ml-2 text-gray-500 hover:text-twitter"})}),t.facebook&&(0,a.jsx)("a",{href:w.facebook(t.facebook),children:(0,a.jsx)(p.Z,{className:"h-6 w-6 ml-2 text-gray-500 hover:text-facebook"})}),t.github&&(0,a.jsx)("a",{href:w.github(t.github),children:(0,a.jsx)(f.Z,{className:"h-6 w-6 ml-2 text-gray-500 hover:text-gray-900"})}),t.website&&(0,a.jsx)("a",{href:t.website,children:(0,a.jsx)(x.Z,{className:"h-6 w-6 ml-2 text-gray-500 hover:text-gray-900"})})]})]}),(0,a.jsxs)("div",{className:"col-span-12 lg:col-span-7",children:[(0,a.jsx)("h1",{className:"my-1 text-3xl tracking-tight leading-10 font-extrabold text-gray-900 sm:leading-none sm:text-6xl lg:text-4xl xl:text-5xl",children:t.name}),(0,a.jsxs)("div",{className:"",children:["Articles: ",t.content_count]}),(0,a.jsxs)("div",{className:"",children:["Joined: ",u()(t.created_at).format("MMM DD, YYYY")]}),(0,a.jsx)("div",{className:"my-4",dangerouslySetInnerHTML:{__html:t.bio_html}})]}),(0,a.jsx)("div",{className:"lg:col-span-1"})]}),(0,a.jsxs)("div",{className:"mt-8 border-t border-gray-200",children:[(0,a.jsx)("h2",{className:"my-6 text-xl tracking-tight leading-10 font-extrabold text-gray-700 sm:leading-none sm:text-4xl lg:text-2xl xl:text-3xl",children:"Recently published"}),(0,a.jsx)("div",{className:"grid gap-5 lg:grid-cols-3",children:t.contents.map((e,t)=>(0,a.jsx)("div",{children:(0,a.jsx)(h.Z,{article:e,lazyLoad:0!==t})},e.id))}),(0,a.jsxs)("div",{className:"mt-8 border-t border-gray-200 px-4 flex items-center justify-between sm:px-0",children:[r>1&&(0,a.jsx)("div",{className:"-mt-px w-0 flex-1 flex",children:(0,a.jsxs)(n(),{href:m,className:"border-t-2 border-transparent pt-4 pr-1 inline-flex items-center text-sm font-medium text-gray-500 hover:text-gray-700 hover:border-gray-300",children:[(0,a.jsx)(y.Z,{className:"mr-3 h-5 w-5 text-gray-400"}),"Previous"]})}),Math.ceil(t.content_count/9)>r&&(0,a.jsx)("div",{className:"-mt-px w-0 flex-1 flex justify-end",children:(0,a.jsxs)(n(),{href:c,className:"border-t-2 border-transparent pt-4 pl-1 inline-flex items-center text-sm font-medium text-gray-500 hover:text-gray-700 hover:border-gray-300",children:["Next",(0,a.jsx)(j.Z,{className:"ml-3 h-5 w-5 text-gray-400"})]})})]})]})]})]})}},84866:function(e,t,r){let a=r(99729),i=r(97329),l=r(1301);t.getExcerpt=(e,t)=>
1{if(!e)return"";t=t||{};let r=e.replace(/<a href="#fn.*?rel="footnote">.*?<\/a>/gi,"");return r=(r=(r=(r=(r=r.replace(/<div class="footnotes"><ol>.*?<\/ol><\/div>/,"")).replace(/<h[123456](.*)>(.*)<\/h[123456]>/,"")).replace(/(<\/p>|<br>)/gi," ")).replace(/<\/?[^>]+>/gi,"")).replace(/(\r\n|\n|\r)+/gm," "),t.words||t.characters||(t.words=50),i(r,t)},t.getHtmlExcerpt=(e,t)=>e?((t=t||{}).words||t.characters||(t.words=50),i(e,t)):"",t.getFeaturedContributor=e=>{if(!e)return null;let t=e.contributors||[],r=t.find(e=>"author"===e._pivot_role);return(r||(r=t.find(e=>"author"===e.role)),r)?r:t.find(e=>"editor"===e._pivot_role||"editor"===e.role)||a(t,"[0]",null)},t.getSecondaryContributors=e=>{if(!e)return null;let t=e.contributors||[],r=t.find(e=>"author"===e._pivot_role),i=t.find(e=>"editor"===e._pivot_role||"editor"===e.role);return r?t.filter(e=>e.slug!==a(r,"slug","")):i?t.filter(e=>e.slug!==a(i,"slug","")):t.slice(1,t.length)},t.getTableOfContents=e=>{let t=l.load(e.body_html),r=[];return t("h1, h2, h3, h4, h5").map((e,a)=>{let i=t(a);if(!i)return r;let l={level:Number(a.name.replace("h","")),text:i.text(),id:i.attr("id"),children:[]};if(0===r.length)return r.push(l),r;let s=r[r.length-1];s.level<l.level&&s.level+1===l.level?s.children.push(l):s.level>=l.level&&r.push(l)}),r},t.getContentMeta=e=>{let r={};r.toc=t.getTableOfContents(e);let a=l.load(e.body_html);return r.img_count=a("img:not(.alert img)").length,r.code_count=a("pre > code").length,r}},72900:function(e,t,r){let a=r(98784),i=r(24219),l=r(37131),s="stackabuse.com",n=!0,getFirstParam=e=>a.isArray(e)?a.get(e,"[0]",null):e,normalizeDomain=(e,t,{absolute:r=!1,prefix:a=null,suffix:s=null,isHttps:o=n}={})=>{if(!e){if(!t)throw Error("Must pass either a 'str' or a 'domain'");return o?`https://${t}`:`http://${t}`}if(s&&!e.endsWith(s)&&(e+=s),e.startsWith(`https://${t}`))return e;if(e.startsWith("//"))return o?`https:${e}`:`http:${e}`;e=e.replace(RegExp(`^${t}`,"i"),"");let c=l.parse(e);return(c.protocol=o?"https:":"http",c.host=t,!a||c.pathname.startsWith(a)&&c.pathname.startsWith(`/${a}`)||(c.pathname=i.join(a,c.pathname)),r)?l.format(c):c.pathname};t.stackabuse=(e,t)=>normalizeDomain(e,s,t),t.twitter=e=>normalizeDomain(e,"twitter.com",{absolute:!0}),t.facebook=e=>normalizeDomain(e,"facebook.com",{absolute:!0}),t.github=e=>normalizeDomain(e,"github.com",{absolute:!0}),t.imgUrl=(e,t)=>e&&e.startsWith("/")?normalizeDomain(e,null,t):e,t.articleUrl=(e,t={})=>normalizeDomain(e=getFirstParam(e),s,{prefix:"/",suffix:"/",...t}),t.byteUrl=(e,t={})=>normalizeDomain(e=getFirstParam(e),s,{prefix:"/bytes",suffix:"/",...t}),t.pageUrl=(e,t={})=>normalizeDomain(e=getFirstParam(e),s,{prefix:"/",suffix:"/",...t}),t.courseUrl=(e,t={})=>normalizeDomain(e=getFirstParam(e),s,{prefix:"/courses",suffix:"/",...t}),t.lessonUrl=(e,t={})=>{let r=getFirstParam(e);return normalizeDomain(e[1],s,{prefix:"/courses/"+r+"/lessons",suffix:"/",...t})},t.authorUrl=(e,t={})=>normalizeDomain(e=getFirstParam(e),s,{prefix:"/author",suffix:"/",...t}),t.tagUrl=(e,t={})=>normalizeDomain(e=getFirstParam(e),s,{prefix:"/tag",suffix:"/",...t}),t.paginateUrl=(e,t={})=>normalizeDomain(e=getFirstParam(e),s,{prefix:"/page",suffix:"/",...t}),t.bytePageUrl=(e,t={})=>normalizeDomain(e=getFirstParam(e),s,{prefix:"/bytes/page",suffix:"/",...t}),t.toolUrl=(e,t={})=>normalizeDomain(e=getFirstParam(e),s,{prefix:"/tools",suffix:"/",...t}),t.embedToolUrl=(e,t={})=>normalizeDomain(e=getFirstParam(e),s,{prefix:"/tools",suffix:"/embed/",...t})}},function(e){e.O(0,[8033,816,3401,7329,2221,9774,2888,179],function(){return e(e.s=70358)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.