<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sean Coughlin</title>
    <description>The latest articles on DEV Community by Sean Coughlin (@scc33).</description>
    <link>https://dev.to/scc33</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F797541%2F7f967e33-b680-435c-ab16-f9dc8556e4ae.png</url>
      <title>DEV Community: Sean Coughlin</title>
      <link>https://dev.to/scc33</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/scc33"/>
    <language>en</language>
    <item>
      <title>Understanding CI/CD: Streamlining Software Deployment</title>
      <dc:creator>Sean Coughlin</dc:creator>
      <pubDate>Thu, 30 Nov 2023 16:08:56 +0000</pubDate>
      <link>https://dev.to/scc33/understanding-cicd-streamlining-software-deployment-59d</link>
      <guid>https://dev.to/scc33/understanding-cicd-streamlining-software-deployment-59d</guid>
      <description>&lt;p&gt;In the ever-evolving landscape of software development, &lt;a href="https://en.wikipedia.org/wiki/CI/CD"&gt;Continuous Integration and Continuous Deployment (CI/CD)&lt;/a&gt; have emerged as key practices that enhance efficiency and reliability.&lt;/p&gt;

&lt;p&gt;Let's delve into the world of CI/CD, its importance, historical evolution, and some notable platforms that facilitate these processes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is CI/CD?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Continuous_integration"&gt;&lt;strong&gt;Continuous Integration (CI)&lt;/strong&gt;&lt;/a&gt; involves the practice of automating the integration of code changes from multiple contributors into a single software project. It's a crucial part of modern software development practices that helps detect and fix bugs quicker, improve software quality, and reduce the time it takes to validate and release new software updates.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Continuous_delivery"&gt;&lt;strong&gt;Continuous Deployment (CD)&lt;/strong&gt;&lt;/a&gt; extends CI by automatically deploying all code changes to a testing and/or production environment after the build stage. This practice ensures a faster and more streamlined deployment process, enabling organizations to release new features, fixes, and updates rapidly and efficiently.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Evolution of CI/CD
&lt;/h3&gt;

&lt;p&gt;Traditionally, software deployment was a manual and infrequent process. Developers would write code for weeks or months and then merge their changes into the main branch. This often led to conflicts and bugs, which were time-consuming and costly to fix.&lt;/p&gt;

&lt;p&gt;The introduction of &lt;a href="https://en.wikipedia.org/wiki/Agile_software_development"&gt;Agile methodologies&lt;/a&gt; marked the beginning of more iterative and incremental software development. CI/CD evolved as a natural extension of Agile, focusing on frequent, small, incremental changes to code and automatic testing and deployment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Historical Shift:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pre-CI/CD Era&lt;/strong&gt; : Manual code integration, infrequent releases, and high potential for errors.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Post-CI/CD Adoption&lt;/strong&gt; : Streamlined processes with automated testing and deployment, leading to more frequent and reliable software releases.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Key Benefits of CI/CD:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Faster Release Rate&lt;/strong&gt; : Automates the software release process, enabling more frequent and reliable deployments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Improved Code Quality&lt;/strong&gt; : Continuous testing identifies defects early in the development cycle.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Increased Efficiency&lt;/strong&gt; : Reduces manual intervention, leading to a more efficient development process.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When is CI/CD Important?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Rapid Development Environments&lt;/strong&gt; : In fast-paced sectors where software needs to be updated frequently.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Large Teams&lt;/strong&gt; : Facilitates coordination and integration of changes made by different developers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;High Availability Systems&lt;/strong&gt; : Ensures continuous delivery and deployment with minimal downtime.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Popular CI/CD Platforms
&lt;/h2&gt;

&lt;p&gt;Several platforms have emerged to support CI/CD practices. Some of the widely used ones include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Jenkins&lt;/strong&gt; : An open-source automation server that provides hundreds of plugins to support building, deploying, and automating any project. &lt;a href="https://www.jenkins.io/doc/"&gt;Jenkins Documentation&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GitLab CI/CD&lt;/strong&gt; : Integrated into GitLab, it offers a web-based CI/CD service for software development through the GitLab repository. &lt;a href="https://docs.gitlab.com/ee/ci/"&gt;GitLab CI/CD Documentation&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CircleCI&lt;/strong&gt; : Known for its ease of setup and maintenance, CircleCI is a cloud-based system that supports various programming languages and integrates with GitHub and Bitbucket. &lt;a href="https://circleci.com/docs/"&gt;CircleCI Documentation&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Travis CI&lt;/strong&gt; : A hosted continuous integration service used to build and test software projects hosted on GitHub and Bitbucket. &lt;a href="https://docs.travis-ci.com/"&gt;Travis CI Documentation&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AWS CodePipeline&lt;/strong&gt; : A continuous integration and continuous delivery service for fast and reliable application and infrastructure updates. &lt;a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/welcome.html"&gt;AWS CodePipeline User Guide&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GitHub Actions:&lt;/strong&gt; An automation suite built right into GitHub. It can be used to run many types of automation including CICd pipelines. &lt;a href="https://docs.github.com/en/actions"&gt;GitHub Actions documentation&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The adoption of CI/CD is a game-changer in the software development process. It not only speeds up the development and deployment cycles but also significantly enhances the quality of the software produced.&lt;/p&gt;

&lt;p&gt;By automating the integration and deployment process, CI/CD allows developers to focus more on developing features and less on the process of integrating and deploying them.&lt;/p&gt;

&lt;p&gt;For software engineers and teams looking to stay ahead in the fast-paced tech world, embracing CI/CD methodologies is not just an option, but a necessity. With the plethora of tools and platforms available, implementing CI/CD has never been more accessible.&lt;/p&gt;




&lt;p&gt;Originally published at &lt;a href="https://blog.seancoughlin.me"&gt;https://blog.seancoughlin.me&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>cicd</category>
    </item>
    <item>
      <title>jsdom vs happy-dom: Navigating the Nuances of JavaScript Testing</title>
      <dc:creator>Sean Coughlin</dc:creator>
      <pubDate>Thu, 30 Nov 2023 04:16:16 +0000</pubDate>
      <link>https://dev.to/scc33/jsdom-vs-happy-dom-navigating-the-nuances-of-javascript-testing-320i</link>
      <guid>https://dev.to/scc33/jsdom-vs-happy-dom-navigating-the-nuances-of-javascript-testing-320i</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;JavaScript testing is a crucial part of ensuring that web applications work correctly across different environments. In this context, tools like &lt;a href="https://github.com/jsdom/jsdom"&gt;jsdom&lt;/a&gt; and &lt;a href="https://github.com/capricorn86/happy-dom"&gt;happy-dom&lt;/a&gt; are incredibly valuable. They both provide ways to simulate a browser-like environment for testing purposes. Let's dive into what each of these tools is and how they compare.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Server-Side DOM in Web Development
&lt;/h2&gt;

&lt;p&gt;Before we can dive fully into these tools we need to briefly discuss the DOM.&lt;/p&gt;

&lt;p&gt;When we talk about the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model"&gt;DOM&lt;/a&gt; or Document Object Model, the immediate association is with client-side JavaScript in a web browser. It's a critical concept for web developers, as it represents the page's structure, style, and content, and allows scripts to interact with and modify it.&lt;/p&gt;

&lt;p&gt;However, there's another side to this: the server-side DOM. Lets explore what this means and why it's important in modern web development.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Idea of a DOM Outside a Client (Server-Side DOM)
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://en.wikipedia.org/wiki/Document_Object_Model"&gt;Document Object Model (DOM)&lt;/a&gt; is typically thought of as the model that the browser uses to turn an HTML document into a visible website. However, the &lt;a href="https://dom.spec.whatwg.org"&gt;DOM standard&lt;/a&gt; can be implemented in pure JavaScript to run outside of a browser on a server.&lt;/p&gt;

