<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Anas Khan]]></title><description><![CDATA[I’m versatile in learning & experiencing different fields. I have a keen interest in Web Development and Finance. I like designing & building products that posi]]></description><link>https://anaskhan28.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Mon, 16 Nov 2026 03:19:05 GMT</lastBuildDate><atom:link href="https://anaskhan28.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Building a Layoff Prediction Model: A Beginner's Guide to MindsDB]]></title><description><![CDATA[As someone who was completely new to the world of Machine Learning, stumbling upon the Hashnode MindsDB hackathon was a true game-changer. Initially, I was…]]></description><link>https://anaskhan28.hashnode.dev/building-a-layoff-prediction-model-a-beginners-guide-to-mindsdb</link><guid isPermaLink="true">https://anaskhan28.hashnode.dev/building-a-layoff-prediction-model-a-beginners-guide-to-mindsdb</guid><category><![CDATA[MindsDBHackathon]]></category><category><![CDATA[mindsdb]]></category><category><![CDATA[AI]]></category><dc:creator><![CDATA[Anas Khan]]></dc:creator><pubDate>Fri, 28 Apr 2023 10:36:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1682678116290/5e102393-d262-4267-a702-238b6d369eb6.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">Overview</h2>
<p>As someone who was completely new to the world of Machine Learning, stumbling upon the Hashnode MindsDB hackathon was a true game-changer. Initially, I was unsure if I could participate, let alone create a successful project that could stand out among so many others. But with some determination and a willingness to learn, I embarked on a journey that would take me from a novice to an up-and-coming Machine Learning enthusiast.</p>
<p>Through countless hours of research, trial, and error, and plenty of head-scratching, I am proud to present my Layoff Prediction Model - a tool that can predict the likelihood of layoffs in a company by analyzing its financial and core structure data. This project has been a labor of love and an opportunity for me to stretch my limits and push beyond my comfort zone. It has been both exhilarating and challenging to dive into a new field and to see the potential impact that Machine Learning can have on real-world issues.</p>
<h2 id="heading-prerequisite">Prerequisite</h2>
<ol>
<li><p>Knowledge of Machine Learning: Although you don't need to be an expert in machine learning to use MindsDB, it's important to have a basic understanding of machine learning concepts like data preprocessing, model selection, and evaluation.</p>
</li>
<li><p>Data: You'll need access to a dataset that you can use to train and test your machine-learning model. The dataset should be in a format that MindsDB supports, such as CSV, Excel, or SQL.</p>
</li>
<li><p>MindsDB Account: You'll need to sign up for a MindsDB account to use the MindsDB Cloud Editor and train machine learning models using MindsDB's AutoML capabilities.</p>
</li>
<li><p>Basic SQL Knowledge: You should have a basic understanding of SQL or be willing to learn it, as MindsDB's query language is similar to SQL.</p>
</li>
<li><p>Python Knowledge (Optional): If you want to use MindsDB's Python API or write custom code to work with your machine-learning models, you should have a basic understanding of Python.</p>
</li>
</ol>
<p>Overall, the prerequisites for working with MindsDB are fairly minimal. With a little bit of knowledge and the right dataset, you can get started with building machine-learning models quickly and easily.</p>
<h2 id="heading-process">Process</h2>
<p>One such dataset that caught my attention is the "Layoffs Data 2023" by TheAkhilB. This dataset contains information on layoffs from various companies in 2022. It includes details such as the company name, industry, number of layoffs, and the reason for the layoffs.</p>
<p>Using this dataset, we can explore the reasons for layoffs, which companies are more likely to lay off employees, and predict the likelihood of future layoffs in different industries. To accomplish this, we can use a machine learning model that can learn from the data and make predictions based on the patterns it finds.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1682677709010/3a9c3f1f-9b22-4736-a176-b1747e80fa14.png" alt class="image--center mx-auto" /></p>
<p>To start with, we need to import the dataset into a programming environment such as Python, R, or Jupyter Notebook. We can then perform some initial data exploration to get a better understanding of the data. For instance, we can use Python's Pandas library to load the data into a data frame and perform some basic data analysis such as calculating the total number of layoffs in each industry.</p>
<p>Once we have a good understanding of the data, we can then start building a predictive model using a machine learning library such as sci-kit-learn. We can split the data into training and testing sets, train the model on the training set, and then test its accuracy on the testing set.</p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"Company Name"</span>: <span class="hljs-string">"ABC Corp"</span>,
  <span class="hljs-attr">"Industry"</span>: <span class="hljs-string">"Finance"</span>,
  <span class="hljs-attr">"Reason"</span>: <span class="hljs-string">"Financial Loss"</span>
}
</code></pre>
<h2 id="heading-awesome-mindsdb">Awesome MindsDB</h2>
<p>To make this process even easier, we can use the MindsDB cloud editor, which provides an intuitive interface for building and deploying machine learning models. MindsDB also supports various data sources, including CSV files, which makes it easy to import the "Layoffs Data 2023" dataset.</p>
<p>To get started with MindsDB, we first need to create an account on the MindsDB website. Once we have an account, we can create a new project and import the dataset into the project. MindsDB will automatically detect the data types and provide a summary of the dataset, including the number of records and columns.</p>
<pre><code class="lang-sql"><span class="hljs-keyword">SELECT</span>
  Industry,
  <span class="hljs-keyword">SUM</span>(<span class="hljs-string">`Number of Layoffs`</span>) <span class="hljs-keyword">AS</span> <span class="hljs-string">`Total Layoffs`</span>
<span class="hljs-keyword">FROM</span>
  <span class="hljs-string">`Layoffs Data 2022`</span>
<span class="hljs-keyword">GROUP</span> <span class="hljs-keyword">BY</span>
  Industry
</code></pre>
<p>Next, we can create a predictive model by selecting the target variable (in this case, the number of layoffs) and the features (such as the industry, reason, and company name). MindsDB will automatically generate a machine-learning model based on the selected features and target variables.</p>
<p>We can then test the accuracy of the model by running it on the testing set and comparing the predicted values to the actual values. MindsDB provides various metrics to evaluate the accuracy of the model, such as the R-squared score and the mean absolute error.</p>
<pre><code class="lang-sql"><span class="hljs-keyword">SELECT</span> 
  CompanyName, 
  FinancialHealthIndex, 
  OperatingMargin, 
  DebtToEquityRatio, 
  IndustryType,
  __target__ <span class="hljs-keyword">as</span> LayoffPrediction
<span class="hljs-keyword">FROM</span> 
  layoffs_data_2022
PREDICT 
  LayoffPrediction
<span class="hljs-keyword">USING</span> 
  <span class="hljs-keyword">model</span> layoff_model;
</code></pre>
<p>Using the MindsDB cloud editor, we can also visualize the data and the model predictions, which can help us gain insights into the data and improve the model's accuracy. For instance, we can plot a scatter plot of the actual number of layoffs against the predicted number of layoffs, which can help us identify any patterns or outliers in the data.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Participating in this hackathon has been an inspiring and emotional journey for me. It has taught me that with the right attitude, even the most daunting tasks can be conquered.</p>
<p>I am happy about the partnership between <a target="_blank" href="https://hashnode.com/"><strong>Hashnode</strong></a> and <a target="_blank" href="https://mindsdb.com/"><strong>MindsDB</strong></a> that brought about this incredible hackathon. The event was a great opportunity to learn about machine learning tech and expand my skill set.</p>
]]></content:encoded></item><item><title><![CDATA[Behind the Scenes: A Day in the Life of an Intern]]></title><description><![CDATA["One often meets his destiny on the road he takes to avoid it." - Master Oogway]]></description><link>https://anaskhan28.hashnode.dev/behind-the-scenes-a-day-in-the-life-of-an-intern</link><guid isPermaLink="true">https://anaskhan28.hashnode.dev/behind-the-scenes-a-day-in-the-life-of-an-intern</guid><category><![CDATA[internships]]></category><category><![CDATA[Experience ]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[Full Stack Development]]></category><dc:creator><![CDATA[Anas Khan]]></dc:creator><pubDate>Thu, 06 Apr 2023 10:50:07 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1680777628993/38f6bd25-b6be-4f82-98c9-8eeacf4226d7.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-overview">Overview</h2>
<p>I joined as a frontend intern two months ago at Nexus Software Solution, which provides services like sass, marketing, and developing software. In this article, I'll be sharing my experience and what are the challenges I faced during the internship.</p>
<p><img src="https://i.gifer.com/LyCe.gif" alt="How i met your mother barney stinson GIF - Find on GIFER" class="image--center mx-auto" /></p>
<h2 id="heading-story">Story</h2>
<p>Working as an intern for two months on a project that aims to teach coding to children from ages 4 to 12 has been a wonderful and insightful experience. During my time working on the project, I learned so many things that I never thought I would learn before.</p>
<p>The project involved developing a software application that would make learning how to code easy and fun for children. We used a variety of technologies and tools such as React, Node.js, PostgreSQL, AWS, Webpack, and TypeScript, to make the software both user-friendly and powerful.</p>
<h2 id="heading-learnings">Learnings</h2>
<p>During my internship, I faced several challenges, including the pressure of learning new technologies quickly and the responsibility of contributing to a project with high stakes. As a front-end intern, I found it challenging to transition to full-stack development in just one month.</p>
<p><img src="https://i.pinimg.com/originals/6c/01/d3/6c01d3833bad3badf1cf79a45caf51b1.gif" alt="HIMYM How IMet Your Mother GIF - HIMYM HowIMetYourMother OhHoney - Discover  &amp; Share GIFs | How i met your mother, I meet you, Himym" class="image--center mx-auto" /></p>
<p>I also gained a lot of experience with React, a popular JavaScript library for building user interfaces. We used React to build the front end of the application, and I was impressed by how easy it was to use and how quickly we could develop features. Additionally, I learned about the importance of using TypeScript with React to help catch errors before they happen, and how to set up Webpack to optimize the application's performance.</p>
<p>Finally, working on this project gave me an appreciation for the challenges that come with designing software that is suitable for children. We had to ensure that the software was engaging and easy to use, while still providing valuable educational content. This required us to think carefully about the user experience and to test our designs thoroughly to ensure that they met our goals.</p>
<h2 id="heading-future">Future</h2>
<p>Through my internship experience, I have discovered my passion for software development and how it can make a positive impact on people's lives. This experience has allowed me to gain valuable skills, work with an amazing team, and contribute to a project that has the potential to make a real difference in the world.</p>
<p>I am grateful for this opportunity, and I am excited to continue pursuing my passion and doing great work. You can check out the application here <a target="_blank" href="https://dev.schoolcode.uk/">Schoolcode</a></p>
<p>"The only way to do great work is to love what you do." - Steve Jobs</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680778096079/84bdcc4d-5dae-4144-8d16-f712cd813a65.gif" alt class="image--center mx-auto" /></p>
]]></content:encoded></item><item><title><![CDATA[Qwik City: Supercharge Your Development]]></title><description><![CDATA[Boost Your Development Efficiency with Qwik City Meta-Framework]]></description><link>https://anaskhan28.hashnode.dev/qwik-city-supercharge-your-development</link><guid isPermaLink="true">https://anaskhan28.hashnode.dev/qwik-city-supercharge-your-development</guid><category><![CDATA[Qwik]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[React]]></category><category><![CDATA[framework]]></category><category><![CDATA[Frontend Development]]></category><dc:creator><![CDATA[Anas Khan]]></dc:creator><pubDate>Sun, 26 Feb 2023 12:55:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1677416014036/4b6b9a70-9482-4aa3-8a55-f0af7458855b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This article will be a part of a series of my learning and experimenting with Qwik and its meta-framework. So let's get started 🤞</p>
<h2 id="heading-introduction">Introduction</h2>
<p>In this article let’s talk about Qwik city and how it is different from other meta-frameworks. We’ll also look into some of the best features that make Qwik City one of the best meta-framework out there.</p>
<h2 id="heading-whats-a-meta-framework">What’s a meta-framework?</h2>
<p>A meta-framework is basically one extra layer on a framework that provides some of the cool advancement features that are not easily accessible with only the framework. Some of the popular meta-frameworks are Gatsby and Next.js which is built on top of react.js and there are many more meta-frameworks.</p>
<h2 id="heading-what-are-the-features-of-meta-framework">What are the features of Meta-framework?</h2>
<p>Some of the common features that a meta-framework .provide would be something like </p>
<ul>
<li><p>file or directory-based routing</p>
</li>
<li><p>Data fetching</p>
</li>
<li><p>Server-side rendering or SSR</p>
</li>
<li><p>Static site generation or SSG</p>
</li>
</ul>
<p>But the biggest this that I think it provides would-be developer experience and tooling that it adds so, for example, you absolutely could build a high-quality react.js app without one of these meta-frameworks. However, meta-framework provides all the developer experience and the tooling to make it much easier for developers to bust out and create a high-quality application as quickly as possible.</p>
<h2 id="heading-little-about-qwik-framework">Little about Qwik Framework</h2>
<p>There’s a saying that a faster-performing site will increase your conversion rates whatever those may be. The web is full of such depth research and shows that the faster your site is the more your conversion rates improve such as increased sales, more signups fewer users leaving your site, and many more.</p>
<h3 id="heading-what-role-does-qwik-play-here">What role does Qwik Play here?</h3>
<p>There are hundreds of frameworks out there that say they are the fastest how actually is Qwik different from one of today’s popular frameworks? Basically popular frameworks today use hydration to start up a server-side rendered application the big difference is that most of today’s frameworks are <strong>replayable</strong> where as Qwikis <strong>resumable.</strong> Let’s break down these words and understand them better.</p>
<p>Think of a virtual machine wherein the first machine you can run an application to a certain point then freeze dry the application State and head it off to another machine. The second machine is able to pick up exactly where the first one left off. This is very similar to the resume ability for Qwik. A server is able to generate the HTML and within it include the application's current state which means how the page is currently rendered depending on the URL or any other parameter.</p>
<p>Hydration is entirely different in that the application needs to run twice, once on the server and then once on a browser. After the server renders HTML it ships the content to the browsers but however the client or the browser has to replay everything the server already did it needs to execute the application again so it can get back to the point where the server left it off.</p>
<p>This is why we called it replayable not resumable because it needs to replay the app a second time to get it up and running again and back to the same.</p>
<h2 id="heading-what-makes-qwik-city-different">What makes Qwik City different?</h2>
<p>Qwik City is a meta-framework that is built on top of the Qwik framework it has many traditional features of many meta-frameworks out there like </p>
<ul>
<li><p>Routing</p>
</li>
<li><p>Data Fetching</p>
</li>
<li><p>SSR / SSG</p>
</li>
</ul>
<p>A limitation commonly seen in many of today’s meta-framework would have to be their poor time to interactivity or TTI. The amount of time it takes for the page to become interactive can often be attributed to the underlying frameworks that use the javascript hydration.</p>
<p>It also comes down to the frameworks that heavily rely on Javascript to get the app up and running. Because low-level frameworks have a lot of baggage meta-framework has to deal with it and make it less performant.</p>
<p>On the other hand, Qwik city focuses on increasing the speed of the website by reducing the unnecessary javascript and making it more performant. Here are the top features that make Qwik city different from other meta frameworks.</p>
<ul>
<li><p>Qwik City meta-framework is built on top of the Qwik so all the benefits of resume ability and extremely fast time to interact are also possible for the Qwik City application.</p>
</li>
<li><p>Because of inheriting all the cool feature of Qwik, there is very little runtime involved at all with Qwik-city.</p>
</li>
<li><p>It is optimized for Time To Interactive (TIL)</p>
</li>
<li><p>Perform better HTTP Request/ Response Handling</p>
</li>
<li><p>Support Active Prefetching</p>
</li>
</ul>
<h2 id="heading-the-uniqueness-of-qwik-city">The uniqueness of Qwik City</h2>
<ul>
<li><p>Active Prefetching: Qwik City avoid actively prefetching what’s possible but that does not mean that we are not prefetching important features, on the other hand, Qwik only prefetch what’s needed so for example if the only thing a user can do is click a button then that’s the only module prefetched.</p>
</li>
<li><p>Static Site Generation SSG: Qwik City is different here because of its ability to add a heavy amount of interactivity but without a large javascript overhead. One of the reasons is full reloads are very cheap because of the resume ability concept.</p>
</li>
<li><p>Server-Side Rendering: Qwik provides HTTP streaming by default and it does not block waiting for the entire HTML chunk. It also has support server middleware like CloudFare, Netlify, Express, etc. Integration with the Qwik City into existing servers and it does not take full control of handlers.</p>
</li>
</ul>
<h3 id="heading-hybrid-combination-of-ssg-and-ssr">Hybrid Combination of SSG and SSR</h3>
<p>One of the approaches of mixing statically generated content and dynamically rendered content, it’s really difficult to get anything faster than SSG. It comes with already rendered and no work needs to be done, but with SSR however, usually the entire tree needs to render because the application isn’t sure what’s static or dynamic</p>
<p>With Qwik Optimizer it does contain this information and it does know what is static and what’s dynamic. This means that while generating SSR render code we can create modules that are largely pre-rendered strings of the content. It’s not having to render the entire tree but rather concatenate all the static parts which could be most of the page and dynamically render the small sections.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Qwik city is a great way to get your website to load fast and make it more performant. Supports of both MPA and SPA architecture make it easy to workload the capability of the website and designed it that way. Qwik and Qwik City have made making websites so fast that it feels like magic.</p>
]]></content:encoded></item><item><title><![CDATA[How to deploy your react application with Vercel super fast 🚀🚀]]></title><description><![CDATA[how to deploy your react application with vercel]]></description><link>https://anaskhan28.hashnode.dev/how-to-host-your-react-application-with-vercel-super-fast</link><guid isPermaLink="true">https://anaskhan28.hashnode.dev/how-to-host-your-react-application-with-vercel-super-fast</guid><category><![CDATA[Vercel]]></category><category><![CDATA[Web Hosting]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[React]]></category><dc:creator><![CDATA[Anas Khan]]></dc:creator><pubDate>Tue, 25 Oct 2022 04:20:56 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1666637964834/cVlPn-hmG.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Today there are many hosting platforms that can host your website and provide you all flexibility without paying any penny. You can host your portfolio, personal projects, and some other cool stuff.</p>
<p>What is so special about Vercel and why did I choose Vercel to host the react application?</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666637977258/ebHjUO3uF.png" alt="vercel logo.png" /></p>
<p>Vercel is a popular static web hosting serverless platform for front-end developers. The platform allows developers to host websites and web services, by providing speed and reliability it can deploy instantly, and scale automatically with minimal configuration just need to create it at the moment of inspiration. </p>
<p>You can use serverless functions to handle user authentication, form submission, database queries, custom Slack commands, and many more. Vercel integrates well with popular tools, such as GitHub, GitLab, etc.</p>
<p><strong>Features of Vercel</strong></p>
<ul>
<li>Build and Deploy your Project with 
 automatic CI/CD</li>