&lt;p&gt;One of the primary uses of a server-side DOM is in the context of testing web applications. In traditional scenarios, testing a web application's functionality requires rendering pages in a browser. However, with a server-side DOM, developers can simulate a browser environment on the server.&lt;/p&gt;

&lt;p&gt;This approach is extremely useful for automated testing, allowing scripts to interact with a simulated DOM without the overhead of a real browser. The GUI of a browser is very nice for human usability but has terrible performance. Stripping out the browser overhead enables fast JavaScript unit testing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tools for Server-Side DOM
&lt;/h3&gt;

&lt;p&gt;In the JavaScript world, tools like jsdom and happy-dom are prime examples of server-side DOM implementations. They create a simulated browser-like DOM environment within a server context.&lt;/p&gt;

&lt;p&gt;This means JavaScript code, which typically runs in a client-side browser, can be executed on the server. This simulation can include creating and manipulating DOM elements, handling events, and sometimes even emulating browser-specific behaviors and CSS support.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is happy-dom?
&lt;/h2&gt;

&lt;p&gt;happy-dom is a relatively new entrant in the world of JavaScript testing. It's a lightweight, high-performance server-side DOM implementation. happy-Dom is designed to emulate a web browser's environment, allowing you to run and test your JavaScript code in a simulated browser-like environment on the server.&lt;/p&gt;

&lt;p&gt;One of the key features of happy-dom is its speed and efficiency. It's built to be fast, which makes it an excellent choice for high-speed DOM operations and tests that require quick execution. This can be particularly beneficial in a &lt;a href="https://blog.seancoughlin.me/series/ci-cd"&gt;continuous integration/continuous deployment (CI/CD)&lt;/a&gt; pipeline where speed is crucial.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is jsdom?
&lt;/h2&gt;

&lt;p&gt;jsdom, on the other hand, is a more established tool in the JavaScript world. It offers a robust simulation of a web browser's environment. JSdom allows you to create a virtual DOM on the server-side, enabling the testing of JavaScript intended for client-side execution in a Node.js environment.&lt;/p&gt;

&lt;p&gt;jsdom is known for its comprehensive emulation of the web browser's environment. It includes a wide range of browser features, making it a go-to choice for tests that require detailed emulation, including CSS support, layout, and more complex DOM manipulations.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to Use jsdom or happy-dom
&lt;/h2&gt;

&lt;p&gt;Choosing between jsdom and happy-dom often depends on your specific testing requirements:&lt;/p&gt;

&lt;p&gt;The rough rule of thumb is happy-dom might be faster (depending on your use case) and jsdom might be more complete (simulates more of what a browser would).&lt;/p&gt;

&lt;h3&gt;
  
  
  Example Use Case
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://vitest.dev"&gt;Vitest&lt;/a&gt; supports the use of &lt;a href="https://vitest.dev/guide/environment#test-environment"&gt;different DOM rendering tools&lt;/a&gt;. You could choose to use either happy-dom or jsdom depending on your preference.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default defineConfig({
    plugins: [svelte()],
    test: {
        environment: 'jsdom', // could pass in jsdom or happy-dom
    },
})

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Feel free to &lt;a href="https://blog.seancoughlin.me/vitest-vs-jest-the-new-javascript-testing-framework"&gt;learn more about Vitest in one of my earlier posts&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, both JSdom and Happy-Dom offer valuable solutions for testing JavaScript in a non-browser environment. Your choice between the two should be guided by your project's specific needs. If you require detailed browser emulation, jsdom is your go-to tool. For rapid testing, particularly focused on DOM operations, happy-dom is an excellent choice.&lt;/p&gt;

&lt;p&gt;As JavaScript continues to evolve, tools like these play a crucial role in ensuring the reliability and performance of web applications. As a software engineer, staying informed about these tools and understanding their strengths and weaknesses can significantly enhance your testing strategy and overall development workflow.&lt;/p&gt;




&lt;p&gt;Originally published at &lt;a href="https://blog.seancoughlin.me"&gt;https://blog.seancoughlin.me&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>testing</category>
      <category>jest</category>
    </item>
    <item>
      <title>Publishing a SvelteKit App to GitHub Pages</title>
      <dc:creator>Sean Coughlin</dc:creator>
      <pubDate>Sun, 08 Oct 2023 14:08:35 +0000</pubDate>
      <link>https://dev.to/scc33/publishing-a-sveltekit-app-to-github-pages-4439</link>
      <guid>https://dev.to/scc33/publishing-a-sveltekit-app-to-github-pages-4439</guid>
      <description>&lt;p&gt;Learn the step-by-step guide to effortlessly deploy your SvelteKit application to GitHub Pages and make your web project accessible to the world.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1696773973033%2F9dbab7b7-9cab-4942-b35d-908a6f3d6f75.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1696773973033%2F9dbab7b7-9cab-4942-b35d-908a6f3d6f75.png" alt="SvelteKit Logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is SvelteKit?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://kit.svelte.dev/docs/introduction" rel="noopener noreferrer"&gt;SvelteKit&lt;/a&gt; is a framework for building web applications that are built on top of Svelte, a modern JavaScript UI library. Unlike traditional frameworks that operate mainly on the client side, SvelteKit provides a unified approach to building apps that can be rendered on the server, statically generated at build time, or even rendered client-side. It comes with built-in features like routing, layouts, and server-side rendering (SSR), making it a comprehensive solution for building everything from small, static websites to large, complex web applications. With a focus on performance and a simplified developer experience, SvelteKit aims to streamline the process of building robust and scalable web apps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Build a SvelteKit App!
&lt;/h3&gt;

&lt;p&gt;This tutorial just spells out how to configure and deploy a SvelteKit web app to GitHub Pages. If you never have created a Svelte application before, the &lt;a href="https://kit.svelte.dev/docs/creating-a-project" rel="noopener noreferrer"&gt;docs&lt;/a&gt; are great!&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuring SvelteKit for GitHub Pages
&lt;/h3&gt;

&lt;p&gt;Build your application using Svelte and SvelteKit&lt;/p&gt;

&lt;p&gt;GitHub Pages is a static site host. Therefore, we need to install the &lt;a href="https://kit.svelte.dev/docs/adapters" rel="noopener noreferrer"&gt;Svelte static site adapter&lt;/a&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# NPM install&lt;/span&gt;
npm i &lt;span class="nt"&gt;-D&lt;/span&gt; @sveltejs/adapter-static
&lt;span class="c"&gt;# YARN install&lt;/span&gt;
yarn add @sveltejs/adapter-static &lt;span class="nt"&gt;--dev&lt;/span&gt;



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After installing the static adapter, at that to your &lt;code&gt;svelte.config.js&lt;/code&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;adapter&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@sveltejs/adapter-static&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;vitePreprocess&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@sveltejs/kit/vite&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="cm"&gt;/** @type {import('@sveltejs/kit').Config} */&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;kit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;appDir&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Required as the default is _app&lt;/span&gt;
        &lt;span class="na"&gt;adapter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;adapter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;preprocess&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;vitePreprocess&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Add an app directory output to the &lt;code&gt;svelte.config.js&lt;/code&gt;. The typical output is &lt;code&gt;_app&lt;/code&gt; so I think something like &lt;code&gt;app&lt;/code&gt; makes sense but this can be anything without an underscore. GitHub Pages cannot serve content from directories with special characters like underscores.&lt;/p&gt;

&lt;p&gt;If you are deployed to &lt;code&gt;https://[username].github.io&lt;/code&gt; that is all that is required for configuration. If you are deploying to &lt;code&gt;https://[username].github.io/your-repo-name&lt;/code&gt; you will need to supply a &lt;code&gt;paths.base&lt;/code&gt;. See the &lt;a href="https://kit.svelte.dev/docs/adapter-static#github-pages" rel="noopener noreferrer"&gt;SvelteKit docs&lt;/a&gt; for more details.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;adapter&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@sveltejs/adapter-static&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dev&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="cm"&gt;/** @type {import('@sveltejs/kit').Config} */&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;kit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;adapter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;adapter&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;base&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;dev&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;BASE_PATH&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Add an empty &lt;code&gt;.nojekyll&lt;/code&gt; file in your &lt;code&gt;static&lt;/code&gt; folder to prevent GitHub Pages provided Jekyll configurations from managing the site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1696772807659%2F1143e923-067a-4f8c-bf25-72291a131ac9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1696772807659%2F1143e923-067a-4f8c-bf25-72291a131ac9.png" alt="No-Jekyll"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Manually build and push your output directory to GitHub or use a tool like &lt;a href="https://dev.to/scc33/deploying-to-github-pages-using-gh-pages-2d95"&gt;gh-pages&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Configure GitHub pages to &lt;a href="https://blog.seancoughlin.me/building-a-personal-website-with-github-pages" rel="noopener noreferrer"&gt;deploy your app with the repo settings&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;Originally published at &lt;a href="https://blog.seancoughlin.me" rel="noopener noreferrer"&gt;https://blog.seancoughlin.me&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>svelte</category>
      <category>sveltekit</category>
      <category>github</category>
      <category>staticwebsite</category>
    </item>
    <item>
      <title>Deploying to GitHub Pages using gh-pages</title>
      <dc:creator>Sean Coughlin</dc:creator>
      <pubDate>Sat, 07 Oct 2023 19:26:50 +0000</pubDate>
      <link>https://dev.to/scc33/deploying-to-github-pages-using-gh-pages-2d95</link>
      <guid>https://dev.to/scc33/deploying-to-github-pages-using-gh-pages-2d95</guid>
      <description>&lt;p&gt;Effortlessly Deploy Your Static Websites to GitHub Pages with the gh-pages NPM Package.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flt0vk7ex8gfwlevotuy0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flt0vk7ex8gfwlevotuy0.png" alt="gh-pages scripts"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is GitHub Pages?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://pages.github.com" rel="noopener noreferrer"&gt;GitHub Pages&lt;/a&gt; is a static site hosting service offered by GitHub that takes files straight from a repository on GitHub and publishes them as a website. It's designed to host your personal, organizational, or project pages directly from a GitHub repository. GitHub Pages supports static HTML, CSS, and JavaScript files, as well as Jekyll, a static site generator that converts Markdown files to HTML. The service is commonly used to host personal portfolios, project landing pages, documentation, and blogs, offering a simple way to turn code repositories into publicly accessible websites.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is gh-pages?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/tschaub/gh-pages" rel="noopener noreferrer"&gt;&lt;code&gt;gh-pages&lt;/code&gt;&lt;/a&gt; is a Node.js package that provides a simple command-line utility for publishing files to a GitHub Pages branch in your repository. It automates the process of pushing your static assets to the &lt;code&gt;gh-pages&lt;/code&gt; branch of your GitHub repository, which is then automatically published by GitHub Pages. This package is often used in combination with site generators or build tools to simplify the deployment process for static websites or client-side web apps.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gh-pages&lt;/code&gt; can easily be used to automatically release and deploy any client-side rendered code. React, Angular, Svelte, plain HTML/CSS/Javascript, etc they all work!&lt;/p&gt;

&lt;h2&gt;
  
  
  Using gh-pages
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Setup your GitHub Pages Repo
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Open Terminal or Command Line&lt;/strong&gt; : Navigate to the directory where you want to initialize a new Git repository.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Initialize Git Repository&lt;/strong&gt; : Run the following command to initialize a new Git repository in that directory:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

 git init


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Add Files to the Repository&lt;/strong&gt; : You can add files to be tracked by Git with the following command:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

 git add &lt;span class="nb"&gt;.&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Commit Changes&lt;/strong&gt; : Commit these changes to the repository:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

 git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Initial commit"&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create a Remote Repository&lt;/strong&gt; : If you haven't already, create a new repository on GitHub. Do not initialize it with README, license, or &lt;code&gt;.gitignore&lt;/code&gt; files if you're planning to push an existing repository.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Add Remote Repository&lt;/strong&gt; : Back in your terminal, run the following command to link your local repository to the remote one:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

 git remote add origin &lt;span class="o"&gt;[&lt;/span&gt;Your GitHub Repo URL]


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Verify Remote&lt;/strong&gt; : You can verify that the remote URL has been added by running:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

 git remote &lt;span class="nt"&gt;-v&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Setup and Configure gh-pages
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Download the gh-pages package&lt;/strong&gt; : you can use your favorite node package manager for this step. This module requires Git &amp;gt;= 1.9 and Node &amp;gt; 14.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;#NPM installation&lt;/span&gt;
npm &lt;span class="nb"&gt;install &lt;/span&gt;gh-pages &lt;span class="nt"&gt;--save-dev&lt;/span&gt;
&lt;span class="c"&gt;# YARN install&lt;/span&gt;
yarn add gh-pages &lt;span class="nt"&gt;--dev&lt;/span&gt;



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Update your&lt;/strong&gt; &lt;code&gt;package.json&lt;/code&gt; &lt;strong&gt;scripts&lt;/strong&gt; : add a &lt;code&gt;predeploy&lt;/code&gt; and &lt;code&gt;deploy&lt;/code&gt; script. The &lt;code&gt;predeploy&lt;/code&gt; setup handles building the static content. The &lt;code&gt;predeploy&lt;/code&gt; script will automatically run when the deploy script runs.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;NPM&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"predeploy"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npm run build"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"deploy"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"gh-pages -d build"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;YARN&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"predeploy"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"yarn run build"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"deploy"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"gh-pages -d build"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;



&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Push the app to the GitHub repository&lt;/strong&gt; : once again you can use your favorite package manager tool.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;#NPM&lt;/span&gt;
npm run deploy
&lt;span class="c"&gt;# YARN&lt;/span&gt;
yarn run deploy



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check the GitHub repo to make sure the code was pushed to remote&lt;/strong&gt; : gh-pages should have pushed the code to a branch named &lt;code&gt;gh-pages&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Configure GitHub Pages
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Navigate to the GitHub Pages on the GitHub repository site&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configure the &lt;code&gt;Build and deployment&lt;/code&gt; settings.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F92e0w5fl0oor1skz95da.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F92e0w5fl0oor1skz95da.png" alt="Pages configurations"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've previously written about Github Pages configurations in one of my &lt;a href="https://blog.seancoughlin.me/building-a-personal-website-with-github-pages" rel="noopener noreferrer"&gt;very first blog posts&lt;/a&gt;. Feel free to check that out to learn more.&lt;/p&gt;

&lt;p&gt;That's all! GitHub Actions should automatically use these configurations to take your site live to the internet.&lt;/p&gt;




&lt;p&gt;Originally published at &lt;a href="https://blog.seancoughlin.me" rel="noopener noreferrer"&gt;https://blog.seancoughlin.me&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>react</category>
      <category>angular</category>
    </item>
    <item>
      <title>Time to Rebrand! Designing a Personal Site with SvelteKit</title>
      <dc:creator>Sean Coughlin</dc:creator>
      <pubDate>Sat, 07 Oct 2023 18:04:12 +0000</pubDate>
      <link>https://dev.to/scc33/time-to-rebrand-designing-a-personal-site-with-sveltekit-228j</link>
      <guid>https://dev.to/scc33/time-to-rebrand-designing-a-personal-site-with-sveltekit-228j</guid>
      <description>&lt;h3&gt;
  
  
  Site Background
&lt;/h3&gt;

&lt;p&gt;Who am I announcing this to? I'm not sure. It's a total vanity project, but we all need a vanity project or two!&lt;/p&gt;

&lt;p&gt;I originally published my site &lt;a href="https://seancoughlin.me"&gt;seancoughlin. me&lt;/a&gt; around two years ago. At the time, I used a basic &lt;a href="https://getbootstrap.com"&gt;Bootstrap&lt;/a&gt; resume template. I used raw HTML and CSS with a little plain JS.&lt;/p&gt;