<li>Automatic Git Integration</li>
<li>Vercel Analytics</li>
<li>Incremental Static Regeneration</li>
<li>Provide State level production </li>
</ul>
<p>Now you are familiar with <strong>Vercel</strong> and ready to host your application </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666639182385/-TJr68Pt3.gif" alt="yes.gif" class="image--center mx-auto" /></p>
<p>I will be assuming you had one react project and looking for the hosting part so let's get started.</p>
<ol>
<li><p>Make an account in Vercel <a target="_blank" href="https://vercel.com/">continue with Github </a>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666668301399/_UEIs7xUs.png" alt="image.png" /></p>
</li>
<li><p>You will redirected to a dashboard section then click on the <strong>Add New</strong> menu, and select <strong>Project</strong>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666668535337/MQOjknmOn.png" alt="image.png" />
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666668566634/mB9se2ElV.png" alt="image.png" class="image--center mx-auto" /></p>
</li>
<li><p>Click <strong>Continue with Github</strong>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666668779875/4QmSEJKOF.png" alt="image.png" /></p>
</li>
<li><p>Select the repository you want to host 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666668881347/YfPcemetG.png" alt="image.png" /></p>
</li>
<li><p>Write the <strong>Name</strong> of the project (only lowercase) and select <strong>Create React App</strong> in the <strong>Framework Preset</strong> section. 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666669068798/PBbKloThh.png" alt="image.png" /></p>
</li>
<li><p>Click on the <strong>Edit</strong> root directory and choose the folder where the react application is stored. In my case, it is in the client folder and then click <strong>Continue</strong><br /><strong>Do this step only if you have multiple folders</strong>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666669412854/S3-artk81.png" alt="image.png" /></p>
</li>
<li><p>Click on <strong>Deploy</strong> and wait for an application to get deployed.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666669880447/ZSJkXlMa7.png" alt="image.png" /></p>
</li>
<li><p>Congratulation your site has been deployed 🎉
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666670165924/LOCYKoDsU.png" alt="image.png" /></p>
</li>
<li><p>Click on <strong>Continue to Dashboard</strong> and click on the <strong>Visit</strong> tab. 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666670317697/qdmYiE-Uz.png" alt="image.png" /></p>
</li>
<li><p>Our website is ready and now anyone with this link can visit your website.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666670727353/9VMoHugsG.png" alt="image.png" /></p>
</li>
</ol>
<p> <strong>Thanks</strong> for reading.❤️</p>
<p>Let me know which hosting platform do you use and why?</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666670912760/gMWqlCaHn.avif" alt="5VuZmkfXz.avif" class="image--center mx-auto" /></p>
<p>Until the next time 👋</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666670964270/tkzWzFyls.avif" alt="LadJ4m8lY.avif" class="image--center mx-auto" /></p>
]]></content:encoded></item><item><title><![CDATA[Caesar Cipher in Javascript]]></title><description><![CDATA[Let's make a Caesar Cipher website with javascript DOM]]></description><link>https://anaskhan28.hashnode.dev/caesar-cipher-in-javascript</link><guid isPermaLink="true">https://anaskhan28.hashnode.dev/caesar-cipher-in-javascript</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[Cryptography]]></category><category><![CDATA[Caesar Cipher]]></category><category><![CDATA[CSS]]></category><dc:creator><![CDATA[Anas Khan]]></dc:creator><pubDate>Sat, 22 Oct 2022 06:26:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1666419932079/alG-7iTEM.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-a-little-demo">A little demo</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666415958253/q3usMfNpl.gif" alt="ezgif-5-7818604223.gif" /></p>
<h3 id="heading-any-pre-requirement">Any pre-requirement?</h3>
<p>Nothing 😁</p>
<p><strong>You be like</strong><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666416325068/z1E4R7Vj6.gif" alt="side-seriou.gif" /></p>
<p>Nah! I am kidding
you should know the basics of HTML CSS and Javascript</p>
<h3 id="heading-lets-get-started">Let's Get Started</h3>
<p>First let's understand the caesar cipher and what it is exactly, below are the resources to learn caesar cipher and cryptography because this blog is not about lectures🤷‍♂️
<a target="_blank" href="https://brilliant.org/wiki/caesar-cipher/">Click here </a></p>
<p>Now you are ready to make your learning and blend it into a web page.</p>
<p>Create one folder in vscode and add an HTML file, CSS file, and Javascript file</p>
<p><strong>CaesarShift.html</strong></p>
<p>Use <strong>Ctrl + 1</strong> to generate default HTML code and edit it accordingly </p>
<pre><code>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
    &lt;title&gt;Caesar Cipher Encrypter&lt;/title&gt;
    &lt;link rel="stylesheet" href="Styles.css"&gt;
&lt;/head&gt;
</code></pre><p>We have created two containers one for the title and image and a second one for the input area where we encrypt and decrypt our message.</p>
<pre><code>&lt;body&gt;
    &lt;div id='container-1'&gt;
        &lt;h1&gt;Caesar Cipher Encrypter&lt;/h1&gt;
        &lt;img id='caesar' src='https://www.seas.upenn.edu/~cis110/current/assets/img/misc/caesar.jpg'&gt;
    &lt;/div&gt;

&lt;div id='container-2'&gt;
&lt;label&gt;&lt;textarea type="text" id='plainInput-1' 
placeholder="Type in plain text"&gt;&lt;/textarea&gt;&lt;/label&gt;
        &lt;button id='encrypt-btn'&gt;Encrypt&lt;/button&gt;
        &lt;button id='decrypt-btn'&gt;Decrypt&lt;/button&gt;
        &lt;input type='number' id='shiftInput' min= '0' max = '25'&gt;
        &lt;br&gt;
        &lt;label&gt;  
            &lt;textarea type='text' id='encryptedInput-1' placeholder="Encrypted 
text will appear here..."&gt;&lt;/textarea&gt;
        &lt;/label&gt;
   &lt;/div&gt;
   &lt;script src="./Script.js"&gt;&lt;/script&gt;  
&lt;/body&gt;
</code></pre><p>We are done with our HTML code let's dive into CSS</p>
<p><strong>Styles.css</strong></p>
<p>In the CSS part we are adding a custom font style just for the heading.</p>
<pre><code>@<span class="hljs-keyword">import</span> url(<span class="hljs-string">'https://fonts.googleapis.com/css2?family=Kenia&amp;display=swap'</span>);

body{
    <span class="hljs-attr">background</span>: linear-gradient(<span class="hljs-number">90</span>deg, #fdfcfb <span class="hljs-number">0</span>%, #e2d1c3 <span class="hljs-number">100</span>%);
    position:relative;
    bottom:<span class="hljs-number">50</span>px;
}
label{
    font-family:sans-serif;
    color:black;
    transform:scale(<span class="hljs-number">1.5</span>);
    position:relative;
}
#container<span class="hljs-number">-2</span>{
    <span class="hljs-attr">position</span>:relative;
    left:<span class="hljs-number">580</span>px;
    top:<span class="hljs-number">140</span>px;
    background:white;
    border-radius:<span class="hljs-number">10</span>px;
    padding:<span class="hljs-number">10</span>px <span class="hljs-number">60</span>px;
    width:<span class="hljs-number">400</span>px;
    height:<span class="hljs-number">500</span>px;
    flex-direction:column;
    box-shadow: <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">30</span>px rgba(<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0.2</span>);     
}
 #container<span class="hljs-number">-2</span> button{
    <span class="hljs-attr">position</span>:relative;
    top:<span class="hljs-number">100</span>px;
    right:<span class="hljs-number">125</span>px;
}
</code></pre><p>In this CSS part, we are making changes to containers and how it will look alike</p>
<pre><code>textarea{
<span class="hljs-attr">background</span>:transparent;
outline:none;
border-radius:<span class="hljs-number">5</span>px;
text-align:center;
transform:scale(<span class="hljs-number">1.5</span>);
margin-bottom:<span class="hljs-number">70</span>px;
position:relative;
top:<span class="hljs-number">40</span>px;
cursor:pointer;
}
#encrypt-btn{
 <span class="hljs-attr">transform</span>:translate(<span class="hljs-number">50</span>px,<span class="hljs-number">128</span>px) scale(<span class="hljs-number">2.4</span>);
}
#decrypt-btn{
    <span class="hljs-attr">transform</span>:translate(<span class="hljs-number">210</span>px,<span class="hljs-number">110</span>px) scale(<span class="hljs-number">2.4</span>);
}
#encrypt-btn, #decrypt-btn{
    border-radius:<span class="hljs-number">2</span>px;
 border:none;
 cursor:pointer;
 background:#<span class="hljs-number">3066</span>f6;
 color:white;
 font-family:sans-serif;
 font-size:<span class="hljs-number">10</span>px;
 padding:<span class="hljs-number">4</span>px <span class="hljs-number">12</span>px;
}
#shiftInput{
    <span class="hljs-attr">transform</span>:scale(<span class="hljs-number">1.8</span>);
    outline:none;
    cursor:pointer;
    border:<span class="hljs-number">1</span>px solid grey
}
#container<span class="hljs-number">-1</span>{
    <span class="hljs-attr">background</span>:white;
    border-radius:<span class="hljs-number">10</span>px;
    padding:<span class="hljs-number">30</span>px <span class="hljs-number">60</span>px;
    width:<span class="hljs-number">400</span>px;
    height:<span class="hljs-number">50</span>px;
    box-shadow: <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">30</span>px rgba(<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0.2</span>);
    transform:translate(<span class="hljs-number">580</span>px,<span class="hljs-number">100</span>px);
    font-family: Kenia, cursive;
    cursor:pointer;
}
#container<span class="hljs-number">-1</span>,#container<span class="hljs-number">-2</span>{
    <span class="hljs-attr">display</span>:flex;
    justify-content:center;
    align-items:center;
}
#caesar{
  <span class="hljs-attr">width</span>:<span class="hljs-number">111</span>px;
  border-radius:<span class="hljs-number">0</span>px <span class="hljs-number">10</span>px <span class="hljs-number">10</span>px <span class="hljs-number">0</span>px;
  position:relative;
  left:<span class="hljs-number">62</span>px
}
</code></pre><p>Now finally let's get started with javascript part</p>
<p><strong>Script.js</strong></p>
<p>In this javascript part, we are assigning variables and connecting to HTML tags with the help of <strong>document.getElementById()</strong> and making the input in uppercase.</p>
<pre><code><span class="hljs-keyword">let</span> encryptBtn = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'encrypt-btn'</span>)
        <span class="hljs-keyword">let</span> eInput= <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'encryptedInput-1'</span>)
        <span class="hljs-keyword">let</span> pInput= <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'plainInput-1'</span>)
        <span class="hljs-keyword">let</span> inputs = [eInput,pInput]
        <span class="hljs-keyword">let</span> decryptBtn = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'decrypt-btn'</span>)

        inputs.forEach(<span class="hljs-function"><span class="hljs-params">input</span> =&gt;</span> {
            input.oninput = <span class="hljs-function">() =&gt;</span> {
                input.value = input.value.toUpperCase()
            }
        })
</code></pre><p>In this part, we are creating encrypt function that will encrypt our input plain text and will present it in encrypted text.</p>
<pre><code>     <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">encrypt</span>(<span class="hljs-params"></span>) </span>{
            <span class="hljs-keyword">let</span> pInput= <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'plainInput-1'</span>).value
            <span class="hljs-keyword">let</span> solved = <span class="hljs-string">''</span>
            <span class="hljs-keyword">let</span> shiftInput = <span class="hljs-built_in">parseInt</span>(<span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'shiftInput'</span>).value)

            <span class="hljs-keyword">for</span>(<span class="hljs-keyword">var</span> i =<span class="hljs-number">0</span>; i&lt;pInput.length; i++){
                <span class="hljs-keyword">let</span> ascii_num = pInput[i].charCodeAt()
                <span class="hljs-keyword">let</span> sum = ascii_num + shiftInput
                sum &gt;= <span class="hljs-number">65</span> &amp;&amp; sum &lt;=<span class="hljs-number">90</span> ? solved += <span class="hljs-built_in">String</span>.fromCharCode(sum) : sum &gt; <span class="hljs-number">90</span> ? 
                solved += <span class="hljs-built_in">String</span>.fromCharCode(<span class="hljs-number">65</span> + (sum % <span class="hljs-number">91</span>)) : solved += pInput[i]    
                       }
        eInput.value = solved
        }