&lt;p&gt;I filled out my details, deployed to Github pages, and called it a day. The page saw a few content updates, some under-the-hood optimizations for SEO and &lt;a href="https://chrome.google.com/webstore/detail/lighthouse/blipmdconlkpinefehnmjammfjpmpbjk"&gt;Lighthouse&lt;/a&gt;, and the addition of minor UI tweaks like &lt;a href="https://fontawesome.com"&gt;Font Awesome&lt;/a&gt; icons.&lt;/p&gt;

&lt;p&gt;Things were fine, but I felt the site had started to feel dated and didn't reflect my current skills. So I went on the hunt for new ideas.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9klIHzgX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1696701053124/41f484f2-f63c-4afb-99cd-94c65f6971c7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9klIHzgX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1696701053124/41f484f2-f63c-4afb-99cd-94c65f6971c7.png" alt="Wandering path" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Finding Inspiration
&lt;/h3&gt;

&lt;p&gt;I am an engineer by trade and CS geek by night. As hard as I try, graphic design just isn't my strong suit. However, people are kind and open-source is awesome! If you ever lack inspiration, search out the community. Just remember to cite the helpful people who contribute to your work :).&lt;/p&gt;

&lt;p&gt;After some hunting, I arrived at &lt;a href="https://youtu.be/-2UjwQzxvBQ?si=9q7kHikpHbCoVqaG"&gt;this&lt;/a&gt; cool &lt;a href="https://www.freecodecamp.org"&gt;freeCodeCamp&lt;/a&gt; tutorial! This guy was great a great teacher and I learned a lot from this tutorial. I typically work with React so this was my first &lt;a href="https://svelte.dev"&gt;Svelte&lt;/a&gt; introduction. I would say this is a good place to start.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/-2UjwQzxvBQ?si=mM1Fzy3J8zlaHDwS"&gt;https://youtu.be/-2UjwQzxvBQ?si=mM1Fzy3J8zlaHDwS&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I took his great design and made some tweaks such as adding my details, a skills section, and custom links.&lt;/p&gt;

&lt;p&gt;If you want to check out the original tutorial code you can find it &lt;a href="https://github.com/jamezmca/hughjass"&gt;here&lt;/a&gt;. If you want to check out my source code you can find that &lt;a href="https://github.com/Scc33/Scc33.github.io/releases/tag/v2.0.0"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Outcome
&lt;/h3&gt;

&lt;p&gt;Please go check out the new &lt;a href="https://seancoughlin.me/#about"&gt;site&lt;/a&gt; or view some of these fun screenshots.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jh1Vb5fm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1696700425689/5f460cec-342a-4872-87fd-1a3e614dab32.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jh1Vb5fm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1696700425689/5f460cec-342a-4872-87fd-1a3e614dab32.png" alt="About me section of seancoughlin.me" width="800" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g6JxBqW8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1696700449791/69554d30-87df-48e3-83bf-6916173a868b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g6JxBqW8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1696700449791/69554d30-87df-48e3-83bf-6916173a868b.png" alt="Skills section of seancoughlin.me" width="800" height="469"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Iym5XdXH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1696700535186/f37a1746-4767-471a-b946-071783782d48.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Iym5XdXH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1696700535186/f37a1746-4767-471a-b946-071783782d48.png" alt="Footer of seancoughlin.me" width="800" height="178"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;




&lt;p&gt;Originally published at &lt;a href="https://blog.seancoughlin.me"&gt;https://blog.seancoughlin.me&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>svelte</category>
      <category>sveltekit</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A Comprehensive Guide to AWS DynamoDB vs. Redshift for Databases and Data Warehouses</title>
      <dc:creator>Sean Coughlin</dc:creator>
      <pubDate>Sat, 09 Sep 2023 20:13:06 +0000</pubDate>
      <link>https://dev.to/scc33/a-comprehensive-guide-to-aws-dynamodb-vs-redshift-for-databases-and-data-warehouses-22hb</link>
      <guid>https://dev.to/scc33/a-comprehensive-guide-to-aws-dynamodb-vs-redshift-for-databases-and-data-warehouses-22hb</guid>
      <description>&lt;p&gt;Unlock the Full Potential of Your Data: An In-Depth Comparison of AWS DynamoDB and Redshift for Streamlined Data Management and Analytics&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9zxJyhxp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bmxh94qref4wbdlz1a4m.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9zxJyhxp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bmxh94qref4wbdlz1a4m.jpg" alt="DynamoDB vs Redshift" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The topics of &lt;a href="https://en.wikipedia.org/wiki/Database"&gt;databases&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/Data_warehouse"&gt;data warehouses&lt;/a&gt; are central to the modern data landscape, and Amazon's offerings&lt;a href="https://aws.amazon.com/dynamodb/"&gt;DynamoDB&lt;/a&gt; and &lt;a href="https://aws.amazon.com/redshift/"&gt;Redshift&lt;/a&gt;are standout products in their respective categories. Here's a detailed comparison:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Database vs. Data Warehouse&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4f_eIKpl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ggvkf5m7le3fblcsez9k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4f_eIKpl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ggvkf5m7le3fblcsez9k.png" alt="database vs data warehouses chart" width="800" height="708"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;DynamoDB&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Amazon_DynamoDB"&gt;Amazon DynamoDB&lt;/a&gt;, launched by AWS in 2012, is a fully managed NoSQL database service designed to provide seamless scalability and reliable performance. Built to handle high-velocity data and offer single-digit millisecond latency, DynamoDB supports key-value and document data models, making it well-suited for a variety of applications, including real-time analytics, mobile backends, and serverless architectures. With features like auto-scaling, in-memory caching, and multi-region replication, DynamoDB has become a cornerstone in the AWS ecosystem for developers requiring a highly available and low-latency data store.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Cases&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;High-velocity data like IoT event streams.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Serverless applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Real-time big data analytics.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mobile applications needing a backend.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Technical Features&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Offers single-digit millisecond latency.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Supports key-value and document data models.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Can be set up for multi-region replication.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Auto-scaling, in-memory caching, backup, and restore functionalities.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;AWS Redshift&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Amazon_Redshift"&gt;AWS Redshift&lt;/a&gt;, introduced in 2012, is a managed data warehouse service built on a Massively Parallel Processing (MPP) architecture. Based on PostgreSQL, Redshift is engineered for complex query processing and offers robust performance for large datasets by utilizing columnar storage and data compression techniques. Designed to serve the needs of OLAP (Online Analytical Processing) workloads, it integrates seamlessly with a variety of Business Intelligence tools and can handle structured and semi-structured data. As a staple in the AWS service suite, Redshift caters to enterprises and data analysts looking for scalable, fast, and flexible solutions for their analytics needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Cases&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Business intelligence.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data analytics.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Batch data processing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Complex SQL queries over large datasets.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Technical Features&lt;/strong&gt; :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Columnar storage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data compression to improve query performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Massively Parallel Processing (MPP) architecture.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Integration with various BI tools and data lakes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Next Steps&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If you're interested in DynamoDB start with AWS's free tier offer for DynamoDB. Then dive into AWS's extensive &lt;a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Introduction.html"&gt;DynamoDB documentation&lt;/a&gt; and sample projects before experimenting with different DynamoDB features like Streams and Global Tables.&lt;/p&gt;

&lt;p&gt;If you're interested in Redshift utilize the AWS free trial for Redshift! Then explore the i&lt;a href="https://docs.aws.amazon.com/redshift/latest/gsg/new-user-serverless.html"&gt;ntegrations between Redshift and other AWS services&lt;/a&gt; like S3, Kinesis, and SageMaker for a more comprehensive data solution.&lt;/p&gt;