</code></pre><p>In the last part, we are creating a decrypt function that will convert encrypted text into simple plain text format. At the last, we are adding event listeners to encrypt and decrypt buttons.</p>
<pre><code> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">decrypt</span>(<span class="hljs-params"></span>)</span>{
            <span class="hljs-keyword">let</span> eInput= <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'encryptedInput-1'</span>).value
            <span class="hljs-keyword">let</span> solved = <span class="hljs-string">''</span>
            <span class="hljs-keyword">let</span> shiftInput = <span class="hljs-built_in">parseInt</span>(<span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'shiftInput'</span>).value)

            <span class="hljs-keyword">for</span>(<span class="hljs-keyword">let</span> i =<span class="hljs-number">0</span>; i&lt;eInput.length; i++){
                <span class="hljs-keyword">let</span> ascii_num = eInput[i].charCodeAt()
                <span class="hljs-keyword">let</span> minus = ascii_num + shiftInput
                minus &gt;= <span class="hljs-number">65</span> &amp;&amp; minus &lt;=<span class="hljs-number">90</span> ? solved += <span class="hljs-built_in">String</span>.fromCharCode(minus) : minus &gt; 
                <span class="hljs-number">90</span> ? solved += <span class="hljs-built_in">String</span>.fromCharCode(<span class="hljs-number">65</span> - (minus % <span class="hljs-number">91</span>)) : solved -= eInput[i]    
                       }
        pInput.value = solved
                    }
        decryptBtn.addEventListener(<span class="hljs-string">'click'</span>, decrypt)
        encryptBtn.addEventListener(<span class="hljs-string">'click'</span>, encrypt)