&lt;p&gt;Originally published at &lt;a href="https://blog.seancoughlin.me"&gt;https://blog.seancoughlin.me&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>dynamodb</category>
      <category>redshift</category>
      <category>datawarehouse</category>
    </item>
    <item>
      <title>Delete Duplicate Emails</title>
      <dc:creator>Sean Coughlin</dc:creator>
      <pubDate>Sat, 09 Sep 2023 19:45:03 +0000</pubDate>
      <link>https://dev.to/scc33/delete-duplicate-emails-2k0e</link>
      <guid>https://dev.to/scc33/delete-duplicate-emails-2k0e</guid>
      <description>&lt;p&gt;Eliminating Duplicate Emails Efficiently: A Comprehensive Guide to Data Cleanup Using Pandas and SQL&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;With this article, I will be covering the &lt;a href="https://leetcode.com/problems/delete-duplicate-emails/"&gt;delete duplicate emails Leetcode problem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Leetcode describes this problem as easy. That's a super reasonable evaluation as the solution requires only basic SQL or Pandas knowledge.&lt;/p&gt;

&lt;p&gt;The problem description is as follows:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Write a solution to &lt;strong&gt;delete&lt;/strong&gt; all duplicate emails, keeping only one unique email with the smallest &lt;code&gt;id&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For SQL users, please note that you are supposed to write a &lt;code&gt;DELETE&lt;/code&gt; statement and not a &lt;code&gt;SELECT&lt;/code&gt; one.&lt;/p&gt;

&lt;p&gt;For Pandas users, please note that you are supposed to modify &lt;code&gt;Person&lt;/code&gt; in place.&lt;/p&gt;

&lt;p&gt;After running your script, the answer shown is the &lt;code&gt;Person&lt;/code&gt; table. The driver will first compile and run your piece of code and then show the &lt;code&gt;Person&lt;/code&gt; table. The final order of the &lt;code&gt;Person&lt;/code&gt; table &lt;strong&gt;does not matter&lt;/strong&gt;.&lt;/p&gt;


&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+-------------+---------+
| Column Name | Type |
+-------------+---------+
| id | int |
| email | varchar |
+-------------+---------+
id is the primary key (column with unique values) for this table.
Each row of this table contains an email. 
The emails will not contain uppercase letters.

&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Pandas
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Pandas_(software)"&gt;Pandas&lt;/a&gt; is a great Python tool for data analysis and manipulation. Built into that library is the &lt;a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.drop_duplicates.html"&gt;drop duplicates&lt;/a&gt; function. Please note that the problem statement asks us to do this &lt;a href="https://en.wikipedia.org/wiki/In-place_algorithm"&gt;in place&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Using the Pandas library this can be achieved by first in-place sorting by the &lt;code&gt;id&lt;/code&gt; field and then dropping the duplicates from &lt;code&gt;email&lt;/code&gt;. We want to keep at least the first duplicated element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;delete_duplicate_emails&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;person&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DataFrame&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort_values&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;by&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;inplace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drop_duplicates&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;subset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;email&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;keep&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;first&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;inplace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Voila! I love these simple questions.&lt;/p&gt;

&lt;h3&gt;
  
  
  SQL
&lt;/h3&gt;

&lt;p&gt;In SQL we want to run a delete query. We will grab two copies of the &lt;code&gt;person&lt;/code&gt; table and match them based on the &lt;code&gt;email&lt;/code&gt;. To keep at least one of the solutions we only delete the entry with the higher &lt;code&gt;id&lt;/code&gt; value. This keeps the &lt;code&gt;email&lt;/code&gt; associated with the smallest &lt;code&gt;id&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;DELETE&lt;/span&gt; &lt;span class="n"&gt;p1&lt;/span&gt; 
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;person&lt;/span&gt; &lt;span class="n"&gt;p1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;person&lt;/span&gt; &lt;span class="n"&gt;p2&lt;/span&gt; 
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;p1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;p1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As with many problems, there are multiple ways to solve them. These Pandas and SQL solutions are but one way of approaching the delete duplicate question.&lt;/p&gt;




&lt;p&gt;Originally published at &lt;a href="https://blog.seancoughlin.me"&gt;https://blog.seancoughlin.me&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>pandas</category>
      <category>sql</category>
      <category>leetcode</category>
    </item>
    <item>
      <title>Understanding Amazon Route 53: An In-depth Guide</title>
      <dc:creator>Sean Coughlin</dc:creator>
      <pubDate>Fri, 08 Sep 2023 14:46:40 +0000</pubDate>
      <link>https://dev.to/scc33/understanding-amazon-route-53-an-in-depth-guide-3ocf</link>
      <guid>https://dev.to/scc33/understanding-amazon-route-53-an-in-depth-guide-3ocf</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In today's cloud-centric world, one of the most crucial services often overlooked is the &lt;a href="https://en.wikipedia.org/wiki/Domain_Name_System"&gt;Domain Name System (DNS)&lt;/a&gt;. A robust DNS service is foundational to ensure that your web applications are scalable, secure, and highly available. One such leading service in this space is &lt;a href="https://aws.amazon.com/route53/"&gt;Amazon Route 53&lt;/a&gt;, part of &lt;a href="https://aws.amazon.com"&gt;Amazon Web Services (AWS)&lt;/a&gt;. This blog post aims to provide a comprehensive guide on what Amazon Route 53 is, its history, how it compares with other services and its myriad use cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;A Glimpse into the Past: The Background of Amazon Route 53&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Amazon launched &lt;a href="https://en.wikipedia.org/wiki/Amazon_Route_53"&gt;Route 53 in December 2010&lt;/a&gt;, and it has since become a cornerstone of AWS offerings. The name "Route 53" is a reference to &lt;a href="https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers"&gt;TCP and UDP port 53&lt;/a&gt;, where DNS server requests are addressed. Amazon created this service to provide an extremely reliable and cost-effective way to route end-user requests to various endpoints, such as an Amazon EC2 instance or an S3 bucket, in a globally distributed manner.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Does Route 53 Compare to Other Services?
&lt;/h2&gt;

&lt;p&gt;To truly understand the value that Amazon Route 53 brings to the table, it's useful to compare it to other comparable DNS services:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://cloud.google.com/dns"&gt;&lt;strong&gt;Google Cloud DNS&lt;/strong&gt;&lt;/a&gt;: This is Google Cloud's offering, designed to provide high-performance and premium networking.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://azure.microsoft.com/en-us/products/dns"&gt;&lt;strong&gt;Azure DNS&lt;/strong&gt;&lt;/a&gt;: Microsoft's DNS offering for Azure provides seamless integration with other Azure services.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.cloudflare.com"&gt;&lt;strong&gt;Cloudflare&lt;/strong&gt;&lt;/a&gt;: Apart from offering DNS services, Cloudflare provides a range of additional features, such as DDoS protection and CDN services.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.oracle.com/cloud/networking/dns/"&gt;&lt;strong&gt;Dyn&lt;/strong&gt;&lt;/a&gt;: Acquired by Oracle, Dyn offers a feature-rich DNS service that focuses particularly on performance and uptime.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://ns1.com"&gt;&lt;strong&gt;NS1&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;(IBM)&lt;/strong&gt;: A less conventional but highly flexible service that provides data-driven DNS routing capabilities.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Unveiling the Multiple Use Cases of Route 53
&lt;/h2&gt;

&lt;p&gt;Amazon Route 53 offers a plethora of functionalities that go beyond basic domain name registration and DNS routing. Below are some key use cases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Domain Name Management - Whether you want to register a new domain name or transfer an existing one, Route 53 has you covered. It offers domain registration services, including various domain name extensions such as &lt;code&gt;.com&lt;/code&gt;, &lt;code&gt;.org&lt;/code&gt;, and &lt;code&gt;.net&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;DNS Record Management - Route 53 provides a simple way to manage DNS records, including A Records, CNAMEs, and MX Records. You can point these to your preferred AWS resources easily through the AWS Management Console.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;blockquote&gt;
&lt;p&gt;Side note - &lt;a href="https://en.wikipedia.org/wiki/List_of_DNS_record_types"&gt;DNS record types&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A - maps a hostname to an IPv4 address&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AAAA - maps a hostname to an IPv6 address&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CNAME - maps a hostname to a hostname&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;MX - mail exchange servers&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Etc&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;




&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Health Checks and Monitoring - Amazon Route 53 can perform health checks on your application and its various components. If an endpoint becomes unavailable, Route 53 reroutes traffic to a healthy endpoint, ensuring high availability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Load Balancing - Route 53 integrates well with &lt;a href="https://aws.amazon.com/elasticloadbalancing/"&gt;AWS Load Balancers&lt;/a&gt;, enabling you to distribute incoming application traffic across multiple targets, such as EC2 instances, in multiple Availability Zones.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Geographical Routing - With geolocation routing, you can route traffic according to the geographic location of your users, optimizing latency and improving user experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Private DNS Records for AWS Resources - For internal AWS resources, Route 53 allows you to configure private DNS records, making internal routing simpler and more secure.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Advanced Application Routing - The service can also be used for advanced application-level routing, like &lt;a href="https://en.wikipedia.org/wiki/A/B_testing"&gt;A/B testing&lt;/a&gt; or &lt;a href="https://en.wikipedia.org/wiki/Bluegreen_deployment"&gt;blue-green deployments&lt;/a&gt;, through DNS queries.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Amazon Route 53 is more than just a DNS service; it's a complete cloud DNS web service designed for developers and businesses alike. From domain registration to advanced DNS routing techniques, Route 53 offers a suite of features that cater to different needs. Given its importance in the realm of cloud computing, having a good grasp of Amazon Route 53 is beneficial for anyone involved in web development, IT management, or cloud services.&lt;/p&gt;

&lt;p&gt;Whether you're just getting started with AWS or looking to optimize your existing cloud infrastructure, Route 53 is an invaluable tool that deserves a closer look.&lt;/p&gt;




&lt;p&gt;Originally published at &lt;a href="https://blog.seancoughlin.me"&gt;https://blog.seancoughlin.me&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>networking</category>
      <category>dns</category>
    </item>
    <item>
      <title>How to validate a Sudoku board</title>
      <dc:creator>Sean Coughlin</dc:creator>
      <pubDate>Thu, 07 Sep 2023 15:30:52 +0000</pubDate>
      <link>https://dev.to/scc33/how-to-validate-a-sudoku-board-46pb</link>
      <guid>https://dev.to/scc33/how-to-validate-a-sudoku-board-46pb</guid>
      <description>&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;With this article, I will be covering the &lt;a href="https://leetcode.com/problems/valid-sudoku/"&gt;valid sudoku Leetcode problem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Leetcode describes the problem with the following:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Determine if a &lt;code&gt;9 x 9&lt;/code&gt; Sudoku board is valid. Only the filled cells need to be validated &lt;strong&gt;according to the following rules&lt;/strong&gt; :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Each row must contain the digits &lt;code&gt;1-9&lt;/code&gt; without repetition.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Each column must contain the digits &lt;code&gt;1-9&lt;/code&gt; without repetition.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Each of the nine &lt;code&gt;3 x 3&lt;/code&gt; sub-boxes of the grid must contain the digits &lt;code&gt;1-9&lt;/code&gt; without repetition.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A Sudoku board (partially filled) could be valid but is not necessarily solvable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Only the filled cells need to be validated according to the mentioned rules.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;Leetcode ranks this problem as a medium. I think that is an appropriate rating. The solution is feasible but does require some out-of-the-box reasoning.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;isValidSudoku&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;board&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;seen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
                &lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;board&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                    &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;row&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="n"&gt;column&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;column&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="n"&gt;block&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;block&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;seen&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;seen&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;block&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
                    &lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Solution Description
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;seen = set()&lt;/code&gt;: Creates an empty set named &lt;code&gt;seen&lt;/code&gt; to keep track of numbers that have already appeared in rows, columns, and 3x3 blocks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Two nested loops &lt;code&gt;for i in range(9)&lt;/code&gt; and &lt;code&gt;for j in range(9)&lt;/code&gt; iterate through each cell of the 9x9 board.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;number = board[i][j]&lt;/code&gt;: Stores the current cell's value in the variable &lt;code&gt;number&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;if number != ".":&lt;/code&gt;: Checks if the cell is not empty (a dot indicates an empty cell in this context).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;row = str(number) + "row" + str(i)&lt;/code&gt;: Creates a string like &lt;code&gt;1row0&lt;/code&gt; to indicate that the number 1 is in row 0.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;column = str(number) + "column" + str(j)&lt;/code&gt;: Creates a string like &lt;code&gt;1column0&lt;/code&gt; to indicate that the number 1 is in column 0.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;block = str(number) + "block" + str(i / 3) + "/" + str(j/3)&lt;/code&gt;: Creates a string like &lt;code&gt;1block0/0&lt;/code&gt; to indicate that the number 1 is in the top-left 3x3 block.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;if row in seen or column in seen or block in seen:&lt;/code&gt;: Checks if any of these strings already exist in the &lt;code&gt;seen&lt;/code&gt; set. If so, the board is not valid and the function returns &lt;code&gt;False&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;seen.add(row)&lt;/code&gt;, &lt;code&gt;seen.add(column)&lt;/code&gt;, &lt;code&gt;seen.add(block)&lt;/code&gt;: Adds the newly created strings to the &lt;code&gt;seen&lt;/code&gt; set so that they can be checked against future cells.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If all cells are valid, the function returns &lt;code&gt;True&lt;/code&gt;, indicating a valid Sudoku board.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Big O Analysis
&lt;/h3&gt;

&lt;p&gt;Assuming &lt;code&gt;n&lt;/code&gt; is the side length. We have a double for-loop so that is at least &lt;code&gt;O(n^2)&lt;/code&gt;. Inside the nested loops, the operations (like adding to a set, creating strings, and checking for membership in a set) are &lt;code&gt;O(1)&lt;/code&gt; operations. Therefore, the overall runtime is &lt;code&gt;O(n^2)&lt;/code&gt;.&lt;/p&gt;




&lt;p&gt;Originally published at &lt;a href="https://blog.seancoughlin.me"&gt;https://blog.seancoughlin.me&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>leetcode</category>
      <category>algorithms</category>
      <category>interviewprep</category>
      <category>bigo</category>
    </item>
    <item>
      <title>How to Find First and Last Position of Element in Sorted Array</title>
      <dc:creator>Sean Coughlin</dc:creator>
      <pubDate>Tue, 05 Sep 2023 23:18:35 +0000</pubDate>
      <link>https://dev.to/scc33/how-to-find-first-and-last-position-of-element-in-sorted-array-d7f</link>
      <guid>https://dev.to/scc33/how-to-find-first-and-last-position-of-element-in-sorted-array-d7f</guid>
      <description>&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;With this article, I will be covering the &lt;a href="https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/"&gt;Find First and Last Position of an Element in a Sorted Array problem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Leetcode describes the problem with the following:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Given an array of integers &lt;code&gt;nums&lt;/code&gt; sorted in non-decreasing order, find the starting and ending position of a given &lt;code&gt;target&lt;/code&gt; value.&lt;/p&gt;

&lt;p&gt;If &lt;code&gt;target&lt;/code&gt; is not found in the array, return &lt;code&gt;[-1, -1]&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You must write an algorithm with &lt;code&gt;O(log n)&lt;/code&gt; runtime complexity.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Input: nums = [5,7,7,8,8,10], target = 8&lt;/p&gt;

&lt;p&gt;Output: [3,4]&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Leetcode ranks this problem as a medium. I think that is an appropriate rating. The solution is feasible but does require some algorithmic understanding.&lt;/p&gt;

&lt;h3&gt;
  
  
  Naive Approach and Its Limitations
&lt;/h3&gt;

&lt;p&gt;The naive approach for solving this problem would be to scan through the array linearly to find the first and last occurrence of the target value. This involves looping through the array once to find the first occurrence of the target and marking that index as the starting position, then looping through it again to find the last occurrence and marking that as the ending position.&lt;/p&gt;