</code></pre><p>This concludes and our website is ready.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666419838342/OxzhLxLDG.avif" alt="5VuZmkfXz.avif" /></p>
<p>Until next time have a great learning ✌️</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666419851284/QUGrJoDWe.avif" alt="LadJ4m8lY.avif" /></p>
]]></content:encoded></item><item><title><![CDATA[Why I want  to be a Developer?]]></title><description><![CDATA[In this blog, I'll try to take you on a journey(yet to complete) to become a developer! 😉]]></description><link>https://anaskhan28.hashnode.dev/why-i-want-to-be-a-developer</link><guid isPermaLink="true">https://anaskhan28.hashnode.dev/why-i-want-to-be-a-developer</guid><category><![CDATA[4articles4weeks]]></category><category><![CDATA[week1]]></category><category><![CDATA[Developer]]></category><dc:creator><![CDATA[Anas Khan]]></dc:creator><pubDate>Sun, 21 Aug 2022 11:11:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1661079701849/o215vcwW5.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-everything-is-uncertain">Everything is uncertain... 🤷‍♂️</h3>
<p><strong>Let's take a time machine and go to the past</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1661080463504/QpAmeNogy.gif" alt="AcclaimedRealisticAmericanalligator-size_restricted.gif" /></p>
<p>My school life is over and I passed with a good percentage, I had thought of becoming a doctor but corona arrived and everything was locked, the world stop enjoying its fullest and went into the grieving sadness.</p>
<p>I had a computer since I was in my 5th std but I only used the computer for playing games and watching movies (most teen does this only🤦‍♂️). So in corona, I had nothing to do, and I started overthinking everything about my future, and career. One of my friends is learning python programming though, so one day I asked him about what is it you are learning, and he explain to me about programming language and how apps and websites are made ( I was astonished when he said you can make one too). I got super pumped by those words and started learning to program 😎</p>
<h3 id="heading-again-error">Again error...😒</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1661079772289/JE-Txb86x.gif" alt="programming-crazy.gif" class="image--center mx-auto" /></p>
<p>"I always get the error", <em>programming is not for me</em> (that's what I thought), I felt to quit and do something else (I still feel sometimes) but I always say to myself one more try. This trial and error will give me what I am seeking ✌</p>
<p>The main reason I love programming is that a very objective/logical thinker who likes to quantify things that most people wouldn't think to quantify. I like the idea of creating unique things but I don't see myself as a very creative person. Programming allows me to do something between creativeness and logic.</p>
<h3 id="heading-i-can-be-a-developer">I can be a Developer 😃</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1661079663390/_Mi_-4Mzr.gif" alt="1_IRGHmiGsa16stedQvIaZfw.gif" /></p>
<p> I joined many communities and started learning in public, participated in some of the hackathons and events, learning and met amazing folks. I also made some of the projects <a target="_blank" href="https://github.com/anaskhan28">check out here</a></p>
<p>Many people say that you can become a Developer only if you are very creative or very good at math.
That's just hypothetical,  but yes one thing you need is consistency. </p>
<p>Thank you for reading! ❤</p>
<p>PS: Not a good writer, would love to have feedback 😊
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1661079365573/AuvLI4afK.avif" alt="MmmzPHD2m.avif" /></p>
<p>NB: This article was published as my #week1 article for the Hashnode #4articles4weeks <strong>Writeathon</strong>. </p>
]]></content:encoded></item></channel></rss>