&lt;p&gt;While this approach works, it takes &lt;code&gt;O(n)&lt;/code&gt; time to solve, which doesn't meet the constraint of &lt;code&gt;O(log n)&lt;/code&gt; runtime complexity. Therefore, it would become inefficient when dealing with large datasets.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;To achieve a runtime complexity of &lt;code&gt;O(log n)&lt;/code&gt;, we can use &lt;a href="https://en.wikipedia.org/wiki/Binary_search_algorithm"&gt;binary search&lt;/a&gt;. A binary search is possible because the array is already sorted. In this optimized approach, we will perform two binary searches:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Finding the Leftmost Position&lt;/strong&gt; : The first binary search will find the leftmost or the first occurrence of the target value.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Finding the Rightmost Position&lt;/strong&gt; : The second binary search will find the rightmost or the last occurrence of the target value.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here's how each binary search would work:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Leftmost Position&lt;/strong&gt; : Initialize &lt;code&gt;left&lt;/code&gt; to 0 and &lt;code&gt;right&lt;/code&gt; to &lt;code&gt;n - 1&lt;/code&gt; (where &lt;code&gt;n&lt;/code&gt; is the length of the array). In the while loop, calculate the middle index as &lt;code&gt;(left + right) // 2&lt;/code&gt;. If &lt;code&gt;target &amp;gt; nums[mid]&lt;/code&gt;, set &lt;code&gt;left = mid + 1&lt;/code&gt;. Otherwise, set &lt;code&gt;right = mid - 1&lt;/code&gt;. After the loop, check if &lt;code&gt;nums[left]&lt;/code&gt; is the target to confirm.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Rightmost Position&lt;/strong&gt; : Initialize &lt;code&gt;left&lt;/code&gt; to 0 and &lt;code&gt;right&lt;/code&gt; to &lt;code&gt;n - 1&lt;/code&gt; again. This time, if &lt;code&gt;target &amp;gt;= nums[mid]&lt;/code&gt;, set &lt;code&gt;left = mid + 1&lt;/code&gt;. Otherwise, set &lt;code&gt;right = mid - 1&lt;/code&gt;. After the loop, check if &lt;code&gt;nums[right]&lt;/code&gt; is the target to confirm.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finally return [-1, -1] if the location of the left and right position overlap.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Notice that the key difference between the left and right searches is the use of the greater than or equal to check on the right search.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Solution&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;object&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;searchRange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;left&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
        &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; 
                &lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
            &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
                &lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
        &lt;span class="n"&gt;left_to_return&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;left&lt;/span&gt;

        &lt;span class="n"&gt;left&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
        &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; 
                &lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
            &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
                &lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;left_to_return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nf"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;left_to_return&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Time Complexity
&lt;/h3&gt;

&lt;p&gt;Each binary search has a time complexity of &lt;code&gt;O(log n)&lt;/code&gt;, and since we are performing two binary searches, the overall time complexity remains &lt;code&gt;O(log n)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This optimized approach not only meets the problem's algorithmic constraint but also efficiently finds the target's starting and ending positions in the array.&lt;/p&gt;




&lt;p&gt;Originally published at &lt;a href="https://blog.seancoughlin.me"&gt;https://blog.seancoughlin.me&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>leetcode</category>
      <category>binarysearch</category>
      <category>interviewprep</category>
    </item>
    <item>
      <title>UIUC MCS - CS 513 Review - Theory and Practice of Data Cleaning</title>
      <dc:creator>Sean Coughlin</dc:creator>
      <pubDate>Tue, 05 Sep 2023 02:45:31 +0000</pubDate>
      <link>https://dev.to/scc33/uiuc-mcs-cs-513-review-theory-and-practice-of-data-cleaning-f0n</link>
      <guid>https://dev.to/scc33/uiuc-mcs-cs-513-review-theory-and-practice-of-data-cleaning-f0n</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;TLDR:&lt;/strong&gt; 513 won't teach you very much, and what you will learn is highly outdated, but it's an easy 500-level course.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Difficulty:&lt;/strong&gt; Very easy&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Opinion:&lt;/strong&gt; Disliked&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Weekly workload:&lt;/strong&gt; 2 hours&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Semester:&lt;/strong&gt; Summer 2023&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Class Content
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Lecture Content
&lt;/h3&gt;

&lt;p&gt;Every week consisted of about an hour of lectures. The topics covered included data validation, profiling, relational models, &lt;a href="https://en.wikipedia.org/wiki/Datalog"&gt;Datalog&lt;/a&gt;, &lt;a href="https://en.wikipedia.org/wiki/SQL"&gt;SQL&lt;/a&gt;, Workflows, &lt;a href="https://en.wikipedia.org/wiki/Provenance#Computer_science"&gt;Provenance&lt;/a&gt;, and &lt;a href="https://github.com/yesworkflow-org"&gt;YesWorkflow&lt;/a&gt;. I could not figure out exactly when these lectures were recorded, but I'm guessing they are close to a decade old. Ideally, they should all be rerecorded at this point and factor in newer material.&lt;/p&gt;

&lt;p&gt;I'm not sure why the course title includes 'theory' as the lectures focused entirely on data-cleaning practices. But each week had links to data cleaning papers, and those contained good resources. A diligent student who consumes all those external papers could learn a lot and cover a lot of theory ground. The course doesn't have any mechanism for enforcing reading.&lt;/p&gt;

&lt;h3&gt;
  
  
  Assignments
&lt;/h3&gt;

&lt;p&gt;As with most MCS courses, there were weekly quizzes. The quizzes allowed for unlimited attempts and never took more than a few minutes to complete.&lt;/p&gt;

&lt;p&gt;There were six homework assignments. In order they were Regular Expressions, &lt;a href="https://openrefine.org"&gt;OpenRefine&lt;/a&gt;, &lt;a href="https://en.wikipedia.org/wiki/Datalog"&gt;Datalog&lt;/a&gt;, SQL, Provenance, and Python. None of these assignments took more than two to three hours to complete. They all were basic implementation and programming assignments with autograders.&lt;/p&gt;

&lt;p&gt;The class did not have any exams. Instead, it concluded with a two-phase group project. Groups consisted of three people. The setup of the project did not require much collaboration, and my team corresponded entirely over Teams messages without any synchronous meetings.&lt;/p&gt;

&lt;p&gt;The project required cleaning some given datasets. Then you had to write a paper analyzing essentially how dirty the dataset was before and how much you were able to clean or improve it through your process. You also had to submit documentation about your cleaning process and write up some potential benefits of the cleaning. There was not any difficulty with the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Takeaways
&lt;/h2&gt;

&lt;p&gt;This class is ridiculously easy. It does not feel adequate at the graduate level and certainly should not be a 500-level course. I can see how many would be disappointed by the lack of rigor in what is an otherwise challenging program. If you are paying by the credit hour, it makes sense that you would want a considerable knowledge return on investment. I simply don't think this class offers that.&lt;/p&gt;

&lt;p&gt;I think the biggest disappointment is data cleaning is a crucial skill for all data science or software engineer jobs. The content is so important that the class deserves to be good! If the content was updated and some of the assignments swapped this class could be something special. Unfortunately, the execution is not there right now.&lt;/p&gt;

&lt;p&gt;All that being said, there are not many 500-level options, so you will probably need to take this class. Additionally, the low difficulty did make for a very well-balanced semester when paired with &lt;a href="https://dev.to/scc33/uiuc-mcs-cs-416-review-data-visualization-1897"&gt;CS 416&lt;/a&gt;. I would recommend pairing this class with something else, and you'll still have a decently challenging semester.&lt;/p&gt;

&lt;h3&gt;
  
  
  Banner Credit
&lt;/h3&gt;

&lt;p&gt;The banner was generated using the &lt;a href="https://d7.cs.illinois.edu/projects/linkedin-banner-image/"&gt;&lt;strong&gt;UIUC LinkedIn Banner Generator&lt;/strong&gt;&lt;/a&gt;. It is an awesome tool if you need an Illinois-themed banner for anything.&lt;/p&gt;

&lt;h3&gt;
  
  
  More Reviews
&lt;/h3&gt;

&lt;p&gt;Check out &lt;a href="http://uiucmcs.org"&gt;&lt;strong&gt;uiucmcs.org&lt;/strong&gt;&lt;/a&gt; for more reviews of MCS courses. I don't know who maintains this site, but it's a good review collection from many semesters.&lt;/p&gt;

&lt;p&gt;I have also written up a &lt;a href="https://dev.to/scc33/uiuc-mcs-cs-427-review-software-engineering-3cbo"&gt;&lt;strong&gt;CS 427 review&lt;/strong&gt;&lt;/a&gt;, a &lt;a href="https://dev.to/scc33/uiuc-mcs-cs-435-review-cloud-computer-networking-58c5"&gt;&lt;strong&gt;CS 435 review&lt;/strong&gt;&lt;/a&gt;, a &lt;a href="https://dev.to/scc33/uiuc-mcs-cs-498-review-cloud-computing-applications-b6i"&gt;CS 498 Cloud Computing review&lt;/a&gt;, and a &lt;a href="https://dev.to/scc33/uiuc-mcs-cs-416-review-data-visualization-1897"&gt;CS 416 review&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;Originally published at &lt;a href="https://blog.seancoughlin.me"&gt;https://blog.seancoughlin.me&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>datacleaning</category>
      <category>univerity</category>
      <category>uiuc</category>
    </item>
    <item>
      <title>UIUC MCS - CS 416 Review - Data Visualization</title>
      <dc:creator>Sean Coughlin</dc:creator>
      <pubDate>Tue, 05 Sep 2023 01:51:05 +0000</pubDate>
      <link>https://dev.to/scc33/uiuc-mcs-cs-416-review-data-visualization-1897</link>
      <guid>https://dev.to/scc33/uiuc-mcs-cs-416-review-data-visualization-1897</guid>
      <description>&lt;p&gt;Computer Science 416 covers computer graphics, psychology, and human perception.&lt;/p&gt;

&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;TLDR:&lt;/strong&gt; &lt;a href="https://courses.illinois.edu/schedule/terms/CS/416"&gt;416&lt;/a&gt; is a fun, laid-back class with two major assignments, a midterm, and a final. I had fun and did not have to stress very much.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Difficulty:&lt;/strong&gt; Easy&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Opinion:&lt;/strong&gt; Enjoyed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Weekly workload:&lt;/strong&gt; 5 hours&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Semester:&lt;/strong&gt; Summer 2023&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Class Content
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Lecture Content
&lt;/h3&gt;

&lt;p&gt;The course had weekly lectures. Topics included data types, human perception, psychology, integrating data into web pages, interactive visualization, narrative visualization, and declarative visualizations. There were one to two hours of lectures per week. The lectures could easily be watched at 1.5 speed if necessary.&lt;/p&gt;

&lt;p&gt;I found the lectures to be a nice change of pace from many other computer science courses. They covered technical concepts but focused on humans and how to design for people. For example, there were a few videos on optical illusions. The optical illusions were used to introduce various quirks of the human eye and how to design visualizations that leveraged those human features.&lt;/p&gt;

&lt;h3&gt;
  
  
  Assignments
&lt;/h3&gt;

&lt;p&gt;Every week of the course had an associated quiz. The quizzes were all released ahead of schedule which made time management a breeze. Thankfully, each quiz could be taken as many times as desired, so this was a nice review and an easy class grade.&lt;/p&gt;

&lt;p&gt;The class also had two major projects. The first was a visualization dashboard that you had to build with Tableau. The second was a narrative visualization website that had to be built with HTML/CSS/JavaScript and the D3 library.&lt;/p&gt;

&lt;p&gt;For the first project, you were required to create a dashboard that synthesized multiple datasets, visualized at least two charts, and supported cross-filtering between the charts. Students could choose to visualize any dataset of their pleasure and the assignment parameters were fairly broad so you could get pretty creative with the implementation.&lt;/p&gt;

&lt;p&gt;I know Tableau is incredibly common among data scientists and those working in analytical jobs. I work as a software engineer for my day-to-day job. My role does not require Tableau so the visualization dashboard project was my first introduction to the tool. I think this assignment was a good introduction and very approachable. I completed it over the course of two nights.&lt;/p&gt;

&lt;p&gt;The second project was more involved. You were required to analyze some dataset, find a story in that data, then build a website using plain JavasScript with multiple pages telling that story, and finally write a report afterward describing everything. It was a lot. I still felt like it was a good project, but it took some serious effort to complete.&lt;/p&gt;

&lt;h3&gt;
  
  
  Exams
&lt;/h3&gt;

&lt;p&gt;The course had one midterm and a final. The exams were non-cumulative and relatively easy for multiple choice. Each exam was about 20 questions, proctored, and you had one hour to complete it.&lt;/p&gt;

&lt;p&gt;Each exam was administered through ProctorU. ProctorU has always been a nemesis of mine, and this semester only got worse. We were forced to use a &lt;a href="https://en.wikipedia.org/wiki/Chromium_(web_browser)"&gt;Chromium&lt;/a&gt;-based browser called &lt;a href="https://guardian.meazurelearning.com"&gt;Guardian&lt;/a&gt;. Guardian is easily one of the worst pieces of software I've ever used. It frequently crashes, and I hate downloading that type of spyware to my machine. Unfortunately, there was no other way to take the exams.&lt;/p&gt;

&lt;p&gt;Exams were quick and easy. I'm to the point in my educational career where I'm tired of studying and taking exams. I appreciate that this course emphasized the projects over the exams.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Takeaways
&lt;/h2&gt;

&lt;p&gt;I think this class could be really useful for anyone interested in pursuing analyst or data science-type roles. This content feels fundamental and very relevant for those roles.&lt;/p&gt;

&lt;p&gt;As a software engineer, I didn't find many takeaways that would be useful in my current job. However, I still had a really good time in this class. The assignments were well-constructed, the lectures were novel, and the projects were fairly useful.&lt;/p&gt;

&lt;p&gt;If you're interested in a class that focuses on the softer side of computer science, I would highly recommend this course.&lt;/p&gt;

&lt;h3&gt;
  
  
  Banner Credit
&lt;/h3&gt;

&lt;p&gt;The banner was generated using the &lt;a href="https://d7.cs.illinois.edu/projects/linkedin-banner-image/"&gt;&lt;strong&gt;UIUC LinkedIn Banner Generator&lt;/strong&gt;&lt;/a&gt;. It is an awesome tool if you need an Illinois-themed banner for anything.&lt;/p&gt;

&lt;h3&gt;
  
  
  More Reviews
&lt;/h3&gt;

&lt;p&gt;Check out &lt;a href="http://uiucmcs.org"&gt;&lt;strong&gt;uiucmcs.org&lt;/strong&gt;&lt;/a&gt; for more reviews of MCS courses. I don't know who maintains this site, but it's a good review collection from many semesters.&lt;/p&gt;

&lt;p&gt;I have also written up a &lt;a href="https://dev.to/scc33/uiuc-mcs-cs-427-review-software-engineering-3cbo"&gt;&lt;strong&gt;CS 427 review&lt;/strong&gt;&lt;/a&gt;, &lt;a href="https://dev.to/scc33/uiuc-mcs-cs-435-review-cloud-computer-networking-58c5"&gt;&lt;strong&gt;CS 435 review&lt;/strong&gt;&lt;/a&gt;, and &lt;a href="https://dev.to/scc33/uiuc-mcs-cs-498-review-cloud-computing-applications-b6i"&gt;CS 498 Cloud Computing review&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;Originally published at &lt;a href="https://blog.seancoughlin.me"&gt;https://blog.seancoughlin.me&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>uiuc</category>
      <category>review</category>
      <category>datavis</category>
    </item>
  </channel>
</rss>
