<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Articles on Andrew Odendaal</title>
    <link>https://andrewodendaal.com/articles/</link>
    <description>Recent content in Articles on Andrew Odendaal</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 01 Apr 2026 08:00:00 +0400</lastBuildDate>
    <atom:link href="https://andrewodendaal.com/articles/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>AWS Step Functions: Orchestrating Complex Workflows</title>
      <link>https://andrewodendaal.com/aws-step-functions-orchestrating-complex-workflows/</link>
      <pubDate>Wed, 01 Apr 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/aws-step-functions-orchestrating-complex-workflows/</guid>
      <description>&lt;p&gt;I deleted roughly 2,000 lines of orchestration code from our payment processing service last year. Replaced it with about 200 lines of Amazon States Language JSON. The system got more reliable, not less. That&amp;rsquo;s the short version of why I think Step Functions is one of the most underappreciated services in AWS.&lt;/p&gt;&#xA;&lt;p&gt;The longer version involves a 3am incident, a chain of Lambda functions calling each other through direct invocation, and a payment that got charged twice because nobody could tell where the workflow had actually failed.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Terraform Testing: Unit, Integration, and End-to-End</title>
      <link>https://andrewodendaal.com/terraform-testing-unit-integration-e2e/</link>
      <pubDate>Sat, 28 Mar 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/terraform-testing-unit-integration-e2e/</guid>
      <description>&lt;p&gt;Most Terraform code has zero tests. That&amp;rsquo;s insane for something managing production infrastructure. We wouldn&amp;rsquo;t ship application code without tests — why do we treat the thing that creates our VPCs, databases, and IAM roles like it&amp;rsquo;s somehow less important?&lt;/p&gt;&#xA;&lt;p&gt;I learned this lesson the painful way. Last year I pushed a Terraform change that modified a security group rule on a shared networking stack. The plan looked clean. Added an ingress rule, removed an old one. Terraform showed exactly two changes. I approved it, applied it, and went to lunch. By the time I got back, three services were down. The &amp;ldquo;old&amp;rdquo; rule I removed was the one allowing traffic between our application tier and the database subnet. The plan was technically correct — it did exactly what I told it to. But I&amp;rsquo;d told it the wrong thing, and nothing in our pipeline caught it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Distributed Tracing with OpenTelemetry: A Complete Guide</title>
      <link>https://andrewodendaal.com/distributed-tracing-opentelemetry-complete-guide/</link>
      <pubDate>Wed, 25 Mar 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/distributed-tracing-opentelemetry-complete-guide/</guid>
      <description>&lt;p&gt;I spent four hours on a Tuesday night debugging a 30-second API call. Four hours. The call touched 12 services — auth, inventory, pricing, three different caching layers, a recommendation engine, two legacy adapters, and a handful of internal APIs that nobody remembered writing. Logs told me nothing useful. Metrics showed elevated latency somewhere in the pricing path, but &amp;ldquo;somewhere&amp;rdquo; isn&amp;rsquo;t actionable at 11pm when your on-call phone won&amp;rsquo;t stop buzzing.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Container Security Scanning in CI/CD Pipelines</title>
      <link>https://andrewodendaal.com/container-security-scanning-cicd-pipelines/</link>
      <pubDate>Sat, 21 Mar 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/container-security-scanning-cicd-pipelines/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;re not scanning container images before they hit production, it&amp;rsquo;s only a matter of time before something ugly shows up in your environment. I learned this the hard way, and I&amp;rsquo;m going to walk you through exactly how I set up container security scanning in CI/CD pipelines so you don&amp;rsquo;t repeat my mistakes.&lt;/p&gt;&#xA;&lt;h3 id=&#34;the-wake-up-call&#34;&gt;The Wake-Up Call&lt;/h3&gt;&#xA;&lt;p&gt;About two years ago, I was running a handful of microservices on ECS. Everything was humming along. Deployments were smooth, monitoring looked clean, the team was shipping features weekly. Life was good.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AWS EventBridge: Building Event-Driven Architectures</title>
      <link>https://andrewodendaal.com/aws-eventbridge-event-driven-architectures/</link>
      <pubDate>Tue, 17 Mar 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/aws-eventbridge-event-driven-architectures/</guid>
      <description>&lt;p&gt;EventBridge is the most underused AWS service. I&amp;rsquo;ll die on that hill. Teams will build these elaborate Rube Goldberg machines out of SNS topics, SQS queues, and Lambda functions stitched together with duct tape and prayers, when EventBridge would&amp;rsquo;ve given them a cleaner architecture in a fraction of the time.&lt;/p&gt;&#xA;&lt;p&gt;I know this because I was one of those teams. About two years ago I inherited a system where a single order placement triggered a cascade of 14 SNS topics fanning out to 23 SQS queues. Nobody could tell me what happened when an order was placed without opening a spreadsheet. A spreadsheet. For message routing. When I asked why they hadn&amp;rsquo;t used EventBridge, the answer was &amp;ldquo;we started before it existed and never migrated.&amp;rdquo; Fair enough. But the pain was real — we&amp;rsquo;d get phantom duplicate processing, messages landing in DLQs with no context about where they came from, and debugging meant grepping through six different CloudWatch log groups hoping to find a correlation ID someone remembered to pass along.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python Performance Optimization: Profiling and Tuning Guide</title>
      <link>https://andrewodendaal.com/python-performance-optimization-profiling-tuning/</link>
      <pubDate>Sat, 14 Mar 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/python-performance-optimization-profiling-tuning/</guid>
      <description>&lt;p&gt;Don&amp;rsquo;t optimize until you&amp;rsquo;ve profiled. I&amp;rsquo;ve watched teams rewrite entire modules that weren&amp;rsquo;t even the bottleneck. Weeks of work, zero measurable improvement. The code was &amp;ldquo;cleaner&amp;rdquo; I guess, but the endpoint was still slow because the actual problem was three database queries hiding inside a template tag.&lt;/p&gt;&#xA;&lt;p&gt;I learned this the hard way on a Django project a couple of years back. We had a view that took 4+ seconds to render. The team was convinced it was the serialization layer — we were building a big nested JSON response, lots of related objects. Someone had already started rewriting the serializers when I asked if anyone had actually profiled it. Blank stares.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes Operators: Building Custom Controllers in Go</title>
      <link>https://andrewodendaal.com/kubernetes-operators-custom-controllers-go/</link>
      <pubDate>Tue, 10 Mar 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/kubernetes-operators-custom-controllers-go/</guid>
      <description>&lt;p&gt;Operator SDK vs kubebuilder — I pick kubebuilder every time. Operator SDK wraps kubebuilder anyway, adds a layer of abstraction that mostly just gets in the way, and the documentation lags behind. Kubebuilder gives you the scaffolding, the code generation, and then gets out of your face. That&amp;rsquo;s what I want from a framework.&lt;/p&gt;&#xA;&lt;p&gt;I built my first operator about two years ago. The task: automate database provisioning for development teams. Every time a team needed a new PostgreSQL instance, they&amp;rsquo;d file a Jira ticket, wait for the platform team to provision it, get credentials back in a Slack DM (yes, really), and manually configure their app. The whole cycle took three to five days. Sometimes longer if someone was on leave.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust Error Handling Patterns for Production Applications</title>
      <link>https://andrewodendaal.com/rust-error-handling-patterns-production/</link>
      <pubDate>Sat, 07 Mar 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-error-handling-patterns-production/</guid>
      <description>&lt;p&gt;I got paged at 3am on a Tuesday because a Rust service I&amp;rsquo;d deployed two weeks earlier crashed hard. No graceful degradation, no useful error message in the logs. Just a panic backtrace pointing at line 247 of our config parser: &lt;code&gt;.unwrap()&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The config file had a trailing comma that our test fixtures didn&amp;rsquo;t cover. One &lt;code&gt;.unwrap()&lt;/code&gt; on a &lt;code&gt;serde_json::from_str&lt;/code&gt; call, and the whole service went down. I sat there in the dark, laptop balanced on my knees, fixing a one-line bug that should never have made it past code review.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AWS CDK vs Terraform: A Practical Comparison in 2026</title>
      <link>https://andrewodendaal.com/aws-cdk-vs-terraform-practical-comparison-2026/</link>
      <pubDate>Tue, 03 Mar 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/aws-cdk-vs-terraform-practical-comparison-2026/</guid>
      <description>&lt;p&gt;I use both. Terraform for multi-cloud, CDK when it&amp;rsquo;s pure AWS and the team knows TypeScript. That&amp;rsquo;s the short answer. But the long answer has a lot more nuance, and I&amp;rsquo;ve earned that nuance the hard way — including one migration that nearly broke a team&amp;rsquo;s shipping cadence for two months.&lt;/p&gt;&#xA;&lt;p&gt;This isn&amp;rsquo;t a &amp;ldquo;which one is better&amp;rdquo; post. I don&amp;rsquo;t think that question makes sense without context. What I can tell you is where each tool shines, where each one will bite you, and how to pick the right one for your situation in 2026. I&amp;rsquo;ve shipped production infrastructure with both, maintained both in anger, and migrated between them. Here&amp;rsquo;s what I&amp;rsquo;ve learned.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Platform Engineering: Building an Internal Developer Platform</title>
      <link>https://andrewodendaal.com/platform-engineering-internal-developer-platform/</link>
      <pubDate>Sat, 28 Feb 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/platform-engineering-internal-developer-platform/</guid>
      <description>&lt;p&gt;Platform engineering is DevOps done right. Or maybe it&amp;rsquo;s DevOps with a product mindset. Either way, it&amp;rsquo;s the recognition that telling every team to &amp;ldquo;own their own infrastructure&amp;rdquo; without giving them decent tooling is a recipe for chaos. I&amp;rsquo;ve watched organisations try the &amp;ldquo;you build it, you run it&amp;rdquo; approach and end up with fifteen different ways to deploy a container, nine half-configured Terraform repos, and developers who spend more time fighting YAML than writing features.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes Horizontal Pod Autoscaling with Custom Metrics</title>
      <link>https://andrewodendaal.com/kubernetes-hpa-custom-metrics-autoscaling/</link>
      <pubDate>Wed, 25 Feb 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/kubernetes-hpa-custom-metrics-autoscaling/</guid>
      <description>&lt;p&gt;CPU-based autoscaling is a lie for most web services. There, I said it.&lt;/p&gt;&#xA;&lt;p&gt;I spent a painful week last year watching an HPA scale our API pods from 3 to 15 based on CPU utilization. The dashboards looked great — CPU was being &amp;ldquo;managed.&amp;rdquo; Meanwhile, the service was falling over because every single one of those 15 pods was fighting over a connection pool limited to 50 database connections. More pods made the problem worse. We were autoscaling ourselves into an outage.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Go Concurrency Patterns for Microservices</title>
      <link>https://andrewodendaal.com/go-concurrency-patterns-microservices/</link>
      <pubDate>Sat, 21 Feb 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/go-concurrency-patterns-microservices/</guid>
      <description>&lt;p&gt;Goroutines are cheap. Goroutine leaks are not.&lt;/p&gt;&#xA;&lt;p&gt;I learned this the hard way at 2am on a Tuesday, staring at Grafana dashboards showing one of our services consuming 40GB of RAM and climbing. The service normally sat around 500MB. We&amp;rsquo;d shipped a change three days earlier — a seemingly innocent fan-out pattern to parallelize calls to a downstream API. The code looked fine. Reviews passed. Tests passed. What we&amp;rsquo;d missed was that when the downstream service timed out, nothing was cancelling the spawned goroutines. They just&amp;hellip; accumulated. Thousands per minute, each holding onto its request body and response buffer, waiting for a context that would never expire because we&amp;rsquo;d used &lt;code&gt;context.Background()&lt;/code&gt; instead of propagating the parent context.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Implementing Zero-Trust Networking on AWS</title>
      <link>https://andrewodendaal.com/implementing-zero-trust-networking-aws/</link>
      <pubDate>Wed, 18 Feb 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/implementing-zero-trust-networking-aws/</guid>
      <description>&lt;p&gt;VPNs are not zero trust. Stop calling them that.&lt;/p&gt;&#xA;&lt;p&gt;I can&amp;rsquo;t count how many times I&amp;rsquo;ve sat in architecture reviews where someone points at a Site-to-Site VPN or a Client VPN endpoint and says &amp;ldquo;we&amp;rsquo;re zero trust.&amp;rdquo; No. You&amp;rsquo;ve built a tunnel. A tunnel that, once you&amp;rsquo;re inside, gives you access to everything on the network. That&amp;rsquo;s the opposite of zero trust. That&amp;rsquo;s a castle with a drawbridge and nothing inside but open hallways.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python Type Hints and Static Analysis in Production Codebases</title>
      <link>https://andrewodendaal.com/python-type-hints-static-analysis-production/</link>
      <pubDate>Sat, 14 Feb 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/python-type-hints-static-analysis-production/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;re writing Python without type hints in 2026, you&amp;rsquo;re making life harder for everyone — including future you. I held out for a while. I liked Python&amp;rsquo;s flexibility, the duck typing, the &amp;ldquo;we&amp;rsquo;re all consenting adults here&amp;rdquo; philosophy. Then a production bug cost my team three days of debugging, and I changed my mind permanently.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m going to walk through how I&amp;rsquo;ve adopted type hints across production codebases, the tooling that makes it practical, and the patterns that actually matter versus the ones that are just academic noise.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AWS Cost Optimization: 15 Techniques That Actually Work</title>
      <link>https://andrewodendaal.com/aws-cost-optimization-techniques-that-work/</link>
      <pubDate>Tue, 10 Feb 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/aws-cost-optimization-techniques-that-work/</guid>
      <description>&lt;p&gt;I got a call from a startup founder last year. &amp;ldquo;Our AWS bill just hit $47,000 and we have twelve engineers.&amp;rdquo; They&amp;rsquo;d been running for about eighteen months, never really looked at the bill, and suddenly it was eating their runway. I spent a week inside their account. We cut it to $28,000. That&amp;rsquo;s a 40% reduction, and honestly most of it was embarrassingly obvious stuff.&lt;/p&gt;&#xA;&lt;p&gt;That experience crystallized something I&amp;rsquo;d been thinking about for a while: most AWS cost problems aren&amp;rsquo;t sophisticated. They&amp;rsquo;re neglect. People provision things, forget about them, and the meter keeps running. The fixes aren&amp;rsquo;t glamorous either — they&amp;rsquo;re methodical, sometimes tedious, and they work.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes RBAC Deep Dive: Securing Multi-Tenant Clusters</title>
      <link>https://andrewodendaal.com/kubernetes-rbac-deep-dive-multi-tenant-clusters/</link>
      <pubDate>Sat, 07 Feb 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/kubernetes-rbac-deep-dive-multi-tenant-clusters/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m going to say something that&amp;rsquo;ll upset people: if your developers have cluster-admin access in production, you&amp;rsquo;re running on borrowed time. I don&amp;rsquo;t care how small your team is. I don&amp;rsquo;t care if &amp;ldquo;everyone&amp;rsquo;s responsible.&amp;rdquo; It&amp;rsquo;s insane, and I&amp;rsquo;ve got the scars to prove it.&lt;/p&gt;&#xA;&lt;p&gt;This article is the RBAC deep dive I wish I&amp;rsquo;d had before a developer on my team ran &lt;code&gt;kubectl delete namespace production-api&lt;/code&gt; on a Friday afternoon. Not maliciously. He thought he was pointed at his local minikube. He wasn&amp;rsquo;t. That namespace had 14 services, and we spent the weekend rebuilding it from manifests that were — let&amp;rsquo;s be generous — &amp;ldquo;mostly&amp;rdquo; up to date.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Terraform Modules: Design Patterns for Reusable Infrastructure</title>
      <link>https://andrewodendaal.com/terraform-modules-design-patterns-reusable-infrastructure/</link>
      <pubDate>Tue, 03 Feb 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/terraform-modules-design-patterns-reusable-infrastructure/</guid>
      <description>&lt;p&gt;I once inherited a project with a single &lt;code&gt;main.tf&lt;/code&gt; that was over 3,000 lines long. No modules. No abstractions. Just one enormous file that deployed an entire production environment — VPCs, ECS clusters, RDS instances, Lambda functions, IAM roles — all jammed together with hardcoded values and copy-pasted blocks. Changing a security group rule meant scrolling for five minutes and praying you edited the right resource. It was, without exaggeration, the worst Terraform I&amp;rsquo;ve ever seen.&lt;/p&gt;</description>
    </item>
    <item>
      <title>GitOps with ArgoCD: From Zero to Production</title>
      <link>https://andrewodendaal.com/gitops-argocd-zero-to-production/</link>
      <pubDate>Sat, 31 Jan 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/gitops-argocd-zero-to-production/</guid>
      <description>&lt;p&gt;ArgoCD won the GitOps war. I&amp;rsquo;ll say it. Flux is fine—it works, it&amp;rsquo;s CNCF graduated, it has its fans—but ArgoCD&amp;rsquo;s UI alone makes it worth choosing. When something&amp;rsquo;s out of sync at 2am, I don&amp;rsquo;t want to be parsing CLI output. I want to click on a resource tree and see exactly what drifted.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve been running ArgoCD in production across multiple clusters for a couple of years now, and this is the guide I wish I&amp;rsquo;d had when I started. We&amp;rsquo;ll go from a fresh install to a production-grade setup with app-of-apps, RBAC, SSO, multi-cluster management, and sane sync policies.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust for Cloud Engineers: Why Systems Programming Matters</title>
      <link>https://andrewodendaal.com/rust-for-cloud-engineers-systems-programming/</link>
      <pubDate>Tue, 27 Jan 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-for-cloud-engineers-systems-programming/</guid>
      <description>&lt;p&gt;I started learning Rust as someone who&amp;rsquo;d spent years writing Python scripts and Go services for cloud infrastructure. My first reaction was honestly frustration — the borrow checker felt like a compiler that existed purely to reject my code. But something kept pulling me back. The binaries were tiny. The startup times were instant. And once my code compiled, it just&amp;hellip; worked. No runtime panics at 3am. No mysterious memory leaks creeping up after a week in production.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AWS ECS vs EKS: Choosing the Right Container Orchestrator in 2026</title>
      <link>https://andrewodendaal.com/aws-ecs-vs-eks-choosing-container-orchestrator-2026/</link>
      <pubDate>Sat, 24 Jan 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/aws-ecs-vs-eks-choosing-container-orchestrator-2026/</guid>
      <description>&lt;p&gt;ECS is underrated. Most teams picking EKS don&amp;rsquo;t need it. I&amp;rsquo;ve been saying this for years, and I&amp;rsquo;ll keep saying it until the industry stops treating Kubernetes as the default answer to every container question.&lt;/p&gt;&#xA;&lt;p&gt;I watched a team — smart engineers, solid product — choose EKS for what was essentially a three-service CRUD application behind an ALB. They&amp;rsquo;d read the blog posts, watched the conference talks, and decided Kubernetes was the future. Three months later they were still stabilizing the cluster. Not building features. Not shipping value. Debugging Helm chart conflicts, fighting with the AWS VPC CNI plugin, and trying to understand why their pods kept getting evicted. The application itself worked fine. The orchestration layer was the problem.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building Production-Ready Docker Images: A Multi-Stage Build Guide</title>
      <link>https://andrewodendaal.com/building-production-ready-docker-images-multi-stage/</link>
      <pubDate>Tue, 20 Jan 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/building-production-ready-docker-images-multi-stage/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve shipped Docker images to production for years now, and the single biggest improvement I&amp;rsquo;ve made wasn&amp;rsquo;t some fancy orchestration tool or a new CI platform. It was learning to write proper multi-stage Dockerfiles. My CI pipeline used to spend 20 minutes rebuilding a bloated 2GB image every push. After switching to multi-stage builds, that image dropped to 45MB and builds finished in under 3 minutes. That&amp;rsquo;s not a typo.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python Async Programming: asyncio, Tasks, and Real-World Patterns</title>
      <link>https://andrewodendaal.com/python-async-programming-asyncio-patterns/</link>
      <pubDate>Fri, 16 Jan 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/python-async-programming-asyncio-patterns/</guid>
      <description>&lt;p&gt;I avoided asyncio for years. Callbacks, event loops, futures — it all felt like unnecessary complexity when threads worked fine. Then we had an API endpoint making 200 sequential HTTP calls to an upstream service. 45 seconds per request. We threw asyncio.gather at it and the whole thing dropped to 3 seconds. That was the moment it clicked.&lt;/p&gt;&#xA;&lt;p&gt;Python&amp;rsquo;s async story has matured enormously. What used to be a mess of &lt;code&gt;yield from&lt;/code&gt; and manual loop management is now clean, readable, and genuinely powerful. If you&amp;rsquo;ve been putting off learning asyncio properly, this is the guide I wish I&amp;rsquo;d had.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes Network Policies: A Practical Security Guide</title>
      <link>https://andrewodendaal.com/kubernetes-network-policies-practical-security-guide/</link>
      <pubDate>Mon, 12 Jan 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/kubernetes-network-policies-practical-security-guide/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m going to be blunt here. If you&amp;rsquo;re running Kubernetes without network policies, every pod in your cluster can talk to every other pod. That&amp;rsquo;s a flat network. It&amp;rsquo;s terrifying.&lt;/p&gt;&#xA;&lt;p&gt;I learned this the hard way. A few years back, a compromised container in our staging namespace made a direct TCP connection to the production PostgreSQL pod. No firewall, no segmentation, nothing stopping it. The attacker didn&amp;rsquo;t even need to be clever — they just scanned the internal network and found an open port. We had &lt;a href=&#34;https://andrewodendaal.com/kubernetes-pod-security-policies&#34;&gt;pod security policies&lt;/a&gt; in place, RBAC locked down, image scanning, the works. But zero network policies. That one gap made everything else irrelevant.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AWS Lambda Cold Starts: Causes, Measurement, and Mitigation Strategies</title>
      <link>https://andrewodendaal.com/aws-lambda-cold-starts-causes-measurement-mitigation/</link>
      <pubDate>Thu, 08 Jan 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/aws-lambda-cold-starts-causes-measurement-mitigation/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve lost count of how many times someone&amp;rsquo;s told me &amp;ldquo;Lambda has cold start problems&amp;rdquo; like it&amp;rsquo;s some fatal flaw. It isn&amp;rsquo;t. Cold starts are a tradeoff. You get near-infinite scale and zero idle cost, and in return, the first request to a new execution environment takes a bit longer. That&amp;rsquo;s the deal.&lt;/p&gt;&#xA;&lt;p&gt;The real problem is that most teams either panic about cold starts when they don&amp;rsquo;t matter, or ignore them completely when they absolutely do. I&amp;rsquo;ve seen both. We had a payment API on Lambda that was timing out on cold starts during Black Friday — the Java function took 6 seconds to initialize with Spring Boot, and our API Gateway timeout was set to 5 seconds. Every new concurrent request during the traffic spike just&amp;hellip; failed. That was a bad day.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Terraform State Management Best Practices in 2026</title>
      <link>https://andrewodendaal.com/terraform-state-management-best-practices-2026/</link>
      <pubDate>Mon, 05 Jan 2026 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/terraform-state-management-best-practices-2026/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve been managing Terraform state across production environments for years now, and if there&amp;rsquo;s one thing I&amp;rsquo;m certain of, it&amp;rsquo;s this: state management is where most Terraform setups fall apart. Not modules. Not provider quirks. State.&lt;/p&gt;&#xA;&lt;p&gt;The state file is Terraform&amp;rsquo;s memory. It&amp;rsquo;s how Terraform knows what it built, what changed, and what to tear down. Lose it, corrupt it, or let two people write to it at the same time, and you&amp;rsquo;re in for a rough day. I once lost a state file for a networking stack and spent the better part of 6 hours reimporting over 200 resources by hand. VPCs, subnets, route tables, NAT gateways — one at a time. Never again.&lt;/p&gt;</description>
    </item>
    <item>
      <title>SRE Practices for Serverless Architectures: Ensuring Reliability Without Servers</title>
      <link>https://andrewodendaal.com/sre-serverless-architectures/</link>
      <pubDate>Tue, 30 Dec 2025 09:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/sre-serverless-architectures/</guid>
      <description>&lt;p&gt;Serverless architectures have transformed how organizations build and deploy applications, offering benefits like reduced operational overhead, automatic scaling, and consumption-based pricing. However, the ephemeral nature of serverless functions, limited execution contexts, and distributed architecture introduce unique reliability challenges. Site Reliability Engineering (SRE) practices must evolve to address these challenges while maintaining the core principles of reliability, observability, and automation.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores how to apply SRE practices to serverless architectures, with practical examples and implementation strategies for ensuring reliability in environments where you don&amp;rsquo;t manage the underlying infrastructure.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust Year in Review: 2025&#39;s Major Milestones and Achievements</title>
      <link>https://andrewodendaal.com/rust-year-in-review-2025/</link>
      <pubDate>Thu, 25 Dec 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-year-in-review-2025/</guid>
      <description>&lt;p&gt;As 2025 draws to a close, it&amp;rsquo;s time to look back on what has been an extraordinary year for the Rust programming language. From significant language enhancements and ecosystem growth to expanding industry adoption and community achievements, Rust has continued its impressive trajectory. What began as Mozilla&amp;rsquo;s research project has evolved into a mainstream programming language that&amp;rsquo;s reshaping how we think about systems programming, web development, and beyond.&lt;/p&gt;&#xA;&lt;p&gt;In this comprehensive year-in-review, we&amp;rsquo;ll explore the major milestones and achievements that defined Rust in 2025. We&amp;rsquo;ll examine the language improvements that landed, the ecosystem developments that expanded Rust&amp;rsquo;s capabilities, the industry adoption trends that solidified its position, and the community growth that fueled its success. Whether you&amp;rsquo;ve been following Rust closely throughout the year or are just catching up, this retrospective will provide valuable insights into Rust&amp;rsquo;s evolution over the past twelve months.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AI-Driven Cybersecurity: Advanced Threat Detection and Response</title>
      <link>https://andrewodendaal.com/ai-driven-cybersecurity/</link>
      <pubDate>Tue, 16 Dec 2025 10:30:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/ai-driven-cybersecurity/</guid>
      <description>&lt;p&gt;The cybersecurity landscape has reached a critical inflection point. As threat actors deploy increasingly sophisticated attacks using automation and artificial intelligence, traditional security approaches are struggling to keep pace. Security teams face overwhelming volumes of alerts, complex attack patterns, and a persistent shortage of skilled personnel. In response, organizations are turning to AI-driven cybersecurity solutions to detect, analyze, and respond to threats with greater speed and accuracy than ever before.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust in 2025: Future Directions and Predictions</title>
      <link>https://andrewodendaal.com/rust-future-directions-2025/</link>
      <pubDate>Mon, 15 Dec 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-future-directions-2025/</guid>
      <description>&lt;p&gt;As 2025 draws to a close, the Rust programming language continues its impressive trajectory of growth and adoption. From its humble beginnings as Mozilla&amp;rsquo;s research project to its current status as a mainstream language used by tech giants and startups alike, Rust has proven that its unique combination of safety, performance, and expressiveness fills a critical gap in the programming language landscape. But what lies ahead for Rust in 2025? What new features, ecosystem developments, and adoption trends can we expect to see?&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust for AI and Machine Learning in 2025: Libraries, Performance, and Use Cases</title>
      <link>https://andrewodendaal.com/rust-ai-machine-learning/</link>
      <pubDate>Fri, 05 Dec 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-ai-machine-learning/</guid>
      <description>&lt;p&gt;Artificial Intelligence and Machine Learning continue to transform industries across the globe, driving innovations in everything from healthcare and finance to autonomous vehicles and creative tools. While Python has long dominated the AI/ML landscape due to its extensive ecosystem and ease of use, Rust has been steadily gaining ground as a compelling alternative for performance-critical components and production deployments. With its focus on safety, speed, and concurrency, Rust offers unique advantages for AI/ML workloads that require efficiency and reliability.&lt;/p&gt;</description>
    </item>
    <item>
      <title>DevOps for Edge Computing: Extending CI/CD to the Network Edge</title>
      <link>https://andrewodendaal.com/devops-edge-computing/</link>
      <pubDate>Tue, 02 Dec 2025 09:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/devops-edge-computing/</guid>
      <description>&lt;p&gt;The rise of edge computing is transforming how organizations deploy and manage applications. By moving computation closer to data sources and end users, edge computing reduces latency, conserves bandwidth, and enables new use cases that weren&amp;rsquo;t previously possible. However, this distributed architecture introduces significant challenges for DevOps teams accustomed to centralized cloud environments.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores how to extend DevOps principles and practices to edge computing environments, enabling reliable, secure, and scalable deployments across potentially thousands of edge locations.&lt;/p&gt;</description>
    </item>
    <item>
      <title>FinOps Practices for Cloud Cost Optimization in Distributed Systems</title>
      <link>https://andrewodendaal.com/finops-practices-cloud-cost-optimization/</link>
      <pubDate>Mon, 01 Dec 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/finops-practices-cloud-cost-optimization/</guid>
      <description>&lt;p&gt;As organizations increasingly adopt distributed systems in the cloud, managing and optimizing costs has become a critical challenge. The dynamic, scalable nature of cloud resources that makes distributed systems powerful can also lead to unexpected expenses and inefficiencies if not properly managed. This is where FinOps—the practice of bringing financial accountability to cloud spending—comes into play.&lt;/p&gt;&#xA;&lt;p&gt;This article explores practical FinOps strategies and techniques for optimizing cloud costs in distributed systems without compromising performance, reliability, or security.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Hiring Cloud Engineers: What to Look For</title>
      <link>https://andrewodendaal.com/hiring-cloud-engineers-what-to-look-for/</link>
      <pubDate>Mon, 01 Dec 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/hiring-cloud-engineers-what-to-look-for/</guid>
      <description>&lt;p&gt;As organizations accelerate their cloud adoption journeys, the demand for skilled cloud engineers has skyrocketed. Building a high-performing cloud team is now a critical competitive advantage, yet finding and retaining top cloud talent remains one of the most significant challenges facing technology leaders today. The rapid evolution of cloud technologies, combined with a global shortage of experienced professionals, has created a fiercely competitive hiring landscape.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores what to look for when hiring cloud engineers, from essential technical skills and certifications to soft skills and cultural fit. Whether you&amp;rsquo;re building a cloud team from scratch or expanding an existing one, this guide provides actionable strategies for attracting, assessing, and retaining the cloud talent your organization needs to succeed.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust Best Practices for Maintainable Code in 2025</title>
      <link>https://andrewodendaal.com/rust-maintainable-code-practices/</link>
      <pubDate>Tue, 25 Nov 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-maintainable-code-practices/</guid>
      <description>&lt;p&gt;Writing code that works is just the first step in software development. For projects that need to evolve and be maintained over time, code quality and maintainability are just as important as functionality. Rust, with its emphasis on safety and correctness, provides many tools and patterns that can help you write code that&amp;rsquo;s not only correct but also maintainable. However, like any language, it requires discipline and adherence to best practices to ensure your codebase remains clean, understandable, and sustainable.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Service Mesh Architecture: The SRE&#39;s Guide to Network Reliability</title>
      <link>https://andrewodendaal.com/service-mesh-architecture/</link>
      <pubDate>Tue, 18 Nov 2025 10:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/service-mesh-architecture/</guid>
      <description>&lt;p&gt;As organizations adopt microservices architectures, the complexity of service-to-service communication grows exponentially. Managing this communication layer—including routing, security, reliability, and observability—has become one of the most challenging aspects of operating modern distributed systems. Service mesh architecture has emerged as a powerful solution to these challenges, providing a dedicated infrastructure layer that handles service-to-service communication.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores service mesh architecture from an SRE perspective, focusing on how it enhances reliability, security, and observability in microservices environments.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust in Industry: Case Studies and Success Stories in 2025</title>
      <link>https://andrewodendaal.com/rust-industry-adoption/</link>
      <pubDate>Sat, 15 Nov 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-industry-adoption/</guid>
      <description>&lt;p&gt;Since its 1.0 release in 2015, Rust has steadily gained adoption across various industries, from tech giants to startups, and from web services to embedded systems. What began as Mozilla&amp;rsquo;s research project has evolved into a mainstream programming language that companies increasingly rely on for performance-critical, secure, and reliable systems. As we look at the landscape in 2025, Rust&amp;rsquo;s adoption has reached new heights, with more organizations than ever using it to solve real-world problems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust Compared to Other Programming Languages: A Comprehensive Analysis</title>
      <link>https://andrewodendaal.com/rust-compared-other-languages/</link>
      <pubDate>Wed, 05 Nov 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-compared-other-languages/</guid>
      <description>&lt;p&gt;Choosing the right programming language for a project is a critical decision that can significantly impact development speed, code quality, performance, and maintainability. Rust, with its focus on memory safety without garbage collection, has carved out a unique position in the programming language landscape. But how does it compare to other popular languages like C/C++, Go, Java, Python, and JavaScript? Understanding these comparisons can help you make informed decisions about when and why to choose Rust for your projects.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AI-Powered Data Analytics: Transforming Enterprise Decision Making</title>
      <link>https://andrewodendaal.com/ai-powered-data-analytics/</link>
      <pubDate>Tue, 04 Nov 2025 10:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/ai-powered-data-analytics/</guid>
      <description>&lt;p&gt;The volume, velocity, and variety of data that organizations generate today have far outpaced traditional analytics methods. As businesses struggle to extract meaningful insights from increasingly complex datasets, artificial intelligence has emerged as a transformative force in data analytics. AI-powered analytics goes beyond conventional approaches by automating pattern detection, generating predictive insights, and even recommending actions based on data-driven findings.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores how AI is revolutionizing data analytics, with practical implementation strategies and real-world examples to help organizations harness the full potential of their data assets.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Common Cloud Security Misconfigurations: Detection and Remediation</title>
      <link>https://andrewodendaal.com/common-cloud-security-misconfigurations/</link>
      <pubDate>Sat, 01 Nov 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/common-cloud-security-misconfigurations/</guid>
      <description>&lt;p&gt;Cloud security misconfigurations have become one of the leading causes of data breaches and security incidents. As organizations rapidly adopt cloud services and infrastructure, the complexity of configurations increases, creating numerous opportunities for security gaps. According to recent industry reports, misconfigurations account for nearly 65-70% of cloud security incidents, making them a critical area of focus for security teams.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores common cloud security misconfigurations across major cloud providers (AWS, Azure, and Google Cloud), providing detailed detection methods, remediation strategies, and prevention techniques. Whether you&amp;rsquo;re a cloud architect, security engineer, or DevOps professional, this guide will help you identify and address the most prevalent security risks in your cloud environments.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust&#39;s Design Philosophy and Principles: Understanding the Language&#39;s Core Values</title>
      <link>https://andrewodendaal.com/rust-design-philosophy-principles/</link>
      <pubDate>Sat, 25 Oct 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-design-philosophy-principles/</guid>
      <description>&lt;p&gt;Every programming language embodies a set of values and principles that guide its design decisions and evolution. Rust, with its unique combination of memory safety, performance, and expressiveness, is built on a foundation of carefully considered principles that shape everything from its syntax to its type system. Understanding these principles not only helps you write better Rust code but also provides insight into why Rust works the way it does and how to make decisions that align with the language&amp;rsquo;s philosophy.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Container Security Best Practices: Protecting Your Containerized Applications</title>
      <link>https://andrewodendaal.com/container-security-best-practices/</link>
      <pubDate>Tue, 21 Oct 2025 09:30:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/container-security-best-practices/</guid>
      <description>&lt;p&gt;As organizations increasingly adopt containerization for application deployment, securing these environments has become a critical concern. Containers introduce unique security challenges that differ from traditional infrastructure, requiring specialized approaches and tools. From vulnerable base images to insecure runtime configurations, the attack surface for containerized applications is substantial and often overlooked.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores container security best practices across the entire container lifecycle, providing practical strategies and tools to help DevOps teams build and maintain secure containerized environments.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Go Distributed Consensus: Implementing Raft and Leader Election</title>
      <link>https://andrewodendaal.com/go-distributed-consensus-raft-leader-election/</link>
      <pubDate>Tue, 07 Oct 2025 11:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/go-distributed-consensus-raft-leader-election/</guid>
      <description>&lt;p&gt;In distributed systems, one of the most challenging problems is achieving consensus among a group of nodes that may experience failures, network partitions, and message delays. How do we ensure that a cluster of servers agrees on a shared state when any node might fail at any time? This fundamental problem underlies many distributed systems challenges, from database replication to distributed locking and coordination services.&lt;/p&gt;&#xA;&lt;p&gt;Distributed consensus algorithms provide a solution by enabling a collection of machines to work as a coherent group that can survive the failures of some of its members. Among these algorithms, Raft has emerged as one of the most widely implemented due to its focus on understandability and practical implementation. Unlike more complex algorithms like Paxos, Raft was designed to be comprehensible and implementable, making it an excellent choice for Go developers building distributed systems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Observability Patterns for Distributed Systems: Beyond Metrics, Logs, and Traces</title>
      <link>https://andrewodendaal.com/observability-patterns-distributed-systems/</link>
      <pubDate>Tue, 07 Oct 2025 10:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/observability-patterns-distributed-systems/</guid>
      <description>&lt;p&gt;In today&amp;rsquo;s world of microservices, serverless functions, and complex distributed systems, traditional monitoring approaches fall short. Modern systems generate vast amounts of telemetry data across numerous components, making it challenging to understand system behavior, identify issues, and troubleshoot problems. This is where observability comes in—providing deep insights into what&amp;rsquo;s happening inside your systems without having to deploy new code to add instrumentation.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores advanced observability patterns for distributed systems, going beyond the basic &amp;ldquo;three pillars&amp;rdquo; of metrics, logs, and traces to help SRE teams build more observable systems and solve complex problems faster.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Data Mesh Architecture: A Paradigm Shift for Distributed Data</title>
      <link>https://andrewodendaal.com/data-mesh-architecture/</link>
      <pubDate>Wed, 01 Oct 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/data-mesh-architecture/</guid>
      <description>&lt;p&gt;As organizations scale their data initiatives, traditional centralized data architectures—data warehouses, data lakes, and even lake houses—often struggle to keep pace with the growing complexity and domain diversity of modern enterprises. Data Mesh has emerged as a paradigm shift in how we think about and implement data architectures, particularly in distributed systems.&lt;/p&gt;&#xA;&lt;p&gt;This article explores the principles, implementation patterns, and practical considerations for adopting Data Mesh architecture in distributed systems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AI-Powered Code Generation: Transforming Enterprise Software Development</title>
      <link>https://andrewodendaal.com/ai-code-generation-enterprise/</link>
      <pubDate>Tue, 16 Sep 2025 09:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/ai-code-generation-enterprise/</guid>
      <description>&lt;p&gt;The landscape of software development is undergoing a profound transformation with the rise of AI-powered code generation tools. What began as simple code completion features has evolved into sophisticated systems capable of generating entire functions, classes, and even applications from natural language descriptions. For enterprise organizations, these tools offer unprecedented opportunities to accelerate development cycles, reduce technical debt, and allow developers to focus on higher-value creative work.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores how enterprises can effectively implement AI code generation tools, establish appropriate governance frameworks, and maximize developer productivity while maintaining code quality and security.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust Package Management with Cargo: Beyond the Basics</title>
      <link>https://andrewodendaal.com/rust-cargo-package-management/</link>
      <pubDate>Mon, 15 Sep 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-cargo-package-management/</guid>
      <description>&lt;p&gt;Cargo, Rust&amp;rsquo;s package manager and build system, is one of the language&amp;rsquo;s greatest strengths. It handles dependency management, compilation, testing, documentation generation, and package publishing, providing a seamless experience for Rust developers. While most Rust programmers are familiar with basic Cargo commands like &lt;code&gt;cargo build&lt;/code&gt; and &lt;code&gt;cargo test&lt;/code&gt;, the tool offers a wealth of advanced features that can significantly improve your development workflow and help you manage complex projects more effectively.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust Documentation Practices: Creating Clear, Comprehensive, and Useful Docs</title>
      <link>https://andrewodendaal.com/rust-documentation-practices/</link>
      <pubDate>Fri, 05 Sep 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-documentation-practices/</guid>
      <description>&lt;p&gt;Documentation is a crucial aspect of software development, serving as a bridge between code authors and users. Well-written documentation helps users understand how to use your code, explains why certain design decisions were made, and guides contributors on how to extend or modify your project. Rust takes documentation seriously, providing first-class tools and conventions that make it easy to create clear, comprehensive, and useful documentation directly alongside your code.&lt;/p&gt;&#xA;&lt;p&gt;In this comprehensive guide, we&amp;rsquo;ll explore Rust&amp;rsquo;s documentation ecosystem, from inline doc comments to full-fledged documentation websites. You&amp;rsquo;ll learn how to write effective documentation, leverage Rust&amp;rsquo;s documentation tools, and follow best practices that have emerged in the Rust community. By the end, you&amp;rsquo;ll have a solid understanding of how to create documentation that enhances the quality and usability of your Rust projects, whether you&amp;rsquo;re working on a small library or a large-scale application.&lt;/p&gt;</description>
    </item>
    <item>
      <title>GitOps for Multi-Environment Deployments: Scaling Infrastructure as Code</title>
      <link>https://andrewodendaal.com/gitops-multi-environment-deployments/</link>
      <pubDate>Tue, 02 Sep 2025 10:30:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/gitops-multi-environment-deployments/</guid>
      <description>&lt;p&gt;As organizations scale their cloud-native applications, managing deployments across multiple environments—from development and staging to production and disaster recovery—becomes increasingly complex. GitOps has emerged as a powerful paradigm for managing this complexity by using Git as the single source of truth for declarative infrastructure and applications.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores how to implement GitOps practices for multi-environment deployments, providing practical strategies and tools to ensure consistency, security, and scalability across your entire deployment pipeline.&lt;/p&gt;</description>
    </item>
    <item>
      <title>SOC 2 and ISO 27001 for SaaS Companies: A Comprehensive Implementation Guide</title>
      <link>https://andrewodendaal.com/soc2-and-iso27001-for-saas-companies/</link>
      <pubDate>Mon, 01 Sep 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/soc2-and-iso27001-for-saas-companies/</guid>
      <description>&lt;p&gt;For SaaS companies, security and compliance have evolved from optional differentiators to essential business requirements. As organizations increasingly rely on cloud-based solutions to handle sensitive data, customers and partners demand assurance that their information is protected according to recognized standards. SOC 2 and ISO 27001 have emerged as the two most important compliance frameworks for SaaS providers, serving as trusted indicators of security maturity and risk management capabilities.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores the implementation of SOC 2 and ISO 27001 for SaaS companies. We&amp;rsquo;ll cover the requirements, implementation strategies, certification processes, and approaches for maintaining ongoing compliance. Whether you&amp;rsquo;re just starting your compliance journey or looking to enhance your existing security program, this guide provides actionable insights to help you achieve and maintain these critical certifications.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Testing and Debugging in Rust: Ensuring Code Quality and Reliability</title>
      <link>https://andrewodendaal.com/rust-testing-debugging/</link>
      <pubDate>Mon, 25 Aug 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-testing-debugging/</guid>
      <description>&lt;p&gt;Testing and debugging are essential aspects of software development, ensuring that code works as expected and helping to identify and fix issues when it doesn&amp;rsquo;t. Rust provides a rich set of tools and features for testing and debugging, from built-in unit testing frameworks to advanced property-based testing libraries and powerful debugging capabilities. These tools, combined with Rust&amp;rsquo;s strong type system and ownership model, help developers catch bugs early and build reliable, maintainable software.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Quantum Computing for Enterprise: Implementation Guide</title>
      <link>https://andrewodendaal.com/articles/quantum-enterprise-guide/</link>
      <pubDate>Mon, 25 Aug 2025 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/quantum-enterprise-guide/</guid>
      <description>&lt;p&gt;Understand quantum computing applications in enterprise environments.&lt;/p&gt;&#xA;&lt;h4 id=&#34;understanding-quantum-computing&#34;&gt;Understanding Quantum Computing&lt;/h4&gt;&#xA;&lt;h4 id=&#34;quantum-computing-fundamentals&#34;&gt;Quantum Computing Fundamentals&lt;/h4&gt;&#xA;&lt;p&gt;Key concepts that distinguish quantum from classical computing:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Quantum Bits (Qubits)&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Unlike classical bits (0 or 1), qubits can exist in superposition&lt;/li&gt;&#xA;&lt;li&gt;Can represent multiple states simultaneously&lt;/li&gt;&#xA;&lt;li&gt;Enable quantum computers to process vast amounts of information&lt;/li&gt;&#xA;&lt;li&gt;Current systems have dozens to hundreds of qubits&lt;/li&gt;&#xA;&lt;li&gt;Future fault-tolerant systems will require millions&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Quantum Superposition&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Qubits can exist in multiple states at once&lt;/li&gt;&#xA;&lt;li&gt;Allows quantum computers to explore multiple solutions simultaneously&lt;/li&gt;&#xA;&lt;li&gt;Creates exponential scaling of computational space&lt;/li&gt;&#xA;&lt;li&gt;Enables certain algorithms to achieve dramatic speedups&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Quantum Entanglement&lt;/strong&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust&#39;s Security Features: Building Robust, Vulnerability-Free Software</title>
      <link>https://andrewodendaal.com/rust-security-features/</link>
      <pubDate>Fri, 15 Aug 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-security-features/</guid>
      <description>&lt;p&gt;Security vulnerabilities continue to plague software systems, with memory safety issues like buffer overflows, use-after-free, and data races accounting for a significant percentage of critical CVEs (Common Vulnerabilities and Exposures). Rust was designed from the ground up with security in mind, offering a unique approach that prevents these classes of bugs at compile time without sacrificing performance. This &amp;ldquo;security by design&amp;rdquo; philosophy has made Rust increasingly popular for security-critical applications, from operating systems and browsers to cryptographic libraries and network services.&lt;/p&gt;</description>
    </item>
    <item>
      <title>SRE Incident Management: Response and Recovery</title>
      <link>https://andrewodendaal.com/articles/sre-incident-management/</link>
      <pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/sre-incident-management/</guid>
      <description>&lt;p&gt;Implement effective incident management processes.&lt;/p&gt;&#xA;&lt;h4 id=&#34;the-foundations-of-effective-incident-management&#34;&gt;The Foundations of Effective Incident Management&lt;/h4&gt;&#xA;&lt;p&gt;Before diving into specific practices, let&amp;rsquo;s establish the core principles that underpin effective incident management:&lt;/p&gt;&#xA;&lt;h4 id=&#34;key-principles&#34;&gt;Key Principles&lt;/h4&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Blameless Culture&lt;/strong&gt;: Focus on systems and processes, not individuals&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Preparedness&lt;/strong&gt;: Plan and practice for incidents before they occur&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Clear Ownership&lt;/strong&gt;: Define roles and responsibilities clearly&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Proportional Response&lt;/strong&gt;: Match the response to the severity of the incident&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Continuous Learning&lt;/strong&gt;: Use incidents as opportunities to improve&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h4 id=&#34;the-incident-lifecycle&#34;&gt;The Incident Lifecycle&lt;/h4&gt;&#xA;&lt;p&gt;Understanding the complete incident lifecycle helps teams develop comprehensive management strategies:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Transfer Learning Techniques: Leveraging Pre-trained Models for Enterprise AI Applications</title>
      <link>https://andrewodendaal.com/transfer-learning-techniques/</link>
      <pubDate>Tue, 05 Aug 2025 09:45:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/transfer-learning-techniques/</guid>
      <description>&lt;p&gt;In the rapidly evolving field of artificial intelligence, transfer learning has emerged as one of the most powerful techniques for building effective models with limited data and computational resources. By leveraging knowledge gained from pre-trained models, organizations can significantly reduce the time, data, and computing power needed to develop high-performing AI applications.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores practical transfer learning techniques that can help enterprise teams build sophisticated AI solutions even when faced with constraints on data availability and computational resources.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Serverless Architecture Patterns for Distributed Systems</title>
      <link>https://andrewodendaal.com/serverless-architecture-patterns/</link>
      <pubDate>Tue, 05 Aug 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/serverless-architecture-patterns/</guid>
      <description>&lt;p&gt;Serverless computing has revolutionized how we build and deploy distributed systems, offering a model where cloud providers dynamically manage the allocation and provisioning of servers. This approach allows developers to focus on writing code without worrying about infrastructure management, scaling, or maintenance. As serverless architectures mature, distinct patterns have emerged that address common challenges in distributed systems.&lt;/p&gt;&#xA;&lt;p&gt;This article explores key serverless architecture patterns, providing practical implementation examples and guidance on when to apply each pattern in your distributed systems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Future of Rust: Roadmap and Upcoming Features</title>
      <link>https://andrewodendaal.com/rust-future-roadmap/</link>
      <pubDate>Tue, 05 Aug 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-future-roadmap/</guid>
      <description>&lt;p&gt;Since its 1.0 release in 2015, Rust has evolved from a promising systems programming language into a mature, production-ready technology used by companies and developers worldwide. Its unique combination of performance, safety, and ergonomics has driven adoption across various domains, from operating systems and embedded devices to web services and game development. As we look to the future, Rust continues to evolve with an ambitious roadmap that aims to address current limitations, expand into new domains, and further improve developer experience.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Microservices Architecture Patterns: Design Strategies for Scalable Systems</title>
      <link>https://andrewodendaal.com/microservices-architecture-patterns/</link>
      <pubDate>Tue, 22 Jul 2025 10:15:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/microservices-architecture-patterns/</guid>
      <description>&lt;p&gt;Microservices architecture has become the dominant approach for building complex, scalable applications. By breaking down monolithic applications into smaller, independently deployable services, organizations can achieve greater agility, scalability, and resilience. However, implementing microservices effectively requires careful consideration of numerous design patterns and architectural decisions.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores proven microservices architecture patterns that help teams navigate the complexities of distributed systems while avoiding common pitfalls. Whether you&amp;rsquo;re planning a new microservices implementation or refining an existing one, these patterns will provide valuable strategies for building robust, maintainable systems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Service Discovery in Distributed Systems: Patterns and Implementation</title>
      <link>https://andrewodendaal.com/service-discovery-distributed-systems/</link>
      <pubDate>Sun, 20 Jul 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/service-discovery-distributed-systems/</guid>
      <description>&lt;p&gt;In distributed systems, particularly microservices architectures, services need to find and communicate with each other efficiently. As systems scale and become more dynamic—with services being deployed, scaled, and terminated frequently—hardcoded network locations become impractical. This is where service discovery comes in, providing mechanisms for services to locate each other dynamically at runtime.&lt;/p&gt;&#xA;&lt;p&gt;This article explores various service discovery patterns, their implementation approaches, and best practices for building robust service discovery mechanisms in distributed systems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust Interoperability: Seamlessly Working with Other Languages</title>
      <link>https://andrewodendaal.com/rust-interoperability/</link>
      <pubDate>Tue, 15 Jul 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-interoperability/</guid>
      <description>&lt;p&gt;One of Rust&amp;rsquo;s greatest strengths is its ability to interoperate with other programming languages. This interoperability allows developers to gradually introduce Rust into existing projects, leverage specialized libraries from other ecosystems, and build components that can be used across different platforms and languages. Whether you&amp;rsquo;re looking to speed up a Python application with Rust, integrate Rust components into a C++ codebase, or expose Rust functionality to JavaScript, the language provides robust tools and patterns for seamless integration.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Edge Computing Architectures: Bringing Computation Closer to Data Sources</title>
      <link>https://andrewodendaal.com/edge-computing-architectures/</link>
      <pubDate>Thu, 10 Jul 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/edge-computing-architectures/</guid>
      <description>&lt;p&gt;As data volumes grow exponentially and latency requirements become more stringent, traditional cloud computing models face increasing challenges. Edge computing has emerged as a powerful paradigm that brings computation and data storage closer to the sources of data, enabling faster processing, reduced bandwidth usage, and new capabilities for real-time applications. From IoT devices and autonomous vehicles to content delivery and industrial automation, edge computing is transforming how we architect distributed systems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Automated Remediation: Building Self-Healing Systems for Modern SRE Teams</title>
      <link>https://andrewodendaal.com/automated-remediation-sre/</link>
      <pubDate>Tue, 08 Jul 2025 09:30:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/automated-remediation-sre/</guid>
      <description>&lt;p&gt;In the world of Site Reliability Engineering (SRE), the goal has always been to reduce toil—repetitive, manual work that adds little value and scales linearly with service growth. One of the most effective ways to achieve this is through automated remediation: the practice of automatically detecting and fixing common issues without human intervention. By building self-healing systems, SRE teams can not only improve reliability but also free up valuable time for strategic engineering work.&lt;/p&gt;</description>
    </item>
    <item>
      <title>SRE Capacity Planning: Resource Management</title>
      <link>https://andrewodendaal.com/articles/sre-capacity-planning/</link>
      <pubDate>Tue, 01 Jul 2025 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/sre-capacity-planning/</guid>
      <description>&lt;p&gt;Master capacity planning techniques.&lt;/p&gt;&#xA;&lt;h4 id=&#34;understanding-capacity-planning-for-sre&#34;&gt;Understanding Capacity Planning for SRE&lt;/h4&gt;&#xA;&lt;p&gt;Before diving into specific methodologies, let&amp;rsquo;s establish what capacity planning means in the context of Site Reliability Engineering.&lt;/p&gt;&#xA;&lt;h4 id=&#34;what-is-capacity-planning&#34;&gt;What is Capacity Planning?&lt;/h4&gt;&#xA;&lt;p&gt;Capacity planning is the process of determining the resources required to meet expected workloads while maintaining service level objectives (SLOs). For SRE teams, this involves:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Forecasting demand&lt;/strong&gt;: Predicting future workload based on historical data and business projections&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Resource modeling&lt;/strong&gt;: Understanding how workload translates to resource requirements&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Capacity allocation&lt;/strong&gt;: Provisioning appropriate resources across services and regions&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Performance analysis&lt;/strong&gt;: Ensuring systems meet performance targets under expected load&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Cost optimization&lt;/strong&gt;: Balancing reliability requirements with infrastructure costs&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h4 id=&#34;why-capacity-planning-matters-for-sre&#34;&gt;Why Capacity Planning Matters for SRE&lt;/h4&gt;&#xA;&lt;p&gt;Effective capacity planning directly impacts several key aspects of reliability engineering:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust&#39;s Ecosystem and Community: The Foundation of Success</title>
      <link>https://andrewodendaal.com/rust-ecosystem-community/</link>
      <pubDate>Wed, 25 Jun 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-ecosystem-community/</guid>
      <description>&lt;p&gt;A programming language is more than just syntax and features—it&amp;rsquo;s also the ecosystem of libraries, tools, and resources that surround it, and the community of people who use, develop, and advocate for it. Rust has distinguished itself not only through its technical merits but also through its exceptionally vibrant ecosystem and welcoming community. From the comprehensive package manager Cargo to the collaborative governance model, Rust&amp;rsquo;s ecosystem and community have been instrumental in the language&amp;rsquo;s growing adoption and success.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Data Consistency Models in Distributed Systems</title>
      <link>https://andrewodendaal.com/data-consistency-distributed-systems/</link>
      <pubDate>Fri, 20 Jun 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/data-consistency-distributed-systems/</guid>
      <description>&lt;p&gt;In distributed systems, one of the most challenging aspects is managing data consistency across multiple nodes. The CAP theorem tells us that we can&amp;rsquo;t simultaneously achieve perfect consistency, availability, and partition tolerance—we must make trade-offs. Understanding these trade-offs and the spectrum of consistency models is crucial for designing distributed systems that meet your specific requirements.&lt;/p&gt;&#xA;&lt;p&gt;This article explores the various consistency models available in distributed systems, from strong consistency to eventual consistency, and provides guidance on selecting the appropriate model for your application needs.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building an AI Ethics and Governance Framework for Enterprise Applications</title>
      <link>https://andrewodendaal.com/ai-ethics-governance-framework/</link>
      <pubDate>Tue, 17 Jun 2025 11:30:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/ai-ethics-governance-framework/</guid>
      <description>&lt;p&gt;As artificial intelligence becomes increasingly embedded in enterprise applications and decision-making processes, organizations face growing pressure to ensure their AI systems are developed and deployed responsibly. Beyond regulatory compliance, implementing robust AI ethics and governance frameworks has become a business imperative—protecting against reputational damage, enhancing customer trust, and mitigating risks associated with AI deployment.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores how to build and implement an effective AI ethics and governance framework for enterprise applications, providing practical strategies and tools that technical leaders can use to ensure responsible AI development and deployment.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Machine Learning with Rust: Performance and Safety for AI Applications</title>
      <link>https://andrewodendaal.com/rust-machine-learning/</link>
      <pubDate>Sun, 15 Jun 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-machine-learning/</guid>
      <description>&lt;p&gt;Machine learning has traditionally been dominated by languages like Python, which offer ease of use and a rich ecosystem of libraries. However, as models grow larger and performance requirements become more demanding, there&amp;rsquo;s increasing interest in alternatives that can provide better efficiency without sacrificing developer productivity. Rust, with its focus on performance, safety, and modern language features, is emerging as a compelling option for machine learning applications, particularly in production environments where speed and reliability are critical.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Site Reliability Engineering Fundamentals: Building and Scaling Reliable Services</title>
      <link>https://andrewodendaal.com/site-reliability-engineering-fundamentals/</link>
      <pubDate>Sun, 15 Jun 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/site-reliability-engineering-fundamentals/</guid>
      <description>&lt;p&gt;Site Reliability Engineering (SRE) has emerged as a critical discipline at the intersection of software engineering and operations. Pioneered by Google and now adopted by organizations of all sizes, SRE applies software engineering principles to operations and infrastructure challenges, with a focus on creating scalable and highly reliable software systems. As distributed systems grow more complex, the principles and practices of SRE have become essential for maintaining service reliability while enabling rapid innovation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Data Engineering Best Practices: Building Robust Pipelines</title>
      <link>https://andrewodendaal.com/articles/data-engineering-best-practices/</link>
      <pubDate>Thu, 12 Jun 2025 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/data-engineering-best-practices/</guid>
      <description>&lt;p&gt;Master data engineering principles.&lt;/p&gt;&#xA;&lt;h4 id=&#34;data-pipeline-architecture&#34;&gt;Data Pipeline Architecture&lt;/h4&gt;&#xA;&lt;h4 id=&#34;architectural-patterns&#34;&gt;Architectural Patterns&lt;/h4&gt;&#xA;&lt;p&gt;Foundational approaches to data pipeline design:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Batch Processing&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Processing data in scheduled intervals&lt;/li&gt;&#xA;&lt;li&gt;Handling large volumes efficiently&lt;/li&gt;&#xA;&lt;li&gt;Optimizing for throughput over latency&lt;/li&gt;&#xA;&lt;li&gt;Implementing idempotent operations&lt;/li&gt;&#xA;&lt;li&gt;Managing dependencies between jobs&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Stream Processing&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Processing data in near real-time&lt;/li&gt;&#xA;&lt;li&gt;Handling continuous data flows&lt;/li&gt;&#xA;&lt;li&gt;Implementing windowing strategies&lt;/li&gt;&#xA;&lt;li&gt;Managing state and checkpointing&lt;/li&gt;&#xA;&lt;li&gt;Ensuring exactly-once processing&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Lambda Architecture&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Combining batch and streaming layers&lt;/li&gt;&#xA;&lt;li&gt;Providing both accurate and real-time views&lt;/li&gt;&#xA;&lt;li&gt;Managing duplicate processing logic&lt;/li&gt;&#xA;&lt;li&gt;Reconciling batch and speed layers&lt;/li&gt;&#xA;&lt;li&gt;Optimizing for different access patterns&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Kappa Architecture&lt;/strong&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>API Design for Distributed Systems: Principles and Best Practices</title>
      <link>https://andrewodendaal.com/api-design-distributed-systems/</link>
      <pubDate>Thu, 05 Jun 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/api-design-distributed-systems/</guid>
      <description>&lt;p&gt;In distributed systems, APIs serve as the critical interfaces between services, enabling communication, integration, and collaboration across components. Well-designed APIs can significantly enhance system flexibility, maintainability, and scalability, while poorly designed ones can lead to tight coupling, performance bottlenecks, and brittle architectures. As organizations increasingly adopt microservices and distributed architectures, mastering API design has become an essential skill for modern software engineers.&lt;/p&gt;&#xA;&lt;p&gt;This article explores key principles, patterns, and best practices for designing effective APIs in distributed systems, with practical examples to guide your implementation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Game Development with Rust: Building Fast, Reliable Games</title>
      <link>https://andrewodendaal.com/rust-game-development/</link>
      <pubDate>Thu, 05 Jun 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-game-development/</guid>
      <description>&lt;p&gt;Game development demands a unique combination of performance, reliability, and expressiveness from programming languages. Traditionally dominated by C++ for its speed and control, the field is now seeing growing interest in Rust as an alternative. Rust offers comparable performance to C++ while eliminating entire classes of bugs through its ownership system and providing modern language features that improve developer productivity. From indie 2D games to high-performance game engines, Rust is proving to be a compelling choice for game developers.&lt;/p&gt;</description>
    </item>
    <item>
      <title>DevSecOps Implementation Guide: Integrating Security into the Development Lifecycle</title>
      <link>https://andrewodendaal.com/devsecops-implementation-guide/</link>
      <pubDate>Tue, 03 Jun 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/devsecops-implementation-guide/</guid>
      <description>&lt;p&gt;As organizations accelerate their digital transformation and software delivery, security can no longer be an afterthought or a final checkpoint before deployment. DevSecOps—the integration of security practices within the DevOps process—has emerged as a critical approach for building secure applications from the ground up. By embedding security throughout the software development lifecycle, organizations can deliver secure, compliant applications without sacrificing speed or agility.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores the principles, practices, tools, and cultural changes needed to successfully implement DevSecOps in your organization. Whether you&amp;rsquo;re just starting your DevSecOps journey or looking to enhance your existing practices, this guide provides actionable strategies to integrate security into every phase of your development process.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Embedded Systems Programming with Rust: Safety and Performance for Resource-Constrained Devices</title>
      <link>https://andrewodendaal.com/rust-embedded-systems/</link>
      <pubDate>Sun, 25 May 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-embedded-systems/</guid>
      <description>&lt;p&gt;Embedded systems programming has traditionally been dominated by C and C++, languages that offer the low-level control and performance necessary for resource-constrained environments. However, these languages also come with significant drawbacks, particularly in terms of memory safety and modern language features. Rust offers a compelling alternative, providing the same level of control and performance while eliminating entire classes of bugs through its ownership system and zero-cost abstractions.&lt;/p&gt;&#xA;&lt;p&gt;In this comprehensive guide, we&amp;rsquo;ll explore how Rust is changing the landscape of embedded systems development. From bare-metal programming on microcontrollers to higher-level abstractions for IoT devices, you&amp;rsquo;ll learn how Rust&amp;rsquo;s unique features make it an excellent choice for embedded applications. By the end, you&amp;rsquo;ll understand how to leverage Rust&amp;rsquo;s safety and performance for your own embedded projects, whether you&amp;rsquo;re building a simple sensor node or a complex industrial control system.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Monitoring and Observability in Distributed Systems</title>
      <link>https://andrewodendaal.com/monitoring-observability-distributed-systems/</link>
      <pubDate>Sun, 25 May 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/monitoring-observability-distributed-systems/</guid>
      <description>&lt;p&gt;In the world of distributed systems, understanding what&amp;rsquo;s happening across your services is both critical and challenging. As systems grow in complexity—spanning multiple services, data stores, and infrastructure components—traditional monitoring approaches fall short. This is where modern monitoring and observability practices come into play, providing the visibility needed to operate distributed systems with confidence.&lt;/p&gt;&#xA;&lt;p&gt;This article explores the evolution from basic monitoring to comprehensive observability, providing practical guidance on implementing effective observability practices in distributed systems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Real-Time Data Processing: Stream Analytics</title>
      <link>https://andrewodendaal.com/articles/data-real-time-processing/</link>
      <pubDate>Sun, 25 May 2025 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/data-real-time-processing/</guid>
      <description>&lt;p&gt;Build real-time data processing systems using stream processing frameworks.&lt;/p&gt;&#xA;&lt;h4 id=&#34;real-time-data-processing-fundamentals&#34;&gt;Real-Time Data Processing Fundamentals&lt;/h4&gt;&#xA;&lt;h4 id=&#34;core-concepts-and-terminology&#34;&gt;Core Concepts and Terminology&lt;/h4&gt;&#xA;&lt;p&gt;Understanding the building blocks of real-time systems:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Real-Time Processing vs. Batch Processing&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Real-time: Continuous processing with minimal latency&lt;/li&gt;&#xA;&lt;li&gt;Batch: Periodic processing of accumulated data&lt;/li&gt;&#xA;&lt;li&gt;Micro-batch: Small batches with higher frequency&lt;/li&gt;&#xA;&lt;li&gt;Near real-time: Low but not immediate latency&lt;/li&gt;&#xA;&lt;li&gt;Stream processing: Continuous data flow processing&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Key Concepts&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Events: Discrete data records representing occurrences&lt;/li&gt;&#xA;&lt;li&gt;Streams: Unbounded sequences of events&lt;/li&gt;&#xA;&lt;li&gt;Producers: Systems generating event data&lt;/li&gt;&#xA;&lt;li&gt;Consumers: Systems processing event data&lt;/li&gt;&#xA;&lt;li&gt;Topics/Channels: Named streams for event organization&lt;/li&gt;&#xA;&lt;li&gt;Partitions: Subdivisions of streams for parallelism&lt;/li&gt;&#xA;&lt;li&gt;Offsets: Positions within event streams&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Processing Semantics&lt;/strong&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Event-Driven Architecture Patterns: Building Responsive and Scalable Systems</title>
      <link>https://andrewodendaal.com/event-driven-architecture-patterns/</link>
      <pubDate>Thu, 15 May 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/event-driven-architecture-patterns/</guid>
      <description>&lt;p&gt;Event-driven architecture (EDA) has emerged as a powerful architectural paradigm for building responsive, scalable, and resilient distributed systems. By decoupling components through asynchronous event-based communication, EDA enables organizations to build systems that can handle complex workflows, scale independently, and evolve more flexibly than traditional request-response architectures. However, implementing EDA effectively requires understanding various patterns, technologies, and trade-offs.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores event-driven architecture patterns, covering event sourcing, CQRS, message brokers, stream processing, and implementation strategies. Whether you&amp;rsquo;re designing a new system or evolving an existing one, these insights will help you leverage event-driven approaches to build systems that can adapt to changing business requirements while maintaining performance, reliability, and maintainability.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Web Development with Rust: An Introduction to Building Fast, Secure Web Applications</title>
      <link>https://andrewodendaal.com/rust-web-development/</link>
      <pubDate>Thu, 15 May 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-web-development/</guid>
      <description>&lt;p&gt;Web development with Rust is gaining momentum as developers seek alternatives that offer better performance, improved security, and fewer runtime surprises than traditional web stacks. While Rust wasn&amp;rsquo;t initially designed for web development, its emphasis on safety, speed, and concurrency makes it an excellent fit for modern web applications that need to be reliable and efficient. From low-level HTTP servers to full-stack frameworks, the Rust ecosystem now offers a variety of tools for building web applications at different levels of abstraction.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Testing Distributed Systems: Strategies for Ensuring Reliability</title>
      <link>https://andrewodendaal.com/testing-distributed-systems/</link>
      <pubDate>Sat, 10 May 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/testing-distributed-systems/</guid>
      <description>&lt;p&gt;Testing distributed systems presents unique challenges that go far beyond traditional application testing. With components spread across multiple machines, complex network interactions, and various failure modes, ensuring reliability requires specialized testing strategies. Traditional testing approaches often fall short when confronted with the complexities of distributed environments, where issues like network partitions, race conditions, and partial failures can lead to subtle and hard-to-reproduce bugs.&lt;/p&gt;&#xA;&lt;p&gt;This article explores comprehensive testing strategies for distributed systems, providing practical approaches to validate functionality, performance, and resilience across distributed components.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AI Anomaly Detection Systems: Architectures and Implementation</title>
      <link>https://andrewodendaal.com/ai-anomaly-detection-systems/</link>
      <pubDate>Mon, 05 May 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/ai-anomaly-detection-systems/</guid>
      <description>&lt;p&gt;Anomaly detection has become a critical capability for modern organizations, enabling them to identify unusual patterns that could indicate security breaches, system failures, performance issues, or business opportunities. With the explosion of data from infrastructure, applications, and business processes, traditional rule-based approaches to anomaly detection are no longer sufficient. This is where AI-powered anomaly detection systems come in, offering the ability to automatically learn normal patterns and identify deviations without explicit programming.&lt;/p&gt;</description>
    </item>
    <item>
      <title>GraphQL API Design Best Practices: Building Flexible and Efficient APIs</title>
      <link>https://andrewodendaal.com/graphql-api-design-best-practices/</link>
      <pubDate>Thu, 01 May 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/graphql-api-design-best-practices/</guid>
      <description>&lt;p&gt;GraphQL has transformed API development by enabling clients to request exactly the data they need, reducing over-fetching and under-fetching that plague traditional REST APIs. Since its public release by Facebook in 2015, GraphQL has gained widespread adoption across organizations of all sizes, from startups to enterprises. However, building a well-designed GraphQL API requires careful consideration of schema design, performance optimization, security, and maintainability.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores GraphQL API design best practices, covering schema design principles, performance optimization techniques, security considerations, versioning strategies, and implementation approaches. Whether you&amp;rsquo;re building your first GraphQL API or looking to improve existing implementations, these insights will help you create flexible, efficient, and maintainable GraphQL APIs that deliver an exceptional developer experience.&lt;/p&gt;</description>
    </item>
    <item>
      <title>File I/O in Rust: Reading and Writing Files Safely and Efficiently</title>
      <link>https://andrewodendaal.com/rust-file-io/</link>
      <pubDate>Fri, 25 Apr 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-file-io/</guid>
      <description>&lt;p&gt;File input and output (I/O) operations are fundamental to many applications, from configuration management to data processing. Rust&amp;rsquo;s approach to file I/O combines safety, performance, and ergonomics, providing powerful abstractions that prevent common errors while maintaining fine-grained control when needed. Unlike languages with implicit error handling or those that ignore potential failures, Rust&amp;rsquo;s type system ensures that file operations are handled correctly, making your code more robust and reliable.&lt;/p&gt;&#xA;&lt;p&gt;In this comprehensive guide, we&amp;rsquo;ll explore Rust&amp;rsquo;s file I/O capabilities, from basic reading and writing to advanced techniques like memory mapping and asynchronous I/O. You&amp;rsquo;ll learn how to work with files efficiently, handle errors gracefully, and choose the right approach for different scenarios. By the end, you&amp;rsquo;ll have a solid understanding of how to perform file operations in Rust that are both safe and performant.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes Advanced Deployment Strategies: Beyond Rolling Updates</title>
      <link>https://andrewodendaal.com/kubernetes-advanced-deployment-strategies/</link>
      <pubDate>Tue, 22 Apr 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/kubernetes-advanced-deployment-strategies/</guid>
      <description>&lt;p&gt;Kubernetes has revolutionized how we deploy and manage containerized applications, with its built-in rolling update strategy providing a solid foundation for zero-downtime deployments. However, as applications grow in complexity and criticality, more sophisticated deployment strategies become necessary to minimize risk, validate changes in production, and respond quickly to issues.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores advanced deployment strategies in Kubernetes that go beyond basic rolling updates. We&amp;rsquo;ll cover blue-green deployments, canary releases, A/B testing, and progressive delivery patterns, with practical examples and implementation guidance. Whether you&amp;rsquo;re looking to reduce deployment risk, test features with real users, or build a fully automated progressive delivery pipeline, this guide will help you implement the right strategy for your needs.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Security in Distributed Systems: Challenges and Best Practices</title>
      <link>https://andrewodendaal.com/security-distributed-systems/</link>
      <pubDate>Tue, 22 Apr 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/security-distributed-systems/</guid>
      <description>&lt;p&gt;Security in distributed systems presents unique challenges that go beyond traditional application security. With components spread across multiple machines, networks, and potentially different trust domains, the attack surface expands dramatically. Each communication channel, data store, and service becomes a potential entry point for attackers. As organizations increasingly adopt distributed architectures, understanding how to secure these complex systems has become a critical concern.&lt;/p&gt;&#xA;&lt;p&gt;This article explores the key security challenges in distributed systems and provides practical strategies and best practices to address them effectively.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes Networking: Advanced Cluster Communication</title>
      <link>https://andrewodendaal.com/articles/kubernetes-networking/</link>
      <pubDate>Mon, 21 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/kubernetes-networking/</guid>
      <description>&lt;p&gt;Master Kubernetes networking including CNI.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-and-setup&#34;&gt;Introduction and Setup&lt;/h2&gt;&#xA;&lt;p&gt;Kubernetes networking has a reputation for being complex, and honestly, that reputation is well-deserved. The challenge isn&amp;rsquo;t that the concepts are inherently difficult—it&amp;rsquo;s that they&amp;rsquo;re completely different from traditional networking. If you&amp;rsquo;re coming from a world of VLANs, subnets, and static IP addresses, Kubernetes networking requires a fundamental shift in thinking.&lt;/p&gt;&#xA;&lt;p&gt;The good news is that once you understand the core principles, Kubernetes networking is actually quite elegant. It&amp;rsquo;s dynamic, software-defined, and surprisingly simple—once you stop fighting it and start working with its design philosophy.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AI Governance Frameworks: Building Responsible AI Systems</title>
      <link>https://andrewodendaal.com/ai-governance-frameworks/</link>
      <pubDate>Fri, 18 Apr 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/ai-governance-frameworks/</guid>
      <description>&lt;p&gt;As artificial intelligence becomes increasingly integrated into critical business systems and decision-making processes, organizations face growing pressure to ensure their AI systems are developed and deployed responsibly. AI governance frameworks provide structured approaches to managing AI risks, ensuring ethical compliance, and maintaining regulatory alignment. Without proper governance, organizations risk developing AI systems that make biased decisions, violate privacy, lack transparency, or create other unintended consequences.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores AI governance frameworks, covering risk management, ethical principles, regulatory compliance, and best practices. Whether you&amp;rsquo;re just beginning to implement AI or looking to enhance governance of existing AI systems, these insights will help you build more responsible, trustworthy, and compliant AI capabilities.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust&#39;s Standard Library: Essential Tools for Every Project</title>
      <link>https://andrewodendaal.com/rust-standard-library/</link>
      <pubDate>Tue, 15 Apr 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-standard-library/</guid>
      <description>&lt;p&gt;Rust&amp;rsquo;s standard library is a carefully curated collection of core components that provide essential functionality for almost every Rust program. Unlike some languages that include &amp;ldquo;batteries&amp;rdquo; for nearly every use case, Rust&amp;rsquo;s standard library is intentionally focused, offering only the most fundamental tools while leaving more specialized functionality to the crate ecosystem. This design philosophy ensures that the standard library remains lean, well-maintained, and suitable for a wide range of environments, from embedded systems to web servers.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes Security: Cluster and Workload Protection</title>
      <link>https://andrewodendaal.com/articles/kubernetes-security/</link>
      <pubDate>Tue, 15 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/kubernetes-security/</guid>
      <description>&lt;p&gt;Security in Kubernetes isn&amp;rsquo;t just about locking down your cluster—it&amp;rsquo;s about building a defense-in-depth strategy that protects your workloads, data, and infrastructure while maintaining operational efficiency. This guide takes you through the essential security practices that separate production-ready clusters from development environments.&lt;/p&gt;&#xA;&lt;h2 id=&#34;security-foundations&#34;&gt;Security Foundations&lt;/h2&gt;&#xA;&lt;p&gt;Kubernetes security isn&amp;rsquo;t something you can add as an afterthought—it needs to be designed into your cluster architecture from the beginning. The difference between a secure cluster and a vulnerable one often comes down to understanding the fundamental security model and implementing proper controls at every layer.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Quantum Computing in Distributed Systems: Preparing for the Quantum Future</title>
      <link>https://andrewodendaal.com/quantum-computing-distributed-systems/</link>
      <pubDate>Thu, 10 Apr 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/quantum-computing-distributed-systems/</guid>
      <description>&lt;p&gt;Quantum computing represents one of the most significant technological revolutions on the horizon, with the potential to transform how we approach complex computational problems. As quantum computers continue to advance, their integration with distributed systems will create new possibilities and challenges for system architects and developers. While fully fault-tolerant quantum computers are still developing, organizations should begin preparing for the quantum future today.&lt;/p&gt;&#xA;&lt;p&gt;This article explores the intersection of quantum computing and distributed systems, examining how quantum technologies will impact distributed architectures and providing practical guidance on preparing for the quantum advantage.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building Fault-Tolerant Distributed Systems: Strategies and Patterns</title>
      <link>https://andrewodendaal.com/fault-tolerance-distributed-systems/</link>
      <pubDate>Sat, 05 Apr 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/fault-tolerance-distributed-systems/</guid>
      <description>&lt;p&gt;In distributed systems, failures are not just possible—they&amp;rsquo;re inevitable. Networks partition, servers crash, disks fail, and software bugs manifest in production. Building systems that can withstand these failures while maintaining acceptable service levels is the essence of fault tolerance. As distributed architectures become increasingly complex, mastering fault tolerance has never been more critical.&lt;/p&gt;&#xA;&lt;p&gt;This article explores strategies, patterns, and practical techniques for building fault-tolerant distributed systems that can gracefully handle failures without catastrophic service disruptions.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Macros in Rust: Metaprogramming Made Simple</title>
      <link>https://andrewodendaal.com/rust-macros/</link>
      <pubDate>Sat, 05 Apr 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-macros/</guid>
      <description>&lt;p&gt;Macros are one of Rust&amp;rsquo;s most powerful features, enabling metaprogramming—code that writes code. Unlike macros in C and C++, which are simple text substitution mechanisms, Rust&amp;rsquo;s macros are hygienic and operate on the abstract syntax tree (AST), making them both powerful and safe. They allow you to extend the language, reduce boilerplate, create domain-specific languages, and implement compile-time code generation without sacrificing Rust&amp;rsquo;s safety guarantees.&lt;/p&gt;&#xA;&lt;p&gt;In this comprehensive guide, we&amp;rsquo;ll explore Rust&amp;rsquo;s macro system in depth, from basic declarative macros to advanced procedural macros. You&amp;rsquo;ll learn how macros work, when to use them, and how to write your own macros to solve real-world problems. By the end, you&amp;rsquo;ll have a solid understanding of how to leverage Rust&amp;rsquo;s macro system to write more expressive, maintainable, and DRY (Don&amp;rsquo;t Repeat Yourself) code.&lt;/p&gt;</description>
    </item>
    <item>
      <title>API Security Best Practices: Protecting Your Digital Interfaces</title>
      <link>https://andrewodendaal.com/api-security-best-practices/</link>
      <pubDate>Tue, 01 Apr 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/api-security-best-practices/</guid>
      <description>&lt;p&gt;As organizations increasingly expose their services and data through APIs, these interfaces have become prime targets for attackers. According to recent studies, API attacks have grown by over 300% in the past two years, with the average organization experiencing dozens of API security incidents annually. The consequences of API breaches can be severe, ranging from data theft and service disruption to regulatory penalties and reputational damage.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores API security best practices, covering authentication, authorization, encryption, rate limiting, input validation, and monitoring. Whether you&amp;rsquo;re building new APIs or securing existing ones, these insights will help you implement robust protection against common vulnerabilities and attacks, ensuring your digital interfaces remain secure, reliable, and compliant with regulatory requirements.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust&#39;s Memory Safety Guarantees: How the Compiler Protects Your Code</title>
      <link>https://andrewodendaal.com/rust-memory-safety/</link>
      <pubDate>Sat, 29 Mar 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-memory-safety/</guid>
      <description>&lt;p&gt;Memory-related bugs are among the most pernicious issues in software development. Buffer overflows, use-after-free errors, double frees, and data races have plagued systems programming for decades, leading to security vulnerabilities, crashes, and unpredictable behavior. Traditional approaches to solving these problems involve either manual memory management (prone to human error) or garbage collection (which introduces runtime overhead and unpredictable pauses).&lt;/p&gt;&#xA;&lt;p&gt;Rust takes a revolutionary approach to memory safety by enforcing strict rules at compile time through its ownership system, borrow checker, and type system. This approach ensures memory safety without garbage collection, combining the performance of languages like C and C++ with the safety guarantees typically associated with higher-level languages.&lt;/p&gt;</description>
    </item>
    <item>
      <title>LLM Production Deployment: Architectures, Strategies, and Best Practices</title>
      <link>https://andrewodendaal.com/llm-production-deployment/</link>
      <pubDate>Tue, 25 Mar 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/llm-production-deployment/</guid>
      <description>&lt;p&gt;Large Language Models (LLMs) have revolutionized natural language processing and AI applications, enabling capabilities that were previously impossible. However, deploying these powerful models in production environments presents unique challenges due to their size, computational requirements, and the complexity of the systems needed to serve them efficiently.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores the architectures, strategies, and best practices for deploying LLMs in production. Whether you&amp;rsquo;re working with open-source models like Llama 2 or Mistral, fine-tuned variants, or commercial APIs like OpenAI&amp;rsquo;s GPT-4, this guide will help you navigate the complexities of building robust, scalable, and cost-effective LLM-powered applications.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust for Robotics in 2025: Libraries, Tools, and Best Practices</title>
      <link>https://andrewodendaal.com/rust-robotics-ecosystem/</link>
      <pubDate>Tue, 25 Mar 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-robotics-ecosystem/</guid>
      <description>&lt;p&gt;Robotics development presents unique challenges that demand high performance, reliability, and safety guarantees. From industrial automation and autonomous vehicles to consumer robots and drones, these systems must interact with the physical world in real-time while ensuring predictable behavior. Rust, with its combination of performance comparable to C/C++ and memory safety guarantees without garbage collection, has emerged as an excellent choice for robotics development.&lt;/p&gt;&#xA;&lt;p&gt;In this comprehensive guide, we&amp;rsquo;ll explore Rust&amp;rsquo;s ecosystem for robotics as it stands in early 2025. We&amp;rsquo;ll examine the libraries, frameworks, and tools that have matured over the years, providing developers with robust building blocks for creating efficient and reliable robotic systems. Whether you&amp;rsquo;re building industrial robots, autonomous drones, or experimental platforms, this guide will help you navigate the rich landscape of Rust&amp;rsquo;s robotics ecosystem.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Concurrency in Rust: Fearless Parallelism</title>
      <link>https://andrewodendaal.com/rust-concurrency/</link>
      <pubDate>Sat, 22 Mar 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-concurrency/</guid>
      <description>&lt;p&gt;Concurrency is notoriously difficult to get right. Race conditions, deadlocks, and other concurrency bugs are among the most insidious issues in software development, often manifesting only under specific timing conditions that are hard to reproduce and debug. Rust tackles this challenge head-on with a concurrency model that leverages the type system and ownership rules to prevent data races and other concurrency errors at compile time.&lt;/p&gt;&#xA;&lt;p&gt;In this comprehensive guide, we&amp;rsquo;ll explore Rust&amp;rsquo;s approach to concurrency, from basic threads to advanced asynchronous programming. You&amp;rsquo;ll learn how Rust&amp;rsquo;s ownership system enables &amp;ldquo;fearless concurrency&amp;rdquo;—the ability to write concurrent code with confidence that the compiler will catch common mistakes before they become runtime bugs. By the end, you&amp;rsquo;ll have a solid understanding of how to build efficient, safe concurrent applications in Rust.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Case Study: How We Cut Cloud Costs by 30% Without Sacrificing Performance</title>
      <link>https://andrewodendaal.com/case-study-cutting-cloud-costs-by-30-percent/</link>
      <pubDate>Sat, 15 Mar 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/case-study-cutting-cloud-costs-by-30-percent/</guid>
      <description>&lt;p&gt;Cloud cost optimization is a critical concern for organizations of all sizes, but particularly for growing companies that experience the shock of rapidly escalating cloud bills as they scale. At Ataiva, we recently worked with TechNova, a mid-sized SaaS company experiencing this exact challenge. Their monthly AWS bill had grown from $50,000 to over $200,000 in just 18 months as their customer base expanded, putting significant pressure on margins and raising concerns among investors.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Lifetimes in Rust: Managing References Safely</title>
      <link>https://andrewodendaal.com/rust-lifetimes/</link>
      <pubDate>Sat, 15 Mar 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-lifetimes/</guid>
      <description>&lt;p&gt;Lifetimes are one of Rust&amp;rsquo;s most distinctive and initially challenging features. While other aspects of Rust&amp;rsquo;s ownership system deal with who owns a value, lifetimes address how long references to that value remain valid. This mechanism ensures memory safety without a garbage collector by validating at compile time that no reference outlives the data it points to—a common source of bugs in languages like C and C++.&lt;/p&gt;&#xA;&lt;p&gt;In this comprehensive guide, we&amp;rsquo;ll explore Rust&amp;rsquo;s lifetime system in depth, from basic concepts to advanced patterns. You&amp;rsquo;ll learn how lifetimes work, when and how to use lifetime annotations, and techniques for handling complex borrowing scenarios. By the end, you&amp;rsquo;ll have a solid understanding of how lifetimes contribute to Rust&amp;rsquo;s memory safety guarantees and how to leverage them effectively in your code.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust for Computer Vision in 2025: Libraries, Tools, and Best Practices</title>
      <link>https://andrewodendaal.com/rust-computer-vision-ecosystem/</link>
      <pubDate>Sat, 15 Mar 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-computer-vision-ecosystem/</guid>
      <description>&lt;p&gt;Computer vision and image processing applications demand high performance, reliability, and often real-time capabilities. From autonomous vehicles and robotics to augmented reality and medical imaging, these systems process enormous amounts of visual data and must do so efficiently and safely. Rust, with its combination of performance comparable to C/C++ and memory safety guarantees without garbage collection, has emerged as an excellent choice for computer vision development.&lt;/p&gt;&#xA;&lt;p&gt;In this comprehensive guide, we&amp;rsquo;ll explore Rust&amp;rsquo;s ecosystem for computer vision and image processing as it stands in early 2025. We&amp;rsquo;ll examine the libraries, frameworks, and tools that have matured over the years, providing developers with robust building blocks for creating efficient and reliable vision applications. Whether you&amp;rsquo;re building real-time video processing systems, image analysis tools, or integrating computer vision with machine learning, this guide will help you navigate the rich landscape of Rust&amp;rsquo;s computer vision ecosystem.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes Operators: Custom Resource Management</title>
      <link>https://andrewodendaal.com/articles/kubernetes-operators/</link>
      <pubDate>Sat, 15 Mar 2025 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/kubernetes-operators/</guid>
      <description>&lt;p&gt;Build and deploy Kubernetes operators for automated application management.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-and-setup&#34;&gt;Introduction and Setup&lt;/h2&gt;&#xA;&lt;p&gt;When I first started working with Kubernetes, I quickly realized that managing complex applications required more than just deploying pods and services. That&amp;rsquo;s where operators come in - they&amp;rsquo;re like having an experienced system administrator encoded in software, continuously managing your applications with domain-specific knowledge.&lt;/p&gt;&#xA;&lt;h2 id=&#34;understanding-kubernetes-operators&#34;&gt;Understanding Kubernetes Operators&lt;/h2&gt;&#xA;&lt;p&gt;Operators extend Kubernetes by combining Custom Resource Definitions (CRDs) with controllers that understand how to manage specific applications. I&amp;rsquo;ve seen teams struggle with manual database backups, complex scaling decisions, and application lifecycle management. Operators solve these problems by automating operational tasks that would otherwise require human intervention.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Blockchain in Enterprise Distributed Systems: Beyond Cryptocurrencies</title>
      <link>https://andrewodendaal.com/blockchain-enterprise-applications/</link>
      <pubDate>Mon, 10 Mar 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/blockchain-enterprise-applications/</guid>
      <description>&lt;p&gt;While blockchain technology first gained prominence as the foundation for cryptocurrencies like Bitcoin, its potential applications extend far beyond digital currencies. At its core, blockchain is a distributed ledger technology that provides a secure, transparent, and immutable record of transactions across a decentralized network. These properties make it particularly valuable for enterprise distributed systems that require trust, transparency, and data integrity across multiple parties.&lt;/p&gt;&#xA;&lt;p&gt;This article explores practical enterprise applications of blockchain technology in distributed systems, examining implementation patterns, challenges, and best practices for organizations looking to leverage this transformative technology.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Infrastructure as Code Best Practices: Beyond the Basics</title>
      <link>https://andrewodendaal.com/infrastructure-as-code-best-practices/</link>
      <pubDate>Mon, 10 Mar 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/infrastructure-as-code-best-practices/</guid>
      <description>&lt;p&gt;Infrastructure as Code (IaC) has revolutionized how organizations manage their cloud resources, enabling teams to provision and manage infrastructure through machine-readable definition files rather than manual processes. While most teams have adopted basic IaC practices, many struggle to implement the advanced patterns and workflows that lead to truly maintainable, secure, and efficient infrastructure management.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores advanced Infrastructure as Code best practices that go beyond the basics. We&amp;rsquo;ll cover strategies for testing, security, modularity, team workflows, and more—all designed to help you elevate your IaC implementation from functional to exceptional. Whether you&amp;rsquo;re using Terraform, CloudFormation, Pulumi, or another IaC tool, these principles will help you build more robust infrastructure management capabilities.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Distributed Caching Strategies for High-Performance Applications</title>
      <link>https://andrewodendaal.com/distributed-caching-strategies/</link>
      <pubDate>Fri, 07 Mar 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/distributed-caching-strategies/</guid>
      <description>&lt;p&gt;In today&amp;rsquo;s digital landscape, where milliseconds can make the difference between user engagement and abandonment, caching has become an indispensable technique for building high-performance applications. As systems scale and distribute across multiple servers or regions, simple in-memory caching is no longer sufficient. This is where distributed caching comes into play—providing a shared cache that spans multiple servers, enabling consistent performance across distributed applications.&lt;/p&gt;&#xA;&lt;p&gt;This article explores distributed caching strategies, patterns, and implementations that can help you build faster, more scalable applications while reducing the load on your databases and backend services.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust for Audio Programming in 2025: Libraries, Tools, and Best Practices</title>
      <link>https://andrewodendaal.com/rust-audio-programming-ecosystem/</link>
      <pubDate>Wed, 05 Mar 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-audio-programming-ecosystem/</guid>
      <description>&lt;p&gt;Audio programming presents unique challenges that demand both high performance and reliability. From real-time digital signal processing to music creation tools, audio applications require low latency, predictable memory usage, and freedom from unexpected crashes or glitches. Rust, with its combination of performance comparable to C/C++ and memory safety guarantees without garbage collection, has emerged as an excellent choice for audio development.&lt;/p&gt;&#xA;&lt;p&gt;In this comprehensive guide, we&amp;rsquo;ll explore Rust&amp;rsquo;s ecosystem for audio programming as it stands in early 2025. We&amp;rsquo;ll examine the libraries, frameworks, and tools that have matured over the years, providing developers with robust building blocks for creating efficient and reliable audio applications. Whether you&amp;rsquo;re building digital audio workstations, audio plugins, embedded audio devices, or game audio engines, this guide will help you navigate the rich landscape of Rust&amp;rsquo;s audio programming ecosystem.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Traits in Rust: Interfaces with Superpowers</title>
      <link>https://andrewodendaal.com/rust-traits/</link>
      <pubDate>Wed, 05 Mar 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-traits/</guid>
      <description>&lt;p&gt;In object-oriented programming, interfaces define a contract that implementing classes must fulfill. Rust&amp;rsquo;s trait system serves a similar purpose but goes far beyond traditional interfaces, offering a powerful mechanism for defining shared behavior, enabling polymorphism, and creating flexible abstractions—all while maintaining Rust&amp;rsquo;s guarantees of memory safety and performance.&lt;/p&gt;&#xA;&lt;p&gt;Traits are one of Rust&amp;rsquo;s most distinctive and powerful features, enabling code reuse without inheritance and polymorphism without runtime overhead. In this comprehensive guide, we&amp;rsquo;ll explore Rust&amp;rsquo;s trait system in depth, from basic usage to advanced patterns. You&amp;rsquo;ll learn how to define and implement traits, use trait bounds, work with trait objects, and leverage traits to write generic code that is both flexible and efficient.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes Configuration Management</title>
      <link>https://andrewodendaal.com/articles/kubernetes-configuration/</link>
      <pubDate>Sat, 01 Mar 2025 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/kubernetes-configuration/</guid>
      <description>&lt;p&gt;Master Kubernetes configuration with ConfigMaps.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-and-setup&#34;&gt;Introduction and Setup&lt;/h2&gt;&#xA;&lt;p&gt;Configuration management in Kubernetes nearly broke me when I first started trying to use it. I spent three days debugging why my application couldn&amp;rsquo;t connect to the database, only to discover I&amp;rsquo;d misspelled &amp;ldquo;postgres&amp;rdquo; as &amp;ldquo;postgress&amp;rdquo; in a ConfigMap. That typo taught me more about Kubernetes configuration than any documentation ever could.&lt;/p&gt;&#xA;&lt;p&gt;The frustrating truth about Kubernetes configuration is that it looks simple until you need it to work reliably across environments. ConfigMaps and Secrets seem straightforward, but managing configuration at scale requires patterns that aren&amp;rsquo;t obvious from the basic examples.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Working with Structs and Enums in Rust: Building Robust Data Models</title>
      <link>https://andrewodendaal.com/rust-structs-enums/</link>
      <pubDate>Fri, 28 Feb 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-structs-enums/</guid>
      <description>&lt;p&gt;Data modeling is at the heart of software development, and the tools a language provides for representing data significantly impact code quality, maintainability, and correctness. Rust offers two powerful constructs for modeling data: structs and enums. These complementary tools allow developers to express complex data relationships with precision while leveraging Rust&amp;rsquo;s type system to prevent entire categories of bugs at compile time.&lt;/p&gt;&#xA;&lt;p&gt;In this comprehensive guide, we&amp;rsquo;ll explore Rust&amp;rsquo;s structs and enums in depth, from basic usage to advanced patterns. You&amp;rsquo;ll learn how to create flexible, type-safe data models that express your domain concepts clearly and leverage the compiler to catch errors early. By the end, you&amp;rsquo;ll have a solid understanding of when and how to use each construct effectively in your Rust projects.&lt;/p&gt;</description>
    </item>
    <item>
      <title>SLO and SLI Implementation Guide: Building Reliable Services</title>
      <link>https://andrewodendaal.com/slo-sli-implementation-guide/</link>
      <pubDate>Tue, 25 Feb 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/slo-sli-implementation-guide/</guid>
      <description>&lt;p&gt;In today&amp;rsquo;s digital landscape, reliability has become a critical differentiator for services and products. Users expect systems to be available, responsive, and correct—all the time. However, pursuing 100% reliability is not only prohibitively expensive but often unnecessary. This is where Service Level Objectives (SLOs) and Service Level Indicators (SLIs) come in, providing a framework to define, measure, and maintain appropriate reliability targets that balance user expectations with engineering costs.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores the practical aspects of implementing SLOs and SLIs in your organization. We&amp;rsquo;ll cover everything from selecting the right metrics to building the technical infrastructure needed to track them, and establishing the processes to act on the resulting data. Whether you&amp;rsquo;re just starting with reliability engineering or looking to refine your existing practices, this guide provides actionable insights to help you build more reliable services.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Pattern Matching in Rust: Powerful, Expressive, and Safe</title>
      <link>https://andrewodendaal.com/rust-pattern-matching/</link>
      <pubDate>Sat, 15 Feb 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-pattern-matching/</guid>
      <description>&lt;p&gt;Pattern matching stands as one of Rust&amp;rsquo;s most powerful and distinctive features, elevating it beyond a mere control flow mechanism to a fundamental aspect of the language&amp;rsquo;s design philosophy. Unlike the simple switch statements found in many languages, Rust&amp;rsquo;s pattern matching system provides a rich, expressive way to destructure complex data types, handle multiple conditions, and ensure exhaustive checking of all possible cases. This combination of power and safety makes pattern matching an essential tool in every Rust programmer&amp;rsquo;s toolkit.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust&#39;s Blockchain Development Ecosystem in 2025</title>
      <link>https://andrewodendaal.com/rust-blockchain-development-ecosystem/</link>
      <pubDate>Sat, 15 Feb 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-blockchain-development-ecosystem/</guid>
      <description>&lt;p&gt;Blockchain technology has evolved significantly since the introduction of Bitcoin in 2009, expanding beyond cryptocurrencies to encompass smart contracts, decentralized finance (DeFi), non-fungible tokens (NFTs), and various forms of decentralized applications (dApps). As blockchain systems have grown more complex and demanding, the need for programming languages that prioritize safety, performance, and reliability has become increasingly apparent. Rust, with its focus on memory safety without sacrificing performance, has emerged as a leading language for blockchain development.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Scaling Startups with Cloud Best Practices</title>
      <link>https://andrewodendaal.com/scaling-startups-with-cloud-best-practices/</link>
      <pubDate>Sat, 15 Feb 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/scaling-startups-with-cloud-best-practices/</guid>
      <description>&lt;p&gt;Scaling a startup&amp;rsquo;s technical infrastructure is one of the most challenging aspects of company growth. As user numbers increase, feature sets expand, and market demands evolve, the technology decisions made in the early days are put to the test. Cloud computing has revolutionized how startups scale, offering unprecedented flexibility and power—but also introducing complexity and potential pitfalls.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores cloud best practices for scaling startups, covering everything from architectural patterns and cost optimization to security, DevOps, and organizational strategies. Whether you&amp;rsquo;re experiencing hypergrowth or planning for sustainable expansion, these practices will help you build a robust, efficient, and adaptable cloud infrastructure that supports your business goals.&lt;/p&gt;</description>
    </item>
    <item>
      <title>MLOps Pipeline Architecture: Building Production-Ready ML Systems</title>
      <link>https://andrewodendaal.com/mlops-pipeline-architecture/</link>
      <pubDate>Wed, 12 Feb 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/mlops-pipeline-architecture/</guid>
      <description>&lt;p&gt;Machine learning has moved beyond research and experimentation to become a critical component of many production systems. However, successfully deploying and maintaining ML models in production requires more than just good data science—it demands robust engineering practices, automated pipelines, and governance frameworks. This is where MLOps (Machine Learning Operations) comes in, bridging the gap between ML development and operational excellence.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores the architecture of production-grade MLOps pipelines, covering everything from data preparation to model monitoring. Whether you&amp;rsquo;re building your first ML system or looking to improve your existing ML operations, this guide provides practical insights and implementation patterns for creating reliable, scalable, and governable machine learning systems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Error Handling in Rust: Mastering Result and Option Types</title>
      <link>https://andrewodendaal.com/rust-error-handling/</link>
      <pubDate>Wed, 05 Feb 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-error-handling/</guid>
      <description>&lt;p&gt;Error handling is a critical aspect of writing reliable software, yet it&amp;rsquo;s often treated as an afterthought in many programming languages. Some languages rely on exceptions that can be easily overlooked, while others use error codes that can be ignored. Rust takes a fundamentally different approach by making error handling explicit through its type system, primarily using the &lt;code&gt;Result&lt;/code&gt; and &lt;code&gt;Option&lt;/code&gt; types. This approach ensures that errors are handled deliberately rather than by accident or omission. This error handling system works hand-in-hand with &lt;a href=&#34;https://andrewodendaal.com/rust-ownership-system&#34;&gt;Rust&amp;rsquo;s ownership system&lt;/a&gt; to create safe, reliable code.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust&#39;s Distributed Systems Ecosystem in 2025</title>
      <link>https://andrewodendaal.com/rust-distributed-systems-ecosystem/</link>
      <pubDate>Wed, 05 Feb 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-distributed-systems-ecosystem/</guid>
      <description>&lt;p&gt;Distributed systems have become the backbone of modern computing infrastructure, powering everything from cloud services and microservices architectures to blockchain networks and IoT platforms. Building these systems presents unique challenges: network partitions, partial failures, consistency issues, and the inherent complexity of coordinating multiple nodes. Rust, with its focus on reliability, performance, and fine-grained control, has emerged as an excellent language for tackling these challenges.&lt;/p&gt;&#xA;&lt;p&gt;In this comprehensive guide, we&amp;rsquo;ll explore Rust&amp;rsquo;s ecosystem for building distributed systems as it stands in early 2025. We&amp;rsquo;ll examine the libraries, frameworks, and tools that have matured over the years, providing developers with robust building blocks for creating reliable and scalable distributed applications. Whether you&amp;rsquo;re building a microservices architecture, a peer-to-peer network, or a distributed database, this guide will help you navigate the rich landscape of Rust&amp;rsquo;s distributed systems ecosystem.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust&#39;s Type System: A Deep Dive into Safety and Expressiveness</title>
      <link>https://andrewodendaal.com/rust-type-system/</link>
      <pubDate>Fri, 31 Jan 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-type-system/</guid>
      <description>&lt;p&gt;Rust&amp;rsquo;s type system stands as one of its most powerful features, combining the expressiveness of modern languages with the safety guarantees that systems programming demands. Unlike dynamically typed languages that defer type checking to runtime, or statically typed languages with escape hatches that can lead to undefined behavior, Rust&amp;rsquo;s type system is designed to catch errors at compile time while remaining flexible enough for real-world programming challenges.&lt;/p&gt;&#xA;&lt;p&gt;In this comprehensive exploration, we&amp;rsquo;ll dive deep into Rust&amp;rsquo;s type system, examining how it balances safety and expressiveness. We&amp;rsquo;ll cover everything from basic types to advanced type-level programming techniques, providing you with the knowledge to leverage Rust&amp;rsquo;s type system to its fullest potential. By the end, you&amp;rsquo;ll understand why Rust&amp;rsquo;s approach to types is a game-changer for building reliable software.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Borrowing and References in Rust: The Art of Safe Memory Sharing</title>
      <link>https://andrewodendaal.com/rust-borrowing-references/</link>
      <pubDate>Sat, 25 Jan 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-borrowing-references/</guid>
      <description>&lt;p&gt;In our previous exploration of Rust&amp;rsquo;s ownership system, we established how Rust manages memory through a set of compile-time rules that track the ownership of values. While ownership provides the foundation for Rust&amp;rsquo;s memory safety guarantees, constantly transferring ownership would make code unnecessarily complex and inefficient. This is where Rust&amp;rsquo;s borrowing system comes into play—a sophisticated mechanism that allows you to use values without transferring ownership.&lt;/p&gt;&#xA;&lt;p&gt;Borrowing, implemented through references, is what makes Rust&amp;rsquo;s ownership model practical for everyday programming. It enables multiple parts of your code to access the same data concurrently while still maintaining Rust&amp;rsquo;s strict safety guarantees. In this comprehensive guide, we&amp;rsquo;ll dive deep into Rust&amp;rsquo;s borrowing system, explore the nuances of references, and uncover advanced patterns that will elevate your Rust programming skills.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Implementing Distributed Tracing: A Practical Guide for Modern Applications</title>
      <link>https://andrewodendaal.com/distributed-tracing-implementation/</link>
      <pubDate>Mon, 20 Jan 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/distributed-tracing-implementation/</guid>
      <description>&lt;p&gt;In today&amp;rsquo;s world of distributed systems and microservices architectures, understanding the flow of requests across dozens or even hundreds of services has become increasingly challenging. When a user experiences a slow response or an error, pinpointing the root cause can feel like searching for a needle in a haystack. This is where distributed tracing comes in—providing a powerful lens through which we can observe, understand, and optimize our distributed applications.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust Security Features and Best Practices in 2025</title>
      <link>https://andrewodendaal.com/rust-security-features-best-practices/</link>
      <pubDate>Mon, 20 Jan 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-security-features-best-practices/</guid>
      <description>&lt;p&gt;Security has become a paramount concern in software development, with vulnerabilities and exploits causing billions in damages annually. As systems become more interconnected and complex, the need for programming languages that prioritize security by design has never been greater. Rust, with its focus on memory safety without sacrificing performance, has positioned itself as a leading language for security-critical applications. By eliminating entire classes of bugs at compile time, Rust provides developers with powerful tools to write secure code from the ground up.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes Pod Security Policies: Best Practices for Cluster Protection</title>
      <link>https://andrewodendaal.com/kubernetes-pod-security-policies/</link>
      <pubDate>Wed, 15 Jan 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/kubernetes-pod-security-policies/</guid>
      <description>&lt;p&gt;As Kubernetes adoption continues to grow across organizations of all sizes, securing containerized workloads has become a critical concern. Pod Security Policies (PSPs) and their successor, Pod Security Admission, represent Kubernetes&amp;rsquo; native approach to enforcing security best practices at the pod level. By controlling the security-sensitive aspects of pod specifications, these mechanisms help prevent privilege escalation and limit the potential damage from container-based attacks.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores how to implement effective pod security controls in Kubernetes, covering both the legacy Pod Security Policies and the newer Pod Security Standards and Admission Controller. You&amp;rsquo;ll learn practical strategies for balancing security with operational requirements, implementing defense in depth, and addressing common security challenges in Kubernetes environments.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Understanding Rust&#39;s Ownership System: The Key to Memory Safety</title>
      <link>https://andrewodendaal.com/rust-ownership-system/</link>
      <pubDate>Wed, 15 Jan 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-ownership-system/</guid>
      <description>&lt;p&gt;Rust&amp;rsquo;s ownership system stands as one of the language&amp;rsquo;s most revolutionary contributions to systems programming. While other languages rely on garbage collection or manual memory management, Rust introduces a third approach: ownership with borrowing. This system enables Rust to guarantee memory safety at compile time without runtime overhead, preventing entire categories of bugs that plague other languages. For developers coming from languages like C++, Java, or Python, understanding ownership is the key to unlocking Rust&amp;rsquo;s full potential. This ownership system is also a key part of &lt;a href=&#34;https://andrewodendaal.com/rust-security-features-best-practices&#34;&gt;Rust&amp;rsquo;s security features and best practices&lt;/a&gt; and works hand-in-hand with &lt;a href=&#34;https://andrewodendaal.com/rust-error-handling&#34;&gt;Rust&amp;rsquo;s error handling system&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Distributed Systems Fundamentals: Core Concepts Every Developer Should Know</title>
      <link>https://andrewodendaal.com/distributed-systems-fundamentals/</link>
      <pubDate>Tue, 07 Jan 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/distributed-systems-fundamentals/</guid>
      <description>&lt;p&gt;In today&amp;rsquo;s interconnected world, distributed systems have become the backbone of modern software architecture. From global e-commerce platforms to real-time collaboration tools, distributed systems enable applications to scale beyond the confines of a single machine, providing resilience, performance, and global reach. However, with these benefits come significant challenges that every developer must understand to build effective distributed applications.&lt;/p&gt;&#xA;&lt;p&gt;This article explores the fundamental concepts of distributed systems, providing a solid foundation for developers looking to navigate this complex but essential domain. We&amp;rsquo;ll examine the core principles, common challenges, and practical approaches that form the basis of distributed system design.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Getting Started with Rust: A Comprehensive Installation and Setup Guide</title>
      <link>https://andrewodendaal.com/rust-installation-setup/</link>
      <pubDate>Sun, 05 Jan 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-installation-setup/</guid>
      <description>&lt;p&gt;Rust has emerged as one of the most promising programming languages of the decade, offering an unparalleled combination of performance, reliability, and productivity. Whether you&amp;rsquo;re a seasoned developer looking to expand your toolkit or a newcomer to systems programming, setting up Rust correctly is your first step toward mastering this powerful language. This comprehensive guide will walk you through the installation process across different operating systems, help you configure your development environment, and introduce you to essential tools in the Rust ecosystem.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust Interoperability: Seamlessly Working with Other Languages in 2025</title>
      <link>https://andrewodendaal.com/rust-interoperability-other-languages/</link>
      <pubDate>Sun, 05 Jan 2025 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-interoperability-other-languages/</guid>
      <description>&lt;p&gt;In today&amp;rsquo;s complex software landscape, few applications are built using a single programming language. Different languages offer different strengths, and existing codebases represent significant investments that can&amp;rsquo;t be rewritten overnight. This reality makes language interoperability—the ability for code written in different languages to work together seamlessly—a critical feature for any modern programming language. Rust, with its focus on safety, performance, and practicality, has developed robust interoperability capabilities that allow it to integrate smoothly with a wide range of other languages.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust&#39;s unwrap: Unlocking Its Potential and Avoiding Pitfalls</title>
      <link>https://andrewodendaal.com/rust-unwrap-function/</link>
      <pubDate>Mon, 30 Dec 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-unwrap-function/</guid>
      <description>&lt;p&gt;Learn how to effectively use Rust&amp;rsquo;s &lt;code&gt;unwrap&lt;/code&gt; method, including its benefits, risks, and safer alternatives, in this comprehensive guide. At the heart of its error-handling mechanism lie the &lt;code&gt;Option&lt;/code&gt; and &lt;code&gt;Result&lt;/code&gt; types, which provide developers with tools to explicitly manage the presence or absence of values and handle potential errors in computations. However, there exists a method—&lt;code&gt;unwrap&lt;/code&gt;—that offers a shortcut for extracting values from these types. While powerful, its misuse can lead to unexpected panics, making it a topic of both fascination and caution among Rustaceans.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Optimizing the Two Sum Problem: Techniques, Trade-offs, and Performance</title>
      <link>https://andrewodendaal.com/optimizing-the-two-sum-problem-techniques-trade-offs-and-performance/</link>
      <pubDate>Fri, 13 Dec 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/optimizing-the-two-sum-problem-techniques-trade-offs-and-performance/</guid>
      <description>&lt;h2 id=&#34;the-problem-statement&#34;&gt;The Problem Statement&lt;/h2&gt;&#xA;&lt;p&gt;One of the classic algorithm problems frequently encountered in interviews is the Two Sum problem. It challenges you to find two indices in an array such that the sum of the elements at these indices equals a given target. It seems simple, but the real depth lies in optimizing its solution.&lt;/p&gt;&#xA;&lt;p&gt;There is this common programming question that goes something like this:&lt;/p&gt;&#xA;&lt;p&gt;Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Chaos Engineering Practices: Building Resilient Systems Through Controlled Failure</title>
      <link>https://andrewodendaal.com/chaos-engineering-practices/</link>
      <pubDate>Tue, 10 Dec 2024 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/chaos-engineering-practices/</guid>
      <description>&lt;p&gt;In today&amp;rsquo;s complex distributed systems, failures are inevitable. Networks partition, services crash, dependencies slow down, and hardware fails. Traditional testing approaches often fall short in identifying how these systems behave under unexpected conditions. Chaos Engineering has emerged as a disciplined approach to identify weaknesses in distributed systems by deliberately injecting failures in a controlled manner.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores chaos engineering principles, tools, implementation strategies, and real-world examples. Whether you&amp;rsquo;re just starting your reliability journey or looking to enhance your existing practices, these approaches will help you build more resilient systems that can withstand the turbulence of production environments.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Low-Code/No-Code Platforms: Democratizing Application Development</title>
      <link>https://andrewodendaal.com/low-code-no-code-platforms/</link>
      <pubDate>Fri, 15 Nov 2024 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/low-code-no-code-platforms/</guid>
      <description>&lt;p&gt;The demand for software applications continues to outpace the availability of professional developers, creating significant backlogs and slowing digital transformation initiatives. Low-code and no-code development platforms have emerged as powerful solutions to this challenge, enabling both professional developers and business users to build applications with minimal traditional coding. By abstracting away complex technical details through visual interfaces and pre-built components, these platforms democratize application development and accelerate delivery.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores low-code and no-code platforms, covering their capabilities, use cases, implementation strategies, governance, and best practices. Whether you&amp;rsquo;re evaluating these platforms for your organization or looking to optimize your existing implementation, these insights will help you leverage low-code/no-code approaches to drive innovation while maintaining enterprise standards.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes Fundamentals: Container Orchestration Basics</title>
      <link>https://andrewodendaal.com/articles/kubernetes-fundamentals/</link>
      <pubDate>Sun, 10 Nov 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/kubernetes-fundamentals/</guid>
      <description>&lt;p&gt;Learn the core concepts and practical skills needed to deploy, manage, and scale containerized applications using Kubernetes.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-and-setup&#34;&gt;Introduction and Setup&lt;/h2&gt;&#xA;&lt;h1 id=&#34;introduction-to-kubernetes&#34;&gt;Introduction to Kubernetes&lt;/h1&gt;&#xA;&lt;p&gt;Container orchestration sounds complicated, but the problem it solves is simple: how do you run dozens or hundreds of containers across multiple servers without losing your sanity? Docker works great for single containers, but when you need to manage entire applications with databases, web servers, and background workers, you quickly realize you need something more sophisticated.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cloud Cost Optimization: Maximizing ROI</title>
      <link>https://andrewodendaal.com/articles/cloud-cost-optimization/</link>
      <pubDate>Wed, 06 Nov 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/cloud-cost-optimization/</guid>
      <description>&lt;p&gt;Master cloud cost optimization strategies.&lt;/p&gt;&#xA;&lt;h4 id=&#34;understanding-cloud-waste-the-hidden-cost-of-convenience&#34;&gt;Understanding Cloud Waste: The Hidden Cost of Convenience&lt;/h4&gt;&#xA;&lt;p&gt;Before diving into solutions, it&amp;rsquo;s important to understand the common sources of cloud waste:&lt;/p&gt;&#xA;&lt;h4 id=&#34;1-idle-resources&#34;&gt;1. Idle Resources&lt;/h4&gt;&#xA;&lt;p&gt;Resources that are provisioned but not actively used:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Running instances with low CPU utilization&lt;/li&gt;&#xA;&lt;li&gt;Provisioned databases with minimal connections&lt;/li&gt;&#xA;&lt;li&gt;Load balancers routing traffic to a single instance&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h4 id=&#34;2-overprovisioned-resources&#34;&gt;2. Overprovisioned Resources&lt;/h4&gt;&#xA;&lt;p&gt;Resources allocated beyond actual requirements:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Instances with more CPU/memory than needed&lt;/li&gt;&#xA;&lt;li&gt;Databases with excessive provisioned IOPS&lt;/li&gt;&#xA;&lt;li&gt;Oversized storage volumes with low utilization&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h4 id=&#34;3-orphaned-resources&#34;&gt;3. Orphaned Resources&lt;/h4&gt;&#xA;&lt;p&gt;Resources that are no longer needed but still incurring costs:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cloud Performance Tuning: Optimization Strategies</title>
      <link>https://andrewodendaal.com/articles/cloud-performance-tuning/</link>
      <pubDate>Wed, 06 Nov 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/cloud-performance-tuning/</guid>
      <description>&lt;p&gt;Optimize cloud application performance with advanced tuning techniques.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-to-cloud-performance-tuning&#34;&gt;Introduction to Cloud Performance Tuning&lt;/h2&gt;&#xA;&lt;p&gt;Working with hundreds of customer applications has taught me that performance problems follow predictable patterns. Whether it&amp;rsquo;s a startup scaling their first viral app or an enterprise migrating legacy systems, the same fundamental issues appear repeatedly: chatty applications making too many API calls, databases overwhelmed by inefficient queries, and auto-scaling policies that react too slowly to traffic spikes.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Observability Platforms Comparison: Choosing the Right Monitoring Solution</title>
      <link>https://andrewodendaal.com/observability-platforms-comparison/</link>
      <pubDate>Tue, 05 Nov 2024 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/observability-platforms-comparison/</guid>
      <description>&lt;p&gt;As systems grow more complex and distributed, traditional monitoring approaches fall short. Modern observability platforms have emerged to provide deeper insights into system behavior, performance, and health. However, choosing the right observability solution for your organization can be challenging given the wide range of options available, each with different strengths, architectures, and pricing models.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide compares leading observability platforms including Prometheus, Grafana, Datadog, New Relic, Elastic Observability, and Dynatrace. We&amp;rsquo;ll examine their features, architectures, pricing models, and ideal use cases to help you make an informed decision for your specific needs.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Microservices vs Monoliths: Architecture Patterns</title>
      <link>https://andrewodendaal.com/articles/architecture-microservices-vs-monoliths/</link>
      <pubDate>Tue, 05 Nov 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/architecture-microservices-vs-monoliths/</guid>
      <description>&lt;p&gt;Understand the trade-offs between microservices and monolithic architectures.&lt;/p&gt;&#xA;&lt;h4 id=&#34;understanding-the-architectural-patterns&#34;&gt;Understanding the Architectural Patterns&lt;/h4&gt;&#xA;&lt;p&gt;Before diving into comparisons, let&amp;rsquo;s establish a clear understanding of each architectural pattern.&lt;/p&gt;&#xA;&lt;h4 id=&#34;monolithic-architecture&#34;&gt;Monolithic Architecture&lt;/h4&gt;&#xA;&lt;p&gt;A monolithic architecture is a traditional unified model where all components of an application are interconnected and interdependent, functioning as a single unit.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Key Characteristics:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Single Codebase&lt;/strong&gt;: All functionality exists in a single codebase&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Shared Database&lt;/strong&gt;: Components typically share a single database&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Unified Deployment&lt;/strong&gt;: The entire application is deployed as a single unit&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Tightly Coupled&lt;/strong&gt;: Components are interconnected and interdependent&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Vertical Scaling&lt;/strong&gt;: Typically scaled by adding more resources to a single server&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example Structure of a Monolithic E-commerce Application:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Migrate Docker Repositories to a New DockerHub Username</title>
      <link>https://andrewodendaal.com/migrate-docker-repositories-new-username/</link>
      <pubDate>Mon, 04 Nov 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/migrate-docker-repositories-new-username/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;ve ever tried to rename your DockerHub username, you know there’s no direct way to do it. For many users, creating a new DockerHub account and transferring all their repositories is the best option. This guide walks you through automating the process of migrating all Docker images from an old username to a new one. We’ll share a complete shell script, so you don’t have to manually tag and push each image, saving you time and effort.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python 3.13 No-GIL Mode: How to Unlock True Multi-Threading and Boost Performance</title>
      <link>https://andrewodendaal.com/python-3-13-no-gil-multi-threading-performance/</link>
      <pubDate>Fri, 01 Nov 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/python-3-13-no-gil-multi-threading-performance/</guid>
      <description>&lt;p&gt;Python 3.13 has quietly introduced a game-changing experimental feature: &lt;strong&gt;no-GIL mode&lt;/strong&gt;! For years, the &lt;strong&gt;Global Interpreter Lock (GIL)&lt;/strong&gt; has been a barrier to true parallelism in Python, limiting Python threads to one at a time. But with Python 3.13, you can now compile Python to run without the GIL, allowing Python threads to fully utilize multiple cores. Let&amp;rsquo;s dive into why this matters, how to try it out, and what kinds of performance gains you might see.&lt;/p&gt;</description>
    </item>
    <item>
      <title>API-First Development: Building Scalable Interfaces</title>
      <link>https://andrewodendaal.com/articles/architecture-api-first-development/</link>
      <pubDate>Fri, 25 Oct 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/architecture-api-first-development/</guid>
      <description>&lt;p&gt;Master API-first development methodologies.&lt;/p&gt;&#xA;&lt;h4 id=&#34;api-first-fundamentals&#34;&gt;API-First Fundamentals&lt;/h4&gt;&#xA;&lt;h4 id=&#34;core-principles-and-benefits&#34;&gt;Core Principles and Benefits&lt;/h4&gt;&#xA;&lt;p&gt;Understanding the foundational concepts:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;API-First Definition&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Designing APIs before implementing applications&lt;/li&gt;&#xA;&lt;li&gt;Treating APIs as first-class products&lt;/li&gt;&#xA;&lt;li&gt;Focusing on consumer needs and use cases&lt;/li&gt;&#xA;&lt;li&gt;Establishing clear contracts between systems&lt;/li&gt;&#xA;&lt;li&gt;Enabling parallel development workflows&lt;/li&gt;&#xA;&lt;li&gt;Creating consistent, reusable interfaces&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Traditional vs. API-First Approach&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Traditional Development:&#xA;Requirements → Application Development → API Creation → Integration → Deployment&#xA;&#xA;API-First Development:&#xA;Requirements → API Design → API Contract → Parallel Development → Integration → Deployment&#xA;                                            ├─ Frontend Development&#xA;                                            ├─ Backend Implementation&#xA;                                            └─ Consumer Integration&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Key Benefits&lt;/strong&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes vs Serverless: Architecture Decision Guide</title>
      <link>https://andrewodendaal.com/articles/architecture-kubernetes-vs-serverless/</link>
      <pubDate>Thu, 17 Oct 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/architecture-kubernetes-vs-serverless/</guid>
      <description>&lt;p&gt;Compare Kubernetes and serverless architectures.&lt;/p&gt;&#xA;&lt;h4 id=&#34;understanding-the-core-concepts&#34;&gt;Understanding the Core Concepts&lt;/h4&gt;&#xA;&lt;p&gt;Before diving into comparisons, let&amp;rsquo;s establish a clear understanding of each approach.&lt;/p&gt;&#xA;&lt;h4 id=&#34;kubernetes-container-orchestration-at-scale&#34;&gt;Kubernetes: Container Orchestration at Scale&lt;/h4&gt;&#xA;&lt;p&gt;Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Key Components:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Nodes&lt;/strong&gt;: Physical or virtual machines that form the Kubernetes cluster&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Pods&lt;/strong&gt;: The smallest deployable units, containing one or more containers&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Deployments&lt;/strong&gt;: Controllers that manage pod replication and updates&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Services&lt;/strong&gt;: Abstractions that define how to access pods&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;ConfigMaps and Secrets&lt;/strong&gt;: Resources for configuration and sensitive data&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Namespaces&lt;/strong&gt;: Virtual clusters for resource isolation&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Ingress&lt;/strong&gt;: Rules for external access to services&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Core Capabilities:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Benefits of Cloud-Native Applications: Building for the Modern Infrastructure</title>
      <link>https://andrewodendaal.com/benefits-of-cloud-native-applications/</link>
      <pubDate>Tue, 15 Oct 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/benefits-of-cloud-native-applications/</guid>
      <description>&lt;p&gt;The landscape of application development and deployment has undergone a profound transformation over the past decade. Traditional monolithic applications hosted on physical servers have given way to cloud-native applications designed specifically to leverage the capabilities of modern cloud infrastructure. This shift isn&amp;rsquo;t merely a change in hosting environment—it represents a fundamental reimagining of how applications are built, deployed, and operated.&lt;/p&gt;&#xA;&lt;p&gt;Cloud-native applications are specifically designed to thrive in cloud environments, embracing principles like containerization, microservices architecture, declarative APIs, and immutable infrastructure. These applications are built to harness the full potential of cloud platforms, delivering unprecedented levels of scalability, resilience, and agility.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Event-Driven Architecture: Building Reactive Systems</title>
      <link>https://andrewodendaal.com/articles/architecture-event-driven-architecture/</link>
      <pubDate>Tue, 15 Oct 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/architecture-event-driven-architecture/</guid>
      <description>&lt;p&gt;Design and implement event-driven architectures using messaging patterns.&lt;/p&gt;&#xA;&lt;h3 id=&#34;understanding-event-driven-architecture&#34;&gt;Understanding Event-Driven Architecture&lt;/h3&gt;&#xA;&lt;p&gt;Before diving into specific patterns, let&amp;rsquo;s establish a clear understanding of what constitutes an event-driven architecture.&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-is-an-event&#34;&gt;What is an Event?&lt;/h3&gt;&#xA;&lt;p&gt;An event is a record of something that has happened—a fact. Events are immutable, meaning once an event has occurred, it cannot be changed or deleted. Events typically include:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A unique identifier&lt;/li&gt;&#xA;&lt;li&gt;Event type or name&lt;/li&gt;&#xA;&lt;li&gt;Timestamp&lt;/li&gt;&#xA;&lt;li&gt;Payload (the data describing what happened)&lt;/li&gt;&#xA;&lt;li&gt;Metadata (additional contextual information)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Examples of events include:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust Performance Optimization: High-Performance Programming</title>
      <link>https://andrewodendaal.com/articles/rust-performance-optimization/</link>
      <pubDate>Sun, 06 Oct 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/rust-performance-optimization/</guid>
      <description>&lt;p&gt;Optimize Rust applications for maximum performance with profiling.&lt;/p&gt;&#xA;&lt;h4 id=&#34;performance-optimization-fundamentals&#34;&gt;Performance Optimization Fundamentals&lt;/h4&gt;&#xA;&lt;p&gt;Before diving into specific techniques, let&amp;rsquo;s establish some fundamental principles:&lt;/p&gt;&#xA;&lt;h4 id=&#34;the-optimization-process&#34;&gt;The Optimization Process&lt;/h4&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;1. Measure - Establish a baseline and identify bottlenecks&#xA;2. Analyze - Understand why the bottlenecks exist&#xA;3. Improve - Make targeted changes to address the bottlenecks&#xA;4. Verify - Measure again to confirm improvements&#xA;5. Repeat - Continue until performance goals are met&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h4 id=&#34;premature-optimization&#34;&gt;Premature Optimization&lt;/h4&gt;&#xA;&lt;p&gt;As Donald Knuth famously said, &amp;ldquo;Premature optimization is the root of all evil.&amp;rdquo; Focus on writing clear, correct code first, then optimize where necessary:&lt;/p&gt;</description>
    </item>
    <item>
      <title>AI-Powered Distributed Systems: Architectures and Implementation Patterns</title>
      <link>https://andrewodendaal.com/ai-powered-distributed-systems/</link>
      <pubDate>Sat, 05 Oct 2024 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/ai-powered-distributed-systems/</guid>
      <description>&lt;p&gt;The integration of artificial intelligence (AI) with distributed systems represents one of the most significant technological advancements in recent years. As distributed systems grow in complexity, traditional management approaches struggle to keep pace. AI offers powerful capabilities to enhance these systems with self-healing, intelligent scaling, anomaly detection, and automated optimization. This convergence is creating a new generation of distributed systems that are more resilient, efficient, and adaptive than ever before.&lt;/p&gt;</description>
    </item>
    <item>
      <title>API Security Guide: Protect Your Application from Cyber Threats</title>
      <link>https://andrewodendaal.com/api-security-guide-protect-your-application-from-cyber-threats/</link>
      <pubDate>Wed, 02 Oct 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/api-security-guide-protect-your-application-from-cyber-threats/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/api-security-guide-protect-your-application-from-cyber-threats1.jpg&#34; alt=&#34;API Security&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Welcome to our journey into the world of API Security, Definitions, and Meanings!&lt;/p&gt;&#xA;&lt;p&gt;My name is Alex, and I&amp;rsquo;m a cybersecurity expert with a passion for helping individuals and organizations understand the importance of protecting their APIs. With over 10 years of experience in the field, I&amp;rsquo;ve seen firsthand how a single misconfigured API can lead to catastrophic consequences.&lt;/p&gt;&#xA;&lt;p&gt;So, why am I so passionate about API security? Well, it all started when I was working on a project that involved developing a custom API for a client. As I delved deeper into the world of APIs, I realized just how vulnerable they were to attacks. A single malicious actor could exploit a weakness in our API and gain access to sensitive data or disrupt the entire system.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust Design Patterns: Idiomatic Programming</title>
      <link>https://andrewodendaal.com/articles/rust-design-patterns/</link>
      <pubDate>Sat, 28 Sep 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/rust-design-patterns/</guid>
      <description>&lt;p&gt;Master Rust design patterns.&lt;/p&gt;&#xA;&lt;h4 id=&#34;memory-management-patterns&#34;&gt;Memory Management Patterns&lt;/h4&gt;&#xA;&lt;p&gt;Rust&amp;rsquo;s ownership system influences how we manage resources:&lt;/p&gt;&#xA;&lt;h4 id=&#34;raii-resource-acquisition-is-initialization&#34;&gt;RAII (Resource Acquisition Is Initialization)&lt;/h4&gt;&#xA;&lt;p&gt;RAII is a fundamental pattern in Rust where resources are acquired during initialization and released when the object goes out of scope:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-rust&#34; data-lang=&#34;rust&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;struct&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;File&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    handle: &lt;span style=&#34;color:#a6e22e&#34;&gt;std&lt;/span&gt;::fs::File,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;impl&lt;/span&gt; File {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;new&lt;/span&gt;(path: &lt;span style=&#34;color:#66d9ef&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;str&lt;/span&gt;) -&amp;gt; Result&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;Self, std::io::Error&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;let&lt;/span&gt; handle &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; std::fs::File::open(path)&lt;span style=&#34;color:#f92672&#34;&gt;?&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        Ok(File { handle })&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;read_to_string&lt;/span&gt;(&lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;mut&lt;/span&gt; self) -&amp;gt; Result&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;String, std::io::Error&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;let&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;mut&lt;/span&gt; content &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; String::new();&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        self.handle.read_to_string(&lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;mut&lt;/span&gt; content)&lt;span style=&#34;color:#f92672&#34;&gt;?&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        Ok(content)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// The file is automatically closed when `file` goes out of scope&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;process_file&lt;/span&gt;(path: &lt;span style=&#34;color:#66d9ef&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;str&lt;/span&gt;) -&amp;gt; Result&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;String, std::io::Error&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;let&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;mut&lt;/span&gt; file &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; File::new(path)&lt;span style=&#34;color:#f92672&#34;&gt;?&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    file.read_to_string()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;drop-guard&#34;&gt;Drop Guard&lt;/h4&gt;&#xA;&lt;p&gt;A drop guard ensures that cleanup code runs even if a function returns early:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create Your Own Programming Language</title>
      <link>https://andrewodendaal.com/how-to-create-your-own-programming-language/</link>
      <pubDate>Thu, 19 Sep 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-your-own-programming-language/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/how-to-create-your-own-programming-language1.jpg&#34; alt=&#34;Create your own programming language&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;A programming language is a system of communication and computation used to control a computer. Languages allow us to write instructions in a format that computers can understand and execute.&lt;/p&gt;&#xA;&lt;p&gt;While many popular languages like Python, Java, and JavaScript already exist, you may want to create your own for learning purposes or to solve a specific problem. Here is an overview of the key steps involved in designing a custom programming language.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Poetry vs Pip: Comparing Python Dependency Management and Packaging Tools</title>
      <link>https://andrewodendaal.com/poetry-vs-pip-comparing-python-dependency-management-and-packaging-tools/</link>
      <pubDate>Fri, 13 Sep 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/poetry-vs-pip-comparing-python-dependency-management-and-packaging-tools/</guid>
      <description>&lt;p&gt;Poetry and Pip are two popular tools for managing Python dependencies and packaging Python projects. Both have their own sets of advantages and disadvantages. This guide will provide a technical comparison of the two tools and demonstrate why Poetry has more features and is generally preferable to Pip for most use cases.&lt;/p&gt;&#xA;&lt;h2 id=&#34;key-differences&#34;&gt;Key Differences&lt;/h2&gt;&#xA;&lt;p&gt;Some of the key differences between Poetry and Pip include:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;Dependency resolution&lt;/strong&gt;: Poetry uses a resolver to find the best combination of package versions to meet your requirements. Pip does not do this, it just installs the latest version that matches each requirement.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sustainable Cloud Computing for Distributed Systems</title>
      <link>https://andrewodendaal.com/sustainable-cloud-computing/</link>
      <pubDate>Thu, 12 Sep 2024 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/sustainable-cloud-computing/</guid>
      <description>&lt;p&gt;As distributed systems increasingly rely on cloud computing resources, their environmental impact has become a growing concern. The global IT industry accounts for approximately 2-3% of worldwide carbon emissions—comparable to the aviation industry—with data centers alone consuming about 1% of global electricity. With the exponential growth of distributed systems and cloud computing, implementing sustainable practices is not just an environmental imperative but also a business necessity.&lt;/p&gt;&#xA;&lt;p&gt;This article explores practical strategies and technologies for implementing sustainable cloud computing in distributed systems, helping organizations reduce their environmental impact while maintaining performance, reliability, and cost-effectiveness.&lt;/p&gt;</description>
    </item>
    <item>
      <title>API Design Principles: Building Interfaces That Last</title>
      <link>https://andrewodendaal.com/api-design-principles/</link>
      <pubDate>Tue, 10 Sep 2024 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/api-design-principles/</guid>
      <description>&lt;p&gt;Application Programming Interfaces (APIs) have become the foundation of modern software development, enabling seamless integration between systems, powering microservices architectures, and facilitating third-party ecosystems. However, designing APIs that are intuitive, efficient, secure, and able to evolve over time requires careful consideration of numerous principles and best practices.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores API design principles that lead to robust, developer-friendly interfaces. We&amp;rsquo;ll cover RESTful design, GraphQL, versioning strategies, authentication methods, documentation approaches, and patterns for creating APIs that stand the test of time. Whether you&amp;rsquo;re building public APIs for third-party developers or internal interfaces for microservices, these principles will help you create APIs that are a joy to use and maintain.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Complete DevOps Guide for Beginners</title>
      <link>https://andrewodendaal.com/a-complete-devops-guide-for-beginners/</link>
      <pubDate>Thu, 05 Sep 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/a-complete-devops-guide-for-beginners/</guid>
      <description>&lt;p&gt;Are you looking to improve your software development workflow and increase efficiency? Look no further than DevOps! In this comprehensive guide, we&amp;rsquo;ll explore what DevOps means, its benefits, and how to get started with implementing it in your own organization.&lt;/p&gt;&#xA;&lt;p&gt;Hello there! My name is Andrew, and I&amp;rsquo;m excited to share my expertise on DevOps Engineering with you. As someone who has spent years working in the field, I&amp;rsquo;ve seen firsthand how it can transform organizations and bring people together. In this guide, we&amp;rsquo;ll explore what DevOps means, its benefits, and how to get started with implementing it in your own life.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Creating a Docker Alternative in Python</title>
      <link>https://andrewodendaal.com/creating-a-docker-alternative-in-python/</link>
      <pubDate>Mon, 26 Aug 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/creating-a-docker-alternative-in-python/</guid>
      <description>&lt;p&gt;Docker is a popular containerization platform that allows developers to easily package applications into lightweight containers that can run isolated on any system. Containers provide a convenient way to deploy and scale applications by bundling together all the dependencies and configurations needed to run the app.&lt;/p&gt;&#xA;&lt;p&gt;In this guide, we will walk through how to create a simple docker alternative in Python. The goal is to build a basic container runtime that can build images, run containers, and manage containers lifecycles. While this will only cover a subset of Docker&amp;rsquo;s functionality, it will demonstrate the core concepts needed to build a container engine.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Why Different Programming Languages Need to Exist</title>
      <link>https://andrewodendaal.com/why-different-programming-languages-need-to-exist/</link>
      <pubDate>Mon, 26 Aug 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/why-different-programming-languages-need-to-exist/</guid>
      <description>&lt;p&gt;Programming languages allow us to communicate with computers by writing code. There are hundreds of programming languages in use today, and new ones are constantly being created. But why do we need so many different languages? Here are some key reasons:&lt;/p&gt;&#xA;&lt;h2 id=&#34;different-levels-of-abstraction&#34;&gt;Different Levels of Abstraction&lt;/h2&gt;&#xA;&lt;p&gt;Programming languages operate at different levels of abstraction from the underlying machine code that computers understand. Lower level languages like C and Assembly provide direct access to computer hardware and memory. They require developers to manage many details but allow for precise control and high performance.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Database Scaling Strategies: From Gigabytes to Petabytes</title>
      <link>https://andrewodendaal.com/database-scaling-strategies/</link>
      <pubDate>Thu, 15 Aug 2024 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/database-scaling-strategies/</guid>
      <description>&lt;p&gt;As applications grow in popularity and data volumes expand, database performance often becomes a critical bottleneck. What worked perfectly during development or early production can quickly become inadequate as user numbers increase and data accumulates. Scaling database systems effectively requires a deep understanding of various strategies, their trade-offs, and implementation approaches.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores database scaling strategies from vertical scaling to distributed systems, covering relational and NoSQL approaches, replication, sharding, and cloud-native solutions. Whether you&amp;rsquo;re experiencing growing pains with your current database or planning ahead for future scale, these strategies will help you build resilient, high-performance database systems that grow with your business.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust for Quantum Computing in 2024: Libraries, Tools, and Best Practices</title>
      <link>https://andrewodendaal.com/rust-quantum-computing-ecosystem/</link>
      <pubDate>Sat, 10 Aug 2024 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-quantum-computing-ecosystem/</guid>
      <description>&lt;p&gt;Quantum computing represents one of the most exciting frontiers in computer science, promising computational capabilities that could revolutionize fields from cryptography to drug discovery. As quantum hardware continues to advance, there&amp;rsquo;s a growing need for robust software tools to bridge the gap between quantum algorithms and physical quantum processors. Rust, with its combination of performance comparable to C/C++ and memory safety guarantees without garbage collection, has emerged as an excellent choice for quantum computing development.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Future of AI in Software Development: What to Expect in 2025</title>
      <link>https://andrewodendaal.com/future-of-ai-in-software-development-what-to-expect-in-2025/</link>
      <pubDate>Thu, 08 Aug 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/future-of-ai-in-software-development-what-to-expect-in-2025/</guid>
      <description>&lt;p&gt;As we stand on the cusp of a new era in technology, the integration of Artificial Intelligence (AI) into software development is poised to revolutionize the way we create, maintain, and evolve digital solutions. By 2025, the landscape of software engineering is expected to undergo a dramatic transformation, with AI playing a pivotal role in every aspect of the development lifecycle. From intelligent code generation to predictive maintenance and beyond, the fusion of AI and software development promises to enhance productivity, improve code quality, and accelerate innovation at an unprecedented scale.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Learn Concurrency in Go</title>
      <link>https://andrewodendaal.com/learn-concurrency-in-go/</link>
      <pubDate>Mon, 22 Jul 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/learn-concurrency-in-go/</guid>
      <description>&lt;p&gt;Concurrency in Go is one of its most powerful features, designed to make it easy to write concurrent programs. Go&amp;rsquo;s concurrency model is based on goroutines and channels, which provide a simple and efficient way to manage multiple tasks running in parallel.&lt;/p&gt;&#xA;&lt;h2 id=&#34;goroutines&#34;&gt;Goroutines&lt;/h2&gt;&#xA;&lt;p&gt;A goroutine is a lightweight thread managed by the Go runtime. You can start a new goroutine using the &lt;code&gt;go&lt;/code&gt; keyword followed by a function call. Goroutines run concurrently with other goroutines.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Learn Go as a DevOps Engineer</title>
      <link>https://andrewodendaal.com/learn-go-as-a-devops-engineer/</link>
      <pubDate>Thu, 18 Jul 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/learn-go-as-a-devops-engineer/</guid>
      <description>&lt;p&gt;Go, also known as Golang, is an open-source programming language designed for simplicity, efficiency, and reliability. It has become increasingly popular in the DevOps community due to its powerful standard library, ease of use, and performance capabilities. This guide aims to provide DevOps engineers with a comprehensive understanding of Go, from basic syntax to advanced topics, complete with practical examples and code snippets.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-introduction-to-go&#34;&gt;1. Introduction to Go&lt;/h2&gt;&#xA;&lt;h3 id=&#34;what-is-go&#34;&gt;What is Go?&lt;/h3&gt;&#xA;&lt;p&gt;Go is a statically typed, compiled programming language designed by Google. It emphasizes simplicity and efficiency, making it ideal for scalable system programming and cloud-native development.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust CLI Applications: Command-Line Tool Development</title>
      <link>https://andrewodendaal.com/articles/rust-cli-applications/</link>
      <pubDate>Mon, 15 Jul 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/rust-cli-applications/</guid>
      <description>&lt;p&gt;Build robust.&lt;/p&gt;&#xA;&lt;h4 id=&#34;getting-started-a-simple-cli-application&#34;&gt;Getting Started: A Simple CLI Application&lt;/h4&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s start with a basic command-line application that accepts arguments and prints output:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-rust&#34; data-lang=&#34;rust&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;use&lt;/span&gt; std::env;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;main&lt;/span&gt;() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;// Collect command-line arguments&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;let&lt;/span&gt; args: Vec&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;String&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; env::args().collect();&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;// The first argument is the program name&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;println!&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Program name: &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;{}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;, args[&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;]);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;// Print the remaining arguments&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; args.len() &lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#a6e22e&#34;&gt;println!&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Arguments:&amp;#34;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; (i, arg) &lt;span style=&#34;color:#66d9ef&#34;&gt;in&lt;/span&gt; args.iter().enumerate().skip(&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#a6e22e&#34;&gt;println!&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;  &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;{}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;: &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;{}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;, i, arg);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    } &lt;span style=&#34;color:#66d9ef&#34;&gt;else&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#a6e22e&#34;&gt;println!&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;No arguments provided&amp;#34;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This simple example demonstrates how to access command-line arguments using the standard library. However, for more complex applications, we&amp;rsquo;ll want to use dedicated argument parsing libraries.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Run Technical Discovery Sessions: A Comprehensive Guide</title>
      <link>https://andrewodendaal.com/how-to-run-technical-discovery-sessions/</link>
      <pubDate>Fri, 05 Jul 2024 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-run-technical-discovery-sessions/</guid>
      <description>&lt;p&gt;Technical discovery sessions are the foundation of successful software projects. These structured conversations between technical teams, stakeholders, and subject matter experts uncover requirements, constraints, and context that shape the entire project lifecycle. When done well, discovery sessions align expectations, identify risks early, and create a shared understanding that guides implementation. When done poorly, they lead to misaligned expectations, missed requirements, and ultimately, project failure.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores how to plan and facilitate effective technical discovery sessions. Whether you&amp;rsquo;re a solution architect, technical lead, or project manager, this guide provides actionable strategies for preparation, facilitation, documentation, and follow-up to ensure your discovery sessions deliver maximum value.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Secrets Management in Cloud Environments: Best Practices and Tools</title>
      <link>https://andrewodendaal.com/secrets-management-in-cloud-environments/</link>
      <pubDate>Mon, 01 Jul 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/secrets-management-in-cloud-environments/</guid>
      <description>&lt;p&gt;In today&amp;rsquo;s cloud-native world, applications require access to numerous secrets—API keys, database credentials, encryption keys, and other sensitive information. Managing these secrets securely is one of the most critical aspects of cloud security. Poor secrets management can lead to data breaches, unauthorized access, and compliance violations that can severely impact your organization.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores best practices, tools, and implementation strategies for effective secrets management across AWS, Azure, and Google Cloud Platform (GCP), helping you build a robust security posture for your cloud environments.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust Module System: Code Organization</title>
      <link>https://andrewodendaal.com/articles/rust-module-system/</link>
      <pubDate>Sat, 22 Jun 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/rust-module-system/</guid>
      <description>&lt;p&gt;Master Rust&amp;rsquo;s module system.&lt;/p&gt;&#xA;&lt;h4 id=&#34;understanding-the-basics-of-rusts-module-system&#34;&gt;Understanding the Basics of Rust&amp;rsquo;s Module System&lt;/h4&gt;&#xA;&lt;p&gt;At its core, Rust&amp;rsquo;s module system is about organizing code and controlling visibility. Let&amp;rsquo;s start with the fundamental concepts:&lt;/p&gt;&#xA;&lt;h4 id=&#34;modules-organizing-code-into-logical-units&#34;&gt;Modules: Organizing Code into Logical Units&lt;/h4&gt;&#xA;&lt;p&gt;A module is a container for items such as functions, structs, traits, impl blocks, and even other modules:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-rust&#34; data-lang=&#34;rust&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Define a module named &amp;#39;geometry&amp;#34;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;mod&lt;/span&gt; geometry {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;// Constants within the module&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;PI&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;f64&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;3.14159&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;// Functions within the module&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;pub&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;area_of_circle&lt;/span&gt;(radius: &lt;span style=&#34;color:#66d9ef&#34;&gt;f64&lt;/span&gt;) -&amp;gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;f64&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;PI&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; radius &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; radius&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;// Nested module&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;pub&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;mod&lt;/span&gt; shapes {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;pub&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;struct&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Rectangle&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#66d9ef&#34;&gt;pub&lt;/span&gt; width: &lt;span style=&#34;color:#66d9ef&#34;&gt;f64&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#66d9ef&#34;&gt;pub&lt;/span&gt; height: &lt;span style=&#34;color:#66d9ef&#34;&gt;f64&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;impl&lt;/span&gt; Rectangle {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#66d9ef&#34;&gt;pub&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;new&lt;/span&gt;(width: &lt;span style=&#34;color:#66d9ef&#34;&gt;f64&lt;/span&gt;, height: &lt;span style=&#34;color:#66d9ef&#34;&gt;f64&lt;/span&gt;) -&amp;gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Rectangle&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                Rectangle { width, height }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#66d9ef&#34;&gt;pub&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;area&lt;/span&gt;(&lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&lt;/span&gt;self) -&amp;gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;f64&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                self.width &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; self.height&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;main&lt;/span&gt;() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;// Using items from the module&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;let&lt;/span&gt; area &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; geometry::area_of_circle(&lt;span style=&#34;color:#ae81ff&#34;&gt;5.0&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;println!&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Area of circle: &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;{}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;, area);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;let&lt;/span&gt; rect &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; geometry::shapes::Rectangle::new(&lt;span style=&#34;color:#ae81ff&#34;&gt;10.0&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;5.0&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;println!&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Area of rectangle: &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;{}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;, rect.area());&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;visibility-and-the-pub-keyword&#34;&gt;Visibility and the pub Keyword&lt;/h4&gt;&#xA;&lt;p&gt;By default, everything in Rust is private. The &lt;code&gt;pub&lt;/code&gt; keyword makes items accessible outside their defining module:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Developing a Custom Kubernetes Controller in Go</title>
      <link>https://andrewodendaal.com/developing-a-custom-kubernetes-controller-in-go/</link>
      <pubDate>Thu, 20 Jun 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/developing-a-custom-kubernetes-controller-in-go/</guid>
      <description>&lt;p&gt;A custom Kubernetes controller manages custom resources within a Kubernetes cluster, allowing for extended functionalities and custom automation.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-by-step-guide&#34;&gt;Step-by-Step Guide&lt;/h2&gt;&#xA;&lt;h3 id=&#34;define-custom-resource&#34;&gt;Define Custom Resource:&lt;/h3&gt;&#xA;&lt;p&gt;Define a custom resource definition (CRD) in a YAML file.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;apiVersion&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;apiextensions.k8s.io/v1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;kind&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;CustomResourceDefinition&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;metadata&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;name&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;myresources.mydomain.com&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;spec&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;group&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;mydomain.com&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;versions&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    - &lt;span style=&#34;color:#f92672&#34;&gt;name&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;v1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;served&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;storage&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;schema&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;openAPIV3Schema&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;object&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#f92672&#34;&gt;spec&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;              &lt;span style=&#34;color:#f92672&#34;&gt;type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;object&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;              &lt;span style=&#34;color:#f92672&#34;&gt;properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                &lt;span style=&#34;color:#f92672&#34;&gt;size&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                  &lt;span style=&#34;color:#f92672&#34;&gt;type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;integer&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;scope&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;Namespaced&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;names&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;plural&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;myresources&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;singular&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;myresource&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;kind&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;MyResource&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;shortNames&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    - &lt;span style=&#34;color:#ae81ff&#34;&gt;mr&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;generate-clientset&#34;&gt;Generate Clientset:&lt;/h3&gt;&#xA;&lt;p&gt;Use kubebuilder to generate clientset, informers, and listers for your CRD.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust for IoT Development in 2024: Frameworks, Tools, and Best Practices</title>
      <link>https://andrewodendaal.com/rust-iot-development-ecosystem/</link>
      <pubDate>Tue, 18 Jun 2024 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/rust-iot-development-ecosystem/</guid>
      <description>&lt;p&gt;The Internet of Things (IoT) continues to transform our world, connecting billions of devices that collect, process, and exchange data. As IoT deployments grow in scale and complexity, the need for reliable, secure, and efficient software becomes increasingly critical. Rust, with its unique combination of memory safety without garbage collection, predictable performance, and modern language features, has emerged as an excellent choice for IoT development.&lt;/p&gt;&#xA;&lt;p&gt;In this comprehensive guide, we&amp;rsquo;ll explore Rust&amp;rsquo;s ecosystem for IoT development as it stands in mid-2024. We&amp;rsquo;ll examine the frameworks, libraries, and tools that have matured over the years, providing developers with robust building blocks for creating secure and efficient IoT applications. Whether you&amp;rsquo;re building smart home devices, industrial sensors, wearables, or large-scale IoT platforms, this guide will help you navigate the rich landscape of Rust&amp;rsquo;s IoT development ecosystem.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Creating a Monitoring Agent in Go</title>
      <link>https://andrewodendaal.com/creating-a-monitoring-agent-in-go/</link>
      <pubDate>Tue, 18 Jun 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/creating-a-monitoring-agent-in-go/</guid>
      <description>&lt;p&gt;Building a monitoring agent involves collecting metrics from a system and sending them to a monitoring server or displaying them on a dashboard.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-by-step-guide&#34;&gt;Step-by-Step Guide&lt;/h2&gt;&#xA;&lt;h3 id=&#34;define-metrics-structure&#34;&gt;Define Metrics Structure:&lt;/h3&gt;&#xA;&lt;p&gt;Create a structure to store metrics.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;type&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Metric&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;struct&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Name&lt;/span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;string&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Value&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;float64&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;collect-metrics&#34;&gt;Collect Metrics:&lt;/h3&gt;&#xA;&lt;p&gt;Implement functions to collect various system metrics (CPU usage, memory usage, etc.).&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;github.com/shirou/gopsutil/cpu&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;github.com/shirou/gopsutil/mem&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;func&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;collectCPUMetrics&lt;/span&gt;() &lt;span style=&#34;color:#a6e22e&#34;&gt;Metric&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;usage&lt;/span&gt;, &lt;span style=&#34;color:#a6e22e&#34;&gt;_&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;cpu&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Percent&lt;/span&gt;(&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;, &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Metric&lt;/span&gt;{&lt;span style=&#34;color:#a6e22e&#34;&gt;Name&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;cpu_usage&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#a6e22e&#34;&gt;Value&lt;/span&gt;: &lt;span style=&#34;color:#a6e22e&#34;&gt;usage&lt;/span&gt;[&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;]}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;func&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;collectMemoryMetrics&lt;/span&gt;() &lt;span style=&#34;color:#a6e22e&#34;&gt;Metric&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;v&lt;/span&gt;, &lt;span style=&#34;color:#a6e22e&#34;&gt;_&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;mem&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;VirtualMemory&lt;/span&gt;()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Metric&lt;/span&gt;{&lt;span style=&#34;color:#a6e22e&#34;&gt;Name&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;memory_usage&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#a6e22e&#34;&gt;Value&lt;/span&gt;: &lt;span style=&#34;color:#a6e22e&#34;&gt;v&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;UsedPercent&lt;/span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;send-metrics&#34;&gt;Send Metrics:&lt;/h3&gt;&#xA;&lt;p&gt;Implement a function to send metrics to a monitoring server (e.g., Prometheus, InfluxDB).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building a CI/CD Pipeline Tool in Go</title>
      <link>https://andrewodendaal.com/building-a-cicd-pipeline-tool-in-go/</link>
      <pubDate>Sat, 15 Jun 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/building-a-cicd-pipeline-tool-in-go/</guid>
      <description>&lt;p&gt;Developing a custom CI/CD pipeline tool in Go can help automate the processes of building, testing, and deploying applications. This project involves setting up pipelines, triggering builds, running tests, and deploying applications.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-by-step-guide&#34;&gt;Step-by-Step Guide&lt;/h2&gt;&#xA;&lt;h3 id=&#34;define-the-pipeline-structure&#34;&gt;Define the Pipeline Structure:&lt;/h3&gt;&#xA;&lt;p&gt;Create a structure to define pipeline stages, jobs, and steps.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;type&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Step&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;struct&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Name&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;string&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Command&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;string&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;type&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Job&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;struct&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Name&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;string&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Steps&lt;/span&gt; []&lt;span style=&#34;color:#a6e22e&#34;&gt;Step&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;type&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Pipeline&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;struct&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Name&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;string&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Jobs&lt;/span&gt; []&lt;span style=&#34;color:#a6e22e&#34;&gt;Job&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;parse-configuration&#34;&gt;Parse Configuration:&lt;/h3&gt;&#xA;&lt;p&gt;Write a function to parse a pipeline configuration file (e.g., YAML or JSON).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cloud Networking Best Practices: Designing Secure and Scalable Architectures</title>
      <link>https://andrewodendaal.com/cloud-networking-best-practices/</link>
      <pubDate>Mon, 10 Jun 2024 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/cloud-networking-best-practices/</guid>
      <description>&lt;p&gt;Networking is the foundation of cloud infrastructure, connecting your applications, services, and data across regions and to the internet. As organizations migrate more workloads to the cloud, designing secure, scalable, and high-performance network architectures becomes increasingly critical. Poor network design can lead to security vulnerabilities, performance bottlenecks, and operational challenges that impact your entire cloud environment.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores cloud networking best practices across major cloud providers, covering VPC design, security controls, connectivity options, performance optimization, and monitoring strategies. Whether you&amp;rsquo;re building a new cloud environment or optimizing an existing one, these practices will help you create a robust networking foundation for your cloud infrastructure.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rust Error Handling: Robust Program Design</title>
      <link>https://andrewodendaal.com/articles/rust-error-handling/</link>
      <pubDate>Sun, 02 Jun 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/rust-error-handling/</guid>
      <description>&lt;p&gt;Master Rust&amp;rsquo;s error handling with Result types.&lt;/p&gt;&#xA;&lt;h4 id=&#34;beyond-the-basics-result-and-option&#34;&gt;Beyond the Basics: Result and Option&lt;/h4&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s start with a quick refresher on Rust&amp;rsquo;s basic error handling types:&lt;/p&gt;&#xA;&lt;h4 id=&#34;result-and-option-recap&#34;&gt;Result and Option Recap&lt;/h4&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-rust&#34; data-lang=&#34;rust&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Result: for operations that can fail&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;divide&lt;/span&gt;(a: &lt;span style=&#34;color:#66d9ef&#34;&gt;i32&lt;/span&gt;, b: &lt;span style=&#34;color:#66d9ef&#34;&gt;i32&lt;/span&gt;) -&amp;gt; Result&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;i32&lt;/span&gt;, &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&lt;/span&gt;&amp;#39;static &lt;span style=&#34;color:#66d9ef&#34;&gt;str&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; b &lt;span style=&#34;color:#f92672&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        Err(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Division by zero&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    } &lt;span style=&#34;color:#66d9ef&#34;&gt;else&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        Ok(a &lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt; b)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Option: for values that might be absent&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;find_user&lt;/span&gt;(id: &lt;span style=&#34;color:#66d9ef&#34;&gt;u64&lt;/span&gt;) -&amp;gt; Option&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;User&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; id &lt;span style=&#34;color:#f92672&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        None&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    } &lt;span style=&#34;color:#66d9ef&#34;&gt;else&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        Some(User { id, name: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;User&amp;#34;&lt;/span&gt;.to_string() })&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Using Result and Option together&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;get_user_name&lt;/span&gt;(id: &lt;span style=&#34;color:#66d9ef&#34;&gt;u64&lt;/span&gt;) -&amp;gt; Result&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;String, &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&lt;/span&gt;&amp;#39;static &lt;span style=&#34;color:#66d9ef&#34;&gt;str&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    find_user(id).map(&lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt;user&lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt; user.name).ok_or(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;User not found&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;the--operator&#34;&gt;The ? Operator&lt;/h4&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-rust&#34; data-lang=&#34;rust&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;process_data&lt;/span&gt;() -&amp;gt; Result&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;String, &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&lt;/span&gt;&amp;#39;static &lt;span style=&#34;color:#66d9ef&#34;&gt;str&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;let&lt;/span&gt; data &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; read_file(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;data.txt&amp;#34;&lt;/span&gt;)&lt;span style=&#34;color:#f92672&#34;&gt;?&lt;/span&gt;;  &lt;span style=&#34;color:#75715e&#34;&gt;// Returns early if Err&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;let&lt;/span&gt; processed &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; process_string(&lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&lt;/span&gt;data)&lt;span style=&#34;color:#f92672&#34;&gt;?&lt;/span&gt;;  &lt;span style=&#34;color:#75715e&#34;&gt;// Returns early if Err&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    Ok(processed)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Works with Option too&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;first_even_number&lt;/span&gt;(numbers: &lt;span style=&#34;color:#66d9ef&#34;&gt;&amp;amp;&lt;/span&gt;[&lt;span style=&#34;color:#66d9ef&#34;&gt;i32&lt;/span&gt;]) -&amp;gt; Option&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;i32&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;let&lt;/span&gt; first &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; numbers.first()&lt;span style=&#34;color:#f92672&#34;&gt;?&lt;/span&gt;;  &lt;span style=&#34;color:#75715e&#34;&gt;// Returns None if empty&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; first &lt;span style=&#34;color:#f92672&#34;&gt;%&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        Some(&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;first)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    } &lt;span style=&#34;color:#66d9ef&#34;&gt;else&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        None&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;combining-result-and-option&#34;&gt;Combining Result and Option&lt;/h4&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-rust&#34; data-lang=&#34;rust&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;process_optional_data&lt;/span&gt;(data: Option&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&amp;amp;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;str&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;) -&amp;gt; Result&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;String, &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&lt;/span&gt;&amp;#39;static &lt;span style=&#34;color:#66d9ef&#34;&gt;str&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;// Convert Option to Result&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;let&lt;/span&gt; data &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; data.ok_or(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;No data provided&amp;#34;&lt;/span&gt;)&lt;span style=&#34;color:#f92672&#34;&gt;?&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;// Process the data&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; data.is_empty() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; Err(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Data is empty&amp;#34;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    Ok(data.to_uppercase())&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Using map and map_err for transformations&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;fn&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;transform_data&lt;/span&gt;(input: Option&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&amp;amp;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;str&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;) -&amp;gt; Result&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;i32&lt;/span&gt;, String&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    input&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        .ok_or(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;No input provided&amp;#34;&lt;/span&gt;.to_string())&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        .map(&lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt;s&lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt; s.parse::&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;i32&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;())&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        .map_err(&lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt;e&lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;format!&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Invalid input: &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;{}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;, e))&lt;span style=&#34;color:#f92672&#34;&gt;?&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        .map_err(&lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt;e&lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;format!&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Parse error: &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;{}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;, e))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;&#xA;&lt;h3 id=&#34;custom-error-types&#34;&gt;Custom Error Types&lt;/h3&gt;&#xA;&lt;p&gt;For real-world applications, custom error types provide better organization and flexibility:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Everything you need to know to Master API Creation</title>
      <link>https://andrewodendaal.com/everything-you-need-to-know-to-master-api-creation/</link>
      <pubDate>Fri, 31 May 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/everything-you-need-to-know-to-master-api-creation/</guid>
      <description>&lt;h2 id=&#34;introduction-to-apis&#34;&gt;Introduction to APIs&lt;/h2&gt;&#xA;&lt;p&gt;An API (Application Programming Interface) is a set of rules and protocols that allows different software applications to communicate with each other. APIs can be categorized into various types, including REST, SOAP, GraphQL, and RPC. Among these, REST (Representational State Transfer) is the most widely used due to its simplicity and scalability.&lt;/p&gt;&#xA;&lt;p&gt;This guide focuses primarily on RESTful APIs, which adhere to a set of constraints that make them efficient and easy to use. We&amp;rsquo;ll also touch on advanced topics like authentication, error handling, and rate limiting.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Progressive Web Apps: Modern Web Development</title>
      <link>https://andrewodendaal.com/articles/web-progressive-web-apps/</link>
      <pubDate>Mon, 27 May 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/web-progressive-web-apps/</guid>
      <description>&lt;p&gt;Build progressive web applications with service workers.&lt;/p&gt;&#xA;&lt;h4 id=&#34;understanding-progressive-web-apps&#34;&gt;Understanding Progressive Web Apps&lt;/h4&gt;&#xA;&lt;h4 id=&#34;core-concepts-and-principles&#34;&gt;Core Concepts and Principles&lt;/h4&gt;&#xA;&lt;p&gt;Fundamental elements that define Progressive Web Apps:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Progressive Enhancement&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Works for all users regardless of browser choice&lt;/li&gt;&#xA;&lt;li&gt;Core functionality available to everyone&lt;/li&gt;&#xA;&lt;li&gt;Enhanced experience for modern browsers&lt;/li&gt;&#xA;&lt;li&gt;Feature detection over browser detection&lt;/li&gt;&#xA;&lt;li&gt;Graceful degradation for older browsers&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Responsive Design&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Adapts to different screen sizes and orientations&lt;/li&gt;&#xA;&lt;li&gt;Fluid layouts and flexible images&lt;/li&gt;&#xA;&lt;li&gt;Mobile-first approach&lt;/li&gt;&#xA;&lt;li&gt;Touch-friendly interfaces&lt;/li&gt;&#xA;&lt;li&gt;Consistent experience across devices&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;App-like Experience&lt;/strong&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Zero Trust Architecture: Security Framework Implementation</title>
      <link>https://andrewodendaal.com/articles/security-zero-trust-architecture/</link>
      <pubDate>Mon, 20 May 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/security-zero-trust-architecture/</guid>
      <description>&lt;p&gt;Design and implement zero trust security architectures with identity-based access control.&lt;/p&gt;&#xA;&lt;h3 id=&#34;understanding-zero-trust-security&#34;&gt;Understanding Zero Trust Security&lt;/h3&gt;&#xA;&lt;p&gt;Zero Trust is a security framework that requires all users and services, whether inside or outside the organization&amp;rsquo;s network, to be authenticated, authorized, and continuously validated before being granted access to applications and data.&lt;/p&gt;&#xA;&lt;h3 id=&#34;core-principles-of-zero-trust&#34;&gt;Core Principles of Zero Trust&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Verify explicitly&lt;/strong&gt;: Always authenticate and authorize based on all available data points&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Use least privilege access&lt;/strong&gt;: Limit user access with Just-In-Time and Just-Enough-Access&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Assume breach&lt;/strong&gt;: Minimize blast radius and segment access, verify end-to-end encryption, and use analytics to improve security posture&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;traditional-vs-zero-trust-security&#34;&gt;Traditional vs. Zero Trust Security&lt;/h3&gt;&#xA;&lt;p&gt;Traditional security models operate on the concept of &amp;ldquo;trust but verify,&amp;rdquo; where entities inside the network perimeter are inherently trusted. Zero Trust, by contrast, operates on &amp;ldquo;never trust, always verify,&amp;rdquo; treating every request as if it originates from an untrusted network.&lt;/p&gt;</description>
    </item>
    <item>
      <title>WebAssembly in the Enterprise: Beyond the Browser</title>
      <link>https://andrewodendaal.com/webassembly-enterprise-applications/</link>
      <pubDate>Sat, 18 May 2024 08:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/webassembly-enterprise-applications/</guid>
      <description>&lt;p&gt;WebAssembly (Wasm) has evolved far beyond its origins as a browser technology. Initially designed to enable high-performance code execution in web browsers, Wasm has expanded into server-side applications, edge computing, containerization alternatives, and more. Its unique combination of near-native performance, sandboxed security, language-agnostic design, and compact binary format makes it increasingly attractive for enterprise applications seeking portability, security, and efficiency.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide explores WebAssembly&amp;rsquo;s role in enterprise applications, covering server-side Wasm, edge computing use cases, containerization alternatives, multi-language development, and security considerations. Whether you&amp;rsquo;re evaluating Wasm for your organization or looking to expand your existing implementation, these insights will help you leverage WebAssembly&amp;rsquo;s capabilities to build portable, secure, and high-performance applications across diverse computing environments.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building CI/CD Pipelines with GitHub Actions: A Comprehensive Guide</title>
      <link>https://andrewodendaal.com/building-cicd-pipelines-with-github-actions/</link>
      <pubDate>Wed, 15 May 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/building-cicd-pipelines-with-github-actions/</guid>
      <description>&lt;p&gt;Continuous Integration and Continuous Deployment (CI/CD) have revolutionized how software teams deliver value. By automating the build, test, and deployment processes, CI/CD enables faster, more reliable software delivery with fewer manual interventions. Among the various CI/CD tools available today, GitHub Actions has emerged as a powerful and flexible solution, particularly for teams already using GitHub for source control.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide will walk you through building effective CI/CD pipelines with GitHub Actions, from basic concepts to advanced implementation strategies, helping you accelerate your software delivery while maintaining quality and security.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to AWS Assume Role and then revert to the previous role after</title>
      <link>https://andrewodendaal.com/how-to-aws-assume-role-and-then-revert-to-the-previous-role-after/</link>
      <pubDate>Wed, 01 May 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-aws-assume-role-and-then-revert-to-the-previous-role-after/</guid>
      <description>&lt;p&gt;If you need to assume a role in AWS and then revert back to the previous role once complete, you can use the following snippet of code:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Save original environment variables&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ORIGINAL_AWS_ACCESS_KEY_ID&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$AWS_ACCESS_KEY_ID&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ORIGINAL_AWS_SECRET_ACCESS_KEY&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$AWS_SECRET_ACCESS_KEY&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ORIGINAL_AWS_SESSION_TOKEN&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$AWS_SESSION_TOKEN&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Assume the role and store the output in a variable&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;assume_role_output&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;aws sts assume-role --role-arn arn:aws:iam::12345678912:role/YourCrossAccountAccessRole --role-session-name &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;AssumeRoleSession&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Extract temporary credentials from the assume role output using jq (JSON processor)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;export AWS_ACCESS_KEY_ID&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$assume_role_output&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; | jq -r &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;.Credentials.AccessKeyId&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;export AWS_SECRET_ACCESS_KEY&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$assume_role_output&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; | jq -r &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;.Credentials.SecretAccessKey&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;export AWS_SESSION_TOKEN&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$assume_role_output&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; | jq -r &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;.Credentials.SessionToken&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Later, if you want to revert back to the original environment variables&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Restore the original environment variables&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;export AWS_ACCESS_KEY_ID&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$ORIGINAL_AWS_ACCESS_KEY_ID&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;export AWS_SECRET_ACCESS_KEY&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$ORIGINAL_AWS_SECRET_ACCESS_KEY&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;export AWS_SESSION_TOKEN&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$ORIGINAL_AWS_SESSION_TOKEN&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;understanding-the-process&#34;&gt;Understanding the Process&lt;/h2&gt;&#xA;&lt;p&gt;Assuming a role in AWS allows you to temporarily access AWS resources that you wouldn&amp;rsquo;t have permission to access with your current credentials. After completing your tasks, it&amp;rsquo;s essential to revert back to your original role for security and access control reasons. This snippet demonstrates how to accomplish that using Bash scripting and the AWS CLI.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Zero Trust in the Cloud: Implementation Guide</title>
      <link>https://andrewodendaal.com/articles/security-zero-trust-cloud/</link>
      <pubDate>Wed, 24 Apr 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/security-zero-trust-cloud/</guid>
      <description>&lt;p&gt;Implement zero trust security models in cloud environments with identity management.&lt;/p&gt;&#xA;&lt;h4 id=&#34;understanding-zero-trust-core-principles&#34;&gt;Understanding Zero Trust: Core Principles&lt;/h4&gt;&#xA;&lt;p&gt;Before diving into implementation details, let&amp;rsquo;s establish a clear understanding of Zero Trust principles and how they apply to cloud environments.&lt;/p&gt;&#xA;&lt;h4 id=&#34;what-is-zero-trust&#34;&gt;What is Zero Trust?&lt;/h4&gt;&#xA;&lt;p&gt;Zero Trust is a security model that assumes no user or system should be inherently trusted, whether inside or outside the traditional network perimeter. Instead, verification is required from everyone trying to access resources in the network.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Infrastructure as Code with Terraform: From Basics to Best Practices</title>
      <link>https://andrewodendaal.com/infrastructure-as-code-with-terraform/</link>
      <pubDate>Fri, 12 Apr 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/infrastructure-as-code-with-terraform/</guid>
      <description>&lt;p&gt;In today&amp;rsquo;s cloud-centric world, managing infrastructure manually is no longer feasible. As organizations scale their cloud presence, the complexity of managing resources across multiple providers and environments becomes overwhelming. Infrastructure as Code (IaC) has emerged as the solution to this challenge, with Terraform standing out as one of the most powerful and flexible IaC tools available.&lt;/p&gt;&#xA;&lt;p&gt;This comprehensive guide will take you through the journey of mastering Terraform—from understanding core concepts to implementing advanced techniques and best practices that enable you to manage infrastructure at scale with confidence and efficiency.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cloud-Native Security: Modern Protection Strategies</title>
      <link>https://andrewodendaal.com/articles/security-cloud-native-security/</link>
      <pubDate>Fri, 12 Apr 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/security-cloud-native-security/</guid>
      <description>&lt;p&gt;Implement comprehensive security for cloud-native applications including container security.&lt;/p&gt;&#xA;&lt;h4 id=&#34;cloud-native-security-fundamentals&#34;&gt;Cloud-Native Security Fundamentals&lt;/h4&gt;&#xA;&lt;h4 id=&#34;the-cloud-native-security-landscape&#34;&gt;The Cloud-Native Security Landscape&lt;/h4&gt;&#xA;&lt;p&gt;Understanding the unique security challenges:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Cloud-Native Architecture Characteristics&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Distributed and decentralized&lt;/li&gt;&#xA;&lt;li&gt;Ephemeral and immutable&lt;/li&gt;&#xA;&lt;li&gt;API-driven and programmable&lt;/li&gt;&#xA;&lt;li&gt;Highly automated&lt;/li&gt;&#xA;&lt;li&gt;Dynamically orchestrated&lt;/li&gt;&#xA;&lt;li&gt;Microservices-based&lt;/li&gt;&#xA;&lt;li&gt;Infrastructure as code&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Security Implications&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Expanded attack surface&lt;/li&gt;&#xA;&lt;li&gt;Dynamic trust boundaries&lt;/li&gt;&#xA;&lt;li&gt;Short-lived resources&lt;/li&gt;&#xA;&lt;li&gt;Increased complexity&lt;/li&gt;&#xA;&lt;li&gt;Shared responsibility model&lt;/li&gt;&#xA;&lt;li&gt;Infrastructure as code vulnerabilities&lt;/li&gt;&#xA;&lt;li&gt;Supply chain risks&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;The 4C&amp;rsquo;s of Cloud-Native Security&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;┌───────────────────────────────────────────────────────────┐&#xA;│                                                           │&#xA;│                        Cloud                             │&#xA;│                                                           │&#xA;│  ┌───────────────────────────────────────────────────┐    │&#xA;│  │                                                   │    │&#xA;│  │                    Cluster                        │    │&#xA;│  │                                                   │    │&#xA;│  │  ┌───────────────────────────────────────────┐    │    │&#xA;│  │  │                                           │    │    │&#xA;│  │  │               Container                   │    │    │&#xA;│  │  │                                           │    │    │&#xA;│  │  │  ┌───────────────────────────────────┐    │    │    │&#xA;│  │  │  │                                   │    │    │    │&#xA;│  │  │  │             Code                  │    │    │    │&#xA;│  │  │  │                                   │    │    │    │&#xA;│  │  │  └───────────────────────────────────┘    │    │    │&#xA;│  │  │                                           │    │    │&#xA;│  │  └───────────────────────────────────────────┘    │    │&#xA;│  │                                                   │    │&#xA;│  └───────────────────────────────────────────────────┘    │&#xA;│                                                           │&#xA;└───────────────────────────────────────────────────────────┘&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Cloud-Native Security Principles&lt;/strong&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python Web Development: Building Modern Applications</title>
      <link>https://andrewodendaal.com/articles/python-web-development/</link>
      <pubDate>Fri, 12 Apr 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/python-web-development/</guid>
      <description>&lt;p&gt;Build modern web applications using Python frameworks like Flask and Django with database integration.&lt;/p&gt;&#xA;&lt;h2 id=&#34;setting-up-your-python-web-development-environment&#34;&gt;Setting Up Your Python Web Development Environment&lt;/h2&gt;&#xA;&lt;p&gt;When I first started building web applications with Python, I made the classic mistake of jumping straight into Django without understanding the fundamentals. Three weeks later, I was drowning in middleware, models, and migrations without grasping why any of it mattered. That&amp;rsquo;s why we&amp;rsquo;re starting this guide with the foundation—understanding what Python web development actually means and setting up an environment that&amp;rsquo;ll serve you well throughout your journey.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Essential Policies for Administering an AWS EKS Cluster</title>
      <link>https://andrewodendaal.com/essential-policies-for-administering-an-aws-eks-cluster/</link>
      <pubDate>Fri, 22 Mar 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/essential-policies-for-administering-an-aws-eks-cluster/</guid>
      <description>&lt;p&gt;So, what policies does my role need to create an AWS EKS cluster and be the admin?&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;AmazonEKSClusterPolicy&lt;/strong&gt;: This policy grants permissions to create and manage EKS clusters. It includes actions like &lt;code&gt;eks:CreateCluster&lt;/code&gt;, &lt;code&gt;eks:DescribeCluster&lt;/code&gt;, &lt;code&gt;eks:UpdateClusterConfig&lt;/code&gt;, &lt;code&gt;eks:DeleteCluster&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;AmazonEKSServicePolicy&lt;/strong&gt;: This policy allows the necessary permissions for the EKS service to manage resources on your behalf. It includes actions like &lt;code&gt;eks:DescribeUpdates&lt;/code&gt;, &lt;code&gt;eks:ListClusters&lt;/code&gt;, &lt;code&gt;eks:ListUpdates&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;AmazonEKSServiceRolePolicy&lt;/strong&gt;: This policy is attached to the IAM role assumed by the EKS service. It allows the service to perform necessary operations within your AWS account. This policy is typically managed by AWS and attached to the service role.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Show the Top 10 Largest Directories on Linux</title>
      <link>https://andrewodendaal.com/show-the-top-10-largest-directories-on-linux/</link>
      <pubDate>Wed, 13 Mar 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/show-the-top-10-largest-directories-on-linux/</guid>
      <description>&lt;p&gt;If you need to see the top 10 largest directories on your Linux system, you can use the following command:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;du -h --max-depth&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; / | sort -rh | head -n &lt;span style=&#34;color:#ae81ff&#34;&gt;11&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;alternative&#34;&gt;Alternative&lt;/h2&gt;&#xA;&lt;p&gt;If you are okay to install additional software, then you can use a tool like &lt;code&gt;ncdu&lt;/code&gt; to do the same, but with a lot more options and more features.&lt;/p&gt;&#xA;&lt;h3 id=&#34;installing-ncdu&#34;&gt;Installing &lt;code&gt;ncdu&lt;/code&gt;&lt;/h3&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Ncdu&#34;&gt;&lt;code&gt;ncdu&lt;/code&gt;&lt;/a&gt; is a software package that standards for &amp;ldquo;NCurses Disk Usage&amp;rdquo; and is a disk utility tool for Unix based systems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cloud Cost Optimization Strategies: Maximizing ROI in the Cloud</title>
      <link>https://andrewodendaal.com/cloud-cost-optimization-strategies/</link>
      <pubDate>Fri, 01 Mar 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/cloud-cost-optimization-strategies/</guid>
      <description>&lt;p&gt;As organizations continue to migrate workloads to the cloud, many are experiencing the phenomenon known as &amp;ldquo;cloud shock&amp;rdquo;—the realization that cloud costs are significantly higher than anticipated. While the cloud offers tremendous benefits in terms of agility, scalability, and innovation, these advantages can come at a substantial cost if not managed properly. According to Gartner, through 2024, nearly 60% of organizations will encounter public cloud cost overruns that negatively impact their budgets.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Retrieve the Latest Versioned Tag from AWS ECR in Bash</title>
      <link>https://andrewodendaal.com/retrieve-the-latest-versioned-tag-from-aws-ecr-in-bash/</link>
      <pubDate>Wed, 21 Feb 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/retrieve-the-latest-versioned-tag-from-aws-ecr-in-bash/</guid>
      <description>&lt;p&gt;Managing Docker images in Amazon Elastic Container Registry (ECR) is a common task for many developers and DevOps practitioners. Often, you need to retrieve the latest versioned tag from a repository to streamline deployment processes or ensure compatibility with the most recent features or fixes.&lt;/p&gt;&#xA;&lt;p&gt;In this post, we&amp;rsquo;ll explore a simple Bash command using the AWS CLI and &lt;code&gt;jq&lt;/code&gt; to fetch the latest versioned tag from an ECR repository.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Designing Scalable Systems in AWS: Architecture Patterns for Growth</title>
      <link>https://andrewodendaal.com/designing-scalable-systems-in-aws/</link>
      <pubDate>Mon, 05 Feb 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/designing-scalable-systems-in-aws/</guid>
      <description>&lt;p&gt;In today&amp;rsquo;s digital landscape, building systems that can scale effectively is no longer a luxury—it&amp;rsquo;s a necessity. Whether you&amp;rsquo;re launching a startup that might experience overnight success or managing enterprise applications with predictable but substantial growth, your architecture must be designed to scale seamlessly. Amazon Web Services (AWS) provides a rich ecosystem of services and tools to build highly scalable systems, but knowing how to leverage these resources effectively requires understanding key architectural patterns and best practices.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to install MySQL on AmazonLinux2023</title>
      <link>https://andrewodendaal.com/how-to-install-mysql-on-amazonlinux2023/</link>
      <pubDate>Mon, 29 Jan 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-install-mysql-on-amazonlinux2023/</guid>
      <description>&lt;p&gt;If you are using Amazon Linux 2023 base-image, and you have tried to run &lt;code&gt;yum install -y mysql&lt;/code&gt;, you will soon realize that it doesn&amp;rsquo;t work.&lt;/p&gt;&#xA;&lt;p&gt;Instead install MySQL on Amazon Linux 2023 like this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo dnf update -y&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo dnf install mariadb105-server&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For advanced use-cases where you are installing this in a Docker-in-Docker environment, do it without the &lt;code&gt;sudo&lt;/code&gt;, as follows:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;dnf update -y&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;dnf install mariadb105-server&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now if you run &lt;code&gt;mysql&lt;/code&gt;, you will no longer get the &lt;code&gt;mysql: command not found&lt;/code&gt; message.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Object-Oriented Programming in Python</title>
      <link>https://andrewodendaal.com/articles/python-object-oriented/</link>
      <pubDate>Mon, 29 Jan 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/python-object-oriented/</guid>
      <description>&lt;p&gt;Master OOP concepts in Python including classes.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-and-setup&#34;&gt;Introduction and Setup&lt;/h2&gt;&#xA;&lt;p&gt;When I first started programming in Python, I thought object-oriented programming was just a fancy way to organize code. I couldn&amp;rsquo;t have been more wrong. After years of building everything from web applications to data processing pipelines, I&amp;rsquo;ve learned that OOP isn&amp;rsquo;t just about organization—it&amp;rsquo;s about modeling real-world problems in ways that make your code more maintainable, reusable, and intuitive.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python Testing and Debugging: Quality Assurance</title>
      <link>https://andrewodendaal.com/articles/python-testing-debugging/</link>
      <pubDate>Thu, 18 Jan 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/python-testing-debugging/</guid>
      <description>&lt;p&gt;Master testing frameworks.&lt;/p&gt;&#xA;&lt;h2 id=&#34;understanding-the-testing-mindset-and-environment-setup&#34;&gt;Understanding the Testing Mindset and Environment Setup&lt;/h2&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve seen countless developers jump straight into writing tests without understanding why they&amp;rsquo;re doing it. They treat testing like a checkbox exercise—something to appease their team lead or satisfy code coverage metrics. But here&amp;rsquo;s what I&amp;rsquo;ve learned after years of debugging production failures at 3 AM: testing isn&amp;rsquo;t about proving your code works; it&amp;rsquo;s about discovering how it fails.&lt;/p&gt;&#xA;&lt;p&gt;The mindset shift from &amp;ldquo;my code is perfect&amp;rdquo; to &amp;ldquo;my code will break in ways I haven&amp;rsquo;t imagined&amp;rdquo; is fundamental. When you write tests, you&amp;rsquo;re not just verifying functionality—you&amp;rsquo;re documenting your assumptions, creating safety nets for future changes, and building confidence in your system&amp;rsquo;s behavior under stress.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Choosing the Right Cloud Architecture: A Decision Framework for Modern Applications</title>
      <link>https://andrewodendaal.com/choosing-the-right-cloud-architecture/</link>
      <pubDate>Mon, 15 Jan 2024 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/choosing-the-right-cloud-architecture/</guid>
      <description>&lt;p&gt;In today&amp;rsquo;s rapidly evolving technology landscape, selecting the right cloud architecture is one of the most consequential decisions that organizations face. The architecture you choose not only impacts your application&amp;rsquo;s performance, scalability, and reliability but also significantly affects your development velocity, operational overhead, and total cost of ownership. With multiple architectural patterns available—from traditional monoliths to microservices, serverless, and various hybrid approaches—making an informed decision requires a structured approach that considers your specific business context, technical requirements, and organizational constraints.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python Data Science: Analytics and Machine Learning</title>
      <link>https://andrewodendaal.com/articles/python-data-science/</link>
      <pubDate>Sat, 13 Jan 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/python-data-science/</guid>
      <description>&lt;p&gt;Master Python for data science with NumPy.&lt;/p&gt;&#xA;&lt;h2 id=&#34;setting-up-your-data-science-environment-and-understanding-the-ecosystem&#34;&gt;Setting Up Your Data Science Environment and Understanding the Ecosystem&lt;/h2&gt;&#xA;&lt;p&gt;Environment setup might seem boring, but I&amp;rsquo;ve learned it&amp;rsquo;s where most data science projects succeed or fail. You can have the best analysis in the world, but if your colleagues can&amp;rsquo;t reproduce it because of dependency conflicts, your work becomes worthless. Getting this foundation right from the start saves enormous headaches later.&lt;/p&gt;&#xA;&lt;p&gt;The Python data science ecosystem has evolved dramatically over the past decade. What started as a collection of separate tools has become an integrated platform that rivals specialized statistical software. Understanding how these pieces fit together will make you more effective at solving real problems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python Data Structures: Algorithms and Implementation</title>
      <link>https://andrewodendaal.com/articles/python-data-structures/</link>
      <pubDate>Tue, 09 Jan 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/python-data-structures/</guid>
      <description>&lt;p&gt;Master Python&amp;rsquo;s built-in data structures and implement custom algorithms for efficient data manipulation and problem-solving.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-and-fundamentals&#34;&gt;Introduction and Fundamentals&lt;/h2&gt;&#xA;&lt;p&gt;Last month, I watched a developer spend three hours debugging why their web application was timing out. The culprit wasn&amp;rsquo;t a complex algorithm or a database issue - it was using a list to check if user IDs were valid. With 50,000 users, each login attempt was checking potentially all 50,000 entries. A simple change to a set reduced login time from 2 seconds to 2 milliseconds.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Asynchronous Programming in Python: Building High-Performance Applications</title>
      <link>https://andrewodendaal.com/articles/python-async-programming/</link>
      <pubDate>Wed, 03 Jan 2024 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/python-async-programming/</guid>
      <description>&lt;p&gt;Master Python&amp;rsquo;s asynchronous programming capabilities to build fast, scalable applications that handle thousands of concurrent operations efficiently.&lt;/p&gt;&#xA;&lt;h2 id=&#34;why-async-programming-matters&#34;&gt;Why Async Programming Matters&lt;/h2&gt;&#xA;&lt;p&gt;Asynchronous programming can seem like magic when you see a single Python process handle 10,000 concurrent connections. How can one thread outperform traditional multi-threaded servers? The answer lies in efficiency and smart resource management.&lt;/p&gt;&#xA;&lt;p&gt;Think of a restaurant where waiters take one order, go to the kitchen, wait for the food to cook, bring it back, then serve the next customer. If your meal takes 20 minutes, other customers wait 20 minutes just to place their order.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python Fundamentals: Complete Programming Foundation</title>
      <link>https://andrewodendaal.com/articles/python-fundamentals/</link>
      <pubDate>Sat, 30 Dec 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/python-fundamentals/</guid>
      <description>&lt;p&gt;Build a solid foundation in Python programming with comprehensive coverage of syntax.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-and-setup&#34;&gt;Introduction and Setup&lt;/h2&gt;&#xA;&lt;p&gt;Python has earned its reputation as one of the most approachable programming languages. What takes 20 lines of code in other languages often requires just 3 lines in Python. This simplicity isn&amp;rsquo;t accidental—it&amp;rsquo;s the result of deliberate design choices that prioritize readability and developer productivity.&lt;/p&gt;&#xA;&lt;p&gt;When Guido van Rossum created Python, he built it around a philosophy of clean, readable code. The result is a language that reads almost like English, making it perfect for beginners while remaining powerful enough for complex applications. This guide will take you from Python basics to building real-world applications.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Run any version of Terrform using Docker</title>
      <link>https://andrewodendaal.com/run-any-version-of-terrform-using-docker/</link>
      <pubDate>Fri, 22 Dec 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/run-any-version-of-terrform-using-docker/</guid>
      <description>&lt;p&gt;So our friend Docker comes around for another usecase.&lt;/p&gt;&#xA;&lt;h2 id=&#34;run-terraform-any-version-from-docker&#34;&gt;Run Terraform (any version) from Docker&lt;/h2&gt;&#xA;&lt;p&gt;In this example, we will try and configure Terraform 1.4.0 through Docker, so that we don&amp;rsquo;t need to install it on our host system.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;alias terraform14&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;docker run --rm -it -w $PWD:$PWD -v $PWD:$PWD hashicorp/terraform:1.4.0&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To use it, we simply run a Terraform command:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;terraform14 -version&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;next-lets-try-another-terraform-version-as-well&#34;&gt;Next let&amp;rsquo;s try another Terraform version as well&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;alias terraform15&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;docker run --rm -it -w $PWD:$PWD -v $PWD:$PWD hashicorp/terraform:1.5.0&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To use it, like before:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Select * to Show Database Table Sizes MariaDB</title>
      <link>https://andrewodendaal.com/select-show-database-table-sizes-mariadb/</link>
      <pubDate>Thu, 21 Dec 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/select-show-database-table-sizes-mariadb/</guid>
      <description>&lt;p&gt;In database management, understanding the size of your tables is crucial for optimizing performance and ensuring efficient resource utilization. If you&amp;rsquo;re a technical enthusiast or a seasoned database administrator working with MariaDB, this blog post is tailored just for you. Today, we&amp;rsquo;ll unravel the mystery behind MariaDB database table sizes using a powerful SQL query.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;SELECT&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  table_schema &lt;span style=&#34;color:#66d9ef&#34;&gt;AS&lt;/span&gt; DB_NAME, &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;TABLE_NAME&lt;/span&gt;, &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  (DATA_LENGTH&lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt;INDEX_LENGTH)&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1024&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1024&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1024&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;AS&lt;/span&gt; TABLE_SIZE_in_MB&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;FROM&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  information_schema.TABLES&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;ORDER&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;BY&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  TABLE_SIZE_in_MB &lt;span style=&#34;color:#66d9ef&#34;&gt;DESC&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;exploring-mariadb-table-sizes&#34;&gt;Exploring MariaDB Table Sizes&lt;/h2&gt;&#xA;&lt;p&gt;MariaDB stands out as a robust and reliable option. To gain insights into your database&amp;rsquo;s table sizes, we&amp;rsquo;re going to wield the mighty SQL language. Our tool of choice is a concise yet potent query that taps into the depths of MariaDB&amp;rsquo;s information schema.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Graceful Shutdown Patterns in Go</title>
      <link>https://andrewodendaal.com/articles/go-graceful-shutdown/</link>
      <pubDate>Sun, 10 Dec 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-graceful-shutdown/</guid>
      <description>&lt;p&gt;Implement proper shutdown procedures for Go applications.&lt;/p&gt;&#xA;&lt;h4 id=&#34;signal-handling-fundamentals&#34;&gt;Signal Handling Fundamentals&lt;/h4&gt;&#xA;&lt;p&gt;At the core of graceful shutdown is the ability to detect and respond to termination signals. Before diving into complex implementations, let&amp;rsquo;s establish a solid understanding of signal handling in Go.&lt;/p&gt;&#xA;&lt;h4 id=&#34;understanding-os-signals&#34;&gt;Understanding OS Signals&lt;/h4&gt;&#xA;&lt;p&gt;Operating systems communicate with processes through signals. The most common signals relevant to application lifecycle management include:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;SIGINT&lt;/strong&gt; (Ctrl+C): Interrupt signal, typically sent when a user presses Ctrl+C&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;SIGTERM&lt;/strong&gt;: Termination signal, the standard way to request graceful termination&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;SIGKILL&lt;/strong&gt;: Kill signal, forces immediate termination (cannot be caught or ignored)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;SIGHUP&lt;/strong&gt;: Hangup signal, traditionally used to indicate a controlling terminal has closed&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;In Go, we can capture and handle these signals using the &lt;code&gt;os/signal&lt;/code&gt; package and channels:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rate Limiting Strategies in Go</title>
      <link>https://andrewodendaal.com/articles/go-rate-limiting/</link>
      <pubDate>Fri, 08 Dec 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-rate-limiting/</guid>
      <description>&lt;p&gt;Implement sophisticated rate limiting algorithms and patterns in Go for API protection.&lt;/p&gt;&#xA;&lt;h4 id=&#34;rate-limiting-fundamentals&#34;&gt;Rate Limiting Fundamentals&lt;/h4&gt;&#xA;&lt;p&gt;Rate limiting is a strategy to control the rate at which a user, service, or system can access a resource or perform operations. Before diving into complex implementations, let&amp;rsquo;s establish a solid understanding of the core concepts and basic approaches.&lt;/p&gt;&#xA;&lt;h4 id=&#34;core-concepts-and-terminology&#34;&gt;Core Concepts and Terminology&lt;/h4&gt;&#xA;&lt;p&gt;Rate limiting involves several key concepts:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Request Rate&lt;/strong&gt;: The number of requests per unit time (e.g., 100 requests per second)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Burst&lt;/strong&gt;: A temporary spike in request rate&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Quota&lt;/strong&gt;: The maximum number of requests allowed in a given time window&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Throttling&lt;/strong&gt;: The act of delaying or rejecting requests that exceed defined limits&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Rate Limiter&lt;/strong&gt;: The component that enforces rate limits&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h4 id=&#34;simple-counter-based-rate-limiter&#34;&gt;Simple Counter-Based Rate Limiter&lt;/h4&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s start with a basic implementation—a fixed window counter rate limiter:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Advanced Go Reflection and Code Generation</title>
      <link>https://andrewodendaal.com/articles/go-reflection-code-generation/</link>
      <pubDate>Wed, 22 Nov 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-reflection-code-generation/</guid>
      <description>&lt;p&gt;Master Go&amp;rsquo;s reflection capabilities and code generation techniques for building flexible.&lt;/p&gt;&#xA;&lt;p&gt;#Go is known for simplicity, but sometimes you need more flexibility. Reflection lets you inspect types and values at runtime, while code generation creates Go code automatically. Both techniques help eliminate repetitive code and build more flexible systems.&lt;/p&gt;&#xA;&lt;h2 id=&#34;when-you-need-these-techniques&#34;&gt;When You Need These Techniques&lt;/h2&gt;&#xA;&lt;p&gt;Most Go code doesn&amp;rsquo;t need reflection or code generation. But they&amp;rsquo;re valuable when:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Building frameworks&lt;/strong&gt;: ORMs, web frameworks, and serialization libraries&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Eliminating boilerplate&lt;/strong&gt;: Generating repetitive struct methods&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Dynamic behavior&lt;/strong&gt;: Handling unknown types at runtime&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;API tooling&lt;/strong&gt;: Generating client libraries from definitions&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Testing utilities&lt;/strong&gt;: Creating mocks and test helpers&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;reflection-vs-code-generation&#34;&gt;Reflection vs Code Generation&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;Reflection&lt;/strong&gt; happens at runtime:&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Future Prospects of DevOps in an AI World</title>
      <link>https://andrewodendaal.com/the-future-prospects-of-devops-in-an-ai-world/</link>
      <pubDate>Mon, 20 Nov 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/the-future-prospects-of-devops-in-an-ai-world/</guid>
      <description>&lt;h2 id=&#34;abstract&#34;&gt;Abstract&lt;/h2&gt;&#xA;&lt;p&gt;DevOps has become an integral part of modern software development, emphasizing communication and collaboration between software developers and IT operations professionals. However, with the rise of artificial intelligence (AI), the future role and necessity of devops has been brought into question. This paper explores the prospects for devops in an increasingly AI-driven world, including devops&amp;rsquo; potential contributions to and collaboration with AI, as well as the possibility of eventual replacement by intelligent systems. Both theoretical analysis and real-world trajectory suggest devops retaining relevance, albeit with an evolving role and skillset demands.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Go Pipeline Patterns for Data Processing</title>
      <link>https://andrewodendaal.com/articles/go-pipeline-patterns/</link>
      <pubDate>Thu, 09 Nov 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-pipeline-patterns/</guid>
      <description>&lt;p&gt;Build efficient data processing pipelines in Go using channel patterns.&lt;/p&gt;&#xA;&lt;p&gt;#Processing large amounts of data efficiently is a common challenge. Pipeline patterns break complex processing into stages, where each stage does one thing well and passes results to the next stage.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-are-pipeline-patterns&#34;&gt;What Are Pipeline Patterns?&lt;/h2&gt;&#xA;&lt;p&gt;Think of an assembly line: each worker performs a specific task and passes the work to the next person. Pipeline patterns work similarly:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Input Stage&lt;/strong&gt;: Receives raw data&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Processing Stages&lt;/strong&gt;: Transform, filter, or enrich data&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Output Stage&lt;/strong&gt;: Sends results somewhere useful&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Each stage runs concurrently, so while stage 1 processes item N, stage 2 can process item N-1, and stage 3 can process item N-2.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Event Sourcing Implementation in Go</title>
      <link>https://andrewodendaal.com/articles/go-event-sourcing/</link>
      <pubDate>Fri, 03 Nov 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-event-sourcing/</guid>
      <description>&lt;p&gt;Build event-sourced systems in Go with CQRS patterns.&lt;/p&gt;&#xA;&lt;p&gt;#Most applications store only current state - when something changes, the old data is lost. Event sourcing takes a different approach: store every change as an immutable event, preserving the complete history.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-problem-with-state-based-storage&#34;&gt;The Problem with State-Based Storage&lt;/h2&gt;&#xA;&lt;p&gt;Traditional applications work like this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Traditional approach - only current state&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;type&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Account&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;struct&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;ID&lt;/span&gt;      &lt;span style=&#34;color:#66d9ef&#34;&gt;string&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Balance&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Status&lt;/span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;string&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// When balance changes, old value is lost&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;func&lt;/span&gt; (&lt;span style=&#34;color:#a6e22e&#34;&gt;a&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Account&lt;/span&gt;) &lt;span style=&#34;color:#a6e22e&#34;&gt;Withdraw&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;amount&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt;) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;a&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Balance&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;-=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;amount&lt;/span&gt;  &lt;span style=&#34;color:#75715e&#34;&gt;// History is gone&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Problems with this approach:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Supercharge Your Code with Amazon CodeWhisperer</title>
      <link>https://andrewodendaal.com/supercharge-your-code-with-amazon-codewhisperer/</link>
      <pubDate>Sun, 29 Oct 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/supercharge-your-code-with-amazon-codewhisperer/</guid>
      <description>&lt;p&gt;Amazon CodeWhisperer is a cutting-edge service that leverages advanced AI and machine learning to provide real-time code generation, recommendations, and security analysis. As a developer, CodeWhisperer can supercharge your productivity and code quality.&lt;/p&gt;&#xA;&lt;h2 id=&#34;key-capabilities&#34;&gt;Key Capabilities&lt;/h2&gt;&#xA;&lt;h3 id=&#34;neural-code-generation&#34;&gt;Neural Code Generation&lt;/h3&gt;&#xA;&lt;p&gt;CodeWhisperer utilizes powerful neural networks to generate code snippets and entire functions on demand. The advanced models are trained on millions of code samples and can produce idiomatic, human-readable code for a wide variety of programming languages.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Deep Dive into Machine Learning Algorithms</title>
      <link>https://andrewodendaal.com/a-deep-dive-into-machine-learning-algorithms/</link>
      <pubDate>Sat, 28 Oct 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/a-deep-dive-into-machine-learning-algorithms/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://andrewodendaal.com/tags/ml&#34;&gt;Machine learning&lt;/a&gt; algorithms are the backbone of modern artificial intelligence. They enable computers to learn and make predictions or decisions without being explicitly programmed. In this comprehensive guide, we will delve into common machine learning algorithms, providing detailed explanations and code examples to help you understand their inner workings. Whether you&amp;rsquo;re a beginner or an experienced data scientist, this post will be a valuable resource to enhance your understanding of machine learning.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What is GitHub? A Comprehensive Guide from Basics to Advanced</title>
      <link>https://andrewodendaal.com/what-is-github-a-comprehensive-guide-from-basics-to-advanced/</link>
      <pubDate>Fri, 27 Oct 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/what-is-github-a-comprehensive-guide-from-basics-to-advanced/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://github.com&#34;&gt;GitHub&lt;/a&gt; is a platform that has revolutionized the world of software development, enabling individuals and teams to collaborate efficiently on projects of all sizes. In this comprehensive guide, we&amp;rsquo;ll explore GitHub from the very basics to the most advanced features. Whether you&amp;rsquo;re a novice or an experienced developer, you&amp;rsquo;ll find valuable insights and tips to enhance your understanding of GitHub.&lt;/p&gt;&#xA;&lt;h2 id=&#34;part-1-git-basics&#34;&gt;Part 1: Git Basics&lt;/h2&gt;&#xA;&lt;p&gt;Before diving into GitHub, it&amp;rsquo;s essential to grasp the fundamental concepts of Git, the version control system that underlies GitHub.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Connect IPv4 and IPv6 Networks Seamlessly with Amazon VPC Lattice</title>
      <link>https://andrewodendaal.com/connect-ipv4-ipv6-networks-seamlessly-amazon-vpc-lattice/</link>
      <pubDate>Thu, 26 Oct 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/connect-ipv4-ipv6-networks-seamlessly-amazon-vpc-lattice/</guid>
      <description>&lt;p&gt;As the internet continues to grow, the transition from IPv4 to IPv6 has become more critical. Organizations need to manage both IP stacks efficiently and ensure seamless connectivity. Amazon Web Services (AWS) offers a groundbreaking solution: Amazon VPC Lattice. In this advanced guide, we&amp;rsquo;ll delve deeper into Amazon VPC Lattice, its technical details, and provide code examples for advanced users.&lt;/p&gt;&#xA;&lt;h2 id=&#34;a-lattice-of-connectivity&#34;&gt;A Lattice of Connectivity&lt;/h2&gt;&#xA;&lt;p&gt;Amazon VPC Lattice simplifies the coexistence of IPv4 and IPv6 stacks within your Virtual Private Cloud (VPC). The innovation lies in its ability to bridge the gap between these two IP versions without the need for Network Address Translation (NAT) devices. Let&amp;rsquo;s explore the capabilities of VPC Lattice and its significance in modern networking.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building Event-Driven Architectures with Amazon EventBridge</title>
      <link>https://andrewodendaal.com/building-event-driven-architectures-amazon-eventbridge/</link>
      <pubDate>Wed, 25 Oct 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/building-event-driven-architectures-amazon-eventbridge/</guid>
      <description>&lt;p&gt;In the realm of real-time data streaming applications, managing the routing and processing of events efficiently is a complex challenge. Amazon Web Services (AWS) has a powerful solution: Amazon EventBridge.&lt;/p&gt;&#xA;&lt;p&gt;In the realm of real-time data streaming applications, managing the routing and processing of events efficiently is a complex challenge. Amazon Web Services (AWS) has a powerful solution: Amazon EventBridge. In this advanced guide, we&amp;rsquo;ll delve deeper into EventBridge, its key concepts, and provide code examples for advanced users.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Splitting Terraform Modules into Separate Git Repositories</title>
      <link>https://andrewodendaal.com/splitting-terraform-modules-into-separate-git-repositories/</link>
      <pubDate>Tue, 24 Oct 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/splitting-terraform-modules-into-separate-git-repositories/</guid>
      <description>&lt;p&gt;In the world of &lt;a href=&#34;https://andrewodendaal.com/tags/terraform/&#34;&gt;Infrastructure as Code (IaC)&lt;/a&gt;, Terraform has emerged as a powerful tool for managing infrastructure resources. As your Terraform codebase grows, managing monolithic code can become challenging. In this advanced-level blog post, we will explore the process of moving Terraform modules into separate &lt;a href=&#34;https://andrewodendaal.com/tags/git/&#34;&gt;Git repositories&lt;/a&gt; and referencing these modules across multiple repositories. This approach can help you achieve better code organization, reusability, and collaboration in your infrastructure provisioning projects.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Accelerating Machine Learning with SageMaker Jumpstart</title>
      <link>https://andrewodendaal.com/accelerating-machine-learning-sagemaker-jumpstart/</link>
      <pubDate>Sun, 22 Oct 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/accelerating-machine-learning-sagemaker-jumpstart/</guid>
      <description>&lt;p&gt;Machine learning (ML) projects can be complex, time-consuming, and resource-intensive. Amazon SageMaker Jumpstart aims to change that by providing pre-built solutions, pre-trained models, and end-to-end ML capabilities. In this advanced guide, we&amp;rsquo;ll dive deep into SageMaker Jumpstart and provide code examples to illustrate its power.&lt;/p&gt;&#xA;&lt;h2 id=&#34;unleashing-ml-potential&#34;&gt;Unleashing ML Potential&lt;/h2&gt;&#xA;&lt;p&gt;Amazon SageMaker Jumpstart is designed to accelerate your ML journey. It offers a wide range of pre-built solutions and pre-trained models for various ML use cases, including natural language processing, computer vision, and more. Let&amp;rsquo;s delve into the capabilities of SageMaker Jumpstart and how it can make your ML projects more efficient.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Understanding the AWS Well-Architected Framework</title>
      <link>https://andrewodendaal.com/aws-well-architected-framework/</link>
      <pubDate>Thu, 19 Oct 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/aws-well-architected-framework/</guid>
      <description>&lt;p&gt;The AWS Well-Architected Framework is more than just a set of best practices; it&amp;rsquo;s a blueprint for success in the cloud. It offers a comprehensive guide to building high-quality, efficient, and cost-effective architectures on Amazon Web Services (AWS). In this blog post, we&amp;rsquo;ll delve into the key principles and pillars of the AWS Well-Architected Framework and explore how you can leverage it to ensure your cloud infrastructure is robust and resilient.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Mastering Advanced Networking in EKS and Kubernetes</title>
      <link>https://andrewodendaal.com/mastering-advanced-networking-in-eks-and-kubernetes/</link>
      <pubDate>Mon, 16 Oct 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/mastering-advanced-networking-in-eks-and-kubernetes/</guid>
      <description>&lt;p&gt;Kubernetes has revolutionized container orchestration, and Amazon&amp;rsquo;s Elastic Kubernetes Service (EKS) is one of the most popular managed Kubernetes solutions available today. While getting started with EKS and Kubernetes is relatively straightforward, mastering advanced networking topics is essential for managing complex workloads and achieving optimal performance. In this comprehensive guide, we will explore advanced networking concepts in EKS and Kubernetes, accompanied by code examples and practical insights.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-vpc-design-and-eks-setup&#34;&gt;1. VPC Design and EKS Setup&lt;/h2&gt;&#xA;&lt;p&gt;When &lt;a href=&#34;https://andrewodendaal.com/teach-me-kubernetes-part1-overview&#34;&gt;working with EKS&lt;/a&gt;, it&amp;rsquo;s crucial to have a &lt;a href=&#34;https://andrewodendaal.com/aws-well-architected-framework&#34;&gt;well-architected&lt;/a&gt; VPC. This section will cover best practices for VPC design, creating EKS clusters, and securing them with security groups and Network ACLs. Let&amp;rsquo;s look at a snippet of Terraform code to create a VPC:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Ignore SSL Certificates Globally in Git</title>
      <link>https://andrewodendaal.com/how-to-ignore-ssl-certificates-globally-in-git/</link>
      <pubDate>Sat, 14 Oct 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-ignore-ssl-certificates-globally-in-git/</guid>
      <description>&lt;p&gt;In the world of software development, Git is an indispensable tool for version control. However, when working with repositories that use &lt;a href=&#34;https://andrewodendaal.com/tags/ssl/&#34;&gt;SSL certificates&lt;/a&gt;, you might encounter situations where you need to ignore SSL certificate verification globally. Whether it&amp;rsquo;s for testing or debugging purposes, this guide will show you how to ignore SSL certificates globally in &lt;a href=&#34;https://andrewodendaal.com/tags/git/&#34;&gt;Git&lt;/a&gt; and even disable SSL certificate checks altogether. We&amp;rsquo;ll cover everything from the basics to advanced configurations to help you manage SSL certificates effectively in your &lt;a href=&#34;https://andrewodendaal.com/gitops-rising-transforming-devops-streamlined-delivery/&#34;&gt;Git workflow&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Semantic Versioning with npm</title>
      <link>https://andrewodendaal.com/semantic-versioning-with-npm/</link>
      <pubDate>Fri, 13 Oct 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/semantic-versioning-with-npm/</guid>
      <description>&lt;p&gt;Semantic Versioning, often referred to as SemVer, is a crucial convention within the Node.js ecosystem. It provides a clear and structured way of versioning software, ensuring that developers can easily understand the impact of version changes. In this blog post, we&amp;rsquo;ll explore the principles of Semantic Versioning and how npm (&lt;a href=&#34;https://andrewodendaal.com/introduction-to-npm&#34;&gt;Node Package Manager&lt;/a&gt;) leverages it to manage packages effectively.&lt;/p&gt;&#xA;&lt;h2 id=&#34;understanding-semantic-versioning&#34;&gt;Understanding Semantic Versioning&lt;/h2&gt;&#xA;&lt;p&gt;Semantic Versioning is based on a three-digit version number, often expressed as &lt;code&gt;x.y.z&lt;/code&gt;, where each digit has a specific meaning:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Understanding Peer Dependencies in Node Modules</title>
      <link>https://andrewodendaal.com/understanding-peer-dependencies-in-node-modules/</link>
      <pubDate>Thu, 12 Oct 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/understanding-peer-dependencies-in-node-modules/</guid>
      <description>&lt;p&gt;When working with Node.js and managing packages for your projects, you&amp;rsquo;re likely familiar with the &lt;code&gt;dependencies&lt;/code&gt; and &lt;code&gt;devDependencies&lt;/code&gt; sections in a &lt;code&gt;package.json&lt;/code&gt; file. These sections define the packages your project depends on for both production and development purposes. However, there&amp;rsquo;s another crucial field often overlooked but equally important: &lt;code&gt;peerDependencies&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In this blog post, we will delve into the concept of &lt;code&gt;peerDependencies&lt;/code&gt; and how they differ from regular dependencies and &lt;code&gt;devDependencies&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Programmatically get Amazon IP Ranges/CIDRs</title>
      <link>https://andrewodendaal.com/how-to-programmatically-get-amazon-ip-ranges-cidrs/</link>
      <pubDate>Wed, 11 Oct 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-programmatically-get-amazon-ip-ranges-cidrs/</guid>
      <description>&lt;p&gt;Amazon Web Services (AWS) operates an extensive network infrastructure with a vast number of IP addresses and CIDR blocks. As a developer or network administrator, you may need to programmatically retrieve the IP ranges or CIDRs associated with AWS regions and services for various reasons, such as configuring firewall rules or network security groups. In this guide, we&amp;rsquo;ll show you how to accomplish this using Python.&lt;/p&gt;&#xA;&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;&#xA;&lt;p&gt;Before we dive into the code, make sure you have the following prerequisites in place:&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Ultimate Guide to Emacs: Mastering the Art of CLI Programming</title>
      <link>https://andrewodendaal.com/ultimate-guide-to-emacs-mastering-the-art-of-cli-programming/</link>
      <pubDate>Tue, 10 Oct 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/ultimate-guide-to-emacs-mastering-the-art-of-cli-programming/</guid>
      <description>&lt;p&gt;In the realm of command-line interface (CLI) programming, Emacs stands as a legendary text editor, known for its immense power and unparalleled extensibility. For decades, Emacs has been the tool of choice for seasoned CLI programmers who demand efficiency and customization. In this ultimate guide, we will explore advanced and expert ways to harness the full potential of Emacs, helping you become an amazing CLI programmer.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-to-emacs&#34;&gt;Introduction to Emacs&lt;/h2&gt;&#xA;&lt;h3 id=&#34;what-is-emacs&#34;&gt;What is Emacs?&lt;/h3&gt;&#xA;&lt;p&gt;Emacs is a highly extensible, open-source text editor with a rich history dating back to the 1970s. It&amp;rsquo;s renowned for its &amp;ldquo;everything is a buffer&amp;rdquo; philosophy, which means you can edit not only code but also emails, calendar events, and more from within Emacs.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Ultimate Guide to VI: Mastering the Art of CLI Programming</title>
      <link>https://andrewodendaal.com/ultimate-guide-to-vi-mastering-the-art-of-cli-programming/</link>
      <pubDate>Mon, 09 Oct 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/ultimate-guide-to-vi-mastering-the-art-of-cli-programming/</guid>
      <description>&lt;p&gt;In the world of command-line interface (CLI) programming, efficiency is paramount. And when it comes to text editing in the CLI, there&amp;rsquo;s no tool more legendary than VI. This powerful, yet enigmatic text editor has been the choice of seasoned CLI programmers for decades. In this ultimate guide, we will explore advanced and expert ways to harness the full potential of VI, helping you become an amazing CLI programmer.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-to-vi&#34;&gt;Introduction to VI&lt;/h2&gt;&#xA;&lt;h3 id=&#34;what-is-vi&#34;&gt;What is VI?&lt;/h3&gt;&#xA;&lt;p&gt;VI, which stands for &amp;ldquo;Visual Editor,&amp;rdquo; is a highly efficient and lightweight text editor that comes pre-installed on most Unix-like systems. Its minimalist design and keyboard-centric interface make it a favorite among power users who spend a lot of time in the terminal.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AWS Assume to another role</title>
      <link>https://andrewodendaal.com/aws-assume-role/</link>
      <pubDate>Sun, 08 Oct 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/aws-assume-role/</guid>
      <description>&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;OUT&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;aws sts assume-role --role-arn arn:aws:iam::0123456789:role/OrganizationAccountAccessRole --role-session-name test&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;export AWS_ACCESS_KEY_ID&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;echo $OUT | cut -d &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&amp;#34;&amp;#39;&lt;/span&gt; -f &lt;span style=&#34;color:#ae81ff&#34;&gt;6&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;export AWS_SECRET_ACCESS_KEY&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;echo $OUT | cut -d &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&amp;#34;&amp;#39;&lt;/span&gt; -f &lt;span style=&#34;color:#ae81ff&#34;&gt;10&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;export AWS_SESSION_TOKEN&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;echo $OUT | cut -d &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&amp;#34;&amp;#39;&lt;/span&gt; -f &lt;span style=&#34;color:#ae81ff&#34;&gt;14&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;aws sts get-caller-identity&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>Service Discovery Patterns in Go</title>
      <link>https://andrewodendaal.com/articles/go-service-discovery/</link>
      <pubDate>Wed, 04 Oct 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-service-discovery/</guid>
      <description>&lt;p&gt;Implement service discovery mechanisms in Go microservices using various patterns and tools for dynamic service registration and lookup.&lt;/p&gt;&#xA;&lt;h4 id=&#34;service-discovery-fundamentals&#34;&gt;Service Discovery Fundamentals&lt;/h4&gt;&#xA;&lt;p&gt;Before diving into implementation details, let&amp;rsquo;s establish a solid understanding of service discovery concepts and their role in distributed systems.&lt;/p&gt;&#xA;&lt;h4 id=&#34;the-service-discovery-problem&#34;&gt;The Service Discovery Problem&lt;/h4&gt;&#xA;&lt;p&gt;In a traditional monolithic application, components communicate through in-memory function calls or well-known local interfaces. In distributed systems, however, services run on different machines with their own network locations, creating several challenges:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Programming Languages Series</title>
      <link>https://andrewodendaal.com/programming-languages-series/</link>
      <pubDate>Mon, 02 Oct 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/programming-languages-series/</guid>
      <description>&lt;h2 id=&#34;1-introduction&#34;&gt;1. Introduction&lt;/h2&gt;&#xA;&lt;p&gt;Welcome to our Programming Languages Series! In this series, we&amp;rsquo;ll explore various programming languages, understand their purposes, provide code examples, and discuss when to use each one. Let&amp;rsquo;s begin with an introduction to programming languages.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-are-programming-languages&#34;&gt;What Are Programming Languages?&lt;/h2&gt;&#xA;&lt;p&gt;Programming languages are a means of communication between humans and computers. They allow developers to instruct computers to perform specific tasks, ranging from simple calculations to complex data processing and application development.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Go Worker Pool Patterns: Scalable Concurrent Processing</title>
      <link>https://andrewodendaal.com/articles/go-worker-pools/</link>
      <pubDate>Thu, 28 Sep 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-worker-pools/</guid>
      <description>&lt;p&gt;Master worker pool patterns in Go for building scalable.&lt;/p&gt;&#xA;&lt;p&gt;#Processing many tasks concurrently is a common need, but creating unlimited goroutines can overwhelm your system. Worker pools solve this by using a fixed number of workers to process tasks from a queue.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-problem-with-unlimited-goroutines&#34;&gt;The Problem with Unlimited Goroutines&lt;/h2&gt;&#xA;&lt;p&gt;Consider processing 10,000 images:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Don&amp;#39;t do this - creates 10,000 goroutines&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;_&lt;/span&gt;, &lt;span style=&#34;color:#a6e22e&#34;&gt;image&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;range&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;images&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;go&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;processImage&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;image&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This approach can:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Exhaust memory with too many goroutines&lt;/li&gt;&#xA;&lt;li&gt;Overwhelm the CPU with context switching&lt;/li&gt;&#xA;&lt;li&gt;Crash your system under high load&lt;/li&gt;&#xA;&lt;li&gt;Make it hard to control resource usage&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;worker-pool-solution&#34;&gt;Worker Pool Solution&lt;/h2&gt;&#xA;&lt;p&gt;Instead, use a fixed number of workers:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Docker Deep Dive Series</title>
      <link>https://andrewodendaal.com/docker-deep-dive-series/</link>
      <pubDate>Fri, 22 Sep 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/docker-deep-dive-series/</guid>
      <description>&lt;h2 id=&#34;1-getting-started&#34;&gt;1. Getting Started&lt;/h2&gt;&#xA;&lt;p&gt;In this first part of the series, we will kick things off by getting Docker installed and running on your system. Docker makes it easy to package and distribute applications as containers, ensuring consistent environments across different stages of the development and deployment pipeline.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s jump right in and get Docker up and running!&lt;/p&gt;&#xA;&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;&#xA;&lt;p&gt;Before we start, ensure that you have the following prerequisites installed on your system:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Go Atomic Operations: Lock-Free Programming</title>
      <link>https://andrewodendaal.com/articles/go-atomic-operations/</link>
      <pubDate>Thu, 21 Sep 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-atomic-operations/</guid>
      <description>&lt;p&gt;Master Go&amp;rsquo;s atomic operations for building high-performance.&lt;/p&gt;&#xA;&lt;h4 id=&#34;understanding-gos-memory-model&#34;&gt;Understanding Go&amp;rsquo;s Memory Model&lt;/h4&gt;&#xA;&lt;p&gt;Before diving into atomic operations, it&amp;rsquo;s essential to understand Go&amp;rsquo;s memory model, which defines the rules for how memory operations in one goroutine become visible to another. This understanding forms the foundation for correct concurrent programming in Go.&lt;/p&gt;&#xA;&lt;h4 id=&#34;memory-ordering-and-visibility&#34;&gt;Memory Ordering and Visibility&lt;/h4&gt;&#xA;&lt;p&gt;Go&amp;rsquo;s memory model is based on the happens-before relationship, which determines when the effects of one goroutine&amp;rsquo;s memory operations become visible to another goroutine:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Machine Learning Mastery Series</title>
      <link>https://andrewodendaal.com/machine-learning-mastery-series/</link>
      <pubDate>Wed, 13 Sep 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/machine-learning-mastery-series/</guid>
      <description>&lt;h2 id=&#34;part-1-introduction-to-machine-learning&#34;&gt;Part 1. Introduction to Machine Learning&lt;/h2&gt;&#xA;&lt;p&gt;Welcome to the Machine Learning Mastery Series, a comprehensive journey into the exciting world of machine learning. In this first installment, we&amp;rsquo;ll lay the foundation by exploring the fundamentals of machine learning, its types, and the essential concepts that underpin this transformative field.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-machine-learning&#34;&gt;What is Machine Learning?&lt;/h2&gt;&#xA;&lt;p&gt;Machine learning is a subfield of artificial intelligence (AI) that focuses on developing algorithms and models that enable computers to learn from and make predictions or decisions based on data. Unlike traditional programming, where explicit instructions are provided to solve a specific task, machine learning systems learn patterns and relationships from data to make informed decisions.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes Mastery</title>
      <link>https://andrewodendaal.com/kubernetes-mastery/</link>
      <pubDate>Sun, 03 Sep 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/kubernetes-mastery/</guid>
      <description>&lt;h2 id=&#34;part-1-introduction&#34;&gt;Part 1. Introduction&lt;/h2&gt;&#xA;&lt;p&gt;Welcome to the Kubernetes Mastery Series! In this first part, we&amp;rsquo;ll set up a Kubernetes cluster using KinD (Kubernetes in Docker). This series will build on concepts covered in our &lt;a href=&#34;https://andrewodendaal.com/the-ultimate-guide-to-kubernetes-deployment-strategies&#34;&gt;Ultimate Guide to Kubernetes Deployment Strategies&lt;/a&gt; and provide practical implementations of &lt;a href=&#34;https://andrewodendaal.com/devops-risk-management-security-compliance&#34;&gt;DevOps security best practices&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites:&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Docker&lt;/li&gt;&#xA;&lt;li&gt;kubectl&lt;/li&gt;&#xA;&lt;li&gt;KinD&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Step 1: Install Docker&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Step 2: Install kubectl&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Step 3: Install KinD&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Step 4: Create a KinD cluster&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;kind create cluster --name my-cluster --config - &amp;lt;&amp;lt;EOF&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;kind&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;Cluster&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;apiVersion&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;kind.x-k8s.io/v1alpha4&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;nodes&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;- &lt;span style=&#34;color:#f92672&#34;&gt;role&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;control-plane&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;- &lt;span style=&#34;color:#f92672&#34;&gt;role&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;worker&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;- &lt;span style=&#34;color:#f92672&#34;&gt;role&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;worker&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;EOF&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Step 5: Set kubectl context&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;kubectl cluster-info --context kind-my-cluster&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Step 6: Verify cluster nodes&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;kubectl get nodes&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;part-2-deploying-your-first-app&#34;&gt;Part 2. Deploying Your First App&lt;/h2&gt;&#xA;&lt;p&gt;In this second part, we&amp;rsquo;ll explore how to deploy your first application to the Kubernetes cluster you set up in Part 1.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Advanced Go Concurrency Patterns</title>
      <link>https://andrewodendaal.com/articles/go-concurrency-patterns/</link>
      <pubDate>Sun, 03 Sep 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-concurrency-patterns/</guid>
      <description>&lt;p&gt;Master sophisticated concurrency patterns in Go including worker pools.&lt;/p&gt;&#xA;&lt;p&gt;#Go&amp;rsquo;s concurrency model is powerful, but building distributed systems requires more than basic goroutines and channels. You need patterns that handle coordination across services, manage failures gracefully, and scale under load.&lt;/p&gt;&#xA;&lt;h2 id=&#34;beyond-basic-concurrency&#34;&gt;Beyond Basic Concurrency&lt;/h2&gt;&#xA;&lt;p&gt;Most Go tutorials cover the basics: launching goroutines, sending values through channels, and using select statements. But real distributed systems face challenges like:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Service coordination&lt;/strong&gt;: Multiple services need to work together&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Failure handling&lt;/strong&gt;: Networks partition, services crash, timeouts occur&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Load management&lt;/strong&gt;: Systems must handle varying traffic patterns&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Resource coordination&lt;/strong&gt;: Shared resources need careful management&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;patterns-youll-learn&#34;&gt;Patterns You&amp;rsquo;ll Learn&lt;/h2&gt;&#xA;&lt;p&gt;This guide covers advanced concurrency patterns for distributed systems:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Managing Multiple Environments with Terraform Workspaces</title>
      <link>https://andrewodendaal.com/managing-multiple-environments-terraform-workspaces/</link>
      <pubDate>Sat, 02 Sep 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/managing-multiple-environments-terraform-workspaces/</guid>
      <description>&lt;p&gt;Managing infrastructure across multiple environments such as development, staging, and production can be a daunting task. Terraform, a popular Infrastructure as Code (IaC) tool, offers a powerful feature known as workspaces that can help you efficiently manage and maintain separate environments within a single configuration. In this technical blog post, we&amp;rsquo;ll explore Terraform workspaces, how they work, and best practices for utilizing them effectively.&lt;/p&gt;&#xA;&lt;h2 id=&#34;understanding-terraform-workspaces&#34;&gt;Understanding Terraform Workspaces&lt;/h2&gt;&#xA;&lt;p&gt;Terraform workspaces provide a way to manage distinct instances of the same infrastructure configuration. Each workspace maintains its state files and variables, allowing you to create isolated environments for different purposes. This isolation prevents potential conflicts and allows you to make changes to one environment without affecting others.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Controlling and Understanding Parallelism Impact on the DAG</title>
      <link>https://andrewodendaal.com/controlling-understanding-terraform-parallelism-impact-dag/</link>
      <pubDate>Fri, 01 Sep 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/controlling-understanding-terraform-parallelism-impact-dag/</guid>
      <description>&lt;p&gt;When working with large-scale infrastructure deployments, managing the provisioning and orchestration of resources efficiently becomes crucial. Terraform, a widely-used Infrastructure as Code (IaC) tool, offers a feature known as parallelism to accelerate the deployment process. In this blog post, we&amp;rsquo;ll delve into parallelism in Terraform, how it affects the Directed Acyclic Graph (DAG), and how you can control and optimize its usage.&lt;/p&gt;&#xA;&lt;h2 id=&#34;understanding-parallelism-and-the-dag&#34;&gt;Understanding Parallelism and the DAG&lt;/h2&gt;&#xA;&lt;p&gt;Parallelism refers to the ability to execute multiple tasks simultaneously. In the context of Terraform, parallelism enables the provisioning of resources in parallel, speeding up the infrastructure deployment process. However, parallelism introduces complexities due to resource dependencies and potential conflicts.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to add Payment Subscriptions with Stripe in Django</title>
      <link>https://andrewodendaal.com/add-payment-subscriptions-stripe-django/</link>
      <pubDate>Thu, 31 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/add-payment-subscriptions-stripe-django/</guid>
      <description>&lt;p&gt;Integrating Stripe subscriptions into your Django site involves several steps. Here&amp;rsquo;s a high-level overview of the process. Please note that the exact implementation can vary based on your specific requirements.&lt;/p&gt;&#xA;&lt;h2 id=&#34;steps-involved&#34;&gt;Steps involved&lt;/h2&gt;&#xA;&lt;h3 id=&#34;sign-up-and-set-up-stripe-account&#34;&gt;Sign Up and Set Up Stripe Account&lt;/h3&gt;&#xA;&lt;p&gt;If you haven&amp;rsquo;t already, sign up for a Stripe account at &lt;a href=&#34;https://stripe.co&#34;&gt;https://stripe.com&lt;/a&gt;. Once you&amp;rsquo;ve signed up, you&amp;rsquo;ll need your API keys: a &lt;code&gt;Publishable Key&lt;/code&gt; (for the client-side) and a &lt;code&gt;Secret Key&lt;/code&gt; (for server-side interactions).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Private Application Load Balancer for EKS in Terraform</title>
      <link>https://andrewodendaal.com/private-application-load-balancer-eks-terraform/</link>
      <pubDate>Wed, 30 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/private-application-load-balancer-eks-terraform/</guid>
      <description>&lt;p&gt;Amazon Web Services (AWS) provides a powerful combination of services for building, deploying, and managing applications. Amazon Elastic Kubernetes Service (EKS) is a managed Kubernetes service that simplifies the process of deploying, managing, and scaling containerized applications using Kubernetes. In certain scenarios, you might want to deploy a private Application Load Balancer (ALB) in front of your private EKS cluster to handle incoming traffic efficiently. In this guide, we&amp;rsquo;ll walk through the process of setting up a private ALB for your private EKS cluster using Terraform, along with best practices and intricate details.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes vs Docker Swarm for Container Orchestration</title>
      <link>https://andrewodendaal.com/kubernetes-docker-swarm-container-orchestration/</link>
      <pubDate>Tue, 29 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/kubernetes-docker-swarm-container-orchestration/</guid>
      <description>&lt;p&gt;Container orchestration has become a cornerstone of modern application deployment and management. Two prominent contenders in the realm of container orchestration are Kubernetes and Docker Swarm. Both offer powerful solutions for automating the deployment, scaling, and management of containerized applications. In this in-depth comparison, we&amp;rsquo;ll delve into the strengths, features, and nuances of Kubernetes and Docker Swarm to help you make an informed choice for your container orchestration needs.&lt;/p&gt;&#xA;&lt;h2 id=&#34;understanding-kubernetes&#34;&gt;Understanding Kubernetes&lt;/h2&gt;&#xA;&lt;p&gt;Kubernetes, often referred to as K8s, has emerged as a de facto standard for container orchestration. It provides an extensive set of features for managing containerized applications, ensuring high availability, scalability, and seamless deployments. Kubernetes excels in orchestrating complex microservices architectures and applications with intricate scaling requirements.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Setting Comprehensive CI/CD Pipeline with Jenkins and Docker</title>
      <link>https://andrewodendaal.com/setting-comprehensive-ci-cd-pipeline-jenkins-docker/</link>
      <pubDate>Mon, 28 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/setting-comprehensive-ci-cd-pipeline-jenkins-docker/</guid>
      <description>&lt;p&gt;In today&amp;rsquo;s dynamic software landscape, the fusion of Continuous Integration and Continuous Deployment (CI/CD) pipelines with robust tools like Jenkins and Docker has emerged as a cornerstone of efficient and reliable application delivery. This detailed tutorial will provide you with an in-depth walkthrough, guiding you step by step through the intricate process of configuring a comprehensive CI/CD pipeline using Jenkins and Docker. By the end of this tutorial, you&amp;rsquo;ll be equipped to seamlessly incorporate DevOps practices, elevating your software delivery process to new heights.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Navigating Microsoft Azure for Seasoned AWS Experts</title>
      <link>https://andrewodendaal.com/navigating-microsoft-azure-seasoned-aws-experts/</link>
      <pubDate>Sun, 27 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/navigating-microsoft-azure-seasoned-aws-experts/</guid>
      <description>&lt;p&gt;In the ever-evolving landscape of cloud computing, two mammoth players, Amazon Web Services (AWS) and Microsoft Azure, have emerged as titans, offering an extensive array of services that cater to a diverse spectrum of business needs. If you&amp;rsquo;ve already amassed a wealth of knowledge and experience in AWS and are now yearning to broaden your cloud horizons, this comprehensive guide is designed to be your compass. Together, we&amp;rsquo;ll embark on a journey to seamlessly transition your AWS proficiency into the realm of Microsoft Azure, unraveling parallels between their services and enriching your cloud expertise.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Advanced Go Memory Management</title>
      <link>https://andrewodendaal.com/articles/go-memory-management/</link>
      <pubDate>Sun, 27 Aug 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-memory-management/</guid>
      <description>&lt;p&gt;Master Go&amp;rsquo;s memory model.&lt;/p&gt;&#xA;&lt;h4 id=&#34;understanding-gos-memory-model&#34;&gt;Understanding Go&amp;rsquo;s Memory Model&lt;/h4&gt;&#xA;&lt;p&gt;Before diving into optimization techniques, it&amp;rsquo;s essential to understand how Go manages memory at a fundamental level. Go&amp;rsquo;s memory model defines not just how memory is allocated and freed, but also the guarantees around memory access in concurrent programs.&lt;/p&gt;&#xA;&lt;h4 id=&#34;stack-vs-heap-allocation&#34;&gt;Stack vs. Heap Allocation&lt;/h4&gt;&#xA;&lt;p&gt;Go uses a hybrid approach to memory allocation, utilizing both stack and heap:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;package&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;main&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;fmt&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;runtime&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;func&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;main&lt;/span&gt;() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#75715e&#34;&gt;// Stack allocation - x doesn&amp;#39;t escape to the heap&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;x&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;42&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#75715e&#34;&gt;// Heap allocation - y escapes to the heap&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;y&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:=&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;x&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#75715e&#34;&gt;// Force GC to demonstrate the concept&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;runtime&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;GC&lt;/span&gt;()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#75715e&#34;&gt;// Print memory statistics&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#66d9ef&#34;&gt;var&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;m&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;runtime&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;MemStats&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;runtime&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;ReadMemStats&lt;/span&gt;(&lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;m&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;fmt&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Printf&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Stack variable: %d\n&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#a6e22e&#34;&gt;x&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;fmt&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Printf&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Heap reference: %d\n&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;y&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;fmt&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Printf&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Heap allocations: %d bytes\n&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#a6e22e&#34;&gt;m&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;HeapAlloc&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The Go compiler uses &lt;strong&gt;escape analysis&lt;/strong&gt; to determine whether a variable should be allocated on the stack or heap. Variables allocated on the stack are automatically freed when the function returns, while heap allocations are managed by the garbage collector.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Navigating Google Cloud Platform (GCP) for AWS Experts</title>
      <link>https://andrewodendaal.com/navigating-google-cloud-platform-gcp-aws-experts/</link>
      <pubDate>Sat, 26 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/navigating-google-cloud-platform-gcp-aws-experts/</guid>
      <description>&lt;p&gt;In today&amp;rsquo;s rapidly evolving landscape of cloud computing, Amazon Web Services (AWS) and Google Cloud Platform (GCP) have emerged as prominent contenders, furnishing an extensive array of services tailored to cater to the dynamic requirements of modern businesses. If you&amp;rsquo;re already versed in the intricacies of AWS and are now seeking to broaden your cloud horizons, this comprehensive guide is poised to be your beacon. We&amp;rsquo;ll embark on a journey of bridging the gap between your existing AWS proficiency and your newfound GCP expertise, ensuring your transition is not just smooth, but also illuminating.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Create a slug from a name in MySQL/MariaDB</title>
      <link>https://andrewodendaal.com/create-a-slug-from-a-name-in-mysql-mariadb/</link>
      <pubDate>Fri, 25 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/create-a-slug-from-a-name-in-mysql-mariadb/</guid>
      <description>&lt;p&gt;How to create a &lt;code&gt;slug&lt;/code&gt; from the &lt;code&gt;name&lt;/code&gt; of an item in MySQL/MariaDB.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;UPDATE&lt;/span&gt; my_table&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;SET&lt;/span&gt; slug &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;LOWER&lt;/span&gt;(REGEXP_REPLACE(&lt;span style=&#34;color:#66d9ef&#34;&gt;REPLACE&lt;/span&gt;(&lt;span style=&#34;color:#66d9ef&#34;&gt;REPLACE&lt;/span&gt;(&lt;span style=&#34;color:#66d9ef&#34;&gt;REPLACE&lt;/span&gt;(name, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39; &amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;-&amp;#39;&lt;/span&gt;), &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;and&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;-&amp;#39;&lt;/span&gt;), &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;[^a-zA-Z0-9-]&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&amp;#39;&lt;/span&gt;), &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;-+&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;-&amp;#39;&lt;/span&gt;));&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>Secure Efficient Server Management with AWS Systems Manager</title>
      <link>https://andrewodendaal.com/secure-efficient-server-management-aws-systems-manager/</link>
      <pubDate>Thu, 24 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/secure-efficient-server-management-aws-systems-manager/</guid>
      <description>&lt;p&gt;In the ever-evolving landscape of cloud computing, AWS (Amazon Web Services) continually introduces innovative solutions to enhance operational efficiency, security, and ease of management. One such powerful tool is AWS Systems Manager (SSM), which empowers users to manage their server infrastructure without the need for SSH access and traditional EC2 key pairs. In this comprehensive guide, we&amp;rsquo;ll delve into setting up AWS SSM, exploring its advanced use cases, and demonstrating how it can transform your workflow.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Get a List of Available Regions from AWS CLI</title>
      <link>https://andrewodendaal.com/how-to-get-a-list-of-available-regions-from-aws-cli/</link>
      <pubDate>Wed, 23 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-a-list-of-available-regions-from-aws-cli/</guid>
      <description>&lt;p&gt;AWS (Amazon Web Services) is a prominent cloud service provider that offers a wide range of services to businesses and individuals worldwide. One of the fundamental concepts in AWS is regions, which are distinct geographical locations hosting AWS infrastructure. Understanding regions is crucial for optimizing your cloud infrastructure&amp;rsquo;s performance, data residency, and compliance requirements. In this blog post, we&amp;rsquo;ll dive into the world of AWS regions, learn how to list available regions using the AWS CLI, and explore a handy command to fetch region details in a more reader-friendly format.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] A Number After a Double Reversal in Python</title>
      <link>https://andrewodendaal.com/solved-a-number-after-a-double-reversal-in-python/</link>
      <pubDate>Tue, 22 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/solved-a-number-after-a-double-reversal-in-python/</guid>
      <description>&lt;h2 id=&#34;the-problem&#34;&gt;The problem&lt;/h2&gt;&#xA;&lt;p&gt;Reversing an integer means to reverse all its digits.&lt;/p&gt;&#xA;&lt;p&gt;For example, reversing 2021 gives 1202. Reversing 12300 gives 321 as the leading zeros are not retained.&#xA;Given an integer num, reverse num to get reversed1, then reverse reversed1 to get reversed2. Return true if reversed2 equals num. Otherwise return false.&lt;/p&gt;&#xA;&lt;h3 id=&#34;example-1&#34;&gt;Example 1:&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Input: num = 526&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Output: true&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Explanation: Reverse num to get 625, then reverse 625 to get 526, which equals num.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;example-2&#34;&gt;Example 2:&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Input: num = 1800&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Output: false&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Explanation: Reverse num to get 81, then reverse 81 to get 18, which does not equal num.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;example-3&#34;&gt;Example 3:&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Input: num = 0&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Output: true&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Explanation: Reverse num to get 0, then reverse 0 to get 0, which equals num.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;constraints&#34;&gt;Constraints:&lt;/h3&gt;&#xA;&lt;p&gt;`0 &amp;lt;= num &amp;lt;= 106``&lt;/p&gt;</description>
    </item>
    <item>
      <title>Common Issues and Mastering Effective Debugging Techniques</title>
      <link>https://andrewodendaal.com/common-issues-mastering-effective-debugging-techniques/</link>
      <pubDate>Mon, 21 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/common-issues-mastering-effective-debugging-techniques/</guid>
      <description>&lt;p&gt;While Kubernetes offers a powerful platform for deploying containerized applications, managing complex clusters can sometimes lead to challenges and errors. In this comprehensive blog post, we will delve into common issues that arise in Kubernetes clusters and equip you with effective troubleshooting and debugging methodologies. By the end, you&amp;rsquo;ll be empowered to unravel the mysteries of Kubernetes troubleshooting and confidently resolve issues to ensure the seamless operation of your clusters.&lt;/p&gt;</description>
    </item>
    <item>
      <title>K8s CI/CD: GitOps with Jenkins, GitLab, Argo CD</title>
      <link>https://andrewodendaal.com/k8s-ci-cd-gitops-jenkins-gitlab-argo-cd/</link>
      <pubDate>Sun, 20 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/k8s-ci-cd-gitops-jenkins-gitlab-argo-cd/</guid>
      <description>&lt;p&gt;Continuous Integration and Continuous Deployment (CI/CD) pipelines are fundamental to the success of &lt;a href=&#34;https://andrewodendaal.com/the-ultimate-guide-to-kubernetes-deployment-strategies&#34;&gt;Kubernetes deployments&lt;/a&gt;, enabling fast and reliable application delivery. In this comprehensive blog post, we will explore CI/CD pipelines customized for Kubernetes, including the GitOps approach, and how to leverage popular tools like Jenkins, GitLab, and Argo CD. By the end, you&amp;rsquo;ll be equipped with actionable insights to build efficient CI/CD pipelines that seamlessly integrate with your Kubernetes ecosystem.&lt;/p&gt;</description>
    </item>
    <item>
      <title>K8s Monitoring &amp; Logging: Best Practices &amp; Top Tools</title>
      <link>https://andrewodendaal.com/k8s-monitoring-logging-practices-top-tools/</link>
      <pubDate>Sat, 19 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/k8s-monitoring-logging-practices-top-tools/</guid>
      <description>&lt;p&gt;Monitoring and logging are critical components of a &lt;a href=&#34;https://andrewodendaal.com/teach-me-kubernetes-part6-deployments&#34;&gt;successful Kubernetes deployment&lt;/a&gt;, providing insights into the health, performance, and behavior of your clusters and applications. In this comprehensive blog post, we will cover best practices for monitoring Kubernetes, including node and pod metrics, as well as exploring popular monitoring and logging tools such as Prometheus, Grafana, and Elasticsearch. By the end, you&amp;rsquo;ll be equipped with actionable knowledge to set up robust observability for your Kubernetes ecosystem, enabling you to detect issues proactively and ensure smooth operations.&lt;/p&gt;</description>
    </item>
    <item>
      <title>K8s Upgrades &amp; Rollbacks Guide to Compatibility &amp; Strategies</title>
      <link>https://andrewodendaal.com/k8s-upgrades-rollbacks-guide-compatibility-strategies/</link>
      <pubDate>Fri, 18 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/k8s-upgrades-rollbacks-guide-compatibility-strategies/</guid>
      <description>&lt;p&gt;Keeping your Kubernetes cluster up-to-date is crucial for security, performance, and accessing the latest features. However, orchestrating Kubernetes upgrades and rollbacks can be a challenging endeavor. In this all-encompassing blog post, we will dive into the complexities of Kubernetes upgrades, exploring version compatibility considerations, the power of rolling updates, and the importance of robust rollback strategies. By the end, you&amp;rsquo;ll be equipped with actionable insights to navigate Kubernetes upgrades and rollbacks with confidence, ensuring your cluster remains resilient and always up-to-date.&lt;/p&gt;</description>
    </item>
    <item>
      <title>K8s Pod Scheduling: Node &amp; Pod Affinity Demystified</title>
      <link>https://andrewodendaal.com/k8s-pod-scheduling-node-pod-affinity-demystified/</link>
      <pubDate>Thu, 17 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/k8s-pod-scheduling-node-pod-affinity-demystified/</guid>
      <description>&lt;p&gt;Efficient pod scheduling is essential to achieving high performance and resource utilization in a Kubernetes cluster. Understanding the intricacies of pod scheduling, particularly node affinity, pod affinity, and anti-affinity rules, empowers you to distribute workloads effectively. In this comprehensive blog post, we will explore the art of &lt;a href=&#34;https://andrewodendaal.com/teach-me-kubernetes-part3-pods&#34;&gt;pod scheduling in Kubernetes&lt;/a&gt;, shedding light on the power of node affinity, enhancing resource allocation with pod affinity, and ensuring fault tolerance through anti-affinity. By the end, you&amp;rsquo;ll be equipped to fine-tune pod placement and optimize the distribution of workloads within your Kubernetes ecosystem.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Securing Kubernetes: Guarding Against Container Threats</title>
      <link>https://andrewodendaal.com/securing-kubernetes-guarding-container-threats/</link>
      <pubDate>Wed, 16 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/securing-kubernetes-guarding-container-threats/</guid>
      <description>&lt;p&gt;Kubernetes has become the de facto platform for &lt;a href=&#34;https://andrewodendaal.com/teach-me-kubernetes-part6-deployments&#34;&gt;deploying containerized applications&lt;/a&gt;, revolutionizing software development. However, with great power comes great responsibility, and security is paramount in a Kubernetes environment. In this comprehensive blog post, we will delve into the critical security concerns in Kubernetes, covering the protection of the API server, implementing Role-Based Access Control (RBAC), fortifying with Network Policies, and mitigating container vulnerabilities. By the end, you&amp;rsquo;ll have actionable tips to build a robust Kubernetes fortress, protecting your applications and data from potential security risks.&lt;/p&gt;</description>
    </item>
    <item>
      <title>K8s Cluster Performance: Resource Optimization Guide</title>
      <link>https://andrewodendaal.com/k8s-cluster-performance-resource-optimization-guide/</link>
      <pubDate>Tue, 15 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/k8s-cluster-performance-resource-optimization-guide/</guid>
      <description>&lt;p&gt;Efficiently managing resources in a Kubernetes cluster is crucial to achieving peak performance and cost-effectiveness. Resource allocation, utilization, and handling resource-intensive applications demand careful consideration. In this comprehensive blog post, we will delve into best practices for resource management, exploring resource allocation techniques, monitoring, and optimizing resource-hungry applications. By the end, you&amp;rsquo;ll be armed with the knowledge to optimize your Kubernetes cluster for maximum productivity and resource efficiency.&lt;/p&gt;&#xA;&lt;h2 id=&#34;understanding-resource-management-in-kubernetes&#34;&gt;Understanding Resource Management in Kubernetes&lt;/h2&gt;&#xA;&lt;p&gt;Resource management involves allocating CPU, memory, and other resources to applications running in a Kubernetes cluster. Properly managing these resources ensures that applications receive the necessary compute power while avoiding resource contention that can lead to performance bottlenecks.&lt;/p&gt;</description>
    </item>
    <item>
      <title>K8s Scaling Mastery: Manual, HPA &amp; Metrics APIs</title>
      <link>https://andrewodendaal.com/k8s-scaling-mastery-manual-hpa-metrics-apis/</link>
      <pubDate>Mon, 14 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/k8s-scaling-mastery-manual-hpa-metrics-apis/</guid>
      <description>&lt;p&gt;Kubernetes has revolutionized application deployment by providing a scalable and efficient container orchestration platform. However, as your applications grow, you&amp;rsquo;ll encounter the challenge of efficiently scaling them to meet varying demands. In this in-depth blog post, we will explore the intricacies of &lt;a href=&#34;https://andrewodendaal.com/the-ultimate-guide-to-kubernetes-deployment-strategies&#34;&gt;scaling applications in Kubernetes&lt;/a&gt;, discussing manual scaling, Horizontal Pod Autoscalers (HPA), and harnessing the power of Kubernetes Metrics APIs. By the end, you&amp;rsquo;ll be equipped with the knowledge to elegantly scale your applications, ensuring they thrive under any workload.&lt;/p&gt;</description>
    </item>
    <item>
      <title>K8s Storage Demystified: Persistent Volumes &amp; Classes</title>
      <link>https://andrewodendaal.com/k8s-storage-demystified-persistent-volumes-classes/</link>
      <pubDate>Sun, 13 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/k8s-storage-demystified-persistent-volumes-classes/</guid>
      <description>&lt;p&gt;Kubernetes has become the go-to platform for deploying scalable, containerized applications. However, managing persistent data in a dynamic container environment presents unique challenges. In this comprehensive blog post, we&amp;rsquo;ll delve into the world of Kubernetes persistent storage, exploring the various approaches like Persistent Volumes (PVs) and Storage Classes (SCs). We&amp;rsquo;ll also shed light on common issues such as data loss and performance bottlenecks, equipping you with the knowledge to ensure data integrity and optimal storage performance within your Kubernetes clusters.&lt;/p&gt;</description>
    </item>
    <item>
      <title>K8s Networking: Pod Communication and Ingress Demystified</title>
      <link>https://andrewodendaal.com/k8s-networking-pod-communication-ingress-demystified/</link>
      <pubDate>Sat, 12 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/k8s-networking-pod-communication-ingress-demystified/</guid>
      <description>&lt;p&gt;Kubernetes has revolutionized the way we &lt;a href=&#34;https://andrewodendaal.com/how-to-deploy-a-docker-container-to-kubernetes&#34;&gt;deploy and manage containerized applications&lt;/a&gt;. However, with the increasing complexity of distributed systems, networking and communication between pods within a Kubernetes cluster can become a daunting challenge. In this blog post, we will delve into the common networking issues that arise in Kubernetes and explore effective solutions using Service Discovery and Ingress controllers. By the end, you&amp;rsquo;ll have a clearer understanding of how to ensure seamless communication between your pods, enabling your applications to thrive in the Kubernetes ecosystem.&lt;/p&gt;</description>
    </item>
    <item>
      <title>React State Balancing: A Guide to State Management</title>
      <link>https://andrewodendaal.com/react-state-balancing-guide-state-management/</link>
      <pubDate>Fri, 11 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/react-state-balancing-guide-state-management/</guid>
      <description>&lt;p&gt;As &lt;a href=&#34;https://andrewodendaal.com/tags/react/&#34;&gt;React apps&lt;/a&gt; grow, &lt;a href=&#34;https://andrewodendaal.com/state-management-101-a-beginners-guide-to-react-state&#34;&gt;managing shared and app-wide state&lt;/a&gt; can become challenging. Dedicated state management libraries help tackle these complexities.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s compare popular options:&lt;/p&gt;&#xA;&lt;h2 id=&#34;redux&#34;&gt;Redux&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://redux.js.org/&#34;&gt;Redux&lt;/a&gt; uses a centralized store for state:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Store with root reducer&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;store&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;createStore&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;rootReducer&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Dispatch actions  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;store&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;dispatch&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;addTodo&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;text&lt;/span&gt;));&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Selectors&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;todos&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;useSelector&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;state&lt;/span&gt; =&amp;gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;state&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;todos&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Redux enforces unidirectional data flow inspired by functional programming.&lt;/p&gt;&#xA;&lt;h2 id=&#34;mobx&#34;&gt;MobX&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://mobx.js.org/README.html&#34;&gt;MobX&lt;/a&gt; uses observable variables that update reactively:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Observable store&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;store&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;observable&lt;/span&gt;({&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;todos&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; []&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;});&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Computed values derived from store &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;completedTodos&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;computed&lt;/span&gt;(() =&amp;gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;store&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;todos&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;filter&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;todo&lt;/span&gt; =&amp;gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;todo&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;complete&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;});&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;MobX automatically tracks dependencies and re-renders on changes.&lt;/p&gt;</description>
    </item>
    <item>
      <title>React &#43; Node: Beginner&#39;s Guide to Full Stack Dev</title>
      <link>https://andrewodendaal.com/react-node-beginner-guide-full-stack-dev/</link>
      <pubDate>Thu, 10 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/react-node-beginner-guide-full-stack-dev/</guid>
      <description>&lt;p&gt;React excels at building fast, dynamic frontends. Node.js shines for server-side APIs and microservices. Together, they make a powerful stack for full stack apps.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s walk through integrating React with Node.js:&lt;/p&gt;&#xA;&lt;h2 id=&#34;serving-react-builds&#34;&gt;Serving React Builds&lt;/h2&gt;&#xA;&lt;p&gt;Use Node.js middleware like Express to serve the React app:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// server.js&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;app&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;use&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;express&lt;/span&gt;.&lt;span style=&#34;color:#66d9ef&#34;&gt;static&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;path&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;join&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;__dirname&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;client/build&amp;#39;&lt;/span&gt;)));&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;app&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;get&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;*&amp;#39;&lt;/span&gt;, (&lt;span style=&#34;color:#a6e22e&#34;&gt;req&lt;/span&gt;, &lt;span style=&#34;color:#a6e22e&#34;&gt;res&lt;/span&gt;) =&amp;gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;res&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;sendFile&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;path&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;join&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;__dirname&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;client/build&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;index&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;html&lt;/span&gt;));&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;});&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This serves the React build from the &lt;code&gt;/build&lt;/code&gt; folder.&lt;/p&gt;&#xA;&lt;h2 id=&#34;proxying-api-requests&#34;&gt;Proxying API Requests&lt;/h2&gt;&#xA;&lt;p&gt;Proxy frontend requests to the backend API:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Optimal React Patterns: Beginner&#39;s Guide</title>
      <link>https://andrewodendaal.com/optimal-react-patterns-beginner-guide/</link>
      <pubDate>Wed, 09 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/optimal-react-patterns-beginner-guide/</guid>
      <description>&lt;p&gt;As with any framework, React comes with its own set of best practices and optimal patterns. Let&amp;rsquo;s explore some tips for writing robust React code:&lt;/p&gt;&#xA;&lt;h2 id=&#34;modular-components&#34;&gt;Modular Components&lt;/h2&gt;&#xA;&lt;p&gt;Break components into reusable, composable units:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Bad&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;App&lt;/span&gt;() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;header&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;nav&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;logo&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;links&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/nav&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;h1&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Welcome&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;!&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/h1&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;footer&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;copyright&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/footer&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/header&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  );&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Good&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Nav&lt;/span&gt;() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;nav&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Logo&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Links&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/nav&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ); &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Header&lt;/span&gt;() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;header&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Nav&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;h1&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Welcome&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;!&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/h1&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Footer&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/header&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  );&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This encourages reusability.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Debugging React Apps: Beginner&#39;s Guide</title>
      <link>https://andrewodendaal.com/debugging-react-apps-beginner-guide/</link>
      <pubDate>Tue, 08 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/debugging-react-apps-beginner-guide/</guid>
      <description>&lt;p&gt;Bugs are inevitable in complex React applications. Thankfully, React provides great tools to squash bugs quickly.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s look at some key techniques for debugging React apps:&lt;/p&gt;&#xA;&lt;h2 id=&#34;react-developer-tools&#34;&gt;React Developer Tools&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en&#34;&gt;The React DevTools Chrome&lt;/a&gt; extension lets you inspect React component hierarchies, props, state and more in Chrome:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;DevTools&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;App&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Navbar&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;   &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Profile&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Jane&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;imageUrl&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://...&amp;#34;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/App&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This provides invaluable visibility into React apps.&lt;/p&gt;&#xA;&lt;h2 id=&#34;error-boundaries&#34;&gt;Error Boundaries&lt;/h2&gt;&#xA;&lt;p&gt;Error boundaries catch errors and display fallbacks:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Go WebAssembly: High-Performance Web Applications</title>
      <link>https://andrewodendaal.com/articles/go-webassembly/</link>
      <pubDate>Tue, 08 Aug 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-webassembly/</guid>
      <description>&lt;p&gt;Build high-performance web applications using Go and WebAssembly with advanced optimization techniques and JavaScript interoperability.&lt;/p&gt;&#xA;&lt;h2 id=&#34;understanding-the-foundation&#34;&gt;Understanding the Foundation&lt;/h2&gt;&#xA;&lt;p&gt;WebAssembly represents a fundamental shift in web development capabilities. For years, JavaScript was the only option for client-side computation, which worked fine for most applications but hit performance walls with computationally intensive tasks like data processing, image manipulation, or complex algorithms.&lt;/p&gt;&#xA;&lt;p&gt;WebAssembly changes this by allowing languages like Go, Rust, and C++ to run in the browser at near-native speeds. This opens up possibilities that were previously impossible or impractical in web applications—real-time data processing, complex simulations, and performance-critical applications that would have required desktop software.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Advanced React Patterns: Compound Components &amp; More</title>
      <link>https://andrewodendaal.com/advanced-react-patterns-compound-components/</link>
      <pubDate>Mon, 07 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/advanced-react-patterns-compound-components/</guid>
      <description>&lt;p&gt;As React apps scale, you&amp;rsquo;ll want to structure components for greater reusability and composability. Here are some powerful React patterns:&lt;/p&gt;&#xA;&lt;h2 id=&#34;compound-components&#34;&gt;Compound Components&lt;/h2&gt;&#xA;&lt;p&gt;The compound components pattern creates component APIs with shared context:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Parent exposes context through &amp;#39;Box&amp;#39; component&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Layout&lt;/span&gt;({&lt;span style=&#34;color:#a6e22e&#34;&gt;children&lt;/span&gt;}) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Box&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;{&lt;span style=&#34;color:#a6e22e&#34;&gt;children&lt;/span&gt;}&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/Box&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Children access shared context via Box&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Profile&lt;/span&gt;() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Layout&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Box&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;p&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;{&lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;}&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;h1&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Jane&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Doe&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/h1&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/Box&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/Layout&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  );&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This provides more flexible APIs than just props.&lt;/p&gt;</description>
    </item>
    <item>
      <title>React Animation Guide: Libraries and Techniques</title>
      <link>https://andrewodendaal.com/react-animation-guide-libraries-techniques/</link>
      <pubDate>Sun, 06 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/react-animation-guide-libraries-techniques/</guid>
      <description>&lt;p&gt;Animation brings interfaces to life. Thankfully, React has great open source libraries for animation. Let&amp;rsquo;s compare some popular options:&lt;/p&gt;&#xA;&lt;h2 id=&#34;framer-motion&#34;&gt;Framer Motion&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://www.framer.com/motion/&#34;&gt;Framer Motion&lt;/a&gt; uses declarative props for animation:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;import&lt;/span&gt; { &lt;span style=&#34;color:#a6e22e&#34;&gt;motion&lt;/span&gt; } &lt;span style=&#34;color:#a6e22e&#34;&gt;from&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;framer-motion&amp;#39;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;boxVariants&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;hidden&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; { &lt;span style=&#34;color:#a6e22e&#34;&gt;opacity&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt; },&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;visible&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; { &lt;span style=&#34;color:#a6e22e&#34;&gt;opacity&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; }, &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;MyComponent&lt;/span&gt;() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;motion&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;div&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#a6e22e&#34;&gt;initial&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;hidden&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#a6e22e&#34;&gt;animate&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;visible&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#a6e22e&#34;&gt;variants&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;{&lt;span style=&#34;color:#a6e22e&#34;&gt;boxVariants&lt;/span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  );&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Framer Motion allows CSS, SVG, gesture, and physics animations.&lt;/p&gt;&#xA;&lt;h2 id=&#34;react-transition-group&#34;&gt;React Transition Group&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://reactcommunity.org/react-transition-group/&#34;&gt;React Transition&lt;/a&gt; Group offers class-based transitions:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Testing React Apps: Beginner&#39;s Guide to TDD</title>
      <link>https://andrewodendaal.com/testing-react-apps-beginner-guide-tdd/</link>
      <pubDate>Sat, 05 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/testing-react-apps-beginner-guide-tdd/</guid>
      <description>&lt;p&gt;Testing is crucial for ensuring React apps are stable and bug-free. Popular tools like Jest and React Testing Library make testing React components simple.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s look at how to write great tests for React:&lt;/p&gt;&#xA;&lt;h2 id=&#34;render-component&#34;&gt;render Component&lt;/h2&gt;&#xA;&lt;p&gt;Render the component into a test environment using &lt;code&gt;render&lt;/code&gt; from React Testing Library:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;import&lt;/span&gt; { &lt;span style=&#34;color:#a6e22e&#34;&gt;render&lt;/span&gt; } &lt;span style=&#34;color:#a6e22e&#34;&gt;from&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;@testing-library/react&amp;#39;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;import&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Button&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;from&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;./Button&amp;#39;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;test&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;displays button text&amp;#39;&lt;/span&gt;, () =&amp;gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; { &lt;span style=&#34;color:#a6e22e&#34;&gt;getByText&lt;/span&gt; } &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;render&lt;/span&gt;(&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Button&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Click&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/Button&amp;gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;expect&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;getByText&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Click&amp;#39;&lt;/span&gt;)).&lt;span style=&#34;color:#a6e22e&#34;&gt;toBeInTheDocument&lt;/span&gt;(); &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;});&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This renders the component virtually for testing.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Data Fetched Fast - A Beginner&#39;s Guide to React Query</title>
      <link>https://andrewodendaal.com/data-fetched-fast-a-beginners-guide-to-react-query/</link>
      <pubDate>Fri, 04 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/data-fetched-fast-a-beginners-guide-to-react-query/</guid>
      <description>&lt;p&gt;Fetching data in React often means using stale state and complex caching logic.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://react-query.tanstack.com/&#34;&gt;React Query&lt;/a&gt; simplifies data fetching with powerful features like automatic caching, deduplication, and background updates.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s explore some key features of React Query:&lt;/p&gt;&#xA;&lt;h2 id=&#34;declarative-data-fetching&#34;&gt;Declarative Data Fetching&lt;/h2&gt;&#xA;&lt;p&gt;Fetch data with the &lt;code&gt;useQuery&lt;/code&gt; hook:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;import&lt;/span&gt; { &lt;span style=&#34;color:#a6e22e&#34;&gt;useQuery&lt;/span&gt; } &lt;span style=&#34;color:#a6e22e&#34;&gt;from&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;react-query&amp;#39;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;MyComponent&lt;/span&gt;() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; { &lt;span style=&#34;color:#a6e22e&#34;&gt;data&lt;/span&gt;, &lt;span style=&#34;color:#a6e22e&#34;&gt;error&lt;/span&gt;, &lt;span style=&#34;color:#a6e22e&#34;&gt;isLoading&lt;/span&gt; } &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;useQuery&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;posts&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#a6e22e&#34;&gt;fetchPosts&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#75715e&#34;&gt;// use data  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;useQuery&lt;/code&gt; handles declaring cache keys, performing fetches, and more.&lt;/p&gt;&#xA;&lt;h2 id=&#34;background-refetching&#34;&gt;background Refetching&lt;/h2&gt;&#xA;&lt;p&gt;React Query automatically refetches &amp;ldquo;inactive&amp;rdquo; queries in the background:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Forms Simplified, A Beginner&#39;s Guide to Managing React Forms</title>
      <link>https://andrewodendaal.com/forms-simplified-a-beginners-guide-to-managing-react-forms/</link>
      <pubDate>Thu, 03 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/forms-simplified-a-beginners-guide-to-managing-react-forms/</guid>
      <description>&lt;p&gt;Forms are a common need for many React apps. However, managing form state and validation can be tricky.&lt;/p&gt;&#xA;&lt;p&gt;Thankfully, React provides great libraries to simplify complex forms. Let&amp;rsquo;s explore some helpful tools:&lt;/p&gt;&#xA;&lt;h2 id=&#34;formik-for-form-state&#34;&gt;Formik for Form State&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://formik.org/&#34;&gt;Formik&lt;/a&gt; handles common form tasks:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;import&lt;/span&gt; { &lt;span style=&#34;color:#a6e22e&#34;&gt;Formik&lt;/span&gt; } &lt;span style=&#34;color:#a6e22e&#34;&gt;from&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;formik&amp;#39;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;MyForm&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; () =&amp;gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Formik&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;initialValues&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;{{ &lt;span style=&#34;color:#a6e22e&#34;&gt;email&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&amp;#39;&lt;/span&gt; }}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;onSubmit&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;{&lt;span style=&#34;color:#a6e22e&#34;&gt;values&lt;/span&gt; =&amp;gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;console&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;log&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;values&lt;/span&gt;)}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    {&lt;span style=&#34;color:#a6e22e&#34;&gt;formik&lt;/span&gt; =&amp;gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;form&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;onSubmit&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;{&lt;span style=&#34;color:#a6e22e&#34;&gt;formik&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;handleSubmit&lt;/span&gt;}&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;input&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;email&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#a6e22e&#34;&gt;onChange&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;{&lt;span style=&#34;color:#a6e22e&#34;&gt;formik&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;handleChange&lt;/span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#a6e22e&#34;&gt;value&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;{&lt;span style=&#34;color:#a6e22e&#34;&gt;formik&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;values&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;email&lt;/span&gt;} &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;button&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;type&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;submit&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Submit&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/button&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/form&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    )}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/Formik&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Formik reduces boilerplate for:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Go Performance Profiling and Optimization</title>
      <link>https://andrewodendaal.com/articles/go-performance-profiling/</link>
      <pubDate>Thu, 03 Aug 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-performance-profiling/</guid>
      <description>&lt;p&gt;Master Go&amp;rsquo;s profiling tools.&lt;/p&gt;&#xA;&lt;h4 id=&#34;understanding-go-performance-fundamentals&#34;&gt;Understanding Go Performance Fundamentals&lt;/h4&gt;&#xA;&lt;p&gt;Before diving into specific profiling tools, it&amp;rsquo;s essential to understand the key factors that influence Go application performance and the metrics that matter most when optimizing.&lt;/p&gt;&#xA;&lt;h4 id=&#34;performance-metrics-and-objectives&#34;&gt;Performance Metrics and Objectives&lt;/h4&gt;&#xA;&lt;p&gt;Performance optimization should always begin with clear objectives and metrics:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;package&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;main&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;fmt&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;time&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// PerformanceMetrics tracks key performance indicators&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;type&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;PerformanceMetrics&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;struct&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;Latency&lt;/span&gt;       &lt;span style=&#34;color:#a6e22e&#34;&gt;time&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Duration&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;// Time to complete a single operation&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;Throughput&lt;/span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt;           &lt;span style=&#34;color:#75715e&#34;&gt;// Operations per second&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;MemoryUsage&lt;/span&gt;   &lt;span style=&#34;color:#66d9ef&#34;&gt;uint64&lt;/span&gt;        &lt;span style=&#34;color:#75715e&#34;&gt;// Bytes allocated&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;CPUUsage&lt;/span&gt;      &lt;span style=&#34;color:#66d9ef&#34;&gt;float64&lt;/span&gt;       &lt;span style=&#34;color:#75715e&#34;&gt;// CPU utilization percentage&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;GCPause&lt;/span&gt;       &lt;span style=&#34;color:#a6e22e&#34;&gt;time&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Duration&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;// Garbage collection pause time&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;ResponseTime&lt;/span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;time&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Duration&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;// Time to first byte (for servers)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;ErrorRate&lt;/span&gt;     &lt;span style=&#34;color:#66d9ef&#34;&gt;float64&lt;/span&gt;       &lt;span style=&#34;color:#75715e&#34;&gt;// Percentage of operations that fail&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;SaturationPoint&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt;         &lt;span style=&#34;color:#75715e&#34;&gt;// Load at which performance degrades&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Example performance objectives for different application types&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;func&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;definePerformanceObjectives&lt;/span&gt;() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#75715e&#34;&gt;// Low-latency trading system&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;tradingSystemObjectives&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;PerformanceMetrics&lt;/span&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;Latency&lt;/span&gt;:       &lt;span style=&#34;color:#ae81ff&#34;&gt;100&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;time&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Microsecond&lt;/span&gt;, &lt;span style=&#34;color:#75715e&#34;&gt;// 99th percentile&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;Throughput&lt;/span&gt;:    &lt;span style=&#34;color:#ae81ff&#34;&gt;100000&lt;/span&gt;,                 &lt;span style=&#34;color:#75715e&#34;&gt;// 100K trades per second&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;MemoryUsage&lt;/span&gt;:   &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1024&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1024&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1024&lt;/span&gt;, &lt;span style=&#34;color:#75715e&#34;&gt;// 1GB max heap&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;CPUUsage&lt;/span&gt;:      &lt;span style=&#34;color:#ae81ff&#34;&gt;80.0&lt;/span&gt;,                   &lt;span style=&#34;color:#75715e&#34;&gt;// 80% max CPU utilization&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;GCPause&lt;/span&gt;:       &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;time&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Millisecond&lt;/span&gt;,   &lt;span style=&#34;color:#75715e&#34;&gt;// 1ms max GC pause&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;ErrorRate&lt;/span&gt;:     &lt;span style=&#34;color:#ae81ff&#34;&gt;0.0001&lt;/span&gt;,                 &lt;span style=&#34;color:#75715e&#34;&gt;// 0.01% max error rate&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;SaturationPoint&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;120000&lt;/span&gt;,               &lt;span style=&#34;color:#75715e&#34;&gt;// Handles 20% over target load&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#75715e&#34;&gt;// Web API service&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;webAPIObjectives&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;PerformanceMetrics&lt;/span&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;Latency&lt;/span&gt;:       &lt;span style=&#34;color:#ae81ff&#34;&gt;50&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;time&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Millisecond&lt;/span&gt;,  &lt;span style=&#34;color:#75715e&#34;&gt;// 99th percentile&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;Throughput&lt;/span&gt;:    &lt;span style=&#34;color:#ae81ff&#34;&gt;5000&lt;/span&gt;,                   &lt;span style=&#34;color:#75715e&#34;&gt;// 5K requests per second&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;MemoryUsage&lt;/span&gt;:   &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1024&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1024&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1024&lt;/span&gt;, &lt;span style=&#34;color:#75715e&#34;&gt;// 2GB max heap&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;ResponseTime&lt;/span&gt;:  &lt;span style=&#34;color:#ae81ff&#34;&gt;20&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;time&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Millisecond&lt;/span&gt;,  &lt;span style=&#34;color:#75715e&#34;&gt;// 20ms time to first byte&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;ErrorRate&lt;/span&gt;:     &lt;span style=&#34;color:#ae81ff&#34;&gt;0.001&lt;/span&gt;,                  &lt;span style=&#34;color:#75715e&#34;&gt;// 0.1% max error rate&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;SaturationPoint&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;7500&lt;/span&gt;,                 &lt;span style=&#34;color:#75715e&#34;&gt;// Handles 50% over target load&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#75715e&#34;&gt;// Batch processing system&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;batchProcessingObjectives&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;PerformanceMetrics&lt;/span&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;Throughput&lt;/span&gt;:    &lt;span style=&#34;color:#ae81ff&#34;&gt;10000&lt;/span&gt;,                  &lt;span style=&#34;color:#75715e&#34;&gt;// 10K records per second&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;MemoryUsage&lt;/span&gt;:   &lt;span style=&#34;color:#ae81ff&#34;&gt;8&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1024&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1024&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1024&lt;/span&gt;, &lt;span style=&#34;color:#75715e&#34;&gt;// 8GB max heap&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;CPUUsage&lt;/span&gt;:      &lt;span style=&#34;color:#ae81ff&#34;&gt;95.0&lt;/span&gt;,                   &lt;span style=&#34;color:#75715e&#34;&gt;// 95% max CPU utilization&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;ErrorRate&lt;/span&gt;:     &lt;span style=&#34;color:#ae81ff&#34;&gt;0.0005&lt;/span&gt;,                 &lt;span style=&#34;color:#75715e&#34;&gt;// 0.05% max error rate&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;fmt&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Printf&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Trading system 99th percentile latency target: %v\n&amp;#34;&lt;/span&gt;, &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;tradingSystemObjectives&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Latency&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;fmt&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Printf&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Web API throughput target: %v requests/second\n&amp;#34;&lt;/span&gt;, &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;webAPIObjectives&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Throughput&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;fmt&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Printf&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Batch processing memory usage target: %v bytes\n&amp;#34;&lt;/span&gt;, &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#x9;&#x9;&lt;span style=&#34;color:#a6e22e&#34;&gt;batchProcessingObjectives&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;MemoryUsage&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;performance-bottleneck-categories&#34;&gt;Performance Bottleneck Categories&lt;/h4&gt;&#xA;&lt;p&gt;Understanding the different types of bottlenecks helps guide your profiling approach:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Optimizing React Performance: Beginner&#39;s Guide</title>
      <link>https://andrewodendaal.com/optimizing-react-performance-beginner-guide/</link>
      <pubDate>Wed, 02 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/optimizing-react-performance-beginner-guide/</guid>
      <description>&lt;p&gt;As React apps grow, you may notice performance starting to lag - sluggish interactions, choppy animations, janky scrolling.&lt;/p&gt;&#xA;&lt;p&gt;Luckily, there are many great techniques to optimize React app performance. Let&amp;rsquo;s look at some top tips:&lt;/p&gt;&#xA;&lt;h2 id=&#34;use-reactmemo-for-component-memoization&#34;&gt;Use React.memo for Component Memoization&lt;/h2&gt;&#xA;&lt;p&gt;The &lt;code&gt;React.memo&lt;/code&gt; API can memoize component outputs:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;MyComponent&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;React&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;memo&lt;/span&gt;(&lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;MyComponent&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;props&lt;/span&gt;) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#75715e&#34;&gt;/* only rerenders if props change */&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;});&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This prevents unnecessary re-renders if props stay the same.&lt;/p&gt;&#xA;&lt;h2 id=&#34;virtualize-long-lists&#34;&gt;Virtualize Long Lists&lt;/h2&gt;&#xA;&lt;p&gt;Rendering thousands of rows kills performance. Virtualize rendering instead:&lt;/p&gt;</description>
    </item>
    <item>
      <title>State Management 101 - A Beginner&#39;s Guide to React State</title>
      <link>https://andrewodendaal.com/state-management-101-a-beginners-guide-to-react-state/</link>
      <pubDate>Tue, 01 Aug 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/state-management-101-a-beginners-guide-to-react-state/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://andrewodendaal.com/lifting-state-react-beginner-guide&#34;&gt;State management&lt;/a&gt; is a crucial concept in React. State allows components to dynamically update UI based on data changes.&lt;/p&gt;&#xA;&lt;p&gt;However, &lt;a href=&#34;https://andrewodendaal.com/lifting-state-react-beginner-guide&#34;&gt;managing state properly&lt;/a&gt; takes some practice. Let&amp;rsquo;s walk through the basics of handling state in React:&lt;/p&gt;&#xA;&lt;h2 id=&#34;creating-state&#34;&gt;Creating State&lt;/h2&gt;&#xA;&lt;p&gt;The &lt;code&gt;useState&lt;/code&gt; hook defines state variables:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;import&lt;/span&gt; { &lt;span style=&#34;color:#a6e22e&#34;&gt;useState&lt;/span&gt; } &lt;span style=&#34;color:#a6e22e&#34;&gt;from&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;react&amp;#39;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Example&lt;/span&gt;() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; [&lt;span style=&#34;color:#a6e22e&#34;&gt;count&lt;/span&gt;, &lt;span style=&#34;color:#a6e22e&#34;&gt;setCount&lt;/span&gt;] &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;useState&lt;/span&gt;(&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;useState&lt;/code&gt; accepts the initial state value and returns:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The current state&lt;/li&gt;&#xA;&lt;li&gt;A function to update it&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;reading-state&#34;&gt;Reading State&lt;/h2&gt;&#xA;&lt;p&gt;To display state in UI, simply reference the variable:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Accessible React Apps: Beginner&#39;s Guide to Accessibility</title>
      <link>https://andrewodendaal.com/accessible-react-apps-beginner-guide-accessibility/</link>
      <pubDate>Mon, 31 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/accessible-react-apps-beginner-guide-accessibility/</guid>
      <description>&lt;p&gt;Accessibility is an important consideration when building modern web apps. React provides useful tools to make accessible, inclusive products.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s look at some best practices for web accessibility with React:&lt;/p&gt;&#xA;&lt;h2 id=&#34;semantic-html&#34;&gt;Semantic HTML&lt;/h2&gt;&#xA;&lt;p&gt;Use proper HTML semantics. For example:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Good&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;button&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Save&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/button&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Avoid &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;div&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;onclick&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;save&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Save&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/div&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Semantic HTML is parsed correctly by screen readers.&lt;/p&gt;&#xA;&lt;h2 id=&#34;alt-text&#34;&gt;alt Text&lt;/h2&gt;&#xA;&lt;p&gt;Images should have &lt;code&gt;alt&lt;/code&gt; text describing content/purpose:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;img&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;src&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;logo.png&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;alt&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Company logo&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Screen readers can&amp;rsquo;t interpret images. &lt;code&gt;alt&lt;/code&gt; text substitutes meaning.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Mystery Boxes - A Beginner&#39;s Guide to React Fragments</title>
      <link>https://andrewodendaal.com/mystery-boxes-a-beginners-guide-to-react-fragments/</link>
      <pubDate>Sun, 30 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/mystery-boxes-a-beginners-guide-to-react-fragments/</guid>
      <description>&lt;p&gt;When returning multiple elements from a component&amp;rsquo;s render method, they must be wrapped in a single parent DOM node:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Needs a &amp;lt;div&amp;gt; wrapper&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;div&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;ChildA&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;ChildB&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/div&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This extra wrapper &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; in the DOM is often unwanted. Enter &lt;strong&gt;React fragments&lt;/strong&gt; - a way to group elements without adding extra nodes.&lt;/p&gt;&#xA;&lt;h2 id=&#34;short-syntax&#34;&gt;Short Syntax&lt;/h2&gt;&#xA;&lt;p&gt;The simplest fragment syntax is:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;ChildA&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;ChildB&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;&amp;lt;&amp;gt;&amp;lt;/&amp;gt;&lt;/code&gt; syntax declares a React fragment. Fragments let you skip the wrapper &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Unidirectional Data Flow in React: Beginner&#39;s Guide</title>
      <link>https://andrewodendaal.com/unidirectional-data-flow-react-beginner-guide/</link>
      <pubDate>Sat, 29 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/unidirectional-data-flow-react-beginner-guide/</guid>
      <description>&lt;p&gt;A key advantage of React is its unidirectional data flow. This makes the flow of data predictable, and helps avoid unexpected side effects from data changing unexpectedly.&lt;/p&gt;&#xA;&lt;p&gt;But what exactly does &amp;ldquo;unidirectional data flow&amp;rdquo; mean in React? Let&amp;rsquo;s break it down:&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-data-flows-down&#34;&gt;The Data Flows Down&lt;/h2&gt;&#xA;&lt;p&gt;In React, parent components pass data to children via props:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Parent&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Parent&lt;/span&gt;() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; [&lt;span style=&#34;color:#a6e22e&#34;&gt;value&lt;/span&gt;, &lt;span style=&#34;color:#a6e22e&#34;&gt;setValue&lt;/span&gt;] &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;useState&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Hello&amp;#39;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Child&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;value&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;{&lt;span style=&#34;color:#a6e22e&#34;&gt;value&lt;/span&gt;} &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Child&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Child&lt;/span&gt;({&lt;span style=&#34;color:#a6e22e&#34;&gt;value&lt;/span&gt;}) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;h1&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;{&lt;span style=&#34;color:#a6e22e&#34;&gt;value&lt;/span&gt;}&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/h1&amp;gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The parent&amp;rsquo;s &lt;code&gt;value&lt;/code&gt; state is passed down into the &lt;code&gt;Child&lt;/code&gt; via a prop. This is the &lt;strong&gt;&amp;ldquo;data down&amp;rdquo;&lt;/strong&gt; part.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Advanced Go Channel Patterns: Mastering Communication in Concurrent Systems</title>
      <link>https://andrewodendaal.com/articles/go-channel-patterns/</link>
      <pubDate>Sat, 29 Jul 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-channel-patterns/</guid>
      <description>&lt;p&gt;Explore sophisticated channel patterns that enable elegant, efficient communication between goroutines in complex concurrent applications.&lt;/p&gt;&#xA;&lt;p&gt;#Channels are Go&amp;rsquo;s primary tool for goroutine communication. Most developers know the basics - sending and receiving values - but advanced patterns unlock much more powerful concurrent designs.&lt;/p&gt;&#xA;&lt;h2 id=&#34;beyond-basic-channels&#34;&gt;Beyond Basic Channels&lt;/h2&gt;&#xA;&lt;p&gt;Basic channel operations are straightforward:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;ch&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:=&lt;/span&gt; make(&lt;span style=&#34;color:#66d9ef&#34;&gt;chan&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;go&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;func&lt;/span&gt;() { &lt;span style=&#34;color:#a6e22e&#34;&gt;ch&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;42&lt;/span&gt; }()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;value&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:=&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;-&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;ch&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But real systems need more sophisticated coordination:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Pipeline Processing&lt;/strong&gt;: Chain operations together&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Fan-Out/Fan-In&lt;/strong&gt;: Distribute work and collect results&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Rate Limiting&lt;/strong&gt;: Control operation flow&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Timeouts&lt;/strong&gt;: Handle operations that take too long&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Cancellation&lt;/strong&gt;: Stop work when it&amp;rsquo;s no longer needed&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;common-channel-pitfalls&#34;&gt;Common Channel Pitfalls&lt;/h2&gt;&#xA;&lt;p&gt;Before diving into patterns, understand the traps:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Event Handling in React: Beginner&#39;s Guide</title>
      <link>https://andrewodendaal.com/event-handling-react-beginner-guide/</link>
      <pubDate>Fri, 28 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/event-handling-react-beginner-guide/</guid>
      <description>&lt;p&gt;Responding to user events is a crucial part of building interactive UIs. In React, you can pass event handlers as props to components to run code when events occur.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s look at how to listen and react to common events in React:&lt;/p&gt;&#xA;&lt;h2 id=&#34;binding-to-events&#34;&gt;Binding to Events&lt;/h2&gt;&#xA;&lt;p&gt;Pass an event handler function to a component to subscribe to events:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Button&lt;/span&gt;({ &lt;span style=&#34;color:#a6e22e&#34;&gt;onClick&lt;/span&gt; }) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;button&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;onClick&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;{&lt;span style=&#34;color:#a6e22e&#34;&gt;onClick&lt;/span&gt;}&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#a6e22e&#34;&gt;Click&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Me&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/button&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  );&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;App&lt;/span&gt;() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;handleClick&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; () =&amp;gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;console&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;log&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Clicked!&amp;#39;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  };&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Button&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;onClick&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;{&lt;span style=&#34;color:#a6e22e&#34;&gt;handleClick&lt;/span&gt;} &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  );&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When the button is clicked, &lt;code&gt;handleClick&lt;/code&gt; will be called.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Circuit Breaker Patterns in Go</title>
      <link>https://andrewodendaal.com/articles/go-circuit-breakers/</link>
      <pubDate>Fri, 28 Jul 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-circuit-breakers/</guid>
      <description>&lt;p&gt;Implement robust circuit breaker patterns in Go for building resilient microservices that handle failures gracefully and prevent cascade failures.&lt;/p&gt;&#xA;&lt;h4 id=&#34;understanding-circuit-breaker-patterns&#34;&gt;Understanding Circuit Breaker Patterns&lt;/h4&gt;&#xA;&lt;p&gt;Before diving into implementation details, it&amp;rsquo;s crucial to understand the core concepts behind circuit breakers and how they fit into a broader resilience strategy.&lt;/p&gt;&#xA;&lt;h4 id=&#34;the-circuit-breaker-state-machine&#34;&gt;The Circuit Breaker State Machine&lt;/h4&gt;&#xA;&lt;p&gt;At its core, a circuit breaker is a state machine with three distinct states:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;package&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;circuitbreaker&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// State represents the current state of the circuit breaker&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;type&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;State&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;// Closed means the circuit breaker is allowing requests through&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Closed&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;State&lt;/span&gt; = &lt;span style=&#34;color:#66d9ef&#34;&gt;iota&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;// Open means the circuit breaker is preventing requests from going through&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Open&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;// HalfOpen means the circuit breaker is allowing a limited number of test requests&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;HalfOpen&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// CircuitBreaker represents a basic circuit breaker&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;type&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;CircuitBreaker&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;struct&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;state&lt;/span&gt;           &lt;span style=&#34;color:#a6e22e&#34;&gt;State&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;failureCount&lt;/span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;failureThreshold&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;resetTimeout&lt;/span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;time&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Duration&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;lastFailureTime&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;time&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Time&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;mutex&lt;/span&gt;           &lt;span style=&#34;color:#a6e22e&#34;&gt;sync&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;RWMutex&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The circuit breaker operates as follows:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Hooked on React - A Beginner&#39;s Guide to React Hooks</title>
      <link>https://andrewodendaal.com/hooked-on-react-a-beginners-guide-to-react-hooks/</link>
      <pubDate>Thu, 27 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/hooked-on-react-a-beginners-guide-to-react-hooks/</guid>
      <description>&lt;p&gt;When React was first released, class components were the standard way to build complex UIs. However, classes can be cumbersome for some use cases.&lt;/p&gt;&#xA;&lt;p&gt;Enter &lt;strong&gt;React hooks&lt;/strong&gt; - a way to use React features like state and lifecycle methods without classes.&lt;/p&gt;&#xA;&lt;p&gt;Hooks provide a more direct API for React concepts you already know. Let&amp;rsquo;s dive into some commonly used hooks:&lt;/p&gt;&#xA;&lt;h2 id=&#34;managing-state-with-usestate&#34;&gt;Managing State with useState&lt;/h2&gt;&#xA;&lt;p&gt;The &lt;code&gt;useState&lt;/code&gt; hook lets components use state without a class:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Lifting State in React: Beginner&#39;s Guide</title>
      <link>https://andrewodendaal.com/lifting-state-react-beginner-guide/</link>
      <pubDate>Wed, 26 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/lifting-state-react-beginner-guide/</guid>
      <description>&lt;p&gt;As React apps grow in complexity, managing shared state between components can become tricky. Oftentimes, several child components may need to reflect the same data in the UI.&lt;/p&gt;&#xA;&lt;p&gt;The React solution is to &lt;strong&gt;lift the state&lt;/strong&gt; up to a common ancestor component. The parent component can manage the state, and pass it down to the children via props.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s look at how to lift state for easier data sharing:&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-problem-with-local-state&#34;&gt;The Problem with Local State&lt;/h2&gt;&#xA;&lt;p&gt;Imagine we have a &lt;code&gt;&amp;lt;Toolbox&amp;gt;&lt;/code&gt; component that contains some &lt;code&gt;&amp;lt;Tool&amp;gt;&lt;/code&gt; components:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Looping in JSX with React Keys: Beginner&#39;s Guide</title>
      <link>https://andrewodendaal.com/looping-jsx-react-keys-beginner-guide/</link>
      <pubDate>Tue, 25 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/looping-jsx-react-keys-beginner-guide/</guid>
      <description>&lt;p&gt;Looping over arrays to render lists of elements is a common need in React apps. However, there are some special considerations when rendering lists in JSX.&lt;/p&gt;&#xA;&lt;p&gt;One important aspect is the &lt;code&gt;key&lt;/code&gt; prop. React uses keys to uniquely identify list elements and optimize performance.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s look at how to loop through arrays in JSX, and why keys are important:&lt;/p&gt;&#xA;&lt;h2 id=&#34;rendering-arrays-in-jsx&#34;&gt;Rendering Arrays in JSX&lt;/h2&gt;&#xA;&lt;p&gt;JSX makes looping straightforward - you can use JavaScript&amp;rsquo;s &lt;code&gt;map()&lt;/code&gt; function directly:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Conditional Rendering in React</title>
      <link>https://andrewodendaal.com/conditional-rendering-in-react/</link>
      <pubDate>Mon, 24 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/conditional-rendering-in-react/</guid>
      <description>&lt;p&gt;In React apps, you&amp;rsquo;ll often need to render different UI components conditionally based on certain state. For example, showing a login form if a user is not authenticated, or displaying different content based on configurable settings.&lt;/p&gt;&#xA;&lt;p&gt;Here are useful patterns for conditional rendering in React:&lt;/p&gt;&#xA;&lt;h2 id=&#34;ifelse-statements&#34;&gt;If/Else Statements&lt;/h2&gt;&#xA;&lt;p&gt;The standard JS if/else statement works in JSX too:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;App&lt;/span&gt;() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;loggedIn&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; (&lt;span style=&#34;color:#a6e22e&#34;&gt;loggedIn&lt;/span&gt;) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;WelcomeMessage&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  } &lt;span style=&#34;color:#66d9ef&#34;&gt;else&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;LoginForm&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will render either the &lt;code&gt;WelcomeMessage&lt;/code&gt; or &lt;code&gt;LoginForm&lt;/code&gt; component based on the value of &lt;code&gt;loggedIn&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Passing Data Between React Components with Props</title>
      <link>https://andrewodendaal.com/passing-data-between-react-components-with-props/</link>
      <pubDate>Sun, 23 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/passing-data-between-react-components-with-props/</guid>
      <description>&lt;p&gt;One of React&amp;rsquo;s core concepts is reusability through composable components. Components allow splitting complex UI into separate, reusable pieces. However, for components to communicate, they need a way to pass data to each other. Enter props.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Props&lt;/strong&gt; allow passing data from a parent component to a child component. They are like function parameters, but for React components.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s look at a simple example:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Parent component&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Parent&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; () =&amp;gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Child&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#a6e22e&#34;&gt;color&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;blue&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#a6e22e&#34;&gt;onClick&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;{&lt;span style=&#34;color:#a6e22e&#34;&gt;handleClick&lt;/span&gt;} &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  );&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Child component&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Child&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; (&lt;span style=&#34;color:#a6e22e&#34;&gt;props&lt;/span&gt;) =&amp;gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;div&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;{&lt;span style=&#34;color:#a6e22e&#34;&gt;props&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;color&lt;/span&gt;}&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/div&amp;gt; &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The parent component &lt;code&gt;Parent&lt;/code&gt; passes two props to the child component &lt;code&gt;Child&lt;/code&gt; - a &lt;code&gt;color&lt;/code&gt; string and an &lt;code&gt;onClick&lt;/code&gt; event handler.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fostering DevOps Learning Culture: Lifelong Learning</title>
      <link>https://andrewodendaal.com/fostering-devops-learning-culture-lifelong-learning/</link>
      <pubDate>Sat, 22 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/fostering-devops-learning-culture-lifelong-learning/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;In the fast-evolving world of technology, where advancements and innovations are a constant, staying ahead of the curve is paramount for any DevOps team. One of the most effective ways to achieve this is by fostering a continuous learning culture. Embracing a mindset of lifelong learning not only empowers individuals to enhance their skills and knowledge but also drives collective growth and innovation within the organization. In this blog post, we will explore the significance of building a continuous learning culture in DevOps, its impact on team performance, and practical strategies to implement and sustain such a culture. Join us on this journey as we discover how to unleash the power of continuous learning in DevOps.&lt;/p&gt;</description>
    </item>
    <item>
      <title>DevOps&#39; Role in AI: Enhancing Intelligent Systems</title>
      <link>https://andrewodendaal.com/devops-role-ai-enhancing-intelligent-systems/</link>
      <pubDate>Fri, 21 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/devops-role-ai-enhancing-intelligent-systems/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;The world of technology is witnessing a remarkable fusion of two transformative disciplines: DevOps and Artificial Intelligence (AI). DevOps has revolutionized software development, emphasizing collaboration, automation, and continuous delivery, while AI has pushed the boundaries of what machines can achieve, enabling intelligent decision-making and automation. In this blog post, we will explore the symbiotic relationship between DevOps and AI, the challenges and opportunities it presents, and how organizations can leverage this powerful combination to unlock the full potential of intelligent systems. Join us on this journey as we delve into the role of DevOps in the realm of Artificial Intelligence.&lt;/p&gt;</description>
    </item>
    <item>
      <title>DevOps and Microservices: Scalable, Agile Software Delivery</title>
      <link>https://andrewodendaal.com/devops-microservices-scalable-agile-software-delivery/</link>
      <pubDate>Thu, 20 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/devops-microservices-scalable-agile-software-delivery/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;In the fast-paced world of software development, two crucial methodologies have emerged as game-changers for modern development teams: DevOps and Microservices. DevOps is a cultural and technical movement that emphasizes collaboration, automation, and continuous delivery, while Microservices is an architectural style that structures applications as a collection of loosely coupled, independently deployable services. Combining these methodologies can empower organizations to achieve scalable, agile, and efficient software delivery. In this blog post, we will explore the intersection of DevOps and Microservices, their synergies, and how they complement each other. Additionally, we will dive into practical examples with code to demonstrate their seamless integration.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Nature-Inspired Problem Solving: Genetic Algorithms</title>
      <link>https://andrewodendaal.com/nature-inspired-problem-solving-genetic-algorithms/</link>
      <pubDate>Wed, 19 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/nature-inspired-problem-solving-genetic-algorithms/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;Genetic Algorithms (GAs) and Evolutionary Computation (EC) are powerful optimization techniques inspired by the process of natural selection and evolution. These algorithms mimic the principles of genetics and survival of the fittest to find high-quality solutions to complex problems. In this blog post, we will dive into the world of Genetic Algorithms and Evolutionary Computation, exploring their underlying concepts and demonstrating how they can be implemented in Python to tackle a variety of real-world challenges.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python Dynamic Programming: Mastering Optimization</title>
      <link>https://andrewodendaal.com/python-dynamic-programming-mastering-optimization/</link>
      <pubDate>Tue, 18 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/python-dynamic-programming-mastering-optimization/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;Dynamic programming is a powerful algorithmic technique that allows developers to tackle complex problems efficiently. By breaking down these problems into smaller overlapping subproblems and storing their solutions, dynamic programming enables the creation of more adaptive and resource-efficient solutions. In this comprehensive guide, we will explore dynamic programming in-depth and learn how to apply it in Python to solve a variety of problems.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-understanding-dynamic-programming&#34;&gt;1. Understanding Dynamic Programming&lt;/h2&gt;&#xA;&lt;p&gt;Dynamic programming is a method of solving problems by breaking them down into smaller, simpler subproblems and solving each subproblem only once. The solutions to subproblems are stored in a data structure, such as an array or dictionary, to avoid redundant computations. Dynamic programming is particularly useful when a problem exhibits the following characteristics:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python Reflection &amp; Metaprogramming: Advanced Power</title>
      <link>https://andrewodendaal.com/python-reflection-metaprogramming-advanced-power/</link>
      <pubDate>Mon, 17 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/python-reflection-metaprogramming-advanced-power/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;Python is a versatile programming language that offers powerful features and capabilities. For advanced users, understanding and harnessing the potential of reflection and metaprogramming can open up a whole new world of possibilities. In this blog post, we&amp;rsquo;ll dive deep into the concepts of reflection and metaprogramming in Python, exploring their definitions, use cases, and implementation techniques. By mastering reflection and metaprogramming, you can build resilient, scalable, and highly adaptable applications. Get ready to elevate your Python skills as we unravel the magic of reflection and metaprogramming!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Go Context Patterns: Advanced Request Lifecycle Management</title>
      <link>https://andrewodendaal.com/articles/go-context-patterns/</link>
      <pubDate>Mon, 17 Jul 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-context-patterns/</guid>
      <description>&lt;p&gt;Master advanced Go context patterns for sophisticated request lifecycle management, cancellation, and deadline handling in concurrent applications.&lt;/p&gt;&#xA;&lt;h2 id=&#34;context-fundamentals&#34;&gt;Context Fundamentals&lt;/h2&gt;&#xA;&lt;h3 id=&#34;why-context-matters-more-than-you-think&#34;&gt;Why Context Matters More Than You Think&lt;/h3&gt;&#xA;&lt;p&gt;When I first encountered Go&amp;rsquo;s context package, I&amp;rsquo;ll be honest—I thought it was just another way to pass around cancellation signals. Boy, was I wrong. After years of debugging production issues and watching teams struggle with request lifecycle management, I&amp;rsquo;ve come to realize that context is actually the backbone of well-architected Go applications.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes ReplicaSets: Scalability &amp; Fault Tolerance</title>
      <link>https://andrewodendaal.com/kubernetes-replicasets-scalability-fault-tolerance/</link>
      <pubDate>Sun, 16 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/kubernetes-replicasets-scalability-fault-tolerance/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;In Kubernetes, ReplicaSets are a vital resource that enables scalable and fault-tolerant deployments of pods. They provide the ability to ensure a desired number of pod replicas are running at all times, allowing applications to handle increased traffic and recover from failures. In this blog post, we will delve into the world of ReplicaSets, exploring their functionalities, use cases, and best practices. By mastering ReplicaSets, you can build resilient and scalable deployments in Kubernetes.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes Namespaces: Isolation &amp; Resource Management</title>
      <link>https://andrewodendaal.com/kubernetes-namespaces-isolation-resource-management/</link>
      <pubDate>Sat, 15 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/kubernetes-namespaces-isolation-resource-management/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;In Kubernetes, namespaces provide a powerful abstraction that allows you to partition and isolate resources within a cluster. In this blog post, we&amp;rsquo;ll explore Kubernetes namespaces in detail and discuss their importance in achieving effective resource management and isolation. By understanding namespaces and leveraging their capabilities, you can enhance the security, scalability, and manageability of your &lt;a href=&#34;https://andrewodendaal.com/teach-me-kubernetes-part6-deployments&#34;&gt;Kubernetes deployments&lt;/a&gt;. Let&amp;rsquo;s dive into the world of namespaces and unlock their potential!&lt;/p&gt;&#xA;&lt;h2 id=&#34;understanding-kubernetes-namespaces&#34;&gt;Understanding Kubernetes Namespaces&lt;/h2&gt;&#xA;&lt;p&gt;Kubernetes namespaces provide a virtual clustering mechanism that allows you to divide a cluster into multiple logical units. Each namespace acts as a separate virtual cluster, providing isolation and resource segmentation. This ensures that resources within a namespace are isolated from resources in other namespaces, providing a boundary for managing applications and their associated components.&lt;/p&gt;</description>
    </item>
    <item>
      <title>K8s Cluster Resiliency: Advanced High Availability</title>
      <link>https://andrewodendaal.com/k8s-cluster-resiliency-advanced-high-availability/</link>
      <pubDate>Fri, 14 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/k8s-cluster-resiliency-advanced-high-availability/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;In today&amp;rsquo;s technology landscape, ensuring the resiliency and high availability of Kubernetes clusters is crucial for maintaining the availability of applications and business continuity. In this blog post, we will explore advanced techniques and best practices for building cluster resiliency in Kubernetes. By implementing these strategies, you can ensure that your applications remain highly available, even in the face of failures or disruptions. Let&amp;rsquo;s dive into the world of cluster resiliency and learn how to build rock-solid, resilient clusters!&lt;/p&gt;</description>
    </item>
    <item>
      <title>K8s Networking Mastery: Advanced Cluster Communication</title>
      <link>https://andrewodendaal.com/k8s-networking-mastery-advanced-cluster-communication/</link>
      <pubDate>Thu, 13 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/k8s-networking-mastery-advanced-cluster-communication/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;Kubernetes has revolutionized container orchestration, enabling the efficient management of complex applications. As an advanced user, you&amp;rsquo;re likely already familiar with the basics of Kubernetes networking. In this blog post, we&amp;rsquo;ll dive deeper into advanced networking concepts, exploring techniques and best practices to optimize cluster communication, enhance security, and troubleshoot network-related issues. Get ready to level up your networking skills in Kubernetes!&lt;/p&gt;&#xA;&lt;h2 id=&#34;network-models-in-kubernetes&#34;&gt;Network Models in Kubernetes&lt;/h2&gt;&#xA;&lt;p&gt;In Kubernetes, network models play a crucial role in facilitating communication between pods. One commonly used model is the overlay network. This model allows pods to communicate seamlessly across different nodes by encapsulating network packets within an overlay network. Understanding how overlay networks work and how they enable efficient pod-to-pod communication is essential for &lt;a href=&#34;https://andrewodendaal.com/mastering-advanced-networking-in-eks-and-kubernetes&#34;&gt;advanced networking in Kubernetes&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Blue-Green Deployments in Kubernetes: Production &amp; DR</title>
      <link>https://andrewodendaal.com/blue-green-deployments-kubernetes-production-dr/</link>
      <pubDate>Wed, 12 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/blue-green-deployments-kubernetes-production-dr/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;In today&amp;rsquo;s fast-paced and highly competitive digital landscape, organizations strive to deliver seamless and uninterrupted services to their customers. To achieve this, a robust production strategy combined with a solid disaster recovery (DR) plan is crucial. In the realm of Kubernetes, one powerful technique for achieving these goals is the implementation of blue-green deployments. This blog post will explore the concept of blue-green deployments, their benefits, and how they can be effectively leveraged in &lt;a href=&#34;https://andrewodendaal.com/how-to-get-the-environment-variables-in-a-kubernetes-pod&#34;&gt;Kubernetes environments&lt;/a&gt; to streamline production and disaster recovery strategies.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AWS Production-DR Failover: Advanced Strategies</title>
      <link>https://andrewodendaal.com/aws-production-dr-failover-advanced-strategies/</link>
      <pubDate>Tue, 11 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/aws-production-dr-failover-advanced-strategies/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;Implementing failover between a production (Prod) account and a disaster recovery (DR) account is a critical aspect of ensuring high availability and business continuity in AWS. While DNS-based failover is a common approach, advanced users can explore additional strategies that provide enhanced control, automation, and scalability for failover scenarios. In this comprehensive guide, we will delve into advanced techniques that go beyond DNS, enabling advanced users to build robust failover architectures in AWS.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python Context Managers Mastery: Resource Management</title>
      <link>https://andrewodendaal.com/python-context-managers-mastery-resource-management/</link>
      <pubDate>Mon, 10 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/python-context-managers-mastery-resource-management/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;Python context managers provide a convenient and reliable way to manage resources and ensure proper setup and teardown actions. Whether dealing with file operations, database connections, or any resource that needs to be acquired and released, context managers offer a clean and concise approach. This comprehensive blog post will explore the concept of context managers in Python, starting from the fundamentals and gradually progressing to more advanced techniques.&lt;/p&gt;&#xA;&lt;h2 id=&#34;understanding-context-managers&#34;&gt;Understanding Context Managers&lt;/h2&gt;&#xA;&lt;h3 id=&#34;the-context-management-protocol&#34;&gt;The Context Management Protocol&lt;/h3&gt;&#xA;&lt;p&gt;The Context Management Protocol defines the interface that objects must implement to be used as context managers. It requires the implementation of &lt;code&gt;__enter__()&lt;/code&gt; and &lt;code&gt;__exit__()&lt;/code&gt; methods. The &lt;code&gt;__enter__()&lt;/code&gt; method sets up the context, while the &lt;code&gt;__exit__()&lt;/code&gt; method handles the cleanup actions.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python Decorators Mastery: Advanced Usage Guide</title>
      <link>https://andrewodendaal.com/python-decorators-mastery-advanced-usage-guide/</link>
      <pubDate>Sun, 09 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/python-decorators-mastery-advanced-usage-guide/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;Python decorators are a powerful feature that allows you to modify the behavior of functions or classes dynamically. Decorators provide a way to add functionality to existing code without modifying the original source. This blog post will delve into the concept of decorators in Python, starting from the basics and gradually progressing to more advanced techniques.&lt;/p&gt;&#xA;&lt;h2 id=&#34;understanding-decorators&#34;&gt;Understanding Decorators&lt;/h2&gt;&#xA;&lt;h3 id=&#34;function-decorators&#34;&gt;Function Decorators&lt;/h3&gt;&#xA;&lt;p&gt;Function decorators are a way to modify the behavior of a function by wrapping it inside another function. The decorator function takes the original function as an argument, adds some functionality, and returns a modified function. This allows you to enhance or extend the behavior of functions without modifying their source code.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python&#39;s Yield Mastery: Advanced Usage Guide</title>
      <link>https://andrewodendaal.com/python-yield-mastery-advanced-usage-guide/</link>
      <pubDate>Sat, 08 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/python-yield-mastery-advanced-usage-guide/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;Python&amp;rsquo;s &lt;code&gt;yield&lt;/code&gt; statement is a powerful feature that allows you to create generator functions. Generators provide an efficient way to generate a sequence of values without storing them all in memory at once. This blog post will delve into the concept of &lt;code&gt;yield&lt;/code&gt; in Python, starting from the basics and gradually progressing to more advanced techniques.&lt;/p&gt;&#xA;&lt;h2 id=&#34;understanding-the-basics&#34;&gt;Understanding the Basics&lt;/h2&gt;&#xA;&lt;h3 id=&#34;yield-vs-return&#34;&gt;Yield vs. Return&lt;/h3&gt;&#xA;&lt;p&gt;In Python, the &lt;code&gt;yield&lt;/code&gt; statement is used within a function to create a generator. Unlike the &lt;code&gt;return&lt;/code&gt; statement, which terminates the function and returns a single value, &lt;code&gt;yield&lt;/code&gt; allows the function to produce a sequence of values, one at a time. This is what differentiates generator functions from regular functions.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python: Unleashing the Power of Simplicity and Versatility</title>
      <link>https://andrewodendaal.com/python-unleashing-the-power-of-simplicity-and-versatility/</link>
      <pubDate>Fri, 07 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/python-unleashing-the-power-of-simplicity-and-versatility/</guid>
      <description>&lt;h2 id=&#34;getting-started-with-python&#34;&gt;Getting Started with Python&lt;/h2&gt;&#xA;&lt;p&gt;Python is a versatile and popular programming language known for its simplicity and readability. It is widely used in various fields, including web development, data analysis, artificial intelligence, and automation. If you&amp;rsquo;re new to Python, this guide will help you get started with the basics and provide some code examples to illustrate key concepts.&lt;/p&gt;&#xA;&lt;h2 id=&#34;installing-python&#34;&gt;Installing Python&lt;/h2&gt;&#xA;&lt;p&gt;To begin, you need to install Python on your computer. Python is available for multiple platforms, including Windows, macOS, and Linux. You can download the latest version of Python from the official website (&lt;a href=&#34;https://www.python.org/downloads/&#34;&gt;https://www.python.org/downloads/&lt;/a&gt;) and follow the installation instructions specific to your operating system.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python&#39;s Advanced Features: Empowering Programmers</title>
      <link>https://andrewodendaal.com/python-advanced-features-empowering-programmers/</link>
      <pubDate>Thu, 06 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/python-advanced-features-empowering-programmers/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction:&lt;/h2&gt;&#xA;&lt;p&gt;In the vast realm of programming, Python stands tall as a language that caters to developers of all levels. Beyond its beginner-friendly syntax, Python harbors a treasure trove of advanced features that can elevate your coding prowess to new heights. In this blog post, we embark on an exhilarating journey to explore the depths of Python&amp;rsquo;s advanced features, unleashing their full potential. Brace yourself as we delve into the world of decorators, context managers, metaclasses, multiple inheritance, generators, coroutines, dynamic typing, duck typing, and functional programming tools. Get ready to unlock the true power of Python!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Advanced Go Testing Strategies and Benchmarking</title>
      <link>https://andrewodendaal.com/articles/go-testing-benchmarking/</link>
      <pubDate>Thu, 06 Jul 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-testing-benchmarking/</guid>
      <description>&lt;p&gt;Master comprehensive testing approaches in Go including unit testing.&lt;/p&gt;&#xA;&lt;p&gt;#In the world of Go development, writing code is only half the battle. The other half—often more challenging and equally critical—is ensuring that your code works correctly, performs efficiently, and remains resilient under all conditions. As Go continues to power mission-critical systems across industries, from financial services to cloud infrastructure, the importance of comprehensive testing strategies cannot be overstated.&lt;/p&gt;&#xA;&lt;p&gt;This guide explores advanced testing techniques that go beyond basic unit tests to help you build truly bulletproof Go applications. We&amp;rsquo;ll dive deep into sophisticated testing patterns, benchmarking strategies, and quality assurance practices that experienced Go developers use to ensure their systems perform reliably at scale.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python&#39;s Yield: Unleashing Generator Magic</title>
      <link>https://andrewodendaal.com/python-yield-unleashing-generator-magic/</link>
      <pubDate>Wed, 05 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/python-yield-unleashing-generator-magic/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;Python, being a versatile language, offers numerous tools and features to streamline our coding experience. One such powerful feature is the &lt;code&gt;yield&lt;/code&gt; keyword. In this blog post, we will embark on an exciting journey to explore the hidden potential of Python&amp;rsquo;s &lt;code&gt;yield&lt;/code&gt; statement and dive into the realm of generators. Buckle up and get ready to witness the magic unfold!&lt;/p&gt;&#xA;&lt;h2 id=&#34;section-1-understanding-the-basics-of-yield&#34;&gt;Section 1: Understanding the Basics of Yield&lt;/h2&gt;&#xA;&lt;p&gt;At its core, &lt;code&gt;yield&lt;/code&gt; is used in Python to create generator functions. Generators are special functions that can pause and resume their execution, allowing us to iterate over a sequence of values without creating them all at once. Let&amp;rsquo;s take a look at a simple example to grasp the concept:&lt;/p&gt;</description>
    </item>
    <item>
      <title>GitOps Rising: Transforming DevOps for Streamlined Delivery</title>
      <link>https://andrewodendaal.com/gitops-rising-transforming-devops-streamlined-delivery/</link>
      <pubDate>Tue, 04 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/gitops-rising-transforming-devops-streamlined-delivery/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;In today&amp;rsquo;s fast-paced digital landscape, where businesses strive to deliver high-quality software products with agility and efficiency, DevOps practices have become indispensable. DevOps aims to bridge the gap between software development and operations, enabling seamless collaboration, faster deployments, and improved overall software delivery. One of the most prominent trends revolutionizing the DevOps world is GitOps. In this blog post, we will explore the concept of GitOps, its benefits, and why it has gained significant traction in the industry.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Enhancing Security: How DevOps Mitigates Cyber Threats</title>
      <link>https://andrewodendaal.com/enhancing-security-how-devops-mitigates-cyber-threats/</link>
      <pubDate>Mon, 03 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/enhancing-security-how-devops-mitigates-cyber-threats/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;In today&amp;rsquo;s digital landscape, where cyber threats are prevalent and evolving, organizations must adopt robust security measures to safeguard their sensitive data and systems. In this pursuit, DevOps practices have emerged as a powerful ally, enabling organizations to build secure and resilient software solutions. By integrating security into every stage of the software development lifecycle, DevOps plays a crucial role in preventing, detecting, and responding to cyber attacks. In this blog post, we will explore how DevOps helps organizations fend off hackers and enhance their overall security posture.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Site Reliability Engineering (SRE) in Modern Organizations</title>
      <link>https://andrewodendaal.com/site-reliability-engineering-sre-modern-organizations/</link>
      <pubDate>Sun, 02 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/site-reliability-engineering-sre-modern-organizations/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;In today&amp;rsquo;s fast-paced and technology-driven world, organizations heavily rely on digital services to deliver their products and serve their customers. With the increasing complexity of modern infrastructure and the need for high availability and reliability, Site Reliability Engineering (SRE) has emerged as a critical discipline. SRE combines software engineering principles with operations expertise to ensure the smooth functioning of complex systems. In this blog post, we will explore the importance of SRE in organizations and how it contributes to their success.&lt;/p&gt;</description>
    </item>
    <item>
      <title>DevOps &amp; DevSecOps: Bridging Dev-Security Gap</title>
      <link>https://andrewodendaal.com/devops-devsecops-bridging-dev-security-gap/</link>
      <pubDate>Sat, 01 Jul 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/devops-devsecops-bridging-dev-security-gap/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;In today&amp;rsquo;s fast-paced digital landscape, where software development cycles are becoming increasingly rapid and security threats are ever-present, organizations are seeking effective ways to align development and security practices. Two prominent approaches that have gained significant attention are &lt;a href=&#34;https://andrewodendaal.com/what-is-devops&#34;&gt;DevOps and DevSecOps&lt;/a&gt;. While these terms may sound similar, there are crucial distinctions between them. In this blog post, we will explore the differences between &lt;a href=&#34;https://andrewodendaal.com/tags/devops/&#34;&gt;DevOps and DevSecOps&lt;/a&gt;, their goals, and how they contribute to efficient and secure software delivery.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Unleashing the Power: Lambda - A Killer Feature in AWS</title>
      <link>https://andrewodendaal.com/unleashing-the-power-lambda-a-killer-feature-in-aws/</link>
      <pubDate>Fri, 30 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/unleashing-the-power-lambda-a-killer-feature-in-aws/</guid>
      <description>&lt;p&gt;In the world of cloud computing, Amazon Web Services (AWS) has long been a dominant player, providing a comprehensive suite of services to meet the diverse needs of businesses. Among its vast array of offerings, one particular service stands out as a true game-changer: AWS Lambda. Lambda is a serverless computing platform that has revolutionized the way developers build and deploy applications. In this blog post, we&amp;rsquo;ll explore why Lambda is rightly hailed as a killer feature in AWS.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python vs Java Performance: Programming Powerhouses</title>
      <link>https://andrewodendaal.com/python-java-performance-programming-powerhouses/</link>
      <pubDate>Thu, 29 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/python-java-performance-programming-powerhouses/</guid>
      <description>&lt;p&gt;In the vast landscape of programming languages, Python and Java have emerged as titans, offering robust solutions for a wide range of applications. When it comes to performance, developers often find themselves pondering which language reigns supreme. In this blog post, we will delve into the world of Python and Java, exploring their performance characteristics, strengths, and weaknesses, and ultimately helping you make an informed choice for your next project.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Teach me the Basics of Data Science in Python</title>
      <link>https://andrewodendaal.com/teach-me-the-basics-of-data-science-in-python/</link>
      <pubDate>Wed, 28 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/teach-me-the-basics-of-data-science-in-python/</guid>
      <description>&lt;h2 id=&#34;an-overview-of-data-science-in-python&#34;&gt;An overview of Data Science in Python&lt;/h2&gt;&#xA;&lt;p&gt;This is an overview of the basics of data science in Python. Data science involves extracting knowledge and insights from data using various techniques such as data cleaning, visualization, statistical analysis, and &lt;a href=&#34;https://andrewodendaal.com/machine-learning-mastery-series&#34;&gt;machine learning&lt;/a&gt;. Python is a popular programming language in the data science community due to its rich ecosystem of libraries and tools. Let&amp;rsquo;s go through the key components of data science in Python.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Share a VPC from one AWS Account to Another</title>
      <link>https://andrewodendaal.com/how-to-share-a-vpc-from-one-aws-account-to-another/</link>
      <pubDate>Tue, 27 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-share-a-vpc-from-one-aws-account-to-another/</guid>
      <description>&lt;p&gt;To share a Virtual Private Cloud (VPC) from one AWS account to another, you can use the AWS Resource Access Manager (RAM) service. RAM allows you to securely share your AWS resources with other AWS accounts while maintaining control over the resource permissions.&lt;/p&gt;&#xA;&lt;p&gt;Here&amp;rsquo;s a step-by-step guide on how to share a VPC from one AWS account to another:&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-set-up-the-necessary-permissions&#34;&gt;1. Set up the necessary permissions&lt;/h2&gt;&#xA;&lt;p&gt;In the account that owns the VPC (the sharing account), ensure that you have the required permissions to share the VPC. You need to have the &lt;code&gt;ram:CreateResourceShare&lt;/code&gt; and &lt;code&gt;ec2:DescribeVpc&lt;/code&gt; IAM permissions.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] Set CloudWatch Logs role ARN in account settings</title>
      <link>https://andrewodendaal.com/solved-set-cloudwatch-logs-role-arn-account-settings/</link>
      <pubDate>Mon, 26 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/solved-set-cloudwatch-logs-role-arn-account-settings/</guid>
      <description>&lt;p&gt;The error message you mentioned, &amp;ldquo;CloudWatch Logs role ARN must be set in account settings to enable logging,&amp;rdquo; typically occurs when you&amp;rsquo;re trying to enable logging for an AWS service that requires a CloudWatch Logs role, but the necessary role hasn&amp;rsquo;t been set up or configured correctly in your account settings. To resolve this issue, you can follow these steps:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Sign in to the AWS Management Console.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Open the AWS CloudTrail console at &lt;a href=&#34;https://console.aws.amazon.com/cloudtrail/&#34;&gt;https://console.aws.amazon.com/cloudtrail/&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create CloudFormation with Multiple Files</title>
      <link>https://andrewodendaal.com/how-to-create-cloudformation-with-multiple-files/</link>
      <pubDate>Sun, 25 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-cloudformation-with-multiple-files/</guid>
      <description>&lt;p&gt;To create a CloudFormation (CFN) stack with multiple files, you can follow these general steps:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Organize your resources: Divide your resources into logical groups or services. For example, you might have separate files for networking, storage, compute, and so on.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Create YAML or JSON templates: Create individual &lt;code&gt;YAML&lt;/code&gt; or &lt;code&gt;JSON&lt;/code&gt; templates for each group or service. Each template will define the resources specific to that group. For example, networking.yaml, storage.yaml, and compute.yaml.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Teach me Hashicorp Vault</title>
      <link>https://andrewodendaal.com/teach-me-hashicorp-vault/</link>
      <pubDate>Sat, 24 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/teach-me-hashicorp-vault/</guid>
      <description>&lt;h2 id=&#34;introduction-to-hashicorp-vault&#34;&gt;Introduction to Hashicorp Vault&lt;/h2&gt;&#xA;&lt;p&gt;HashiCorp Vault is a popular open-source tool designed for securely storing and managing secrets, such as API keys, passwords, certificates, and other sensitive information. It provides a centralized place to store secrets, access control mechanisms, and auditing capabilities. Vault ensures that only authorized applications and users can access the secrets they need, thus improving security in an organization.&lt;/p&gt;&#xA;&lt;h2 id=&#34;concepts&#34;&gt;Concepts&lt;/h2&gt;&#xA;&lt;p&gt;Here&amp;rsquo;s a high-level overview of the key concepts and components of HashiCorp Vault:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Generate Terraform using a Bash Shell script</title>
      <link>https://andrewodendaal.com/how-to-generate-terraform-using-a-bash-shell-script/</link>
      <pubDate>Fri, 23 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-generate-terraform-using-a-bash-shell-script/</guid>
      <description>&lt;p&gt;To generate Terraform code using a Bash shell script, you can utilize Python within the script. Here&amp;rsquo;s an example of how you can achieve this:&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-create-a-new-bash-script-file&#34;&gt;1. Create a new Bash script file&lt;/h2&gt;&#xA;&lt;p&gt;Open a text editor and create a new file, for example, &lt;code&gt;generate_terraform.sh&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;2-add-the-shebang-line&#34;&gt;2. Add the shebang line&lt;/h2&gt;&#xA;&lt;p&gt;Start the script with the shebang line to specify that it should be interpreted using Bash:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#!/bin/bash&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;3-install-required-libraries&#34;&gt;3. Install Required Libraries&lt;/h2&gt;&#xA;&lt;p&gt;Since you&amp;rsquo;ll be using Python within the script, ensure that Python and &lt;code&gt;pip&lt;/code&gt; are installed on your system. You also need to install the &lt;code&gt;hclwriter&lt;/code&gt; library. To do this, you can include the installation commands within the script:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Generate Terraform using Python</title>
      <link>https://andrewodendaal.com/how-to-generate-terraform-using-python/</link>
      <pubDate>Thu, 22 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-generate-terraform-using-python/</guid>
      <description>&lt;p&gt;To generate Terraform code using Python, you can utilize the power of the language and various libraries to dynamically create and manipulate the Terraform configuration files. Here&amp;rsquo;s a step-by-step guide on how to get started:&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-install-required-libraries&#34;&gt;1. Install Required Libraries&lt;/h2&gt;&#xA;&lt;p&gt;Make sure you have Python installed on your system. Additionally, install the hclwriter library, which simplifies the process of generating HCL (HashiCorp Configuration Language) code, the language used by Terraform. You can install it using pip:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Make EKS cluster private with NodeGroup access</title>
      <link>https://andrewodendaal.com/eks-cluster-private-nodegroup-access/</link>
      <pubDate>Wed, 21 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/eks-cluster-private-nodegroup-access/</guid>
      <description>&lt;h2 id=&#34;the-theory&#34;&gt;The Theory&lt;/h2&gt;&#xA;&lt;p&gt;To make an Amazon Elastic Kubernetes Service (EKS) cluster private and allow nodes to join through a node group, you need to follow a few steps. By default, EKS creates a public cluster, but you can configure it to make it private for enhanced security. Here&amp;rsquo;s an overview of the process:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Create a VPC&lt;/strong&gt;: Start by creating a Virtual Private Cloud (VPC) in your AWS account if you haven&amp;rsquo;t already. This VPC will be used to host your private EKS cluster.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Create private subnets&lt;/strong&gt;: Within the VPC, create one or more private subnets. These subnets will provide the network isolation required for a private cluster. Make sure the subnets have no direct internet access and that their route tables do not have an internet gateway attached.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Create security groups&lt;/strong&gt;: Create security groups to define the inbound and outbound traffic rules for your EKS cluster and nodes. These security groups should allow communication between the control plane and the worker nodes, as well as any other necessary network traffic.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Create a NAT gateway&lt;/strong&gt;: Since the private subnets don&amp;rsquo;t have direct internet access, you need to set up a Network Address Translation (NAT) gateway in a public subnet to enable outbound internet connectivity for resources in the private subnets.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Configure VPC endpoints&lt;/strong&gt;: Create VPC endpoints for EKS and EC2 to allow private communication between your EKS cluster control plane and the worker nodes. These endpoints will ensure that the control plane and nodes can communicate without requiring access to the public internet.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Create a private EKS cluster&lt;/strong&gt;: Now, create a private EKS cluster using the AWS Management Console, AWS CLI, or AWS SDKs. During the cluster creation, specify the private subnets, security groups, and VPC endpoints you created earlier. This will ensure that the cluster is deployed within the private subnets and can communicate with the nodes via the VPC endpoints.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Create a node group&lt;/strong&gt;: Once the cluster is created, you can proceed to create a node group. When creating the node group, specify the private subnets and security groups that you set up earlier. The node group will be deployed in the private subnets and join the private EKS cluster.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Following these steps will result in a private EKS cluster where the control plane and worker nodes communicate privately through the VPC endpoints. The private nature of the cluster enhances security by reducing exposure to the public internet.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Which is the best language to use in DevOps</title>
      <link>https://andrewodendaal.com/which-is-the-best-language-to-use-in-devops/</link>
      <pubDate>Tue, 20 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/which-is-the-best-language-to-use-in-devops/</guid>
      <description>&lt;p&gt;In DevOps, there isn&amp;rsquo;t a single &amp;ldquo;best&amp;rdquo; language that universally applies to all situations. The choice of programming language depends on various factors, including the specific requirements of your project, existing infrastructure, team&amp;rsquo;s expertise, and the ecosystem surrounding the tools and technologies you plan to use. However, here are some commonly used languages in different areas of DevOps:&lt;/p&gt;&#xA;&lt;h2 id=&#34;automation-and-configuration-management&#34;&gt;Automation and Configuration Management&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ansible: Ansible uses a declarative YAML syntax for defining configurations and automation tasks. It is known for its simplicity and ease of use.&lt;/li&gt;&#xA;&lt;li&gt;Python: Python is a versatile language widely used in DevOps. It has a rich ecosystem of libraries and frameworks, making it suitable for automation, scripting, and building infrastructure tools.&lt;/li&gt;&#xA;&lt;li&gt;Ruby: Ruby is the language used by Chef, another popular configuration management tool. If you plan to use Chef, having knowledge of Ruby can be beneficial.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;infrastructure-as-code&#34;&gt;Infrastructure as Code&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Terraform: Terraform, a tool for provisioning and managing infrastructure, uses its own domain-specific language (DSL). Although it has its own DSL, it is worth noting that Terraform configurations can be written using JSON or HCL (HashiCorp Configuration Language), which is similar to JSON.&lt;/li&gt;&#xA;&lt;li&gt;Cloud-specific languages: Cloud providers often provide their own specific languages or SDKs for infrastructure provisioning and management. For example, AWS provides AWS CloudFormation (JSON/YAML-based) and AWS SDKs for various languages such as Python, Java, and JavaScript.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;continuous-integrationcontinuous-deployment-cicd&#34;&gt;Continuous Integration/Continuous Deployment (CI/CD)&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Jenkinsfile (Groovy): Jenkins, a popular CI/CD tool, uses a Groovy-based DSL for defining pipelines and workflows.&lt;/li&gt;&#xA;&lt;li&gt;YAML: Many CI/CD tools, including GitLab CI/CD and GitHub Actions, use YAML-based configuration files for defining CI/CD pipelines.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;monitoring-and-data-analysis&#34;&gt;Monitoring and Data Analysis&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Python: Python is often used for scripting and building monitoring tools. It has libraries like Pandas, NumPy, and matplotlib that are useful for data analysis and visualization.&lt;/li&gt;&#xA;&lt;li&gt;Go: Go (Golang) is gaining popularity for building high-performance and scalable monitoring systems and data processing pipelines.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;moreover&#34;&gt;Moreover&lt;/h2&gt;&#xA;&lt;p&gt;In the world of DevOps, the choice of programming language plays a crucial role in effectively managing and automating various tasks. However, it&amp;rsquo;s worth noting that many DevOps tasks involve using multiple languages and tools together, rather than relying on a single language. This approach allows DevOps teams to leverage the strengths and capabilities of different languages and tools to meet their specific requirements.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How is Ansible different from Chef or Puppet</title>
      <link>https://andrewodendaal.com/how-is-ansible-different-from-chef-or-puppet/</link>
      <pubDate>Mon, 19 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-is-ansible-different-from-chef-or-puppet/</guid>
      <description>&lt;p&gt;Ansible, Chef, and Puppet are all popular configuration management and automation tools, but they differ in their approach and architecture. Here&amp;rsquo;s a comparison of Ansible with Chef and Puppet:&lt;/p&gt;&#xA;&lt;h2 id=&#34;architecture&#34;&gt;Architecture&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ansible: Ansible follows a simple agentless architecture. It uses SSH or WinRM to connect to managed nodes and executes tasks remotely without the need for installing any agent software on the nodes.&lt;/li&gt;&#xA;&lt;li&gt;Chef: Chef uses a client-server architecture. It requires a Chef client agent to be installed on each managed node, which communicates with a central Chef server.&lt;/li&gt;&#xA;&lt;li&gt;Puppet: Puppet also follows a client-server architecture. It requires the installation of the Puppet agent on each managed node, which communicates with a central Puppet master.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;configuration-language&#34;&gt;Configuration Language&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ansible: Ansible uses YAML, a human-readable language, for defining playbooks and configurations. YAML has a simpler syntax and is easy to understand and write.&lt;/li&gt;&#xA;&lt;li&gt;Chef: Chef uses a Ruby-based DSL (Domain-Specific Language) called the Chef DSL. It allows for more flexibility and extensibility but has a steeper learning curve for users not familiar with Ruby.&lt;/li&gt;&#xA;&lt;li&gt;Puppet: Puppet uses its own declarative language called Puppet DSL or Puppet language. It is designed to be readable and expressive, although some users find it more complex than Ansible&amp;rsquo;s YAML.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;agent-based-vs-agentless&#34;&gt;Agent-based vs. Agentless&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ansible: Ansible is agentless, meaning it does not require a separate agent to be installed on the managed nodes. This simplifies the setup and maintenance process.&lt;/li&gt;&#xA;&lt;li&gt;Chef: Chef and Puppet both require agents to be installed on the managed nodes, which adds an extra step and potential overhead.&lt;/li&gt;&#xA;&lt;li&gt;Puppet: Puppet also requires agent installation on managed nodes.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;ease-of-use&#34;&gt;Ease of Use&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ansible: Ansible is known for its simplicity and ease of use. Its YAML syntax and agentless architecture make it accessible to users with varying levels of experience.&lt;/li&gt;&#xA;&lt;li&gt;Chef: Chef offers a higher level of flexibility but may have a steeper learning curve, especially for users who are not familiar with Ruby or DSLs.&lt;/li&gt;&#xA;&lt;li&gt;Puppet: Puppet has a reputation for being powerful but also having a steeper learning curve due to its language and architecture.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;community-and-ecosystem&#34;&gt;Community and Ecosystem&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ansible: Ansible has a large and active community with extensive documentation and a wide range of community-contributed modules and playbooks available for various use cases.&lt;/li&gt;&#xA;&lt;li&gt;Chef: Chef also has an active community and offers a rich ecosystem of cookbooks (equivalent to Ansible&amp;rsquo;s roles) available in the Chef Supermarket.&lt;/li&gt;&#xA;&lt;li&gt;Puppet: Puppet has a well-established community and ecosystem, with a central repository called Puppet Forge that provides a collection of modules.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;making-the-correct-choice&#34;&gt;Making the correct choice&lt;/h2&gt;&#xA;&lt;p&gt;Overall, the choice between Ansible, Chef, or Puppet depends on your specific requirements, familiarity with different languages, preferences, and the existing infrastructure in your environment. Each tool has its strengths and can be effective for automating configuration management tasks, but Ansible&amp;rsquo;s simplicity and agentless architecture make it a popular choice for many users.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Teach me the basics of Ansible</title>
      <link>https://andrewodendaal.com/teach-me-the-basics-of-ansible/</link>
      <pubDate>Sun, 18 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/teach-me-the-basics-of-ansible/</guid>
      <description>&lt;p&gt;Ansible is an open-source automation tool that allows you to manage and configure computer systems. It uses a declarative language called YAML (Yet Another Markup Language) for defining configurations and tasks. Ansible follows a client-server architecture, where the controlling machine (the Ansible server) manages and communicates with the target machines (managed nodes) over SSH.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-basics-of-ansible&#34;&gt;The basics of Ansible&lt;/h2&gt;&#xA;&lt;h3 id=&#34;inventory&#34;&gt;Inventory&lt;/h3&gt;&#xA;&lt;p&gt;An inventory file in Ansible contains a list of target hosts (managed nodes) on which Ansible performs operations. You can define the inventory in a simple text file or in dynamic inventory scripts. Each host entry can have associated variables like IP address, username, and SSH key.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How do you create an EKS cluster using CloudFormation</title>
      <link>https://andrewodendaal.com/how-do-you-create-an-eks-cluster-using-cloudformation/</link>
      <pubDate>Sat, 17 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-do-you-create-an-eks-cluster-using-cloudformation/</guid>
      <description>&lt;h2 id=&#34;the-steps-to-achieve-this&#34;&gt;The steps to achieve this&lt;/h2&gt;&#xA;&lt;p&gt;To create an Amazon Elastic Kubernetes Service (EKS) cluster using CloudFormation, you can follow these steps:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Create a CloudFormation template: Start by creating a CloudFormation template in YAML or JSON format. This template will define the resources required for your EKS cluster, including the cluster itself, worker nodes, and other necessary components.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Define the EKS cluster resource: Within your CloudFormation template, define an AWS::EKS::Cluster resource. Specify the desired configuration for your EKS cluster, such as the version, name, and role-based access control (RBAC) configuration.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to connect an API Gateway to Inline Lambda in Terraform</title>
      <link>https://andrewodendaal.com/how-to-connect-an-api-gateway-to-inline-lambda-in-terraform/</link>
      <pubDate>Fri, 16 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-connect-an-api-gateway-to-inline-lambda-in-terraform/</guid>
      <description>&lt;p&gt;To connect an API Gateway to an inline Lambda function using Terraform, you can follow these steps:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Define your API Gateway and Lambda function resources in your Terraform configuration. Here&amp;rsquo;s an example:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-terraform&#34; data-lang=&#34;terraform&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_api_gateway_rest_api&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;my_api_gateway&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;MyApiGateway&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_api_gateway_resource&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;my_api_gateway_resource&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;rest_api_id&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;aws_api_gateway_rest_api&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;my_api_gateway&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;id&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;parent_id&lt;/span&gt;   &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;aws_api_gateway_rest_api&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;my_api_gateway&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;root_resource_id&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;path_part&lt;/span&gt;   &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;myresource&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_api_gateway_method&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;my_api_gateway_method&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;rest_api_id&lt;/span&gt;   &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;aws_api_gateway_rest_api&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;my_api_gateway&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;id&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;resource_id&lt;/span&gt;   &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;aws_api_gateway_resource&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;my_api_gateway_resource&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;id&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;http_method&lt;/span&gt;   &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;GET&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;authorization&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;NONE&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;integration&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;type&lt;/span&gt;             &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;AWS_PROXY&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;http_method&lt;/span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;POST&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;uri&lt;/span&gt;              &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;arn:aws:apigateway:&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;var.&lt;span style=&#34;color:#a6e22e&#34;&gt;region&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;:lambda:path/2015-03-31/functions/&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;aws_lambda_function&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;my_lambda_function&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;arn&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/invocations&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_api_gateway_deployment&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;my_api_gateway_deployment&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;rest_api_id&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;aws_api_gateway_rest_api&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;my_api_gateway&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;id&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;stage_name&lt;/span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;prod&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_lambda_function&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;my_lambda_function&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;function_name&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;MyLambdaFunction&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;runtime&lt;/span&gt;       &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;python3.8&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;handler&lt;/span&gt;       &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;index.lambda_handler&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;inline_code&lt;/span&gt;   &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&amp;lt;EOF&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    def lambda_handler(event, context):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;        return {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;            &amp;#39;statusCode&amp;#39;: 200,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;            &amp;#39;body&amp;#39;: &amp;#39;Hello from Lambda!&amp;#39;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;        }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;EOF&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_lambda_permission&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;my_lambda_permission&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;statement_id&lt;/span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;AllowAPIGatewayInvoke&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;action&lt;/span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;lambda:InvokeFunction&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;function_name&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;aws_lambda_function&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;my_lambda_function&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;arn&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;principal&lt;/span&gt;     &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;apigateway.amazonaws.com&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;source_arn&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;arn:aws:execute-api:&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;var.&lt;span style=&#34;color:#a6e22e&#34;&gt;region&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;data.&lt;span style=&#34;color:#a6e22e&#34;&gt;aws_caller_identity&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;current&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;account_id&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;aws_api_gateway&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the above example, the Lambda function is defined inline using the &lt;code&gt;inline_code&lt;/code&gt; property. The code inside the &lt;code&gt;lambda_handler&lt;/code&gt; function can be customized according to your requirements.&lt;/p&gt;</description>
    </item>
    <item>
      <title>gRPC Microservices with Go</title>
      <link>https://andrewodendaal.com/articles/go-grpc-microservices/</link>
      <pubDate>Fri, 16 Jun 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-grpc-microservices/</guid>
      <description>&lt;p&gt;Build high-performance microservices using gRPC and Go with advanced patterns for service communication.&lt;/p&gt;&#xA;&lt;h4 id=&#34;advanced-grpc-service-design&#34;&gt;Advanced gRPC Service Design&lt;/h4&gt;&#xA;&lt;p&gt;Before diving into optimization techniques, it&amp;rsquo;s essential to establish a solid foundation with well-designed gRPC services that follow best practices and leverage the full power of Protocol Buffers.&lt;/p&gt;&#xA;&lt;h4 id=&#34;domain-driven-service-boundaries&#34;&gt;Domain-Driven Service Boundaries&lt;/h4&gt;&#xA;&lt;p&gt;When designing gRPC services, aligning service boundaries with domain contexts helps create cohesive, maintainable APIs:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-protobuf&#34; data-lang=&#34;protobuf&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// user_service.proto&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;syntax &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;proto3&amp;#34;&lt;/span&gt;;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;package&lt;/span&gt; user;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;option&lt;/span&gt; go_package &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;github.com/example/user&amp;#34;&lt;/span&gt;;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;import&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;google/protobuf/timestamp.proto&amp;#34;&lt;/span&gt;;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;service&lt;/span&gt; UserService {&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#75715e&#34;&gt;// User lifecycle operations&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;rpc&lt;/span&gt; CreateUser(CreateUserRequest) &lt;span style=&#34;color:#66d9ef&#34;&gt;returns&lt;/span&gt; (User);&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;rpc&lt;/span&gt; GetUser(GetUserRequest) &lt;span style=&#34;color:#66d9ef&#34;&gt;returns&lt;/span&gt; (User);&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;rpc&lt;/span&gt; UpdateUser(UpdateUserRequest) &lt;span style=&#34;color:#66d9ef&#34;&gt;returns&lt;/span&gt; (User);&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;rpc&lt;/span&gt; DeleteUser(DeleteUserRequest) &lt;span style=&#34;color:#66d9ef&#34;&gt;returns&lt;/span&gt; (DeleteUserResponse);&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#75715e&#34;&gt;// Domain-specific operations&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;rpc&lt;/span&gt; VerifyUserEmail(VerifyUserEmailRequest) &lt;span style=&#34;color:#66d9ef&#34;&gt;returns&lt;/span&gt; (VerifyUserEmailResponse);&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;rpc&lt;/span&gt; ResetPassword(ResetPasswordRequest) &lt;span style=&#34;color:#66d9ef&#34;&gt;returns&lt;/span&gt; (ResetPasswordResponse);&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#75715e&#34;&gt;// Batch operations for efficiency&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;rpc&lt;/span&gt; GetUsers(GetUsersRequest) &lt;span style=&#34;color:#66d9ef&#34;&gt;returns&lt;/span&gt; (GetUsersResponse);&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;}&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;message&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;User&lt;/span&gt; {&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;string&lt;/span&gt; id &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;string&lt;/span&gt; email &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;string&lt;/span&gt; display_name &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;3&lt;/span&gt;;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;bool&lt;/span&gt; email_verified &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;4&lt;/span&gt;;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;  google.protobuf.Timestamp created_at &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;  google.protobuf.Timestamp updated_at &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;6&lt;/span&gt;;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;}&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Other message definitions...&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;versioning-strategies&#34;&gt;Versioning Strategies&lt;/h4&gt;&#xA;&lt;p&gt;Proper versioning is crucial for maintaining backward compatibility while evolving your APIs:&lt;/p&gt;</description>
    </item>
    <item>
      <title>API Gateway to Inline Lambda in CloudFormation</title>
      <link>https://andrewodendaal.com/api-gateway-inline-lambda-cloudformation/</link>
      <pubDate>Thu, 15 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/api-gateway-inline-lambda-cloudformation/</guid>
      <description>&lt;p&gt;To connect an API Gateway to an inline Lambda function using CloudFormation, you can follow these steps:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Define your API Gateway and Lambda function resources in your CloudFormation template. Here&amp;rsquo;s an example:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;Resources&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyApiGateway&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::ApiGateway::RestApi&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Name&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;MyApiGateway&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyApiGatewayResource&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::ApiGateway::Resource&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;RestApiId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MyApiGateway&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;ParentId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;GetAtt MyApiGateway.RootResourceId&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;PathPart&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;myresource&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyApiGatewayMethod&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::ApiGateway::Method&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;RestApiId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MyApiGateway&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;ResourceId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MyApiGatewayResource&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;HttpMethod&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;GET&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;AuthorizationType&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;NONE&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Integration&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS_PROXY&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;IntegrationHttpMethod&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;POST&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;Uri&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Sub &amp;#34;arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:MyLambdaFunction/invocations&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyApiGatewayDeployment&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::ApiGateway::Deployment&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;RestApiId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MyApiGateway&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyApiGatewayStage&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::ApiGateway::Stage&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;StageName&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;prod&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;RestApiId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MyApiGateway&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;DeploymentId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MyApiGatewayDeployment&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyLambdaFunction&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::Lambda::Function&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;FunctionName&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;MyLambdaFunction&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Runtime&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;python3.8&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Handler&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;index.lambda_handler&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Code&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;ZipFile&lt;/span&gt;: |&lt;span style=&#34;color:#e6db74&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;          def lambda_handler(event, context):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;              return {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;                  &amp;#39;statusCode&amp;#39;: 200,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;                  &amp;#39;body&amp;#39;: &amp;#39;Hello from Lambda!&amp;#39;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;              }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the above example, the Lambda function is defined inline using the &lt;code&gt;ZipFile&lt;/code&gt; property. The code inside the &lt;code&gt;lambda_handler&lt;/code&gt; function can be customized according to your requirements.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to connect an API Gateway to Lambda in CloudFormation</title>
      <link>https://andrewodendaal.com/how-to-connect-an-api-gateway-to-lambda-in-cloudformation/</link>
      <pubDate>Wed, 14 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-connect-an-api-gateway-to-lambda-in-cloudformation/</guid>
      <description>&lt;p&gt;To connect an API Gateway to a Lambda function using CloudFormation, you can follow these steps:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Define your API Gateway and Lambda function resources in your CloudFormation template. Here&amp;rsquo;s an example:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;Resources&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyLambdaFunction&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::Lambda::Function&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;FunctionName&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;MyLambdaFunction&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Runtime&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;python3.8&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Handler&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;index.handler&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Code&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;S3Bucket&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;my-lambda-code-bucket&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;S3Key&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;lambda-code.zip&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyApiGateway&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::ApiGateway::RestApi&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Name&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;MyApiGateway&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start=&#34;2&#34;&gt;&#xA;&lt;li&gt;Create a resource of type &lt;code&gt;AWS::ApiGateway::Resource&lt;/code&gt; to define the resource path for your API Gateway:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyApiGatewayResource&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::ApiGateway::Resource&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;RestApiId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MyApiGateway&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;ParentId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;GetAtt MyApiGateway.RootResourceId&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;PathPart&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;myresource&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start=&#34;3&#34;&gt;&#xA;&lt;li&gt;Create a method on the resource to define the HTTP method (e.g., GET, POST) and integration details:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyApiGatewayMethod&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::ApiGateway::Method&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;RestApiId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MyApiGateway&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;ResourceId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MyApiGatewayResource&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;HttpMethod&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;GET&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;AuthorizationType&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;NONE&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Integration&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;IntegrationHttpMethod&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;POST&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;Uri&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Sub arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyLambdaFunction.Arn}/invocations&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the above example, the &lt;code&gt;Uri&lt;/code&gt; property references the ARN of the Lambda function.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Create DynamoDB Table &amp; Add Items using Python 3 from Lambda</title>
      <link>https://andrewodendaal.com/create-dynamodb-table-add-items-python-3-lambda/</link>
      <pubDate>Tue, 13 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/create-dynamodb-table-add-items-python-3-lambda/</guid>
      <description>&lt;p&gt;To create a DynamoDB table and add items to it using Python 3 from AWS Lambda, you can use the AWS SDK for Python, also known as Boto3. Here&amp;rsquo;s a step-by-step guide:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Set up your AWS environment:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Install Boto3 by running &lt;code&gt;pip install boto3&lt;/code&gt; in your local development environment.&lt;/li&gt;&#xA;&lt;li&gt;Set up your AWS credentials and configure your AWS CLI or environment variables. You can find detailed instructions in the AWS documentation.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;Create a Lambda function in the AWS Management Console:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Go to the AWS Management Console and navigate to the Lambda service.&lt;/li&gt;&#xA;&lt;li&gt;Click on &amp;ldquo;Create function&amp;rdquo; and follow the instructions to create a new Lambda function.&lt;/li&gt;&#xA;&lt;li&gt;Choose the desired runtime as Python 3.x.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;Write the Python code to create the DynamoDB table and add items:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In the Lambda function code editor, enter the following code:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; boto3&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;lambda_handler&lt;/span&gt;(event, context):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;# Create a DynamoDB client&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    dynamodb &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; boto3&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;client(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;dynamodb&amp;#39;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;# Define the table name and schema&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    table_name &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;YourTableName&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    table_schema &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; [&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;AttributeName&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;ID&amp;#39;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;AttributeType&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;N&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        },&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;AttributeName&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Name&amp;#39;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;AttributeType&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;S&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    ]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;# Create the DynamoDB table&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    dynamodb&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;create_table(&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        TableName&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;table_name,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        KeySchema&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;[&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;AttributeName&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;ID&amp;#39;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;KeyType&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;HASH&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        ],&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        AttributeDefinitions&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;table_schema,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        ProvisionedThroughput&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;ReadCapacityUnits&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;WriteCapacityUnits&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    )&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;# Wait for the table to be created&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    dynamodb&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;get_waiter(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;table_exists&amp;#39;&lt;/span&gt;)&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;wait(TableName&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;table_name)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;# Add items to the table&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    items &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; [&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;ID&amp;#39;&lt;/span&gt;: {&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;N&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;1&amp;#39;&lt;/span&gt;},&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Name&amp;#39;&lt;/span&gt;: {&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;S&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Item 1&amp;#39;&lt;/span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        },&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;ID&amp;#39;&lt;/span&gt;: {&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;N&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;2&amp;#39;&lt;/span&gt;},&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Name&amp;#39;&lt;/span&gt;: {&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;S&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Item 2&amp;#39;&lt;/span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    ]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;with&lt;/span&gt; dynamodb&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;batch_writer(TableName&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;table_name) &lt;span style=&#34;color:#66d9ef&#34;&gt;as&lt;/span&gt; batch:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; item &lt;span style=&#34;color:#f92672&#34;&gt;in&lt;/span&gt; items:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            batch&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;put_item(Item&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;item)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;statusCode&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;200&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;body&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;DynamoDB table created and items added successfully.&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start=&#34;4&#34;&gt;&#xA;&lt;li&gt;Configure the Lambda function:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In the AWS Lambda function configuration, specify the following:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Handler: Enter the name of the Python file and the lambda_handler function. For example, &lt;code&gt;filename.lambda_handler&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Runtime: Python 3.x.&lt;/li&gt;&#xA;&lt;li&gt;Timeout: Set an appropriate timeout based on the expected execution time of your code.&lt;/li&gt;&#xA;&lt;li&gt;Role: Choose or create an execution role with appropriate DynamoDB permissions.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;Save and test the Lambda function:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Save the Lambda function by clicking on the &amp;ldquo;Save&amp;rdquo; button.&lt;/li&gt;&#xA;&lt;li&gt;Test the function by clicking on the &amp;ldquo;Test&amp;rdquo; button and configuring a test event.&lt;/li&gt;&#xA;&lt;li&gt;Monitor the execution logs and check for any errors or exceptions.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;When you invoke the Lambda function, it will create a DynamoDB table with the specified schema and add the items to it using a batch write operation. Make sure to replace &lt;code&gt;&#39;YourTableName&#39;&lt;/code&gt; with the desired name for your DynamoDB table.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create a Site-to-Site VPN in Boto3 Python</title>
      <link>https://andrewodendaal.com/how-to-create-a-site-to-site-vpn-in-boto3-python/</link>
      <pubDate>Mon, 12 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-site-to-site-vpn-in-boto3-python/</guid>
      <description>&lt;p&gt;To create a site-to-site VPN using the Boto3 library in Python, you can utilize the &lt;code&gt;boto3.client(&#39;ec2&#39;)&lt;/code&gt; client to interact with the AWS EC2 service. Here&amp;rsquo;s an example code snippet to create a site-to-site VPN:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; boto3&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ec2_client &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; boto3&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;client(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;ec2&amp;#39;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Create VPN Gateway&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;vpn_gateway_response &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; ec2_client&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;create_vpn_gateway(Type&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;ipsec.1&amp;#39;&lt;/span&gt;, TagSpecifications&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;[{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;ResourceType&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;vpn-gateway&amp;#39;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Tags&amp;#39;&lt;/span&gt;: [{&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Key&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Name&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Value&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;SiteToSiteVPN&amp;#39;&lt;/span&gt;}]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}])&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;vpn_gateway_id &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; vpn_gateway_response[&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;VpnGateway&amp;#39;&lt;/span&gt;][&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;VpnGatewayId&amp;#39;&lt;/span&gt;]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Create VPN Connection&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;vpn_connection_response &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; ec2_client&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;create_vpn_connection(&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    Type&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;ipsec.1&amp;#39;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    CustomerGatewayId&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&amp;lt;CUSTOMER_GATEWAY_ID&amp;gt;&amp;#39;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    VpnGatewayId&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;vpn_gateway_id,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    Options&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;StaticRoutesOnly&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;True&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    },&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    TagSpecifications&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;[{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;ResourceType&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;vpn-connection&amp;#39;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Tags&amp;#39;&lt;/span&gt;: [{&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Key&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Name&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Value&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;SiteToSiteVPNConnection&amp;#39;&lt;/span&gt;}]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;vpn_connection_id &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; vpn_connection_response[&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;VpnConnection&amp;#39;&lt;/span&gt;][&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;VpnConnectionId&amp;#39;&lt;/span&gt;]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Create VPN Connection Route&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ec2_client&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;create_vpn_connection_route(&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    DestinationCidrBlock&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&amp;lt;DESTINATION_CIDR_BLOCK&amp;gt;&amp;#39;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    VpnConnectionId&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;vpn_connection_id&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the above code, you need to replace &lt;code&gt;&amp;lt;CUSTOMER_GATEWAY_ID&amp;gt;&lt;/code&gt; with the ID of the customer gateway representing the remote site, and &lt;code&gt;&amp;lt;DESTINATION_CIDR_BLOCK&amp;gt;&lt;/code&gt; with the CIDR block of the remote network you want to connect to.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create a Site-to-Site VPN in Terraform</title>
      <link>https://andrewodendaal.com/how-to-create-a-site-to-site-vpn-in-terraform/</link>
      <pubDate>Sun, 11 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-site-to-site-vpn-in-terraform/</guid>
      <description>&lt;p&gt;To create a site-to-site VPN using Terraform, you can use the &lt;code&gt;aws_vpn_gateway&lt;/code&gt; and &lt;code&gt;aws_vpn_connection&lt;/code&gt; resources from the AWS provider. Here&amp;rsquo;s an example Terraform configuration to create a site-to-site VPN:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-terraform&#34; data-lang=&#34;terraform&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_vpn_gateway&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;vpn_gateway&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;vpc_id&lt;/span&gt;       &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;lt;VPC_ID&amp;gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;tags&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Name&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;SiteToSiteVPN&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_vpn_connection&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;vpn_connection&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;customer_gateway_id&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;lt;CUSTOMER_GATEWAY_ID&amp;gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;vpn_gateway_id&lt;/span&gt;     &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;aws_vpn_gateway&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;vpn_gateway&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;id&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;type&lt;/span&gt;               &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;ipsec.1&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;static_routes_only&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;tags&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Name&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;SiteToSiteVPNConnection&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_vpn_connection_route&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;vpn_connection_route&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;destination_cidr_block&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;lt;DESTINATION_CIDR_BLOCK&amp;gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;vpn_connection_id&lt;/span&gt;     &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;aws_vpn_connection&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;vpn_connection&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;id&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the above Terraform configuration, you need to replace &lt;code&gt;&amp;lt;VPC_ID&amp;gt;&lt;/code&gt; with the ID of the VPC where the VPN gateway will be attached, &lt;code&gt;&amp;lt;CUSTOMER_GATEWAY_ID&amp;gt;&lt;/code&gt; with the ID of the customer gateway representing the remote site, and &lt;code&gt;&amp;lt;DESTINATION_CIDR_BLOCK&amp;gt;&lt;/code&gt; with the CIDR block of the remote network you want to connect to.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create a Site-to-Site VPN in CloudFormation</title>
      <link>https://andrewodendaal.com/how-to-create-a-site-to-site-vpn-in-cloudformation/</link>
      <pubDate>Sat, 10 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-site-to-site-vpn-in-cloudformation/</guid>
      <description>&lt;p&gt;To create a site-to-site VPN (Virtual Private Network) using AWS CloudFormation, you can use the &lt;code&gt;AWS::EC2::VPNGateway&lt;/code&gt; and &lt;code&gt;AWS::EC2::VPNConnection&lt;/code&gt; resources. Here&amp;rsquo;s an example CloudFormation template to create a site-to-site VPN:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;AWSTemplateFormatVersion&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;2010-09-09&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;Resources&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;VpnGateway&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::EC2::VPNGateway&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;ipsec.1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Tags&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        - &lt;span style=&#34;color:#f92672&#34;&gt;Key&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;Name&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;Value&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;SiteToSiteVPN&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;VpnConnection&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::EC2::VPNConnection&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;ipsec.1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;CustomerGatewayId&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;&amp;lt;CUSTOMER_GATEWAY_ID&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;VpnGatewayId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref VpnGateway&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;StaticRoutesOnly&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Tags&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        - &lt;span style=&#34;color:#f92672&#34;&gt;Key&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;Name&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;Value&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;SiteToSiteVPNConnection&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;VpnConnectionRoute&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::EC2::VPNConnectionRoute&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;DestinationCidrBlock&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;&amp;lt;DESTINATION_CIDR_BLOCK&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;VpnConnectionId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref VpnConnection&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the above template, you need to replace &lt;code&gt;&amp;lt;CUSTOMER_GATEWAY_ID&amp;gt;&lt;/code&gt; with the ID of the customer gateway representing the remote site, and &lt;code&gt;&amp;lt;DESTINATION_CIDR_BLOCK&amp;gt;&lt;/code&gt; with the CIDR block of the remote network you want to connect to.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to AWS sts assume role in one command - without jq</title>
      <link>https://andrewodendaal.com/how-to-aws-sts-assume-role-in-one-command-without-jq/</link>
      <pubDate>Fri, 09 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-aws-sts-assume-role-in-one-command-without-jq/</guid>
      <description>&lt;h2 id=&#34;the-issue---what-it-takes-to-assume-a-role&#34;&gt;The issue - what it takes to assume a role&lt;/h2&gt;&#xA;&lt;p&gt;To assume an AWS role in the CLI, you will have to do something like this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;aws sts assume-role --role-arn arn:aws:iam::123456789123:role/myAwesomeRole --role-session-name test --region eu-central-1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will give you the following output:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-json&#34; data-lang=&#34;json&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;Credentials&amp;#34;&lt;/span&gt;: {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;AccessKeyId&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;someAccessKeyId&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;SecretAccessKey&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;someSecretAccessKey&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;SessionToken&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;someSessionToken&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;Expiration&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;20203-01-02T06:52:13+00:00&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    },&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;AssumedRoleUser&amp;#34;&lt;/span&gt;: {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;AssumedRoleId&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;idOfTheAssummedRole&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;Arn&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;theARNOfTheRoleIWantToAssume&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But then you will have to manually copy and paste the values of &lt;code&gt;AccessKeyId&lt;/code&gt;, &lt;code&gt;SecretAccessKey&lt;/code&gt; and &lt;code&gt;SessionToken&lt;/code&gt; in a bunch of exports like this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create a Lambda in CloudFormation</title>
      <link>https://andrewodendaal.com/how-to-create-a-lambda-in-cloudformation/</link>
      <pubDate>Wed, 07 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-lambda-in-cloudformation/</guid>
      <description>&lt;p&gt;You can create a Lambda in CloudFormation as follows:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1---inline-code&#34;&gt;Option 1 - Inline code&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;Resources&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyLambdaFunction&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::Lambda::Function&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;FunctionName&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;MyLambdaFunction&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Runtime&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;python3.8&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Handler&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;index.lambda_handler&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Code&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;ZipFile&lt;/span&gt;: |&lt;span style=&#34;color:#e6db74&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;          import json&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;          def lambda_handler(event, context):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;              # Your Lambda function code here&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;              return {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;                  &amp;#39;statusCode&amp;#39;: 200,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;                  &amp;#39;body&amp;#39;: json.dumps(&amp;#39;Hello from Lambda!&amp;#39;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;              }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Role&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;GetAtt MyLambdaExecutionRole.Arn&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In this example, instead of specifying the &lt;code&gt;S3Bucket&lt;/code&gt; and &lt;code&gt;S3Key&lt;/code&gt; properties under the &lt;code&gt;Code&lt;/code&gt; section, you use the &lt;code&gt;ZipFile&lt;/code&gt; property to provide the actual code as a multiline string. The code is written in Python and includes a simple Lambda handler function.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create a Lambda in Terraform</title>
      <link>https://andrewodendaal.com/how-to-create-a-lambda-in-terraform/</link>
      <pubDate>Wed, 07 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-lambda-in-terraform/</guid>
      <description>&lt;p&gt;To create an AWS Lambda function using Terraform, you need to define the necessary resources in a Terraform configuration file. Here&amp;rsquo;s an example of how you can create a Lambda function using Terraform:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1---seperate-lambda-source&#34;&gt;Option 1 - Seperate Lambda Source&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Create a new directory for your Terraform configuration and navigate to it in your terminal.&lt;/li&gt;&#xA;&lt;li&gt;Create a new file with a &lt;code&gt;.tf&lt;/code&gt; extension, such as &lt;code&gt;lambda.tf&lt;/code&gt;, and open it in a text editor.&lt;/li&gt;&#xA;&lt;li&gt;In the lambda.tf file, add the following code:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-terraform&#34; data-lang=&#34;terraform&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;provider&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;region&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;us-east-1&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;  # Replace with your desired AWS region&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_lambda_function&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;my_lambda&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;function_name&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;my-lambda-function&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;role&lt;/span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;aws_iam_role&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;lambda_role&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;arn&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;handler&lt;/span&gt;       &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;index.handler&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;runtime&lt;/span&gt;       &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;nodejs14.x&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;  # Replace with your desired runtime&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;  // Replace with the path to your Lambda function code&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;filename&lt;/span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;path/to/lambda/code.zip&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;  // Replace with the appropriate values for your Lambda function&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;environment&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;variables&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#a6e22e&#34;&gt;KEY&lt;/span&gt;   &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;VALUE&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#a6e22e&#34;&gt;KEY2&lt;/span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;VALUE2&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_iam_role&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;lambda_role&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;my-lambda-role&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;assume_role_policy&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&amp;lt;EOF&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;  &amp;#34;Version&amp;#34;: &amp;#34;2012-10-17&amp;#34;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;  &amp;#34;Statement&amp;#34;: [&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;      &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;      &amp;#34;Principal&amp;#34;: {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;        &amp;#34;Service&amp;#34;: &amp;#34;lambda.amazonaws.com&amp;#34;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;      },&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;      &amp;#34;Action&amp;#34;: &amp;#34;sts:AssumeRole&amp;#34;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;  ]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;EOF&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_iam_role_policy_attachment&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;lambda_policy_attachment&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;role&lt;/span&gt;       &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;aws_iam_role&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;lambda_role&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;policy_arn&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start=&#34;4&#34;&gt;&#xA;&lt;li&gt;In the above code, you can customize the following parts:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;region&lt;/code&gt;: Specify the AWS region where you want to create the Lambda function.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;runtime&lt;/code&gt;: Specify the runtime environment for your Lambda function (e.g., &lt;code&gt;nodejs14.x&lt;/code&gt;, &lt;code&gt;python3.8&lt;/code&gt;, etc.).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;filename&lt;/code&gt;: Update the path to your Lambda function code. Ensure that the code is packaged in a ZIP file.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;You can also modify the environment variables section (&lt;code&gt;KEY&lt;/code&gt; and &lt;code&gt;VALUE&lt;/code&gt;) according to your requirements.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create a Bastion server in Terraform</title>
      <link>https://andrewodendaal.com/how-to-create-a-bastion-server-in-terraform/</link>
      <pubDate>Tue, 06 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-bastion-server-in-terraform/</guid>
      <description>&lt;p&gt;To create a Bastion server using Terraform, you need to define the necessary resources in a Terraform configuration file. Here&amp;rsquo;s an example of how you can create a Bastion server using Terraform:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-terraform&#34; data-lang=&#34;terraform&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Define the security group&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_security_group&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;bastion_sg&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;bastion-security-group&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;description&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Bastion Security Group&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;ingress&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;from_port&lt;/span&gt;   &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;22&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;to_port&lt;/span&gt;     &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;22&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;protocol&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;tcp&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;cidr_blocks&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; [&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;0.0.0.0/0&amp;#34;&lt;/span&gt;]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;vpc_id&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;your-vpc-id&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Define the Bastion instance&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_instance&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;bastion_instance&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;ami&lt;/span&gt;           &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;your-ami-id&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;instance_type&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;t2.micro&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;  # Update with the desired instance type&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;key_name&lt;/span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;your-key-pair-name&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;security_group_ids&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; [&lt;span style=&#34;color:#a6e22e&#34;&gt;aws_security_group&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;bastion_sg&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;id&lt;/span&gt;]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;user_data&lt;/span&gt;     &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&amp;lt;-EOF&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    #!/bin/bash&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    echo &amp;#34;AllowTcpForwarding yes&amp;#34; &amp;gt;&amp;gt; /etc/ssh/sshd_config&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    service sshd restart&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    iptables -t nat -A PREROUTING -p tcp --dport 22 -j REDIRECT --to-port 2222&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    iptables-save &amp;gt; /etc/sysconfig/iptables&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    systemctl enable iptables&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    systemctl restart iptables&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;EOF&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Allocate an Elastic IP and associate it with the Bastion instance&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_eip&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;bastion_eip&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;instance&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;aws_instance&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;bastion_instance&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;id&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the Terraform configuration:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create a Bastion server in CloudFormation</title>
      <link>https://andrewodendaal.com/how-to-create-a-bastion-server-in-cloudformation/</link>
      <pubDate>Mon, 05 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-bastion-server-in-cloudformation/</guid>
      <description>&lt;p&gt;To create a Bastion server using AWS CloudFormation, you need to define the necessary resources in a CloudFormation template. Here&amp;rsquo;s an example of how you can create a Bastion server using CloudFormation:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;AWSTemplateFormatVersion&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;2010-09-09&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;Resources&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;BastionSecurityGroup&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::EC2::SecurityGroup&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;GroupDescription&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;Bastion Security Group&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;SecurityGroupIngress&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        - &lt;span style=&#34;color:#f92672&#34;&gt;IpProtocol&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;tcp&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;FromPort&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;22&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;ToPort&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;22&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;CidrIp&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;0.0.0.0&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;/0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;VpcId&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;your-vpc-id&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;BastionInstance&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::EC2::Instance&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;ImageId&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;your-ami-id&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;InstanceType&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;t2.micro&amp;#34;&lt;/span&gt;  &lt;span style=&#34;color:#75715e&#34;&gt;# Update with the desired instance type&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;SecurityGroupIds&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        - !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref BastionSecurityGroup&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;KeyName&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;your-key-pair-name&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;UserData&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;Fn::Base64&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Sub |&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#75715e&#34;&gt;#!/bin/bash&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#ae81ff&#34;&gt;echo &amp;#34;AllowTcpForwarding yes&amp;#34; &amp;gt;&amp;gt; /etc/ssh/sshd_config&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#ae81ff&#34;&gt;service sshd restart&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#ae81ff&#34;&gt;iptables -t nat -A PREROUTING -p tcp --dport 22 -j REDIRECT --to-port 2222&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#ae81ff&#34;&gt;iptables-save &amp;gt; /etc/sysconfig/iptables&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#ae81ff&#34;&gt;systemctl enable iptables&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#ae81ff&#34;&gt;systemctl restart iptables&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;BastionEIP&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::EC2::EIP&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;InstanceId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref BastionInstance&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the CloudFormation template:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to you create a Cross Account Role in Terraform</title>
      <link>https://andrewodendaal.com/how-to-you-create-a-cross-account-role-in-terraform/</link>
      <pubDate>Sun, 04 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-you-create-a-cross-account-role-in-terraform/</guid>
      <description>&lt;p&gt;To create a cross-account role in Terraform, you need to perform the following steps:&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-define-the-iam-role&#34;&gt;1. Define the IAM role&lt;/h2&gt;&#xA;&lt;p&gt;Define the IAM role in the Terraform configuration&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-terraform&#34; data-lang=&#34;terraform&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_iam_role&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;cross_account_role&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;               &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;CrossAccountRole&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;assume_role_policy&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&amp;lt;EOF&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;  &amp;#34;Version&amp;#34;: &amp;#34;2012-10-17&amp;#34;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;  &amp;#34;Statement&amp;#34;: [&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;      &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;      &amp;#34;Principal&amp;#34;: {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;        &amp;#34;AWS&amp;#34;: &amp;#34;arn:aws:iam::&amp;lt;ACCOUNT_ID&amp;gt;:root&amp;#34;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;      },&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;      &amp;#34;Action&amp;#34;: &amp;#34;sts:AssumeRole&amp;#34;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;  ]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;EOF&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the &lt;code&gt;assume_role_policy&lt;/code&gt; section, replace &lt;code&gt;&amp;lt;ACCOUNT_ID&amp;gt;&lt;/code&gt; with the AWS account ID of the target account that will assume this role.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to you create a Cross Account Role in CloudFormation</title>
      <link>https://andrewodendaal.com/how-to-you-create-a-cross-account-role-in-cloudformation/</link>
      <pubDate>Sat, 03 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-you-create-a-cross-account-role-in-cloudformation/</guid>
      <description>&lt;p&gt;To create a cross-account role in CloudFormation, you can follow these steps:&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-create-a-cloudformation-template&#34;&gt;1. Create a CloudFormation template&lt;/h2&gt;&#xA;&lt;p&gt;Create a new CloudFormation template in YAML or JSON format. This template will define the resources, including the cross-account role, that you want to create.&lt;/p&gt;&#xA;&lt;h2 id=&#34;2-define-the-cross-account-role&#34;&gt;2. Define the cross-account role&lt;/h2&gt;&#xA;&lt;p&gt;Within your CloudFormation template, define the cross-account role using the &lt;code&gt;AWS::IAM::Role&lt;/code&gt; resource type. Specify the necessary properties such as &lt;code&gt;RoleName&lt;/code&gt;, &lt;code&gt;AssumeRolePolicyDocument&lt;/code&gt;, and &lt;code&gt;ManagedPolicyArns&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create Public and Private Subnets in CloudFormation</title>
      <link>https://andrewodendaal.com/how-to-create-public-and-private-subnets-in-cloudformation/</link>
      <pubDate>Fri, 02 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-public-and-private-subnets-in-cloudformation/</guid>
      <description>&lt;p&gt;To create public and private subnets in AWS CloudFormation, you can use the AWS CloudFormation Template Language (CFT) to define your network configuration. Here&amp;rsquo;s an example CloudFormation template that demonstrates how to create public and private subnets within a Virtual Private Cloud (VPC) in AWS:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;Resources&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyVPC&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::EC2::VPC&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;CidrBlock&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;10.0.0.0&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;/16&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Tags&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        - &lt;span style=&#34;color:#f92672&#34;&gt;Key&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;Name&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;Value&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;my-vpc&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;PublicSubnet&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::EC2::Subnet&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;VpcId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MyVPC&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;CidrBlock&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;10.0.0.0&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;/24&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;AvailabilityZone&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;us-west-2a&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Tags&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        - &lt;span style=&#34;color:#f92672&#34;&gt;Key&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;Name&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;Value&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;public-subnet&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;PrivateSubnet&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::EC2::Subnet&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;VpcId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MyVPC&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;CidrBlock&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;10.0.1.0&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;/24&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;AvailabilityZone&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;us-west-2b&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;Tags&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        - &lt;span style=&#34;color:#f92672&#34;&gt;Key&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;Name&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;Value&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;private-subnet&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In this example, the &lt;code&gt;AWS::EC2::VPC&lt;/code&gt; resource creates a VPC with the specified CIDR block. The &lt;code&gt;AWS::EC2::Subnet&lt;/code&gt; resources create the public and private subnets within the VPC, using different CIDR blocks and availability zones.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create Public and Private Subnets in Terraform</title>
      <link>https://andrewodendaal.com/how-to-create-public-and-private-subnets-in-terraform/</link>
      <pubDate>Thu, 01 Jun 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-public-and-private-subnets-in-terraform/</guid>
      <description>&lt;p&gt;To create public and private subnets in Terraform, you can use the AWS provider to define your network configuration. Here&amp;rsquo;s an example configuration that demonstrates how to create public and private subnets within a Virtual Private Cloud (VPC) in AWS:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-terraform&#34; data-lang=&#34;terraform&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Define your AWS provider configuration&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;provider&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;region&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;us-west-2&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;  # Update with your desired region&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;}&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Create the VPC&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_vpc&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;my_vpc&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;cidr_block&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;10.0.0.0/16&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;  # Update with your desired VPC CIDR block&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;tags&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Name&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;my-vpc&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Create the public subnet&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_subnet&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;public_subnet&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;vpc_id&lt;/span&gt;            &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;aws_vpc&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;my_vpc&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;id&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;cidr_block&lt;/span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;10.0.0.0/24&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;  # Update with your desired public subnet CIDR block&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;availability_zone&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;us-west-2a&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;  # Update with your desired availability zone&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;tags&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Name&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;public-subnet&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Create the private subnet&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_subnet&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;private_subnet&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;vpc_id&lt;/span&gt;            &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;aws_vpc&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;my_vpc&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;id&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;cidr_block&lt;/span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;10.0.1.0/24&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;  # Update with your desired private subnet CIDR block&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;availability_zone&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;us-west-2b&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;  # Update with your desired availability zone&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;tags&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Name&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;private-subnet&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In this example, the &lt;code&gt;aws_vpc&lt;/code&gt; resource creates a VPC with the specified CIDR block. The &lt;code&gt;aws_subnet&lt;/code&gt; resources create the public and private subnets within the VPC, using different CIDR blocks and availability zones.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Create Internet Gateway &amp; Assign to EC2 in CloudFormation</title>
      <link>https://andrewodendaal.com/create-internet-gateway-assign-ec2-cloudformation/</link>
      <pubDate>Wed, 31 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/create-internet-gateway-assign-ec2-cloudformation/</guid>
      <description>&lt;p&gt;To create an Internet Gateway and associate it with an EC2 instance using AWS CloudFormation, you can follow these steps:&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-create-a-cloudformation-template&#34;&gt;Step 1: Create a CloudFormation template&lt;/h2&gt;&#xA;&lt;p&gt;Create a new YAML or JSON file with a &lt;code&gt;.yaml&lt;/code&gt; or &lt;code&gt;.json&lt;/code&gt; extension (e.g., &lt;code&gt;template.yaml&lt;/code&gt;), and add the following contents:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;AWSTemplateFormatVersion&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;2010-09-09&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;Resources&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyVPC&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::EC2::VPC&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;CidrBlock&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;10.0.0.0&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;/16 &lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;# Replace with your desired VPC CIDR block&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyInternetGateway&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::EC2::InternetGateway&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyVPCGatewayAttachment&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::EC2::VPCGatewayAttachment&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;VpcId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MyVPC&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;InternetGatewayId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MyInternetGateway&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MySubnet&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::EC2::Subnet&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;VpcId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MyVPC&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;CidrBlock&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;10.0.0.0&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;/24 &lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;# Replace with your desired subnet CIDR block&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;AvailabilityZone&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;us-west-2a &lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;# Replace with your desired availability zone&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyRouteTable&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::EC2::RouteTable&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;VpcId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MyVPC&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyDefaultRoute&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::EC2::Route&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;DependsOn&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;MyVPCGatewayAttachment&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;RouteTableId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MyRouteTable&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;DestinationCidrBlock&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;0.0.0.0&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;/0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;GatewayId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MyInternetGateway&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;MyEC2Instance&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;AWS::EC2::Instance&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;Properties&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;ImageId&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;ami-0123456789abcdef0 &lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;# Replace with your desired AMI ID&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;InstanceType&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;t2.micro &lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;# Replace with your desired instance type&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;SubnetId&lt;/span&gt;: !&lt;span style=&#34;color:#ae81ff&#34;&gt;Ref MySubnet&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Make sure to replace the placeholder values (&lt;code&gt;CidrBlock&lt;/code&gt;, &lt;code&gt;AvailabilityZone&lt;/code&gt;, &lt;code&gt;ImageId&lt;/code&gt;, etc.) with your desired values.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Create Internet Gateway &amp; Assign to EC2 in Terraform</title>
      <link>https://andrewodendaal.com/create-internet-gateway-assign-ec2-terraform/</link>
      <pubDate>Tue, 30 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/create-internet-gateway-assign-ec2-terraform/</guid>
      <description>&lt;p&gt;To create an Internet gateway and assign it to an EC2 instance using Terraform, you can follow these steps:&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-set-up-your-terraform-environment&#34;&gt;Step 1: Set up your Terraform environment&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install Terraform: Download and install Terraform from the official website (&lt;a href=&#34;https://www.terraform.io/downloads.html&#34;&gt;https://www.terraform.io/downloads.html&lt;/a&gt;) based on your operating system.&lt;/li&gt;&#xA;&lt;li&gt;Configure AWS credentials: Set up your AWS access key and secret access key as environment variables or use an AWS profile configured on your system.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;step-2-create-a-terraform-configuration-file&#34;&gt;Step 2: Create a Terraform configuration file&lt;/h2&gt;&#xA;&lt;p&gt;Create a new file with a &lt;code&gt;.tf&lt;/code&gt; extension (e.g., &lt;code&gt;main.tf&lt;/code&gt;) and add the following contents:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to configure Terraform to use Local Providers from Nexus</title>
      <link>https://andrewodendaal.com/how-to-configure-terraform-to-use-local-providers-from-nexus/</link>
      <pubDate>Mon, 29 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-configure-terraform-to-use-local-providers-from-nexus/</guid>
      <description>&lt;p&gt;If your organization has blocked &lt;code&gt;registry.terraform.io&lt;/code&gt; and has instead downloaded the provider binaries to Nexus, then you can do the following to still make your Terraform execute correctly.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1---download-the-required-providers&#34;&gt;Step 1 - Download the Required Providers&lt;/h2&gt;&#xA;&lt;p&gt;In our example, we need the following providers:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;AWS&lt;/li&gt;&#xA;&lt;li&gt;Archive&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;These commands below are running directly from the pipeline that executes the Terraform:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Download the providers from the Nexus repository&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;- curl -u &lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;Nexus_REPO_USER&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;:&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;Nexus_REPO_PASS&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt; -o terraform-provider-aws4.65.0linuxamd64.zip https://nexus.example.com/repository/some-local-mirror/registry.terraform.io/hashicorp/aws/terraform-provider-aws_4.65.0_linux_amd64.zip&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;- curl -u &lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;Nexus_REPO_USER&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;:&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;Nexus_REPO_PASS&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt; -o terraform-provider-archive_2.3.0_linux_amd64.zip https://nexus.example.com/repository/local-mirror/registry.terraform.io/hashicorp/archive/terraform-provider-archive_2.3.0_linux_amd64.zip&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Make a local directory to store these providers&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;- mkdir -p $HOME/.terraform.d/plugins/registry.terraform.io/hashicorp/aws/&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;- mkdir -p $HOME/.terraform.d/plugins/registry.terraform.io/hashicorp/archive/&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Move the downloaded zip files to these directories&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;- mv terraform-provider-aws_4.65.0_linux_amd64.zip $HOME/.terraform.d/plugins/registry.terraform.io/hashicorp/aws/&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;- mv terraform-provider-archive_2.3.0_linux_amd64.zip $HOME/.terraform.d/plugins/registry.terraform.io/hashicorp/archive/&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Give the permissions (not always required)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;- chmod &lt;span style=&#34;color:#ae81ff&#34;&gt;777&lt;/span&gt; -R $HOME/.terraform.d/plugins/&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;step-2---run-the-terraform-code-with-a-plugin-directory&#34;&gt;Step 2 - Run the Terraform code with a Plugin Directory&lt;/h2&gt;&#xA;&lt;p&gt;The following code continues the pipeline from above where we left off:&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] Fargate Can&#39;t Read Secrets from Secret Manager</title>
      <link>https://andrewodendaal.com/solved-fargate-read-secrets-secret-manager/</link>
      <pubDate>Sun, 28 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/solved-fargate-read-secrets-secret-manager/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;re running a Fargate task and it&amp;rsquo;s not able to read secrets from AWS Secret Manager, there are a few things you can check:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Verify that the Fargate task has the correct IAM permissions to access the secret. You need to grant the task the secretsmanager:GetSecretValue permission for the specific secret that it needs to access. You can do this by adding the necessary permission to the task execution role, or by creating a separate IAM role and attaching it to the task.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Golang vs Python: The Ultimate Battle in DevOps</title>
      <link>https://andrewodendaal.com/golang-vs-python-the-ultimate-battle-in-devops/</link>
      <pubDate>Sat, 27 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/golang-vs-python-the-ultimate-battle-in-devops/</guid>
      <description>&lt;p&gt;In the world of DevOps, two programming languages are often pitted against each other: Golang and Python. Both languages have their own strengths and weaknesses, and choosing the right one for your DevOps needs can be a tough decision. In this blog post, we will take a closer look at Golang and Python, and compare their capabilities in the DevOps landscape.&lt;/p&gt;&#xA;&lt;h2 id=&#34;golang&#34;&gt;Golang&lt;/h2&gt;&#xA;&lt;p&gt;Golang is a language that has gained immense popularity in recent years, especially in the field of DevOps. One of the key reasons behind its success is its simplicity, which makes it easier to learn and use. The language was designed to be fast, efficient, and reliable, with a focus on minimizing dependencies and maximizing performance. Golang&amp;rsquo;s popularity in the DevOps landscape is due to its ability to build high-performance, networked services and web applications with ease.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Why DevOps and Python are Amazing Together</title>
      <link>https://andrewodendaal.com/why-devops-and-python-are-amazing-together/</link>
      <pubDate>Fri, 26 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/why-devops-and-python-are-amazing-together/</guid>
      <description>&lt;p&gt;In today&amp;rsquo;s software development world, DevOps and Python are two of the most essential elements for building high-quality software. DevOps has transformed the way software is developed, tested, and deployed, while Python has become a popular programming language for automation and scripting.&lt;/p&gt;&#xA;&lt;p&gt;The combination of DevOps and Python is particularly powerful because it provides developers with the necessary tools to automate, test, and deploy software efficiently. Here are some of the reasons why DevOps and Python are such a great match:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python &amp; DevOps: Transforming Software Development</title>
      <link>https://andrewodendaal.com/python-devops-transforming-software-development/</link>
      <pubDate>Thu, 25 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/python-devops-transforming-software-development/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction:&lt;/h2&gt;&#xA;&lt;p&gt;In recent years, the software industry has witnessed a remarkable shift towards DevOps and Python. DevOps has become a vital part of software development, and Python is now one of the most popular programming languages used by developers. In this blog post, we&amp;rsquo;ll explore why DevOps and Python are so amazing together, and how they can help revolutionize software development.&lt;/p&gt;&#xA;&lt;h2 id=&#34;devops-a-game-changer-in-software-development&#34;&gt;DevOps: A Game Changer in Software Development&lt;/h2&gt;&#xA;&lt;p&gt;DevOps is a software development methodology that aims to bridge the gap between development and operations teams. It involves collaboration, automation, and continuous delivery of software. DevOps practices have gained popularity in recent years due to their ability to improve the efficiency, quality, and speed of software development.&lt;/p&gt;</description>
    </item>
    <item>
      <title>DevOps: The Ultimate Secret Weapon for High-Tech Success</title>
      <link>https://andrewodendaal.com/devops-ultimate-secret-weapon-high-tech-success/</link>
      <pubDate>Wed, 24 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/devops-ultimate-secret-weapon-high-tech-success/</guid>
      <description>&lt;p&gt;DevOps has been a buzzword in the tech industry for some time now. While some companies have embraced the DevOps methodology, others are still lagging behind. If you&amp;rsquo;re wondering what all the hype is about and why DevOps is so amazing, then read on! Here are ten reasons why DevOps is the ultimate secret weapon for high-tech success.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-improved-collaboration-and-communication&#34;&gt;1. Improved Collaboration and Communication&lt;/h2&gt;&#xA;&lt;p&gt;Improved collaboration and communication are critical benefits of DevOps that can have a significant impact on the success of software development projects. In traditional software development approaches, different teams often work in silos, with little communication or coordination between them. This can lead to delays, misunderstandings, and errors.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Deploy a Java Application in AWS ECS using Terraform</title>
      <link>https://andrewodendaal.com/how-to-deploy-a-java-application-in-aws-ecs-using-terraform/</link>
      <pubDate>Tue, 23 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-deploy-a-java-application-in-aws-ecs-using-terraform/</guid>
      <description>&lt;p&gt;In order to deploy a Java application into AWS ECS (Elastic Container Service) using Terraform, we need to consider a few different things.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1---java-application&#34;&gt;Step 1 - Java Application&lt;/h2&gt;&#xA;&lt;p&gt;Create a file called &lt;code&gt;HelloWorld.java&lt;/code&gt; and add the following code to it:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;class&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;HelloWorld&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;static&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;void&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;main&lt;/span&gt;(String&lt;span style=&#34;color:#f92672&#34;&gt;[]&lt;/span&gt; args) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        System.&lt;span style=&#34;color:#a6e22e&#34;&gt;out&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;println&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Hello, World!&amp;#34;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We now need to build our class as follows:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;javac HelloWorld.java&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once this is done, we can package our application into a &lt;code&gt;jar&lt;/code&gt; file:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to set the Hostname on a Linux server with Terraform</title>
      <link>https://andrewodendaal.com/how-to-set-the-hostname-on-a-linux-server-with-terraform/</link>
      <pubDate>Mon, 22 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-set-the-hostname-on-a-linux-server-with-terraform/</guid>
      <description>&lt;p&gt;If you need to set the hostname on a linux server, and you are using Terraform, then you can do the following:&lt;/p&gt;&#xA;&lt;p&gt;Include the &lt;code&gt;provisioner&lt;/code&gt; block and set it to &lt;code&gt;remote-exec&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-terraform&#34; data-lang=&#34;terraform&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;provisioner&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;remote-exec&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;inline&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; [&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;sudo hostnamectl set-hostname friendly.example.com&amp;#34;&lt;/span&gt;]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>Go Sync Package Mastery: Synchronization Primitives</title>
      <link>https://andrewodendaal.com/articles/go-sync-primitives/</link>
      <pubDate>Mon, 22 May 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/go-sync-primitives/</guid>
      <description>&lt;p&gt;Master Go&amp;rsquo;s synchronization primitives including mutexes.&lt;/p&gt;&#xA;&lt;p&gt;#Go&amp;rsquo;s sync package contains the building blocks for safe concurrent programming. When multiple goroutines access shared data, you need synchronization to prevent race conditions and data corruption.&lt;/p&gt;&#xA;&lt;p&gt;The sync package provides several key primitives:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Mutex&lt;/strong&gt;: Mutual exclusion locks for protecting shared resources&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;RWMutex&lt;/strong&gt;: Reader-writer locks for read-heavy workloads&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;WaitGroup&lt;/strong&gt;: Waiting for a collection of goroutines to finish&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Once&lt;/strong&gt;: Ensuring a function runs exactly once&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Cond&lt;/strong&gt;: Condition variables for complex coordination&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Pool&lt;/strong&gt;: Object pools for reducing garbage collection pressure&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;when-to-use-sync-primitives&#34;&gt;When to Use Sync Primitives&lt;/h2&gt;&#xA;&lt;p&gt;Go&amp;rsquo;s philosophy is &amp;ldquo;Don&amp;rsquo;t communicate by sharing memory; share memory by communicating.&amp;rdquo; Channels are often the right choice for goroutine coordination. However, sync primitives are essential when:&lt;/p&gt;</description>
    </item>
    <item>
      <title>What are the different types of AWS API Gateway Protocols?</title>
      <link>https://andrewodendaal.com/what-are-the-different-types-of-aws-api-gateway-protocols/</link>
      <pubDate>Sun, 21 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/what-are-the-different-types-of-aws-api-gateway-protocols/</guid>
      <description>&lt;p&gt;Amazon API Gateway supports various protocols for exposing APIs, including:&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-restful-api&#34;&gt;1. RESTful API&lt;/h2&gt;&#xA;&lt;p&gt;This is the most common and widely used protocol for web APIs. Amazon API Gateway allows you to create and manage RESTful APIs, where you define API resources, methods (such as GET, POST, PUT, DELETE, etc.), and HTTP request and response mappings using API Gateway&amp;rsquo;s REST API model.&lt;/p&gt;&#xA;&lt;h3 id=&#34;primary-use-cases-include&#34;&gt;Primary use-cases include&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Building traditional web APIs with standard HTTP methods (GET, POST, PUT, DELETE, etc.) and resource-based URLs.&lt;/li&gt;&#xA;&lt;li&gt;Exposing APIs for legacy systems or third-party integrations that follow RESTful principles.&lt;/li&gt;&#xA;&lt;li&gt;Building APIs that are consumed by a wide range of clients, such as web browsers, mobile apps, and IoT devices.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;2-websocket-api&#34;&gt;2. WebSocket API&lt;/h2&gt;&#xA;&lt;p&gt;WebSocket is a protocol that enables bidirectional communication between web clients and servers over a single, long-lived connection. With Amazon API Gateway&amp;rsquo;s WebSocket API, you can create real-time, interactive APIs that support two-way communication between clients and servers, making it suitable for use cases like chat applications, gaming, and notifications.&lt;/p&gt;</description>
    </item>
    <item>
      <title>IaC: A Guide to Modern Software Development</title>
      <link>https://andrewodendaal.com/iac-guide-modern-software-development/</link>
      <pubDate>Sat, 20 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/iac-guide-modern-software-development/</guid>
      <description>&lt;p&gt;In the world of software development, efficiency, scalability, and repeatability are paramount. Enter Infrastructure as Code (IaC), a revolutionary approach to managing infrastructure in the cloud era. In this definitive guide, we will dive deep into the concept of IaC, explore its benefits, best practices, and how it is reshaping the way modern software is built and deployed. Join us on this journey as we unlock the power of IaC and uncover its secrets to successful software development.&lt;/p&gt;</description>
    </item>
    <item>
      <title>DevOps and Microservices: How They Complement Each Other</title>
      <link>https://andrewodendaal.com/devops-and-microservices-how-they-complement-each-other/</link>
      <pubDate>Fri, 19 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/devops-and-microservices-how-they-complement-each-other/</guid>
      <description>&lt;p&gt;In today&amp;rsquo;s fast-paced world of software development, DevOps and microservices have emerged as two powerful methodologies that enable organizations to build and deploy applications with speed, agility, and reliability. While DevOps and microservices are distinct concepts, they often go hand in hand, complementing each other to create a seamless and efficient software development and deployment process. In this blog post, we will explore how DevOps and microservices fit together and how organizations can leverage them to accelerate their software delivery pipelines and achieve business success.&lt;/p&gt;</description>
    </item>
    <item>
      <title>IaC Unlock: Maximize Potential with Ansible</title>
      <link>https://andrewodendaal.com/iac-unlock-maximize-potential-ansible/</link>
      <pubDate>Thu, 18 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/iac-unlock-maximize-potential-ansible/</guid>
      <description>&lt;p&gt;In today&amp;rsquo;s fast-paced world of software development and IT operations, the need for efficient and scalable infrastructure management has become more critical than ever. Enter Infrastructure as Code (IaC), a game-changing approach that allows organizations to automate their infrastructure provisioning and management, making it more agile, scalable, and reliable. And when it comes to IaC, Ansible stands out as a top choice for many IT teams due to its simplicity, versatility, and robustness. In this blog post, we will explore the power of IaC with Ansible and how it can revolutionize your IT operations.&lt;/p&gt;</description>
    </item>
    <item>
      <title>GitOps: Managing Infrastructure as Code with Git</title>
      <link>https://andrewodendaal.com/gitops-managing-infrastructure-as-code-with-git/</link>
      <pubDate>Wed, 17 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/gitops-managing-infrastructure-as-code-with-git/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;In today&amp;rsquo;s fast-paced world of software development and operations, managing infrastructure efficiently and securely is crucial for organizations to deliver reliable and scalable applications. Traditional methods of managing infrastructure can be time-consuming, error-prone, and lack visibility, making it challenging to keep up with the demands of modern software development practices. However, with the emergence of GitOps, organizations now have a powerful and efficient way to manage infrastructure as code, leveraging the familiar and widely adopted Git version control system. In this blog post, we will explore the concept of GitOps, its benefits, and how organizations can implement GitOps practices to streamline their infrastructure management while adhering to popular SEO tactics.&lt;/p&gt;</description>
    </item>
    <item>
      <title>DevOps Synergy: Boosting Cybersecurity</title>
      <link>https://andrewodendaal.com/devops-synergy-boosting-cybersecurity/</link>
      <pubDate>Tue, 16 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/devops-synergy-boosting-cybersecurity/</guid>
      <description>&lt;p&gt;As organizations increasingly rely on technology to power their operations, the need for robust cybersecurity measures becomes more critical than ever. Cyber threats are constantly evolving, and traditional security approaches are no longer sufficient to protect against sophisticated attacks. This is where DevOps, a collaborative approach to software development and operations, can play a significant role in enhancing cybersecurity defenses. In this blog post, we will explore the powerful synergy between DevOps and cybersecurity, and how organizations can leverage this approach to strengthen their security posture.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Role of DevOps in Blockchain</title>
      <link>https://andrewodendaal.com/the-role-of-devops-in-blockchain/</link>
      <pubDate>Mon, 15 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/the-role-of-devops-in-blockchain/</guid>
      <description>&lt;p&gt;Blockchain technology is gaining traction across various industries for its ability to provide transparency, security, and immutability. However, implementing blockchain solutions requires a robust and efficient software development process, which is where DevOps comes in. In this blog post, we will explore the role of DevOps in blockchain development and how it can help organizations deploy blockchain solutions seamlessly.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-devops&#34;&gt;What is DevOps?&lt;/h2&gt;&#xA;&lt;p&gt;DevOps is a software development methodology that emphasizes collaboration, automation, and continuous delivery to ensure faster and more reliable software delivery. The approach combines the practices of agile software development, continuous integration, and continuous delivery/deployment. DevOps focuses on breaking down the silos between development and operations teams, enabling seamless collaboration and communication.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Importance of Testing in DevOps: Strategies and Tools</title>
      <link>https://andrewodendaal.com/the-importance-of-testing-in-devops-strategies-and-tools/</link>
      <pubDate>Sun, 14 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/the-importance-of-testing-in-devops-strategies-and-tools/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;In today&amp;rsquo;s fast-paced digital world, software development has become an essential part of business operations. With the adoption of DevOps practices, organizations can build and deploy software applications more efficiently and effectively. However, with faster release cycles, it becomes increasingly important to ensure that software is thoroughly tested before release. In this blog post, we will explore the importance of testing in DevOps, strategies for successful testing, and tools that can help streamline the testing process.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Docker Production Deployment Strategies</title>
      <link>https://andrewodendaal.com/articles/docker-production-deployment/</link>
      <pubDate>Sun, 14 May 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/docker-production-deployment/</guid>
      <description>&lt;p&gt;Deploy Docker containers to production with security.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-and-setup&#34;&gt;Introduction and Setup&lt;/h2&gt;&#xA;&lt;p&gt;My first production Docker deployment was a disaster. I thought running containers in production would be as simple as &lt;code&gt;docker run&lt;/code&gt; with a few extra flags. Three hours into the deployment, our application was down, the database was corrupted, and I was frantically trying to figure out why containers kept restarting in an endless loop.&lt;/p&gt;&#xA;&lt;p&gt;That painful experience taught me that production Docker deployments are fundamentally different from development. The stakes are higher, the complexity is greater, and the margin for error is essentially zero.&lt;/p&gt;</description>
    </item>
    <item>
      <title>DevOps Impact on Customer Experience</title>
      <link>https://andrewodendaal.com/devops-impact-customer-experience/</link>
      <pubDate>Sat, 13 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/devops-impact-customer-experience/</guid>
      <description>&lt;p&gt;DevOps has revolutionized the way organizations develop, deploy, and manage software applications. It has brought about a cultural shift that emphasizes collaboration, automation, and continuous improvement. While DevOps has many benefits for software development teams, it also has a significant impact on customer experience and business success.&lt;/p&gt;&#xA;&lt;p&gt;In this blog post, we will explore how DevOps can improve customer experience and lead to business success.&lt;/p&gt;&#xA;&lt;h2 id=&#34;key-points&#34;&gt;Key Points&lt;/h2&gt;&#xA;&lt;h3 id=&#34;faster-time-to-market&#34;&gt;Faster Time-to-Market&lt;/h3&gt;&#xA;&lt;p&gt;One of the key benefits of DevOps is that it enables teams to release software faster and more frequently. This means that organizations can quickly respond to changing market demands and customer needs. By delivering new features and updates in a timely manner, organizations can improve customer satisfaction and increase their competitive edge.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building a DevOps Culture from the Ground Up</title>
      <link>https://andrewodendaal.com/building-a-devops-culture-from-the-ground-up/</link>
      <pubDate>Fri, 12 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/building-a-devops-culture-from-the-ground-up/</guid>
      <description>&lt;p&gt;DevOps has become a crucial aspect of software development, enabling teams to deliver software more efficiently and with higher quality. However, implementing DevOps is not just a matter of adopting tools and processes; it requires a cultural shift in the organization. In this blog post, we will explore the steps organizations can take to build a DevOps culture from the ground up.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-define-the-vision-and-goals&#34;&gt;1. Define the vision and goals&lt;/h2&gt;&#xA;&lt;p&gt;The first step in building a DevOps culture is to establish a clear vision and goals. This includes defining the purpose of DevOps and how it aligns with the organization&amp;rsquo;s overall strategy. This vision should be communicated clearly to all stakeholders to ensure that everyone is working towards the same goal.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Scaling DevOps for Enterprise Organizations</title>
      <link>https://andrewodendaal.com/scaling-devops-for-enterprise-organizations/</link>
      <pubDate>Thu, 11 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/scaling-devops-for-enterprise-organizations/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;DevOps has become a popular approach for software development in recent years, enabling teams to collaborate more effectively, increase efficiency, and deliver high-quality software faster. However, scaling DevOps for enterprise organizations can be challenging due to the size and complexity of their operations. In this blog post, we will explore the key considerations for scaling DevOps in an enterprise context and provide practical tips for success.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-establish-a-clear-vision-and-strategy&#34;&gt;1. Establish a Clear Vision and Strategy&lt;/h2&gt;&#xA;&lt;p&gt;Before scaling DevOps, it&amp;rsquo;s crucial to establish a clear vision and strategy that aligns with the organization&amp;rsquo;s business objectives. This should include defining key performance indicators (KPIs) to measure success and outlining the roles and responsibilities of different teams. The strategy should also incorporate feedback loops to ensure continuous improvement and flexibility to adapt to changing business needs.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Benefits of Infrastructure as Code in DevOps</title>
      <link>https://andrewodendaal.com/the-benefits-of-infrastructure-as-code-in-devops/</link>
      <pubDate>Wed, 10 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/the-benefits-of-infrastructure-as-code-in-devops/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;The increasing complexity of software systems requires a flexible, scalable, and reliable infrastructure. This is where infrastructure as code (IaC) comes in, providing a way to automate the management of infrastructure through code. In DevOps, IaC is a critical component that helps teams achieve continuous delivery and deployment, reduce errors, improve collaboration and communication, and ensure consistency and repeatability. In this blog post, we will explore the benefits of infrastructure as code in DevOps.&lt;/p&gt;</description>
    </item>
    <item>
      <title>DevOps for Legacy Systems: Challenges and Solutions</title>
      <link>https://andrewodendaal.com/devops-for-legacy-systems-challenges-and-solutions/</link>
      <pubDate>Tue, 09 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/devops-for-legacy-systems-challenges-and-solutions/</guid>
      <description>&lt;p&gt;As organizations continue to evolve and embrace digital transformation, they often encounter legacy systems that are critical to their business operations. These systems may be outdated and require modernization, but they still need to be maintained and supported in the meantime. This is where DevOps for legacy systems comes in, offering new opportunities for agility, innovation, and efficiency. In this blog post, we will explore the challenges and solutions for implementing DevOps practices for legacy systems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>DevOps Risk Management: Security &amp; Compliance</title>
      <link>https://andrewodendaal.com/devops-risk-management-security-compliance/</link>
      <pubDate>Mon, 08 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/devops-risk-management-security-compliance/</guid>
      <description>&lt;p&gt;DevOps has transformed software development, enabling teams to build, test, and deploy applications faster and more efficiently. However, the speed and agility of DevOps also bring new risks, particularly in the areas of security and compliance. To mitigate these risks, DevOps teams need to adopt strategies that incorporate security and compliance into the development process from the start. In this blog post, we will discuss some of the key strategies for managing risk in DevOps.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Why DevOps is Critical for Digital Transformation</title>
      <link>https://andrewodendaal.com/why-devops-is-critical-for-digital-transformation/</link>
      <pubDate>Sun, 07 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/why-devops-is-critical-for-digital-transformation/</guid>
      <description>&lt;p&gt;Digital transformation is the process of adopting and implementing digital technologies to improve business operations, increase efficiency, and enhance customer experience. The adoption of digital technologies has become essential for businesses to remain competitive in today&amp;rsquo;s fast-paced environment. However, implementing digital transformation is not just about technology, it requires a significant cultural shift in the organization. One of the key elements of digital transformation is the implementation of DevOps. In this blog post, we will explore why DevOps is critical for digital transformation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Role of Microservices in DevOps</title>
      <link>https://andrewodendaal.com/the-role-of-microservices-in-devops/</link>
      <pubDate>Sat, 06 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/the-role-of-microservices-in-devops/</guid>
      <description>&lt;p&gt;In recent years, microservices have become a popular architectural style for building software applications. Microservices are small, independent services that work together to form a larger application. Each microservice is responsible for a specific task, and they communicate with each other through well-defined APIs. This approach offers many benefits, including scalability, resilience, and flexibility. In this blog post, we&amp;rsquo;ll explore the role of microservices in DevOps and how they contribute to a successful software development process.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Docker Image Management and Optimization</title>
      <link>https://andrewodendaal.com/articles/docker-image-management/</link>
      <pubDate>Sat, 06 May 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/docker-image-management/</guid>
      <description>&lt;p&gt;Learn advanced Docker image creation.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-and-setup&#34;&gt;Introduction and Setup&lt;/h2&gt;&#xA;&lt;p&gt;Docker images are deceptively simple. You write a Dockerfile, run &lt;code&gt;docker build&lt;/code&gt;, and you have a container image. But there&amp;rsquo;s a big difference between images that work and images that work well in production. A poorly optimized image can turn a 30-second deployment into a 20-minute ordeal, making hotfixes impossible and frustrating your entire team.&lt;/p&gt;&#xA;&lt;p&gt;Building efficient Docker images requires understanding layers, caching strategies, and the subtle art of Dockerfile optimization. The techniques in this guide will help you create images that are fast to build, quick to deploy, and secure by default.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Achieving Continuous Delivery with DevOps and Automation</title>
      <link>https://andrewodendaal.com/achieving-continuous-delivery-with-devops-and-automation/</link>
      <pubDate>Fri, 05 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/achieving-continuous-delivery-with-devops-and-automation/</guid>
      <description>&lt;p&gt;Continuous delivery is a DevOps practice that aims to automate the entire software delivery process, from code commit to production deployment. With continuous delivery, teams can deliver software faster and with greater reliability. By automating many of the manual steps involved in software delivery, teams can reduce the risk of errors and increase the speed of deployment.&lt;/p&gt;&#xA;&lt;p&gt;To achieve continuous delivery, DevOps teams must prioritize automation. Here are some best practices for achieving continuous delivery with DevOps and automation:&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Importance of Collaboration in DevOps Culture</title>
      <link>https://andrewodendaal.com/the-importance-of-collaboration-in-devops-culture/</link>
      <pubDate>Thu, 04 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/the-importance-of-collaboration-in-devops-culture/</guid>
      <description>&lt;p&gt;Collaboration is a key aspect of DevOps culture, and it plays a crucial role in driving success and delivering value to customers. In today&amp;rsquo;s fast-paced business environment, DevOps teams need to work together seamlessly to ensure that applications are developed and deployed quickly and efficiently, while maintaining high quality and security standards. In this blog post, we will discuss the importance of collaboration in DevOps culture and how it can lead to better outcomes for organizations.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cloud-Native: Key to DevOps Success</title>
      <link>https://andrewodendaal.com/cloud-native-key-devops-success/</link>
      <pubDate>Wed, 03 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/cloud-native-key-devops-success/</guid>
      <description>&lt;p&gt;In recent years, cloud-native architecture has become a buzzword in the world of DevOps. But what exactly does it mean, and why is it so important for DevOps success? In this blog post, we’ll explore the concept of cloud-native architecture and why it’s essential for DevOps teams to embrace it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-cloud-native-architecture&#34;&gt;What is Cloud-Native Architecture?&lt;/h2&gt;&#xA;&lt;p&gt;Cloud-native architecture is an approach to building and running applications that takes advantage of the scalability and flexibility of cloud computing. It’s built around the idea of containerization, which means that applications are broken down into smaller, more manageable components that can be easily deployed and scaled as needed.&lt;/p&gt;</description>
    </item>
    <item>
      <title>10 Best Practices for Continuous Integration in DevOps</title>
      <link>https://andrewodendaal.com/10-best-practices-for-continuous-integration-in-devops/</link>
      <pubDate>Tue, 02 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/10-best-practices-for-continuous-integration-in-devops/</guid>
      <description>&lt;p&gt;Continuous Integration (CI) is an essential part of modern software development and is integral to the DevOps methodology. CI ensures that every code change made by developers is integrated and tested with the existing codebase, allowing teams to catch and fix issues early in the development cycle. In this blog post, we&amp;rsquo;ll explore the best practices for implementing Continuous Integration in DevOps.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-automate-the-build-process&#34;&gt;1. Automate the build process&lt;/h2&gt;&#xA;&lt;p&gt;Automating the build process in CI involves using tools and scripts to build, package, and deploy software artifacts. The process should be designed to be repeatable and reliable so that the same results can be achieved consistently. Automating the build process not only reduces the risk of human error but also increases the speed and efficiency of the development process.&lt;/p&gt;</description>
    </item>
    <item>
      <title>DevOps vs. Agile: What&#39;s the Difference and Why it Matters</title>
      <link>https://andrewodendaal.com/devops-vs-agile-whats-the-difference-and-why-it-matters/</link>
      <pubDate>Mon, 01 May 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/devops-vs-agile-whats-the-difference-and-why-it-matters/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;In the world of software development, there are two methodologies that are often mentioned: Agile and DevOps. While they share some similarities, they are distinct and have different goals. In this blog post, we&amp;rsquo;ll explore the differences between Agile and DevOps, why they matter, and how they can work together.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-agile&#34;&gt;What is Agile?&lt;/h2&gt;&#xA;&lt;p&gt;Agile is a software development methodology that emphasizes collaboration, flexibility, and responsiveness. It was first introduced in 2001 with the publication of the Agile Manifesto, which outlined a set of guiding principles for software development. The Agile approach values working software over comprehensive documentation, customer collaboration over contract negotiation, and responding to change over following a plan.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Future of DevOps: Emerging Trends and Technologies</title>
      <link>https://andrewodendaal.com/the-future-of-devops-emerging-trends-and-technologies/</link>
      <pubDate>Sun, 30 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/the-future-of-devops-emerging-trends-and-technologies/</guid>
      <description>&lt;p&gt;In recent years, DevOps has emerged as a key practice for modern software development, helping organizations to achieve faster delivery of high-quality applications. However, as the technology landscape continues to evolve, DevOps itself is undergoing significant changes to keep pace with emerging trends and technologies. In this blog post, we will explore the future of DevOps and the emerging trends and technologies that are shaping its evolution.&lt;/p&gt;&#xA;&lt;h2 id=&#34;serverless-computing&#34;&gt;Serverless computing&lt;/h2&gt;&#xA;&lt;p&gt;Serverless computing is an approach to cloud computing that allows developers to write and run code without having to manage the underlying infrastructure. In a serverless architecture, the cloud provider is responsible for managing the servers, storage, and networking, while the developer can focus solely on writing code to deliver business value.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building Resilient Microservices with Istio and Envoy</title>
      <link>https://andrewodendaal.com/building-resilient-microservices-with-istio-and-envoy/</link>
      <pubDate>Sat, 29 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/building-resilient-microservices-with-istio-and-envoy/</guid>
      <description>&lt;p&gt;As microservices architecture continues to grow in popularity, it&amp;rsquo;s becoming increasingly important to ensure that these distributed systems are reliable and resilient. Istio and Envoy are two tools that have emerged to help with this challenge. In this blog post, we&amp;rsquo;ll explore how Istio and Envoy can be used to build resilient microservices.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-to-istio-and-envoy&#34;&gt;Introduction to Istio and Envoy&lt;/h2&gt;&#xA;&lt;p&gt;Istio is an open-source service mesh that provides a unified way to connect, manage, and secure microservices. Envoy is a high-performance proxy that can be used to manage and secure service-to-service communication. Together, these tools provide a powerful platform for building resilient microservices.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Role of DevSecOps in Modern Software Development</title>
      <link>https://andrewodendaal.com/the-role-of-devsecops-in-modern-software-development/</link>
      <pubDate>Fri, 28 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/the-role-of-devsecops-in-modern-software-development/</guid>
      <description>&lt;p&gt;As the world becomes increasingly digital, software development has become a critical aspect of business success. However, the rise in cybersecurity threats has made it imperative to ensure that software is developed securely. This is where DevSecOps comes in – it is the integration of security practices into the DevOps process, allowing for more secure and reliable software development. In this blog post, we will discuss the role of DevSecOps in modern software development.&lt;/p&gt;</description>
    </item>
    <item>
      <title>5 Key Metrics to Measure DevOps Success</title>
      <link>https://andrewodendaal.com/5-key-metrics-to-measure-devops-success/</link>
      <pubDate>Thu, 27 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/5-key-metrics-to-measure-devops-success/</guid>
      <description>&lt;p&gt;As DevOps continues to gain popularity and adoption, it is important for organizations to measure the success of their DevOps initiatives. While DevOps is about culture and collaboration, it is also about delivering value to customers quickly and reliably. In this blog post, we will discuss five key metrics that organizations can use to measure the success of their DevOps initiatives.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-lead-time-for-changes&#34;&gt;1. Lead Time for Changes&lt;/h2&gt;&#xA;&lt;p&gt;Lead time for changes is the amount of time it takes for a change to be implemented, from the moment it is requested to the moment it is deployed. This metric measures how quickly an organization can deliver new features or fix issues. A shorter lead time for changes means that an organization can respond to market demands more quickly, reducing time to market and increasing customer satisfaction.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Importance of Infrastructure as Code in DevOps</title>
      <link>https://andrewodendaal.com/the-importance-of-infrastructure-as-code-in-devops/</link>
      <pubDate>Wed, 26 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/the-importance-of-infrastructure-as-code-in-devops/</guid>
      <description>&lt;p&gt;Infrastructure as Code (IaC) is a methodology that involves managing and provisioning infrastructure through code rather than manually configuring hardware and software components. This approach is essential in DevOps because it enables teams to manage infrastructure at scale, improve collaboration, and reduce errors. In this blog post, we will explore the importance of IaC in DevOps and why it is critical for modern software development.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-consistency-and-reproducibility&#34;&gt;1. Consistency and Reproducibility&lt;/h2&gt;&#xA;&lt;p&gt;Manual infrastructure configuration is prone to errors and can be challenging to reproduce consistently. With IaC, teams can define infrastructure configurations in code and version control systems, ensuring that infrastructure is consistent across environments. This approach ensures that the infrastructure is reproducible, which reduces errors and saves time.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Docker Security and Performance Optimization</title>
      <link>https://andrewodendaal.com/articles/docker-security-optimization/</link>
      <pubDate>Wed, 26 Apr 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/docker-security-optimization/</guid>
      <description>&lt;p&gt;Implement Docker security best practices.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-and-setup&#34;&gt;Introduction and Setup&lt;/h2&gt;&#xA;&lt;h1 id=&#34;docker-security-and-optimization-introduction-and-setup&#34;&gt;Docker Security and Optimization: Introduction and Setup&lt;/h1&gt;&#xA;&lt;p&gt;Docker security and performance optimization are critical for production deployments. This guide covers comprehensive security hardening, performance tuning, and operational best practices for containerized environments.&lt;/p&gt;&#xA;&lt;h2 id=&#34;docker-security-fundamentals&#34;&gt;Docker Security Fundamentals&lt;/h2&gt;&#xA;&lt;h3 id=&#34;security-model-overview&#34;&gt;Security Model Overview&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;┌─────────────────────────────────────────────────────────┐&#xA;│                 Host Operating System                   │&#xA;├─────────────────────────────────────────────────────────┤&#xA;│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐     │&#xA;│  │   Kernel    │  │  Namespaces │  │   cgroups   │     │&#xA;│  │ Capabilities│  │             │  │             │     │&#xA;│  └─────────────┘  └─────────────┘  └─────────────┘     │&#xA;├─────────────────────────────────────────────────────────┤&#xA;│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐     │&#xA;│  │   SELinux/  │  │  AppArmor   │  │   seccomp   │     │&#xA;│  │  AppArmor   │  │             │  │             │     │&#xA;│  └─────────────┘  └─────────────┘  └─────────────┘     │&#xA;├─────────────────────────────────────────────────────────┤&#xA;│                 Docker Engine                           │&#xA;├─────────────────────────────────────────────────────────┤&#xA;│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐     │&#xA;│  │ Container 1 │  │ Container 2 │  │ Container 3 │     │&#xA;│  └─────────────┘  └─────────────┘  └─────────────┘     │&#xA;└─────────────────────────────────────────────────────────┘&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;basic-security-commands&#34;&gt;Basic Security Commands&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Run container with security options&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker run --security-opt no-new-privileges:true &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --cap-drop ALL &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --cap-add NET_BIND_SERVICE &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --read-only &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --tmpfs /tmp:rw,noexec,nosuid,size&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;100m &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  nginx&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Run as non-root user&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker run --user 1000:1000 &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -v /etc/passwd:/etc/passwd:ro &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -v /etc/group:/etc/group:ro &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  alpine id&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Limit resources&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker run --memory&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;512m &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --cpus&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;1.5&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --pids-limit&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;100&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --ulimit nofile&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;1024:1024 &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  myapp&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Network security&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker run --network none alpine&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker run --network custom-network &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --ip 172.20.0.10 &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  myapp&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;container-hardening-basics&#34;&gt;Container Hardening Basics&lt;/h2&gt;&#xA;&lt;h3 id=&#34;secure-dockerfile-practices&#34;&gt;Secure Dockerfile Practices&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-dockerfile&#34; data-lang=&#34;dockerfile&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Use specific versions, not latest&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;FROM&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; node:16.17.0-alpine3.16&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Create non-root user early&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;RUN&lt;/span&gt; addgroup -g &lt;span style=&#34;color:#ae81ff&#34;&gt;1001&lt;/span&gt; -S nodejs &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;    adduser -S nextjs -u &lt;span style=&#34;color:#ae81ff&#34;&gt;1001&lt;/span&gt; -G nodejs&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Set working directory&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;WORKDIR&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; /app&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Copy package files first for better caching&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;COPY&lt;/span&gt; package*.json ./&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Install dependencies as root, then switch&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;RUN&lt;/span&gt; npm ci --only&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;production &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;    npm cache clean --force &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;    chown -R nextjs:nodejs /app&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Copy application files&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;COPY&lt;/span&gt; --chown&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;nextjs:nodejs . .&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Switch to non-root user&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;USER&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; nextjs&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Remove unnecessary packages&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;RUN&lt;/span&gt; apk del --purge &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; rm -rf /var/cache/apk/* &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; rm -rf /tmp/*&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Set secure permissions&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;RUN&lt;/span&gt; chmod -R &lt;span style=&#34;color:#ae81ff&#34;&gt;755&lt;/span&gt; /app &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;    chmod &lt;span style=&#34;color:#ae81ff&#34;&gt;644&lt;/span&gt; /app/package.json&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Health check&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;HEALTHCHECK --interval=30s --timeout=3s &lt;/span&gt;--start-period&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;5s --retries&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;3&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  CMD curl -f http://localhost:3000/health &lt;span style=&#34;color:#f92672&#34;&gt;||&lt;/span&gt; exit &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Expose port&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;EXPOSE&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; 3000&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Use exec form for CMD&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;CMD&lt;/span&gt; [&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;node&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;server.js&amp;#34;&lt;/span&gt;]&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;runtime-security-configuration&#34;&gt;Runtime Security Configuration&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Comprehensive security flags&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker run -d &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --name secure-app &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --user 1000:1000 &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --read-only &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --tmpfs /tmp:rw,noexec,nosuid,size&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;100m &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --tmpfs /var/run:rw,noexec,nosuid,size&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;50m &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --cap-drop ALL &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --cap-add CHOWN &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --cap-add SETGID &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --cap-add SETUID &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --security-opt no-new-privileges:true &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --security-opt apparmor:docker-default &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --security-opt seccomp:default &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --memory&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;512m &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --memory-swap&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;512m &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --cpu-shares&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;512&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --pids-limit&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;100&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --ulimit nofile&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;1024:1024 &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --ulimit nproc&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;64:64 &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --restart&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;unless-stopped &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  myapp:latest&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;performance-optimization-basics&#34;&gt;Performance Optimization Basics&lt;/h2&gt;&#xA;&lt;h3 id=&#34;resource-management&#34;&gt;Resource Management&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# CPU optimization&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker run -d &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --cpus&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;2.5&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --cpu-shares&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1024&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --cpuset-cpus&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;0,1&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --cpu-quota&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;50000&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --cpu-period&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;100000&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  myapp&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Memory optimization&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker run -d &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --memory&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;2g &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --memory-swap&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;2g &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --memory-reservation&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;1g &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --oom-kill-disable&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;false &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --kernel-memory&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;500m &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  myapp&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# I/O optimization&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker run -d &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --device-read-bps /dev/sda:50mb &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --device-write-bps /dev/sda:50mb &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --device-read-iops /dev/sda:1000 &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --device-write-iops /dev/sda:1000 &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  myapp&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Network optimization&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker run -d &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --sysctl net.core.somaxconn&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;65535&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --sysctl net.ipv4.tcp_max_syn_backlog&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;65535&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --sysctl net.core.rmem_max&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;134217728&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --sysctl net.core.wmem_max&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;134217728&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  myapp&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;docker-daemon-optimization&#34;&gt;Docker Daemon Optimization&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-json&#34; data-lang=&#34;json&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;log-driver&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;json-file&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;log-opts&amp;#34;&lt;/span&gt;: {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;max-size&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;10m&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;max-file&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;3&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  },&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;storage-driver&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;overlay2&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;storage-opts&amp;#34;&lt;/span&gt;: [&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;overlay2.override_kernel_check=true&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ],&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;default-ulimits&amp;#34;&lt;/span&gt;: {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;nofile&amp;#34;&lt;/span&gt;: {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;Name&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;nofile&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;Hard&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;64000&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;Soft&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;64000&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  },&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;max-concurrent-downloads&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;10&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;max-concurrent-uploads&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;default-shm-size&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;128M&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;userland-proxy&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;experimental&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;metrics-addr&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;127.0.0.1:9323&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;live-restore&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;security-scanning-and-assessment&#34;&gt;Security Scanning and Assessment&lt;/h2&gt;&#xA;&lt;h3 id=&#34;image-vulnerability-scanning&#34;&gt;Image Vulnerability Scanning&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Install and use Trivy&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Scan image for vulnerabilities&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;trivy image nginx:latest&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Scan with specific severity&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;trivy image --severity HIGH,CRITICAL nginx:latest&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Scan and output to file&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;trivy image --format json --output results.json nginx:latest&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Scan filesystem&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;trivy fs .&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Scan with ignore file&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;trivy image --ignorefile .trivyignore nginx:latest&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;.trivyignore example:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Build a Successful DevOps Toolchain</title>
      <link>https://andrewodendaal.com/how-to-build-a-successful-devops-toolchain/</link>
      <pubDate>Mon, 24 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-build-a-successful-devops-toolchain/</guid>
      <description>&lt;p&gt;DevOps toolchains are essential for streamlining software delivery and ensuring that teams can work efficiently and collaboratively. However, building a successful DevOps toolchain requires careful planning, coordination, and evaluation. In this blog post, we will explore some strategies for building a successful DevOps toolchain that can help teams deliver software faster and more reliably.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-define-the-requirements&#34;&gt;1. Define the requirements&lt;/h2&gt;&#xA;&lt;p&gt;The first step in building a successful DevOps toolchain is defining the requirements. Teams should identify the key features and capabilities they need, such as continuous integration, automated testing, deployment automation, and monitoring. They should also consider factors such as integration with existing systems, scalability, and ease of use.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Scaling DevOps: Strategies for Managing Large Teams</title>
      <link>https://andrewodendaal.com/scaling-devops-strategies-for-managing-large-teams/</link>
      <pubDate>Mon, 24 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/scaling-devops-strategies-for-managing-large-teams/</guid>
      <description>&lt;p&gt;DevOps has revolutionized software development and delivery, enabling teams to work collaboratively, automate processes, and deliver software faster and more reliably. However, as organizations grow and teams become larger, managing DevOps at scale becomes more challenging. In this blog post, we will explore some strategies for managing large DevOps teams and ensuring successful software delivery.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-embrace-modular-architecture&#34;&gt;1. Embrace modular architecture&lt;/h2&gt;&#xA;&lt;p&gt;Modular architecture is a critical aspect of scaling DevOps. By breaking down applications into smaller, more manageable components, teams can work independently, reducing dependencies and improving agility. This approach also enables teams to adopt different technologies and tools, allowing for experimentation and innovation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Docker Compose: Multi-Container Orchestration</title>
      <link>https://andrewodendaal.com/articles/docker-compose-orchestration/</link>
      <pubDate>Mon, 24 Apr 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/docker-compose-orchestration/</guid>
      <description>&lt;p&gt;Master Docker Compose for defining.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-and-setup&#34;&gt;Introduction and Setup&lt;/h2&gt;&#xA;&lt;h1 id=&#34;docker-compose-orchestration-introduction-and-setup&#34;&gt;Docker Compose Orchestration: Introduction and Setup&lt;/h1&gt;&#xA;&lt;p&gt;Docker Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application&amp;rsquo;s services, networks, and volumes, then create and start all services with a single command.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-docker-compose&#34;&gt;What is Docker Compose?&lt;/h2&gt;&#xA;&lt;p&gt;Docker Compose solves the complexity of managing multiple containers by providing:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Declarative Configuration&lt;/strong&gt;: Define your entire application stack in a single YAML file&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Service Orchestration&lt;/strong&gt;: Manage dependencies between containers&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Environment Management&lt;/strong&gt;: Easy switching between development, testing, and production&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Scaling&lt;/strong&gt;: Scale services up or down with simple commands&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Networking&lt;/strong&gt;: Automatic network creation and service discovery&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;installation-and-setup&#34;&gt;Installation and Setup&lt;/h2&gt;&#xA;&lt;h3 id=&#34;installing-docker-compose&#34;&gt;Installing Docker Compose&lt;/h3&gt;&#xA;&lt;p&gt;&lt;strong&gt;Linux:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Why DevOps Culture is Critical for Business Success</title>
      <link>https://andrewodendaal.com/why-devops-culture-is-critical-for-business-success/</link>
      <pubDate>Sun, 23 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/why-devops-culture-is-critical-for-business-success/</guid>
      <description>&lt;p&gt;The DevOps movement has been gaining momentum in recent years as organizations realize the benefits of breaking down silos between development and operations teams. DevOps is not just a set of tools and practices; it&amp;rsquo;s a culture that emphasizes collaboration, communication, and continuous improvement. In this blog post, we will explore why DevOps culture is critical for business success.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-speed-and-agility&#34;&gt;1. Speed and agility&lt;/h2&gt;&#xA;&lt;p&gt;In today&amp;rsquo;s fast-paced business environment, organizations need to deliver software quickly and adapt to changing customer demands. DevOps culture emphasizes automation, continuous delivery, and feedback loops, enabling teams to deploy software faster and respond to market changes quickly. By breaking down silos between teams and fostering a culture of collaboration and communication, DevOps enables organizations to deliver software faster while maintaining quality.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Ultimate Guide to Kubernetes Deployment Strategies</title>
      <link>https://andrewodendaal.com/the-ultimate-guide-to-kubernetes-deployment-strategies/</link>
      <pubDate>Sat, 22 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/the-ultimate-guide-to-kubernetes-deployment-strategies/</guid>
      <description>&lt;p&gt;Kubernetes has become a popular choice for container orchestration, providing developers with a powerful platform for deploying, scaling, and managing containerized applications. However, with great power comes great responsibility, and choosing the right deployment strategy is essential for ensuring application availability, scalability, and performance. In this post, we will cover the ultimate guide to Kubernetes deployment strategies, including their benefits, drawbacks, and best practices.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-rolling-updates&#34;&gt;1. Rolling updates&lt;/h2&gt;&#xA;&lt;p&gt;Rolling updates are the most common deployment strategy in Kubernetes, allowing you to update a running application without downtime. In this strategy, Kubernetes replaces old replicas with new ones, gradually rolling out updates while keeping the application running. This approach is useful for applications that require high availability and can handle small disruptions.&lt;/p&gt;</description>
    </item>
    <item>
      <title>10 Best Practices for Container Security in DevOps</title>
      <link>https://andrewodendaal.com/10-best-practices-for-container-security-in-devops/</link>
      <pubDate>Fri, 21 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/10-best-practices-for-container-security-in-devops/</guid>
      <description>&lt;p&gt;Containers have become a critical component of modern software development practices. They provide a lightweight, portable, and scalable way to package and deploy software applications. However, containers also introduce new security challenges, such as vulnerabilities in container images, insecure configurations, and compromised host environments. In this post, we will outline 10 best practices for container security in DevOps to help you mitigate these risks.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-use-trusted-base-images&#34;&gt;1. Use trusted base images&lt;/h2&gt;&#xA;&lt;p&gt;When building container images, it&amp;rsquo;s essential to use trusted base images from reputable sources. Avoid using unverified images from unknown sources, as they may contain hidden vulnerabilities or malware. Instead, use base images that have been thoroughly tested and validated by the community.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Implement CI/CD Pipelines with Jenkins</title>
      <link>https://andrewodendaal.com/how-to-implement-cicd-pipelines-with-jenkins/</link>
      <pubDate>Thu, 20 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-implement-cicd-pipelines-with-jenkins/</guid>
      <description>&lt;p&gt;Continuous Integration and Continuous Deployment (CI/CD) pipelines are critical components of modern software development practices. They enable development teams to deliver high-quality software quickly and reliably by automating the build, test, and deployment process. Jenkins is a popular open-source automation tool that can help you implement CI/CD pipelines easily. In this post, we will guide you through the process of setting up a basic CI/CD pipeline with Jenkins.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-install-jenkins&#34;&gt;Step 1: Install Jenkins&lt;/h2&gt;&#xA;&lt;p&gt;The first step is to install Jenkins on your system. You can download the latest version of Jenkins from the official website and follow the installation instructions. Once you have installed Jenkins, you can access it using the default URL http://localhost:8080.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] AWS Error: TooManyBuckets - Bucket Limit Exceeded</title>
      <link>https://andrewodendaal.com/solved-aws-error-toomanybuckets-bucket-limit-exceeded/</link>
      <pubDate>Wed, 19 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/solved-aws-error-toomanybuckets-bucket-limit-exceeded/</guid>
      <description>&lt;p&gt;If you get the following error:&lt;/p&gt;&#xA;&lt;p&gt;│ Error: creating Amazon S3 (Simple Storage) Bucket (&amp;lt;your-bucket-name): TooManyBuckets: You have attempted to create more buckets than allowed&#xA;│       status code: 400, request id: 0P1TV2VCEDKGFQNY, host id: gc9di71ONabECoBYkkzc7Lmqs0DOo2DVhV2kqCgNruNO6Okm5K3EXzosdf5MCxP8uI=&#xA;│&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-reason-for-the-problem&#34;&gt;The reason for the problem&lt;/h2&gt;&#xA;&lt;p&gt;There is a soft limit of 100 S3 buckets per AWS account.&lt;/p&gt;&#xA;&lt;h2 id=&#34;find-out-more&#34;&gt;Find out more&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.htmlhttps:/&#34;&gt;https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-to-the-problem&#34;&gt;The solution to the problem&lt;/h2&gt;&#xA;&lt;h3 id=&#34;option-1---quick-fix&#34;&gt;Option 1 - Quick fix&lt;/h3&gt;&#xA;&lt;p&gt;Remove unused S3 buckets.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to check if a program exists from a Bash/Shell script</title>
      <link>https://andrewodendaal.com/how-to-check-if-a-program-exists-from-a-bash-shell-script/</link>
      <pubDate>Tue, 18 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-check-if-a-program-exists-from-a-bash-shell-script/</guid>
      <description>&lt;p&gt;You can look to use:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;command -v &amp;lt;the_command&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;There are also 2 other ways, that we will run through a little further down, but for now..&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-use-the-command-if-a-conditional&#34;&gt;How to use the &lt;code&gt;command&lt;/code&gt; if a conditional&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; ! command -v &amp;lt;the_command&amp;gt; &amp;amp;&amp;gt; /dev/null&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;then&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;lt;the_command&amp;gt; could not be found&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    exit&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;fi&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;to-summarize-there-are-3-ways-you-can-do-this&#34;&gt;To summarize, there are 3 ways you can do this&lt;/h2&gt;&#xA;&lt;h3 id=&#34;option-1---using-command&#34;&gt;Option 1 - Using &lt;code&gt;command&lt;/code&gt;&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;command -v foo &amp;gt;/dev/null 2&amp;gt;&amp;amp;&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;||&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;{&lt;/span&gt; echo &amp;gt;&amp;amp;&lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;foo is not installed. Aborting.&amp;#34;&lt;/span&gt;; exit 1; &lt;span style=&#34;color:#f92672&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;option-2---using-type&#34;&gt;Option 2 - Using &lt;code&gt;type&lt;/code&gt;&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;type foo &amp;gt;/dev/null 2&amp;gt;&amp;amp;&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;||&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;{&lt;/span&gt; echo &amp;gt;&amp;amp;&lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;foo is not installed. Aborting.&amp;#34;&lt;/span&gt;; exit 1; &lt;span style=&#34;color:#f92672&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;option-3---using-hash&#34;&gt;Option 3 - Using &lt;code&gt;hash&lt;/code&gt;&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;hash foo 2&amp;gt;/dev/null &lt;span style=&#34;color:#f92672&#34;&gt;||&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;{&lt;/span&gt; echo &amp;gt;&amp;amp;&lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;foo is not installed. Aborting.&amp;#34;&lt;/span&gt;; exit 1; &lt;span style=&#34;color:#f92672&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>The DevOps Culture</title>
      <link>https://andrewodendaal.com/the-devops-culture/</link>
      <pubDate>Mon, 17 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/the-devops-culture/</guid>
      <description>&lt;p&gt;DevOps is a software development approach that emphasizes collaboration and communication between development and operations teams. DevOps culture refers to the values, principles, and practices that foster this collaboration and enable teams to work together effectively.&lt;/p&gt;&#xA;&lt;p&gt;Here are some key elements of DevOps culture:&lt;/p&gt;&#xA;&lt;h2 id=&#34;collaboration&#34;&gt;Collaboration&lt;/h2&gt;&#xA;&lt;p&gt;DevOps culture emphasizes collaboration between development, operations, and other stakeholders involved in the software development process. This collaboration ensures that all team members are working towards the same goal and have a shared understanding of the project.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Teach me Kubernetes - Part 7 - Sidecar Containers</title>
      <link>https://andrewodendaal.com/teach-me-kubernetes-part7-sidecar-containers/</link>
      <pubDate>Sun, 16 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/teach-me-kubernetes-part7-sidecar-containers/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;Looking for the entire 7 part guide? &lt;a href=&#34;https://andrewodendaal.com/teach-me-kubernetes-part1-overview/#follow-the-entire-guide/&#34;&gt;Start at the Overview&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;In Kubernetes, a sidecar container is a secondary container that runs in the same Pod as the primary container. The sidecar container runs alongside the primary container and shares the same network namespace, IPC namespace, and mount namespace.&lt;/p&gt;&#xA;&lt;p&gt;Here are some key features of sidecar containers in Kubernetes:&lt;/p&gt;&#xA;&lt;p&gt;Sidecar containers are used to enhance the functionality of the primary container: The sidecar container runs alongside the primary container and provides additional functionality that the primary container needs to function properly. This can include tasks such as logging, monitoring, or proxying traffic to the primary container.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Teach me Kubernetes - Part 6 - Deployments</title>
      <link>https://andrewodendaal.com/teach-me-kubernetes-part6-deployments/</link>
      <pubDate>Sat, 15 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/teach-me-kubernetes-part6-deployments/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;Looking for the entire 7 part guide? &lt;a href=&#34;https://andrewodendaal.com/teach-me-kubernetes-part1-overview/#follow-the-entire-guide/&#34;&gt;Start at the Overview&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;In Kubernetes, a Deployment is a higher-level abstraction that manages the deployment and scaling of a set of Pods. Deployments provide a declarative way to manage the desired state of your application, making it easy to roll out updates and scale your application over time.&lt;/p&gt;&#xA;&lt;p&gt;Here are some key features of &lt;a href=&#34;https://andrewodendaal.com/the-ultimate-guide-to-kubernetes-deployment-strategies&#34;&gt;Deployments in Kubernetes&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Deployments manage the desired state of your application: You can specify the desired state of your application (e.g., how many replicas of a Pod should be running, what image to use, etc.) in a Deployment configuration file. The Deployment controller then ensures that the actual state of your application matches the desired state.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Teach me Kubernetes - Part 5 - Services</title>
      <link>https://andrewodendaal.com/teach-me-kubernetes-part5-services/</link>
      <pubDate>Fri, 14 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/teach-me-kubernetes-part5-services/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;Looking for the entire 7 part guide? &lt;a href=&#34;https://andrewodendaal.com/teach-me-kubernetes-part1-overview/#follow-the-entire-guide/&#34;&gt;Start at the Overview&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;In Kubernetes, a Service is an abstraction that provides a stable, IP address and DNS name for a set of Pods. Services allow you to decouple the logical representation of your application from the underlying infrastructure, making it easier to manage and scale your application over time.&lt;/p&gt;&#xA;&lt;p&gt;Here are some key features of Services in Kubernetes:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Services provide a stable IP address and DNS name: A Service is assigned a static IP address and DNS name that remains the same even if the underlying Pods are recreated or rescheduled. This allows other components of your application to reliably connect to the Service, without having to know the details of the underlying Pod IP addresses.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Teach me Kubernetes - Part 4 - Replication Controllers</title>
      <link>https://andrewodendaal.com/teach-me-kubernetes-part4-replication-controllers/</link>
      <pubDate>Thu, 13 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/teach-me-kubernetes-part4-replication-controllers/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;Looking for the entire 7 part guide? &lt;a href=&#34;https://andrewodendaal.com/teach-me-kubernetes-part1-overview/#follow-the-entire-guide/&#34;&gt;Start at the Overview&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;In Kubernetes, a ReplicationController (also known as a &amp;ldquo;ReplicaSet&amp;rdquo; in newer versions of Kubernetes) is a controller that ensures that a specified number of replicas of a Pod are running at any given time.&lt;/p&gt;&#xA;&lt;p&gt;The ReplicationController is responsible for monitoring the state of the Pods it manages and taking corrective action if the desired state does not match the actual state. For example, if a Pod fails or is terminated, the ReplicationController will create a new Pod to replace it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Teach me Kubernetes - Part 3 - Pods</title>
      <link>https://andrewodendaal.com/teach-me-kubernetes-part3-pods/</link>
      <pubDate>Wed, 12 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/teach-me-kubernetes-part3-pods/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;Looking for the entire 7 part guide? &lt;a href=&#34;https://andrewodendaal.com/teach-me-kubernetes-part1-overview/#follow-the-entire-guide/&#34;&gt;Start at the Overview&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;In Kubernetes, a Pod is the smallest and simplest unit in the cluster. A Pod represents a single instance of a running process in a container, and it encapsulates one or more container images, storage resources, and network configurations. Pods are used to run and manage containerized applications in Kubernetes, and they provide a mechanism for managing and scaling containers.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Docker Networking and Storage Solutions</title>
      <link>https://andrewodendaal.com/articles/docker-networking-storage/</link>
      <pubDate>Wed, 12 Apr 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/docker-networking-storage/</guid>
      <description>&lt;p&gt;Master Docker networking modes.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-and-setup&#34;&gt;Introduction and Setup&lt;/h2&gt;&#xA;&lt;h1 id=&#34;docker-networking-and-storage-introduction-and-setup&#34;&gt;Docker Networking and Storage: Introduction and Setup&lt;/h1&gt;&#xA;&lt;p&gt;Docker networking and storage are fundamental concepts for building scalable, production-ready containerized applications. This guide covers everything from basic concepts to advanced patterns for managing container connectivity and data persistence.&lt;/p&gt;&#xA;&lt;h2 id=&#34;docker-networking-fundamentals&#34;&gt;Docker Networking Fundamentals&lt;/h2&gt;&#xA;&lt;h3 id=&#34;network-types-overview&#34;&gt;Network Types Overview&lt;/h3&gt;&#xA;&lt;p&gt;Docker provides several network drivers:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;┌─────────────────────────────────────────────────────────┐&#xA;│                    Docker Host                          │&#xA;├─────────────────────────────────────────────────────────┤&#xA;│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐     │&#xA;│  │   Bridge    │  │    Host     │  │    None     │     │&#xA;│  │  Network    │  │  Network    │  │  Network    │     │&#xA;│  └─────────────┘  └─────────────┘  └─────────────┘     │&#xA;├─────────────────────────────────────────────────────────┤&#xA;│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐     │&#xA;│  │   Overlay   │  │   Macvlan   │  │   Custom    │     │&#xA;│  │  Network    │  │  Network    │  │  Network    │     │&#xA;│  └─────────────┘  └─────────────┘  └─────────────┘     │&#xA;└─────────────────────────────────────────────────────────┘&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;basic-network-commands&#34;&gt;Basic Network Commands&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# List networks&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker network ls&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Inspect network&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker network inspect bridge&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Create custom network&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker network create mynetwork&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Create network with specific driver&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker network create --driver bridge mybridge&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Create network with custom subnet&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker network create --subnet&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;172.20.0.0/16 mysubnet&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Connect container to network&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker network connect mynetwork mycontainer&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Disconnect container from network&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker network disconnect mynetwork mycontainer&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Remove network&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker network rm mynetwork&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;bridge-networks&#34;&gt;Bridge Networks&lt;/h3&gt;&#xA;&lt;p&gt;Default bridge network:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Teach me Kubernetes - Part 2 - Nodes</title>
      <link>https://andrewodendaal.com/teach-me-kubernetes-part2-nodes/</link>
      <pubDate>Tue, 11 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/teach-me-kubernetes-part2-nodes/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;Looking for the entire 7 part guide? &lt;a href=&#34;https://andrewodendaal.com/teach-me-kubernetes-part1-overview/#follow-the-entire-guide/&#34;&gt;Start at the Overview&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;In Kubernetes, a Node is a worker machine that runs containerized applications. Nodes are responsible for running Pods, which are the smallest deployable units in Kubernetes.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://andrewodendaal.com/kubernetes-mastery&#34;&gt;Nodes in a Kubernetes cluster&lt;/a&gt; can be physical or virtual machines, and they typically have multiple CPUs and large amounts of memory and storage. Each Node runs a container runtime, such as Docker or containerd, which is responsible for managing the containers that run on the Node.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Teach me Kubernetes - Part 1 - Overview</title>
      <link>https://andrewodendaal.com/teach-me-kubernetes-part1-overview/</link>
      <pubDate>Mon, 10 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/teach-me-kubernetes-part1-overview/</guid>
      <description>&lt;p&gt;Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications. With Kubernetes, you can manage containerized applications across multiple hosts, scale them up or down as needed, and even roll out updates without downtime.&lt;/p&gt;&#xA;&lt;p&gt;Here are some key concepts you need to understand to get started with Kubernetes:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Nodes: A node is a physical or virtual machine that runs your containerized applications. It can be a virtual machine running in a cloud provider or a physical server in your data center.&lt;/li&gt;&#xA;&lt;li&gt;Pods: A pod is the smallest &lt;a href=&#34;https://andrewodendaal.com/teach-me-kubernetes-part3-pods&#34;&gt;deployable unit in Kubernetes&lt;/a&gt;. It&amp;rsquo;s a logical host for one or more containers, and it runs on a node. A pod can contain one or more containers that share the same network namespace, and can communicate with each other using local IP addresses.&lt;/li&gt;&#xA;&lt;li&gt;Replication Controllers: A replication controller ensures that a specified number of replicas of a pod are running at all times. If a pod goes down, the replication controller creates a new one to replace it.&lt;/li&gt;&#xA;&lt;li&gt;Services: &lt;a href=&#34;https://andrewodendaal.com/teach-me-kubernetes-part5-services&#34;&gt;A service&lt;/a&gt; is an abstraction layer that provides a stable IP address and DNS name for a set of pods. It acts as a load balancer, routing traffic to the appropriate pod based on a set of rules.&lt;/li&gt;&#xA;&lt;li&gt;Deployments: &lt;a href=&#34;https://andrewodendaal.com/teach-me-kubernetes-part6-deployments&#34;&gt;A deployment&lt;/a&gt; manages the rollout and updates of a set of pods. It&amp;rsquo;s a higher-level concept that allows you to declaratively manage the desired state of your application.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;To get started with Kubernetes, you&amp;rsquo;ll need to install a Kubernetes cluster on your local machine or on a cloud provider. You can then use the Kubernetes command-line interface (kubectl) to create and manage resources in your cluster.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create a Simple Chatbot in Python</title>
      <link>https://andrewodendaal.com/how-to-create-a-simple-chatbot-in-python/</link>
      <pubDate>Sun, 09 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-simple-chatbot-in-python/</guid>
      <description>&lt;p&gt;This is a simple chatbot in Python using the NLTK library.&lt;/p&gt;&#xA;&lt;p&gt;See the below example Python code:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Import necessary libraries&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;from&lt;/span&gt; nltk.chat.util &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; Chat, reflections&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Define your chatbot&amp;#39;s responses&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;responses &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;hello&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Hello, how can I assist you?&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;hi&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Hi there! How can I help you today?&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;how are you&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;I&amp;#39;m doing well, thank you for asking.&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;what can you do&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;I can help you with tasks such as finding information, setting reminders, and more!&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;bye&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Goodbye, have a nice day!&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Create a Chat instance with your responses&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;chatbot &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; Chat(responses, reflections)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Start chatting!&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;chatbot&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;converse()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In this example, we&amp;rsquo;ve defined a dictionary of responses for our chatbot to use. The keys of the dictionary are the inputs that the user might enter, and the values are the chatbot&amp;rsquo;s responses. We then create a Chat instance with these responses and the reflections dictionary, which helps the chatbot handle variations of user input (such as changing &amp;ldquo;you are&amp;rdquo; to &amp;ldquo;I am&amp;rdquo; in responses).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Create Transit Gateway with Attachments in Terraform</title>
      <link>https://andrewodendaal.com/create-transit-gateway-attachments-terraform/</link>
      <pubDate>Sat, 08 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/create-transit-gateway-attachments-terraform/</guid>
      <description>&lt;p&gt;The following example Terraform code snippet creates a Transit Gateway with VPC and VPN attachments:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-terraform&#34; data-lang=&#34;terraform&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;provider&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;region&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;us-west-2&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Create a transit gateway&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_ec2_transit_gateway&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;example&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;description&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Example transit gateway&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Create a VPC attachment&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_ec2_transit_gateway_vpc_attachment&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;example_vpc_attachment&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;subnet_ids&lt;/span&gt;         &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; [&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;subnet-abc123&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;subnet-def456&amp;#34;&lt;/span&gt;]&lt;span style=&#34;color:#75715e&#34;&gt;  # IDs of the subnets in the VPC to attach&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;transit_gateway_id&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;aws_ec2_transit_gateway&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;example&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;id&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;vpc_id&lt;/span&gt;             &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;vpc-xyz789&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;  # ID of the VPC to attach&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;}&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Create a VPN attachment&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_ec2_transit_gateway_vpn_attachment&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;example_vpn_attachment&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;transit_gateway_id&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;aws_ec2_transit_gateway&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;example&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;id&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;vpn_connection_id&lt;/span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;vpn-123456&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;  # ID of the VPN connection to attach&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In this example, we&amp;rsquo;re using the aws_ec2_transit_gateway resource type to create a transit gateway in the us-west-2 region. We&amp;rsquo;re specifying a description parameter to provide a description for the transit gateway.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Docker and Kubernetes Integration</title>
      <link>https://andrewodendaal.com/articles/docker-kubernetes-integration/</link>
      <pubDate>Sat, 08 Apr 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/docker-kubernetes-integration/</guid>
      <description>&lt;p&gt;Seamlessly integrate Docker containers with Kubernetes for scalable.&lt;/p&gt;&#xA;&lt;h2 id=&#34;understanding-the-foundation&#34;&gt;Understanding the Foundation&lt;/h2&gt;&#xA;&lt;h1 id=&#34;understanding-docker-and-kubernetes-integration&#34;&gt;Understanding Docker and Kubernetes Integration&lt;/h1&gt;&#xA;&lt;p&gt;When I first started working with containers, I thought Docker and Kubernetes were competing technologies. That couldn&amp;rsquo;t be further from the truth. They&amp;rsquo;re actually perfect partners in the container ecosystem, each handling different aspects of the containerization journey.&lt;/p&gt;&#xA;&lt;p&gt;Think of Docker as your master craftsman - it builds, packages, and runs individual containers with precision. Kubernetes, on the other hand, is like an orchestra conductor, coordinating hundreds or thousands of these containers across multiple machines to create a harmonious, scalable application.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create an AWS EC2 Instance in Terraform</title>
      <link>https://andrewodendaal.com/how-to-create-an-aws-ec2-instance-in-terraform/</link>
      <pubDate>Fri, 07 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-an-aws-ec2-instance-in-terraform/</guid>
      <description>&lt;p&gt;The following Terraform code snippet creates an EC2 instance for you.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-terraform&#34; data-lang=&#34;terraform&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;provider&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;region&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;us-west-2&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;resource&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;aws_instance&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;example&amp;#34;&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;ami&lt;/span&gt;           &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;ami-0c94855ba95c71c99&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;  # Amazon Linux 2 AMI&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;instance_type&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;t2.micro&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;key_name&lt;/span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;example-keypair&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;tags&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#a6e22e&#34;&gt;Name&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;example-instance&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In this example, we&amp;rsquo;re using the aws_instance resource type to create an EC2 instance in the us-west-2 region. We&amp;rsquo;re using the ami parameter to specify the Amazon Linux 2 AMI ID, and the instance_type parameter to specify a t2.micro instance type. We&amp;rsquo;re also specifying a key pair to use for SSH access with the key_name parameter.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Primer on Terraform Concepts</title>
      <link>https://andrewodendaal.com/a-primer-on-terraform-concepts/</link>
      <pubDate>Thu, 06 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/a-primer-on-terraform-concepts/</guid>
      <description>&lt;p&gt;Terraform is an open-source tool for building, changing, and versioning infrastructure safely and efficiently. It allows you to describe your infrastructure as code and manage it in a version-controlled way, just like you would with application code.&lt;/p&gt;&#xA;&lt;p&gt;Here are the basic steps of how Terraform works:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Write your infrastructure code: You &lt;a href=&#34;https://andrewodendaal.com/iac-guide-modern-software-development&#34;&gt;write infrastructure code&lt;/a&gt; in the Terraform configuration language (HCL) to describe the resources you want to create. You can define resources like servers, load balancers, databases, and more, as well as their configurations and relationships.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Learn Recursion by Example in Python</title>
      <link>https://andrewodendaal.com/how-to-learn-recursion-by-example-in-python/</link>
      <pubDate>Wed, 05 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-learn-recursion-by-example-in-python/</guid>
      <description>&lt;p&gt;Here&amp;rsquo;s an example code in Python that demonstrates recursion:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;factorial&lt;/span&gt;(n):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; n &lt;span style=&#34;color:#f92672&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;else&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; n &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; factorial(n&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;print(factorial(&lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;))  &lt;span style=&#34;color:#75715e&#34;&gt;# Output: 120&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This code defines a function factorial that calculates the factorial of a given number n. The factorial of a number is the product of all positive integers up to and including that number. For example, the factorial of 5 is 5 x 4 x 3 x 2 x 1 = 120.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Understanding Site Reliability Engineering (SRE)</title>
      <link>https://andrewodendaal.com/understanding-site-reliability-engineering-sre/</link>
      <pubDate>Tue, 04 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/understanding-site-reliability-engineering-sre/</guid>
      <description>&lt;p&gt;Site Reliability Engineering (SRE) can also help organizations to be more proactive in identifying and addressing potential issues before they become major problems. By monitoring system performance and using data-driven insights, SRE teams can detect and respond to issues more quickly, reducing the impact on customers and the business. This can help to increase uptime and reduce the cost of downtime, which can have a direct impact on revenue and profitability.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What is DevOps?</title>
      <link>https://andrewodendaal.com/what-is-devops/</link>
      <pubDate>Mon, 03 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/what-is-devops/</guid>
      <description>&lt;p&gt;DevOps is a term that combines &amp;ldquo;development&amp;rdquo; and &amp;ldquo;operations.&amp;rdquo; It is a methodology that aims to bridge the gap between the software development and IT operations teams. DevOps is a set of practices that focuses on automating the software development process, reducing the time between writing code and deploying it to production, and ensuring a high level of quality in the delivered software.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-to-devops&#34;&gt;Introduction to DevOps&lt;/h2&gt;&#xA;&lt;p&gt;DevOps is a set of practices that combines software development and IT operations. The goal of DevOps is to shorten the system&amp;rsquo;s development cycle and provide more reliable software releases. It is a methodology that aims to bridge the gap between the software development and IT operations teams. DevOps is a culture that emphasizes communication and collaboration between teams.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create a Password Generator in Golang</title>
      <link>https://andrewodendaal.com/how-to-create-a-password-generator-in-golang/</link>
      <pubDate>Sun, 02 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-password-generator-in-golang/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;In today&amp;rsquo;s digital age, password security is more important than ever before. Hackers can easily guess weak passwords, leading to identity theft and other cybersecurity breaches. To ensure our online safety, we need to use strong and secure passwords that are difficult to guess. A good password generator can help us create random and strong passwords. In this blog post, we&amp;rsquo;ll discuss how to create a password generator in Golang.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How does Disaster Recovery work in the Cloud?</title>
      <link>https://andrewodendaal.com/how-does-disaster-recovery-work-in-the-cloud/</link>
      <pubDate>Sat, 01 Apr 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-does-disaster-recovery-work-in-the-cloud/</guid>
      <description>&lt;p&gt;Disaster Recovery (DR) in the cloud refers to the process of recovering IT infrastructure and data in the event of a disaster, such as a natural disaster or a cyber attack, in a cloud environment. Cloud-based Disaster Recovery (DR) is different from traditional DR because it utilizes cloud services and technologies to protect data and applications and minimize downtime.&lt;/p&gt;&#xA;&lt;p&gt;Some key elements involved in implementing a Disaster Recovery plan in the cloud covers topics such as the following.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What is DevOps and why is it important?</title>
      <link>https://andrewodendaal.com/what-is-devops-and-why-is-it-important/</link>
      <pubDate>Fri, 31 Mar 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/what-is-devops-and-why-is-it-important/</guid>
      <description>&lt;p&gt;DevOps is a software development methodology that emphasizes collaboration and communication between software developers and IT operations teams. It is a set of practices that seeks to streamline the software development lifecycle, from planning and coding to testing and deployment, through the use of automation, monitoring, and iterative development processes.&lt;/p&gt;&#xA;&lt;p&gt;The primary goal of DevOps is to deliver software more quickly, reliably, and efficiently by breaking down silos between development and operations teams and encouraging continuous feedback and improvement. By aligning development and operations teams, DevOps seeks to reduce time-to-market, improve software quality, and enhance overall business agility.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Docker Fundamentals: Containerization Basics</title>
      <link>https://andrewodendaal.com/articles/docker-fundamentals/</link>
      <pubDate>Fri, 31 Mar 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/docker-fundamentals/</guid>
      <description>&lt;p&gt;Learn the essential concepts and practical skills needed to containerize applications using Docker, from basic commands to production-ready deployments.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction-and-setup&#34;&gt;Introduction and Setup&lt;/h2&gt;&#xA;&lt;h1 id=&#34;introduction-to-docker-and-containerization&#34;&gt;Introduction to Docker and Containerization&lt;/h1&gt;&#xA;&lt;p&gt;Docker revolutionizes application deployment by packaging applications and their dependencies into lightweight, portable containers that run consistently across different environments.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-docker&#34;&gt;What is Docker?&lt;/h2&gt;&#xA;&lt;p&gt;Docker is a containerization platform that allows you to package applications with all their dependencies into portable containers. Think of containers as lightweight, standalone packages that include everything needed to run an application: code, runtime, system tools, libraries, and settings.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What is the Zen of Python?</title>
      <link>https://andrewodendaal.com/what-is-the-zen-of-python/</link>
      <pubDate>Thu, 30 Mar 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/what-is-the-zen-of-python/</guid>
      <description>&lt;p&gt;The Zen of Python is an &lt;em&gt;Easter Egg&lt;/em&gt; that long time Pythoneer (Tim Peters) channeled the guiding principals for the &lt;a href=&#34;https://andrewodendaal.com/programming-languages-series&#34;&gt;language&amp;rsquo;s design principals&lt;/a&gt; into 20 aphorisms, of which only 19 of them are written down.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-access-this-zen-of-python-easter-egg&#34;&gt;How to access this &lt;code&gt;Zen of Python&lt;/code&gt; Easter Egg&lt;/h2&gt;&#xA;&lt;p&gt;By importing &lt;code&gt;this&lt;/code&gt; into your Python application, it will immediately print as follows:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; this&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;what-is-the-zen-of-python&#34;&gt;What is the &lt;code&gt;Zen of Python&lt;/code&gt;?&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Beautiful is better than ugly.&lt;!-- raw HTML omitted --&gt;&#xA;Explicit is better than implicit.&lt;!-- raw HTML omitted --&gt;&#xA;Simple is better than complex.&lt;!-- raw HTML omitted --&gt;&#xA;Complex is better than complicated.&lt;!-- raw HTML omitted --&gt;&#xA;Flat is better than nested.&lt;!-- raw HTML omitted --&gt;&#xA;Sparse is better than dense.&lt;!-- raw HTML omitted --&gt;&#xA;Readability counts.&lt;!-- raw HTML omitted --&gt;&#xA;Special cases aren&amp;rsquo;t special enough to break the rules.&lt;!-- raw HTML omitted --&gt;&#xA;Although practicality beats purity.&lt;!-- raw HTML omitted --&gt;&#xA;Errors should never pass silently.&lt;!-- raw HTML omitted --&gt;&#xA;Unless explicitly silenced.&lt;!-- raw HTML omitted --&gt;&#xA;In the face of ambiguity, refuse the temptation to guess.&lt;!-- raw HTML omitted --&gt;&#xA;There should be one&amp;ndash; and preferably only one &amp;ndash;obvious way to do it.&lt;!-- raw HTML omitted --&gt;&#xA;Although that way may not be obvious at first unless you&amp;rsquo;re Dutch.&lt;!-- raw HTML omitted --&gt;&#xA;Now is better than never.&lt;!-- raw HTML omitted --&gt;&#xA;Although never is often better than &lt;em&gt;right&lt;/em&gt; now.&lt;!-- raw HTML omitted --&gt;&#xA;If the implementation is hard to explain, it&amp;rsquo;s a bad idea.&lt;!-- raw HTML omitted --&gt;&#xA;If the implementation is easy to explain, it may be a good idea.&lt;!-- raw HTML omitted --&gt;&#xA;Namespaces are one honking great idea &amp;ndash; let&amp;rsquo;s do more of those!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Bash: Convert HTML to Markdown Recursively with Pandoc</title>
      <link>https://andrewodendaal.com/bash-convert-html-markdown-recursively-pandoc/</link>
      <pubDate>Wed, 29 Mar 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/bash-convert-html-markdown-recursively-pandoc/</guid>
      <description>&lt;p&gt;You can recursively convert all your HTML files to Mardown format in Bash, by using Pandoc.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;find . &lt;span style=&#34;color:#ae81ff&#34;&gt;\-&lt;/span&gt;name &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;*.ht*&amp;#34;&lt;/span&gt; | &lt;span style=&#34;color:#66d9ef&#34;&gt;while&lt;/span&gt; read i; &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt; pandoc -f html -t markdown &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$i&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; -o &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;i%.*&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;.md&amp;#34;&lt;/span&gt;; &lt;span style=&#34;color:#66d9ef&#34;&gt;done&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>How to Create a Password Generator in C&#43;&#43;</title>
      <link>https://andrewodendaal.com/how-to-create-a-password-generator-in-cpp/</link>
      <pubDate>Mon, 27 Mar 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-password-generator-in-cpp/</guid>
      <description>&lt;p&gt;You can easily create a password generator in C++ with the following simple method.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-create-the-password-generator-in-c&#34;&gt;How to create the Password Generator in C++&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-c++&#34; data-lang=&#34;c++&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#include&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#include&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;&amp;lt;string&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#include&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;&amp;lt;algorithm&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#include&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;&amp;lt;random&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;std&lt;span style=&#34;color:#f92672&#34;&gt;::&lt;/span&gt;string generate_password(&lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt; length &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;16&lt;/span&gt;) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    std&lt;span style=&#34;color:#f92672&#34;&gt;::&lt;/span&gt;string seed &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; string(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;#34;&lt;/span&gt;) &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; string(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;0123456789&amp;#34;&lt;/span&gt;) &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; string(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;!@#$%^&amp;amp;*()_+=-{}[]&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;\\&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;|:;&amp;lt;&amp;gt;,.?/&amp;#34;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    std&lt;span style=&#34;color:#f92672&#34;&gt;::&lt;/span&gt;string password_string &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; seed;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    std&lt;span style=&#34;color:#f92672&#34;&gt;::&lt;/span&gt;shuffle(password_string.begin(), password_string.end(), std&lt;span style=&#34;color:#f92672&#34;&gt;::&lt;/span&gt;mt19937{std&lt;span style=&#34;color:#f92672&#34;&gt;::&lt;/span&gt;random_device{}()});&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; password_string.substr(&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;, length);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;main&lt;/span&gt;() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    std&lt;span style=&#34;color:#f92672&#34;&gt;::&lt;/span&gt;cout &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; generate_password() &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; std&lt;span style=&#34;color:#f92672&#34;&gt;::&lt;/span&gt;endl;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    std&lt;span style=&#34;color:#f92672&#34;&gt;::&lt;/span&gt;cout &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; generate_password(&lt;span style=&#34;color:#ae81ff&#34;&gt;28&lt;/span&gt;) &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; std&lt;span style=&#34;color:#f92672&#34;&gt;::&lt;/span&gt;endl;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>How do you architect Disaster Recovery in AWS?</title>
      <link>https://andrewodendaal.com/how-do-you-architect-disaster-recovery-in-aws/</link>
      <pubDate>Sun, 26 Mar 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-do-you-architect-disaster-recovery-in-aws/</guid>
      <description>&lt;p&gt;Disaster recovery (DR) in AWS involves creating a plan and set of procedures to help your organization recover from a catastrophic event, such as a natural disaster, power outage, or cyber attack, that could impact your business operations. AWS provides a range of tools and services to help you architect an effective DR solution in the cloud.&lt;/p&gt;&#xA;&lt;p&gt;Here are the high-level steps to architect a Disaster Recovery solution in AWS:&lt;/p&gt;</description>
    </item>
    <item>
      <title>What options exist for Infrastructure as Code (IaC)</title>
      <link>https://andrewodendaal.com/what-options-exist-for-infrastructure-as-code-iac/</link>
      <pubDate>Sat, 25 Mar 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/what-options-exist-for-infrastructure-as-code-iac/</guid>
      <description>&lt;p&gt;There are several options for Infrastructure as Code (IaC) tools that can help automate the provisioning and management of infrastructure resources, such as servers, networks, and storage, in a reliable and reproducible way. Here are some of the most popular IaC options:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Terraform: An open-source tool by HashiCorp that supports a wide range of infrastructure providers, including AWS, Azure, Google Cloud, and more. Terraform uses a declarative language to describe infrastructure as code and can manage both low-level and high-level resources.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to learn Java in 1 day</title>
      <link>https://andrewodendaal.com/how-to-learn-java-in-1-day/</link>
      <pubDate>Fri, 24 Mar 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-learn-java-in-1-day/</guid>
      <description>&lt;p&gt;Learning Java in one day is not a realistic goal, as Java is a complex programming language that requires time and practice to master. However, here are some tips to get you started:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Start with the basics: Before diving into complex topics, learn the basics of Java, such as variables, data types, control structures, and object-oriented programming principles.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Watch tutorials and read documentation: There are many resources available online that can help you learn Java quickly. Watch video tutorials and read documentation to gain a basic understanding of the language.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to read user input as numbers in Python</title>
      <link>https://andrewodendaal.com/how-to-read-user-input-as-numbers-in-python/</link>
      <pubDate>Thu, 23 Mar 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-read-user-input-as-numbers-in-python/</guid>
      <description>&lt;p&gt;In Python 3 onwards, the &lt;code&gt;input&lt;/code&gt; function returns a &lt;code&gt;string&lt;/code&gt; type..&lt;/p&gt;&#xA;&lt;h2 id=&#34;int-value&#34;&gt;&lt;code&gt;int&lt;/code&gt; value&lt;/h2&gt;&#xA;&lt;p&gt;You can explicitly convert this into an &lt;code&gt;int&lt;/code&gt; type.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;val &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; int(input(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Enter a number: &amp;#34;&lt;/span&gt;))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;float-value&#34;&gt;&lt;code&gt;float&lt;/code&gt; value&lt;/h2&gt;&#xA;&lt;p&gt;If you need to accept fractional components, then simply swap this out with a &lt;code&gt;float&lt;/code&gt; type:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;val &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; float(input(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Enter a number:&amp;#34;&lt;/span&gt;))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;map-multiple-values&#34;&gt;&lt;code&gt;map&lt;/code&gt; multiple values&lt;/h2&gt;&#xA;&lt;p&gt;If you have multiple integers in a single line, then you can use &lt;code&gt;map&lt;/code&gt; to extract them into a &lt;code&gt;list&lt;/code&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Capitalize First Letter of Each Word in Python</title>
      <link>https://andrewodendaal.com/capitalize-letter-word-python/</link>
      <pubDate>Wed, 22 Mar 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/capitalize-letter-word-python/</guid>
      <description>&lt;p&gt;If you have a sentence containing multiple words, and you want each of the words to start with a capital letter, then you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1---using-stringcapwords&#34;&gt;Option 1 - using &lt;code&gt;string.capwords()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; string&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;string&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;capwords(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;this is a test!&amp;#39;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt; &lt;code&gt;&#39;This Is A Test!&#39;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-2---using-title&#34;&gt;Option 2 - using &lt;code&gt;title()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;this is a test!&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;title()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt; &lt;code&gt;&#39;This Is A Test!&#39;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-3---using-join-split-and-list-comprehensions&#34;&gt;Option 3 - using &lt;code&gt;join()&lt;/code&gt;, &lt;code&gt;split()&lt;/code&gt; and &lt;code&gt;list comprehensions&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34; &amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;join(w&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;capitalize() &lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; w &lt;span style=&#34;color:#f92672&#34;&gt;in&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;this is a test!&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;split())&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt; &lt;code&gt;&#39;This Is A Test!&#39;&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create a Password Generator in Python</title>
      <link>https://andrewodendaal.com/how-to-create-a-password-generator-in-python/</link>
      <pubDate>Thu, 16 Mar 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-password-generator-in-python/</guid>
      <description>&lt;p&gt;You can easily create a password generator in Python with the following simple method.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-create-the-password-generator-in-python&#34;&gt;How to create the Password Generator in Python&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; string&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; random&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;generate_password&lt;/span&gt;(length&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;16&lt;/span&gt;):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    seed &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;f&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;{&lt;/span&gt;string&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;ascii_letters&lt;span style=&#34;color:#e6db74&#34;&gt;}{&lt;/span&gt;string&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;ascii_lowercase&lt;span style=&#34;color:#e6db74&#34;&gt;}{&lt;/span&gt;string&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;ascii_uppercase&lt;span style=&#34;color:#e6db74&#34;&gt;}{&lt;/span&gt;string&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;punctuation&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    password_string &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; [x &lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; x &lt;span style=&#34;color:#f92672&#34;&gt;in&lt;/span&gt; seed]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    random&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;shuffle(password_string)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;join(password_string[:length])&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;how-to-use-the-password-generator-in-python&#34;&gt;How to use the Password Generator in Python&lt;/h2&gt;&#xA;&lt;p&gt;With this function, you can either call the &lt;code&gt;generate_password()&lt;/code&gt; function without any arguments, and it will generate a &lt;code&gt;16&lt;/code&gt; digit long password, unless you need a longer one, then pass in an integer to specify the lengh of the password you would like. e.g. &lt;code&gt;generate_password(28)&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>GitOps Workflow Implementation</title>
      <link>https://andrewodendaal.com/articles/devops-gitops-workflow/</link>
      <pubDate>Wed, 15 Mar 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/devops-gitops-workflow/</guid>
      <description>&lt;p&gt;Implement GitOps practices for infrastructure and application deployment using Git as the single source of truth for declarative infrastructure and applications.&lt;/p&gt;&#xA;&lt;h4 id=&#34;understanding-gitops-core-principles-and-benefits&#34;&gt;Understanding GitOps: Core Principles and Benefits&lt;/h4&gt;&#xA;&lt;p&gt;Before diving into implementation details, let&amp;rsquo;s establish a clear understanding of GitOps principles and benefits.&lt;/p&gt;&#xA;&lt;h4 id=&#34;core-gitops-principles&#34;&gt;Core GitOps Principles&lt;/h4&gt;&#xA;&lt;p&gt;GitOps is built on four fundamental principles:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;Declarative Configuration&lt;/strong&gt;: The entire system is described declaratively, typically using YAML or JSON files that specify the desired state.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Convert Bytes to a String in Python</title>
      <link>https://andrewodendaal.com/how-to-convert-bytes-to-a-string-in-python/</link>
      <pubDate>Tue, 14 Mar 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-bytes-to-a-string-in-python/</guid>
      <description>&lt;p&gt;If you need to convert bytes to a string in Python, then you can do the following:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;your_string &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;b&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;This works &lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;\xE2\x9C\x85&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;decode(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;utf-8&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;print(your_string)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;This works ✅&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that in the above example, we have converted a &lt;code&gt;utf-8&lt;/code&gt; string to.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to measure the elapsed time in Python</title>
      <link>https://andrewodendaal.com/how-to-measure-the-elapsed-time-in-python/</link>
      <pubDate>Mon, 13 Mar 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-measure-the-elapsed-time-in-python/</guid>
      <description>&lt;h2 id=&#34;option-1---using-the-time-module&#34;&gt;Option 1 - using the &lt;code&gt;time&lt;/code&gt; module&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; time&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;start &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; time&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;time()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;print(&lt;span style=&#34;color:#ae81ff&#34;&gt;23&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;2.3&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;end &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; time&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;time()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;print(end &lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt; start)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;52.9&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;3.600120544433594e-05&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;option-2---using-the-timeit-module&#34;&gt;Option 2 - using the &lt;code&gt;timeit&lt;/code&gt; module&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;from&lt;/span&gt; timeit &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; default_timer &lt;span style=&#34;color:#66d9ef&#34;&gt;as&lt;/span&gt; timer&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;start &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; timer()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;print(&lt;span style=&#34;color:#ae81ff&#34;&gt;23&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;2.3&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;end &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; timer()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;print(end &lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt; start)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;52.9&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;6.355400000000039e-05&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>How to Change a MariaDB/MySQL Data Directory to a New Location on Linux</title>
      <link>https://andrewodendaal.com/how-to-change-a-mariadb-data-directory-to-a-new-location-on-linux/</link>
      <pubDate>Tue, 07 Mar 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-change-a-mariadb-data-directory-to-a-new-location-on-linux/</guid>
      <description>&lt;h2 id=&#34;step-1--moving-the-mariadb-data-directory&#34;&gt;Step 1 — Moving the MariaDB Data Directory&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;mysql -u root -p&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;select @@datadir;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Output:&#xA;  +-----------------+&#xA;  | @@datadir       |&#xA;  +-----------------+&#xA;  | /var/lib/mysql/ |&#xA;  +-----------------+&#xA;  1 row in set (0.00 sec)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;exit&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo systemctl stop mariadb&#xA;sudo systemctl status mariadb&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Output:&#xA;  mysql systemd[1]: Stopped MariaDB database server.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo rsync -av /var/lib/mysql /mnt/my-volume-01&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo mv /var/lib/mysql /var/lib/mysql.bak&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2--pointing-to-the-new-data-location&#34;&gt;Step 2 — Pointing to the New Data Location&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo vi /etc/my.cnf&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[mysqld]&#xA;. . .&#xA;datadir=/mnt/my-volume-01/mysql&#xA;socket=/mnt/my-volume-01/mysql/mysql.sock&#xA;. . .&#xA;&#xA;[client]&#xA;port=3306&#xA;socket=/mnt/my-volume-01/mysql/mysql.sock&#xA;&#xA;!includedir /etc/my.cnf.d&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-3--restarting-mariadb&#34;&gt;Step 3 — Restarting MariaDB&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo systemctl start mariadb&#xA;sudo systemctl status mariadb&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;mysql -u root -p&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;select @@datadir;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Output&#xA;+----------------------------+&#xA;| @@datadir                  |&#xA;+----------------------------+&#xA;| /mnt/my-volume-01/mysql/ |&#xA;+----------------------------+&#xA;1 row in set (0.01 sec)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;exit&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;cleanup&#34;&gt;Cleanup&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo rm -Rf /var/lib/mysql.bak&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>[Solved] Docker Daemon Connection Error: Daemon Running?</title>
      <link>https://andrewodendaal.com/solved-docker-daemon-connection-error-daemon-running/</link>
      <pubDate>Sat, 04 Mar 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/solved-docker-daemon-connection-error-daemon-running/</guid>
      <description>&lt;p&gt;If you get the following error when trying to run a Docker container:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running?&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then you can resolve it by running the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;systemctl start docker&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If this doesn&amp;rsquo;t work because of a &lt;code&gt;root&lt;/code&gt; user issue, then you can do the following first:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;gpasswd -a $USER docker&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;additional-issues&#34;&gt;Additional issues?&lt;/h2&gt;&#xA;&lt;h3 id=&#34;issue-1&#34;&gt;Issue 1&lt;/h3&gt;&#xA;&lt;p&gt;If you have tried the above, and get this error:&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] M1 Docker Image Platform Mismatch with Host (ARM64)</title>
      <link>https://andrewodendaal.com/solved-m1-docker-image-platform-mismatch-host-arm64/</link>
      <pubDate>Fri, 03 Mar 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/solved-m1-docker-image-platform-mismatch-host-arm64/</guid>
      <description>&lt;p&gt;If you get the following error when trying to run a Docker container that was built on an M1 mac:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;M1 docker preview and keycloak &#39;image&#39;s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8)&#39; Issue&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution&#34;&gt;The solution&lt;/h2&gt;&#xA;&lt;p&gt;Then you can do simply add the following argument to your &lt;code&gt;docker build&lt;/code&gt; command.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;--platform linux/amd64&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;where-this-goes&#34;&gt;Where this goes&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;docker build --platform linux/amd64 -t your_docker_item .&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to get the SHA512 sum of a string using Python</title>
      <link>https://andrewodendaal.com/how-to-get-the-sha512-sum-of-a-string-using-python/</link>
      <pubDate>Thu, 02 Mar 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-sha512-sum-of-a-string-using-python/</guid>
      <description>&lt;p&gt;If you need to get the SHA512 sum of a string using Python, then you can do the following.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1&#34;&gt;Step 1&lt;/h2&gt;&#xA;&lt;p&gt;Firstly, we need to use the &lt;code&gt;hashlib&lt;/code&gt; module:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import hashlib&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2&#34;&gt;Step 2&lt;/h2&gt;&#xA;&lt;p&gt;Now make sure that the input string is encoded correctly.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;your_input = &amp;#34;this is your input string&amp;#34;.encode(&amp;#39;utf-8&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-3&#34;&gt;Step 3&lt;/h2&gt;&#xA;&lt;p&gt;Finally use the &lt;code&gt;sha512&lt;/code&gt; function of the &lt;code&gt;hashlib&lt;/code&gt; module, and get the &lt;code&gt;hexdigest()&lt;/code&gt; value from it:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;hashlib.sha512(your_input).hexdigest()&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;putting-it-all-together&#34;&gt;Putting it all together&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import hashlib&#xA;&#xA;your_input = &amp;#34;this is your input string&amp;#34;.encode(&amp;#39;utf-8&amp;#39;)&#xA;hashed = hashlib.sha512(your_input).hexdigest()&#xA;&#xA;print(hashed)&#xA;&#xA;# --&amp;gt; 74cf60b5a22c401454e36193a65e7efeb5a7d72db9e1f786975e7bd2b7bdd12dee83f99e78542d0eca5c9152f09f397d0ac8de68275ca353837b28f938e429f4&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to get the SHA256 sum of a string using Python</title>
      <link>https://andrewodendaal.com/how-to-get-the-sha256-sum-of-a-string-using-python/</link>
      <pubDate>Wed, 01 Mar 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-sha256-sum-of-a-string-using-python/</guid>
      <description>&lt;p&gt;If you need to get the SHA256 sum of a string using Python, then you can do the following.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1&#34;&gt;Step 1&lt;/h2&gt;&#xA;&lt;p&gt;Firstly, we need to use the &lt;code&gt;hashlib&lt;/code&gt; module:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import hashlib&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2&#34;&gt;Step 2&lt;/h2&gt;&#xA;&lt;p&gt;Now make sure that the input string is encoded correctly.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;your_input = &amp;#34;this is your input string&amp;#34;.encode(&amp;#39;utf-8&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-3&#34;&gt;Step 3&lt;/h2&gt;&#xA;&lt;p&gt;Finally use the &lt;code&gt;sha256&lt;/code&gt; function of the &lt;code&gt;hashlib&lt;/code&gt; module, and get the &lt;code&gt;hexdigest()&lt;/code&gt; value from it:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;hashlib.sha256(your_input).hexdigest()&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;putting-it-all-together&#34;&gt;Putting it all together&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import hashlib&#xA;&#xA;your_input = &amp;#34;this is your input string&amp;#34;.encode(&amp;#39;utf-8&amp;#39;)&#xA;hashed = hashlib.sha256(your_input).hexdigest()&#xA;&#xA;print(hashed)&#xA;&#xA;# --&amp;gt; f7dc376447dcd13fdd6cb2aa20a2327bed1f8a1f3420d52c6fdb55b2b94d9b8e&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to get the MD5 sum of a string using Python</title>
      <link>https://andrewodendaal.com/how-to-get-the-md5-sum-of-a-string-using-python/</link>
      <pubDate>Tue, 28 Feb 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-md5-sum-of-a-string-using-python/</guid>
      <description>&lt;p&gt;If you need to get the MD5 sum of a string using Python, then you can do the following.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1&#34;&gt;Step 1&lt;/h2&gt;&#xA;&lt;p&gt;Firstly, we need to use the &lt;code&gt;hashlib&lt;/code&gt; module:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import hashlib&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2&#34;&gt;Step 2&lt;/h2&gt;&#xA;&lt;p&gt;Now make sure that the input string is encoded correctly.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;your_input = &amp;#34;this is your input string&amp;#34;.encode(&amp;#39;utf-8&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-3&#34;&gt;Step 3&lt;/h2&gt;&#xA;&lt;p&gt;Finally use the &lt;code&gt;md5&lt;/code&gt; function of the &lt;code&gt;hashlib&lt;/code&gt; module, and get the &lt;code&gt;hexdigest()&lt;/code&gt; value from it:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;hashlib.md5(your_input).hexdigest()&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;putting-it-all-together&#34;&gt;Putting it all together&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import hashlib&#xA;&#xA;your_input = &amp;#34;this is your input string&amp;#34;.encode(&amp;#39;utf-8&amp;#39;)&#xA;hashed = hashlib.md5(your_input).hexdigest()&#xA;&#xA;print(hashed)&#xA;&#xA;# --&amp;gt; af0874120fd6196ea1feeebdb6de0e54&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>[Solved] TypeError: datetime Not JSON Serializable</title>
      <link>https://andrewodendaal.com/solved-typeerror-datetime-json-serializable/</link>
      <pubDate>Mon, 27 Feb 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/solved-typeerror-datetime-json-serializable/</guid>
      <description>&lt;p&gt;If you get the following error:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;TypeError: Object of type datetime is not JSON serializable&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;..then you can solve it by using this trick:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;json.dumps(your_dict, indent=4, sort_keys=True, default=str)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Microservices Monitoring and Observability</title>
      <link>https://andrewodendaal.com/articles/devops-microservices-monitoring/</link>
      <pubDate>Sat, 25 Feb 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/devops-microservices-monitoring/</guid>
      <description>&lt;p&gt;Build comprehensive monitoring.&lt;/p&gt;&#xA;&lt;h4 id=&#34;understanding-microservices-observability&#34;&gt;Understanding Microservices Observability&lt;/h4&gt;&#xA;&lt;h4 id=&#34;the-observability-challenge&#34;&gt;The Observability Challenge&lt;/h4&gt;&#xA;&lt;p&gt;Why monitoring microservices is fundamentally different:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Distributed Complexity&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Multiple independent services with their own lifecycles&lt;/li&gt;&#xA;&lt;li&gt;Complex service dependencies and interaction patterns&lt;/li&gt;&#xA;&lt;li&gt;Polyglot environments with different languages and frameworks&lt;/li&gt;&#xA;&lt;li&gt;Dynamic infrastructure with containers and orchestration&lt;/li&gt;&#xA;&lt;li&gt;Asynchronous communication patterns&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Traditional Monitoring Limitations&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Host-centric monitoring insufficient for containerized services&lt;/li&gt;&#xA;&lt;li&gt;Siloed monitoring tools create incomplete visibility&lt;/li&gt;&#xA;&lt;li&gt;Static dashboards can&amp;rsquo;t adapt to dynamic environments&lt;/li&gt;&#xA;&lt;li&gt;Lack of context across service boundaries&lt;/li&gt;&#xA;&lt;li&gt;Difficulty correlating events across distributed systems&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Observability Requirements&lt;/strong&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Return a List of All AWS Lambda Function Names in CLI</title>
      <link>https://andrewodendaal.com/how-to-return-a-list-of-all-aws-lambda-function-names-in-cli/</link>
      <pubDate>Fri, 24 Feb 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-return-a-list-of-all-aws-lambda-function-names-in-cli/</guid>
      <description>&lt;p&gt;If you would like to list all AWS Lambda Function Names in your CLI using the AWS CLI, then you can do this:&lt;/p&gt;&#xA;&lt;h2 id=&#34;get-a-list-of-all-lambda-functions&#34;&gt;Get a List of all Lambda Functions&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws lambda list-functions&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;However, note that this will return a potentially large JSON payload back to your CLI. So what if you only want a list of the function names themselves?&lt;/p&gt;&#xA;&lt;p&gt;You can couple the AWS command above, with the &lt;code&gt;jq&lt;/code&gt; command as follows:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How much faster is Python code?</title>
      <link>https://andrewodendaal.com/how-much-faster-is-python-code/</link>
      <pubDate>Thu, 23 Feb 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-much-faster-is-python-code/</guid>
      <description>&lt;p&gt;The speed of Python code compared to other programming languages depends on a variety of factors, such as the specific task being performed, the libraries and frameworks used, the quality of the code implementation, and the hardware on which the code is executed.&lt;/p&gt;&#xA;&lt;p&gt;In general, Python is an interpreted language, which means that code is executed line-by-line by an interpreter, rather than being compiled into machine code beforehand. This can make Python code slower than compiled languages like C or C++ for some tasks.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Containerization Best Practices for DevOps</title>
      <link>https://andrewodendaal.com/articles/devops-containerization/</link>
      <pubDate>Thu, 23 Feb 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/devops-containerization/</guid>
      <description>&lt;p&gt;Master containerization strategies.&lt;/p&gt;&#xA;&lt;h2 id=&#34;container-fundamentals-and-docker-basics&#34;&gt;Container Fundamentals and Docker Basics&lt;/h2&gt;&#xA;&lt;p&gt;Containers transformed how I think about application deployment. After years of wrestling with &amp;ldquo;it works on my machine&amp;rdquo; problems, containers finally gave us a way to package applications with their entire runtime environment.&lt;/p&gt;&#xA;&lt;h2 id=&#34;why-containers-matter&#34;&gt;Why Containers Matter&lt;/h2&gt;&#xA;&lt;p&gt;Traditional deployment meant installing applications directly on servers, managing dependencies, and hoping everything worked together. I&amp;rsquo;ve seen production outages caused by a missing library version or conflicting Python packages. Containers solve this by packaging everything your application needs into a single, portable unit.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Zip &amp; Encode Dict to String &amp; Back in Python</title>
      <link>https://andrewodendaal.com/zip-encode-dict-string-python/</link>
      <pubDate>Wed, 22 Feb 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/zip-encode-dict-string-python/</guid>
      <description>&lt;p&gt;If you have a Python dictionary, and want to encode it as a string and zip it to save space, perhaps for passing a dictionary through as an environment variable or similar, then you can do the following&lt;/p&gt;&#xA;&lt;h2 id=&#34;zip-then-encode--decode-then-unzip-functions&#34;&gt;Zip then Encode / Decode then Unzip Functions&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import json, gzip, base64&#xA;from io import BytesIO&#xA;&#xA;&#xA;def _zip_then_encode(data: dict) -&amp;gt; str:&#xA;    &amp;#34;&amp;#34;&amp;#34;Gzip and base64 encode a dictionary&amp;#34;&amp;#34;&amp;#34;&#xA;    if type(data) != dict:&#xA;        raise TypeError(&amp;#34;data must be a dictionary&amp;#34;)&#xA;    compressed = BytesIO()&#xA;    with gzip.GzipFile(fileobj=compressed, mode=&amp;#34;w&amp;#34;) as f:&#xA;        json_response = json.dumps(data)&#xA;        f.write(json_response.encode(&amp;#34;utf-8&amp;#34;))&#xA;    return base64.b64encode(compressed.getvalue()).decode(&amp;#34;ascii&amp;#34;)&#xA;&#xA;def _decode_then_unzip(data) -&amp;gt; dict:&#xA;    res = base64.b64decode(data)&#xA;    res = gzip.decompress(res)&#xA;    res = res.decode(&amp;#34;utf-8&amp;#34;)&#xA;    res = json.loads(res)&#xA;    return res&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To use the &lt;code&gt;encode&lt;/code&gt; and &lt;code&gt;decode&lt;/code&gt; functions, you can do the following:&lt;/p&gt;</description>
    </item>
    <item>
      <title>MLOps Best Practices: Operationalizing Machine Learning at Scale</title>
      <link>https://andrewodendaal.com/articles/devops-mlops/</link>
      <pubDate>Sat, 18 Feb 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/devops-mlops/</guid>
      <description>&lt;p&gt;Comprehensive guide to MLOps covering model development.&lt;/p&gt;&#xA;&lt;h4 id=&#34;mlops-fundamentals&#34;&gt;MLOps Fundamentals&lt;/h4&gt;&#xA;&lt;h4 id=&#34;the-ml-lifecycle&#34;&gt;The ML Lifecycle&lt;/h4&gt;&#xA;&lt;p&gt;Understanding the end-to-end machine learning process:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;ML Lifecycle Stages&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Problem definition and scoping&lt;/li&gt;&#xA;&lt;li&gt;Data collection and preparation&lt;/li&gt;&#xA;&lt;li&gt;Feature engineering and selection&lt;/li&gt;&#xA;&lt;li&gt;Model development and training&lt;/li&gt;&#xA;&lt;li&gt;Model evaluation and validation&lt;/li&gt;&#xA;&lt;li&gt;Model deployment and serving&lt;/li&gt;&#xA;&lt;li&gt;Monitoring and maintenance&lt;/li&gt;&#xA;&lt;li&gt;Continuous improvement&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;MLOps vs. Traditional DevOps&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Data and model versioning (not just code)&lt;/li&gt;&#xA;&lt;li&gt;Experiment tracking and reproducibility&lt;/li&gt;&#xA;&lt;li&gt;Model-specific testing requirements&lt;/li&gt;&#xA;&lt;li&gt;Specialized deployment patterns&lt;/li&gt;&#xA;&lt;li&gt;Performance monitoring beyond uptime&lt;/li&gt;&#xA;&lt;li&gt;Retraining workflows&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;MLOps Maturity Levels&lt;/strong&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>What Categories of Websites are there?</title>
      <link>https://andrewodendaal.com/what-categories-of-websites-are-there/</link>
      <pubDate>Fri, 17 Feb 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/what-categories-of-websites-are-there/</guid>
      <description>&lt;p&gt;There are many different categories of websites, but here are some of the most common:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;E-commerce websites: These websites sell products or services online. Examples include Amazon, eBay, and Etsy.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;News websites: These websites provide up-to-date news and information on a variety of topics. Examples include CNN, BBC, and The New York Times.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Blogging websites: These websites are used for personal or business blogs. Examples include WordPress, Blogger, and Medium.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Generate a Random Number between 2 numbers in Python</title>
      <link>https://andrewodendaal.com/how-to-generate-random-number-between-two-numbers-in-python/</link>
      <pubDate>Thu, 16 Feb 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-generate-random-number-between-two-numbers-in-python/</guid>
      <description>&lt;p&gt;If you need to generate a random number between two (2) numbers in Python, then you can make use of the &lt;code&gt;random&lt;/code&gt; module.&lt;/p&gt;&#xA;&lt;p&gt;First, import the module:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import random&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then you can use it like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;random.randint(0, 255)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Another option is to use &lt;code&gt;randrange&lt;/code&gt; and &lt;code&gt;uniform&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from random import randrange, uniform&#xA;&#xA;# randrange gives you an integral value&#xA;irand = randrange(0, 10)&#xA;&#xA;# uniform gives you a floating-point value&#xA;frand = uniform(0, 10)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Install AWS SAM CLI on Mac</title>
      <link>https://andrewodendaal.com/how-to-install-sam-cli-on-mac/</link>
      <pubDate>Wed, 15 Feb 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-install-sam-cli-on-mac/</guid>
      <description>&lt;p&gt;If you need to install AWS SAM CLI on a Mac, then the easiest option is to use Homebrew with the following commands:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;brew tap aws/tap&#xA;brew install aws-sam-cli&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now you can validate the installation as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sam --version&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to count the amount of rows in MariaDB fast</title>
      <link>https://andrewodendaal.com/how-to-count-the-amount-of-rows-in-mariadb-fast/</link>
      <pubDate>Sat, 11 Feb 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-count-the-amount-of-rows-in-mariadb-fast/</guid>
      <description>&lt;p&gt;If you need to find the fastest way to count the number of rows in a massive MariaDB, or MySQL table, then you can do the following instead of performing a &lt;code&gt;select count()&lt;/code&gt; query:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;show table status like &amp;#39;&amp;lt;TABLE_NAME&amp;gt;&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will provide you with a table of information about the table statistics, including the amount of rows.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to find the Product of Consecutive Fib Numbers in Python</title>
      <link>https://andrewodendaal.com/how-to-find-the-product-of-consecutive-fib-numbers-in-python/</link>
      <pubDate>Fri, 10 Feb 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-product-of-consecutive-fib-numbers-in-python/</guid>
      <description>&lt;p&gt;&lt;code&gt;0, 0, 1, 0, 2, 0, 2, 2, 1, 6, 0, 5, 0, 2, 6, 5, 4, 0, 5, 3, 0, 3, …&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;This is the Van Eck&amp;rsquo;s Sequence.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s go through it step by step.&lt;/p&gt;&#xA;&lt;p&gt;Term 1: The first term is 0.&#xA;Term 2: Since we haven’t seen 0 before, the second term is 0.&#xA;Term 3: Since we had seen a 0 before, one step back, the third term is 1&#xA;Term 4: Since we haven’t seen a 1 before, the fourth term is 0&#xA;Term 5: Since we had seen a 0 before, two steps back, the fifth term is 2.&#xA;And so on&amp;hellip;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve Van Eck&#39;s Sequence in Python</title>
      <link>https://andrewodendaal.com/how-to-solve-van-ecks-sequence-in-python/</link>
      <pubDate>Thu, 09 Feb 2023 06:00:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-van-ecks-sequence-in-python/</guid>
      <description>&lt;p&gt;&lt;code&gt;0, 0, 1, 0, 2, 0, 2, 2, 1, 6, 0, 5, 0, 2, 6, 5, 4, 0, 5, 3, 0, 3, …&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;This is the Van Eck&amp;rsquo;s Sequence.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s go through it step by step.&lt;/p&gt;&#xA;&lt;p&gt;Term 1: The first term is 0.&#xA;Term 2: Since we haven’t seen 0 before, the second term is 0.&#xA;Term 3: Since we had seen a 0 before, one step back, the third term is 1&#xA;Term 4: Since we haven’t seen a 1 before, the fourth term is 0&#xA;Term 5: Since we had seen a 0 before, two steps back, the fifth term is 2.&#xA;And so on&amp;hellip;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve: Help the Bookseller Challenge in Python</title>
      <link>https://andrewodendaal.com/how-to-solve-help-the-bookseller-challenge/</link>
      <pubDate>Wed, 08 Feb 2023 16:20:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-help-the-bookseller-challenge/</guid>
      <description>&lt;p&gt;A bookseller has lots of books classified in 26 categories labeled A, B, &amp;hellip; Z. Each book has a code c of 3, 4, 5 or more characters. The 1st character of a code is a capital letter which defines the book category.&lt;/p&gt;&#xA;&lt;p&gt;In the bookseller&amp;rsquo;s stocklist each code c is followed by a space and by a positive integer n (int n &amp;gt;= 0) which indicates the quantity of books of this code in stock.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to solve AWS MediaPackage PackagingGroup Quota Limit</title>
      <link>https://andrewodendaal.com/how-to-solve-aws-mediapackage-packaginggroup-quota-limit/</link>
      <pubDate>Tue, 31 Jan 2023 00:05:00 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-aws-mediapackage-packaginggroup-quota-limit/</guid>
      <description>&lt;p&gt;If you are using AWS Elemental MediaPackage and hit the following error, then you need to either do one of the following:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;code&gt;Error: error waiting for CloudFormation Stack (arn:aws:cloudformation:eu-west-1:800417762774:stack/dev-MediaPackage-Vod-1/511fc7a0-a092-11ed-b853-068baf6ac251) create: failed to create CloudFormation stack, delete requested (DELETE_COMPLETE): [&amp;quot;The following resource(s) failed to create: [PackagingGroup]. Delete requested by user.&amp;quot; &amp;quot;Resource handler returned message: \&amp;quot;Limit exceeded for resource of type &#39;AWS::MediaPackage::PackagingGroup&#39;. Reason: You reached the quota for resource=PackagingGroup. Delete the resources that you don?t need, or request a quota increase. (Service: MediaPackageVod, Status Code: 429, Request ID: bc7a5f31-463e-4ac6-a9a2-438111dd201c)\&amp;quot; (RequestToken: 135f9266-ddcd-1b8d-fdff-00e3837d5dc3, HandlerErrorCode: ServiceLimitExceeded)&amp;quot;]&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Run Cdk Bootstrap</title>
      <link>https://andrewodendaal.com/how-to-run-cdk-bootstrap/</link>
      <pubDate>Mon, 30 Jan 2023 12:07:19 +0400</pubDate>
      <guid>https://andrewodendaal.com/how-to-run-cdk-bootstrap/</guid>
      <description>&lt;p&gt;To &lt;code&gt;bootstrap&lt;/code&gt; an AWS CDK environment, you simply need to do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;npx aws-cdk bootstrap&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&amp;hellip;for each environment that you would like the CD to operate within.&lt;/p&gt;&#xA;&lt;p&gt;This will deploy all the required prerequisites to the AWS account, such as the:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;An Amazon S3 bucket for storing files and IAM roles that grant permissions needed to perform deployments.&lt;/li&gt;&#xA;&lt;li&gt;The required resources are defined in an AWS CloudFormation stack, called the bootstrap stack, which is usually named CDKToolkit. Like any AWS CloudFormation stack, it appears in the AWS CloudFormation console once it has been deployed.&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>How to Get Account Number from AWS Lambda</title>
      <link>https://andrewodendaal.com/how-to-get-account-number-from-aws-lambda/</link>
      <pubDate>Tue, 24 Jan 2023 05:16:43 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-account-number-from-aws-lambda/</guid>
      <description>&lt;p&gt;If you need to get the current Account Number, or Account ID from within a Lambda execution, then you can access &lt;code&gt;invoked_function_arn&lt;/code&gt; from the &lt;code&gt;context&lt;/code&gt; and return the associated value as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws_account_id = context.invoked_function_arn.split(&amp;#34;:&amp;#34;)[4]&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Building Resilient Distributed Systems</title>
      <link>https://andrewodendaal.com/articles/distributed-systems-resilience/</link>
      <pubDate>Fri, 20 Jan 2023 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/distributed-systems-resilience/</guid>
      <description>&lt;p&gt;Learn fault tolerance patterns.&lt;/p&gt;&#xA;&lt;h4 id=&#34;understanding-distributed-systems-failures&#34;&gt;Understanding Distributed Systems Failures&lt;/h4&gt;&#xA;&lt;h4 id=&#34;failure-modes-and-models&#34;&gt;Failure Modes and Models&lt;/h4&gt;&#xA;&lt;p&gt;Recognizing what can go wrong:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Common Failure Modes&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Hardware failures&lt;/li&gt;&#xA;&lt;li&gt;Network partitions&lt;/li&gt;&#xA;&lt;li&gt;Service dependencies failures&lt;/li&gt;&#xA;&lt;li&gt;Resource exhaustion&lt;/li&gt;&#xA;&lt;li&gt;Data corruption&lt;/li&gt;&#xA;&lt;li&gt;Clock skew&lt;/li&gt;&#xA;&lt;li&gt;Configuration errors&lt;/li&gt;&#xA;&lt;li&gt;Deployment failures&lt;/li&gt;&#xA;&lt;li&gt;Cascading failures&lt;/li&gt;&#xA;&lt;li&gt;Thundering herd problems&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;The Fallacies of Distributed Computing&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The network is reliable&lt;/li&gt;&#xA;&lt;li&gt;Latency is zero&lt;/li&gt;&#xA;&lt;li&gt;Bandwidth is infinite&lt;/li&gt;&#xA;&lt;li&gt;The network is secure&lt;/li&gt;&#xA;&lt;li&gt;Topology doesn&amp;rsquo;t change&lt;/li&gt;&#xA;&lt;li&gt;There is one administrator&lt;/li&gt;&#xA;&lt;li&gt;Transport cost is zero&lt;/li&gt;&#xA;&lt;li&gt;The network is homogeneous&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;strong&gt;Failure Models&lt;/strong&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Summary of the Frequently Used AWS STS API calls</title>
      <link>https://andrewodendaal.com/summary-of-the-frequently-used-aws-sts-api-calls/</link>
      <pubDate>Thu, 19 Jan 2023 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/summary-of-the-frequently-used-aws-sts-api-calls/</guid>
      <description>&lt;p&gt;&lt;strong&gt;AssumeRole&lt;/strong&gt; –  is useful for allowing existing IAM users to access AWS resources that they don’t already have access to. For example, the user might need access to resources in another AWS account. It is also useful as a means to temporarily gain privileged access—for example, to provide multi-factor authentication (MFA). You must call this API using existing IAM user credentials.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;AssumeRoleWithWebIdentity&lt;/strong&gt; – returns a set of temporary security credentials for federated users who are authenticated through a public identity provider. Examples of public identity providers include Login with Amazon, Facebook, Google, or any OpenID Connect (OIDC)-compatible identity provider.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Understanding Locking and Conditional Writes in AWS DynamoDB</title>
      <link>https://andrewodendaal.com/understanding-locking-and-conditional-writes-in-aws-dynamodb/</link>
      <pubDate>Wed, 18 Jan 2023 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/understanding-locking-and-conditional-writes-in-aws-dynamodb/</guid>
      <description>&lt;p&gt;&lt;strong&gt;Optimistic locking&lt;/strong&gt; is a strategy to ensure that the client-side item that you are updating (or deleting) is the same as the item in DynamoDB. Optimistic concurrency depends on checking a value upon save to ensure that it has not changed. If you use this strategy, then your database writes are protected from being overwritten by the writes of others — and vice-versa.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/update-yes-condition.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;By default, the DynamoDB write operations (&lt;code&gt;PutItem&lt;/code&gt;, &lt;code&gt;UpdateItem&lt;/code&gt;, &lt;code&gt;DeleteItem&lt;/code&gt;) are &lt;em&gt;unconditional&lt;/em&gt;: each of these operations will overwrite an existing item that has the specified primary key.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AWS CodeDeploy Deployment Type Options</title>
      <link>https://andrewodendaal.com/aws-codedeploy-deployment-type-options/</link>
      <pubDate>Tue, 17 Jan 2023 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/aws-codedeploy-deployment-type-options/</guid>
      <description>&lt;p&gt;CodeDeploy provides two (2) deployment type options:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-in-place-deployment&#34;&gt;Option 1 – In-place Deployment&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;In-place deployment&lt;/strong&gt;: The application on each instance in the deployment group is stopped, the latest application revision is installed, and the new version of the application is started and validated. You can use a load balancer so that each instance is deregistered during its deployment and then restored to service after the deployment is complete. Only deployments that use the EC2/On-Premises compute platform can use in-place deployments. AWS Lambda compute platform deployments cannot use an in-place deployment type.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Defining Amazon ECS Task Placement Strategies</title>
      <link>https://andrewodendaal.com/defining-aws-ecs-task-placement-strategies/</link>
      <pubDate>Mon, 16 Jan 2023 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/defining-aws-ecs-task-placement-strategies/</guid>
      <description>&lt;p&gt;Amazon ECS supports the following task placement strategies:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;binpack&lt;/strong&gt; – Place tasks based on the least available amount of CPU or memory. This minimizes the number of instances in use.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;random&lt;/strong&gt; – Place tasks randomly.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;spread&lt;/strong&gt; – Place tasks evenly based on the specified value. Accepted values are attribute key-value pairs, &lt;em&gt;instanceId&lt;/em&gt;, or &lt;em&gt;host&lt;/em&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Deployment methods in AWS Elastic Beanstalk</title>
      <link>https://andrewodendaal.com/deployment-methods-in-aws-elastic-beanstalk/</link>
      <pubDate>Sun, 15 Jan 2023 14:51:26 +0000</pubDate>
      <guid>https://andrewodendaal.com/deployment-methods-in-aws-elastic-beanstalk/</guid>
      <description>&lt;p&gt;&lt;strong&gt;– All at once&lt;/strong&gt; – Deploy the new version to all instances simultaneously. All instances in your environment are out of service for a short time while the deployment occurs.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;– Rolling&lt;/strong&gt; – Deploy the new version in batches. Each batch is taken out of service during the deployment phase, reducing your environment’s capacity by the number of instances in a batch.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;– Rolling with additional batch&lt;/strong&gt; – Deploy the new version in batches, but first launch a new batch of instances to ensure full capacity during the deployment process.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to update NTP to sync clock on Linux</title>
      <link>https://andrewodendaal.com/how-to-update-ntp-to-sync-clock-on-linux/</link>
      <pubDate>Wed, 04 Jan 2023 07:44:07 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-update-ntp-to-sync-clock-on-linux/</guid>
      <description>&lt;p&gt;If you need to sync the clock on Linux using the central NTP clock service, you can do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo service ntp stop&#xA;sudo ntpd -gq&#xA;sudo service ntp start&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The &lt;code&gt;-gg&lt;/code&gt; flags do the following:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Tell &lt;code&gt;g&lt;/code&gt; flag tells the NTP Daemon to correct the time regardless of the offset&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;q&lt;/code&gt; flag tells it to exit immediately after setting the time&lt;/li&gt;&#xA;&lt;/ol&gt;</description>
    </item>
    <item>
      <title>Data Partitioning Strategies for Distributed Systems</title>
      <link>https://andrewodendaal.com/articles/distributed-systems-data-partitioning/</link>
      <pubDate>Mon, 26 Dec 2022 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/distributed-systems-data-partitioning/</guid>
      <description>&lt;p&gt;Master data partitioning techniques including sharding.&lt;/p&gt;&#xA;&lt;h3 id=&#34;understanding-data-partitioning&#34;&gt;Understanding Data Partitioning&lt;/h3&gt;&#xA;&lt;p&gt;Data partitioning (also known as sharding) is the process of breaking a large dataset into smaller, more manageable pieces called partitions or shards. Each partition contains a subset of the data and can be stored on a separate database server or node.&lt;/p&gt;&#xA;&lt;h3 id=&#34;why-partition-data&#34;&gt;Why Partition Data?&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Scalability&lt;/strong&gt;: Overcome hardware limitations by distributing data across multiple machines&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Performance&lt;/strong&gt;: Improve query performance through parallel processing across partitions&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Availability&lt;/strong&gt;: Enhance system resilience by isolating failures to specific partitions&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Manageability&lt;/strong&gt;: Make maintenance operations like backups and index rebuilds more efficient&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Data Locality&lt;/strong&gt;: Store data close to the users or services that access it most frequently&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;partitioning-vs-replication&#34;&gt;Partitioning vs. Replication&lt;/h3&gt;&#xA;&lt;p&gt;It&amp;rsquo;s important to distinguish between partitioning and replication:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Distributed Consensus Algorithms: Building Fault-Tolerant Systems</title>
      <link>https://andrewodendaal.com/articles/distributed-systems-consensus-algorithms/</link>
      <pubDate>Mon, 19 Dec 2022 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/distributed-systems-consensus-algorithms/</guid>
      <description>&lt;p&gt;Master the algorithms that enable distributed systems to agree on shared state despite failures and network partitions.&lt;/p&gt;&#xA;&lt;h3 id=&#34;the-consensus-problem&#34;&gt;The Consensus Problem&lt;/h3&gt;&#xA;&lt;p&gt;Before diving into specific algorithms, let&amp;rsquo;s clearly define the consensus problem. In a distributed system with multiple nodes, consensus is the process of agreeing on a single value or state among all non-faulty nodes. A correct consensus algorithm must satisfy the following properties:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Agreement&lt;/strong&gt;: All non-faulty nodes decide on the same value.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Validity&lt;/strong&gt;: If all nodes propose the same value, then all non-faulty nodes decide on that value.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Termination&lt;/strong&gt;: All non-faulty nodes eventually decide on some value.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The challenge is achieving these properties in the presence of:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find IP Address Ranges used by Amazon S3</title>
      <link>https://andrewodendaal.com/how-to-find-ip-address-ranges-used-by-amazon-s3/</link>
      <pubDate>Tue, 13 Dec 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-ip-address-ranges-used-by-amazon-s3/</guid>
      <description>&lt;p&gt;You can query the &lt;code&gt;ip-ranges&lt;/code&gt; Amazon AWS URL, and parse the results through &lt;code&gt;jq&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&lt;h2 id=&#34;generic-s3-ip-ranges&#34;&gt;Generic S3 IP Ranges&lt;/h2&gt;&#xA;&lt;p&gt;Query:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r &amp;#39;.prefixes[] | select(.service==&amp;#34;S3&amp;#34;)&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Response:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&#xA;  &amp;#34;ip_prefix&amp;#34;: &amp;#34;3.5.140.0/22&amp;#34;,&#xA;  &amp;#34;region&amp;#34;: &amp;#34;ap-northeast-2&amp;#34;,&#xA;  &amp;#34;service&amp;#34;: &amp;#34;S3&amp;#34;,&#xA;  &amp;#34;network_border_group&amp;#34;: &amp;#34;ap-northeast-2&amp;#34;&#xA;}&#xA;{&#xA;  &amp;#34;ip_prefix&amp;#34;: &amp;#34;52.219.170.0/23&amp;#34;,&#xA;  &amp;#34;region&amp;#34;: &amp;#34;eu-central-1&amp;#34;,&#xA;  &amp;#34;service&amp;#34;: &amp;#34;S3&amp;#34;,&#xA;&amp;lt;truncated&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;region-specific-s3-ip-ranges&#34;&gt;Region Specific S3 IP Ranges&lt;/h2&gt;&#xA;&lt;p&gt;Query:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r &amp;#39;.prefixes[] | select(.region==&amp;#34;eu-west-1&amp;#34;) | select(.service==&amp;#34;S3&amp;#34;) | .ip_prefix&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Response:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;18.34.32.0/20&#xA;3.5.72.0/23&#xA;52.218.0.0/17&#xA;3.5.64.0/21&#xA;52.92.0.0/17&#xA;18.34.240.0/22&#xA;3.251.110.208/28&#xA;3.251.110.224/28&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Find the nth Reverse Number in Java</title>
      <link>https://andrewodendaal.com/how-to-find-the-nth-reverse-number-in-java/</link>
      <pubDate>Mon, 12 Dec 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-nth-reverse-number-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Reverse Number is a number which is the same when reversed.&lt;/p&gt;&#xA;&lt;p&gt;For example, the first 20 Reverse Numbers are:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Task&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You need to return the nth reverse number. (Assume that reverse numbers start from 0 as shown in the example.)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1 &amp;lt; n &amp;lt;= 100000000000&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Sum of Intervals in Java</title>
      <link>https://andrewodendaal.com/how-to-find-the-sum-of-intervals/</link>
      <pubDate>Sun, 11 Dec 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-sum-of-intervals/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function called &lt;code&gt;sumIntervals&lt;/code&gt;/&lt;code&gt;sum_intervals()&lt;/code&gt; that accepts an array of intervals, and returns the sum of all the interval lengths. Overlapping intervals should only be counted once.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Intervals&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Intervals are represented by a pair of integers in the form of an array. The first value of the interval will always be less than the second value. Interval example: &lt;code&gt;[1, 5]&lt;/code&gt; is an interval from 1 to 5. The length of this interval is 4.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Stray Number in Python</title>
      <link>https://andrewodendaal.com/how-to-find-the-stray-number-in-python/</link>
      <pubDate>Sat, 10 Dec 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-stray-number-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given an &lt;em&gt;odd-length&lt;/em&gt; array of integers, in which all of them are the same, except for one single number.&lt;/p&gt;&#xA;&lt;p&gt;Complete the method which accepts such an array, and returns that single different number.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The input array will always be valid!&lt;/strong&gt; (odd-length &amp;gt;= 3)&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[1, 1, 2] ==&amp;gt; 2&#xA;[17, 17, 3, 17, 17, 17, 17] ==&amp;gt; 3&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python&#34;&gt;The solution in Python&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def stray(arr):&#xA;    for x in arr:&#xA;        if arr.count(x) == 1:&#xA;            return x&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the EDID UUID of External Mac Monitors</title>
      <link>https://andrewodendaal.com/how-to-find-the-edid-uuid-of-external-mac-monitors/</link>
      <pubDate>Fri, 09 Dec 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-edid-uuid-of-external-mac-monitors/</guid>
      <description>&lt;p&gt;You can issue the following command on an Apple Mac&amp;rsquo;s terminal to show the &lt;code&gt;EDID UUID&lt;/code&gt; (unique serial number) of all attached external monitors:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ioreg -l | grep EDID&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>[Solved] jsii.errors.JSIIError: docker exited with status 1</title>
      <link>https://andrewodendaal.com/solved-jsii-errors-jsiierror-docker-exited-with-status-1/</link>
      <pubDate>Thu, 08 Dec 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-jsii-errors-jsiierror-docker-exited-with-status-1/</guid>
      <description>&lt;p&gt;If you get the following error while running AWS CDK:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;raise JSIIError(resp.error) from JavaScriptError(resp.stack)&#xA;jsii.errors.JSIIError: docker exited with status 1&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then you can resolve it as follows:&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-solve-docker-exited-with-status-1-error&#34;&gt;How to solve &lt;code&gt;docker exited with status 1&lt;/code&gt; error&lt;/h2&gt;&#xA;&lt;p&gt;Make sure that your local Docker client is running.&lt;/p&gt;&#xA;&lt;p&gt;Start &lt;code&gt;docker&lt;/code&gt; on the local machine and CDK will be able to make the Docker connections required.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Filter a Number in C</title>
      <link>https://andrewodendaal.com/how-to-filter-a-number-in-c/</link>
      <pubDate>Wed, 07 Dec 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-filter-a-number-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The number has been mixed up with the text. Your goal is to retrieve the number from the text, can you return the number back to its original state?&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Task&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Your task is to return a number from a string.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Details&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;You will be given a string of numbers and letters mixed up, you have to return all the numbers in that string in the order they occur.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Take a Ten Minute Walk in C</title>
      <link>https://andrewodendaal.com/how-to-take-a-ten-minute-walk-in-c/</link>
      <pubDate>Tue, 06 Dec 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-take-a-ten-minute-walk-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You live in the city of Cartesia where all roads are laid out in a perfect grid. You arrived ten minutes too early to an appointment, so you decided to take the opportunity to go for a short walk. The city provides its citizens with a Walk Generating App on their phones — everytime you press the button it sends you an array of one-letter strings representing directions to walk (eg. [‘n&amp;rsquo;, ‘s&amp;rsquo;, ‘w&amp;rsquo;, ‘e&amp;rsquo;]). You always walk only a single block for each letter (direction) and you know it takes you one minute to traverse one city block, so create a function that will return &lt;strong&gt;true&lt;/strong&gt; if the walk the app gives you will take you exactly ten minutes (you don&amp;rsquo;t want to be early or late!) and will, of course, return you to your starting point. Return &lt;strong&gt;false&lt;/strong&gt; otherwise.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Count Stats of a String in C</title>
      <link>https://andrewodendaal.com/how-to-count-stats-of-a-string-in-c/</link>
      <pubDate>Mon, 05 Dec 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-count-stats-of-a-string-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You will be given a string and your task will be to return a list of ints detailing the count of uppercase letters, lowercase, numbers and special characters, as follows.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Solve(&amp;#34;*&amp;#39;&amp;amp;ABCDabcde12345&amp;#34;) = [4,5,5,3]. &#xA;--the order is: uppercase letters, lowercase, numbers and special characters.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-c&#34;&gt;The solution in C&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;void count_char_types (const char *string, unsigned counts[4])&#xA;{&#xA;  char c;&#xA;  counts[0] = counts[1] = counts[2] = counts[3] = 0;&#xA;  while((c = *string++))&#xA;    if(c &amp;gt;= &amp;#39;A&amp;#39; &amp;amp;&amp;amp; c &amp;lt;= &amp;#39;Z&amp;#39;) counts[0]++;&#xA;    else if(c &amp;gt;= &amp;#39;a&amp;#39; &amp;amp;&amp;amp; c &amp;lt;= &amp;#39;z&amp;#39;) counts[1]++;&#xA;    else if(c &amp;gt;= &amp;#39;0&amp;#39; &amp;amp;&amp;amp; c &amp;lt;= &amp;#39;9&amp;#39;) counts[2]++;&#xA;    else counts[3]++;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Convert a String to the NATO Phonetic Alphabet in C</title>
      <link>https://andrewodendaal.com/how-to-convert-a-string-to-the-nato-phonetic-alphabet-in-c/</link>
      <pubDate>Sun, 04 Dec 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-a-string-to-the-nato-phonetic-alphabet-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You&amp;rsquo;ll have to translate a string to Pilot&amp;rsquo;s alphabet (&lt;!-- raw HTML omitted --&gt;NATO phonetic alphabet&lt;!-- raw HTML omitted --&gt;).&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Input:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;If, you can read?&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;India Foxtrot , Yankee Oscar Uniform Charlie Alfa November Romeo Echo Alfa Delta ?&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;There are preloaded dictionary you can use, named &lt;code&gt;NATO&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;The set of used punctuation is &lt;code&gt;,.!?&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Punctuation should be kept in your return string, but spaces should not.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Xray&lt;/strong&gt; should not have a dash within.&lt;/li&gt;&#xA;&lt;li&gt;Every word and punctuation mark should be seperated by a space ‘ ‘.&lt;/li&gt;&#xA;&lt;li&gt;There should be no trailing whitespace&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-c&#34;&gt;The solution in C&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Add 1 to the Value of each Array in C</title>
      <link>https://andrewodendaal.com/how-to-add-1-to-the-value-of-each-array-in-c/</link>
      <pubDate>Sat, 03 Dec 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-add-1-to-the-value-of-each-array-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of integers of any length, return an array that has 1 added to the value represented by the array.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the array can&amp;rsquo;t be empty&lt;/li&gt;&#xA;&lt;li&gt;only non-negative, single digit integers are allowed&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Return &lt;code&gt;nil&lt;/code&gt; (or your language&amp;rsquo;s equivalent) for invalid inputs.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Valid arrays&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;[4, 3, 2, 5]&lt;/code&gt; would return &lt;code&gt;[4, 3, 2, 6]&lt;/code&gt;&lt;br&gt;&#xA;&lt;code&gt;[1, 2, 3, 9]&lt;/code&gt; would return &lt;code&gt;[1, 2, 4, 0]&lt;/code&gt;&lt;br&gt;&#xA;&lt;code&gt;[9, 9, 9, 9]&lt;/code&gt; would return &lt;code&gt;[1, 0, 0, 0, 0]&lt;/code&gt;&lt;br&gt;&#xA;&lt;code&gt;[0, 1, 3, 7]&lt;/code&gt; would return &lt;code&gt;[0, 1, 3, 8]&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate the Sum of a Sequence in C</title>
      <link>https://andrewodendaal.com/how-to-calculate-the-sum-of-a-sequence-in-c/</link>
      <pubDate>Fri, 02 Dec 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-the-sum-of-a-sequence-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Your task is to make function, which returns the sum of a sequence of integers.&lt;/p&gt;&#xA;&lt;p&gt;The sequence is defined by 3 non-negative values: &lt;strong&gt;begin&lt;/strong&gt;, &lt;strong&gt;end&lt;/strong&gt;, &lt;strong&gt;step (inclusive)&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;If &lt;strong&gt;begin&lt;/strong&gt; value is greater than the &lt;strong&gt;end&lt;/strong&gt;, function should returns ****&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;2,2,2 --&amp;gt; 2&#xA;2,6,2 --&amp;gt; 12 (2 + 4 + 6)&#xA;1,5,1 --&amp;gt; 15 (1 + 2 + 3 + 4 + 5)&#xA;1,5,3  --&amp;gt; 5 (1 + 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-c&#34;&gt;The solution in C&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve the Sum of Triangular Numbers in C</title>
      <link>https://andrewodendaal.com/how-to-solve-the-sum-of-triangular-numbers-in-c/</link>
      <pubDate>Thu, 01 Dec 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-the-sum-of-triangular-numbers-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Your task is to return the sum of Triangular Numbers up-to-and-including the &lt;code&gt;nth&lt;/code&gt; Triangular Number.&lt;/p&gt;&#xA;&lt;p&gt;Triangular Number: &amp;ldquo;any of the series of numbers (1, 3, 6, 10, 15, etc.) obtained by continued summation of the natural numbers 1, 2, 3, 4, 5, etc.&amp;rdquo;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[01]&#xA;02 [03]&#xA;04 05 [06]&#xA;07 08 09 [10]&#xA;11 12 13 14 [15]&#xA;16 17 18 19 20 [21]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;e.g. If &lt;code&gt;4&lt;/code&gt; is given: &lt;code&gt;1 + 3 + 6 + 10 = 20&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Determine if a String Only Contains Unique Characters in C</title>
      <link>https://andrewodendaal.com/how-to-determine-if-a-string-only-contains-unique-characters-in-c/</link>
      <pubDate>Wed, 30 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-determine-if-a-string-only-contains-unique-characters-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a program to determine if a string contains only unique characters. Return true if it does and false otherwise.&lt;/p&gt;&#xA;&lt;p&gt;The string may contain any of the 128 ASCII characters. Characters are case-sensitive, e.g. ‘a&amp;rsquo; and ‘A&amp;rsquo; are considered different characters.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-c&#34;&gt;The solution in C&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;int has_unique_chars(const char *str) {&#xA;  int mask[128]={0};&#xA;  while (*str) if (++mask[*str++]&amp;gt;1) return 0;&#xA;  return 1;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#include &amp;lt;limits.h&amp;gt;&#xA;&#xA;_Bool has_unique_chars(const char *str) {&#xA;    char hit[CHAR_MAX + 1] = {0};&#xA;    while (*str) {&#xA;        if (*str &amp;lt; 0) { str++; continue; }&#xA;        if (hit[*str]) return 0;&#xA;        hit[*str++] = 1;&#xA;    }&#xA;    return 1;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Maximum Multiple in C</title>
      <link>https://andrewodendaal.com/how-to-find-the-maximum-multiple-in-c/</link>
      <pubDate>Tue, 29 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-maximum-multiple-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Given&lt;/em&gt;&lt;/strong&gt; a &lt;strong&gt;&lt;em&gt;Divisor and a Bound&lt;/em&gt;&lt;/strong&gt; , &lt;em&gt;Find the largest integer N&lt;/em&gt; , Such That ,&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Conditions :&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;N&lt;/em&gt;&lt;/strong&gt; is &lt;em&gt;divisible by divisor&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;N&lt;/em&gt;&lt;/strong&gt; is &lt;em&gt;less than or equal to bound&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;N&lt;/em&gt;&lt;/strong&gt; is &lt;em&gt;greater than 0&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &lt;strong&gt;&lt;em&gt;parameters (divisor, bound)&lt;/em&gt;&lt;/strong&gt; passed to the function are &lt;em&gt;only positive values&lt;/em&gt; .&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;It&amp;rsquo;s guaranteed that&lt;/em&gt; a &lt;strong&gt;divisor is Found&lt;/strong&gt; .Input &amp;raquo; Output Examples&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;maxMultiple (2,7) ==&amp;gt; return (6)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;(6)&lt;/em&gt;&lt;/strong&gt; is divisible by &lt;strong&gt;&lt;em&gt;(2)&lt;/em&gt;&lt;/strong&gt; , &lt;strong&gt;&lt;em&gt;(6)&lt;/em&gt;&lt;/strong&gt; is less than or equal to bound &lt;strong&gt;&lt;em&gt;(7)&lt;/em&gt;&lt;/strong&gt; , and &lt;strong&gt;&lt;em&gt;(6)&lt;/em&gt;&lt;/strong&gt; is &amp;gt; 0 .&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Assign a Digital Cypher in C</title>
      <link>https://andrewodendaal.com/how-to-assign-a-digital-cypher-in-c/</link>
      <pubDate>Mon, 28 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-assign-a-digital-cypher-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Digital Cypher assigns to each letter of the alphabet unique number. For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt; a  b  c  d  e  f  g  h  i  j  k  l  m&#xA; 1  2  3  4  5  6  7  8  9 10 11 12 13&#xA; n  o  p  q  r  s  t  u  v  w  x  y  z&#xA;14 15 16 17 18 19 20 21 22 23 24 25 26&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Instead of letters in encrypted word we write the corresponding number, eg. The word scout:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Check for All Inclusive in C</title>
      <link>https://andrewodendaal.com/how-to-check-for-all-inclusive-in-c/</link>
      <pubDate>Sun, 27 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-check-for-all-inclusive-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;Input:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a string &lt;code&gt;strng&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;an array of strings &lt;code&gt;arr&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Output of function &lt;code&gt;contain_all_rots(strng, arr) (or containAllRots or contain-all-rots)&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a boolean &lt;code&gt;true&lt;/code&gt; if all rotations of &lt;code&gt;strng&lt;/code&gt; are included in &lt;code&gt;arr&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;false&lt;/code&gt; otherwise&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;contain_all_rots(&#xA;  &amp;#34;bsjq&amp;#34;, [&amp;#34;bsjq&amp;#34;, &amp;#34;qbsj&amp;#34;, &amp;#34;sjqb&amp;#34;, &amp;#34;twZNsslC&amp;#34;, &amp;#34;jqbs&amp;#34;]) -&amp;gt; true&#xA;&#xA;contain_all_rots(&#xA;  &amp;#34;Ajylvpy&amp;#34;, [&amp;#34;Ajylvpy&amp;#34;, &amp;#34;ylvpyAj&amp;#34;, &amp;#34;jylvpyA&amp;#34;, &amp;#34;lvpyAjy&amp;#34;, &amp;#34;pyAjylv&amp;#34;, &amp;#34;vpyAjyl&amp;#34;, &amp;#34;ipywee&amp;#34;]) -&amp;gt; false)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Though not correct in a mathematical sense&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;we will consider that there are no rotations of &lt;code&gt;strng == &amp;quot;&amp;quot;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;and for any array &lt;code&gt;arr&lt;/code&gt;: &lt;code&gt;contain_all_rots(&amp;quot;&amp;quot;, arr) --&amp;gt; true&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-c&#34;&gt;The solution in C&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve for Factorial in C</title>
      <link>https://andrewodendaal.com/how-to-solve-for-factorial-in-c/</link>
      <pubDate>Sat, 26 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-for-factorial-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. For example: 5! = 5 * 4 * 3 * 2 * 1 = 120. By convention the value of 0! is 1.&lt;/p&gt;&#xA;&lt;p&gt;Write a function to calculate factorial for a given input. If input is below 0 or above 12 return &lt;code&gt;-1&lt;/code&gt; (C).&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create an Incrementer in C</title>
      <link>https://andrewodendaal.com/how-to-create-an-incrementer-in-c/</link>
      <pubDate>Fri, 25 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-an-incrementer-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an input of an array of digits, return the array with each digit incremented by its position in the array: the first digit will be incremented by 1, the second digit by 2, etc. Make sure to &lt;strong&gt;start counting your positions from 1&lt;/strong&gt; ( and not 0 ).&lt;/p&gt;&#xA;&lt;p&gt;Your result can only contain single digit numbers, so if adding a digit with its position gives you a multiple-digit number, only the last digit of the number should be returned.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Return the Closest Number Multiple of 10 in C</title>
      <link>https://andrewodendaal.com/how-to-return-the-closest-number-multiple-of-10-in-c/</link>
      <pubDate>Thu, 24 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-return-the-closest-number-multiple-of-10-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a number return the closest number to it that is divisible by 10.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example input:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;22&#xA;25&#xA;37&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Expected output:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;20&#xA;30&#xA;40&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-c&#34;&gt;The solution in C&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#include &amp;lt;math.h&amp;gt;&#xA;&#xA;int round_to_10 (int n) {&#xA;  return round(n / 10.0) * 10;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;int round_to_10(int n) {&#xA;  return (n + 5) / 10 * 10;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;int round_to_10 (int n) {&#xA;    int r = n % 10;&#xA;    if (r &amp;gt; 0)&#xA;        return r &amp;lt; 5 ? n - r : n - r + 10;&#xA;    else if (r &amp;lt; 0)&#xA;        return r &amp;gt; -5 ? n - r : n - r - 10;&#xA;    return n;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#include &amp;lt;criterion/criterion.h&amp;gt;&#xA;&#xA;extern int round_to_10 (int n);&#xA;static void do_test (int n, int expected);&#xA;&#xA;Test(tests_suite, sample_tests)&#xA;{&#xA;  do_test(0, 0);&#xA;  do_test(10, 10);&#xA;  do_test(22, 20);&#xA;  do_test(25, 30);&#xA;  do_test(37, 40);&#xA;}&#xA;&#xA;static void do_test (int n, int expected)&#xA;{&#xA;  int actual = round_to_10(n);&#xA;  cr_assert_eq(actual, expected,&#xA;    &amp;#34;for n = %d, expected %d, but got %d&amp;#34;,&#xA;    n, expected, actual&#xA;  );&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Reverse Every Other Word in a String in C</title>
      <link>https://andrewodendaal.com/how-to-reverse-every-other-word-in-a-string-in-c/</link>
      <pubDate>Wed, 23 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reverse-every-other-word-in-a-string-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Reverse every other word in a given string, then return the string. Throw away any leading or trailing whitespace, while ensuring there is exactly one space between each word. Punctuation marks should be treated as if they are a part of the word in this challenge.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-c&#34;&gt;The solution in C&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#include &amp;lt;stddef.h&amp;gt;&#xA;#include &amp;lt;stdbool.h&amp;gt;&#xA;&#xA;void reverse_alternate(const char *string, char *result)&#xA;{&#xA;  bool is_word = false, is_second = false, not_first = false;&#xA;  for (const char *s = string; *s; ++s) {&#xA;    if (*s == &amp;#39; &amp;#39; &amp;amp;&amp;amp; is_word) {&#xA;      is_word = false;&#xA;      is_second = !is_second;&#xA;    } else if (*s != &amp;#39; &amp;#39; &amp;amp;&amp;amp; !is_word) {&#xA;      if (not_first) *result++ = &amp;#39; &amp;#39;;&#xA;      is_word = not_first = true;&#xA;    }&#xA;    &#xA;    if (is_second &amp;amp;&amp;amp; is_word) {&#xA;      size_t i = 0;&#xA;      for (const char *ss = s; *ss &amp;amp;&amp;amp; *ss != &amp;#39; &amp;#39;; ++ss, ++i)&#xA;        ;&#xA;      for (size_t j = 0; j &amp;lt; i; ++j)&#xA;        result[j] = s[i - j - 1];&#xA;      s += i - 1;&#xA;      result += i;&#xA;    } else if (*s != &amp;#39; &amp;#39;)&#xA;      *result++ = *s;&#xA;  }&#xA;  *result = &amp;#39;\0&amp;#39;;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve Simple Beads Count in C</title>
      <link>https://andrewodendaal.com/how-to-solve-simple-beads-count-in-c/</link>
      <pubDate>Tue, 22 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-simple-beads-count-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Two red beads are placed between every two blue beads. There are N blue beads. After looking at the arrangement below work out the number of red beads.&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;@&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;@@&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;@&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;@@&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;@&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;@@&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;@&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;@@&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;@&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;@@&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;@&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve the Maze Runner in C</title>
      <link>https://andrewodendaal.com/how-to-solve-the-maze-runner-in-c/</link>
      <pubDate>Mon, 21 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-the-maze-runner-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Task&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;The Maze array will look like&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;maze = [[1,1,1,1,1,1,1],&#xA;        [1,0,0,0,0,0,3],&#xA;        [1,0,1,0,1,0,1],&#xA;        [0,0,1,0,0,0,1],&#xA;        [1,0,1,0,1,0,1],&#xA;        [1,0,0,0,0,0,1],&#xA;        [1,2,1,0,1,0,1]]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;..with the following key&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;  directions = &amp;#34;NNNNNEEEEE&amp;#34; == &amp;#34;Finish&amp;#34; // (directions passed as a string)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Rules&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;the-solution-in-c&#34;&gt;The solution in C&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Take a Number and Sum It’s Digits Raied to the Consecutive Powers in C</title>
      <link>https://andrewodendaal.com/how-to-take-a-number-and-sum-its-digits-raied-to-the-consecutive-powers-in-c/</link>
      <pubDate>Sun, 20 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-take-a-number-and-sum-its-digits-raied-to-the-consecutive-powers-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The number &lt;code&gt;89&lt;/code&gt; is the first integer with more than one digit that fulfills the property partially introduced in the title of this challenge. What&amp;rsquo;s the use of saying &amp;ldquo;Eureka&amp;rdquo;? Because this sum gives the same number.&lt;/p&gt;&#xA;&lt;p&gt;In effect: &lt;code&gt;89 = 8^1 + 9^2&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;The next number in having this property is &lt;code&gt;135&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;See this property again: &lt;code&gt;135 = 1^1 + 3^2 + 5^3&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;We need a function to collect these numbers, that may receive two integers &lt;code&gt;a&lt;/code&gt;, &lt;code&gt;b&lt;/code&gt; that defines the range &lt;code&gt;[a, b]&lt;/code&gt; (inclusive) and outputs a list of the sorted numbers in the range that fulfills the property described above.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Middle Element in C</title>
      <link>https://andrewodendaal.com/how-to-find-the-middle-element-in-c/</link>
      <pubDate>Sat, 19 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-middle-element-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You need to create a function that when provided with a triplet, returns the index of the numerical element that lies between the other two elements.&lt;/p&gt;&#xA;&lt;p&gt;The input to the function will be an array of three distinct numbers (Haskell: a tuple).&lt;/p&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;gimme([2, 3, 1]) =&amp;gt; 0&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;em&gt;2&lt;/em&gt; is the number that fits between &lt;em&gt;1&lt;/em&gt; and &lt;em&gt;3&lt;/em&gt; and the index of &lt;em&gt;2&lt;/em&gt; in the input array is __.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Invite More Women in C</title>
      <link>https://andrewodendaal.com/how-to-invite-more-women-in-c/</link>
      <pubDate>Fri, 18 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-invite-more-women-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;Task&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;King Arthur and his knights are having a New Years party. Last year Lancelot was jealous of Arthur, because Arthur had a date and Lancelot did not, and they started a duel.&lt;/p&gt;&#xA;&lt;p&gt;To prevent this from happening again, Arthur wants to make sure that there are at least as many women as men at this year&amp;rsquo;s party. He gave you a list of integers of all the party goers.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Build a Tower in C</title>
      <link>https://andrewodendaal.com/how-to-build-a-tower-in-c/</link>
      <pubDate>Thu, 17 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-build-a-tower-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Build a pyramid-shaped tower, as an array/list of strings, given a positive integer &lt;code&gt;number of floors&lt;/code&gt;. A tower block is represented with &lt;code&gt;&amp;quot;*&amp;quot;&lt;/code&gt; character.&lt;/p&gt;&#xA;&lt;p&gt;For example, a tower with &lt;code&gt;3&lt;/code&gt; floors looks like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[&#xA;  &amp;#34;  *  &amp;#34;,&#xA;  &amp;#34; *** &amp;#34;, &#xA;  &amp;#34;*****&amp;#34;&#xA;]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And a tower with &lt;code&gt;6&lt;/code&gt; floors looks like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[&#xA;  &amp;#34;     *     &amp;#34;, &#xA;  &amp;#34;    ***    &amp;#34;, &#xA;  &amp;#34;   *****   &amp;#34;, &#xA;  &amp;#34;  *******  &amp;#34;, &#xA;  &amp;#34; ********* &amp;#34;, &#xA;  &amp;#34;***********&amp;#34;&#xA;]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-c&#34;&gt;The solution in C&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate A Rule of Divisibility by 7 in C</title>
      <link>https://andrewodendaal.com/how-to-calculate-a-rule-of-divisibility-by-7-in-c/</link>
      <pubDate>Wed, 16 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-a-rule-of-divisibility-by-7-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;A number m of the form 10x + y is divisible by 7 if and only if x − 2y is divisible by 7. In other words, subtract twice the last digit from the number formed by the remaining digits. Continue to do this until a number known to be divisible by 7 is obtained; you can stop when this number has &lt;em&gt;at most&lt;/em&gt; 2 digits because you are supposed to know if a number of at most 2 digits is divisible by 7 or not.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Categorize a New Member in C</title>
      <link>https://andrewodendaal.com/how-to-categorize-a-new-member-in-c/</link>
      <pubDate>Tue, 15 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-categorize-a-new-member-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The Western Suburbs Croquet Club has two categories of membership, Senior and Open. They would like your help with an application form that will tell prospective members which category they will be placed.&lt;/p&gt;&#xA;&lt;p&gt;To be a senior, a member must be at least 55 years old and have a handicap greater than 7. In this croquet club, handicaps range from -2 to +26; the better the player the lower the handicap.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Load Balancing Strategies for Distributed Systems</title>
      <link>https://andrewodendaal.com/articles/distributed-systems-load-balancing/</link>
      <pubDate>Tue, 15 Nov 2022 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/distributed-systems-load-balancing/</guid>
      <description>&lt;p&gt;Master the art of distributing traffic efficiently across multiple servers and services in distributed architectures.&lt;/p&gt;&#xA;&lt;h3 id=&#34;understanding-load-balancing-in-distributed-systems&#34;&gt;Understanding Load Balancing in Distributed Systems&lt;/h3&gt;&#xA;&lt;p&gt;Load balancing in distributed systems operates at multiple levels, from DNS-based global load balancing to application-level request distribution. Before diving into specific strategies, let&amp;rsquo;s understand the key objectives and challenges.&lt;/p&gt;&#xA;&lt;h3 id=&#34;key-objectives-of-load-balancing&#34;&gt;Key Objectives of Load Balancing&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Even Distribution&lt;/strong&gt;: Spread workload evenly across available resources&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;High Availability&lt;/strong&gt;: Ensure service continuity even when some components fail&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Scalability&lt;/strong&gt;: Accommodate growing workloads by adding resources&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Efficiency&lt;/strong&gt;: Optimize resource utilization&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Latency Reduction&lt;/strong&gt;: Minimize response times for end users&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;load-balancing-layers&#34;&gt;Load Balancing Layers&lt;/h3&gt;&#xA;&lt;p&gt;Load balancing can be implemented at different layers of the system:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve Deodorant Evaporator in C</title>
      <link>https://andrewodendaal.com/how-to-solve-deodorant-evaporator-in-c/</link>
      <pubDate>Mon, 14 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-deodorant-evaporator-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;This program tests the life of an evaporator containing a gas.&lt;/p&gt;&#xA;&lt;p&gt;We know the content of the evaporator (content in ml), the percentage of foam or gas lost every day (evap_per_day) and the threshold (threshold) in percentage beyond which the evaporator is no longer useful. All numbers are strictly positive.&lt;/p&gt;&#xA;&lt;p&gt;The program reports the nth day (as an integer) on which the evaporator will be out of use.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Divisors in C</title>
      <link>https://andrewodendaal.com/how-to-find-the-divisors-in-c/</link>
      <pubDate>Sun, 13 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-divisors-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function named &lt;code&gt;divisors&lt;/code&gt;/&lt;code&gt;Divisors&lt;/code&gt; that takes an integer &lt;code&gt;n &amp;gt; 1&lt;/code&gt; and returns an array with all of the integer&amp;rsquo;s divisors(except for 1 and the number itself), from smallest to largest. If the number is prime return the string ‘(integer) is prime&amp;rsquo; (&lt;code&gt;null&lt;/code&gt; in C#) (use &lt;code&gt;Either String a&lt;/code&gt; in Haskell and &lt;code&gt;Result&amp;lt;Vec&amp;lt;u32&amp;gt;, String&amp;gt;&lt;/code&gt; in Rust).&lt;/p&gt;&#xA;&lt;h4 id=&#34;example&#34;&gt;Example:&lt;/h4&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;divisors(12); // results in {2, 3, 4, 6}&#xA;divisors(25); // results in {5}&#xA;divisors(13); // results in NULL&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-c&#34;&gt;The solution in C&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Terraform State Management: Advanced Patterns and Best Practices</title>
      <link>https://andrewodendaal.com/articles/terraform-state-management/</link>
      <pubDate>Sun, 13 Nov 2022 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/terraform-state-management/</guid>
      <description>&lt;p&gt;Terraform state is both the most critical and most dangerous aspect of infrastructure as code. It&amp;rsquo;s your source of truth for what exists, but it&amp;rsquo;s also a single point of failure that can lock teams out of their infrastructure or, worse, lead to accidental resource destruction.&lt;/p&gt;&#xA;&lt;p&gt;This guide goes deep into state management patterns that work at scale, covering everything from basic remote backends to complex state migration strategies and disaster recovery procedures.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Solving Love vs Friendship in C</title>
      <link>https://andrewodendaal.com/solving-love-vs-friendship-in-c/</link>
      <pubDate>Sat, 12 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solving-love-vs-friendship-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;If　&lt;code&gt;a = 1, b = 2, c = 3 ... z = 26&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then &lt;code&gt;l + o + v + e = 54&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;and &lt;code&gt;f + r + i + e + n + d + s + h + i + p = 108&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;So &lt;code&gt;friendship&lt;/code&gt; is twice as strong as &lt;code&gt;love&lt;/code&gt; 🙂&lt;/p&gt;&#xA;&lt;p&gt;Your task is to write a function which calculates the value of a word based off the sum of the alphabet positions of its characters.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Terraform Testing and Validation: Quality Infrastructure Code</title>
      <link>https://andrewodendaal.com/articles/terraform-testing-validation/</link>
      <pubDate>Sat, 12 Nov 2022 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/terraform-testing-validation/</guid>
      <description>&lt;p&gt;Infrastructure code needs the same quality assurance practices as application code, but testing infrastructure presents unique challenges. How do you unit test a VPC? How do you validate that your security policies actually work? How do you catch configuration errors before they reach production?&lt;/p&gt;&#xA;&lt;p&gt;This guide covers the complete spectrum of Terraform testing and validation, from static analysis and policy validation to integration testing with real cloud resources.&lt;/p&gt;&#xA;&lt;h2 id=&#34;static-analysis-and-linting&#34;&gt;Static Analysis and Linting&lt;/h2&gt;&#xA;&lt;p&gt;Static analysis catches errors before you even run Terraform, identifying syntax issues, security problems, and style inconsistencies that could cause problems later. Unlike application code, infrastructure code mistakes can be expensive—literally. A misconfigured security group or an oversized instance type can cost money and create security vulnerabilities.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Bounce Balls in C</title>
      <link>https://andrewodendaal.com/how-to-bounce-balls-in-c/</link>
      <pubDate>Fri, 11 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-bounce-balls-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;A child is playing with a ball on the nth floor of a tall building. The height of this floor, &lt;em&gt;h&lt;/em&gt;, is known.&lt;/p&gt;&#xA;&lt;p&gt;He drops the ball out of the window. The ball bounces (for example), to two-thirds of its height (a bounce of 0.66).&lt;/p&gt;&#xA;&lt;p&gt;His mother looks out of a window 1.5 meters from the ground.&lt;/p&gt;&#xA;&lt;p&gt;How many times will the mother see the ball pass in front of her window (including when it&amp;rsquo;s falling &lt;em&gt;and&lt;/em&gt; bouncing?&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Capitals in C</title>
      <link>https://andrewodendaal.com/how-to-find-the-capitals-in-c/</link>
      <pubDate>Thu, 10 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-capitals-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;Instructions&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Write a function that takes a single string (&lt;code&gt;word&lt;/code&gt;) as argument. The function must return an ordered list containing the indexes of all capital letters in the string.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Test.assertSimilar( capitals(&amp;#39;CodEStAr&amp;#39;), [0,3,4,6] );&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-c&#34;&gt;The solution in C&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#include &amp;lt;stddef.h&amp;gt;&#xA;#include &amp;lt;string.h&amp;gt;&#xA;#include &amp;lt;stdlib.h&amp;gt;&#xA;&#xA;size_t *find_capitals(const char *word, size_t *nb_uppercase)&#xA;{&#xA;    size_t n = strlen(word);&#xA;    size_t *arr = (size_t *) calloc(n, sizeof(size_t));&#xA;    size_t j = 0;&#xA;    for(size_t i=0; i&amp;lt;n; i++) {&#xA;        if(word[i] &amp;gt;=&amp;#39;A&amp;#39; &amp;amp;&amp;amp; word[i] &amp;lt;=&amp;#39;Z&amp;#39;) {&#xA;            arr[j++] = i;&#xA;        }&#xA;    }&#xA;    *nb_uppercase = j;&#xA;    return realloc(arr, j * sizeof(size_t));&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Empty and Delete an S3 Bucket using the AWS CLI</title>
      <link>https://andrewodendaal.com/how-to-empty-and-delete-an-s3-bucket-using-the-aws-cli/</link>
      <pubDate>Wed, 09 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-empty-and-delete-an-s3-bucket-using-the-aws-cli/</guid>
      <description>&lt;h2 id=&#34;option-1-8211-using-aws-cli&#34;&gt;Option 1 – Using &lt;code&gt;AWS CLI&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;export bucketname=&amp;#39;your-bucket-here&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws s3api delete-objects --bucket $bucketname --delete &amp;#34;$(aws s3api list-object-versions --bucket $bucketname --output=json --query=&amp;#39;{Objects: *[].{Key:Key,VersionId:VersionId}}&amp;#39;)&amp;#34;;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws s3 rb s3://$bucketname&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-python&#34;&gt;Option 2 – Using &lt;code&gt;Python&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#!/usr/bin/env python&#xA;&#xA;BUCKET = &amp;#39;your-bucket-here&amp;#39;&#xA;&#xA;import boto3&#xA;&#xA;s3 = boto3.resource(&amp;#39;s3&amp;#39;)&#xA;bucket = s3.Bucket(BUCKET)&#xA;bucket.object_versions.delete()&#xA;&#xA;bucket.delete()&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>What ports to open for FSx connection to AWS Managed Active Directory</title>
      <link>https://andrewodendaal.com/what-ports-to-open-for-fsx-connection-to-aws-managed-active-directory/</link>
      <pubDate>Tue, 08 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/what-ports-to-open-for-fsx-connection-to-aws-managed-active-directory/</guid>
      <description>&lt;p&gt;If you are creating a FSx file system, and want to connect it to AWS Managed Active Directory, then you will need to create a VPC Security Group with the following ports:&lt;/p&gt;&#xA;&lt;h2 id=&#34;inbound-ports&#34;&gt;Inbound ports&lt;/h2&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;&lt;/th&gt;&#xA;          &lt;th&gt;&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Rules&lt;/td&gt;&#xA;          &lt;td&gt;Ports&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;UDP&lt;/td&gt;&#xA;          &lt;td&gt;53, 88, 123, 389, 464&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;TCP&lt;/td&gt;&#xA;          &lt;td&gt;53, 88, 123, 389, 445, 464, 636, 3268, 3269, 9389, 49152-65535&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;h2 id=&#34;outbound-ports&#34;&gt;Outbound ports&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;All traffic&lt;/code&gt;, &lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Multi-Cloud Terraform: Managing Infrastructure Across Providers</title>
      <link>https://andrewodendaal.com/articles/terraform-multi-cloud/</link>
      <pubDate>Tue, 08 Nov 2022 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/terraform-multi-cloud/</guid>
      <description>&lt;p&gt;Multi-cloud strategies are becoming increasingly common as organizations seek to avoid vendor lock-in, leverage best-of-breed services, and meet compliance requirements. However, managing infrastructure across multiple cloud providers introduces complexity in networking, identity management, monitoring, and operational processes.&lt;/p&gt;&#xA;&lt;p&gt;This guide covers the patterns and practices for successfully implementing multi-cloud infrastructure with Terraform, from basic provider configuration to advanced cross-cloud networking and unified governance.&lt;/p&gt;&#xA;&lt;h2 id=&#34;multi-provider-setup&#34;&gt;Multi-Provider Setup&lt;/h2&gt;&#xA;&lt;p&gt;Managing infrastructure across multiple cloud providers requires careful planning of provider configurations, authentication strategies, and resource organization. Each cloud provider has different authentication mechanisms, regional structures, and service offerings that need to be coordinated in a unified Terraform configuration.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate Variance in Python</title>
      <link>https://andrewodendaal.com/how-to-calculate-variance-in-python/</link>
      <pubDate>Mon, 07 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-variance-in-python/</guid>
      <description>&lt;p&gt;If you need to calculate &lt;code&gt;variance&lt;/code&gt; in Python, then you can do the following.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-variance-from-statistics-module&#34;&gt;Option 1 – Using &lt;code&gt;variance()&lt;/code&gt; from &lt;code&gt;Statistics&lt;/code&gt; module&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import statistics&#xA;&#xA;list = [12,14,10,6,23,31]&#xA;print(&amp;#34;List : &amp;#34; + str(list))&#xA;&#xA;var = statistics.variance(list)&#xA;print(&amp;#34;Variance: &amp;#34; + str(var))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-var-from-numpy-module&#34;&gt;Option 2 – Using &lt;code&gt;var()&lt;/code&gt; from &lt;code&gt;numpy&lt;/code&gt; module&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import numpy as np&#xA;&#xA;arr = [12,43,24,17,32]&#xA;&#xA;print(&amp;#34;Array : &amp;#34;, arr)&#xA;print(&amp;#34;Variance: &amp;#34;, np.var(arr))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-sum-and-list-comprehensions&#34;&gt;Option 3 – Using &lt;code&gt;sum()&lt;/code&gt; and &lt;code&gt;List Comprehensions&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;list = [12,43,24,17,32]&#xA;average = sum(list) / len(list)&#xA;var = sum((x-average)**2 for x in list) / len(list)&#xA;print(var)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Calculate the Sum of a List in Python</title>
      <link>https://andrewodendaal.com/how-to-calculate-the-sum-of-a-list-in-python/</link>
      <pubDate>Sun, 06 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-the-sum-of-a-list-in-python/</guid>
      <description>&lt;p&gt;If you need to calculate and get the sum of a list in Python, then you can do the following.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-sum&#34;&gt;Option 1 – Using &lt;code&gt;sum()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;myList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]&#xA;listSum = sum(myList)&#xA;print(f&amp;#34;Sum of list -&amp;gt; {listSum}&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you get a &lt;code&gt;TypeError&lt;/code&gt; then you can do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;myList = [&amp;#34;1&amp;#34;, &amp;#34;3&amp;#34;, &amp;#34;5&amp;#34;, &amp;#34;7&amp;#34;, &amp;#34;9&amp;#34;]&#xA;myNewList = [int(string) for string in myList]&#xA;sum1 = sum(myNewList)&#xA;sum2 = sum(number for number in myNewList)&#xA;print(f&amp;#34;Sum of list -&amp;gt; {sum1}&amp;#34;)&#xA;print(f&amp;#34;Sum of list -&amp;gt; {sum2}&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-for&#34;&gt;Option 2 – Using &lt;code&gt;for&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;myList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]&#xA;length = len(myList)&#xA;listSum = 0&#xA;&#xA;for i in range(length):&#xA;    listSum += myList[i]&#xA;&#xA;print(f&amp;#34;Sum of list -&amp;gt; {listSum}&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to add a List to a Set in Python</title>
      <link>https://andrewodendaal.com/how-to-add-a-list-to-a-set-in-python/</link>
      <pubDate>Sat, 05 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-add-a-list-to-a-set-in-python/</guid>
      <description>&lt;p&gt;If you need to add a &lt;code&gt;list&lt;/code&gt; to a &lt;code&gt;set&lt;/code&gt; in Python, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-tuple&#34;&gt;Option 1 – Using &lt;code&gt;Tuple&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;myset = set((1,2,3,4))&#xA;mylist = list(1,2,3])&#xA;&#xA;myset.add(tuple(mylist))&#xA;print(myset)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt; &lt;code&gt;{1, 2, 3, 4, (1, 2, 3)}&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-2-8211-using-setupdate&#34;&gt;Option 2 – Using &lt;code&gt;set.update()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;myset = set((1,2,3,4))&#xA;mylist = list(8,9,12])&#xA;&#xA;myset.update(tuple(mylist))&#xA;print(myset)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt; &lt;code&gt;{1, 2, 3, 4, 8, 9, 12}&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Remove Punctuation from a List in Python</title>
      <link>https://andrewodendaal.com/how-to-remove-punctuation-from-a-list-in-python/</link>
      <pubDate>Fri, 04 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-remove-punctuation-from-a-list-in-python/</guid>
      <description>&lt;p&gt;If you have a Python list, and want to remove all punctuation, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;first-get-all-punctuation-by-using-stringpunctuation&#34;&gt;First get all punctuation by using &lt;code&gt;string.punctuation&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import string&#xA;print(string.punctuation)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;!&amp;#34;#$%&amp;amp;&amp;#39;()*+,-./:;&amp;lt;=&amp;gt;?@[\]^_`{|}~&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-1-8211-using-for&#34;&gt;Option 1 – Using &lt;code&gt;for&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import string&#xA;words = [&amp;#34;hell&amp;#39;o&amp;#34;, &amp;#34;Hi,&amp;#34;, &amp;#34;bye bye&amp;#34;, &amp;#34;good bye&amp;#34;, &amp;#34;&amp;#34;]&#xA;new_words = []&#xA;for word in words:&#xA;    if word == &amp;#34;&amp;#34;:&#xA;        words.remove(word)&#xA;    else:&#xA;        for letter in word:&#xA;            if letter in string.punctuation:&#xA;                word = word.replace(letter,&amp;#34;&amp;#34;)   &#xA;        new_words.append(word)&#xA;print(new_words)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-list-comprehensions&#34;&gt;Option 2 – Using &lt;code&gt;List Comprehensions&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import string&#xA;words = [&amp;#34;hell&amp;#39;o&amp;#34;, &amp;#34;Hi,&amp;#34;, &amp;#34;bye bye&amp;#34;, &amp;#34;good bye&amp;#34;, &amp;#34;&amp;#34;]&#xA;words = [&amp;#39;&amp;#39;.join(letter for letter in word if letter not in string.punctuation) for word in words if word]&#xA;print(words)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-strtranslate&#34;&gt;Option 3 – Using &lt;code&gt;str.translate()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import string&#xA;words = [&amp;#34;hell&amp;#39;o&amp;#34;, &amp;#34;Hi,&amp;#34;, &amp;#34;bye bye&amp;#34;, &amp;#34;good bye&amp;#34;, &amp;#34;&amp;#34;]&#xA;words = [word.translate(string.punctuation) for word in words if word]&#xA;print(words)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Normalize a List of Numbers in Python</title>
      <link>https://andrewodendaal.com/how-to-normalize-a-list-of-numbers-in-python/</link>
      <pubDate>Thu, 03 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-normalize-a-list-of-numbers-in-python/</guid>
      <description>&lt;p&gt;If you need to normalize a list of numbers in Python, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-native-python&#34;&gt;Option 1 – Using &lt;code&gt;Native Python&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;list = [6,1,0,2,7,3,8,1,5]&#xA;print(&amp;#39;Original List:&amp;#39;,list)&#xA;xmin = min(list) &#xA;xmax=max(list)&#xA;for i, x in enumerate(list):&#xA;    list[i] = (x-xmin) / (xmax-xmin)&#xA;print(&amp;#39;Normalized List:&amp;#39;,list)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-minmaxscaler-from-sklearn&#34;&gt;Option 2 – Using &lt;code&gt;MinMaxScaler&lt;/code&gt; from &lt;code&gt;sklearn&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import numpy as np&#xA;from sklearn import preprocessing&#xA;list = np.array([6,1,0,2,7,3,8,1,5]).reshape(-1,1)&#xA;print(&amp;#39;Original List:&amp;#39;,list)&#xA;scaler = preprocessing.MinMaxScaler()&#xA;normalizedlist=scaler.fit_transform(list)&#xA;print(&amp;#39;Normalized List:&amp;#39;,normalizedlist)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can also specify the &lt;code&gt;range&lt;/code&gt; of the &lt;code&gt;MinMaxScaler()&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Multiply a List by a Scalar in Python</title>
      <link>https://andrewodendaal.com/how-to-multiply-a-list-by-a-scalar-in-python/</link>
      <pubDate>Wed, 02 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-multiply-a-list-by-a-scalar-in-python/</guid>
      <description>&lt;p&gt;If you need to multiply a list by a scalar in Python, then you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-list-comprehensions&#34;&gt;Option 1 – Using &lt;code&gt;List Comprehensions&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;li = [1,2,3,4]&#xA;multiple = 2.5&#xA;li = [x*multiple for x in li]&#xA;print(li)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt; &lt;code&gt;[2.5, 5.0, 7.5, 10.0]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-2-8211-using-map&#34;&gt;Option 2 – Using &lt;code&gt;map()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;li = [1,2,3,4]&#xA;multiple = 2.5&#xA;def multiply(le):&#xA;    return le*multiple&#xA;&#xA;li = list(map(multiply,li))&#xA;print(li)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt; &lt;code&gt;[2.5, 5.0, 7.5, 10.0]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-3-8211-using-lambda-functions&#34;&gt;Option 3 – Using &lt;code&gt;Lambda Functions&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;li = [1,2,3,4]&#xA;multiple = 2.5&#xA;li = list(map(lambda x: x*multiple, li))&#xA;print(li)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt; &lt;code&gt;[2.5, 5.0, 7.5, 10.0]&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Index of the Minimum Element in a List in Python</title>
      <link>https://andrewodendaal.com/how-to-find-the-index-of-the-minimum-element-in-a-list-in-python/</link>
      <pubDate>Tue, 01 Nov 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-index-of-the-minimum-element-in-a-list-in-python/</guid>
      <description>&lt;p&gt;If you need to find the &lt;code&gt;index&lt;/code&gt; of the minimum element in a list, you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-min-and-index&#34;&gt;Option 1 – Using &lt;code&gt;min()&lt;/code&gt; and &lt;code&gt;index()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;lst = [8,6,9,-1,2,0]&#xA;m = min(lst)&#xA;print(lst.index(m))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt; &lt;code&gt;3&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-2-8211-using-min-and-for&#34;&gt;Option 2 – Using &lt;code&gt;min()&lt;/code&gt; and &lt;code&gt;for&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;lst = [8,6,9,-1,2,0]&#xA;m = min(lst)&#xA;for i in range(len(lst)):&#xA;    if(lst[i]==m):&#xA;        print(i)&#xA;        break&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt; &lt;code&gt;3&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-3-8211-using-min-and-enumerate&#34;&gt;Option 3 – Using &lt;code&gt;min()&lt;/code&gt; and &lt;code&gt;enumerate()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;lst = [8,6,9,-1,2,0]&#xA;a,i = min((a,i) for (i,a) in enumerate(lst))&#xA;print(i)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;em&gt;Output:&lt;/em&gt; &lt;code&gt;3&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Convert a Set to a String in Python</title>
      <link>https://andrewodendaal.com/how-to-convert-a-set-to-a-string-in-python/</link>
      <pubDate>Mon, 31 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-a-set-to-a-string-in-python/</guid>
      <description>&lt;p&gt;If you need to convert a &lt;code&gt;set&lt;/code&gt; to a &lt;code&gt;string&lt;/code&gt; in Python, then you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-map-and-join&#34;&gt;Option 1 – Using &lt;code&gt;map()&lt;/code&gt; and &lt;code&gt;join()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;str_new = &amp;#39;, &amp;#39;.join(list(map(str, se)))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can confirm this worked as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;print(str_new)&#xA;print(type(str_new))&#xA;&#xA;# &amp;#39;1, 2, 3&amp;#39;&#xA;# &amp;lt;class &amp;#39;str&amp;#39;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-repr&#34;&gt;Option 2 – Using &lt;code&gt;repr()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;r_str = repr(se)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can confirm this worked as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;print(r_str)&#xA;print(type(r_str))&#xA;&#xA;# {1, 2, 3}&#xA;# &amp;lt;class &amp;#39;str&amp;#39;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Decrement a Loop in Python</title>
      <link>https://andrewodendaal.com/how-to-decrement-a-loop-in-python/</link>
      <pubDate>Sun, 30 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-decrement-a-loop-in-python/</guid>
      <description>&lt;p&gt;If you need to decrement a loop in Python, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-decrement-a-loop-in-python-using--1&#34;&gt;How to Decrement a loop in Python using &lt;code&gt;-1&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;The optional third argument you can pass to the &lt;code&gt;range&lt;/code&gt; function is the order.&lt;/p&gt;&#xA;&lt;p&gt;The default order is to count up / increment, while the &lt;code&gt;-1&lt;/code&gt; value, is to count down / decrement.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;for i in range(3, 0, -1):&#xA;  print(i)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Output: &lt;code&gt;3 2 1&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-decrement-a-loop-in-python-using-while&#34;&gt;How to Decrement a loop in Python using &lt;code&gt;while&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;You can also use a &lt;code&gt;while&lt;/code&gt; loop and set the value to the upper bound, and then decrement while in the loop itself.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create Zip Archive of Directory in Python</title>
      <link>https://andrewodendaal.com/how-to-create-zip-archive-of-directory-in-python/</link>
      <pubDate>Sat, 29 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-zip-archive-of-directory-in-python/</guid>
      <description>&lt;p&gt;If you need to create a &lt;code&gt;zip&lt;/code&gt; of a directory using Python, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;create-a-zip-using-shutil-in-python&#34;&gt;Create a Zip using &lt;code&gt;shutil&lt;/code&gt; in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import os&#xA;import shutil&#xA;&#xA;filename = &amp;#34;compressed_archive&amp;#34;&#xA;format = &amp;#34;zip&amp;#34;&#xA;directory = os.getcwd()&#xA;&#xA;shutil.make_archive(filename, format, directory)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Remove the Last Character of a String in PHP</title>
      <link>https://andrewodendaal.com/how-to-remove-the-last-character-of-a-string-in-php/</link>
      <pubDate>Fri, 28 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-remove-the-last-character-of-a-string-in-php/</guid>
      <description>&lt;p&gt;If you need to remove the last character of a string in PHP, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-rtrim&#34;&gt;Option 1 – Using &lt;code&gt;rtrim()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;em&gt;Syntax:&lt;/em&gt; &lt;code&gt;rtrim($string, $character)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$mystring = &amp;#34;This is a PHP program!&amp;#34;;&#xA;echo(&amp;#34;Before Removal: $mystring\n&amp;#34;);&#xA;# Before Removal: This is a PHP program!&#xA;&#xA;$newstring = rtrim($mystring, &amp;#34;. &amp;#34;);&#xA;echo(&amp;#34;After Removal: $newstring&amp;#34;);&#xA;# After Removal: This is a PHP program&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-substr&#34;&gt;Option 2 – Using &lt;code&gt;substr()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;em&gt;Syntax:&lt;/em&gt; &lt;code&gt;substr($string, $start, $length)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$mystring = &amp;#34;This is a PHP program!&amp;#34;;&#xA;echo substr($mystring, 0, -1);&#xA;# This is a PHP program&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Create Function with Multiple Returns in PHP</title>
      <link>https://andrewodendaal.com/how-to-create-function-with-multiple-returns-in-php/</link>
      <pubDate>Thu, 27 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-function-with-multiple-returns-in-php/</guid>
      <description>&lt;p&gt;If you need to create a PHP function that returns multiple values, then you can do one of the following.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-returning-an-array&#34;&gt;Option 1 – Returning an &lt;code&gt;array&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function returnArray() {&#xA;  return array(&amp;#34;one&amp;#34;, &amp;#34;two&amp;#34;);&#xA;}&#xA;&#xA;// call the function and print the response&#xA;var_dump(returnArray());&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-returning-a-conditional&#34;&gt;Option 2 – Returning a &lt;code&gt;conditional&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function returnConditional($x = true) {&#xA;  if ($x) return &amp;#34;one&amp;#34;;&#xA;  else return &amp;#34;two&amp;#34;;&#xA;}&#xA;&#xA;// call the function with a value and print the response&#xA;var_dump(returnConditional(false));&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-generator-to-yield-values&#34;&gt;Option 3 – Using &lt;code&gt;generator&lt;/code&gt; to &lt;code&gt;yield&lt;/code&gt; values&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function multipleValues() {&#xA;  yield &amp;#34;one&amp;#34;;&#xA;  yield &amp;#34;two&amp;#34;;&#xA;}&#xA;&#xA;$res = multipleValues();&#xA;foreach($res as $r) {&#xA;  echo $r; // first val==&amp;#34;one&amp;#34;, second val==&amp;#34;two&amp;#34;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Download a File in NodeJS without any Third Party Libraries</title>
      <link>https://andrewodendaal.com/how-to-download-a-file-in-nodejs-without-any-third-party-libraries/</link>
      <pubDate>Wed, 26 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-download-a-file-in-nodejs-without-any-third-party-libraries/</guid>
      <description>&lt;p&gt;If you need to download a file in NodeJS without using any third party libraries, then you can do the following.&lt;/p&gt;&#xA;&lt;p&gt;The NodeJS ecosystem comes with a &lt;code&gt;fs&lt;/code&gt; module, this is to denote the FileSystem built in library.&lt;/p&gt;&#xA;&lt;p&gt;First declare your imports:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;const http = require(&amp;#39;https&amp;#39;);&#xA;const fs = require(&amp;#39;fs&amp;#39;);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now you can use the &lt;code&gt;https&lt;/code&gt; module to download a file, and write it to a stream using &lt;code&gt;fs&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;const https = require(&amp;#34;https&amp;#34;);&#xA;const fs = require(&amp;#34;fs&amp;#34;);&#xA; &#xA;const endpoint = &amp;#34;https://example/files/some_csv_file&amp;#34;;&#xA; &#xA;https.get(endpoint, (res) =&amp;gt; {&#xA;  const file_name = &amp;#34;the_csv.csv&amp;#34;;&#xA;  const writeStream = fs.createWriteStream(file_name);&#xA;});&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Execute a Shell Script in NodeJS</title>
      <link>https://andrewodendaal.com/how-to-execute-a-shell-script-in-nodejs/</link>
      <pubDate>Tue, 25 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-execute-a-shell-script-in-nodejs/</guid>
      <description>&lt;p&gt;If you need to execute a shell script in NodeJS, then you can use the &lt;code&gt;exec&lt;/code&gt; keyword.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Syntax:&lt;/em&gt; &lt;code&gt;exec(command [, options] [, callback]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;const shell = require(&amp;#39;shelljs&amp;#39;)&#xA;shell.exec(&amp;#34;npm --version&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Print Multiple Arguments in Python</title>
      <link>https://andrewodendaal.com/how-to-print-multiple-arguments-in-python/</link>
      <pubDate>Mon, 24 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-print-multiple-arguments-in-python/</guid>
      <description>&lt;p&gt;If you need to print out multiple arguments using Python, then you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-print&#34;&gt;Option 1 – Using &lt;code&gt;print&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;print(&amp;#34;Something&amp;#34;, &amp;#34;Else&amp;#34;, &amp;#34;Please&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;em&gt;Output&lt;/em&gt;: &lt;code&gt;Something Else Please&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-2-8211-using-string-formatting&#34;&gt;Option 2 – Using &lt;code&gt;String Formatting&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;print(&amp;#34;Something {} {}&amp;#34;.format(&amp;#34;Else&amp;#34;, &amp;#34;Please&amp;#34;))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;em&gt;Output&lt;/em&gt;: &lt;code&gt;Something Else Please&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;or-with-explicit-ordering&#34;&gt;Or with explicit ordering:&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;print(&amp;#34;Something {1} {0}&amp;#34;.format(&amp;#34;Else&amp;#34;, &amp;#34;Please&amp;#34;))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;em&gt;Output&lt;/em&gt;: &lt;code&gt;Something Please Else&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-3-8211-using-f-string-formatting&#34;&gt;Option 3 – Using &lt;code&gt;F-String Formatting&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;one = &amp;#34;Something&amp;#34;&#xA;two = &amp;#34;Else&amp;#34;&#xA;three = &amp;#34;Please&amp;#34;&#xA;&#xA;print(f&amp;#34;{one} {two} {three}&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;em&gt;Output&lt;/em&gt;: &lt;code&gt;Something Else Please&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Delete all Resources Except One in Terraform</title>
      <link>https://andrewodendaal.com/how-to-delete-all-resources-except-one-in-terraform/</link>
      <pubDate>Sun, 23 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-delete-all-resources-except-one-in-terraform/</guid>
      <description>&lt;p&gt;If you need to delete all resources created by Terraform, except for a single, specific one, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-get-the-current-state-list&#34;&gt;Step 1 – Get the current &lt;code&gt;state list&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;terraform state list&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-remove-the-exception-resource&#34;&gt;Step 2 – Remove the exception resource&lt;/h2&gt;&#xA;&lt;p&gt;Remove the specific resource that you don&amp;rsquo;t want Terraform to track anymore.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;terraform state rm &amp;lt;resource_to_be_removed&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-3-8211-destroy-the-resources&#34;&gt;Step 3 – Destroy the resources&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;terraform destroy&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Copy Files between Two Nodes using Ansible</title>
      <link>https://andrewodendaal.com/how-to-copy-files-between-two-nodes-using-ansible/</link>
      <pubDate>Sat, 22 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-copy-files-between-two-nodes-using-ansible/</guid>
      <description>&lt;p&gt;If you need to copy files between two (2) nodes, using Ansible, then you can do the following:&lt;/p&gt;&#xA;&lt;p&gt;This solution uses the &lt;code&gt;synchronize&lt;/code&gt; module, specifically using the &lt;code&gt;delegate_to:source-server&lt;/code&gt; keywords.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;- hosts: serverB&#xA;  tasks:    &#xA;   - name: Copy Remote-To-Remote (from serverA to serverB)&#xA;     synchronize: src=https://andrewodendaal.com/copy/from_serverA dest=/copy/to_serverB&#xA;     delegate_to: serverA&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Delete Files and Folders in a Directory using Ansible</title>
      <link>https://andrewodendaal.com/how-to-delete-files-and-folders-in-a-directory-using-ansible/</link>
      <pubDate>Fri, 21 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-delete-files-and-folders-in-a-directory-using-ansible/</guid>
      <description>&lt;p&gt;If you need to delete files and folders in a directory using Ansible, then you can do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;- name: Delete content &amp;amp; entire directory&#xA;  file:&#xA;    state: absent&#xA;    path: /some/directory/path/&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Copy Multiple Files with Ansible</title>
      <link>https://andrewodendaal.com/how-to-copy-multiple-files-with-ansible/</link>
      <pubDate>Thu, 20 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-copy-multiple-files-with-ansible/</guid>
      <description>&lt;p&gt;If you need to copy multiple files using Ansible, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-copy-multiple-files-with-ansible&#34;&gt;How to Copy Multiple Files with Ansible&lt;/h2&gt;&#xA;&lt;p&gt;Look into using the &lt;code&gt;with_fileglob&lt;/code&gt; loop as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;- copy:&#xA;    src: &amp;#34;{{ item }}&amp;#34;&#xA;    dest: /etc/fooapp/&#xA;    owner: root&#xA;    mode: 600&#xA;  with_fileglob:&#xA;    - /playbooks/files/fooapp/*&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you would like to do it as a task, then this could help:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;- name: Your copy task&#xA;  copy: src={{ item.src }} dest={{ item.dest }}&#xA;  with_items:&#xA;    - { src: &amp;#39;another_file&amp;#39;, dest: &amp;#39;/etc/somewhere&amp;#39; }&#xA;    - { src: &amp;#39;dynamic&amp;#39;, dest: &amp;#39;{{ var_path }}&amp;#39; }&#xA;  # repeat for additional files&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Write Multiline Shell Scripts in Ansible</title>
      <link>https://andrewodendaal.com/how-to-write-multiline-shell-scripts-in-ansible/</link>
      <pubDate>Wed, 19 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-write-multiline-shell-scripts-in-ansible/</guid>
      <description>&lt;p&gt;If you need to write a shell script in Ansible, you probably have something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;- name: iterate user groups&#xA;  shell: groupmod -o -g {{ item[&amp;#39;guid&amp;#39;] }} {{ item[&amp;#39;username&amp;#39;] }}&#xA;  with_items: &amp;#34;{{ users }}&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;But how do you write multiline shell scripts with this format?&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-write-multiline-shell-scripts&#34;&gt;How to write Multiline shell scripts&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;- name: iterate user groups&#xA;  shell: |&#xA;    groupmod -o -g {{ item[&amp;#39;guid&amp;#39;] }} {{ item[&amp;#39;username&amp;#39;] }} &#xA;    do_some_stuff_here&#xA;    and_some_other_stuff&#xA;  with_items: &amp;#34;{{ users }}&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Just note that Ansible can do some strange things with manipulations of arguments, so you may want to follow something like this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Pass Variables to Ansible Playbook CLI</title>
      <link>https://andrewodendaal.com/how-to-pass-variables-to-ansible-playbook-cli/</link>
      <pubDate>Tue, 18 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-pass-variables-to-ansible-playbook-cli/</guid>
      <description>&lt;p&gt;If you need to pass a variable to Ansible playbook, using the command line, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-specifying-command-line-arguments&#34;&gt;Option 1 – Specifying command line arguments&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ansible-playbook release.yml --extra-vars &amp;#34;version=1.23.45 other_variable=foo&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;N.B. &lt;code&gt;--extra-vars&lt;/code&gt; specified variables will override any variables with the same name defined inside the playbook.&lt;/p&gt;&#xA;&lt;p&gt;You can also read up on &lt;!-- raw HTML omitted --&gt;Passing Variables On The Command Line&lt;!-- raw HTML omitted --&gt; (Wayback Machine link to maintain versioning)&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create a Directory using Ansible</title>
      <link>https://andrewodendaal.com/how-to-create-a-directory-using-ansible/</link>
      <pubDate>Mon, 17 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-directory-using-ansible/</guid>
      <description>&lt;p&gt;If you need to create a directory using Ansible, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;create-a-directory-in-ansible&#34;&gt;Create a Directory in Ansible&lt;/h2&gt;&#xA;&lt;p&gt;You will need the &lt;code&gt;file&lt;/code&gt; module, then to create a directory you simply specify the option &lt;code&gt;state=directory&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;- name: Creates a directory&#xA;  file:&#xA;    path: /src/www&#xA;    state: directory&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note that with &lt;code&gt;state=directory&lt;/code&gt;, all the immediate subdirectories will be created if they don&amp;rsquo;t already exist.&lt;/p&gt;&#xA;&lt;h2 id=&#34;extending-the-file-module&#34;&gt;Extending the &lt;code&gt;file&lt;/code&gt; module&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;- name: Creates a directory&#xA;  file:&#xA;    path: /src/www&#xA;    state: directory&#xA;    owner: www-data&#xA;    group: www-data&#xA;    mode: 0775&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;create-the-directories-recursively&#34;&gt;Create the Directories Recursively&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;- name: Creates directory&#xA;  file:&#xA;    path: /src/www&#xA;    state: directory&#xA;    owner: www-data&#xA;    group: www-data&#xA;    mode: 0775&#xA;    recurse: yes&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is similar to the &lt;code&gt;recursive&lt;/code&gt; argument used with &lt;code&gt;mkdir -p&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Disable Screensaver on Mac using the CLI</title>
      <link>https://andrewodendaal.com/how-to-disable-screensaver-on-mac-using-the-cli/</link>
      <pubDate>Sun, 16 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-disable-screensaver-on-mac-using-the-cli/</guid>
      <description>&lt;p&gt;If you want to disable the Screensaver on your Mac, by using the Command Line Interface (CLI), then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-see-what-is-currently-set&#34;&gt;Step 1 – See what is currently set&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;defaults read com.apple.screensaver&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-set-the-idletime&#34;&gt;Step 2 – Set the &lt;code&gt;idleTime&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;defaults -currentHost write com.apple.screensaver idleTime 0&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-3-8211-optional-8211-undo-the-change&#34;&gt;Step 3 – (Optional) – Undo the change&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;defaults -currentHost delete com.apple.screensaver idleTime&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Remove Old and Unused Docker Images</title>
      <link>https://andrewodendaal.com/how-to-remove-old-and-unused-docker-images/</link>
      <pubDate>Sat, 15 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-remove-old-and-unused-docker-images/</guid>
      <description>&lt;p&gt;If you need to remove any old and unused Docker images, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-remove-old-and-unused-docker-images&#34;&gt;How to Remove Old and Unused Docker Images&lt;/h2&gt;&#xA;&lt;p&gt;Firstly you need to see all the images:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;docker images&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can also use &lt;code&gt;ls&lt;/code&gt; to see the Docker Images:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;docker image ls&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-remove-a-single-docker-image&#34;&gt;How to Remove a Single Docker Image&lt;/h2&gt;&#xA;&lt;p&gt;The &lt;code&gt;docker rmi&lt;/code&gt; command will remove a single Docker image as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;docker rmi &amp;lt;image_id&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can also use the Docker image names as follows:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Convert Milliseconds to Date in Javascript</title>
      <link>https://andrewodendaal.com/how-to-convert-milliseconds-to-date-in-javascript/</link>
      <pubDate>Fri, 14 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-milliseconds-to-date-in-javascript/</guid>
      <description>&lt;p&gt;If you need to convert Milliseconds to Date in Javascript, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-convert-milliseconds-to-date-in-javascript&#34;&gt;How to Convert Milliseconds to Date in Javascript&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;let date = new Date(milliseconds);&#xA;date.toString();&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;common-date-conversions-from-milliseconds-in-javascript&#34;&gt;Common Date Conversions From Milliseconds in Javascript&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;let originalDate = new Date(milliseconds);&#xA;&#xA;// output: &amp;#34;D/MM/YYYY, H:MM:SS PM/AM&amp;#34;&#xA;originalDate.toLocaleString();&#xA;&#xA;//output: &amp;#34;D/MM/YYYY&amp;#34;&#xA;originalDate.toLocaleDateString();&#xA;&#xA;// output: &amp;#34;Day Month DD YYYY&amp;#34;&#xA;originalDate.toDateString();&#xA;&#xA;// output: &amp;#34;HH:MM:SS GMT+0530&amp;#34;&#xA;originalDate.toTimeString();&#xA;&#xA;// output: &amp;#34;Day Month DD YYYY HH:MM:SS GMT+0500&amp;#34;&#xA;originalDate.toString();&#xA;&#xA;// output: &amp;#34;H:MM:SS AM/PM&amp;#34;&#xA;originalDate.toLocaleTimeString();&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Convert String to Title Case in Javascript</title>
      <link>https://andrewodendaal.com/how-to-convert-string-to-title-case-in-javascript/</link>
      <pubDate>Thu, 13 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-string-to-title-case-in-javascript/</guid>
      <description>&lt;p&gt;If you need to convert a String to Title Case in Javascript, then you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-a-for-loop&#34;&gt;Option 1 – Using a &lt;code&gt;for&lt;/code&gt; loop&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function titleCase(str) {&#xA;  str = str.toLowerCase().split(&amp;#39; &amp;#39;);&#xA;  for (var i = 0; i &amp;lt; str.length; i++)&#xA;    str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1); &#xA;  return str.join(&amp;#39; &amp;#39;);&#xA;}&#xA;&#xA;console.log(titleCase(&amp;#34;this is an example of some text!&amp;#34;));&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Output: &lt;code&gt;This Is An Example Of Some Text!&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-2-8211-using-map&#34;&gt;Option 2 – Using &lt;code&gt;map()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function titleCase(str) {&#xA;  return str.toLowerCase().split(&amp;#39; &amp;#39;).map(function(word) {&#xA;    return (word.charAt(0).toUpperCase() + word.slice(1));&#xA;  }).join(&amp;#39; &amp;#39;);&#xA;}&#xA;&#xA;console.log(titleCase(&amp;#34;this is an example of some text!&amp;#34;));&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Output: &lt;code&gt;This Is An Example Of Some Text!&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Compile Multiple Java Files from a Single Command in Java</title>
      <link>https://andrewodendaal.com/how-to-compile-multiple-java-files-from-a-single-command-in-java/</link>
      <pubDate>Wed, 12 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-compile-multiple-java-files-from-a-single-command-in-java/</guid>
      <description>&lt;p&gt;If you need to compile multiple Java files using a single command, then you can do the following.&lt;/p&gt;&#xA;&lt;p&gt;First, it&amp;rsquo;s good to learn how to compile a Java file.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-compile-a-java-file&#34;&gt;How to Compile a Java File&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s take the following Java code:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class HelloWorld {&#xA;  public static void main(String[] args) {&#xA;    System.out.println(&amp;#34;Hello World&amp;#34;);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To compile this, we simply do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;javac HelloWorld.java&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then when we need to run it, we do:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Convert JSON to a Java Object</title>
      <link>https://andrewodendaal.com/how-to-convert-json-to-a-java-object/</link>
      <pubDate>Tue, 11 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-json-to-a-java-object/</guid>
      <description>&lt;p&gt;If you need to convert JSON to a Java Object, then you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-gson&#34;&gt;Option 1 – Using &lt;code&gt;Gson&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import com.google.gson.Gson;&#xA;&#xA;public class SimpleTesting {&#xA;    public static void main(String[] args) throws InterruptedException {&#xA;        String json = &amp;#34;&amp;#34;&amp;#34;&#xA;            {&#xA;                &amp;#34;firstName&amp;#34; : &amp;#34;Jane&amp;#34;,&#xA;                &amp;#34;lastName&amp;#34; : &amp;#34;Doe&amp;#34;,&#xA;                &amp;#34;dateOfBirth&amp;#34; : &amp;#34;1973-04-29&amp;#34;,&#xA;                &amp;#34;address&amp;#34; : &amp;#34;81 Hype&amp;#34;,&#xA;                &amp;#34;city&amp;#34; : &amp;#34;New York&amp;#34;,&#xA;                &amp;#34;contact&amp;#34; : &amp;#34;0123456789&amp;#34;&#xA;            }&#xA;            &amp;#34;&amp;#34;&amp;#34;;&#xA;        Student data = new Gson().fromJson(json, Student.class);&#xA;&#xA;        System.out.println(data.getFirstName());&#xA;        System.out.println(data.getLastName());&#xA;        System.out.println(data.getCity());&#xA;    }&#xA;}&#xA;&#xA;class Student {&#xA;    private String firstName;&#xA;    private String lastName;&#xA;    private String dateOfBirth;&#xA;    private String address;&#xA;    private String city;&#xA;    private String contact;&#xA;&#xA;    public String getFirstName() {&#xA;        return firstName;&#xA;    }&#xA;    public void setFirstName(String firstName) {&#xA;        this.firstName = firstName;&#xA;    }&#xA;    public String getLastName() {&#xA;        return lastName;&#xA;    }&#xA;    public void setLastName(String lastName) {&#xA;        this.lastName = lastName;&#xA;    }&#xA;    public String getDateOfBirth() {&#xA;        return dateOfBirth;&#xA;    }&#xA;    public void setDateOfBirth(String dateOfBirth) {&#xA;        this.dateOfBirth = dateOfBirth;&#xA;    }&#xA;    public String getAddress() {&#xA;        return address;&#xA;    }&#xA;    public void setAddress(String address) {&#xA;        this.address = address;&#xA;    }&#xA;    public String getCity() {&#xA;        return city;&#xA;    }&#xA;    public void setCity(String city) {&#xA;        this.city = city;&#xA;    }&#xA;    public String getContact() {&#xA;        return contact;&#xA;    }&#xA;    public void setContact(String contact) {&#xA;        this.contact = contact;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-jackson&#34;&gt;Option 2 – Using &lt;code&gt;Jackson&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.io.File;&#xA;import java.io.IOException;&#xA;import com.fasterxml.jackson.databind.ObjectMapper;&#xA;import com.fasterxml.jackson.databind.SerializationFeature;&#xA;&#xA;public class SimpleTesting {&#xA;    public static void main(String[] args) throws InterruptedException {&#xA;        ObjectMapper mapper = new ObjectMapper();&#xA;        mapper.enable(SerializationFeature.INDENT_OUTPUT);&#xA;        try {&#xA;            Student student = mapper.readValue(new File(&amp;#34;json-file.json&amp;#34;), Student.class);&#xA;&#xA;            System.out.println(&amp;#34;First Name: &amp;#34;+student.getFirstName());&#xA;            System.out.println(&amp;#34;Last Name: &amp;#34;+student.getLastName());&#xA;            System.out.println(&amp;#34;City: &amp;#34;+student.getCity());&#xA;            System.out.println(&amp;#34;Address: &amp;#34;+student.getAddress());&#xA;            System.out.println(&amp;#34;Contact: &amp;#34;+student.getContact());&#xA;            System.out.println(&amp;#34;Date of Birth: &amp;#34;+student.getDateOfBirth());&#xA;        } catch(IOException e) {&#xA;            e.printStackTrace();&#xA;        }&#xA;    }&#xA;}&#xA;&#xA;class Student {&#xA;    private String firstName;&#xA;    private String lastName;&#xA;    private String dateOfBirth;&#xA;    private String address;&#xA;    private String city;&#xA;    private String contact;&#xA;&#xA;    public String getFirstName() {&#xA;        return firstName;&#xA;    }&#xA;    public void setFirstName(String firstName) {&#xA;        this.firstName = firstName;&#xA;    }&#xA;    public String getLastName() {&#xA;        return lastName;&#xA;    }&#xA;    public void setLastName(String lastName) {&#xA;        this.lastName = lastName;&#xA;    }&#xA;    public String getDateOfBirth() {&#xA;        return dateOfBirth;&#xA;    }&#xA;    public void setDateOfBirth(String dateOfBirth) {&#xA;        this.dateOfBirth = dateOfBirth;&#xA;    }&#xA;    public String getAddress() {&#xA;        return address;&#xA;    }&#xA;    public void setAddress(String address) {&#xA;        this.address = address;&#xA;    }&#xA;    public String getCity() {&#xA;        return city;&#xA;    }&#xA;    public void setCity(String city) {&#xA;        this.city = city;&#xA;    }&#xA;    public String getContact() {&#xA;        return contact;&#xA;    }&#xA;    public void setContact(String contact) {&#xA;        this.contact = contact;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Calculate Powers of Integers in Java</title>
      <link>https://andrewodendaal.com/how-to-calculate-powers-of-integers-in-java/</link>
      <pubDate>Mon, 10 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-powers-of-integers-in-java/</guid>
      <description>&lt;p&gt;If you need to calculate the powers of Integers in Java, then you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-for-loops&#34;&gt;Option 1 – Using &lt;code&gt;for&lt;/code&gt; loops&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Power {&#xA;    public static void main(String args[]){&#xA;        int number = 5;&#xA;        int power = 3;&#xA;        int result = calculatePower(number,power);&#xA;        System.out.println(number+&amp;#34;^&amp;#34;+power+&amp;#34;=&amp;#34;+result);&#xA;    }&#xA;    static int calculatePower(int num, int power){&#xA;        int answer = 1;&#xA;        if (num &amp;gt; 0 &amp;amp;&amp;amp; power==0){&#xA;            return answer;&#xA;        } else if(num == 0 &amp;amp;&amp;amp; power&amp;gt;=1){&#xA;            return 0;&#xA;        } else{&#xA;            for(int i = 1; i&amp;lt;= power; i++)&#xA;                answer = answer*num;&#xA;            return answer;&#xA;        }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-recursion&#34;&gt;Option 2 – Using Recursion&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Power {&#xA;    public static void main(String args[]){&#xA;        int number = 3;&#xA;        int power = 3;&#xA;        int result = CalculatePower(number,power);&#xA;        System.out.println(number+&amp;#34;^&amp;#34;+power+&amp;#34;=&amp;#34;+result);&#xA;    }&#xA;    static int CalculatePower (int num, int pow){&#xA;        if (pow == 0)&#xA;            return 1;&#xA;        else&#xA;            return num * CalculatePower(num, pow - 1);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-mathpow&#34;&gt;Option 3 – Using &lt;code&gt;Math.pow()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.lang.Math;&#xA;public class Power {&#xA;    public static void main(String args[]){&#xA;        int number = 6;&#xA;        int power = 3;&#xA;        double result = CalculatePower(number,power);&#xA;        System.out.println(number+&amp;#34;^&amp;#34;+power+&amp;#34;=&amp;#34;+result);&#xA;    }&#xA;    static double CalculatePower (int num, int pow){&#xA;        return Math.pow(num,pow);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Get Today’s Date in Java</title>
      <link>https://andrewodendaal.com/how-to-get-todays-date-in-java/</link>
      <pubDate>Sun, 09 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-todays-date-in-java/</guid>
      <description>&lt;p&gt;If you need to get today&amp;rsquo;s date in Java, then you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-localdate&#34;&gt;Option 1 – Using &lt;code&gt;LocalDate&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.time.LocalDate;&#xA;&#xA;public class GetTodayDate {&#xA;    public static void main(String[] args) {&#xA;        LocalDate todaysDate = LocalDate.now();&#xA;        System.out.println(todaysDate);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-calendar-and-simpledateformat&#34;&gt;Option 2 – Using &lt;code&gt;Calendar&lt;/code&gt; and &lt;code&gt;SimpleDateFormat&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.text.SimpleDateFormat;&#xA;import java.util.Calendar;&#xA;import java.util.Date;&#xA;&#xA;public class GetTodayDate {&#xA;    public static void main(String[] args) {&#xA;        SimpleDateFormat dtf = new SimpleDateFormat(&amp;#34;yyyy/MM/dd&amp;#34;);&#xA;        Calendar calendar = Calendar.getInstance();&#xA;&#xA;        Date dateObj = calendar.getTime();&#xA;        String formattedDate = dtf.format(dateObj);&#xA;        System.out.println(formattedDate);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-javasqldate&#34;&gt;Option 3 – Using &lt;code&gt;java.sql.Date&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.sql.Date;&#xA;&#xA;public class GetTodayDate {&#xA;    public static void main(String[] args) {&#xA;        long miliseconds = System.currentTimeMillis();&#xA;        Date date = new Date(miliseconds);&#xA;        System.out.println(date);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Copy Files from Docker Container to Host</title>
      <link>https://andrewodendaal.com/how-to-copy-files-from-docker-container-to-host/</link>
      <pubDate>Sat, 08 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-copy-files-from-docker-container-to-host/</guid>
      <description>&lt;p&gt;If you need to copy files from a Docker Container to the Host, then you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-docker-cp&#34;&gt;Option 1 – Using &lt;code&gt;docker cp&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Syntax:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;docker cp [OPTIONS] CONTAINER: SRC_PATH DEST_PATH&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Setup the container:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;# pull the ubuntu image&#xA;docker pull ubuntu&#xA;&#xA;# run the container locally&#xA;docker run -it -d ubuntu&#xA;&#xA;# connect to the container&#xA;docker exec -it abcde123456 /bin/bash&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Create a file from the container:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;cd usr&#xA;cd share&#xA;touch some_file.txt&#xA;ls&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Copy the file from the container to the host:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Get the IP Address of a Docker Container</title>
      <link>https://andrewodendaal.com/how-to-get-the-ip-address-of-a-docker-container/</link>
      <pubDate>Fri, 07 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-ip-address-of-a-docker-container/</guid>
      <description>&lt;p&gt;If you need to get the IP Address of a Docker Container, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-connect-to-the-bridge-network&#34;&gt;Option 1 – Connect to the Bridge Network&lt;/h2&gt;&#xA;&lt;p&gt;Find out the network setup:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;docker network ls&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Create a docker container and assign it to the bridge network:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;docker run -dt &amp;lt;nginx&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Get the information about the container:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;docker ps&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Inspect the network:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;docker network inspect bridge&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now you can see the container IP Address.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-2-8211-use-docker-inspect&#34;&gt;Option 2 – Use &lt;code&gt;docker inspect&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Use the container id to get detailed information:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Convert Time to String in Golang</title>
      <link>https://andrewodendaal.com/how-to-convert-time-to-string-in-golang/</link>
      <pubDate>Thu, 06 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-time-to-string-in-golang/</guid>
      <description>&lt;p&gt;If you need to convert &lt;code&gt;Time&lt;/code&gt; to a &lt;code&gt;String&lt;/code&gt; in Go, then you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-timenow&#34;&gt;Option 1 – Using &lt;code&gt;time.Now&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;&#xA;import (&#xA;    &amp;#34;fmt&amp;#34;&#xA;    &amp;#34;time&amp;#34;&#xA;)&#xA;&#xA;func main() {&#xA;    currentTime := time.Now()&#xA;    fmt.Println(&amp;#34;Time: &amp;#34;, currentTime.String())&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-timetimestring&#34;&gt;Option 2 – Using &lt;code&gt;time.Time.String()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;&#xA;import (&#xA;    &amp;#34;fmt&amp;#34;&#xA;    &amp;#34;time&amp;#34;&#xA;)&#xA;&#xA;func main() {&#xA;    Time := time.Date(2022, 03, 28, 03, 50, 16, 0, time.UTC)&#xA;    t := Time.String()&#xA;    fmt.Printf(&amp;#34;Time without the nano seconds: %v\n&amp;#34;, t)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Perform a Deep Copy in Golang</title>
      <link>https://andrewodendaal.com/how-to-perform-a-deep-copy-in-golang/</link>
      <pubDate>Wed, 05 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-perform-a-deep-copy-in-golang/</guid>
      <description>&lt;p&gt;To perform a &lt;code&gt;Deep Copy&lt;/code&gt; in Go, you can use a &lt;code&gt;struct&lt;/code&gt; type as follows:&lt;/p&gt;&#xA;&lt;h2 id=&#34;deep-copying-using-a-struct-in-go&#34;&gt;Deep Copying using a &lt;code&gt;struct&lt;/code&gt; in Go&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;&#xA;import (&#xA;    &amp;#34;fmt&amp;#34;&#xA;)&#xA;&#xA;type Dog struct {&#xA;    age     int&#xA;    name    string&#xA;    friends []string&#xA;}&#xA;&#xA;func main() {&#xA;    john := Dog{1, &amp;#34;Harry&amp;#34;, []string{&amp;#34;Steve&amp;#34;, &amp;#34;Matt&amp;#34;, &amp;#34;Sarah&amp;#34;}}&#xA;    jack := john&#xA;&#xA;    jack.friends = make([]string, len(john.friends))&#xA;    copy(jack.friends, harry.friends)&#xA;&#xA;    jack.friends = append(jay.friends, &amp;#34;Fred&amp;#34;)&#xA;&#xA;    fmt.Println(john)&#xA;    fmt.Println(jack)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Return Lambda Functions in Golang</title>
      <link>https://andrewodendaal.com/how-to-return-lambda-functions-in-golang/</link>
      <pubDate>Tue, 04 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-return-lambda-functions-in-golang/</guid>
      <description>&lt;p&gt;Go doesn&amp;rsquo;t typically have Lambda Expressions, but synonymous to &lt;code&gt;Lambdas&lt;/code&gt;, or &lt;code&gt;Closures&lt;/code&gt; if &lt;code&gt;Anonymous Functions&lt;/code&gt; for Go.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-return-a-value-from-an-anonymous-function-in-go&#34;&gt;How to return a value from an Anonymous Function in Go&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;&#xA;import &amp;#34;fmt&amp;#34;&#xA;&#xA;func main() {&#xA;    var sum = func(n1, n2 int) int {&#xA;        sum := n1 + n2&#xA;        return sum&#xA;    }&#xA;    result := sum(5, 3)&#xA;    fmt.Println(&amp;#34;Sum is:&amp;#34;, result)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-return-an-area-from-an-anonymous-function-in-go&#34;&gt;How to return an Area from an Anonymous Function in Go&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;&#xA;import &amp;#34;fmt&amp;#34;&#xA;&#xA;var (&#xA;    area = func(l int, b int) int {&#xA;        return l * b&#xA;    }&#xA;)&#xA;func main() {&#xA;    fmt.Println(area(10, 10))&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Create an Empty Slice in Golang</title>
      <link>https://andrewodendaal.com/how-to-create-an-empty-slice-in-golang/</link>
      <pubDate>Mon, 03 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-an-empty-slice-in-golang/</guid>
      <description>&lt;p&gt;If you would like to create an empty slice in Go, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-initialize-an-empty-slice-in-go&#34;&gt;Option 1 – Initialize an Empty Slice in Go&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;&#xA;import &amp;#34;fmt&amp;#34;&#xA;&#xA;func main() {&#xA;    b := []string{}&#xA;    fmt.Println(b == nil)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-make&#34;&gt;Option 2 – Using &lt;code&gt;make()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;&#xA;import &amp;#34;fmt&amp;#34;&#xA;&#xA;func main() {&#xA;    c := make([]string, 0)&#xA;    fmt.Println(c == nil)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Parallelize a for Loop in Python</title>
      <link>https://andrewodendaal.com/how-to-parallelize-a-for-loop-in-python/</link>
      <pubDate>Sun, 02 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-parallelize-a-for-loop-in-python/</guid>
      <description>&lt;p&gt;If you need to run a for loop in parallel, then you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-multiprocessing&#34;&gt;Option 1 – Using &lt;code&gt;multiprocessing&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import multiprocessing&#xA;&#xA;def sumall(value):&#xA;    return sum(range(1, value + 1))&#xA;&#xA;pool_obj = multiprocessing.Pool()&#xA;&#xA;answer = pool_obj.map(sumall,range(0,5))&#xA;print(answer)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-joblib-module&#34;&gt;Option 2 – Using &lt;code&gt;joblib&lt;/code&gt; module&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from joblib import Parallel, delayed&#xA;import math&#xA;&#xA;def sqrt_func(i, j):&#xA;    time.sleep(1)&#xA;    return math.sqrt(i**j)&#xA;&#xA;Parallel(n_jobs=2)(delayed(sqrt_func)(i, j) for i in range(5) for j in range(2))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-asyncio&#34;&gt;Option 3 – Using &lt;code&gt;asyncio&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import asyncio&#xA;import time&#xA;&#xA;def background(f):&#xA;    def wrapped(*args, **kwargs):&#xA;        return asyncio.get_event_loop().run_in_executor(None, f, *args, **kwargs)&#xA;    return wrapped&#xA;&#xA;@background&#xA;def your_function(argument):&#xA;    time.sleep(2)&#xA;    print(&amp;#39;function finished for &amp;#39;+str(argument))&#xA;&#xA;for i in range(10):&#xA;    your_function(i)&#xA;&#xA;print(&amp;#39;loop finished&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Reverse an Integer in Python</title>
      <link>https://andrewodendaal.com/how-to-reverse-an-integer-in-python/</link>
      <pubDate>Sat, 01 Oct 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reverse-an-integer-in-python/</guid>
      <description>&lt;p&gt;If you need to reverse an integer using Python, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-mathematical-palindrome-check&#34;&gt;Option 1 – Mathematical Palindrome Check&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;original_number = 123454321&#xA;copy_number = original_number&#xA;reversed_number = 0&#xA;&#xA;while original_number &amp;gt; 0:&#xA;    remainder = original_number % 10&#xA;    reversed_number = reversed_number * 10 + remainder&#xA;    original_number = original_number // 10&#xA;&#xA;if copy_number == reversed_number:&#xA;    print(copy_number, &amp;#39;is a palindrome number&amp;#39;)&#xA;else:&#xA;    print(copy_number, &amp;#39;is not a palindrome number&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-string-reversal-number-palindrome&#34;&gt;Option 2 – String Reversal Number Palindrome&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;number = 123454321&#xA;&#xA;if number == int(str(number)[::-1]):&#xA;    print(number, &amp;#39;is palindrome.&amp;#39;)&#xA;else:&#xA;    print(number, &amp;#39;is not palindrome.&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-list-reversal-number-palindrome&#34;&gt;Option 3 – List Reversal Number Palindrome&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;original_number = 123454321&#xA;lst_number = list(str(original_number))&#xA;lst_number.reverse()&#xA;reversed_number = &amp;#39;&amp;#39;.join(lst_number)&#xA;&#xA;if (original_number == int(reversed_number)):&#xA;    print(original_number, &amp;#39;is palindrome.&amp;#39;)&#xA;else:&#xA;    print(original_number, &amp;#39;is not palindrome.&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Terraform for AWS: Cloud-Native Infrastructure</title>
      <link>https://andrewodendaal.com/articles/terraform-aws-integration/</link>
      <pubDate>Sat, 01 Oct 2022 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/terraform-aws-integration/</guid>
      <description>&lt;p&gt;AWS and Terraform are a powerful combination, but AWS&amp;rsquo;s complexity means there are specific patterns, gotchas, and best practices that aren&amp;rsquo;t obvious from general Terraform knowledge. This guide bridges that gap, covering the AWS-specific techniques that separate basic resource creation from production-ready, well-architected infrastructure.&lt;/p&gt;&#xA;&lt;p&gt;From VPC design patterns to multi-account strategies, this guide covers the real-world challenges you&amp;rsquo;ll face when managing AWS infrastructure at scale with Terraform.&lt;/p&gt;&#xA;&lt;h2 id=&#34;aws-provider-setup&#34;&gt;AWS Provider Setup&lt;/h2&gt;&#xA;&lt;p&gt;The AWS provider is Terraform&amp;rsquo;s gateway to Amazon Web Services, but configuring it properly for production use involves more than just setting a region. Authentication strategies, provider aliases for multi-region deployments, and proper credential management are essential for building reliable, secure infrastructure automation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Save a Python Dictionary to a File in Python</title>
      <link>https://andrewodendaal.com/how-to-save-a-python-dictionary-to-a-file-in-python/</link>
      <pubDate>Fri, 30 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-save-a-python-dictionary-to-a-file-in-python/</guid>
      <description>&lt;p&gt;If you need to save a Python Dictionary object type to a file using Python, then you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-pickle-module&#34;&gt;Option 1 – Using &lt;code&gt;pickle&lt;/code&gt; module&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import pickle&#xA;&#xA;my_dict = { &amp;#39;Bob&amp;#39;: 31, &amp;#39;Jane&amp;#39;: 50, &amp;#39;Harry&amp;#39;: 13, &amp;#39;Steve&amp;#39;: 23}&#xA;&#xA;with open(&amp;#34;dictionaryFile.pkl&amp;#34;, &amp;#34;wb&amp;#34;) as tf:&#xA;    pickle.dump(my_dict,tf)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then you can load the pickle file back as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import pickle&#xA;&#xA;with open(&amp;#34;dictionaryFile.pkl&amp;#34;, &amp;#34;wb&amp;#34;) as tf:&#xA;    new_dict = pickle.load(tf)&#xA;&#xA;print(new_dict)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-numpy&#34;&gt;Option 2 – Using &lt;code&gt;numpy&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import numpy as np&#xA;&#xA;my_dict = { &amp;#39;Bob&amp;#39;: 31, &amp;#39;Jane&amp;#39;: 50, &amp;#39;Harry&amp;#39;: 13, &amp;#39;Steve&amp;#39;: 23}&#xA;np.save(&amp;#39;dictionaryFile.npy&amp;#39;, my_dict)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then you can load the file back as follows:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Terraform Fundamentals: Infrastructure as Code</title>
      <link>https://andrewodendaal.com/articles/terraform-fundamentals/</link>
      <pubDate>Fri, 30 Sep 2022 00:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/articles/terraform-fundamentals/</guid>
      <description>&lt;p&gt;Infrastructure as Code isn&amp;rsquo;t just a buzzword—it&amp;rsquo;s the difference between spending your weekend manually clicking through cloud consoles and having reproducible, version-controlled infrastructure that deploys consistently every time. Terraform has become the de facto standard for managing cloud resources, but mastering it requires understanding not just the syntax, but the patterns and practices that separate toy projects from production-ready infrastructure.&lt;/p&gt;&#xA;&lt;p&gt;This guide takes you from writing your first Terraform configuration to architecting complex, multi-environment infrastructure with proper state management, security, and team collaboration patterns.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Move Files From One Directory to Another Using Python</title>
      <link>https://andrewodendaal.com/how-to-move-files-from-one-directory-to-another-using-python/</link>
      <pubDate>Thu, 29 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-move-files-from-one-directory-to-another-using-python/</guid>
      <description>&lt;p&gt;If you need to move files from one directory to another directory, using Python, then you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-shutilmove&#34;&gt;Option 1 – Using &lt;code&gt;shutil.move()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import shutil&#xA;import os&#xA; &#xA;file_source = &amp;#39;source/directory&amp;#39;&#xA;file_destination = &amp;#39;destination/directory&amp;#39;&#xA; &#xA;get_files = os.listdir(file_source)&#xA; &#xA;for file in get_files:&#xA;    shutil.move(file_source + file, file_destination)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-osreplace&#34;&gt;Option 2 – Using &lt;code&gt;os.replace()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import os&#xA; &#xA;file_source = &amp;#39;source/directory&amp;#39;&#xA;file_destination = &amp;#39;destination/directory&amp;#39;&#xA; &#xA;get_files = os.listdir(file_source)&#xA; &#xA;for file in get_files:&#xA;    os.replace(file_source + file, file_destination + file)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-pathlib&#34;&gt;Option 3 – Using &lt;code&gt;pathlib&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from pathlib import Path&#xA;import shutil&#xA;import os&#xA;&#xA;file_source =&amp;#39;source/directory&amp;#39;&#xA;file_destination =&amp;#39;destination/directory&amp;#39;&#xA;&#xA;for file in Path(file_source).glob(&amp;#39;some_file.txt&amp;#39;):&#xA;    shutil.move(os.path.join(file_source,file), file_destination)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Get the Number of Lines in a File in Python</title>
      <link>https://andrewodendaal.com/how-to-get-the-number-of-lines-in-a-file-in-python/</link>
      <pubDate>Wed, 28 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-number-of-lines-in-a-file-in-python/</guid>
      <description>&lt;p&gt;If you need to get the number of lines in a file, or the line count total from a file, using Python, then you can use one of the following options:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-open-and-sum&#34;&gt;Option 1 – Using &lt;code&gt;open()&lt;/code&gt; and &lt;code&gt;sum()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;with open(&amp;#39;directory/file.txt&amp;#39;) as myfile:&#xA;    total_lines = sum(1 for line in myfile)&#xA;&#xA;print(total_lines)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-mmap&#34;&gt;Option 2 – Using &lt;code&gt;mmap&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mmap&#xA;&#xA;with open(&amp;#39;directory/file.txt&amp;#39;, &amp;#34;r+&amp;#34;) as myfile:&#xA;    mm = mmap.mmap(myfile.fileno(), 0)&#xA;    total_lines = 0&#xA;&#xA;    while mm.readline():&#xA;        total_lines += 1&#xA;&#xA;print(total_lines)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-fileread&#34;&gt;Option 3 – Using &lt;code&gt;file.read()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;lines = 0&#xA;size = 1024 * 1024&#xA;&#xA;with open(r&amp;#39;directory/file.txt&amp;#39;, &amp;#34;r+&amp;#34;) as myfile:&#xA;    read_file = myfile.read&#xA;&#xA;    buffer = read_file(size)&#xA;    &#xA;    while buffer:&#xA;        lines += buffer.count(&amp;#39;\n&amp;#39;)&#xA;        buffer = read_file(size)&#xA;&#xA;if (lines != 0):&#xA;    lines += 1&#xA;&#xA;print(lines)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Read Specific Lines From a File in Python</title>
      <link>https://andrewodendaal.com/how-to-read-specific-lines-from-a-file-in-python/</link>
      <pubDate>Tue, 27 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-read-specific-lines-from-a-file-in-python/</guid>
      <description>&lt;p&gt;If you need to read a specific line from a file using Python, then you can use one of the following options:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-fileobjectreadlines&#34;&gt;Option 1 – Using &lt;code&gt;fileobject.readlines()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;If you need to read &lt;code&gt;line 10&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;with open(&amp;#34;file.txt&amp;#34;) as f:&#xA;    data = f.readlines()[10]&#xA;print(data)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you need to read &lt;code&gt;lines 10, to 20&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;with open(&amp;#34;file.txt&amp;#34;) as f:&#xA;    data = f.readlines()[10:20]&#xA;print(data)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-for-in-fileobject&#34;&gt;Option 2 – Using &lt;code&gt;for&lt;/code&gt; in &lt;code&gt;fileobject&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;lines =[10, 20]&#xA;data = []&#xA;i = 0&#xA;&#xA;with open(&amp;#34;file.txt&amp;#34;, &amp;#34;r+&amp;#34;) as f:&#xA;    for line in f:&#xA;        if i in lines:&#xA;            data.append(line.strip)&#xA;            &#xA;        i = i + 1&#xA;&#xA;print(data)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-linecache-module&#34;&gt;Option 3 – Using &lt;code&gt;linecache&lt;/code&gt; module&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import linecache&#xA;data = linecache.getline(&amp;#39;file.txt&amp;#39;, 10).strip()&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-4-8211-using-enumerate&#34;&gt;Option 4 – Using &lt;code&gt;enumerate&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;with open(&amp;#34;file.txt&amp;#34;) as f:&#xA;    for i, line in enumerate(f):&#xA;        pass  # process line i&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Get All Files in a Directory in Python</title>
      <link>https://andrewodendaal.com/how-to-get-all-files-in-a-directory-in-python/</link>
      <pubDate>Mon, 26 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-all-files-in-a-directory-in-python/</guid>
      <description>&lt;p&gt;If you need to get all the files in a directory using Python, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-oslistdir&#34;&gt;Option 1 – Using &lt;code&gt;os.listdir()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import os&#xA;&#xA;dirPath = r&amp;#34;/your/directory/path/&amp;#34;&#xA;result = [f for f in os.listdir(dirPath) if os.path.isfile(os.path.join(dirPath, f))]&#xA;&#xA;print(result)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-oswalk&#34;&gt;Option 2 – Using &lt;code&gt;os.walk()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import os&#xA;&#xA;dirPath = r&amp;#34;/your/directory/path/&amp;#34;&#xA;result = next(os.walk(dirPath))[2]&#xA;&#xA;print(result)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-globglob&#34;&gt;Option 3 – Using &lt;code&gt;glob.glob()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import glob&#xA;&#xA;dirPathPattern = r&amp;#34;/your/directory/path/*.*&amp;#34;&#xA;result = glog.glob(dirPathPattern)&#xA;&#xA;print(result)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>[Solved] dial tcp: lookup proxy.golang.org: i/o timeout</title>
      <link>https://andrewodendaal.com/solved-dial-tcp-lookup-proxy-golang-org-i-o-timeout/</link>
      <pubDate>Sun, 25 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-dial-tcp-lookup-proxy-golang-org-i-o-timeout/</guid>
      <description>&lt;p&gt;If you get a timeout when trying to install go dependencies, the error may look something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ go get github.com/aws/aws-sdk-go/aws&#xA;&#xA;go: module github.com/aws/aws-sdk-go/aws: Get &amp;#34;https://proxy.golang.org/github.com/aws/aws-sdk-go/aws/@v/list&amp;#34;: dial tcp: lookup proxy.golang.org: i/o timeout&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-solve-the-timeout-issue-when-installing-go-deps&#34;&gt;How to Solve the Timeout Issue when installing Go Deps&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;export GOPROXY=direct&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then re-run your &lt;code&gt;go get&lt;/code&gt; command.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Check Operating System in Python</title>
      <link>https://andrewodendaal.com/how-to-check-operating-system-in-python/</link>
      <pubDate>Sat, 24 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-check-operating-system-in-python/</guid>
      <description>&lt;p&gt;If you need to check the Operating System information from Python, then you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-the-platform-module&#34;&gt;Option 1 – Using the &lt;code&gt;platform&lt;/code&gt; module&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import platform&#xA;my_os = platform.system()&#xA;print(&amp;#34;Operating System is: &amp;#34;,my_os)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-the-sys-module&#34;&gt;Option 2 – Using the &lt;code&gt;sys&lt;/code&gt; module&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import sys&#xA;my_os=sys.platform&#xA;print(&amp;#34;Operating System is: &amp;#34;,my_os)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Convert Hex to Byte in Python</title>
      <link>https://andrewodendaal.com/how-to-convert-hex-to-byte-in-python/</link>
      <pubDate>Fri, 23 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-hex-to-byte-in-python/</guid>
      <description>&lt;p&gt;If you need to convert Hex to Byte in Python, then you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-binascii&#34;&gt;Option 1 – Using &lt;code&gt;binascii&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import binascii&#xA;str_val = &amp;#39;This is a test&amp;#39;.encode(&amp;#39;utf-8&amp;#39;)&#xA;hex_val = binascii.hexlify(str_val).decode(&amp;#39;utf-8&amp;#39;)&#xA;&#xA;print(hex_val)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-bytesfromhex&#34;&gt;Option 2 – Using &lt;code&gt;bytes.fromhex()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;hex_val = &amp;#39;This is a test&amp;#39;&#xA;&#xA;print(bytes.fromhex(hex_val))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-unhexlify&#34;&gt;Option 3 – Using &lt;code&gt;unhexlify&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import binascii&#xA;from binascii import unhexlify&#xA;&#xA;str_val = &amp;#39;This is a test&amp;#39;.encode(&amp;#39;utf-8&amp;#39;)&#xA;hex_val = binascii.hexlify(str_val).decode(&amp;#39;utf-8&amp;#39;)&#xA;&#xA;print(&amp;#39;String value: &amp;#39;, str_val.decode(&amp;#39;utf-8&amp;#39;))&#xA;print(&amp;#39;Hexadecimal: &amp;#39;, hex_val)&#xA;print(&amp;#39;Byte value: &amp;#39;, unhexlify(hex_val))&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>[Solved] fatal: Could not read from remote repository with Git</title>
      <link>https://andrewodendaal.com/solved-fatal-could-not-read-from-remote-repository-with-git/</link>
      <pubDate>Thu, 22 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-fatal-could-not-read-from-remote-repository-with-git/</guid>
      <description>&lt;p&gt;If you receive the following error when trying to clone a Git repository:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;fatal: Could not read from remote repository.&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;The full message may look something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ git clone git@ssh.abc.xyz:org/repo.git&#xA;Cloning into &amp;#39;repo&amp;#39;...&#xA;Bad owner or permissions on /Users/ao/.ssh/config&#xA;fatal: Could not read from remote repository.&#xA;&#xA;Please make sure you have the correct access rights&#xA;and the repository exists.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-solve-this-error&#34;&gt;How to solve this error&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ssh-add ~/.ssh/id_rsa&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;where &lt;code&gt;id_rsa&lt;/code&gt; is a ssh key associated with the repo.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Install Homebrew on a Mac</title>
      <link>https://andrewodendaal.com/how-to-install-homebrew-on-a-mac/</link>
      <pubDate>Wed, 21 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-install-homebrew-on-a-mac/</guid>
      <description>&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;You should have some familiarity with the Mac Terminal application&lt;/strong&gt; since you’ll need to use it to install Homebrew. The Terminal application is located in the Utilities folder in the Applications folder.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Dependencies.&lt;/strong&gt; You need to install one other piece of software before you can install Homebew:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Xcode.&lt;/strong&gt; Install Apple’s Xcode development software: &lt;!-- raw HTML omitted --&gt;Xcode in the Apple App Store&lt;!-- raw HTML omitted --&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;installation-overview&#34;&gt;Installation Overview&lt;/h2&gt;&#xA;&lt;p&gt;Installing Homebrew is straightforward as long as you understand the Mac Terminal. The Homebrew installation process guides through each step.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create an AWS EC2 instance in CloudFormation</title>
      <link>https://andrewodendaal.com/how-to-create-an-aws-ec2-instance-in-cloudformation/</link>
      <pubDate>Tue, 20 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-an-aws-ec2-instance-in-cloudformation/</guid>
      <description>&lt;h2 id=&#34;create-an-ec2-instance-in-cloudformation&#34;&gt;Create an EC2 Instance in CloudFormation&lt;/h2&gt;&#xA;&lt;p&gt;If you need to create an EC2 instance in CloudFormation, then you can do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;AWSTemplateFormatVersion: &amp;#34;2010-09-09&amp;#34;&#xA;Resources:&#xA;  WebInstance:&#xA;    Type: AWS::EC2::Instance&#xA;    Properties:&#xA;      InstanceType: t2.nano&#xA;      ImageId: ami-80861296&#xA;      KeyName: my-key&#xA;      SecurityGroupIds:&#xA;        - sg-abc01234&#xA;      SubnetId: subnet-abc01234&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can set the &lt;code&gt;Instance Name&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;AWSTemplateFormatVersion: &amp;#34;2010-09-09&amp;#34;&#xA;Resources:&#xA;  WebInstance:&#xA;    Type: AWS::EC2::Instance&#xA;    Properties:&#xA;      InstanceType: t2.nano&#xA;      ImageId: ami-80861296&#xA;      KeyName: my-key&#xA;      SecurityGroupIds:&#xA;        - sg-abc01234&#xA;      SubnetId: subnet-abc01234&#xA;      Tags:&#xA;        -&#xA;          Key: Name&#xA;          Value: webserver&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can &lt;code&gt;Enable Monitoring&lt;/code&gt; as follows:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Run Commands on an AWS ECS Cluster Task or Container</title>
      <link>https://andrewodendaal.com/how-to-run-commands-on-an-aws-ecs-cluster-task-or-container/</link>
      <pubDate>Mon, 19 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-run-commands-on-an-aws-ecs-cluster-task-or-container/</guid>
      <description>&lt;p&gt;If you need to run a command, or set of commands on an AWS ECS cluster container, then you can do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws ecs execute-command --cluster ${ClusterName} --task ${TASK_ARN} --container nginx --command &amp;#34;/bin/sh&amp;#34; --interactive&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Understanding the Network Modes in AWS ECS</title>
      <link>https://andrewodendaal.com/understanding-the-network-modes-in-aws-ecs/</link>
      <pubDate>Sun, 18 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/understanding-the-network-modes-in-aws-ecs/</guid>
      <description>&lt;p&gt;If using the EC2 launch type, the allowable network mode depends on the underlying EC2 instance’s operating system. If Linux, awsvpc, bridge, host and none mode can be used. If Windows, only the NAT mode is allowed.&lt;/p&gt;&#xA;&lt;p&gt;If using the Fargate launch type, the ‘awsvpc’ is the only network mode supported.&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Amazon ECS task networking&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;The networking behavior of Amazon ECS tasks hosted on Amazon EC2 instances is dependent on the network mode defined in the task definition. The following are the available network modes. Amazon ECS recommends using the awsvpc network mode unless you have a specific need to use a different network mode.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Enable ContainerInsights on AWS ECS from the AWS CLI</title>
      <link>https://andrewodendaal.com/how-to-enable-containerinsights-on-aws-ecs-from-the-aws-cli/</link>
      <pubDate>Sat, 17 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-enable-containerinsights-on-aws-ecs-from-the-aws-cli/</guid>
      <description>&lt;p&gt;If you need to enable &lt;code&gt;Container Insights&lt;/code&gt; for an ECS cluster, by using the AWS CLI, then you can do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws ecs update-cluster-settings&#xA;    --cluster &amp;lt;cluster-name&amp;gt;  &#xA;    --settings name=containerInsights,value=enabled &#xA;    --region &amp;lt;aws_region&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>AppMesh and ECS with Imported ACM certificates on Envoy Sidecar through EFS</title>
      <link>https://andrewodendaal.com/appmesh-and-ecs-with-imported-acm-certificates-on-envoy-sidecar-through-efs/</link>
      <pubDate>Fri, 16 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/appmesh-and-ecs-with-imported-acm-certificates-on-envoy-sidecar-through-efs/</guid>
      <description>&lt;h2 id=&#34;summary&#34;&gt;Summary&lt;/h2&gt;&#xA;&lt;p&gt;This guide showcases the ability to use imported certificates from a third party provider (e.g. Venafi) in ACM, mount them in EFS and use them as trusted sources on Envoy sidecars with applications running in ECS. AppMesh is used as a passthrough with TLS termination occurring on the application container layer.&lt;/p&gt;&#xA;&lt;h2 id=&#34;prerequisites-and-limitations&#34;&gt;Prerequisites and limitations&lt;/h2&gt;&#xA;&lt;h2 id=&#34;prerequisites&#34;&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;p&gt;A certificate that contains the chain of domains required for the fronted service and micro-services needed.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Increase the disk size on a Cloud9 instance</title>
      <link>https://andrewodendaal.com/how-to-increase-the-disk-size-on-a-cloud9-instance%EF%BF%BC/</link>
      <pubDate>Thu, 15 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-increase-the-disk-size-on-a-cloud9-instance%EF%BF%BC/</guid>
      <description>&lt;p&gt;If you need to increase the disk size of a Cloud9 instance, you can run the following script directly from the terminal in Cloud9:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;pip3 install --user --upgrade boto3&#xA;export instance_id=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)&#xA;python3 -c &amp;#34;import boto3&#xA;import os&#xA;from botocore.exceptions import ClientError &#xA;ec2 = boto3.client(&amp;#39;ec2&amp;#39;)&#xA;volume_info = ec2.describe_volumes(&#xA;    Filters=[&#xA;        {&#xA;            &amp;#39;Name&amp;#39;: &amp;#39;attachment.instance-id&amp;#39;,&#xA;            &amp;#39;Values&amp;#39;: [&#xA;                os.getenv(&amp;#39;instance_id&amp;#39;)&#xA;            ]&#xA;        }&#xA;    ]&#xA;)&#xA;volume_id = volume_info[&amp;#39;Volumes&amp;#39;][0][&amp;#39;VolumeId&amp;#39;]&#xA;try:&#xA;    resize = ec2.modify_volume(    &#xA;            VolumeId=volume_id,    &#xA;            Size=30&#xA;    )&#xA;    print(resize)&#xA;except ClientError as e:&#xA;    if e.response[&amp;#39;Error&amp;#39;][&amp;#39;Code&amp;#39;] == &amp;#39;InvalidParameterValue&amp;#39;:&#xA;        print(&amp;#39;ERROR MESSAGE: {}&amp;#39;.format(e))&amp;#34;&#xA;if [ $? -eq 0 ]; then&#xA;    sudo reboot&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Get the Instance Profile attached to an AWS EC2</title>
      <link>https://andrewodendaal.com/how-to-get-the-instance-profile-attached-to-an-ec2/</link>
      <pubDate>Wed, 14 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-instance-profile-attached-to-an-ec2/</guid>
      <description>&lt;p&gt;If you need to get the IAM Role information from the attached EC2 role directly, you can do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;IAM_ROLE=$(curl -s 169.254.169.254/latest/meta-data/iam/info | \&#xA;  jq -r &amp;#39;.InstanceProfileArn&amp;#39; | cut -d&amp;#39;/&amp;#39; -f2)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Create an AWS ECR Repository in AWS CLI</title>
      <link>https://andrewodendaal.com/how-to-create-an-aws-ecr-repository-in-aws-cli/</link>
      <pubDate>Tue, 13 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-an-aws-ecr-repository-in-aws-cli/</guid>
      <description>&lt;p&gt;If you need to create an Elastic Container Registry (ECR) Repository from the AWS CLI, you can do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws ecr create-repository \&#xA;--repository-name &amp;lt;repo-name&amp;gt; \&#xA;--image-scanning-configuration scanOnPush=true \&#xA;--region ${AWS_REGION}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Scale Out an AWS ECS Service</title>
      <link>https://andrewodendaal.com/how-to-scale-out-an-aws-ecs-service/</link>
      <pubDate>Mon, 12 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-scale-out-an-aws-ecs-service/</guid>
      <description>&lt;p&gt;When you create the Amazon ECS service, it includes three Amazon ECS task replicas. You can see this by using the &lt;strong&gt;describe-services&lt;/strong&gt; command, which returns three. Use the &lt;strong&gt;update-service&lt;/strong&gt; command to scale the service to five tasks. Re-run the &lt;strong&gt;describe-services&lt;/strong&gt; command to see the updated five.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-query-the-desired-count&#34;&gt;Step 1 – Query the desired count&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws ecs describe-services \&#xA;--cluster fargate-getting-started \&#xA;--services nginx-service \&#xA;--query &amp;#39;services[0].desiredCount&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Output: &lt;code&gt;3&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-2-8211-set-the-new-desired-count&#34;&gt;Step 2 – Set the new desired count&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws ecs update-service \&#xA;--cluster fargate-getting-started \&#xA;--service nginx-service \&#xA;--desired-count 5&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will now update the service to have a desired count of 5.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Retrieve AWS ECS Cluster Information</title>
      <link>https://andrewodendaal.com/how-to-retrieve-aws-ecs-cluster-information/</link>
      <pubDate>Sun, 11 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-retrieve-aws-ecs-cluster-information/</guid>
      <description>&lt;p&gt;For more information about the Amazon ECS cluster, run the following command. You will find the number of running tasks, capacity providers, and more. &lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws ecs describe-clusters --cluster &amp;lt;your-fargate-cluster&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Sample output:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&#xA;    &amp;#34;clusters&amp;#34;: [&#xA;        {&#xA;            &amp;#34;clusterArn&amp;#34;: &amp;#34;arn:aws:ecs:us-east-2:123456789012:cluster/&amp;lt;your-fargate-cluster&amp;gt;&amp;#34;,&#xA;            &amp;#34;clusterName&amp;#34;: &amp;#34;fargate-getting-started&amp;#34;,&#xA;            &amp;#34;status&amp;#34;: &amp;#34;ACTIVE&amp;#34;,&#xA;            &amp;#34;registeredContainerInstancesCount&amp;#34;: 0,&#xA;            &amp;#34;runningTasksCount&amp;#34;: 3,&#xA;            &amp;#34;pendingTasksCount&amp;#34;: 0,&#xA;            &amp;#34;activeServicesCount&amp;#34;: 1,&#xA;            &amp;#34;statistics&amp;#34;: [],&#xA;            &amp;#34;tags&amp;#34;: [],&#xA;            &amp;#34;settings&amp;#34;: [],&#xA;            &amp;#34;capacityProviders&amp;#34;: [&#xA;                &amp;#34;FARGATE&amp;#34;,&#xA;                &amp;#34;FARGATE_SPOT&amp;#34;&#xA;            ],&#xA;            &amp;#34;defaultCapacityProviderStrategy&amp;#34;: []&#xA;        }&#xA;    ],&#xA;    &amp;#34;failures&amp;#34;: []&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Types of communication in Amazon EKS</title>
      <link>https://andrewodendaal.com/types-of-communication-in-amazon-eks/</link>
      <pubDate>Sat, 10 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/types-of-communication-in-amazon-eks/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2022/09/image-800x232.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;There are multiple types of communication in Amazon EKS environments. Lines of communication include the following:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Interpod communication between containers&lt;/li&gt;&#xA;&lt;li&gt;Communication between pods on the same node or pods on different nodes&lt;/li&gt;&#xA;&lt;li&gt;Ingress connections from outside the cluster&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;In some cases, the default Kubernetes methods are used. In other cases, specifically inter-node communication and ingress methods specific to Amazon EKS are used.&lt;/p&gt;&#xA;&lt;h2 id=&#34;intrapod-communication&#34;&gt;Intrapod communication&lt;/h2&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2022/09/image-1.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Containers in a pod share a Linux namespace and can communicate with each other using localhost. In Kubernetes networking, the IP address with which a container identifies is the same IP address for all entities in the network. All containers can communicate with all other containers in a pod without NAT.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] Read timeout on endpoint URL: “https://lambda.[region].amazonaws.com/2015-03-31/functions/[function-name]/invocations”</title>
      <link>https://andrewodendaal.com/solved-read-timeout-on-endpoint-url-https-lambda-amazonaws-com-2015-03-31-functions-invocations/</link>
      <pubDate>Fri, 09 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-read-timeout-on-endpoint-url-https-lambda-amazonaws-com-2015-03-31-functions-invocations/</guid>
      <description>&lt;p&gt;If you get the following error:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Read timeout on endpoint URL: &amp;#34;https://lambda.&amp;lt;region&amp;gt;.amazonaws.com/2015-03-31/functions/&amp;lt;function-name&amp;gt;/invocations&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then you are probably trying to use the &lt;code&gt;aws cli&lt;/code&gt; to invoke an AWS Lambda function and it is timing out.&lt;/p&gt;&#xA;&lt;p&gt;Other than making sure to set the Lambda execution time to something much higher than it is, you also need to make sure to specify the &lt;code&gt;aws cli&lt;/code&gt; &lt;code&gt;--cli-read-timeout&lt;/code&gt; argument to something that will cover the execution time.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Remove a Passphrase from Certificate Key</title>
      <link>https://andrewodendaal.com/how-to-remove-a-passphrase-from-certificate-key/</link>
      <pubDate>Thu, 08 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-remove-a-passphrase-from-certificate-key/</guid>
      <description>&lt;p&gt;If you have a Certificate Key that includes a Passphrase and you need to remove it, potentially to use it with AWS App Mesh, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-remove-a-passphrase-using-openssl&#34;&gt;How to Remove a Passphrase using OpenSSL&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Locate the Private Key&lt;/li&gt;&#xA;&lt;li&gt;Run the following command:&lt;br&gt;&#xA;&lt;code&gt;open ssl rsa -in &amp;lt;original.key&amp;gt; -out &amp;lt;new.key&amp;gt;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Enter the original passphrase for the existing key&lt;/li&gt;&#xA;&lt;li&gt;The output file &amp;lt;new.key&amp;gt; will now be unencrypted&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;how-to-verify-if-the-passphrase-has-been-removed&#34;&gt;How to Verify if the Passphrase has been removed&lt;/h2&gt;&#xA;&lt;p&gt;Open the file in a text editor and check the headers.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get Python logger to Print to std out</title>
      <link>https://andrewodendaal.com/how-to-get-python-logger-to-print-to-std-out/</link>
      <pubDate>Wed, 07 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-python-logger-to-print-to-std-out/</guid>
      <description>&lt;p&gt;If you use Python&amp;rsquo;s &lt;code&gt;logger&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import logging&#xA;logger = logging.getLogger()&#xA;logger.setLevel(logging.DEBUG) # or logging.INFO&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Perhaps you want to get it to print to Standard Output (&lt;code&gt;stdout&lt;/code&gt;), then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;setup-logger-to-print-to-standard-output&#34;&gt;Setup Logger to print to Standard Output&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import logging&#xA;&#xA;logger = logging.getLogger()&#xA;# logger.setLevel(logging.INFO)&#xA;logger.setLevel(logging.DEBUG)&#xA;&#xA;handler = logging.StreamHandler(sys.stdout)&#xA;handler.setLevel(logging.DEBUG)&#xA;formatter = logging.Formatter(&amp;#39;%(asctime)s - %(name)s - %(levelname)s - %(message)s&amp;#39;)&#xA;handler.setFormatter(formatter)&#xA;logger.addHandler(handler)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This way you can now log straight to the console as well:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Convert a String to an Integer in C</title>
      <link>https://andrewodendaal.com/how-to-convert-a-string-to-an-integer-in-c/</link>
      <pubDate>Tue, 06 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-a-string-to-an-integer-in-c/</guid>
      <description>&lt;p&gt;If you need to convert a String to an Integer in C, then you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-use-atoi&#34;&gt;Option 1 – Use &lt;code&gt;atoi()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;int atoi(const char *str);&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;You can do something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;&#xA;#include &amp;lt;stdlib.h&amp;gt;&#xA;#include &amp;lt;string.h&amp;gt;&#xA;&#xA;int main (void) {&#xA;    int value;&#xA;    char str[20];&#xA;    strcpy(str,&amp;#34;123&amp;#34;);&#xA;    value = atoi(str);&#xA;    printf(&amp;#34;String value = %s, Int value = %d\n&amp;#34;, str, value);&#xA;&#xA;    return(0);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-use-strtol&#34;&gt;Option 2 – Use &lt;code&gt;strtol()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;long int strtol(const char *string, char **laststr,int basenumber);&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Convert an Integer to a String in C</title>
      <link>https://andrewodendaal.com/how-to-convert-an-integer-to-a-string-in-c/</link>
      <pubDate>Mon, 05 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-an-integer-to-a-string-in-c/</guid>
      <description>&lt;p&gt;If you need to convert an Integer to a String in C, then you can do one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-use-sprintf&#34;&gt;Option 1 – Use &lt;code&gt;sprintf()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;int sprintf(char *str, const char *format, [arg1, arg2, ... ]);&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;You can do something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;&#xA;&#xA;int main(void) {&#xA;&#x9;int number;&#xA;&#x9;char text[20]; &#xA;&#xA;&#x9;printf(&amp;#34;Enter a number: &amp;#34;);&#xA;&#x9;scanf(&amp;#34;%d&amp;#34;, &amp;amp;number);&#xA;&#xA;&#x9;sprintf(text, &amp;#34;%d&amp;#34;, number);&#xA;&#xA;&#x9;printf(&amp;#34;\nYou have entered: %s&amp;#34;, text);&#xA;&#xA;&#x9;return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-use-itoa&#34;&gt;Option 2 – Use &lt;code&gt;itoa()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;char* itoa(int num, char * buffer, int base)&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to append to an Array in Elasticsearch using elasticsearch-py</title>
      <link>https://andrewodendaal.com/how-to-append-to-an-array-in-elasticsearch-using-elasticsearch-py/</link>
      <pubDate>Sun, 04 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-append-to-an-array-in-elasticsearch-using-elasticsearch-py/</guid>
      <description>&lt;p&gt;If you are using the Official &lt;!-- raw HTML omitted --&gt;ElasticSearch Python library&lt;!-- raw HTML omitted --&gt; (&lt;!-- raw HTML omitted --&gt;Docs&lt;!-- raw HTML omitted --&gt;), and you want to create an index:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;doc = {&#xA;    &amp;#34;something&amp;#34;: &amp;#34;123a&amp;#34;,&#xA;    &amp;#34;somethingelse&amp;#34;: &amp;#34;456b&amp;#34;,&#xA;    &amp;#34;timestamp&amp;#34;: datetime.now(),&#xA;    &amp;#34;history&amp;#34;: []&#xA;}&#xA;es.index(index=&amp;#34;someindex&amp;#34;, doc_type=&amp;#34;somedoctype&amp;#34;, id=&amp;#34;someid&amp;#34;, body=doc)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can append items to the history each time, instead of overriding them, like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;es.update(index=&amp;#34;someindex&amp;#34;, doc_type=&amp;#34;somedoctype&amp;#34;, id=&amp;#34;someid&amp;#34;,&#xA;    body={&#xA;        &amp;#34;script&amp;#34; : {&#xA;            &amp;#34;source&amp;#34;: &amp;#34;ctx._source.history.addAll(params.history)&amp;#34;,&#xA;            &amp;#34;lang&amp;#34;: &amp;#34;painless&amp;#34;,&#xA;            &amp;#34;params&amp;#34; : {&#xA;                &amp;#34;history&amp;#34; : [&amp;#34;item1&amp;#34;,&amp;#34;item2&amp;#34;]&#xA;            }&#xA;        }&#xA;    })&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This uses &lt;!-- raw HTML omitted --&gt;scripted updates&lt;!-- raw HTML omitted --&gt; in Elasticsearch, for appending to an array.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Copy Text to the Clipboard in Python</title>
      <link>https://andrewodendaal.com/how-to-copy-text-to-the-clipboard-in-python/</link>
      <pubDate>Sat, 03 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-copy-text-to-the-clipboard-in-python/</guid>
      <description>&lt;p&gt;If you need to Copy Text to the Clipboard using your Python application code, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-pyperclip&#34;&gt;Option 1 – Using &lt;code&gt;pyperclip&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;First install the &lt;code&gt;pyperclip&lt;/code&gt; package, using &lt;code&gt;pip&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;pip install pyperclip&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now you can run the following code:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import pyperclip as pc&#xA;&#xA;a1 = &amp;#34;This text will now be in your clipboard&amp;#34;&#xA;pc.copy(a1)&#xA;a2 = pc.paste()&#xA;&#xA;print(a2)&#xA;print(type(a2))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-pyperclip3&#34;&gt;Option 2 – Using &lt;code&gt;pyperclip3&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;This version is similar to the first option above, except it copies all the data into &lt;code&gt;bytes&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Read a PDF file in Python</title>
      <link>https://andrewodendaal.com/how-to-read-a-pdf-file-in-python/</link>
      <pubDate>Fri, 02 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-read-a-pdf-file-in-python/</guid>
      <description>&lt;p&gt;If you need to read a PDF (Portable Document Format) file in your Python code, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-pypdf2&#34;&gt;Option 1 – Using &lt;code&gt;PyPDF2&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from PyPDF2 import PDFFileReader&#xA;temp = open(&amp;#39;your_document.pdf&amp;#39;, &amp;#39;rb&amp;#39;)&#xA;PDF_read = PDFFileReader(temp)&#xA;first_page = PDF_read.getPage(0)&#xA;print(first_page.extractText())&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-pdfplumber&#34;&gt;Option 2 – Using &lt;code&gt;PDFplumber&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import PDFplumber&#xA;with PDFplumber.open(&amp;#34;your_document.PDF&amp;#34;) as temp:&#xA;  first_page = temp.pages[0]&#xA;  print(first_page.extract_text())&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-textract&#34;&gt;Option 3 – Using &lt;code&gt;textract&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import textract&#xA;PDF_read = textract.process(&amp;#39;document_path.PDF&amp;#39;, method=&amp;#39;PDFminer&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Convert HEX to RBG in Python</title>
      <link>https://andrewodendaal.com/how-to-convert-hex-to-rbg-in-python/</link>
      <pubDate>Thu, 01 Sep 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-hex-to-rbg-in-python/</guid>
      <description>&lt;p&gt;If you need to convert HEX (Hexadecimal) to RGB (Red-Green-Blue) in your Python code, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-the-pil-library&#34;&gt;Option 1 – Using the &lt;code&gt;PIL&lt;/code&gt; library&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from PIL import ImageColor&#xA;hex = input(&amp;#39;Enter HEX value: &amp;#39;)&#xA;ImageColor.getcolor(hex, &amp;#34;RGB&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-a-custom-solution&#34;&gt;Option 2 – Using a custom solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;hex = input(&amp;#39;Enter HEX value: &amp;#39;).lstrip(&amp;#39;#&amp;#39;)&#xA;print(&amp;#39;RGB value =&amp;#39;, tuple(int(hex[i:i+2], 16) for i in (0, 2, 4)))&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Refer to a Null Object in Python</title>
      <link>https://andrewodendaal.com/how-to-refer-to-a-null-object-in-python/</link>
      <pubDate>Wed, 31 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-refer-to-a-null-object-in-python/</guid>
      <description>&lt;p&gt;If you need to refer to a Null Object in your Python code, then you can do the following.&lt;/p&gt;&#xA;&lt;p&gt;It is important to note that Python does not have a &lt;code&gt;Null&lt;/code&gt; type, instead Python refers to not set objects or variables as &lt;code&gt;None&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;We can use the &lt;code&gt;is&lt;/code&gt; keyword to check if an object or variable has the type of &lt;code&gt;None&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;object_name = None&#xA;print(object_name is None)&#xA;&#xA;object_name = &amp;#39; some_value&amp;#39;&#xA;print(object_name is None)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Convert Bytearray to String in Python</title>
      <link>https://andrewodendaal.com/how-to-convert-bytearray-to-string-in-python/</link>
      <pubDate>Tue, 30 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-bytearray-to-string-in-python/</guid>
      <description>&lt;p&gt;If you need to convert a Bytearray to a String in Python, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-bytes&#34;&gt;Option 1 – Using &lt;code&gt;bytes()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;b = bytearray(&amp;#34;test&amp;#34;, encoding=&amp;#34;utf-8&amp;#34;)&#xA;str1 = bytes(b)&#xA;print(str1)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-bytearraydecode&#34;&gt;Option 2 – Using &lt;code&gt;bytearray.decode()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;b = bytearray(&amp;#34;test&amp;#34;, encoding=&amp;#34;utf-8&amp;#34;)&#xA;str1 = b.decode()&#xA;print(str1)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to get the Hostname in Python</title>
      <link>https://andrewodendaal.com/how-to-get-the-hostname-in-python/</link>
      <pubDate>Mon, 29 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-hostname-in-python/</guid>
      <description>&lt;p&gt;If you need to get the Hostname in your Python application, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-gethostname&#34;&gt;Option 1 – Using &lt;code&gt;gethostname()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import socket&#xA;print(socket.gethostname())&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-the-platform-module&#34;&gt;Option 2 – Using the &lt;code&gt;platform&lt;/code&gt; module&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import platform&#xA;print (platform.node())&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-osuname&#34;&gt;Option 3 – Using &lt;code&gt;os.uname()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import os&#xA;hname = os.uname()&#xA;print(hname)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to get the IP Address in Python</title>
      <link>https://andrewodendaal.com/how-to-get-the-ip-address-in-python-2/</link>
      <pubDate>Sun, 28 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-ip-address-in-python-2/</guid>
      <description>&lt;p&gt;If you need to get the IP Address in your Python application, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-socketgethostname&#34;&gt;Option 1 – Using &lt;code&gt;socket.gethostname()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import socket&#xA;print(socket.gethostbyname(socket.gethostname()))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-socketgetsockname&#34;&gt;Option 2 – Using &lt;code&gt;socket.getsockname()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import socket&#xA;s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)&#xA;s.connect((&amp;#34;8.8.8.8&amp;#34;, 80))&#xA;print(s.getsockname()[0])&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-the-netifaces-module&#34;&gt;Option 3 – Using the &lt;code&gt;netifaces&lt;/code&gt; module&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from netifaces import interfaces, ifaddresses, AF_INET&#xA;for ifaceName in interfaces():&#xA;    addresses = [i[&amp;#39;addr&amp;#39;] for i in ifaddresses(ifaceName).setdefault(AF_INET, [{&amp;#39;addr&amp;#39;:&amp;#39;No IP addr&amp;#39;}] )]&#xA;    print(&amp;#39; &amp;#39;.join(addresses))&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to use SSH in your Python application</title>
      <link>https://andrewodendaal.com/how-to-use-ssh-in-your-python-application/</link>
      <pubDate>Sat, 27 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-use-ssh-in-your-python-application/</guid>
      <description>&lt;p&gt;If you need to make an SSH connection and issues commands over SSH using your Python application, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-the-paramiko-library&#34;&gt;Option 1 – Using the &lt;code&gt;paramiko&lt;/code&gt; library&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ssh = paramiko.SSHClient()&#xA;ssh.connect(server, username=username, password=password)&#xA;ssh_stdin, ssh_stdout, ssh_stderr = ssh.exec_command(cmd_to_execute)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-the-subprocess-module&#34;&gt;Option 2 – Using the &lt;code&gt;subprocess&lt;/code&gt; module&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;subprocess.check_output([&amp;#39;ssh&amp;#39;, &amp;#39;my_server&amp;#39;, &amp;#39;echo /*/&amp;#39;])&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-the-subprocess-module&#34;&gt;Option 3 – Using the &lt;code&gt;subprocess&lt;/code&gt; module&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;subprocess.Popen(&amp;#34;ssh {user}@{host} {cmd}&amp;#34;.format(user=user, host=host, cmd=&amp;#39;ls -l&amp;#39;), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Pause a Program in Python</title>
      <link>https://andrewodendaal.com/how-to-pause-a-program-in-python/</link>
      <pubDate>Fri, 26 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-pause-a-program-in-python/</guid>
      <description>&lt;p&gt;If you need to pause the execution of your Python program, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-timesleep&#34;&gt;Option 1 – Using &lt;code&gt;time.sleep()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import time&#xA;&#xA;time_duration = 3.5&#xA;time.sleep(time_duration)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-input&#34;&gt;Option 2 – Using &lt;code&gt;input()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;name = input(&amp;#34;Please enter your name: &amp;#34;)&#xA;print(&amp;#34;Name:&amp;#34;, name)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-ossystempause&#34;&gt;Option 3 – Using &lt;code&gt;os.system(&amp;quot;pause&amp;quot;)&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import os&#xA;&#xA;os.system(&amp;#34;pause&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Convert String to Double in Python</title>
      <link>https://andrewodendaal.com/how-to-convert-string-to-double-in-python/</link>
      <pubDate>Thu, 25 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-string-to-double-in-python/</guid>
      <description>&lt;p&gt;If you need to convert a String to a Double in your Python code:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-convert-string-to-double-using-float&#34;&gt;Option 1 – Convert String to Double using &lt;code&gt;float()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;string = &amp;#39;1234.5678&amp;#39;&#xA;myfloat = float(string)&#xA;print(myfloat)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-convert-string-to-double-using-decimaldecimal&#34;&gt;Option 2 – Convert String to Double using &lt;code&gt;decimal.Decimal()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from decimal import Decimal&#xA;&#xA;string = &amp;#39;1234.5678&amp;#39;&#xA;myfloat = Decimal(string)&#xA;print(myfloat)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to a Run Bash Command in Python</title>
      <link>https://andrewodendaal.com/how-to-a-run-bash-command-in-python/</link>
      <pubDate>Wed, 24 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-a-run-bash-command-in-python/</guid>
      <description>&lt;p&gt;If you need to run a bash command in your Python code, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-run-from-subprocess-module&#34;&gt;Option 1 – Using &lt;code&gt;run()&lt;/code&gt; from &lt;code&gt;subprocess&lt;/code&gt; Module&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from subprocess import PIPE&#xA;&#xA;comp_process = subprocess.run(&amp;#34;ls&amp;#34;,stdout=PIPE, stderr=PIPE)&#xA;print(comp_process.stdout)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-popen-from-subprocess-module&#34;&gt;Option 2 – Using &lt;code&gt;Popen()&lt;/code&gt; from &lt;code&gt;subprocess&lt;/code&gt; Module&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from subprocess import PIPE&#xA;&#xA;process = subprocess.Popen(&amp;#34;ls&amp;#34;,stdout=PIPE, stderr=PIPE)&#xA;output, error = process.communicate()&#xA;print(output)&#xA;process.kill&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Force Redeployment of AWS API Gateway using AWS CloudFormation</title>
      <link>https://andrewodendaal.com/how-to-force-redeployment-of-api-gateway-using-cloudformation/</link>
      <pubDate>Tue, 23 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-force-redeployment-of-api-gateway-using-cloudformation/</guid>
      <description>&lt;p&gt;If you have an AWS API Gateway resource, and need it to force a redeployment using CloudFormation, then you can use the &lt;code&gt;TIMESTAMP&lt;/code&gt; trick.&lt;/p&gt;&#xA;&lt;h2 id=&#34;example-aws-cloudformation-extract&#34;&gt;Example AWS CloudFormation Extract&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;template.yaml&lt;/code&gt; extract:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;APIGatewayStage:&#xA;    Type: AWS::ApiGateway::Stage&#xA;    Properties:&#xA;      StageName: !Sub ${EnvironmentTagName}&#xA;      RestApiId: !Ref APIGateway&#xA;      DeploymentId: !Ref APIGatewayDeployment__TIMESTAMP__&#xA;      TracingEnabled: true&#xA;      MethodSettings:&#xA;          - DataTraceEnabled: true&#xA;            HttpMethod: &amp;#34;*&amp;#34;&#xA;            LoggingLevel: INFO&#xA;            ResourcePath: &amp;#34;/*&amp;#34;&#xA;            MetricsEnabled: true&#xA;&#xA;  APIGatewayDeployment__TIMESTAMP__:&#xA;    Type: AWS::ApiGateway::Deployment&#xA;    Properties:&#xA;      RestApiId: !Ref APIGateway&#xA;      Description: !Sub ${EnvironmentTagName} Deployment __TIMESTAMP__&#xA;&#xA;  APIGateway:&#xA;    Type: AWS::ApiGateway::RestApi&#xA;    Properties:&#xA;      Name: !Ref &amp;#34;AWS::StackName&amp;#34;&#xA;      ...&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As we can see, on line 15 above, we use the &lt;code&gt;__TIMESTAMP__&lt;/code&gt; string in the &lt;code&gt;APIGatewayDeployment&lt;/code&gt; stage.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Deploy React App to S3 and CloudFront</title>
      <link>https://andrewodendaal.com/how-to-deploy-react-app-to-s3-and-cloudfront/</link>
      <pubDate>Mon, 22 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-deploy-react-app-to-s3-and-cloudfront/</guid>
      <description>&lt;p&gt;If you would like to deploy a React App to AWS S3 and AWS CloudFront, then you can follow this guide.&lt;/p&gt;&#xA;&lt;p&gt;The following solution creates a React App and deploys it to S3 and CloudFront using the client’s CLI.&lt;br&gt;&#xA;It also chains commands so that a React &lt;code&gt;build&lt;/code&gt;, S3 &lt;code&gt;sync&lt;/code&gt; and CloudFront &lt;code&gt;invalidation&lt;/code&gt; can occur with a single command.&lt;/p&gt;&#xA;&lt;h2 id=&#34;code-available-at-github&#34;&gt;Code available at GitHub&lt;/h2&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;https://github.com/ao/deploy-react-to-s3-cloudfront&#34;&gt;https://github.com/ao/deploy-react-to-s3-cloudfront&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] export ‘Switch’ (imported as ‘Switch’) was not found in ‘react-router-dom’</title>
      <link>https://andrewodendaal.com/solved-export-switch-imported-as-switch-was-not-found-in-react-router-dom/</link>
      <pubDate>Sun, 21 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-export-switch-imported-as-switch-was-not-found-in-react-router-dom/</guid>
      <description>&lt;p&gt;In &lt;em&gt;&lt;code&gt;react-router-dom&lt;/code&gt;&lt;/em&gt; v6, &lt;code&gt;Switch&lt;/code&gt; is replaced by routes &lt;code&gt;Routes&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You need to update the import from:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import { Switch, Route } from &amp;#34;react-router-dom&amp;#34;;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;to:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import { Routes, Route } from &amp;#39;react-router-dom&amp;#39;;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You also need to update the Route declaration from:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;Route path=&amp;#34;/&amp;#34; component={Home} /&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;to:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;Route path=&amp;#39;/welcome&amp;#39; element={&amp;lt;Home/&amp;gt;} /&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to List all Files/Folders/Directories in Python</title>
      <link>https://andrewodendaal.com/how-to-list-all-files-folders-directories-in-python/</link>
      <pubDate>Sat, 20 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-list-all-files-folders-directories-in-python/</guid>
      <description>&lt;p&gt;If you need to list all Files, Folders, or Directories in Python code, then you can use the &lt;code&gt;listdirs&lt;/code&gt; method from the &lt;code&gt;os&lt;/code&gt; package.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import os&#xA;print(os.listdir(&amp;#34;/path/to/directory/&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Read a File in Python</title>
      <link>https://andrewodendaal.com/how-to-read-a-file-in-python/</link>
      <pubDate>Fri, 19 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-read-a-file-in-python/</guid>
      <description>&lt;p&gt;If you need to read a file in Python, then you can use the &lt;code&gt;open()&lt;/code&gt; built-in function to help you.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s say that you have a file called &lt;code&gt;somefile.txt&lt;/code&gt; with the following contents:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Hello, this is a test file&#xA;With some contents&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-open-a-file-and-read-it-in-python&#34;&gt;How to Open a File and Read it in Python&lt;/h2&gt;&#xA;&lt;p&gt;We can &lt;code&gt;read&lt;/code&gt; the contents of this file as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;f = open(&amp;#34;somefile.txt&amp;#34;, &amp;#34;r&amp;#34;)&#xA;print(f.read())&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will print out the contents of the file.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Drop Columns in Pandas Only If Exists</title>
      <link>https://andrewodendaal.com/how-to-drop-columns-in-pandas-if-exists/</link>
      <pubDate>Thu, 18 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-drop-columns-in-pandas-if-exists/</guid>
      <description>&lt;p&gt;If you have a Pandas DataFrame, and want to only drop columns if they exist, then you can do the following:&lt;/p&gt;&#xA;&lt;p&gt;Add parameter &lt;code&gt;errors&lt;/code&gt; to &lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;DataFrame.drop&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;:&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;df = df.drop([&amp;#39;row_num&amp;#39;,&amp;#39;start_date&amp;#39;,&amp;#39;end_date&amp;#39;,&amp;#39;symbol&amp;#39;], axis=1, errors=&amp;#39;ignore&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;an-example-of-how-to-ignore-errors-with-drop&#34;&gt;An example of how to Ignore Errors with &lt;code&gt;.drop()&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;df = pd.DataFrame({&amp;#39;row_num&amp;#39;:[1,2], &amp;#39;w&amp;#39;:[3,4]})&#xA;df = df.drop([&amp;#39;row_num&amp;#39;,&amp;#39;start_date&amp;#39;,&amp;#39;end_date&amp;#39;,&amp;#39;symbol&amp;#39;], axis=1, errors=&amp;#39;ignore&amp;#39;)&#xA;print (df)&#xA;   w&#xA;0  3&#xA;1  4&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>[Solved] An error occurred while calling o86.getDynamicFrame. Exception thrown in awaitResult:</title>
      <link>https://andrewodendaal.com/solved-an-error-occurred-while-calling-o86-getdynamicframe-exception-thrown-in-awaitresult/</link>
      <pubDate>Wed, 17 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-an-error-occurred-while-calling-o86-getdynamicframe-exception-thrown-in-awaitresult/</guid>
      <description>&lt;p&gt;If you are running a &lt;code&gt;GlueJob&lt;/code&gt; in AWS and get the following error:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;An error occurred while calling o86.getDynamicFrame. Exception thrown in awaitResult:&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then you need to view the CloudWatch logs to help you pinpoint where the problem is occuring.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-solve-the-exception-thrown-in-awaitresult&#34;&gt;How to solve the Exception thrown in &lt;code&gt;awaitResult&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;It&amp;rsquo;s highly likely that the issue is in an expired IAM Role.&lt;/p&gt;&#xA;&lt;p&gt;When a Role is created in IAM, the default &lt;code&gt;maximum session duration&lt;/code&gt; is set to &lt;code&gt;1 hour&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AWS CDK Commands</title>
      <link>https://andrewodendaal.com/aws-cdk-commands/</link>
      <pubDate>Tue, 16 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/aws-cdk-commands/</guid>
      <description>&lt;p&gt;The AWS Cloud Development Kit (CDK) comes with a list of commands that you need to know:&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;&lt;/th&gt;&#xA;          &lt;th&gt;&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;cdk list (ls)&lt;/td&gt;&#xA;          &lt;td&gt;Lists the stacks in the app&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;cdk synthesize (synth)&lt;/td&gt;&#xA;          &lt;td&gt;Synthesizes and prints the CloudFormation template for the specified stack(s)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;cdk bootstrap&lt;/td&gt;&#xA;          &lt;td&gt;Deploys the CDK Toolkit staging stack; see Bootstrapping&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;cdk deploy&lt;/td&gt;&#xA;          &lt;td&gt;Deploys the specified stack(s)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;cdk destroy&lt;/td&gt;&#xA;          &lt;td&gt;Destroys the specified stack(s)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;cdk diff&lt;/td&gt;&#xA;          &lt;td&gt;Compares the specified stack with the deployed stack or a local CloudFormation template&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;cdk metadata&lt;/td&gt;&#xA;          &lt;td&gt;Displays metadata about the specified stack&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;cdk init&lt;/td&gt;&#xA;          &lt;td&gt;Creates a new CDK project in the current directory from a specified template&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;cdk context&lt;/td&gt;&#xA;          &lt;td&gt;Manages cached context values&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;cdk docs (doc)&lt;/td&gt;&#xA;          &lt;td&gt;Opens the CDK API reference in your browser&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;cdk doctor&lt;/td&gt;&#xA;          &lt;td&gt;Checks your CDK project for potential problems&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;You can learn more about the CDK here: &lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;https://docs.aws.amazon.com/cdk/v2/guide/cli.html&#34;&gt;https://docs.aws.amazon.com/cdk/v2/guide/cli.html&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Make a Java Jar File Executable</title>
      <link>https://andrewodendaal.com/how-to-make-java-jar-file-executable/</link>
      <pubDate>Mon, 15 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-make-java-jar-file-executable/</guid>
      <description>&lt;p&gt;Let&amp;rsquo;s say you have a Java project as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package ms.ao.something;&#xA;public class MyProject {&#xA;    public static void main(String...args) throws Exception {&#xA;        System.out.println(&amp;#34;Hello world!&amp;#34;);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now you want to build this and make it a self contained executable Jar.&lt;/p&gt;&#xA;&lt;p&gt;If you do a &lt;code&gt;mvn clean install&lt;/code&gt; or &lt;code&gt;mvn clean package&lt;/code&gt;, and try and run it as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;java -jar target/my-java-1.0-SNAPSHOT.jar&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You will get the following error:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;no main manifest attribute, in target/my-java-1.0-SNAPSHOT.jar&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to List All Resources in an AWS Account</title>
      <link>https://andrewodendaal.com/how-to-list-all-resources-in-an-aws-account/</link>
      <pubDate>Sun, 14 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-list-all-resources-in-an-aws-account/</guid>
      <description>&lt;p&gt;If you need to see a list of all the resources in your AWS Account, then you need to look into the &lt;code&gt;Tag Editor&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-tag-editor&#34;&gt;Step 1 – Tag Editor&lt;/h2&gt;&#xA;&lt;p&gt;Search for &lt;code&gt;Tag Editor&lt;/code&gt; in the navigation search at the top of the AWS Console.&lt;/p&gt;&#xA;&lt;p&gt;Select the &lt;code&gt;Resource Groups &amp;amp; Tag Editor&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2022/07/image-800x197.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-2-8211-find-resources&#34;&gt;Step 2 – Find Resources&lt;/h2&gt;&#xA;&lt;p&gt;From the left hand menu, select &lt;code&gt;Tag Editor&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2022/07/image-2-469x350.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-3-8211-filter-your-search-requirements&#34;&gt;Step 3 – Filter your Search Requirements&lt;/h2&gt;&#xA;&lt;p&gt;From the &lt;code&gt;Regions&lt;/code&gt; drop down, select &lt;code&gt;All regions&lt;/code&gt; and then select &lt;code&gt;All supported resource types&lt;/code&gt; from the &lt;code&gt;Resource types&lt;/code&gt; drop down.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fixed size left column and fluid right column both with 100% height in CSS</title>
      <link>https://andrewodendaal.com/fixed-size-left-column-and-fluid-right-column-both-with-100-height-in-css/</link>
      <pubDate>Sat, 13 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/fixed-size-left-column-and-fluid-right-column-both-with-100-height-in-css/</guid>
      <description>&lt;p&gt;If you need two (2) columns and want the left column to be a fixed size, but the right column to automatically take the remaining size of the window, then you can use the following solution.&lt;/p&gt;&#xA;&lt;p&gt;Follow the steps below, which include some CSS and some HTML.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-css-for-our-solution&#34;&gt;The CSS for our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;html, body {&#xA;  height: 100%;&#xA;  width: 100%;&#xA;  padding: 0;&#xA;  margin: 0;&#xA;}&#xA;&#xA;.page-wrapper {&#xA;  height: 100%;&#xA;  position: relative;&#xA;}&#xA;&#xA;.left-column {&#xA;  position:fixed; /* &amp;lt;-- This prevents scrolling */&#xA;  top:0;&#xA;  left:0;&#xA;  width:235px;&#xA;  height:100%;&#xA;  background:#090909;&#xA;}&#xA;&#xA;.right-column {&#xA;  margin-left:235px;&#xA;  background:yellow;&#xA;  min-height:100%;  /* &amp;lt;-- Allows the content to grow */&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-html-for-our-solution&#34;&gt;The HTML for our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;div class=&amp;#34;page-wrapper&amp;#34;&amp;gt;&#xA;  &amp;lt;div class=&amp;#34;left-column&amp;#34;&amp;gt;&amp;lt;/div&amp;gt;&#xA;  &amp;lt;div class=&amp;#34;right-column&amp;#34;&amp;gt;&#xA;    This is the content.&#xA;  &amp;lt;/div&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Check if a Volume is Mounted in Bash</title>
      <link>https://andrewodendaal.com/how-to-check-if-a-volume-is-mounted-in-bash/</link>
      <pubDate>Fri, 12 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-check-if-a-volume-is-mounted-in-bash/</guid>
      <description>&lt;p&gt;If you need to check if a volume is mounted in a Bash script, then you can do the following.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-check-mounted-volumes&#34;&gt;How to Check Mounted Volumes&lt;/h2&gt;&#xA;&lt;p&gt;First we need to determine the command that will be able to check.&lt;/p&gt;&#xA;&lt;p&gt;This can be done with the &lt;code&gt;/proc/mounts&lt;/code&gt; path.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-check-if-a-volume-is-mounted-in-bash&#34;&gt;How to Check if a Volume is Mounted in Bash&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;if grep -qs &amp;#39;/mnt/foo &amp;#39; /proc/mounts; then&#xA;    echo &amp;#34;It&amp;#39;s mounted.&amp;#34;&#xA;else&#xA;    echo &amp;#34;It&amp;#39;s not mounted.&amp;#34;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-check-if-a-volume-is-mounted-and-available&#34;&gt;How to Check if a Volume is Mounted and Available&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;MNT_DIR=/mnt/foo&#xA;df_result=$(timeout 10 df &amp;#34;$MNT_DIR&amp;#34;)&#xA;[[ $df_result =~ $MNT_DIR ]] &#xA;if [ &amp;#34;$BASH_REMATCH&amp;#34; = &amp;#34;$MNT_DIR&amp;#34; ]&#xA;then&#xA;    echo &amp;#34;It&amp;#39;s available.&amp;#34;&#xA;else&#xA;    echo &amp;#34;It&amp;#39;s not available.&amp;#34;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;another-way-of-checking-volume-mounts&#34;&gt;Another way of Checking Volume Mounts&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;mount \&#xA;    | cut -f 3 -d &amp;#39; &amp;#39; \&#xA;    | grep -q /mnt/foo \&#xA;  &amp;amp;&amp;amp; echo &amp;#34;mounted&amp;#34; || echo &amp;#34;not mounted&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Determine if a Bash Variable is Empty</title>
      <link>https://andrewodendaal.com/how-to-determine-if-a-bash-variable-is-empty/</link>
      <pubDate>Thu, 11 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-determine-if-a-bash-variable-is-empty/</guid>
      <description>&lt;p&gt;If you need to check if a &lt;code&gt;bash&lt;/code&gt; variable is empty, or unset, then you can use the following code:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;if [ -z &amp;#34;${VAR}&amp;#34; ];&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The above code will check if a variable called &lt;code&gt;VAR&lt;/code&gt; is set, or empty.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-does-this-mean&#34;&gt;What does this mean?&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;Unset&lt;/code&gt; means that the variable has not been set.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Empty&lt;/code&gt; means that the variable is set with an empty value of &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-the-inverse-of--z&#34;&gt;What is the inverse of &lt;code&gt;-z&lt;/code&gt;?&lt;/h2&gt;&#xA;&lt;p&gt;The inverse of &lt;code&gt;-z&lt;/code&gt; is &lt;code&gt;-n&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Order by File Size using the du command in Linux</title>
      <link>https://andrewodendaal.com/how-to-order-by-file-size-using-the-du-command-in-linux/</link>
      <pubDate>Wed, 10 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-order-by-file-size-using-the-du-command-in-linux/</guid>
      <description>&lt;p&gt;If you use the &lt;code&gt;du&lt;/code&gt; command to list all the file sizes on Linux:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;du&#xA;# or&#xA;du -h # Human readable&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then you would have noticed that they are not ordered by file size.&lt;/p&gt;&#xA;&lt;p&gt;Instead you can pass that result to the &lt;code&gt;sort&lt;/code&gt; command as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;du -h | sort -h&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Join Multiple MySQL Tables in Python</title>
      <link>https://andrewodendaal.com/how-to-join-multiple-mysql-tables-in-python/</link>
      <pubDate>Tue, 09 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-join-multiple-mysql-tables-in-python/</guid>
      <description>&lt;p&gt;First, you will need the &lt;code&gt;mysql.connector&lt;/code&gt;. If you are unsure of how to get this setup, refer to &lt;a href=&#34;https://andrewodendaal.com/how-to-install-mysql-driver-in-python/&#34;&gt;How to Install MySQL Driver in Python&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;presenting-the-data&#34;&gt;Presenting the data&lt;/h2&gt;&#xA;&lt;p&gt;let&amp;rsquo;s take two (2) tables as a demonstration for the code below.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Users&lt;/code&gt; – Table 1&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{ id: 1, name: &amp;#39;Carl&amp;#39;, fav: 254},&#xA;{ id: 2, name: &amp;#39;Emma&amp;#39;, fav: 254},&#xA;{ id: 3, name: &amp;#39;John&amp;#39;, fav: 255},&#xA;{ id: 4, name: &amp;#39;Hayley&amp;#39;, fav:},&#xA;{ id: 5, name: &amp;#39;Andrew&amp;#39;, fav:}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;Products&lt;/code&gt; – Table 2&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Limit a MySQL Query in Python</title>
      <link>https://andrewodendaal.com/how-to-limit-a-mysql-query-in-python/</link>
      <pubDate>Mon, 08 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-limit-a-mysql-query-in-python/</guid>
      <description>&lt;p&gt;First, you will need the &lt;code&gt;mysql.connector&lt;/code&gt;. If you are unsure of how to get this setup, refer to &lt;a href=&#34;https://andrewodendaal.com/how-to-install-mysql-driver-in-python/&#34;&gt;How to Install MySQL Driver in Python&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-limit-the-result-returned-from-mysql-in-python&#34;&gt;How to Limit the Result Returned from MySQL in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&#xA;mydb = mysql.connector.connect(&#xA;  host = &amp;#34;localhost&amp;#34;,&#xA;  user = &amp;#34;username&amp;#34;,&#xA;  password = &amp;#34;YoUrPaSsWoRd&amp;#34;,&#xA;  database = &amp;#34;your_database&amp;#34;&#xA;)&#xA;&#xA;mycursor = mydb.cursor()&#xA;mycursor.execute(&amp;#34;SELECT * FROM customers LIMIT 10&amp;#34;)&#xA;myresult = mycursor.fetchall()&#xA;&#xA;for x in myresult:&#xA;  print(x)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-start-from-another-position-in-mysql-from-python&#34;&gt;How to Start From Another Position in MySQL from Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&#xA;mydb = mysql.connector.connect(&#xA;  host = &amp;#34;localhost&amp;#34;,&#xA;  user = &amp;#34;username&amp;#34;,&#xA;  password = &amp;#34;YoUrPaSsWoRd&amp;#34;,&#xA;  database = &amp;#34;your_database&amp;#34;&#xA;)&#xA;&#xA;mycursor = mydb.cursor()&#xA;mycursor.execute(&amp;#34;SELECT * FROM customers LIMIT 10 OFFSET 5&amp;#34;)&#xA;myresult = mycursor.fetchall()&#xA;&#xA;for x in myresult:&#xA;  print(x)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Update a MySQL Table in Python</title>
      <link>https://andrewodendaal.com/how-to-update-a-mysql-table-in-python/</link>
      <pubDate>Sun, 07 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-update-a-mysql-table-in-python/</guid>
      <description>&lt;p&gt;First, you will need the &lt;code&gt;mysql.connector&lt;/code&gt;. If you are unsure of how to get this setup, refer to &lt;a href=&#34;https://andrewodendaal.com/how-to-install-mysql-driver-in-python/&#34;&gt;How to Install MySQL Driver in Python&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-update-a-mysql-table-in-python&#34;&gt;How to Update a MySQL Table in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&#xA;mydb = mysql.connector.connect(&#xA;  host = &amp;#34;localhost&amp;#34;,&#xA;  user = &amp;#34;username&amp;#34;,&#xA;  password = &amp;#34;YoUrPaSsWoRd&amp;#34;,&#xA;  database = &amp;#34;your_database&amp;#34;&#xA;)&#xA;&#xA;mycursor = mydb.cursor()&#xA;sql = &amp;#34;UPDATE customers SET address = &amp;#39;Stoneleigh Place&amp;#39; WHERE address = &amp;#39;Abbey Road&amp;#39;&amp;#34;&#xA;mycursor.execute(sql)&#xA;mydb.commit()&#xA;&#xA;print(mycursor.rowcount, &amp;#34;record(s) affected&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;prevent-sql-injection-in-your-update-clause-in-python&#34;&gt;Prevent SQL Injection in your Update Clause in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&#xA;mydb = mysql.connector.connect(&#xA;  host = &amp;#34;localhost&amp;#34;,&#xA;  user = &amp;#34;username&amp;#34;,&#xA;  password = &amp;#34;YoUrPaSsWoRd&amp;#34;,&#xA;  database = &amp;#34;your_database&amp;#34;&#xA;)&#xA;&#xA;mycursor = mydb.cursor()&#xA;&#xA;sql = &amp;#34;UPDATE customers SET address = %s WHERE address = %s&amp;#34;&#xA;val = (&amp;#34;Stoneleigh Place&amp;#34;, &amp;#34;Abbey Road&amp;#34;)&#xA;&#xA;mycursor.execute(sql, val)&#xA;mydb.commit()&#xA;&#xA;print(mycursor.rowcount, &amp;#34;record(s) affected&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Drop a MySQL Table in Python</title>
      <link>https://andrewodendaal.com/how-to-drop-a-mysql-table-in-python/</link>
      <pubDate>Sat, 06 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-drop-a-mysql-table-in-python/</guid>
      <description>&lt;p&gt;First, you will need the &lt;code&gt;mysql.connector&lt;/code&gt;. If you are unsure of how to get this setup, refer to &lt;a href=&#34;https://andrewodendaal.com/how-to-install-mysql-driver-in-python/&#34;&gt;How to Install MySQL Driver in Python&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-deletedrop-a-mysql-table-in-python&#34;&gt;How to Delete/Drop a MySQL Table in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&#xA;mydb = mysql.connector.connect(&#xA;  host = &amp;#34;localhost&amp;#34;,&#xA;  user = &amp;#34;username&amp;#34;,&#xA;  password = &amp;#34;YoUrPaSsWoRd&amp;#34;,&#xA;  database = &amp;#34;your_database&amp;#34;&#xA;)&#xA;&#xA;mycursor = mydb.cursor()&#xA;sql = &amp;#34;DROP TABLE customers&amp;#34;&#xA;mycursor.execute(sql)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-deletedrop-only-if-mysql-table-exists-in-python&#34;&gt;How to Delete/Drop Only if MySQL Table Exists in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&#xA;mydb = mysql.connector.connect(&#xA;  host = &amp;#34;localhost&amp;#34;,&#xA;  user = &amp;#34;username&amp;#34;,&#xA;  password = &amp;#34;YoUrPaSsWoRd&amp;#34;,&#xA;  database = &amp;#34;your_database&amp;#34;&#xA;)&#xA;&#xA;mycursor = mydb.cursor()&#xA;sql = &amp;#34;DROP TABLE IF EXISTS customers&amp;#34;&#xA;mycursor.execute(sql)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Delete MySQL Records in Python</title>
      <link>https://andrewodendaal.com/how-to-delete-mysql-records-in-python/</link>
      <pubDate>Fri, 05 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-delete-mysql-records-in-python/</guid>
      <description>&lt;p&gt;First, you will need the &lt;code&gt;mysql.connector&lt;/code&gt;. If you are unsure of how to get this setup, refer to &lt;a href=&#34;https://andrewodendaal.com/how-to-install-mysql-driver-in-python/&#34;&gt;How to Install MySQL Driver in Python&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-delete-mysql-records-in-python&#34;&gt;How to Delete MySQL Records in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&#xA;mydb = mysql.connector.connect(&#xA;  host = &amp;#34;localhost&amp;#34;,&#xA;  user = &amp;#34;username&amp;#34;,&#xA;  password = &amp;#34;YoUrPaSsWoRd&amp;#34;,&#xA;  database = &amp;#34;your_database&amp;#34;&#xA;)&#xA;&#xA;mycursor = mydb.cursor()&#xA;sql = &amp;#34;DELETE FROM customers WHERE address = &amp;#39;The Rockies&amp;#39;&amp;#34;&#xA;mycursor.execute(sql)&#xA;&#xA;mydb.commit()&#xA;&#xA;print(mycursor.rowcount, &amp;#34;record(s) deleted&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;prevent-sql-injection-in-mysql-queries-through-python&#34;&gt;Prevent SQL Injection in MySQL queries through Python&lt;/h2&gt;&#xA;&lt;p&gt;Specify the injected variable as the second argument to the &lt;code&gt;execute&lt;/code&gt; command as below.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to ORDER BY a MySQL Query in Python</title>
      <link>https://andrewodendaal.com/how-to-order-by-a-mysql-query-in-python/</link>
      <pubDate>Thu, 04 Aug 2022 21:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-order-by-a-mysql-query-in-python/</guid>
      <description>&lt;p&gt;First, you will need the &lt;code&gt;mysql.connector&lt;/code&gt;. If you are unsure of how to get this setup, refer to &lt;a href=&#34;https://andrewodendaal.com/how-to-install-mysql-driver-in-python/&#34;&gt;How to Install MySQL Driver in Python&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-sort-the-result-of-a-mysql-query-in-python&#34;&gt;How to Sort the Result of a MySQL Query in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&#xA;mydb = mysql.connector.connect(&#xA;  host = &amp;#34;localhost&amp;#34;,&#xA;  user = &amp;#34;username&amp;#34;,&#xA;  password = &amp;#34;YoUrPaSsWoRd&amp;#34;,&#xA;  database = &amp;#34;your_database&amp;#34;&#xA;)&#xA;&#xA;mycursor = mydb.cursor()&#xA;sql = &amp;#34;SELECT * FROM customers ORDER BY name&amp;#34;&#xA;mycursor.execute(sql)&#xA;&#xA;myresult = mycursor.fetchall()&#xA;&#xA;for x in myresult:&#xA;  print(x)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-change-direction-of-mysql-order-in-python&#34;&gt;How to Change Direction of MySQL Order in Python&lt;/h2&gt;&#xA;&lt;p&gt;You can change the order of the sort by simply setting the order direction.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Filter WHERE MySQL Queries in Python</title>
      <link>https://andrewodendaal.com/how-to-filter-where-mysql-queries-in-python/</link>
      <pubDate>Wed, 03 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-filter-where-mysql-queries-in-python/</guid>
      <description>&lt;p&gt;First, you will need the &lt;code&gt;mysql.connector&lt;/code&gt;. If you are unsure of how to get this setup, refer to &lt;a href=&#34;https://andrewodendaal.com/how-to-install-mysql-driver-in-python/&#34;&gt;How to Install MySQL Driver in Python&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-select-from-mysql-with-a-filter-in-python&#34;&gt;How to Select from MySQL with a Filter in Python&lt;/h2&gt;&#xA;&lt;p&gt;You simply specify the &lt;code&gt;WHERE&lt;/code&gt; clause in your SQL statement as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&#xA;mydb = mysql.connector.connect(&#xA;  host = &amp;#34;localhost&amp;#34;,&#xA;  user = &amp;#34;username&amp;#34;,&#xA;  password = &amp;#34;YoUrPaSsWoRd&amp;#34;,&#xA;  database = &amp;#34;your_database&amp;#34;&#xA;)&#xA;&#xA;mycursor = mydb.cursor()&#xA;sql = &amp;#34;SELECT * FROM customers WHERE address =&amp;#39;London Road&amp;#39;&amp;#34;&#xA;mycursor.execute(sql)&#xA;&#xA;myresult = mycursor.fetchall()&#xA;&#xA;for x in myresult:&#xA;  print(x)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-select-and-filter-wildcard-characters-in-python&#34;&gt;How to Select and Filter Wildcard Characters in Python&lt;/h2&gt;&#xA;&lt;p&gt;To filter &lt;code&gt;wildcard characters&lt;/code&gt;, you combine the &lt;code&gt;WHERE&lt;/code&gt;and &lt;code&gt;LIKE&lt;/code&gt; keywords, and place the &lt;code&gt;%&lt;/code&gt; symbol where the wildcards would occur.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Select From MySQL in Python</title>
      <link>https://andrewodendaal.com/how-to-select-from-mysql-in-python/</link>
      <pubDate>Tue, 02 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-select-from-mysql-in-python/</guid>
      <description>&lt;p&gt;First, you will need the &lt;code&gt;mysql.connector&lt;/code&gt;. If you are unsure of how to get this setup, refer to &lt;a href=&#34;https://andrewodendaal.com/how-to-install-mysql-driver-in-python/&#34;&gt;How to Install MySQL Driver in Python&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-select-from-a-mysql-table-in-python&#34;&gt;How to Select From a MySQL Table in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&#xA;mydb = mysql.connector.connect(&#xA;  host = &amp;#34;localhost&amp;#34;,&#xA;  user = &amp;#34;username&amp;#34;,&#xA;  password = &amp;#34;YoUrPaSsWoRd&amp;#34;,&#xA;  database = &amp;#34;your_database&amp;#34;&#xA;)&#xA;&#xA;mycursor = mydb.cursor()&#xA;mycursor.execute(&amp;#34;SELECT * FROM customers&amp;#34;)&#xA;myresult = mycursor.fetchall()&#xA;&#xA;for x in myresult:&#xA;  print(x)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-select-columns-from-a-mysql-table-in-python&#34;&gt;How to Select Columns From a MySQL Table in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&#xA;mydb = mysql.connector.connect(&#xA;  host = &amp;#34;localhost&amp;#34;,&#xA;  user = &amp;#34;username&amp;#34;,&#xA;  password = &amp;#34;YoUrPaSsWoRd&amp;#34;,&#xA;  database = &amp;#34;your_database&amp;#34;&#xA;)&#xA;&#xA;mycursor = mydb.cursor()&#xA;mycursor.execute(&amp;#34;SELECT name, address FROM customers&amp;#34;)&#xA;myresult = mycursor.fetchall()&#xA;&#xA;for x in myresult:&#xA;  print(x)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-fetch-only-a-single-row-from-mysql-in-python&#34;&gt;How to Fetch Only a Single Row From MySQL in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&#xA;mydb = mysql.connector.connect(&#xA;  host = &amp;#34;localhost&amp;#34;,&#xA;  user = &amp;#34;username&amp;#34;,&#xA;  password = &amp;#34;YoUrPaSsWoRd&amp;#34;,&#xA;  database = &amp;#34;your_database&amp;#34;&#xA;)&#xA;&#xA;mycursor = mydb.cursor()&#xA;mycursor.execute(&amp;#34;SELECT * FROM customers&amp;#34;)&#xA;myresult = mycursor.fetchone()&#xA;&#xA;print(myresult)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Insert into a MySQL Table in Python</title>
      <link>https://andrewodendaal.com/how-to-insert-into-a-mysql-table-in-python/</link>
      <pubDate>Mon, 01 Aug 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-insert-into-a-mysql-table-in-python/</guid>
      <description>&lt;p&gt;If you need to insert data into a MySQL table using Python, then look no further.&lt;/p&gt;&#xA;&lt;p&gt;If you need to first learn about the &lt;code&gt;mysql.connector&lt;/code&gt; and how to get this up and running, first take a look at the &lt;a href=&#34;https://andrewodendaal.com/how-to-install-mysql-driver-in-python/&#34;&gt;How to Install MySQL Driver in Python&lt;/a&gt; post before continuing.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-do-insert-into-a-mysql-table-in-python&#34;&gt;How do Insert into a MySQL Table in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&#xA;mydb = mysql.connector.connect(&#xA;  host = &amp;#34;localhost&amp;#34;,&#xA;  user = &amp;#34;username&amp;#34;,&#xA;  password = &amp;#34;YoUrPaSsWoRd&amp;#34;,&#xA;  database = &amp;#34;your_database&amp;#34;&#xA;)&#xA;&#xA;mycursor = mydb.cursor()&#xA;&#xA;sql = &amp;#34;INSERT INTO customers (name, address) VALUES (%s, %s)&amp;#34;&#xA;val = (&amp;#34;Andrew&amp;#34;, &amp;#34;Somewhere nice&amp;#34;)&#xA;mycursor.execute(sql, val)&#xA;&#xA;mydb.commit()&#xA;&#xA;print(mycursor.rowcount, &amp;#34;record successfully inserted&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will insert a single row into the MySQL table.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create a Primary Key for a MySQL Database in Python</title>
      <link>https://andrewodendaal.com/how-to-create-a-primary-key-for-a-mysql-database-in-python/</link>
      <pubDate>Sun, 31 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-primary-key-for-a-mysql-database-in-python/</guid>
      <description>&lt;p&gt;You can create a Primary Key for your MySQL database in Python as follows.&lt;/p&gt;&#xA;&lt;p&gt;First, you need to know if the Primary Key already exists.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-the-primary-key-does-not-exist&#34;&gt;Option 1 – The Primary Key does not Exist&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&#xA;mydb = mysql.connector.connect(&#xA;  host = &amp;#34;localhost&amp;#34;,&#xA;  user = &amp;#34;username&amp;#34;,&#xA;  password = &amp;#34;YoUrPaSsWoRd&amp;#34;,&#xA;  database = &amp;#34;your_database&amp;#34;&#xA;)&#xA;&#xA;mycursor = mydb.cursor()&#xA;&#xA;mycursor.execute(&amp;#34;CREATE TABLE customers (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), address VARCHAR(255))&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-the-primary-key-already-exists&#34;&gt;Option 2 – The Primary Key already Exists&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&#xA;mydb = mysql.connector.connect(&#xA;  host = &amp;#34;localhost&amp;#34;,&#xA;  user = &amp;#34;username&amp;#34;,&#xA;  password = &amp;#34;YoUrPaSsWoRd&amp;#34;,&#xA;  database = &amp;#34;your_database&amp;#34;&#xA;)&#xA;&#xA;mycursor = mydb.cursor()&#xA;&#xA;mycursor.execute(&amp;#34;ALTER TABLE customers ADD COLUMN id INT AUTO_INCREMENT PRIMARY KEY&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Create a MySQL Table in Python</title>
      <link>https://andrewodendaal.com/how-to-create-a-mysql-table-in-python/</link>
      <pubDate>Sat, 30 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-mysql-table-in-python/</guid>
      <description>&lt;p&gt;If you need to create a table in a MySQL database using Python, then you can do the following.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-create-a-mysql-table-in-python&#34;&gt;How to Create a MySQL Table in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&#xA;mydb = mysql.connector.connect(&#xA;  host = &amp;#34;localhost&amp;#34;,&#xA;  user = &amp;#34;username&amp;#34;,&#xA;  password = &amp;#34;YoUrPaSsWoRd&amp;#34;,&#xA;  database = &amp;#34;your_database&amp;#34;&#xA;)&#xA;&#xA;mycursor = mydb.cursor()&#xA;&#xA;mycursor.execute(&amp;#34;CREATE TABLE people (name VARCHAR(255), address VARCHAR(255))&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-check-if-a-mysql-table-exists-in-python&#34;&gt;How to Check if a MySQL Table Exists in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&#xA;mydb = mysql.connector.connect(&#xA;  host = &amp;#34;localhost&amp;#34;,&#xA;  user = &amp;#34;yourusername&amp;#34;,&#xA;  password = &amp;#34;YoUrPaSsWoRd&amp;#34;,&#xA;  database = &amp;#34;your_database&amp;#34;&#xA;)&#xA;&#xA;mycursor = mydb.cursor()&#xA;&#xA;mycursor.execute(&amp;#34;SHOW TABLES&amp;#34;)&#xA;&#xA;for x in mycursor:&#xA;  print(x)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Create a MySQL Database in Python</title>
      <link>https://andrewodendaal.com/how-to-create-a-mysql-database-in-python/</link>
      <pubDate>Fri, 29 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-mysql-database-in-python/</guid>
      <description>&lt;p&gt;In order to create a MySQL database in Python, you first need to initiate a connection using the &lt;code&gt;mysql.connector&lt;/code&gt;. You can learn about how to &lt;a href=&#34;https://andrewodendaal.com/how-to-install-mysql-driver-in-python&#34;&gt;create a connection to MySQL here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-create-a-database-in-python&#34;&gt;How to Create a Database in Python&lt;/h2&gt;&#xA;&lt;p&gt;Creating a database is simple.&lt;/p&gt;&#xA;&lt;p&gt;First, make sure you have an active connection to your database, and then set a &lt;code&gt;cursor&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Once you have this, issue the &lt;code&gt;execute&lt;/code&gt; command to create your database.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Install MySQL Driver in Python</title>
      <link>https://andrewodendaal.com/how-to-install-mysql-driver-in-python/</link>
      <pubDate>Thu, 28 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-install-mysql-driver-in-python/</guid>
      <description>&lt;p&gt;To begin using MySQL in Python, you need to do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-install-the-mysql-connector&#34;&gt;Step 1 – Install the MySQL Connector&lt;/h2&gt;&#xA;&lt;p&gt;Using &lt;code&gt;pip&lt;/code&gt;, we can install the MySQL Connector package:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;python -m pip install mysql-connector-python&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-test-the-mysql-connector&#34;&gt;Step 2 – Test the MySQL Connector&lt;/h2&gt;&#xA;&lt;p&gt;Create a Python file and import the new package:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mysql.connector&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-3-8211-create-a-connection-to-the-mysql-database&#34;&gt;Step 3 – Create a Connection to the MySQL Database&lt;/h2&gt;&#xA;&lt;p&gt;Now you can create a connection to your MySQL database.&lt;/p&gt;&#xA;&lt;p&gt;Create a file called &lt;code&gt;app.py&lt;/code&gt; and place the following inside:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Resize an AWS EBS Volume in Bash</title>
      <link>https://andrewodendaal.com/how-to-resize-an-aws-ebs-volume-in-bash/</link>
      <pubDate>Wed, 27 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-resize-an-aws-ebs-volume-in-bash/</guid>
      <description>&lt;p&gt;If you need to resize an EBS volume in AWS, you can do so using &lt;code&gt;bash&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-create-a-bash-file&#34;&gt;Step 1 – Create a &lt;code&gt;bash&lt;/code&gt; file&lt;/h2&gt;&#xA;&lt;p&gt;Create a bash file called &lt;code&gt;resize.sh&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#!/bin/bash&#xA;&#xA;SIZE=${1:-20}&#xA;&#xA;INSTANCEID=$(curl http://169.254.169.254/latest/meta-data/instance-id)&#xA;REGION=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed &amp;#39;s/\(.*\)[a-z]/\1/&amp;#39;)&#xA;&#xA;VOLUMEID=$(aws ec2 describe-instances \&#xA;  --instance-id $INSTANCEID \&#xA;  --query &amp;#34;Reservations[0].Instances[0].BlockDeviceMappings[0].Ebs.VolumeId&amp;#34; \&#xA;  --output text \&#xA;  --region $REGION)&#xA;&#xA;aws ec2 modify-volume --volume-id $VOLUMEID --size $SIZE&#xA;&#xA;while [ \&#xA;  &amp;#34;$(aws ec2 describe-volumes-modifications \&#xA;    --volume-id $VOLUMEID \&#xA;    --filters Name=modification-state,Values=&amp;#34;optimizing&amp;#34;,&amp;#34;completed&amp;#34; \&#xA;    --query &amp;#34;length(VolumesModifications)&amp;#34;\&#xA;    --output text)&amp;#34; != &amp;#34;1&amp;#34; ]; do&#xA;sleep 1&#xA;done&#xA;&#xA;if [[ -e &amp;#34;/dev/xvda&amp;#34; &amp;amp;&amp;amp; $(readlink -f /dev/xvda) = &amp;#34;/dev/xvda&amp;#34; ]]&#xA;then&#xA;  sudo growpart /dev/xvda 1&#xA;&#xA;  STR=$(cat /etc/os-release)&#xA;  SUB=&amp;#34;VERSION_ID=\&amp;#34;2\&amp;#34;&amp;#34;&#xA;  if [[ &amp;#34;$STR&amp;#34; == *&amp;#34;$SUB&amp;#34;* ]]&#xA;  then&#xA;    sudo xfs_growfs -d /&#xA;  else&#xA;    sudo resize2fs /dev/xvda1&#xA;  fi&#xA;&#xA;else&#xA;  sudo growpart /dev/nvme0n1 1&#xA;&#xA;  STR=$(cat /etc/os-release)&#xA;  SUB=&amp;#34;VERSION_ID=\&amp;#34;2\&amp;#34;&amp;#34;&#xA;  if [[ &amp;#34;$STR&amp;#34; == *&amp;#34;$SUB&amp;#34;* ]]&#xA;  then&#xA;    sudo xfs_growfs -d /&#xA;  else&#xA;    sudo resize2fs /dev/nvme0n1p1&#xA;  fi&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-run-the-bash-file-specifying-the-new-size&#34;&gt;Step 2 – Run the &lt;code&gt;bash&lt;/code&gt; file specifying the new size&lt;/h2&gt;&#xA;&lt;p&gt;Now that you have the bash file, you can run the &lt;code&gt;bash&lt;/code&gt; file along with specifying the new size of the desired volume:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get all checked checkboxes in Javascript</title>
      <link>https://andrewodendaal.com/how-to-get-all-checked-checkboxes-in-javascript/</link>
      <pubDate>Tue, 26 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-all-checked-checkboxes-in-javascript/</guid>
      <description>&lt;p&gt;If you need to get all the checked checkboxes using Javascript, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-in-a-single-line&#34;&gt;Option 1 – In a single line&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;const checkedBoxes = document.querySelectorAll(&amp;#39;input[name=mycheckboxes]:checked&amp;#39;);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-another-one-liner&#34;&gt;Option 2 – Another one liner&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;const data = [...document.querySelectorAll(&amp;#39;.mycheckboxes:checked&amp;#39;)].map(e =&amp;gt; e.value);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-create-a-helper-function&#34;&gt;Option 3 – Create a helper function&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function getCheckedBoxes(checkboxName) {&#xA;  var checkboxes = document.getElementsByName(checkboxName);&#xA;  var checkboxesChecked = [];&#xA;&#xA;  for (var i=0; i&amp;lt;checkboxes.length; i++) {&#xA;     if (checkboxes[i].checked) checkboxesChecked.push(checkboxes[i]);&#xA;     }&#xA;  }&#xA;  return checkboxesChecked.length &amp;gt; 0 ? checkboxesChecked : null;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now you simply call the function:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Setup Credential Helper for AWS CodeCommit</title>
      <link>https://andrewodendaal.com/how-to-setup-credential-helper-for-aws-codecommit/</link>
      <pubDate>Mon, 25 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-setup-credential-helper-for-aws-codecommit/</guid>
      <description>&lt;p&gt;AWS CodeCommit is a &lt;code&gt;git&lt;/code&gt; code repository service by Amazon Web Services.&lt;/p&gt;&#xA;&lt;p&gt;You will want to clone your repository and setup your remotes using &lt;code&gt;credential helper&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-setup-credential-helper&#34;&gt;Step 1 – Setup Credential Helper&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git config --global credential.helper &amp;#39;!aws codecommit credential-helper $@&amp;#39;&#xA;git config --global credential.UseHttpPath true&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will write to your local user&amp;rsquo;s &lt;code&gt;~/.gitconfig&lt;/code&gt;, and the file will look something like:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[credential]    &#xA;    helper = !aws --profile CodeCommitProfile codecommit credential-helper $@&#xA;    UseHttpPath = true&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can edit this file by running the following &lt;code&gt;git&lt;/code&gt; command:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Flex Grid 2 Columns using CSS</title>
      <link>https://andrewodendaal.com/how-to-flex-grid-2-columns-using-css/</link>
      <pubDate>Sun, 24 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-flex-grid-2-columns-using-css/</guid>
      <description>&lt;p&gt;If you would like to &lt;strong&gt;flex grid 2 columns in CSS&lt;/strong&gt; then you need three (3) &lt;code&gt;div&lt;/code&gt;s.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-set-your-html-template&#34;&gt;Step 1 – Set your HTML template&lt;/h2&gt;&#xA;&lt;p&gt;Create some HTML with this layout.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;div class=&amp;#34;Parent&amp;#34;&amp;gt;&#xA;  &amp;lt;div class=&amp;#34;child1&amp;#34;&amp;gt;&#xA;      &amp;lt;h1&amp;gt;Left&amp;lt;/h1&amp;gt;&#xA;  &amp;lt;/div&amp;gt;&#xA;  &amp;lt;div class=&amp;#34;child2&amp;#34;&amp;gt;&#xA;      &amp;lt;h1&amp;gt;RIGHT&amp;lt;/h1&amp;gt;&#xA;  &amp;lt;/div&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-container-div&#34;&gt;Step 2 – Container Div&lt;/h2&gt;&#xA;&lt;p&gt;Create a &lt;code&gt;Parent&lt;/code&gt; div that uses the Flexbox display model.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;.Parent {&#xA;  display: flex;&#xA;  flex-direction: row;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-3-8211-child-divs&#34;&gt;Step 3 – Child Divs&lt;/h2&gt;&#xA;&lt;p&gt;Create two (2) divs that are both 50% of the parent container.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create a Hashtag Generator in Javascript</title>
      <link>https://andrewodendaal.com/how-to-create-a-hashtag-generator-in-javascript/</link>
      <pubDate>Sat, 23 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-hashtag-generator-in-javascript/</guid>
      <description>&lt;p&gt;If you want to create a &lt;strong&gt;hashtag generator&lt;/strong&gt; in Javascript, then you can do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function generateHashtag(string) {&#xA;  if (string.trim() === &amp;#39;&amp;#39;) return false;&#xA;&#xA;  const stringWithCamelCase = string&#xA;    .split(&amp;#39; &amp;#39;)&#xA;    .map(word =&amp;gt; word.charAt(0).toUpperCase() + word.slice(1))&#xA;    .join(&amp;#39;&amp;#39;);&#xA;&#xA;  const stringWithHashtag = `#${stringWithCamelCase.trim()}`;&#xA;&#xA;  return stringWithHashtag.length &amp;gt; 140 ? false : stringWithHashtag;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-use-the-hashtag-generator&#34;&gt;How to use the Hashtag Generator&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;const hashtag = generateHashtag(&amp;#34;My New Hashtag !&amp;#34;)&#xA;&#xA;console.log(hashtag);&#xA;// #MyNewHashtag!&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Confirm before Leaving Page in Javascript</title>
      <link>https://andrewodendaal.com/how-to-confirm-before-leaving-page-in-javascript/</link>
      <pubDate>Fri, 22 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-confirm-before-leaving-page-in-javascript/</guid>
      <description>&lt;p&gt;You can implement a function to be called before the user leaves a page with Javascript as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;window.onbeforeunload = function(e) {&#xA;  return &amp;#34;Do you want to exit this page?&amp;#34;;&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is a typically solution for when you want the user to confirm their changes are saved before allowing them to close the current page in editing tools.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What are the multiples of 3 from 1 to 1000</title>
      <link>https://andrewodendaal.com/what-are-the-multiples-of-3-from-1-to-1000/</link>
      <pubDate>Thu, 21 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/what-are-the-multiples-of-3-from-1-to-1000/</guid>
      <description>&lt;p&gt;If you need to calculate the multiples of 3, starting from 1 up until 1000, then you can use the following code:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;n = 1&#xA;v = []&#xA;while n &amp;lt;= 1000:&#xA;  v.append(n)&#xA;  n = n + 3&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will generate the list of numbers which are the &lt;strong&gt;multiples of 3 from 1 to 1000&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34, 37, 40, 43, 46, 49, 52, 55, 58, 61, 64, 67, 70, 73, 76, 79, 82, 85, 88, 91, 94, 97, 100, 103, 106, 109, 112, 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, 145, 148, 151, 154, 157, 160, 163, 166, 169, 172, 175, 178, 181, 184, 187, 190, 193, 196, 199, 202, 205, 208, 211, 214, 217, 220, 223, 226, 229, 232, 235, 238, 241, 244, 247, 250, 253, 256, 259, 262, 265, 268, 271, 274, 277, 280, 283, 286, 289, 292, 295, 298, 301, 304, 307, 310, 313, 316, 319, 322, 325, 328, 331, 334, 337, 340, 343, 346, 349, 352, 355, 358, 361, 364, 367, 370, 373, 376, 379, 382, 385, 388, 391, 394, 397, 400, 403, 406, 409, 412, 415, 418, 421, 424, 427, 430, 433, 436, 439, 442, 445, 448, 451, 454, 457, 460, 463, 466, 469, 472, 475, 478, 481, 484, 487, 490, 493, 496, 499, 502, 505, 508, 511, 514, 517, 520, 523, 526, 529, 532, 535, 538, 541, 544, 547, 550, 553, 556, 559, 562, 565, 568, 571, 574, 577, 580, 583, 586, 589, 592, 595, 598, 601, 604, 607, 610, 613, 616, 619, 622, 625, 628, 631, 634, 637, 640, 643, 646, 649, 652, 655, 658, 661, 664, 667, 670, 673, 676, 679, 682, 685, 688, 691, 694, 697, 700, 703, 706, 709, 712, 715, 718, 721, 724, 727, 730, 733, 736, 739, 742, 745, 748, 751, 754, 757, 760, 763, 766, 769, 772, 775, 778, 781, 784, 787, 790, 793, 796, 799, 802, 805, 808, 811, 814, 817, 820, 823, 826, 829, 832, 835, 838, 841, 844, 847, 850, 853, 856, 859, 862, 865, 868, 871, 874, 877, 880, 883, 886, 889, 892, 895, 898, 901, 904, 907, 910, 913, 916, 919, 922, 925, 928, 931, 934, 937, 940, 943, 946, 949, 952, 955, 958, 961, 964, 967, 970, 973, 976, 979, 982, 985, 988, 991, 994, 997, 1000&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Count Files in Directory on Linux</title>
      <link>https://andrewodendaal.com/how-to-count-files-in-directory-on-linux/</link>
      <pubDate>Wed, 20 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-count-files-in-directory-on-linux/</guid>
      <description>&lt;p&gt;If you need to count how many files are in a directory on Linux, then you can use a combination of the &lt;code&gt;ls&lt;/code&gt; command to list all the files, and the &lt;code&gt;wc&lt;/code&gt; command to count how many lines are printed:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-wc&#34;&gt;Option 1 – Using &lt;code&gt;wc&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ls | wc -l&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can specify a directory as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ls &amp;lt;directory&amp;gt; | wc -l&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-find&#34;&gt;Option 2 – Using &lt;code&gt;find&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;You can count files recursively by using the &lt;code&gt;find&lt;/code&gt; command:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Read a File Line by Line in Java</title>
      <link>https://andrewodendaal.com/how-to-read-a-file-line-by-line-in-java/</link>
      <pubDate>Tue, 19 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-read-a-file-line-by-line-in-java/</guid>
      <description>&lt;p&gt;If you need to read a file line by line in Java, then you can use one of the following three (3) options.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1&#34;&gt;Option 1&lt;/h2&gt;&#xA;&lt;p&gt;You can use the &lt;code&gt;FileReader&lt;/code&gt; and &lt;code&gt;BufferedReader&lt;/code&gt; packages as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;File file = new File(&amp;#34;./your/file.txt&amp;#34;);&#xA;&#xA;try (FileReader fr = new FileReader(file);&#xA;  BufferedReader br = new BufferedReader(fr);) {&#xA;  String line;&#xA;  while ((line = br.readLine()) != null) {&#xA;    System.out.println(line);&#xA;  }&#xA;} catch (IOException e) {&#xA;  e.printStackTrace();&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2&#34;&gt;Option 2&lt;/h2&gt;&#xA;&lt;p&gt;You can also read the lines using &lt;code&gt;Files&lt;/code&gt; and &lt;code&gt;Paths&lt;/code&gt; as follows:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How can I clear or empty a StringBuilder</title>
      <link>https://andrewodendaal.com/how-can-i-clear-or-empty-a-stringbuilder/</link>
      <pubDate>Mon, 18 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-can-i-clear-or-empty-a-stringbuilder/</guid>
      <description>&lt;p&gt;You can use Java&amp;rsquo;s &lt;code&gt;StringBuilder&lt;/code&gt; to create and manipulate &lt;code&gt;Strings&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;StringBuilder sb = new StringBuilder();&#xA;sb.append(&amp;#34;Some&amp;#34;).append(&amp;#34; &amp;#34;).append(&amp;#34;String&amp;#34;);&#xA;System.out.println(sb.toString());&#xA;&#xA;// &amp;#34;Some String&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following three (3) options allow you to clear or empty a StringBuilder.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-setlength&#34;&gt;Option 1 – using &lt;code&gt;setLength&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sb.setLength(0);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-reinstantiating&#34;&gt;Option 2 – reinstantiating&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sb = new StringBuilder();&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-delete&#34;&gt;Option 3 – using &lt;code&gt;delete&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sb.delete(0, sb.length());&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Approve a SageMaker model in AWS CLI</title>
      <link>https://andrewodendaal.com/how-to-approve-a-sagemaker-model-in-aws-cli/</link>
      <pubDate>Sun, 17 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-approve-a-sagemaker-model-in-aws-cli/</guid>
      <description>&lt;p&gt;Sometimes you will need to manually approve a SageMaker model package from the AWS CLI.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-get-a-list-of-the-available-packages&#34;&gt;Step 1 – Get a list of the available packages&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws sagemaker list-model-packages --model-package-group-name &amp;#34;the-model-package-group&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will produce the following output:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&#xA;  &amp;#34;ModelPackageSummaryList&amp;#34;: [&#xA;    {&#xA;      &amp;#34;ModelPackageGroupName&amp;#34;: &amp;#34;...&amp;#34;,&#xA;      &amp;#34;ModelPackageVersion&amp;#34;: &amp;#34;...&amp;#34;,&#xA;      &amp;#34;ModelPackageArn&amp;#34;: &amp;#34;the-arn-we-will-use-below&amp;#34;,&#xA;      &amp;#34;ModelPackageDescription&amp;#34;: &amp;#34;...&amp;#34;,&#xA;      &amp;#34;CreationTime&amp;#34;: &amp;#34;...&amp;#34;,&#xA;      &amp;#34;ModelPackageStatus&amp;#34;: &amp;#34;Completed&amp;#34;,&#xA;      &amp;#34;ModelApprovalStatus&amp;#34;: &amp;#34;PendingManualApproval&amp;#34;&#xA;    },&#xA;    ...&#xA;  ]&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-approve-the-model&#34;&gt;Step 2 – Approve the model&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws sagemaker update-model-package --model-package-arn &amp;lt;ARN-FROM-ABOVE&amp;gt; --model-approval-status Approved&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Assume Role across Accounts in AWS</title>
      <link>https://andrewodendaal.com/how-to-assume-role-across-accounts-in-aws/</link>
      <pubDate>Sat, 16 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-assume-role-across-accounts-in-aws/</guid>
      <description>&lt;p&gt;If you need to assume role between AWS accounts, or allow an account to assume a role and use resources in another AWS account, then you need to create a role and attach the following policy.&lt;/p&gt;&#xA;&lt;p&gt;The following two (2) steps creates a &lt;code&gt;Trust Relationship&lt;/code&gt; between the accounts.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-in-the-source-account&#34;&gt;Step 1 – In the &lt;code&gt;Source&lt;/code&gt; Account&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&#xA;  &amp;#34;Version&amp;#34;: &amp;#34;2012-10-17&amp;#34;,&#xA;  &amp;#34;Statement&amp;#34;: [{&#xA;    &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,&#xA;    &amp;#34;Action&amp;#34;: [&#xA;      &amp;#34;sts:AssumeRole&amp;#34;&#xA;    ],&#xA;    &amp;#34;Resource&amp;#34;: [&#xA;      &amp;#34;arn:aws:iam::DESTINATION-ACCOUNT-ID:role/DESTINATION-ROLENAME&amp;#34;&#xA;    ]&#xA;  }]&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-in-the-destination-account&#34;&gt;Step 2 – In the &lt;code&gt;Destination&lt;/code&gt; Account&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&#xA;  &amp;#34;Version&amp;#34;: &amp;#34;2012-10-17&amp;#34;,&#xA;  &amp;#34;Statement&amp;#34;: [{&#xA;    &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,&#xA;    &amp;#34;Principal&amp;#34;: {&#xA;      &amp;#34;AWS&amp;#34;: &amp;#34;arn:aws:iam::SOURCE-ACCOUNT-ID:role/SOURCE-USERNAME&amp;#34;&#xA;    },&#xA;    &amp;#34;Action&amp;#34;: &amp;#34;sts:AssumeRole&amp;#34;&#xA;  }]&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Style an Element using Javascript</title>
      <link>https://andrewodendaal.com/how-to-style-an-element-using-javascript/</link>
      <pubDate>Fri, 15 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-style-an-element-using-javascript/</guid>
      <description>&lt;p&gt;If you need to style an element using Javascript then you can use the &lt;code&gt;style&lt;/code&gt; object to support all your CSS needs.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;html&amp;gt;&#xA;  &amp;lt;body&amp;gt;&#xA;&#xA;    &amp;lt;p id=&amp;#34;p1&amp;#34;&amp;gt;Hello World!&amp;lt;/p&amp;gt;&#xA;&#xA;    &amp;lt;script&amp;gt;&#xA;      document.getElementById(&amp;#34;p1&amp;#34;).style.color = &amp;#34;red&amp;#34;;&#xA;    &amp;lt;/script&amp;gt;&#xA;&#xA;    &amp;lt;p&amp;gt;The paragraph above was changed by a script.&amp;lt;/p&amp;gt;&#xA;&#xA;  &amp;lt;/body&amp;gt;&#xA;&amp;lt;/html&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you need to do this purely in a Javascript file itself, then:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// Get a reference to the element&#xA;var myElement = document.querySelector(&amp;#34;#p1&amp;#34;);&#xA;&#xA;// Now you can update the CSS attributes&#xA;myElement.style.color = &amp;#34;red&amp;#34;;&#xA;myElement.style.backgroundColor = &amp;#34;yellow&amp;#34;;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note that where CSS properties would use &lt;code&gt;dashes&lt;/code&gt; to separate words, like &lt;code&gt;background-color&lt;/code&gt;, Javascript instead uses camel casing and drops the space.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Wait 1 Second in Javascript</title>
      <link>https://andrewodendaal.com/how-to-wait-1-second-in-javascript/</link>
      <pubDate>Thu, 14 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-wait-1-second-in-javascript/</guid>
      <description>&lt;p&gt;If you need your Javascript code to wait one (1) second (or more) while executing, then there are a couple of ways to achieve this.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-creating-a-delay-promise&#34;&gt;Option 1 – Creating a &lt;code&gt;delay&lt;/code&gt; Promise&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function delay(time) {&#xA;  return new Promise(resolve =&amp;gt; setTimeout(resolve, time));&#xA;}&#xA;&#xA;delay(1000).then(() =&amp;gt; console.log(&amp;#39;ran after 1 second elapsed&amp;#39;));&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-using-settimeout&#34;&gt;Option 2 – Using &lt;code&gt;setTimeout&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;setTimeout(function(){ &#xA;  console.log(&amp;#34;Ready&amp;#34;)&#xA;}, 1000);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-using-an-async-promise&#34;&gt;Option 3 – Using an &lt;code&gt;async&lt;/code&gt; Promise&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;async function test() {&#xA;  console.log(&amp;#39;start timer&amp;#39;);&#xA;  await new Promise(resolve =&amp;gt; setTimeout(resolve, 1000));&#xA;  console.log(&amp;#39;after 1 second&amp;#39;);&#xA;}&#xA;&#xA;test();&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-4-8211-creating-a-custom-sleep-function&#34;&gt;Option 4 – Creating a custom &lt;code&gt;sleep&lt;/code&gt; function&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function sleep(num) {&#xA;  let now = new Date();&#xA;  const stop = now.getTime() + num;&#xA;  while(true) {&#xA;    now = new Date();&#xA;    if(now.getTime() &amp;gt; stop) return;&#xA;  }&#xA;}&#xA;&#xA;sleep(1000)&#xA;console.log(&amp;#39;delay 1 second&amp;#39;);&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to use forEach method in Javascript</title>
      <link>https://andrewodendaal.com/how-to-use-foreach-method-in-javascript/</link>
      <pubDate>Wed, 13 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-use-foreach-method-in-javascript/</guid>
      <description>&lt;p&gt;Arrays come with a useful &lt;code&gt;forEach&lt;/code&gt; function that allows you to loop through the array.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var colors = [&amp;#39;red&amp;#39;, &amp;#39;blue&amp;#39;, &amp;#39;green&amp;#39;];&#xA;&#xA;colors.forEach(function(color) {&#xA;  console.log(color);&#xA;});&#xA;&#xA;// red&#xA;// blue&#xA;// green&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can also get the &lt;code&gt;index&lt;/code&gt; in each loop as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;const colors = [&amp;#39;red&amp;#39;, &amp;#39;blue&amp;#39;, &amp;#39;green&amp;#39;];&#xA;&#xA;colors.forEach((item, index)=&amp;gt;{&#xA;  console.log(index, item)&#xA;});&#xA;&#xA;// 0 &amp;#39;red&amp;#39;&#xA;// 1 &amp;#39;blue&amp;#39;&#xA;// 2 &amp;#39;green&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Remove an Element from an Array in Javascript</title>
      <link>https://andrewodendaal.com/how-to-remove-an-element-from-an-array-in-javascript/</link>
      <pubDate>Tue, 12 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-remove-an-element-from-an-array-in-javascript/</guid>
      <description>&lt;p&gt;If you need to remove an element from an array in Javascript, then you can use one of the following five (5) options:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-use-splice-to-remove-an-element&#34;&gt;Option 1 – Use &lt;code&gt;splice&lt;/code&gt; to remove an element&lt;/h2&gt;&#xA;&lt;p&gt;Example 1 using &lt;code&gt;splice&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var colors = [&amp;#34;red&amp;#34;,&amp;#34;blue&amp;#34;,&amp;#34;car&amp;#34;,&amp;#34;green&amp;#34;];&#xA;var carIndex = colors.indexOf(&amp;#34;car&amp;#34;);&#xA;colors.splice(carIndex, 1);&#xA;&#xA;// colors = [&amp;#34;red&amp;#34;,&amp;#34;blue&amp;#34;,&amp;#34;green&amp;#34;]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Example 2 using &lt;code&gt;splice&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var myArray = [&amp;#34;Sunday&amp;#34;, &amp;#34;Monday&amp;#34;, &amp;#34;Tuesday&amp;#34;, &amp;#34;Wednesday&amp;#34;, &amp;#34;Thursday&amp;#34;, &amp;#34;Friday&amp;#34;, &amp;#34;Saturday&amp;#34;];&#xA;&#xA;// Remove Sunday -- index 0 and Monday -- index 1&#xA;myArray.splice(0,2)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-use-filter-to-remove-an-element&#34;&gt;Option 2 – Use &lt;code&gt;filter&lt;/code&gt; to remove an element&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var myArray = [&amp;#34;Sunday&amp;#34;, &amp;#34;Monday&amp;#34;, &amp;#34;Tuesday&amp;#34;, &amp;#34;Wednesday&amp;#34;, &amp;#34;Thursday&amp;#34;, &amp;#34;Friday&amp;#34;, &amp;#34;Saturday&amp;#34;];&#xA;let itemToBeRemoved = [&amp;#34;Sunday&amp;#34;, &amp;#34;Monday&amp;#34;]&#xA;var filteredArray = myArray.filter(item =&amp;gt; !itemToBeRemoved.includes(item))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-use-pop-to-remove-an-element&#34;&gt;Option 3 – Use &lt;code&gt;pop&lt;/code&gt; to remove an element&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;let dailyActivities = [&amp;#39;work&amp;#39;, &amp;#39;eat&amp;#39;, &amp;#39;sleep&amp;#39;, &amp;#39;exercise&amp;#39;];&#xA;&#xA;// remove the last element&#xA;dailyActivities.pop();&#xA;console.log(dailyActivities); // [&amp;#39;work&amp;#39;, &amp;#39;eat&amp;#39;, &amp;#39;sleep&amp;#39;]&#xA;&#xA;// remove the last element from [&amp;#39;work&amp;#39;, &amp;#39;eat&amp;#39;, &amp;#39;sleep&amp;#39;]&#xA;const removedElement = dailyActivities.pop();&#xA;&#xA;// get removed element&#xA;console.log(removedElement); // &amp;#39;sleep&amp;#39;&#xA;console.log(dailyActivities);  // [&amp;#39;work&amp;#39;, &amp;#39;eat&amp;#39;]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-4-8211-use-remove-to-remove-an-element&#34;&gt;Option 4 – Use &lt;code&gt;remove&lt;/code&gt; to remove an element&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;array.remove(number);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-5-8211-change-length-to-remove-elements&#34;&gt;Option 5 – Change &lt;code&gt;length&lt;/code&gt; to remove elements&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var arr = [1, 2, 3, 4, 5, 6];&#xA;&#xA;arr.length = 4;&#xA;&#xA;// [1, 2, 3, 4]&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to get the Alphabet as Array in Javascript</title>
      <link>https://andrewodendaal.com/how-to-get-the-alphabet-as-array-in-javascript/</link>
      <pubDate>Mon, 11 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-alphabet-as-array-in-javascript/</guid>
      <description>&lt;p&gt;If you need to get an array of alphabetical letters in Javascript then you can use one of the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-explicitly-define-the-array-first&#34;&gt;Option 1 – Explicitly define the array first&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;const alphabet = [&amp;#34;a&amp;#34;,&amp;#34;b&amp;#34;,&amp;#34;c&amp;#34;,&amp;#34;d&amp;#34;,&amp;#34;e&amp;#34;,&amp;#34;f&amp;#34;,&amp;#34;g&amp;#34;,&amp;#34;h&amp;#34;,&amp;#34;i&amp;#34;,&amp;#34;j&amp;#34;,&amp;#34;k&amp;#34;,&amp;#34;l&amp;#34;,&amp;#34;m&amp;#34;,&amp;#34;n&amp;#34;,&amp;#34;o&amp;#34;,&amp;#34;p&amp;#34;,&amp;#34;q&amp;#34;,&amp;#34;r&amp;#34;,&amp;#34;s&amp;#34;,&amp;#34;t&amp;#34;,&amp;#34;u&amp;#34;,&amp;#34;v&amp;#34;,&amp;#34;w&amp;#34;,&amp;#34;x&amp;#34;,&amp;#34;y&amp;#34;,&amp;#34;z&amp;#34;];&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-split-a-string-of-alphabetical-characters&#34;&gt;Option 2 – Split a string of alphabetical characters&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;const alphabetArray = &amp;#34;abcdefghijklmnopqrstuvwxyz&amp;#34;.split(&amp;#34;&amp;#34;);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-split-a-string-and-uppercase-characters&#34;&gt;Option 3 – Split a string and UpperCase characters&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;const alphabetArrayUp = toUpperCase(&amp;#34;abcdefghijklmnopqrstuvwxyz&amp;#34;).split(&amp;#34;&amp;#34;);&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>The Power of Two (2) Table</title>
      <link>https://andrewodendaal.com/the-power-of-two-2-table/</link>
      <pubDate>Sun, 10 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-power-of-two-2-table/</guid>
      <description>&lt;p&gt;With the &lt;strong&gt;Power of Two&lt;/strong&gt;, you can ask the following:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How do you find the powers of 2?&lt;/li&gt;&#xA;&lt;li&gt;What does the power of 2 stand for?&lt;/li&gt;&#xA;&lt;li&gt;How much is the power of 2?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;the-power-of-two-2-table-powers-of-two&#34;&gt;The Power of Two (2) Table (Powers of Two)&lt;/h2&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;&lt;strong&gt;Power&lt;/strong&gt;&lt;/th&gt;&#xA;          &lt;th&gt;&lt;strong&gt;Value&lt;/strong&gt;&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;/td&gt;&#xA;          &lt;td&gt;1&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;1&lt;/td&gt;&#xA;          &lt;td&gt;2&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;2&lt;/td&gt;&#xA;          &lt;td&gt;4&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;3&lt;/td&gt;&#xA;          &lt;td&gt;8&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;4&lt;/td&gt;&#xA;          &lt;td&gt;16&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;5&lt;/td&gt;&#xA;          &lt;td&gt;32&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;6&lt;/td&gt;&#xA;          &lt;td&gt;64&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;7&lt;/td&gt;&#xA;          &lt;td&gt;128&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;8&lt;/td&gt;&#xA;          &lt;td&gt;256&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;9&lt;/td&gt;&#xA;          &lt;td&gt;512&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;10&lt;/td&gt;&#xA;          &lt;td&gt;1,024&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;11&lt;/td&gt;&#xA;          &lt;td&gt;2,048&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;12&lt;/td&gt;&#xA;          &lt;td&gt;4,096&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;13&lt;/td&gt;&#xA;          &lt;td&gt;8,192&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;14&lt;/td&gt;&#xA;          &lt;td&gt;16,384&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;15&lt;/td&gt;&#xA;          &lt;td&gt;32,768&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;16&lt;/td&gt;&#xA;          &lt;td&gt;65,536&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;17&lt;/td&gt;&#xA;          &lt;td&gt;131,072&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;18&lt;/td&gt;&#xA;          &lt;td&gt;262,144&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;19&lt;/td&gt;&#xA;          &lt;td&gt;524,288&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;20&lt;/td&gt;&#xA;          &lt;td&gt;1,048,576&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;21&lt;/td&gt;&#xA;          &lt;td&gt;2,097,152&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;22&lt;/td&gt;&#xA;          &lt;td&gt;4,194,304&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;23&lt;/td&gt;&#xA;          &lt;td&gt;8,388,608&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;24&lt;/td&gt;&#xA;          &lt;td&gt;16,777,216&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;25&lt;/td&gt;&#xA;          &lt;td&gt;33,554,432&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;26&lt;/td&gt;&#xA;          &lt;td&gt;67,108,864&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;27&lt;/td&gt;&#xA;          &lt;td&gt;134,217,728&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;28&lt;/td&gt;&#xA;          &lt;td&gt;268,435,456&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;29&lt;/td&gt;&#xA;          &lt;td&gt;536,870,912&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;30&lt;/td&gt;&#xA;          &lt;td&gt;1,073,741,824&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;31&lt;/td&gt;&#xA;          &lt;td&gt;2,147,483,648&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;32&lt;/td&gt;&#xA;          &lt;td&gt;4,294,967,296&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;33&lt;/td&gt;&#xA;          &lt;td&gt;8,589,934,592&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;34&lt;/td&gt;&#xA;          &lt;td&gt;17,179,869,184&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;35&lt;/td&gt;&#xA;          &lt;td&gt;34,359,738,368&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;36&lt;/td&gt;&#xA;          &lt;td&gt;68,719,476,736&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;37&lt;/td&gt;&#xA;          &lt;td&gt;137,438,953,472&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;38&lt;/td&gt;&#xA;          &lt;td&gt;274,877,906,944&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;39&lt;/td&gt;&#xA;          &lt;td&gt;549,755,813,888&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;40&lt;/td&gt;&#xA;          &lt;td&gt;1,099,511,627,776&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;41&lt;/td&gt;&#xA;          &lt;td&gt;2,199,023,255,552&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;42&lt;/td&gt;&#xA;          &lt;td&gt;4,398,046,511,104&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;43&lt;/td&gt;&#xA;          &lt;td&gt;8,796,093,022,208&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;44&lt;/td&gt;&#xA;          &lt;td&gt;17,592,186,044,416&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;45&lt;/td&gt;&#xA;          &lt;td&gt;35,184,372,088,832&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;46&lt;/td&gt;&#xA;          &lt;td&gt;70,368,744,177,664&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;47&lt;/td&gt;&#xA;          &lt;td&gt;140,737,488,355,328&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;48&lt;/td&gt;&#xA;          &lt;td&gt;281,474,976,710,656&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;49&lt;/td&gt;&#xA;          &lt;td&gt;562,949,953,421,312&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;50&lt;/td&gt;&#xA;          &lt;td&gt;1,125,899,906,842,624&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;51&lt;/td&gt;&#xA;          &lt;td&gt;2,251,799,813,685,248&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;52&lt;/td&gt;&#xA;          &lt;td&gt;4,503,599,627,370,496&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;53&lt;/td&gt;&#xA;          &lt;td&gt;9,007,199,254,740,992&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;54&lt;/td&gt;&#xA;          &lt;td&gt;18,014,398,509,481,984&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;55&lt;/td&gt;&#xA;          &lt;td&gt;36,028,797,018,963,968&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;56&lt;/td&gt;&#xA;          &lt;td&gt;72,057,594,037,927,936&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;57&lt;/td&gt;&#xA;          &lt;td&gt;144,115,188,075,855,872&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;58&lt;/td&gt;&#xA;          &lt;td&gt;288,230,376,151,711,744&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;59&lt;/td&gt;&#xA;          &lt;td&gt;576,460,752,303,423,488&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;60&lt;/td&gt;&#xA;          &lt;td&gt;1,152,921,504,606,846,976&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;61&lt;/td&gt;&#xA;          &lt;td&gt;2,305,843,009,213,693,952&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;62&lt;/td&gt;&#xA;          &lt;td&gt;4,611,686,018,427,387,904&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;63&lt;/td&gt;&#xA;          &lt;td&gt;9,223,372,036,854,775,808&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;64&lt;/td&gt;&#xA;          &lt;td&gt;18,446,744,073,709,551,616&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;65&lt;/td&gt;&#xA;          &lt;td&gt;36,893,488,147,419,103,232&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;66&lt;/td&gt;&#xA;          &lt;td&gt;73,786,976,294,838,206,464&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;67&lt;/td&gt;&#xA;          &lt;td&gt;147,573,952,589,676,412,928&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;68&lt;/td&gt;&#xA;          &lt;td&gt;295,147,905,179,352,825,856&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;69&lt;/td&gt;&#xA;          &lt;td&gt;590,295,810,358,705,651,712&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;70&lt;/td&gt;&#xA;          &lt;td&gt;1,180,591,620,717,411,303,424&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;71&lt;/td&gt;&#xA;          &lt;td&gt;2,361,183,241,434,822,606,848&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;72&lt;/td&gt;&#xA;          &lt;td&gt;4,722,366,482,869,645,213,696&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;73&lt;/td&gt;&#xA;          &lt;td&gt;9,444,732,965,739,290,427,392&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;74&lt;/td&gt;&#xA;          &lt;td&gt;18,889,465,931,478,580,854,784&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;75&lt;/td&gt;&#xA;          &lt;td&gt;37,778,931,862,957,161,709,568&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;76&lt;/td&gt;&#xA;          &lt;td&gt;75,557,863,725,914,323,419,136&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;77&lt;/td&gt;&#xA;          &lt;td&gt;151,115,727,451,828,646,838,272&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;78&lt;/td&gt;&#xA;          &lt;td&gt;302,231,454,903,657,293,676,544&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;79&lt;/td&gt;&#xA;          &lt;td&gt;604,462,909,807,314,587,353,088&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;80&lt;/td&gt;&#xA;          &lt;td&gt;1,208,925,819,614,629,174,706,176&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;81&lt;/td&gt;&#xA;          &lt;td&gt;2,417,851,639,229,258,349,412,352&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;82&lt;/td&gt;&#xA;          &lt;td&gt;4,835,703,278,458,516,698,824,704&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;83&lt;/td&gt;&#xA;          &lt;td&gt;9,671,406,556,917,033,397,649,408&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;84&lt;/td&gt;&#xA;          &lt;td&gt;19,342,813,113,834,066,795,298,816&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;85&lt;/td&gt;&#xA;          &lt;td&gt;38,685,626,227,668,133,590,597,632&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;86&lt;/td&gt;&#xA;          &lt;td&gt;77,371,252,455,336,267,181,195,264&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;87&lt;/td&gt;&#xA;          &lt;td&gt;154,742,504,910,672,534,362,390,528&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;88&lt;/td&gt;&#xA;          &lt;td&gt;309,485,009,821,345,068,724,781,056&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;89&lt;/td&gt;&#xA;          &lt;td&gt;618,970,019,642,690,137,449,562,112&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;90&lt;/td&gt;&#xA;          &lt;td&gt;1,237,940,039,285,380,274,899,124,224&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;91&lt;/td&gt;&#xA;          &lt;td&gt;2,475,880,078,570,760,549,798,248,448&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;92&lt;/td&gt;&#xA;          &lt;td&gt;4,951,760,157,141,521,099,596,496,896&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;93&lt;/td&gt;&#xA;          &lt;td&gt;9,903,520,314,283,042,199,192,993,792&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;94&lt;/td&gt;&#xA;          &lt;td&gt;19,807,040,628,566,084,398,385,987,584&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;95&lt;/td&gt;&#xA;          &lt;td&gt;39,614,081,257,132,168,796,771,975,168&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;96&lt;/td&gt;&#xA;          &lt;td&gt;79,228,162,514,264,337,593,543,950,336&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;97&lt;/td&gt;&#xA;          &lt;td&gt;158,456,325,028,528,675,187,087,900,672&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;98&lt;/td&gt;&#xA;          &lt;td&gt;316,912,650,057,057,350,374,175,801,344&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;99&lt;/td&gt;&#xA;          &lt;td&gt;633,825,300,114,114,700,748,351,602,688&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;100&lt;/td&gt;&#xA;          &lt;td&gt;1,267,650,600,228,229,401,496,703,205,376&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;h2 id=&#34;the-power-of-two-2-tables-from-1-to-100&#34;&gt;The Power of Two (2) Tables from 1 to 100&lt;/h2&gt;&#xA;&lt;p&gt;Below you will find the Power of Two (2) tables from 1 to 100.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get the Screen Width in Javascript</title>
      <link>https://andrewodendaal.com/how-to-get-the-screen-width-in-javascript/</link>
      <pubDate>Sat, 09 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-screen-width-in-javascript/</guid>
      <description>&lt;p&gt;Javascript gives a few options to determine the screen width.&lt;/p&gt;&#xA;&lt;p&gt;When we say &lt;code&gt;screen&lt;/code&gt;, we mean the browser window&amp;rsquo;s width itself.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-using-native-javascript&#34;&gt;Option 1 – Using Native Javascript&lt;/h2&gt;&#xA;&lt;p&gt;Using native Javascript objects, we can find the innerWidth and innerHeight:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var w = window.innerWidth;&#xA;var h = window.innerHeight;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The window object also allows for:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;window.screen.width&#xA;// or simply&#xA;screen.width&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We can write some code to tell us the width and height with fallbacks:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var win = window,&#xA;    doc = document,&#xA;    docElem = doc.documentElement,&#xA;    body = doc.getElementsByTagName(&amp;#39;body&amp;#39;)[0],&#xA;    x = win.innerWidth || docElem.clientWidth || body.clientWidth,&#xA;    y = win.innerHeight|| docElem.clientHeight|| body.clientHeight;&#xA;alert(x + &amp;#39; × &amp;#39; + y);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-get-width-using-jquery&#34;&gt;Option 2 – Get Width using jQuery&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$(window).width()&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can use this as follows:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Read a File in Rust</title>
      <link>https://andrewodendaal.com/how-to-read-a-file-in-rust/</link>
      <pubDate>Fri, 08 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-read-a-file-in-rust/</guid>
      <description>&lt;p&gt;If you need to read a file in Rust, then you can use the &lt;code&gt;fs&lt;/code&gt; package from the standard library:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;use std::fs;&#xA;&#xA;fn main() {&#xA;    let contents = fs::read_to_string(filename)&#xA;        .expect(&amp;#34;Something went wrong reading the file&amp;#34;);&#xA;&#xA;    println!(&amp;#34;With text:\n{}&amp;#34;, contents);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Convert Array to String in Java</title>
      <link>https://andrewodendaal.com/how-to-convert-array-to-string-in-java/</link>
      <pubDate>Thu, 07 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-array-to-string-in-java/</guid>
      <description>&lt;p&gt;If you need to convert an array to a string in Java, then you could look at a solution like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;String stringArray[] = {&amp;#34;Hello &amp;#34;, &amp;#34; world&amp;#34;, &amp;#34; this&amp;#34;, &amp;#34; is&amp;#34;, &amp;#34; a&amp;#34;, &amp;#34; test&amp;#34;};&#xA;StringBuffer sb = new StringBuffer();&#xA;for(int i = 0; i &amp;lt; stringArray.length; i++) {&#xA;   sb.append(stringArray[i]);&#xA;}&#xA;String str = sb.toString();&#xA;System.out.println(str);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Or you could do something simple like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;String str = String.join(&amp;#34;,&amp;#34;, arr);&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Join Two Strings Together in Golang</title>
      <link>https://andrewodendaal.com/how-to-join-two-strings-together-in-golang/</link>
      <pubDate>Wed, 06 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-join-two-strings-together-in-golang/</guid>
      <description>&lt;p&gt;If you need to join two (2) strings together in Golang, you can do the following, using the &lt;code&gt;+&lt;/code&gt; concatenation operator:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;import ( &amp;#34;fmt&amp;#34;)&#xA;&#xA;func main() {  &#xA;  message1 := &amp;#34;Join Strings&amp;#34;&#xA;  message2 := &amp;#34;Together&amp;#34;&#xA;&#xA;  result := message1 + &amp;#34; &amp;#34; + message2&#xA;&#xA;  fmt.Println(result)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Recursively Delete all Files in an AWS S3 Bucket</title>
      <link>https://andrewodendaal.com/how-to-recursively-delete-all-files-in-an-aws-s3-bucket/</link>
      <pubDate>Tue, 05 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-recursively-delete-all-files-in-an-aws-s3-bucket/</guid>
      <description>&lt;p&gt;If you need to recursively delete all files in an AWS S3 bucket, then you can do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws s3 rm --recursive s3://your-bucket-name/foo/bar/&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you only want to delete an specific object from AWS S3:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws s3 rm s3://your-bucket-name/foo/bar/item.txt&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Execute Linux Commands in Golang</title>
      <link>https://andrewodendaal.com/how-to-execute-linux-commands-in-golang/</link>
      <pubDate>Mon, 04 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-execute-linux-commands-in-golang/</guid>
      <description>&lt;p&gt;If you want to execute linux commands in Golang, then you can use &lt;code&gt;exec.Command&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;cmd := exec.Command(&amp;#34;echo&amp;#34;, &amp;#34;hello world&amp;#34;)&#xA;res, _ := cmd.CombinedOutput()&#xA;fmt.Println(string(res))&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Check for Prime Numbers using Golang</title>
      <link>https://andrewodendaal.com/how-to-check-for-prime-numbers-using-golang/</link>
      <pubDate>Sun, 03 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-check-for-prime-numbers-using-golang/</guid>
      <description>&lt;p&gt;If you need to check for Prime Numbers in Golang, then you can use the following method:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;const n = 1212121&#xA;if big.NewInt(n).ProbablyPrime(0) {&#xA;  fmt.Println(n, &amp;#34;is prime&amp;#34;)&#xA;} else {&#xA;  fmt.Println(n, &amp;#34;is not prime&amp;#34;)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Raise a Number to a Power in Golang</title>
      <link>https://andrewodendaal.com/how-to-raise-a-number-to-a-power-in-golang/</link>
      <pubDate>Sat, 02 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-raise-a-number-to-a-power-in-golang/</guid>
      <description>&lt;p&gt;If you need to raise a number to a power in Golang, then you can use the &lt;code&gt;math.Pow&lt;/code&gt; function:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main  &#xA;import (&#xA;  &amp;#34;math&amp;#34;  &#xA;)  &#xA;  &#xA;func main() {  &#xA;  var exponent, base float64&#xA;  output := math.Pow(base, exponent)  &#xA;}  &#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to get CPU Frequency in Linux</title>
      <link>https://andrewodendaal.com/how-to-get-cpu-frequency-in-linux/</link>
      <pubDate>Fri, 01 Jul 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-cpu-frequency-in-linux/</guid>
      <description>&lt;p&gt;If you need to get the CPU Frequency in Linux, then you can run the following command:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;watch -n.1 &amp;#34;grep \&amp;#34;^[c]pu MHz\&amp;#34; /proc/cpuinfo&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Disable Warning with Python Pandas</title>
      <link>https://andrewodendaal.com/how-to-disable-warning-with-python-pandas/</link>
      <pubDate>Thu, 30 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-disable-warning-with-python-pandas/</guid>
      <description>&lt;p&gt;How can python pandas disable warnings?&lt;/p&gt;&#xA;&lt;p&gt;If you need to disable warnings with Pandas on Python, then you can use the &lt;code&gt;warnings&lt;/code&gt; module and ignore the filter as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import warnings&#xA;warnings.filterwarnings(&amp;#39;ignore&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Get all Caps Alphabet as List in Python</title>
      <link>https://andrewodendaal.com/how-to-all-caps-alphabet-as-list-in-python/</link>
      <pubDate>Wed, 29 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-all-caps-alphabet-as-list-in-python/</guid>
      <description>&lt;p&gt;If we take the following list:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[&amp;#39;a&amp;#39;, &amp;#39;b&amp;#39;, &amp;#39;c&amp;#39;, &amp;#39;d&amp;#39;, &amp;#39;e&amp;#39;, &amp;#39;f&amp;#39;, &amp;#39;g&amp;#39;, &amp;#39;h&amp;#39;, &amp;#39;i&amp;#39;, &amp;#39;j&amp;#39;, &amp;#39;k&amp;#39;, &amp;#39;l&amp;#39;, &amp;#39;m&amp;#39;, &amp;#39;n&amp;#39;, &amp;#39;o&amp;#39;, &amp;#39;p&amp;#39;, &amp;#39;q&amp;#39;, &amp;#39;r&amp;#39;, &amp;#39;s&amp;#39;, &amp;#39;t&amp;#39;, &amp;#39;u&amp;#39;, &amp;#39;v&amp;#39;, &amp;#39;w&amp;#39;, &amp;#39;x&amp;#39;, &amp;#39;y&amp;#39;, &amp;#39;z&amp;#39;]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;How do we extract only the UpperCase letters of a given word?&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-get-only-the-capital-letters-from-a-string&#34;&gt;How to get only the Capital Letters from a String&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;word = &amp;#39;AbcDefgHijkL&amp;#39;&#xA;result = re.findall(&amp;#39;([A-Z])&amp;#39;, word)&#xA;print(result)&#xA;# [&amp;#39;A&amp;#39;, &amp;#39;D&amp;#39;, &amp;#39;H&amp;#39;, &amp;#39;L&amp;#39;]&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>[Solved] Error creating RDS DB Instance: IAM role ARN value is not value or does not include the required permissions for: ENHANCED_MONITORING</title>
      <link>https://andrewodendaal.com/solved-error-creating-rds-db-instance-iam-role-arn-value-is-not-value-or-does-not-include-the-required-permissions-for-enhanced_monitoring/</link>
      <pubDate>Tue, 28 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-error-creating-rds-db-instance-iam-role-arn-value-is-not-value-or-does-not-include-the-required-permissions-for-enhanced_monitoring/</guid>
      <description>&lt;p&gt;When you are trying to create an RDS database and you get the dreaded error message:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;IAM role ARN value is invalid or does not include the required permissions for: ENHANCED_MONITORING&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then you need to make sure that you are assuming the correct service principle:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;monitoring.rds.amazonaws.com&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Your code should look something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&#xA;  &amp;#34;Version&amp;#34;: &amp;#34;2012-10-17&amp;#34;,&#xA;  &amp;#34;Statement&amp;#34;: [&#xA;    {&#xA;      &amp;#34;Action&amp;#34;: &amp;#34;sts:AssumeRole&amp;#34;,&#xA;      &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,&#xA;      &amp;#34;Principal&amp;#34;: {&#xA;        &amp;#34;Service&amp;#34;: &amp;#34;cloudwatch.amazonaws.com&amp;#34;&#xA;      }&#xA;    },&#xA;    {&#xA;      &amp;#34;Action&amp;#34;: &amp;#34;sts:AssumeRole&amp;#34;,&#xA;      &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,&#xA;      &amp;#34;Principal&amp;#34;: {&#xA;        &amp;#34;Service&amp;#34;: &amp;#34;monitoring.rds.amazonaws.com&amp;#34;&#xA;      }&#xA;    }&#xA;  ]&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to create an AWS Lambda in Terraform</title>
      <link>https://andrewodendaal.com/how-to-create-an-aws-lambda-in-terraform/</link>
      <pubDate>Mon, 27 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-an-aws-lambda-in-terraform/</guid>
      <description>&lt;h2 id=&#34;step-1-8211-lambda-code-in-python&#34;&gt;Step 1 – Lambda Code in Python&lt;/h2&gt;&#xA;&lt;p&gt;The following code expects a python file with the contents as follows in a file called &lt;code&gt;python/script1.py&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def lambda_handler(event, context):&#xA;    return {&#xA;        &amp;#39;code&amp;#39;: 200,&#xA;        &amp;#39;message&amp;#39;: &amp;#39;Triggered&amp;#39;&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-lambda-code-in-terraform&#34;&gt;Step 2 – Lambda Code in Terraform&lt;/h2&gt;&#xA;&lt;p&gt;Now we create the &lt;code&gt;lambda.tf&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;data &amp;#34;archive_file&amp;#34; &amp;#34;zip_python_code_create&amp;#34; {&#xA;  type        = &amp;#34;zip&amp;#34;&#xA;  source_file = &amp;#34;python/script1.py&amp;#34;&#xA;  output_path = &amp;#34;python/script1.zip&amp;#34;&#xA;}&#xA;&#xA;resource &amp;#34;aws_lambda_function&amp;#34; &amp;#34;lambda_script1&amp;#34; {&#xA;  filename      = &amp;#34;python/script1.zip&amp;#34;&#xA;  function_name = &amp;#34;LambdaScript1&amp;#34;&#xA;  role          = aws_iam_role.lambda_role.arn&#xA;  description   = &amp;#34;LambdaScript1&amp;#34;&#xA;  handler       = &amp;#34;create.lambda_handler&amp;#34;&#xA;  runtime       = &amp;#34;python3.8&amp;#34;&#xA;  depends_on    = [aws_iam_role_policy_attachment.attach_iam_policy_to_iam_role]&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-3-8211-iam-and-permissions-in-terraform&#34;&gt;Step 3 – IAM and Permissions in Terraform&lt;/h2&gt;&#xA;&lt;p&gt;We need to specify the permissions for the Lambda:&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] Instance Profile already exists in Terraform</title>
      <link>https://andrewodendaal.com/solved-instance-profile-already-exists-in-terraform/</link>
      <pubDate>Sun, 26 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-instance-profile-already-exists-in-terraform/</guid>
      <description>&lt;p&gt;If you get the &lt;code&gt;Instance Profile already exists&lt;/code&gt; error when running your Terraform &lt;code&gt;apply&lt;/code&gt;, then it is either because an instance profile with that name already existed in the account, or because the previous &lt;code&gt;terraform destroy&lt;/code&gt; did not remove it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-identify-the-instance-profiles-in-the-account&#34;&gt;Step 1 – Identify the Instance Profiles in the account&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws iam list-instance-profiles&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-delete-the-instance-profiles&#34;&gt;Step 2 – Delete the Instance Profile/s&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws iam delete-instance-profile --instance-profile-name &amp;lt;name-of-instance-profile&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>[Solved] An error occurred (UnauthorizedException) when calling ListAccounts operation: Session token not found or invalid</title>
      <link>https://andrewodendaal.com/solved-an-error-occurred-unauthorizedexception-when-calling-listaccounts-operation-session-token-not-found-or-invalid/</link>
      <pubDate>Sat, 25 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-an-error-occurred-unauthorizedexception-when-calling-listaccounts-operation-session-token-not-found-or-invalid/</guid>
      <description>&lt;p&gt;If you are using &lt;code&gt;aws configure sso&lt;/code&gt; to populate your &lt;code&gt;~/.aws/credentials&lt;/code&gt; file and you get the following error when you try and reauthorize, then you can solve this problem as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;An error occurred (UnauthorizedException) when calling ListAccounts operation: Session token not found or invalid&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-1-8211-logout-from-sso&#34;&gt;Step 1 – Logout from SSO&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws sso logout&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-reconfigure-sso-with-previous-defaults&#34;&gt;Step 2 – Reconfigure SSO with previous defaults&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws configure sso&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Match Multiple Strings with grep</title>
      <link>https://andrewodendaal.com/how-to-match-multiple-strings-with-grep/</link>
      <pubDate>Fri, 24 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-match-multiple-strings-with-grep/</guid>
      <description>&lt;p&gt;If you need to match a string in a file, then &lt;code&gt;grep&lt;/code&gt; is your friend.&lt;/p&gt;&#xA;&lt;h2 id=&#34;an-example-of-using-grep&#34;&gt;An example of using &lt;code&gt;grep&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s take a file called &lt;code&gt;somefile.txt&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;this&#xA;is&#xA;a&#xA;test&#xA;that&#xA;looks&#xA;for&#xA;something&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We can look for the string &lt;code&gt;something&lt;/code&gt; in this file using &lt;code&gt;grep&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;cat somefile.txt | grep something&#xA;# something&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;But what if we want to look for both &lt;code&gt;something&lt;/code&gt; and &lt;code&gt;this&lt;/code&gt;?&lt;/p&gt;&#xA;&lt;h2 id=&#34;an-example-of-using-multiple-greps&#34;&gt;An example of using multiple &lt;code&gt;grep&lt;/code&gt;s&lt;/h2&gt;&#xA;&lt;p&gt;It&amp;rsquo;s pretty easy, we just pass the &lt;code&gt;-E&lt;/code&gt; flag, which is short for &lt;code&gt;--extended-regexp&lt;/code&gt;, and separate our strings with a pipe &lt;code&gt;|&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Invoke an AWS Lambda from the CLI</title>
      <link>https://andrewodendaal.com/how-to-invoke-an-aws-lambda-from-the-cli/</link>
      <pubDate>Thu, 23 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-invoke-an-aws-lambda-from-the-cli/</guid>
      <description>&lt;p&gt;If you want to invoke an AWS Lambda from your CLI, then the best option is to have the AWS CLI installed.&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Getting started with the AWS CLI – AWS Command Line Interface (amazon.com)&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Once this is installed, you can invoke Lambdas as follows:&lt;/p&gt;&#xA;&lt;h2 id=&#34;setting-your-aws-region&#34;&gt;Setting your AWS Region&lt;/h2&gt;&#xA;&lt;p&gt;It is recommended to always set your AWS region in an environment variable called &lt;code&gt;AWS_REGION&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Exit if a Bash Variable in Not Set</title>
      <link>https://andrewodendaal.com/how-to-exit-if-a-bash-variable-in-not-set/</link>
      <pubDate>Wed, 22 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-exit-if-a-bash-variable-in-not-set/</guid>
      <description>&lt;p&gt;Sometimes you might want to exit a command if a variable is not set in Bash.&lt;/p&gt;&#xA;&lt;p&gt;You can do this as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;if [ -z &amp;#34;$VARIABLE_NAME&amp;#34; ]; then echo &amp;#34;VARIABLE_NAME is not set&amp;#34;; exit 1; fi&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Force Gitlab pipeline to fail on condition</title>
      <link>https://andrewodendaal.com/how-to-force-gitlab-pipeline-to-fail-on-condition/</link>
      <pubDate>Tue, 21 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-force-gitlab-pipeline-to-fail-on-condition/</guid>
      <description>&lt;p&gt;if you have a conditional in your Gitlab pipeline stage that checks if something has succeeded or failed, then you can use this to pass or fail your pipeline stage.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-fail-on-string-found&#34;&gt;Option 1 – Fail on String Found&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;if cat log.txt | grep &amp;#34;Failure Summary&amp;#34; ; then exit 1 ; else exit 0 ; fi&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will fail the pipeline if it find a string matching &lt;code&gt;Failure Summary&lt;/code&gt; in a file called &lt;code&gt;log.txt&lt;/code&gt; in the current stage.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to run AWS CLI commands based on AWS CLI Version in Bash</title>
      <link>https://andrewodendaal.com/how-to-run-aws-cli-commands-based-on-aws-cli-version-in-bash/</link>
      <pubDate>Mon, 20 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-run-aws-cli-commands-based-on-aws-cli-version-in-bash/</guid>
      <description>&lt;p&gt;If you find yourself having the requirements to support both AWS CLI v1 and v2 simultaneously, then you can use the following conditional in Bash to only run the specific version required:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;AWS_VERSION=$(aws --version | gawk &amp;#39;{print $1}&amp;#39; | gawk -F/ &amp;#39;{print $2}&amp;#39; | gawk -F. &amp;#39;{print $1}&amp;#39;)&#xA;if [ AWS_VERSION == &amp;#34;1&amp;#34; ]&#xA;then&#xA;    aws lambda invoke --function-name YourFunction --payload $(echo &amp;#39;{&amp;#34;k&amp;#34;:&amp;#34;v&amp;#34;}&amp;#39;) response.json&#xA;else&#xA;    aws lambda invoke --function-name YourFunction --cli-binary-format raw-in-base64-out --payload &amp;#39;{&amp;#34;k&amp;#34;:&amp;#34;v&amp;#34;}&amp;#39; response.json&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This can be useful for deploying to environments where you cannot guarantee the AWS CLI version installed. Such as distributed pipelines, or customer environments.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] Unknown options: –cli-binary-format AWS CLI</title>
      <link>https://andrewodendaal.com/solved-unknown-options-cli-binary-format-aws-cli/</link>
      <pubDate>Sun, 19 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-unknown-options-cli-binary-format-aws-cli/</guid>
      <description>&lt;p&gt;If you have tried calling the AWS CLI and got the following error:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Unknown options: --cli-binary-format&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then it is because you are using the &lt;code&gt;AWS CLI v1&lt;/code&gt; and should be using the newer &lt;code&gt;AWS CLI v2&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Another error that you will see along with this is:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;An error occurred (InvalidRequestContentException) when calling the Invoke operation: Could not parse request body into json: Could not parse payload into json: Unrecognized token &amp;#39;eyJwYXRoIjoiJEdMAAAAIgfQo&amp;#39;: was expecting (JSON String, Number, Array, Object or token &amp;#39;null&amp;#39;, &amp;#39;true&amp;#39; or &amp;#39;false&amp;#39;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;an-example-that-fails-on-aws-cli-v1&#34;&gt;An example that fails on AWS CLI v1&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;aws lambda invoke --function-name YourFunction --cli-binary-format raw-in-base64-out --payload &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;{&amp;#34;yourKey&amp;#34;:&amp;#34;yourValue&amp;#34;}&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;how-to-fix-this-error-on-aws-cli-v1&#34;&gt;How to fix this error on AWS CLI v1&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;aws lambda invoke --function-name YourFunction --region eu-west-1 --payload &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;{&amp;#34;yourKey&amp;#34;:&amp;#34;yourValue&amp;#34;}&amp;#39;&lt;/span&gt; response.json&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;how-to-fix-this-error-by-upgrading-to-aws-cli-v2&#34;&gt;How to fix this error by Upgrading to AWS CLI v2&lt;/h2&gt;&#xA;&lt;p&gt;You can follow the guide directly to upgrade your CLI from v1 to v2 here &lt;a href=&#34;https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html&#34;&gt;Migrating from AWS CLI version 1 to version 2 – AWS Command Line Interface (amazon.com)&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Generate Random Strings with Dash in-between in Python</title>
      <link>https://andrewodendaal.com/how-to-generate-random-strings-with-dash-in-between-in-python/</link>
      <pubDate>Sat, 18 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-generate-random-strings-with-dash-in-between-in-python/</guid>
      <description>&lt;p&gt;If you need to generate a random string that looks something like this: &lt;code&gt;VUNBXJ-230411&lt;/code&gt;, then you can use the following random generator:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import random, string&#xA;&#xA;def generate_random_string_with_dash():&#xA;    rand = &amp;#34;{0}-{1}&amp;#34;.format(&amp;#39;&amp;#39;.join(random.choice(string.ascii_uppercase) for x in range(6)),&#xA;                            &amp;#39;&amp;#39;.join(random.choice(string.digits) for x in range(6)))&#xA;    return rand&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You simply call the above as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;print( generate_random_string_with_dash() )&#xA;# JJXFNS-420809&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you need to adjust the length of string A and B, then you can change the value in the &lt;code&gt;range&lt;/code&gt; above from something other than &lt;code&gt;6&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Check OS version and flavor in Linux</title>
      <link>https://andrewodendaal.com/how-to-check-os-version-in-linux/</link>
      <pubDate>Fri, 17 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-check-os-version-in-linux/</guid>
      <description>&lt;p&gt;If you need to check the version and flavour of the running Linux instance, then you can try the below commands:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;cat /etc/os-release&#xA;lsb_release -a&#xA;hostnamectl&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to use a Backend-Config File for Terraform S3 State Configuration</title>
      <link>https://andrewodendaal.com/how-to-use-a-backend-config-file-for-terraform-s3-state-configuration/</link>
      <pubDate>Thu, 16 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-use-a-backend-config-file-for-terraform-s3-state-configuration/</guid>
      <description>&lt;p&gt;If you are using S3 as the backend for your state management in Terraform, then you can create environment specific configuration files where you store the &lt;code&gt;bucket&lt;/code&gt;, &lt;code&gt;region&lt;/code&gt; among other things to be pulled in automatically when switching environments.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-create-environment-specific-configs&#34;&gt;Step 1 – Create environment specific configs&lt;/h2&gt;&#xA;&lt;p&gt;Create a &lt;code&gt;dev.conf&lt;/code&gt; file with the following content:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;bucket = &amp;#34;your-bucket&amp;#34;&#xA;region = &amp;#34;your-aws-region&amp;#34;&#xA;key    = &amp;#34;path/to/key&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-set-the-terraform-backend&#34;&gt;Step 2 – Set the &lt;code&gt;terraform&lt;/code&gt; &lt;code&gt;backend&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;In your &lt;code&gt;main.tf&lt;/code&gt;, &lt;code&gt;providers.tf&lt;/code&gt; or &lt;code&gt;state.tf&lt;/code&gt; file, specify the following:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Refresh State in Terraform</title>
      <link>https://andrewodendaal.com/how-to-refresh-state-in-terraform/</link>
      <pubDate>Wed, 15 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-refresh-state-in-terraform/</guid>
      <description>&lt;p&gt;Sometimes your infrastructure may be out of sync with your Terraform state because resources may have been amended or deleted manually.&lt;/p&gt;&#xA;&lt;p&gt;For this you can &lt;code&gt;refresh&lt;/code&gt; the Terraform state.&lt;/p&gt;&#xA;&lt;h2 id=&#34;using-the-refresh-command&#34;&gt;Using the &lt;code&gt;refresh&lt;/code&gt; command&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;terraform refresh [options]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Why this command may appear strange at first, not that it is merely an alias for:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;terraform apply -refresh-only -auto-approve&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you don&amp;rsquo;t want to &lt;code&gt;auto-approve&lt;/code&gt; the transaction, then you can perform a refresh as follows:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get the Length of an Array in C</title>
      <link>https://andrewodendaal.com/how-to-get-the-length-of-an-array-in-c/</link>
      <pubDate>Tue, 14 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-length-of-an-array-in-c/</guid>
      <description>&lt;p&gt;There isn&amp;rsquo;t really a standard way to get the length of array in C. This means you need to do some additional work to achieve getting the length of an array when using C.&lt;/p&gt;&#xA;&lt;h2 id=&#34;creating-and-looping-through-an-array-in-c&#34;&gt;Creating and Looping through an Array in C&lt;/h2&gt;&#xA;&lt;p&gt;Usually you would create an array as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;int items[5] = {1, 2, 3, 4, 5};&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You could always define the size right off the bat:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;const int SIZE = 5;&#xA;int items[SIZE] = {1, 2, 3, 4, 5};&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This way if you need to loop through the array later on, you can use your &lt;code&gt;SIZE&lt;/code&gt; variable.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to write If/Else Statements in Terraform</title>
      <link>https://andrewodendaal.com/how-to-write-if-else-statements-in-terraform/</link>
      <pubDate>Mon, 13 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-write-if-else-statements-in-terraform/</guid>
      <description>&lt;p&gt;&lt;code&gt;If&lt;/code&gt;/&lt;code&gt;Else&lt;/code&gt; statements are conditional statements that perform decisions based on some known state, or variable.&lt;/p&gt;&#xA;&lt;p&gt;Terraform allows you to perform these if/else statements using a &lt;code&gt;ternary operation&lt;/code&gt; which have become popular as short-form if/else statements in many programming languages.&lt;/p&gt;&#xA;&lt;p&gt;Where a language would write something similar to:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;let truthy = false&#xA;if (something == &amp;#34;value&amp;#34;) {&#xA;  truthy = true&#xA;} else {&#xA;  truthy = false&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The ternary alternative would be:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Reset Udemy Progress</title>
      <link>https://andrewodendaal.com/how-to-reset-udemy-progress/</link>
      <pubDate>Sun, 12 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reset-udemy-progress/</guid>
      <description>&lt;p&gt;If you need to redo a Udemy course and you would like to reset the course&amp;rsquo;s progress, then you can use the following Javascript snippet below.&lt;/p&gt;&#xA;&lt;p&gt;You have to do this manually because Udemy does not provide native functionality to do this.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-navigate-to-udemy-in-a-web-browser&#34;&gt;Step 1 – Navigate to Udemy in a web browser&lt;/h2&gt;&#xA;&lt;p&gt;Make sure you are on the course content page you would like to reset.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-2-8211-open-up-the-developer-tools&#34;&gt;Step 2 – Open up the developer tools&lt;/h2&gt;&#xA;&lt;p&gt;You will need to run a Javascript snippet, so press the following keyboard shortcuts, or right-click and select &lt;code&gt;Inspect&lt;/code&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Get Last Digit of a Large Number in C</title>
      <link>https://andrewodendaal.com/how-to-get-last-digit-of-a-large-number-in-c/</link>
      <pubDate>Sat, 11 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-last-digit-of-a-large-number-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Define a function that takes in two non-negative integers aa_a_ and bb_b_ and returns the last decimal digit of aba^b_a__b_. Note that aa_a_ and bb_b_ may be very large!&lt;/p&gt;&#xA;&lt;p&gt;For example, the last decimal digit of 979^797 is 999, since 97=47829699^7 = 478296997=4782969. The last decimal digit of (2200)2300({2^{200}})^{2^{300}}(2200)2300, which has over 109210^{92}1092 decimal digits, is 666. Also, please take 000^000 to be 111.&lt;/p&gt;&#xA;&lt;p&gt;You may assume that the input will always be valid.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] Network interface is in use by another service in AWS</title>
      <link>https://andrewodendaal.com/solved-network-interface-is-in-use-by-another-service-in-aws/</link>
      <pubDate>Fri, 10 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-network-interface-is-in-use-by-another-service-in-aws/</guid>
      <description>&lt;p&gt;If you have tried to delete a Security Group, or VPC, or various other resources and you get the dreaded &lt;code&gt;Network interface is in use by another service&lt;/code&gt; error, then you can resolve this by deleting the resource through the API.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-delete-the-network-interface-eni&#34;&gt;How to delete the Network Interface (&lt;code&gt;ENI&lt;/code&gt;)&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws ec2 delete-network-interface --network-interface-id eni-xxxxx&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Replace the &lt;code&gt;eni-xxxxx&lt;/code&gt; with the ENI id that you are struggling to delete.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-find-what-services-are-using-the-eni&#34;&gt;How to find what services are using the &lt;code&gt;ENI&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#!/bin/bash&#xA;vpc=&amp;#34;vpc-xxxxxxxxxxxxx&amp;#34; &#xA;aws ec2 describe-internet-gateways --filters &amp;#39;Name=attachment.vpc-id,Values=&amp;#39;$vpc | grep InternetGatewayId&#xA;aws ec2 describe-subnets --filters &amp;#39;Name=vpc-id,Values=&amp;#39;$vpc | grep SubnetId&#xA;aws ec2 describe-route-tables --filters &amp;#39;Name=vpc-id,Values=&amp;#39;$vpc | grep RouteTableId&#xA;aws ec2 describe-network-acls --filters &amp;#39;Name=vpc-id,Values=&amp;#39;$vpc | grep NetworkAclId&#xA;aws ec2 describe-vpc-peering-connections --filters &amp;#39;Name=requester-vpc-info.vpc-id,Values=&amp;#39;$vpc | grep VpcPeeringConnectionId&#xA;aws ec2 describe-vpc-endpoints --filters &amp;#39;Name=vpc-id,Values=&amp;#39;$vpc | grep VpcEndpointId&#xA;aws ec2 describe-nat-gateways --filter &amp;#39;Name=vpc-id,Values=&amp;#39;$vpc | grep NatGatewayId&#xA;aws ec2 describe-security-groups --filters &amp;#39;Name=vpc-id,Values=&amp;#39;$vpc | grep GroupId&#xA;aws ec2 describe-instances --filters &amp;#39;Name=vpc-id,Values=&amp;#39;$vpc | grep InstanceId&#xA;aws ec2 describe-vpn-connections --filters &amp;#39;Name=vpc-id,Values=&amp;#39;$vpc | grep VpnConnectionId&#xA;aws ec2 describe-vpn-gateways --filters &amp;#39;Name=attachment.vpc-id,Values=&amp;#39;$vpc | grep VpnGatewayId&#xA;aws ec2 describe-network-interfaces --filters &amp;#39;Name=vpc-id,Values=&amp;#39;$vpc | grep NetworkInterfaceId&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Uninstall npm packages</title>
      <link>https://andrewodendaal.com/how-to-uninstall-npm-packages/</link>
      <pubDate>Thu, 09 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-uninstall-npm-packages/</guid>
      <description>&lt;p&gt;We typically install an &lt;code&gt;npm&lt;/code&gt; package as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;npm install &amp;lt;package_name&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;But how do we uninstall an &lt;code&gt;npm&lt;/code&gt; package?&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-uninstall-an-npm-package&#34;&gt;How to uninstall an npm package&lt;/h2&gt;&#xA;&lt;p&gt;This will uninstall an npm package that was installed in your project.&lt;/p&gt;&#xA;&lt;p&gt;Just make sure to run the command from the root directory of your project.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;npm uninstall &amp;lt;package_name&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will remove the package from the &lt;code&gt;node_modules&lt;/code&gt; directory and will also remove the reference to it from the &lt;code&gt;package.json&lt;/code&gt; file.&lt;/p&gt;</description>
    </item>
    <item>
      <title>RBG Color Codes</title>
      <link>https://andrewodendaal.com/rbg-color-codes/</link>
      <pubDate>Wed, 08 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/rbg-color-codes/</guid>
      <description>&lt;p&gt;Often you need to reference an HTML/CSS Color Code in RGB or Hex. This is known as &lt;code&gt;rgb color codes&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Below is an easy-to-use table to find the appropriate RGB and Hex Color Codes.&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;Color&lt;/th&gt;&#xA;          &lt;th&gt;Name&lt;/th&gt;&#xA;          &lt;th&gt;#RRGGBB (Hex Code)&lt;/th&gt;&#xA;          &lt;th&gt;R,G,B (Decimal code)&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;maroon&lt;/td&gt;&#xA;          &lt;td&gt;#800000&lt;/td&gt;&#xA;          &lt;td&gt;(128,0,0)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dark red&lt;/td&gt;&#xA;          &lt;td&gt;#8B0000&lt;/td&gt;&#xA;          &lt;td&gt;(139,0,0)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;brown&lt;/td&gt;&#xA;          &lt;td&gt;#A52A2A&lt;/td&gt;&#xA;          &lt;td&gt;(165,42,42)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;firebrick&lt;/td&gt;&#xA;          &lt;td&gt;#B22222&lt;/td&gt;&#xA;          &lt;td&gt;(178,34,34)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;crimson&lt;/td&gt;&#xA;          &lt;td&gt;#DC143C&lt;/td&gt;&#xA;          &lt;td&gt;(220,20,60)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;red&lt;/td&gt;&#xA;          &lt;td&gt;#FF0000&lt;/td&gt;&#xA;          &lt;td&gt;(255,0,0)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;tomato&lt;/td&gt;&#xA;          &lt;td&gt;#FF6347&lt;/td&gt;&#xA;          &lt;td&gt;(255,99,71)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;coral&lt;/td&gt;&#xA;          &lt;td&gt;#FF7F50&lt;/td&gt;&#xA;          &lt;td&gt;(255,127,80)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;indian red&lt;/td&gt;&#xA;          &lt;td&gt;#CD5C5C&lt;/td&gt;&#xA;          &lt;td&gt;(205,92,92)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;light coral&lt;/td&gt;&#xA;          &lt;td&gt;#F08080&lt;/td&gt;&#xA;          &lt;td&gt;(240,128,128)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dark salmon&lt;/td&gt;&#xA;          &lt;td&gt;#E9967A&lt;/td&gt;&#xA;          &lt;td&gt;(233,150,122)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;salmon&lt;/td&gt;&#xA;          &lt;td&gt;#FA8072&lt;/td&gt;&#xA;          &lt;td&gt;(250,128,114)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;light salmon&lt;/td&gt;&#xA;          &lt;td&gt;#FFA07A&lt;/td&gt;&#xA;          &lt;td&gt;(255,160,122)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;orange red&lt;/td&gt;&#xA;          &lt;td&gt;#FF4500&lt;/td&gt;&#xA;          &lt;td&gt;(255,69,0)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dark orange&lt;/td&gt;&#xA;          &lt;td&gt;#FF8C00&lt;/td&gt;&#xA;          &lt;td&gt;(255,140,0)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;orange&lt;/td&gt;&#xA;          &lt;td&gt;#FFA500&lt;/td&gt;&#xA;          &lt;td&gt;(255,165,0)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;gold&lt;/td&gt;&#xA;          &lt;td&gt;#FFD700&lt;/td&gt;&#xA;          &lt;td&gt;(255,215,0)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dark golden rod&lt;/td&gt;&#xA;          &lt;td&gt;#B8860B&lt;/td&gt;&#xA;          &lt;td&gt;(184,134,11)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;golden rod&lt;/td&gt;&#xA;          &lt;td&gt;#DAA520&lt;/td&gt;&#xA;          &lt;td&gt;(218,165,32)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;pale golden rod&lt;/td&gt;&#xA;          &lt;td&gt;#EEE8AA&lt;/td&gt;&#xA;          &lt;td&gt;(238,232,170)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dark khaki&lt;/td&gt;&#xA;          &lt;td&gt;#BDB76B&lt;/td&gt;&#xA;          &lt;td&gt;(189,183,107)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;khaki&lt;/td&gt;&#xA;          &lt;td&gt;#F0E68C&lt;/td&gt;&#xA;          &lt;td&gt;(240,230,140)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;olive&lt;/td&gt;&#xA;          &lt;td&gt;#808000&lt;/td&gt;&#xA;          &lt;td&gt;(128,128,0)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;yellow&lt;/td&gt;&#xA;          &lt;td&gt;#FFFF00&lt;/td&gt;&#xA;          &lt;td&gt;(255,255,0)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;yellow green&lt;/td&gt;&#xA;          &lt;td&gt;#9ACD32&lt;/td&gt;&#xA;          &lt;td&gt;(154,205,50)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dark olive green&lt;/td&gt;&#xA;          &lt;td&gt;#556B2F&lt;/td&gt;&#xA;          &lt;td&gt;(85,107,47)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;olive drab&lt;/td&gt;&#xA;          &lt;td&gt;#6B8E23&lt;/td&gt;&#xA;          &lt;td&gt;(107,142,35)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;lawn green&lt;/td&gt;&#xA;          &lt;td&gt;#7CFC00&lt;/td&gt;&#xA;          &lt;td&gt;(124,252,0)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;chart reuse&lt;/td&gt;&#xA;          &lt;td&gt;#7FFF00&lt;/td&gt;&#xA;          &lt;td&gt;(127,255,0)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;green yellow&lt;/td&gt;&#xA;          &lt;td&gt;#ADFF2F&lt;/td&gt;&#xA;          &lt;td&gt;(173,255,47)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dark green&lt;/td&gt;&#xA;          &lt;td&gt;#006400&lt;/td&gt;&#xA;          &lt;td&gt;(0,100,0)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;green&lt;/td&gt;&#xA;          &lt;td&gt;#008000&lt;/td&gt;&#xA;          &lt;td&gt;(0,128,0)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;forest green&lt;/td&gt;&#xA;          &lt;td&gt;#228B22&lt;/td&gt;&#xA;          &lt;td&gt;(34,139,34)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;lime&lt;/td&gt;&#xA;          &lt;td&gt;#00FF00&lt;/td&gt;&#xA;          &lt;td&gt;(0,255,0)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;lime green&lt;/td&gt;&#xA;          &lt;td&gt;#32CD32&lt;/td&gt;&#xA;          &lt;td&gt;(50,205,50)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;light green&lt;/td&gt;&#xA;          &lt;td&gt;#90EE90&lt;/td&gt;&#xA;          &lt;td&gt;(144,238,144)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;pale green&lt;/td&gt;&#xA;          &lt;td&gt;#98FB98&lt;/td&gt;&#xA;          &lt;td&gt;(152,251,152)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dark sea green&lt;/td&gt;&#xA;          &lt;td&gt;#8FBC8F&lt;/td&gt;&#xA;          &lt;td&gt;(143,188,143)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;medium spring green&lt;/td&gt;&#xA;          &lt;td&gt;#00FA9A&lt;/td&gt;&#xA;          &lt;td&gt;(0,250,154)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;spring green&lt;/td&gt;&#xA;          &lt;td&gt;#00FF7F&lt;/td&gt;&#xA;          &lt;td&gt;(0,255,127)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;sea green&lt;/td&gt;&#xA;          &lt;td&gt;#2E8B57&lt;/td&gt;&#xA;          &lt;td&gt;(46,139,87)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;medium aqua marine&lt;/td&gt;&#xA;          &lt;td&gt;#66CDAA&lt;/td&gt;&#xA;          &lt;td&gt;(102,205,170)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;medium sea green&lt;/td&gt;&#xA;          &lt;td&gt;#3CB371&lt;/td&gt;&#xA;          &lt;td&gt;(60,179,113)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;light sea green&lt;/td&gt;&#xA;          &lt;td&gt;#20B2AA&lt;/td&gt;&#xA;          &lt;td&gt;(32,178,170)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dark slate gray&lt;/td&gt;&#xA;          &lt;td&gt;#2F4F4F&lt;/td&gt;&#xA;          &lt;td&gt;(47,79,79)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;teal&lt;/td&gt;&#xA;          &lt;td&gt;#008080&lt;/td&gt;&#xA;          &lt;td&gt;(0,128,128)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dark cyan&lt;/td&gt;&#xA;          &lt;td&gt;#008B8B&lt;/td&gt;&#xA;          &lt;td&gt;(0,139,139)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;aqua&lt;/td&gt;&#xA;          &lt;td&gt;#00FFFF&lt;/td&gt;&#xA;          &lt;td&gt;(0,255,255)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;cyan&lt;/td&gt;&#xA;          &lt;td&gt;#00FFFF&lt;/td&gt;&#xA;          &lt;td&gt;(0,255,255)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;light cyan&lt;/td&gt;&#xA;          &lt;td&gt;#E0FFFF&lt;/td&gt;&#xA;          &lt;td&gt;(224,255,255)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dark turquoise&lt;/td&gt;&#xA;          &lt;td&gt;#00CED1&lt;/td&gt;&#xA;          &lt;td&gt;(0,206,209)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;turquoise&lt;/td&gt;&#xA;          &lt;td&gt;#40E0D0&lt;/td&gt;&#xA;          &lt;td&gt;(64,224,208)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;medium turquoise&lt;/td&gt;&#xA;          &lt;td&gt;#48D1CC&lt;/td&gt;&#xA;          &lt;td&gt;(72,209,204)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;pale turquoise&lt;/td&gt;&#xA;          &lt;td&gt;#AFEEEE&lt;/td&gt;&#xA;          &lt;td&gt;(175,238,238)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;aqua marine&lt;/td&gt;&#xA;          &lt;td&gt;#7FFFD4&lt;/td&gt;&#xA;          &lt;td&gt;(127,255,212)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;powder blue&lt;/td&gt;&#xA;          &lt;td&gt;#B0E0E6&lt;/td&gt;&#xA;          &lt;td&gt;(176,224,230)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;cadet blue&lt;/td&gt;&#xA;          &lt;td&gt;#5F9EA0&lt;/td&gt;&#xA;          &lt;td&gt;(95,158,160)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;steel blue&lt;/td&gt;&#xA;          &lt;td&gt;#4682B4&lt;/td&gt;&#xA;          &lt;td&gt;(70,130,180)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;corn flower blue&lt;/td&gt;&#xA;          &lt;td&gt;#6495ED&lt;/td&gt;&#xA;          &lt;td&gt;(100,149,237)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;deep sky blue&lt;/td&gt;&#xA;          &lt;td&gt;#00BFFF&lt;/td&gt;&#xA;          &lt;td&gt;(0,191,255)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dodger blue&lt;/td&gt;&#xA;          &lt;td&gt;#1E90FF&lt;/td&gt;&#xA;          &lt;td&gt;(30,144,255)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;light blue&lt;/td&gt;&#xA;          &lt;td&gt;#ADD8E6&lt;/td&gt;&#xA;          &lt;td&gt;(173,216,230)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;sky blue&lt;/td&gt;&#xA;          &lt;td&gt;#87CEEB&lt;/td&gt;&#xA;          &lt;td&gt;(135,206,235)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;light sky blue&lt;/td&gt;&#xA;          &lt;td&gt;#87CEFA&lt;/td&gt;&#xA;          &lt;td&gt;(135,206,250)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;midnight blue&lt;/td&gt;&#xA;          &lt;td&gt;#191970&lt;/td&gt;&#xA;          &lt;td&gt;(25,25,112)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;navy&lt;/td&gt;&#xA;          &lt;td&gt;#000080&lt;/td&gt;&#xA;          &lt;td&gt;(0,0,128)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dark blue&lt;/td&gt;&#xA;          &lt;td&gt;#00008B&lt;/td&gt;&#xA;          &lt;td&gt;(0,0,139)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;medium blue&lt;/td&gt;&#xA;          &lt;td&gt;#0000CD&lt;/td&gt;&#xA;          &lt;td&gt;(0,0,205)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;blue&lt;/td&gt;&#xA;          &lt;td&gt;#0000FF&lt;/td&gt;&#xA;          &lt;td&gt;(0,0,255)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;royal blue&lt;/td&gt;&#xA;          &lt;td&gt;#4169E1&lt;/td&gt;&#xA;          &lt;td&gt;(65,105,225)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;blue violet&lt;/td&gt;&#xA;          &lt;td&gt;#8A2BE2&lt;/td&gt;&#xA;          &lt;td&gt;(138,43,226)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;indigo&lt;/td&gt;&#xA;          &lt;td&gt;#4B0082&lt;/td&gt;&#xA;          &lt;td&gt;(75,0,130)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dark slate blue&lt;/td&gt;&#xA;          &lt;td&gt;#483D8B&lt;/td&gt;&#xA;          &lt;td&gt;(72,61,139)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;slate blue&lt;/td&gt;&#xA;          &lt;td&gt;#6A5ACD&lt;/td&gt;&#xA;          &lt;td&gt;(106,90,205)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;medium slate blue&lt;/td&gt;&#xA;          &lt;td&gt;#7B68EE&lt;/td&gt;&#xA;          &lt;td&gt;(123,104,238)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;medium purple&lt;/td&gt;&#xA;          &lt;td&gt;#9370DB&lt;/td&gt;&#xA;          &lt;td&gt;(147,112,219)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dark magenta&lt;/td&gt;&#xA;          &lt;td&gt;#8B008B&lt;/td&gt;&#xA;          &lt;td&gt;(139,0,139)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dark violet&lt;/td&gt;&#xA;          &lt;td&gt;#9400D3&lt;/td&gt;&#xA;          &lt;td&gt;(148,0,211)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dark orchid&lt;/td&gt;&#xA;          &lt;td&gt;#9932CC&lt;/td&gt;&#xA;          &lt;td&gt;(153,50,204)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;medium orchid&lt;/td&gt;&#xA;          &lt;td&gt;#BA55D3&lt;/td&gt;&#xA;          &lt;td&gt;(186,85,211)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;purple&lt;/td&gt;&#xA;          &lt;td&gt;#800080&lt;/td&gt;&#xA;          &lt;td&gt;(128,0,128)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;thistle&lt;/td&gt;&#xA;          &lt;td&gt;#D8BFD8&lt;/td&gt;&#xA;          &lt;td&gt;(216,191,216)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;plum&lt;/td&gt;&#xA;          &lt;td&gt;#DDA0DD&lt;/td&gt;&#xA;          &lt;td&gt;(221,160,221)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;violet&lt;/td&gt;&#xA;          &lt;td&gt;#EE82EE&lt;/td&gt;&#xA;          &lt;td&gt;(238,130,238)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;magenta / fuchsia&lt;/td&gt;&#xA;          &lt;td&gt;#FF00FF&lt;/td&gt;&#xA;          &lt;td&gt;(255,0,255)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;orchid&lt;/td&gt;&#xA;          &lt;td&gt;#DA70D6&lt;/td&gt;&#xA;          &lt;td&gt;(218,112,214)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;medium violet red&lt;/td&gt;&#xA;          &lt;td&gt;#C71585&lt;/td&gt;&#xA;          &lt;td&gt;(199,21,133)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;pale violet red&lt;/td&gt;&#xA;          &lt;td&gt;#DB7093&lt;/td&gt;&#xA;          &lt;td&gt;(219,112,147)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;deep pink&lt;/td&gt;&#xA;          &lt;td&gt;#FF1493&lt;/td&gt;&#xA;          &lt;td&gt;(255,20,147)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;hot pink&lt;/td&gt;&#xA;          &lt;td&gt;#FF69B4&lt;/td&gt;&#xA;          &lt;td&gt;(255,105,180)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;light pink&lt;/td&gt;&#xA;          &lt;td&gt;#FFB6C1&lt;/td&gt;&#xA;          &lt;td&gt;(255,182,193)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;pink&lt;/td&gt;&#xA;          &lt;td&gt;#FFC0CB&lt;/td&gt;&#xA;          &lt;td&gt;(255,192,203)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;antique white&lt;/td&gt;&#xA;          &lt;td&gt;#FAEBD7&lt;/td&gt;&#xA;          &lt;td&gt;(250,235,215)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;beige&lt;/td&gt;&#xA;          &lt;td&gt;#F5F5DC&lt;/td&gt;&#xA;          &lt;td&gt;(245,245,220)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;bisque&lt;/td&gt;&#xA;          &lt;td&gt;#FFE4C4&lt;/td&gt;&#xA;          &lt;td&gt;(255,228,196)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;blanched almond&lt;/td&gt;&#xA;          &lt;td&gt;#FFEBCD&lt;/td&gt;&#xA;          &lt;td&gt;(255,235,205)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;wheat&lt;/td&gt;&#xA;          &lt;td&gt;#F5DEB3&lt;/td&gt;&#xA;          &lt;td&gt;(245,222,179)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;corn silk&lt;/td&gt;&#xA;          &lt;td&gt;#FFF8DC&lt;/td&gt;&#xA;          &lt;td&gt;(255,248,220)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;lemon chiffon&lt;/td&gt;&#xA;          &lt;td&gt;#FFFACD&lt;/td&gt;&#xA;          &lt;td&gt;(255,250,205)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;light golden rod yellow&lt;/td&gt;&#xA;          &lt;td&gt;#FAFAD2&lt;/td&gt;&#xA;          &lt;td&gt;(250,250,210)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;light yellow&lt;/td&gt;&#xA;          &lt;td&gt;#FFFFE0&lt;/td&gt;&#xA;          &lt;td&gt;(255,255,224)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;saddle brown&lt;/td&gt;&#xA;          &lt;td&gt;#8B4513&lt;/td&gt;&#xA;          &lt;td&gt;(139,69,19)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;sienna&lt;/td&gt;&#xA;          &lt;td&gt;#A0522D&lt;/td&gt;&#xA;          &lt;td&gt;(160,82,45)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;chocolate&lt;/td&gt;&#xA;          &lt;td&gt;#D2691E&lt;/td&gt;&#xA;          &lt;td&gt;(210,105,30)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;peru&lt;/td&gt;&#xA;          &lt;td&gt;#CD853F&lt;/td&gt;&#xA;          &lt;td&gt;(205,133,63)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;sandy brown&lt;/td&gt;&#xA;          &lt;td&gt;#F4A460&lt;/td&gt;&#xA;          &lt;td&gt;(244,164,96)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;burly wood&lt;/td&gt;&#xA;          &lt;td&gt;#DEB887&lt;/td&gt;&#xA;          &lt;td&gt;(222,184,135)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;tan&lt;/td&gt;&#xA;          &lt;td&gt;#D2B48C&lt;/td&gt;&#xA;          &lt;td&gt;(210,180,140)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;rosy brown&lt;/td&gt;&#xA;          &lt;td&gt;#BC8F8F&lt;/td&gt;&#xA;          &lt;td&gt;(188,143,143)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;moccasin&lt;/td&gt;&#xA;          &lt;td&gt;#FFE4B5&lt;/td&gt;&#xA;          &lt;td&gt;(255,228,181)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;navajo white&lt;/td&gt;&#xA;          &lt;td&gt;#FFDEAD&lt;/td&gt;&#xA;          &lt;td&gt;(255,222,173)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;peach puff&lt;/td&gt;&#xA;          &lt;td&gt;#FFDAB9&lt;/td&gt;&#xA;          &lt;td&gt;(255,218,185)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;misty rose&lt;/td&gt;&#xA;          &lt;td&gt;#FFE4E1&lt;/td&gt;&#xA;          &lt;td&gt;(255,228,225)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;lavender blush&lt;/td&gt;&#xA;          &lt;td&gt;#FFF0F5&lt;/td&gt;&#xA;          &lt;td&gt;(255,240,245)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;linen&lt;/td&gt;&#xA;          &lt;td&gt;#FAF0E6&lt;/td&gt;&#xA;          &lt;td&gt;(250,240,230)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;old lace&lt;/td&gt;&#xA;          &lt;td&gt;#FDF5E6&lt;/td&gt;&#xA;          &lt;td&gt;(253,245,230)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;papaya whip&lt;/td&gt;&#xA;          &lt;td&gt;#FFEFD5&lt;/td&gt;&#xA;          &lt;td&gt;(255,239,213)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;sea shell&lt;/td&gt;&#xA;          &lt;td&gt;#FFF5EE&lt;/td&gt;&#xA;          &lt;td&gt;(255,245,238)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;mint cream&lt;/td&gt;&#xA;          &lt;td&gt;#F5FFFA&lt;/td&gt;&#xA;          &lt;td&gt;(245,255,250)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;slate gray&lt;/td&gt;&#xA;          &lt;td&gt;#708090&lt;/td&gt;&#xA;          &lt;td&gt;(112,128,144)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;light slate gray&lt;/td&gt;&#xA;          &lt;td&gt;#778899&lt;/td&gt;&#xA;          &lt;td&gt;(119,136,153)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;light steel blue&lt;/td&gt;&#xA;          &lt;td&gt;#B0C4DE&lt;/td&gt;&#xA;          &lt;td&gt;(176,196,222)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;lavender&lt;/td&gt;&#xA;          &lt;td&gt;#E6E6FA&lt;/td&gt;&#xA;          &lt;td&gt;(230,230,250)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;floral white&lt;/td&gt;&#xA;          &lt;td&gt;#FFFAF0&lt;/td&gt;&#xA;          &lt;td&gt;(255,250,240)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;alice blue&lt;/td&gt;&#xA;          &lt;td&gt;#F0F8FF&lt;/td&gt;&#xA;          &lt;td&gt;(240,248,255)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;ghost white&lt;/td&gt;&#xA;          &lt;td&gt;#F8F8FF&lt;/td&gt;&#xA;          &lt;td&gt;(248,248,255)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;honeydew&lt;/td&gt;&#xA;          &lt;td&gt;#F0FFF0&lt;/td&gt;&#xA;          &lt;td&gt;(240,255,240)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;ivory&lt;/td&gt;&#xA;          &lt;td&gt;#FFFFF0&lt;/td&gt;&#xA;          &lt;td&gt;(255,255,240)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;azure&lt;/td&gt;&#xA;          &lt;td&gt;#F0FFFF&lt;/td&gt;&#xA;          &lt;td&gt;(240,255,255)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;snow&lt;/td&gt;&#xA;          &lt;td&gt;#FFFAFA&lt;/td&gt;&#xA;          &lt;td&gt;(255,250,250)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;black&lt;/td&gt;&#xA;          &lt;td&gt;#000000&lt;/td&gt;&#xA;          &lt;td&gt;(0,0,0)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dim gray / dim grey&lt;/td&gt;&#xA;          &lt;td&gt;#696969&lt;/td&gt;&#xA;          &lt;td&gt;(105,105,105)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;gray / grey&lt;/td&gt;&#xA;          &lt;td&gt;#808080&lt;/td&gt;&#xA;          &lt;td&gt;(128,128,128)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;dark gray / dark grey&lt;/td&gt;&#xA;          &lt;td&gt;#A9A9A9&lt;/td&gt;&#xA;          &lt;td&gt;(169,169,169)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;silver&lt;/td&gt;&#xA;          &lt;td&gt;#C0C0C0&lt;/td&gt;&#xA;          &lt;td&gt;(192,192,192)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;light gray / light grey&lt;/td&gt;&#xA;          &lt;td&gt;#D3D3D3&lt;/td&gt;&#xA;          &lt;td&gt;(211,211,211)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;gainsboro&lt;/td&gt;&#xA;          &lt;td&gt;#DCDCDC&lt;/td&gt;&#xA;          &lt;td&gt;(220,220,220)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;white smoke&lt;/td&gt;&#xA;          &lt;td&gt;#F5F5F5&lt;/td&gt;&#xA;          &lt;td&gt;(245,245,245)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;white&lt;/td&gt;&#xA;          &lt;td&gt;#FFFFFF&lt;/td&gt;&#xA;          &lt;td&gt;(255,255,255)&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;</description>
    </item>
    <item>
      <title>How to Sum the Two Lowest Positive Integers in C&#43;&#43;</title>
      <link>https://andrewodendaal.com/how-to-sum-the-two-lowest-positive-integers-in-c/</link>
      <pubDate>Tue, 07 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-sum-the-two-lowest-positive-integers-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function that returns the sum of the two lowest positive numbers given an array of minimum 4 positive integers. No floats or non-positive integers will be passed.&lt;/p&gt;&#xA;&lt;p&gt;For example, when an array is passed like &lt;code&gt;[19, 5, 42, 2, 77]&lt;/code&gt;, the output should be &lt;code&gt;7&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;[10, 343445353, 3453445, 3453545353453]&lt;/code&gt; should return &lt;code&gt;3453455&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-c&#34;&gt;The solution in C++&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#include &amp;lt;algorithm&amp;gt;&#xA;#include &amp;lt;vector&amp;gt;&#xA;&#xA;long sumTwoSmallestNumbers(std::vector&amp;lt;int&amp;gt; numbers) {&#xA;    std::sort(numbers.begin(), numbers.end());&#xA;    return (long)numbers[0] + (long)numbers[1];&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Sort an Array of Objects by Property in Javascript</title>
      <link>https://andrewodendaal.com/how-to-sort-an-array-of-objects-by-property-in-javascript/</link>
      <pubDate>Mon, 06 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-sort-an-array-of-objects-by-property-in-javascript/</guid>
      <description>&lt;p&gt;If you need to sort an array of objects by their property values using Javascript, then you don&amp;rsquo;t need to look further than the built-in &lt;code&gt;sort&lt;/code&gt; functionality.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-create-an-array-of-objects-to-work-with&#34;&gt;Step 1 – Create an array of objects to work with&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;let people = [&#xA;    {&#xA;        name : &amp;#34;John&amp;#34;,&#xA;        surname : &amp;#34;Doe&amp;#34;,&#xA;        age : 21&#xA;    }, {&#xA;        name : &amp;#34;Jack&amp;#34;,&#xA;        surname : &amp;#34;Bennington&amp;#34;,&#xA;        age : 35&#xA;    }, {&#xA;        name : &amp;#34;Jane&amp;#34;,&#xA;        surname : &amp;#34;Doe&amp;#34;,&#xA;        age : 19&#xA;    }&#xA;];&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-sort-by-keys&#34;&gt;Step 2 – Sort by keys&lt;/h2&gt;&#xA;&lt;h3 id=&#34;option-1-8211-sort-by-surname&#34;&gt;Option 1 – Sort by surname&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;people.sort((a, b) =&amp;gt; a.surname.localeCompare(b.surname));&#xA;console.log(people);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will give you the following output:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create a Countdown Timer in Python</title>
      <link>https://andrewodendaal.com/how-to-create-a-countdown-timer-in-python/</link>
      <pubDate>Sun, 05 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-countdown-timer-in-python/</guid>
      <description>&lt;p&gt;If you need to count down a specific amount of time, say for example, when a token is set to expire, then a countdown timer will be useful.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-writing-the-python-code&#34;&gt;Step 1 – Writing the Python code&lt;/h2&gt;&#xA;&lt;p&gt;Place the following Python code in a file called &lt;code&gt;countdowntimer.py&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;option-1-8211-text-output&#34;&gt;Option 1 – Text output&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import time&#xA;&#xA;def countdown(t):&#xA;  while t:&#xA;    mins, secs = divmod(t, 60)&#xA;    timer = &amp;#39;{:02d}:{:02d}&amp;#39;.format(mins, secs)&#xA;    print(timer, end=&amp;#34;\r&amp;#34;)&#xA;    time.sleep(1)&#xA;    t -= 1&#xA;&#xA;  print(&amp;#39;Countdown time has elapsed!!&amp;#39;)&#xA;&#xA;t = input(&amp;#34;Enter the time in seconds: &amp;#34;)&#xA;&#xA;countdown(int(t))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;option-2-8211-text-and-speech-output&#34;&gt;Option 2 – Text and speech output&lt;/h3&gt;&#xA;&lt;p&gt;Here we also invoke &lt;code&gt;say&lt;/code&gt; which speaks out the text. This is only native to some operating systems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Remove a Resource from Terraform  State</title>
      <link>https://andrewodendaal.com/how-to-remove-a-resource-from-state-in-terraform/</link>
      <pubDate>Sat, 04 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-remove-a-resource-from-state-in-terraform/</guid>
      <description>&lt;p&gt;Terraform &lt;code&gt;state&lt;/code&gt; reflects the most up to date reference of the infrastructure.&lt;/p&gt;&#xA;&lt;p&gt;Sometimes you may need to remove a resource from the Terraform state manually. This is helpful if a resource has been deleted or modified manually and the resource definition has been removed in your Terraform code. This way you can re-run your Terraform plan and apply without deleting the remote infra resource that you removed from the state.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Delete a Specific Resource in Terraform</title>
      <link>https://andrewodendaal.com/how-to-delete-a-specific-resource-in-terraform/</link>
      <pubDate>Fri, 03 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-delete-a-specific-resource-in-terraform/</guid>
      <description>&lt;p&gt;Running &lt;code&gt;terraform destroy&lt;/code&gt; will tear down the whole stack associated to some terraform code.&lt;/p&gt;&#xA;&lt;p&gt;However, sometimes you might only want to remove a specific piece of your infrastructure.&lt;/p&gt;&#xA;&lt;p&gt;To do this, you can use the &lt;code&gt;terraform destroy -target&lt;/code&gt; object.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-list-the-state&#34;&gt;Step 1 – List the State&lt;/h2&gt;&#xA;&lt;p&gt;Get a list of all the resources from the state:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;terraform state list&#xA;&#xA;#data.aws_ami.webserver_ami&#xA;#aws_autoscaling_group.asg-web[0]&#xA;#random_string.rand3&#xA;#...&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-remove-a-specific-resource&#34;&gt;Step 2 – Remove a Specific Resource&lt;/h2&gt;&#xA;&lt;p&gt;Run a &lt;code&gt;terraform destroy -target&lt;/code&gt; and pass a resource from the &lt;code&gt;state list&lt;/code&gt; above:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create a DynamoDB Lock Table for Terraform</title>
      <link>https://andrewodendaal.com/how-to-create-a-dynamodb-lock-table-for-terraform/</link>
      <pubDate>Thu, 02 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-dynamodb-lock-table-for-terraform/</guid>
      <description>&lt;h2 id=&#34;provision-the-dynamodb-table&#34;&gt;Provision the DynamoDB Table&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;resource &amp;#34;aws_dynamodb_table&amp;#34; &amp;#34;dynamodb-terraform-state-lock&amp;#34; {&#xA;  name = &amp;#34;terraform-state-lock-dynamo&amp;#34;&#xA;  hash_key = &amp;#34;LockID&amp;#34;&#xA;  read_capacity = 20&#xA;  write_capacity = 20&#xA; &#xA;  attribute {&#xA;    name = &amp;#34;LockID&amp;#34;&#xA;    type = &amp;#34;S&amp;#34;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;configure-the-dynamodb-table-in-terraform-backend&#34;&gt;Configure the DynamoDB table in Terraform Backend&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;terraform {&#xA;  backend &amp;#34;s3&amp;#34; {&#xA;    encrypt = true&#xA;    bucket = &amp;#34;your-unique-bucket-name&amp;#34;&#xA;    dynamodb_table = &amp;#34;terraform-state-lock-dynamo&amp;#34;&#xA;    key    = &amp;#34;terraform.tfstate&amp;#34;&#xA;    region = &amp;#34;us-east-1&amp;#34;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to add Comments in Terraform</title>
      <link>https://andrewodendaal.com/how-to-add-comments-in-terraform/</link>
      <pubDate>Wed, 01 Jun 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-add-comments-in-terraform/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://andrewodendaal.com/tags/terraform&#34;&gt;Terraform&lt;/a&gt;, a powerful &lt;a href=&#34;https://andrewodendaal.com/iac-guide-modern-software-development&#34;&gt;Infrastructure as Code&lt;/a&gt; (IaC) tool, allows you to define and provision infrastructure resources. Properly commenting your Terraform code is essential for maintaining readability and sharing insights with your team. In this comprehensive guide, we&amp;rsquo;ll explore various methods to add comments in Terraform and address common questions related to &lt;a href=&#34;https://andrewodendaal.com/a-primer-on-terraform-concepts&#34;&gt;Terraform syntax and best practices&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;adding-comments-in-terraform&#34;&gt;Adding Comments in Terraform&lt;/h2&gt;&#xA;&lt;h3 id=&#34;1----single-line-comment&#34;&gt;1. # - Single Line Comment&lt;/h3&gt;&#xA;&lt;p&gt;The &lt;code&gt;#&lt;/code&gt; symbol marks the beginning of a single-line comment in Terraform. Anything following &lt;code&gt;#&lt;/code&gt; on the same line is considered a comment.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to log/debug in Terraform</title>
      <link>https://andrewodendaal.com/how-to-log-debug-in-terraform/</link>
      <pubDate>Tue, 31 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-log-debug-in-terraform/</guid>
      <description>&lt;p&gt;If you have Terraform reporting an error but want more information, then you can configure debug logging.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-configure-bash&#34;&gt;How to configure Bash&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;export TF_LOG=&amp;#34;TRACE&amp;#34;&#xA;export TF_LOG_PATH=&amp;#34;terraform.txt&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-configure-powershell&#34;&gt;How to configure PowerShell&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$env:TF_LOG=&amp;#34;TRACE&amp;#34;&#xA;$env:TF_LOG_PATH=&amp;#34;terraform.txt&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to find the number of trailing zeros of N in Rust</title>
      <link>https://andrewodendaal.com/how-to-find-the-number-of-trailing-zeros-of-n-in-rust/</link>
      <pubDate>Mon, 30 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-number-of-trailing-zeros-of-n-in-rust/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a program that will calculate the number of trailing zeros in a factorial of a given number.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;N! = 1 * 2 * 3 * ... * N&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Be careful &lt;code&gt;1000!&lt;/code&gt; has 2568 digits…&lt;/p&gt;&#xA;&lt;p&gt;For more info, see: &lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://mathworld.wolfram.com/Factorial.html&#34;&gt;http://mathworld.wolfram.com/Factorial.html&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;zeros(6) = 1&#xA;# 6! = 1 * 2 * 3 * 4 * 5 * 6 = 720 --&amp;gt; 1 trailing zero&#xA;&#xA;zeros(12) = 2&#xA;# 12! = 479001600 --&amp;gt; 2 trailing zeros&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-rust&#34;&gt;The solution in Rust&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to do RGB To Hex Conversion in Rust</title>
      <link>https://andrewodendaal.com/how-to-do-rgb-to-hex-conversion-in-rust/</link>
      <pubDate>Sun, 29 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-do-rgb-to-hex-conversion-in-rust/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The rgb function is incomplete. Complete it so that passing in RGB decimal values will result in a hexadecimal representation being returned. Valid decimal values for RGB are 0 – 255. Any values that fall out of that range must be rounded to the closest valid value.&lt;/p&gt;&#xA;&lt;p&gt;Note: Your answer should always be 6 characters long, the shorthand with 3 will not work here.&lt;/p&gt;&#xA;&lt;p&gt;The following are examples of expected output values:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Rename a Git Branch</title>
      <link>https://andrewodendaal.com/how-to-rename-a-git-branch/</link>
      <pubDate>Sat, 28 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-rename-a-git-branch/</guid>
      <description>&lt;p&gt;If you want to rename a git branch, then you have a few options, dependent on the use-case.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-rename-a-git-branch&#34;&gt;Option 1 – Rename a Git Branch&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git branch -a &amp;lt;oldname&amp;gt; &amp;lt;newname&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-rename-the-current-branch&#34;&gt;Option 2 – Rename the Current Branch&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git branch -m &amp;lt;newname&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-on-windows&#34;&gt;Option 3 – On Windows&lt;/h2&gt;&#xA;&lt;p&gt;Windows required a capital &amp;ldquo;-M&amp;rdquo; instead.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git branch -M &amp;lt;newname&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;push-the-local-branch-and-reset-the-upstream-branch&#34;&gt;Push the Local Branch and Reset the Upstream Branch&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git push origin -u &amp;lt;newname&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;delete-the-old-remote-branch&#34;&gt;Delete the Old Remote Branch&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git push origin --delete &amp;lt;oldname&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Find the Shortest Word in C&#43;&#43;</title>
      <link>https://andrewodendaal.com/how-to-find-the-shortest-word-in-c/</link>
      <pubDate>Fri, 27 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-shortest-word-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Simple, given a string of words, return the length of the shortest word(s).&lt;/p&gt;&#xA;&lt;p&gt;The string will never be empty and you do not need to account for different data types.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-c&#34;&gt;The solution in C++&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;int find_short(const std::string &amp;amp;str) {&#xA;    std::istringstream inp(str);&#xA;    std::string s;&#xA;    int len = -1;&#xA;    while (std::getline(inp, s, &amp;#39; &amp;#39;))&#xA;        if (s.length() &amp;lt; len)&#xA;            len = s.length();&#xA;    return len;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;int find_short(std::string str) {&#xA;    std::istringstream iss(str);&#xA;    std::vector&amp;lt;std::string&amp;gt; vec{ std::istream_iterator&amp;lt;std::string&amp;gt;(iss), {} };&#xA;    return std::min_element(vec.begin(), vec.end(), [](const std::string&amp;amp; s1, const std::string&amp;amp; s2) { return s1.length() &amp;lt; s2.length(); })-&amp;gt;length();&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Square Every Digit in C&#43;&#43;</title>
      <link>https://andrewodendaal.com/how-to-square-every-digit-in-c/</link>
      <pubDate>Thu, 26 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-square-every-digit-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are asked to square every digit of a number and concatenate them.&lt;/p&gt;&#xA;&lt;p&gt;For example, if we run 9119 through the function, 811181 will come out, because 9&lt;!-- raw HTML omitted --&gt;2&lt;!-- raw HTML omitted --&gt; is 81 and 1&lt;!-- raw HTML omitted --&gt;2&lt;!-- raw HTML omitted --&gt; is 1.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The function accepts an integer and returns an integer&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-c&#34;&gt;The solution in C++&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;int square_digits(int n) {&#xA;  int a = 1;&#xA;  int m = 0;&#xA;  while (n &amp;gt; 0) {&#xA;    int d = n % 10;&#xA;    m += a * d * d;&#xA;    a *= d &amp;lt;= 3 ? 10 : 100;&#xA;    n /= 10;&#xA;  }&#xA;  return m;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Count Vowels in C&#43;&#43;</title>
      <link>https://andrewodendaal.com/how-to-count-vowels-in-c/</link>
      <pubDate>Wed, 25 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-count-vowels-in-c/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Return the number (count) of vowels in the given string.&lt;/p&gt;&#xA;&lt;p&gt;We will consider &lt;code&gt;a&lt;/code&gt;, &lt;code&gt;e&lt;/code&gt;, &lt;code&gt;i&lt;/code&gt;, &lt;code&gt;o&lt;/code&gt;, &lt;code&gt;u&lt;/code&gt; as vowels for this challenge (but not &lt;code&gt;y&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;The input string will only consist of lower case letters and/or spaces.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-c&#34;&gt;The solution in C++&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#include &amp;lt;string&amp;gt;&#xA;&#xA;using namespace std;&#xA;&#xA;bool is_vowel(char c) {&#xA;  return (c == &amp;#39;a&amp;#39; || c == &amp;#39;e&amp;#39; || c == &amp;#39;i&amp;#39; || c == &amp;#39;o&amp;#39; || c == &amp;#39;u&amp;#39;);&#xA;}&#xA;&#xA;int getCount(const string&amp;amp; inputStr) {&#xA;  return count_if(inputStr.begin(), inputStr.end(), is_vowel);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate the Sum of the Numbers in the Nth row of a Triangle in Golang</title>
      <link>https://andrewodendaal.com/how-to-calculate-the-sum-of-the-numbers-in-the-nth-row-of-a-triangle-in-golang/</link>
      <pubDate>Tue, 24 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-the-sum-of-the-numbers-in-the-nth-row-of-a-triangle-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given the triangle of consecutive odd numbers:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;             1&#xA;          3     5&#xA;       7     9    11&#xA;   13    15    17    19&#xA;21    23    25    27    29&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Calculate the sum of the numbers in the n&lt;!-- raw HTML omitted --&gt;th&lt;!-- raw HTML omitted --&gt; row of this triangle (starting at index 1) e.g.: (&lt;strong&gt;Input –&amp;gt; Output&lt;/strong&gt;)&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;1 --&amp;gt;  1&#xA;2 --&amp;gt; 3 + 5 = 8&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;&#xA;func RowSumOddNumbers(n int) int {&#xA;    return n * n * n&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] Terraform Error accessing remote module registry in PowerShell</title>
      <link>https://andrewodendaal.com/solved-terraform-error-accessing-remote-module-registry-in-powershell/</link>
      <pubDate>Mon, 23 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-terraform-error-accessing-remote-module-registry-in-powershell/</guid>
      <description>&lt;p&gt;If you are using PowerShell and trying to run a &lt;code&gt;terraform init&lt;/code&gt;, you may get an error as follows:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Error: error accessing remote module registry&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Failed to retrieve available versions for module ... from registry.terraform.io: Failed to request discovery document: Get &amp;quot;https://registry.terraform.io/.well-known/terraform.json&amp;quot;: read tcp x.x.x.x:xxxx-&amp;gt;x.x.x.x: wsarecv: An existing connection was forcibly closed by the remote host..&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Note that you will still be able to make a successful &lt;code&gt;curl&lt;/code&gt; request, but &lt;code&gt;terraform&lt;/code&gt; will fail!&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Recursively Delete a Directory in PowerShell</title>
      <link>https://andrewodendaal.com/how-to-recursively-delete-a-directory-in-powershell/</link>
      <pubDate>Sun, 22 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-recursively-delete-a-directory-in-powershell/</guid>
      <description>&lt;p&gt;If you want to recursively delete a directory/folder using PowerShell, then you have 2 options.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-with-literalpath-and-force&#34;&gt;Option 1 – With &lt;code&gt;LiteralPath&lt;/code&gt; and &lt;code&gt;Force&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Remove-Item -LiteralPath &amp;#34;myFolder&amp;#34; -Force -Recurse&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-with-implicit-and-recurse&#34;&gt;Option 2 – With implicit and &lt;code&gt;Recurse&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Remove-Item myFolder/* -Recurse&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>[Solved] npm ERR! could not determine executable to run</title>
      <link>https://andrewodendaal.com/solved-npm-err-could-not-determine-executable-to-run/</link>
      <pubDate>Sat, 21 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-npm-err-could-not-determine-executable-to-run/</guid>
      <description>&lt;p&gt;If you get the following message, then there&amp;rsquo;s a very easy fix:&lt;br&gt;&#xA;&lt;code&gt;npm ERR! could not determine executable to run&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-8211-using-npm&#34;&gt;The solution – using &lt;code&gt;npm&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;rm -rf .git/hooks&#xA;npm install&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-8211-using-yarn&#34;&gt;The solution – using &lt;code&gt;yarn&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;rm -rf .git/hooks&#xA;yarn install&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>[Solved] npm ERR! path node_modules/node-sass</title>
      <link>https://andrewodendaal.com/solved-npm-err-path-node_modules-node-sass/</link>
      <pubDate>Fri, 20 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-npm-err-path-node_modules-node-sass/</guid>
      <description>&lt;p&gt;If you get the following error and need a solution, then look no further!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;npm ERR! code 1&#xA;npm ERR! path ./node_modules/node-sass&#xA;npm ERR! command failed&#xA;npm ERR! command sh -c node scripts/build.js&#xA;&#xA;npm ERR! gyp verb cli   &amp;#39;./node_modules/node-gyp/bin/node-gyp.js&amp;#39;,&#xA;npm ERR! gyp verb cli   &amp;#39;rebuild&amp;#39;,&#xA;npm ERR! gyp verb cli   &amp;#39;--verbose&amp;#39;,&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-1-8211-with-npm&#34;&gt;Option 1 – With &lt;code&gt;npm&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;First, remove the &lt;code&gt;node-sass&lt;/code&gt; dependency from your &lt;code&gt;package.json&lt;/code&gt;, then:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;npm install&#xA;npm i sass&#xA;npm start&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-with-yarn&#34;&gt;Option 2 – With &lt;code&gt;yarn&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;First, remove the &lt;code&gt;node-sass&lt;/code&gt; dependency from your &lt;code&gt;package.json&lt;/code&gt;, then:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Install Lodash through Yarn for React</title>
      <link>https://andrewodendaal.com/how-to-install-lodash-through-yarn-for-react/</link>
      <pubDate>Thu, 19 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-install-lodash-through-yarn-for-react/</guid>
      <description>&lt;p&gt;You can install &lt;code&gt;lodash&lt;/code&gt; through &lt;code&gt;yarn&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-install-lodash-to-get-the-library&#34;&gt;Step 1 – Install Lodash to get the Library&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;yarn add lodash&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-get-the-typescript-info&#34;&gt;Step 2 – Get the Typescript info&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;yarn add --dev @types/lodash&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to SHA256 a String in Golang</title>
      <link>https://andrewodendaal.com/how-to-sha256-a-string-in-golang/</link>
      <pubDate>Wed, 18 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-sha256-a-string-in-golang/</guid>
      <description>&lt;p&gt;If you need to SHA256 a String in Go, then you can use the &lt;code&gt;crypto/sha256&lt;/code&gt; package.&lt;/p&gt;&#xA;&lt;h2 id=&#34;sha256-a-string-in-go&#34;&gt;SHA256 a String in Go&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;&#xA;import (&#xA;&#x9;&amp;#34;crypto/sha256&amp;#34;&#xA;&#x9;&amp;#34;fmt&amp;#34;&#xA;)&#xA;&#xA;func main() {&#xA;&#x9;s := &amp;#34;A sample string to SHA256!&amp;#34;&#xA;&#xA;&#x9;h := sha256.New()&#xA;&#xA;&#x9;h.Write([]byte(s))&#xA;&#xA;&#x9;bs := h.Sum(nil)&#xA;&#xA;&#x9;fmt.Println(s)&#xA;&#x9;fmt.Printf(&amp;#34;%x\n&amp;#34;, bs)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The output will look like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;A sample string to SHA256!&#xA;9abf637c7e39cc4ef84d6d92cf7ffe168dc922b8ae666260d907e0353865ce89&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Base64 Encode/Decode in Golang</title>
      <link>https://andrewodendaal.com/how-to-base64-encode-decode-in-golang/</link>
      <pubDate>Tue, 17 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-base64-encode-decode-in-golang/</guid>
      <description>&lt;p&gt;Go ships with an &lt;code&gt;encoding/base64&lt;/code&gt; package that allows for encode and decoding of Base64 strings.&lt;/p&gt;&#xA;&lt;p&gt;Import the base64 package and then start using it!&lt;/p&gt;&#xA;&lt;h2 id=&#34;base64-encodedecode-a-string&#34;&gt;Base64 encode/decode a string&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;&#xA;import (&#xA;&#x9;b64 &amp;#34;encoding/base64&amp;#34;&#xA;&#x9;&amp;#34;fmt&amp;#34;&#xA;)&#xA;&#xA;func main() {&#xA;&#x9;// define a string&#xA;&#x9;data := &amp;#34;This is a test string!&amp;#34;&#xA;&#xA;&#x9;// Encode to Base64&#xA;&#x9;sEnc := b64.StdEncoding.EncodeToString([]byte(data))&#xA;&#x9;fmt.Println(sEnc)&#xA;&#xA;&#x9;// Decode from Base64&#xA;&#x9;sDec, _ := b64.StdEncoding.DecodeString(sEnc)&#xA;&#x9;fmt.Println(string(sDec))&#xA;&#xA;&#x9;// URL Encode&#xA;&#x9;uEnc := b64.URLEncoding.EncodeToString([]byte(data))&#xA;&#x9;fmt.Println(uEnc)&#xA;&#xA;&#x9;// URL Decode&#xA;&#x9;uDec, _ := b64.URLEncoding.DecodeString(uEnc)&#xA;&#x9;fmt.Println(string(uDec))&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Base64 Encode a String in Java</title>
      <link>https://andrewodendaal.com/how-to-base64-encode-a-string-in-java/</link>
      <pubDate>Mon, 16 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-base64-encode-a-string-in-java/</guid>
      <description>&lt;h2 id=&#34;quick-solution&#34;&gt;Quick solution&lt;/h2&gt;&#xA;&lt;p&gt;In short, you can just do this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;new String(Base64.getEncoder().encode(bytes));&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;examples-and-an-explanation&#34;&gt;Examples and an explanation&lt;/h2&gt;&#xA;&lt;p&gt;In Java 8 and above, you just need to import the Base64 class:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.Base64;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then use the Base64 static methods as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;byte[] encodedBytes = Base64.getEncoder().encode(&amp;#34;Test&amp;#34;.getBytes());&#xA;System.out.println(&amp;#34;encodedBytes &amp;#34; + new String(encodedBytes));&#xA;&#xA;byte[] decodedBytes = Base64.getDecoder().decode(encodedBytes);&#xA;System.out.println(&amp;#34;decodedBytes &amp;#34; + new String(decodedBytes));&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you want to directly encode a string and get the result as an encoded string:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;String encodeBytes = Base64.getEncoder()&#xA;    .encodeToString((&amp;#34;Your String&amp;#34;).getBytes());&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to add a Lambda Environment Variable in Terraform</title>
      <link>https://andrewodendaal.com/how-to-add-a-lambda-environment-variable-in-terraform/</link>
      <pubDate>Sun, 15 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-add-a-lambda-environment-variable-in-terraform/</guid>
      <description>&lt;p&gt;If you have an &lt;code&gt;aws_lambda_function&lt;/code&gt; block that needs to make use of environment variables, then you can simply do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;resource &amp;#34;aws_lambda_function&amp;#34; &amp;#34;test_lambda&amp;#34; {&#xA;  filename         = &amp;#34;lambda_function_payload.zip&amp;#34;&#xA;  function_name    = &amp;#34;lambda_function_name&amp;#34;&#xA;  runtime          = &amp;#34;python3.9&amp;#34;&#xA;  ...&#xA;&#xA;  environment {&#xA;    variables = {&#xA;      api_key = &amp;#34;secret-key&amp;#34;&#xA;    }&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The above example creates an environment variable called &lt;code&gt;api_key&lt;/code&gt; with a value of &lt;code&gt;secret-key&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to perform Array Element Parity in Golang</title>
      <link>https://andrewodendaal.com/how-to-perform-array-element-parity-in-golang/</link>
      <pubDate>Sat, 14 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-perform-array-element-parity-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You will be given an array of integers whose elements have both a negative and a positive value, except for one integer that is either only negative or only positive. Your task will be to find that integer.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;[1, -1, 2, -2, 3] =&amp;gt; 3&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;3&lt;/code&gt; has no matching negative appearance&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;[-3, 1, 2, 3, -1, -4, -2] =&amp;gt; -4&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;-4&lt;/code&gt; has no matching positive appearance&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;[1, -1, 2, -2, 3, 3] =&amp;gt; 3&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Reverse Letters in Kotlin</title>
      <link>https://andrewodendaal.com/how-to-reverse-letters-in-kotlin/</link>
      <pubDate>Fri, 13 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reverse-letters-in-kotlin/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a string &lt;code&gt;str&lt;/code&gt;, reverse it omitting all non-alphabetic characters.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;For &lt;code&gt;str = &amp;quot;krishan&amp;quot;&lt;/code&gt;, the output should be &lt;code&gt;&amp;quot;nahsirk&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For &lt;code&gt;str = &amp;quot;ultr53o?n&amp;quot;&lt;/code&gt;, the output should be &lt;code&gt;&amp;quot;nortlu&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;[input]&lt;/code&gt; string &lt;code&gt;str&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;A string consists of lowercase Latin letters, digits, and symbols.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;[output]&lt;/code&gt; a string&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-kotlin&#34;&gt;The solution in Kotlin&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;fun reverseLetter(str: String): String {&#xA;    return str.filter(Char::isLetter).reversed()&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Get the ASCII Value of Character in Kotlin</title>
      <link>https://andrewodendaal.com/how-to-get-the-ascii-value-of-character-in-kotlin/</link>
      <pubDate>Thu, 12 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-ascii-value-of-character-in-kotlin/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Get the ASCII value of a character.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-kotlin&#34;&gt;The solution in Kotlin&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;val getAscii = Char::toInt&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;fun getAscii(c: Char) = c.code&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;fun getAscii(c: Char): Int {&#xA;    return c.code.toByte().toInt()&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import kotlin.test.assertEquals&#xA;import org.junit.Test&#xA;&#xA;class TestExample {&#xA;  @Test&#xA;  fun `Basic tests`() {&#xA;    assertEquals(65, getAscii(&amp;#39;A&amp;#39;))&#xA;    assertEquals(32, getAscii(&amp;#39; &amp;#39;))&#xA;    assertEquals(33, getAscii(&amp;#39;!&amp;#39;))&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to update each dependency in package.json to the latest version</title>
      <link>https://andrewodendaal.com/how-to-update-each-dependency-in-package-json-to-the-latest-version/</link>
      <pubDate>Wed, 11 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-update-each-dependency-in-package-json-to-the-latest-version/</guid>
      <description>&lt;p&gt;You have 2 options:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-recommended-using-npx&#34;&gt;Option 1 – Recommended (Using &lt;code&gt;npx&lt;/code&gt;)&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;npx npm-check-updates -u&#xA;npm install&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-older-way-using-npm-globally&#34;&gt;Option 2 – Older way (Using &lt;code&gt;npm globally&lt;/code&gt;)&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;npm i -g npm-check-updates&#xA;ncu -u&#xA;npm install&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Convert IPv4 to int32 in Javascript</title>
      <link>https://andrewodendaal.com/how-to-convert-ipv4-to-int32-in-javascript/</link>
      <pubDate>Tue, 10 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-ipv4-to-int32-in-javascript/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Take the following IPv4 address: 128.32.10.1 This address has 4 octets where each octet is a single byte (or 8 bits).&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1st octet 128 has the binary representation: 10000000&lt;/li&gt;&#xA;&lt;li&gt;2nd octet 32 has the binary representation: 00100000&lt;/li&gt;&#xA;&lt;li&gt;3rd octet 10 has the binary representation: 00001010&lt;/li&gt;&#xA;&lt;li&gt;4th octet 1 has the binary representation: 00000001&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So 128.32.10.1 == 10000000.00100000.00001010.00000001&lt;/p&gt;&#xA;&lt;p&gt;Because the above IP address has 32 bits, we can represent it as the 32 bit number: 2149583361.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve the Grouped by Commas Challenge in Javascript</title>
      <link>https://andrewodendaal.com/how-to-solve-the-grouped-by-commas-challenge-in-javascript/</link>
      <pubDate>Mon, 09 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-the-grouped-by-commas-challenge-in-javascript/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Finish the solution so that it takes an input &lt;code&gt;n&lt;/code&gt; (integer) and returns a string that is the decimal representation of the number grouped by commas after every 3 digits.&lt;/p&gt;&#xA;&lt;p&gt;Assume: &lt;code&gt;0 &amp;lt;= n &amp;lt; 2147483647&lt;/code&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;       1  -&amp;gt;           &amp;#34;1&amp;#34;&#xA;      10  -&amp;gt;          &amp;#34;10&amp;#34;&#xA;     100  -&amp;gt;         &amp;#34;100&amp;#34;&#xA;    1000  -&amp;gt;       &amp;#34;1,000&amp;#34;&#xA;   10000  -&amp;gt;      &amp;#34;10,000&amp;#34;&#xA;  100000  -&amp;gt;     &amp;#34;100,000&amp;#34;&#xA; 1000000  -&amp;gt;   &amp;#34;1,000,000&amp;#34;&#xA;35235235  -&amp;gt;  &amp;#34;35,235,235&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-javascript&#34;&gt;The solution in Javascript&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Save sed Output Directly to a File</title>
      <link>https://andrewodendaal.com/how-to-save-sed-output-directly-to-a-file/</link>
      <pubDate>Sun, 08 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-save-sed-output-directly-to-a-file/</guid>
      <description>&lt;p&gt;You have 3 options here:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-use-tee-with-sed&#34;&gt;Option 1: use &lt;code&gt;tee&lt;/code&gt; with sed&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sed &amp;#39;s/Hello/Hi/g&amp;#39; file-name | tee file&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-use--with-sed&#34;&gt;Option 2: use &lt;code&gt;&amp;gt;&lt;/code&gt; with sed&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sed &amp;#39;s/Hello/Hi/g&amp;#39; file-name &amp;gt; file&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-use-sed-with--i-option&#34;&gt;Option 3: use &lt;code&gt;sed&lt;/code&gt; with &lt;code&gt;-i&lt;/code&gt; option&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sed -i &amp;#39;s/Hello/Hi/g&amp;#39; file-name&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Convert BigNumber to Int/Number in Ethers/Web3</title>
      <link>https://andrewodendaal.com/how-to-convert-bignumber-to-int-number-in-ethers-web3/</link>
      <pubDate>Sat, 07 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-bignumber-to-int-number-in-ethers-web3/</guid>
      <description>&lt;p&gt;If you have a &lt;code&gt;BigNumber&lt;/code&gt; when using &lt;code&gt;web3&lt;/code&gt;, then you can convert this to a regular Javascript &lt;code&gt;Number&lt;/code&gt; using the &lt;code&gt;ethers&lt;/code&gt; library as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ethers.BigNumber.from(max).toNumber()&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;&amp;lt;a href=&amp;quot;https://github.com/ethers-io/ethers.js/&amp;quot; target=&amp;quot;_blank&amp;quot; rel=&amp;quot;noreferrer noopener nofollow&amp;quot;&amp;gt;Ethers&amp;lt;/a&amp;gt;&lt;/code&gt; is a complete Ethereum library and wallet implementation in Javascript.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create a Pyramid Array in Javascript</title>
      <link>https://andrewodendaal.com/how-to-create-a-pyramid-array-in-javascript/</link>
      <pubDate>Fri, 06 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-pyramid-array-in-javascript/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that when given a number &amp;gt;= 0, returns an Array of ascending length subarrays.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;pyramid(0) =&amp;gt; [ ]&#xA;pyramid(1) =&amp;gt; [ [1] ]&#xA;pyramid(2) =&amp;gt; [ [1], [1, 1] ]&#xA;pyramid(3) =&amp;gt; [ [1], [1, 1], [1, 1, 1] ]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; the subarrays should be filled with &lt;code&gt;1&lt;/code&gt;s&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-javascript&#34;&gt;The solution in Javascript&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function pyramid(n) {&#xA;  const res = [];&#xA;  for(let i = 0; i &amp;lt; n; i++){&#xA;    res.push([...Array(i+1)].fill(1))&#xA;  }&#xA;  return res;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create a Reverse Polish Notation Calculator in Javascript</title>
      <link>https://andrewodendaal.com/how-to-create-a-reverse-polish-notation-calculator-in-javascript/</link>
      <pubDate>Thu, 05 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-reverse-polish-notation-calculator-in-javascript/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Your job is to create a calculator which evaluates expressions in &lt;!-- raw HTML omitted --&gt;Reverse Polish notation&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For example expression &lt;code&gt;5 1 2 + 4 * + 3 -&lt;/code&gt; (which is equivalent to &lt;code&gt;5 + ((1 + 2) * 4) - 3&lt;/code&gt; in normal notation) should evaluate to &lt;code&gt;14&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For your convenience, the input is formatted such that a space is provided between every token.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to declare a global variable in React?</title>
      <link>https://andrewodendaal.com/how-to-declare-a-global-variable-in-react/</link>
      <pubDate>Wed, 04 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-declare-a-global-variable-in-react/</guid>
      <description>&lt;p&gt;If you need to declare a global variable in React, then you can do the following:&lt;/p&gt;&#xA;&lt;p&gt;Create a file called &lt;code&gt;config.js&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;module.exports = global.config = {&#xA;    something: {&#xA;        somethingelse: {&#xA;            amount: 123,&#xA;            name: &amp;#34;Andrew&amp;#34;&#xA;        }&#xA;    }&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then import the config file where you need it:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import &amp;#39;./config&amp;#39;;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then where you need it in your code:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;global.config.something.somethingelse.amount&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;or&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;global.config.something.somethingelse.name&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Find the Missing Term in an Arithmetic Progression in Javascript</title>
      <link>https://andrewodendaal.com/how-to-find-the-missing-term-in-an-arithmetic-progression-in-javascript/</link>
      <pubDate>Tue, 03 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-missing-term-in-an-arithmetic-progression-in-javascript/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;An Arithmetic Progression is defined as one in which there is a constant difference between the consecutive terms of a given series of numbers. You are provided with consecutive elements of an Arithmetic Progression. There is however one hitch: exactly one term from the original series is missing from the set of numbers that have been given to you. The rest of the given series is the same as the original AP. Find the missing term.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Count Characters in a Javascript String</title>
      <link>https://andrewodendaal.com/how-to-count-characters-in-a-javascript-string/</link>
      <pubDate>Mon, 02 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-count-characters-in-a-javascript-string/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The main idea is to count all the occurring characters in a string. If you have a string like &lt;code&gt;aba&lt;/code&gt;, then the result should be &lt;code&gt;{&#39;a&#39;: 2, &#39;b&#39;: 1}&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;What if the string is empty? Then the result should be an empty object literal, &lt;code&gt;{}&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-javascript&#34;&gt;The solution in Javascript&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function count (string) {  &#xA;  var count = {};&#xA;  string.split(&amp;#39;&amp;#39;).forEach(function(s) {&#xA;     count[s] ? count[s]++ : count[s] = 1;&#xA;  });&#xA;  return count;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Increment/Decrement a value in React/NextJS</title>
      <link>https://andrewodendaal.com/how-to-increment-decrement-a-value-in-react-nextjs/</link>
      <pubDate>Sun, 01 May 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-increment-decrement-a-value-in-react-nextjs/</guid>
      <description>&lt;p&gt;Use the following code block to get started:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function GetCount() {&#xA;  const [count, setCount] = useState(1);&#xA;&#xA;  const incrementCounter = () =&amp;gt; {&#xA;    setCount(count+1)&#xA;  }&#xA;  const decrementCounter = () =&amp;gt; {&#xA;    if (count&amp;gt;1) setCount(count-1)&#xA;  }&#xA;&#xA;  return &amp;lt;div className=&amp;#34;_counterWrapper&amp;#34;&amp;gt;&#xA;    &amp;lt;span className=&amp;#34;_dec&amp;#34; onClick={() =&amp;gt; decrementCounter()}&amp;gt;-&amp;lt;/span&amp;gt;&#xA;    &amp;lt;span className=&amp;#34;_val&amp;#34;&amp;gt;{count}&amp;lt;/span&amp;gt;&#xA;    &amp;lt;span className=&amp;#34;_inc&amp;#34; onClick={() =&amp;gt; incrementCounter()}&amp;gt;+&amp;lt;/span&amp;gt;&#xA;  &amp;lt;/div&amp;gt;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then in your HTML code, add it like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;GetCount /&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to disable text selection highlighting in CSS</title>
      <link>https://andrewodendaal.com/how-to-disable-text-selection-highlighting-in-css/</link>
      <pubDate>Sat, 30 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-disable-text-selection-highlighting-in-css/</guid>
      <description>&lt;p&gt;If you would like to disable the text selection highlighting that is enabled by default on all browsers, then you can do this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;user-select: none;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you are concerned about cross-browser support, then use this class:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;.noselect {&#xA;  -webkit-touch-callout: none; /* iOS Safari */&#xA;    -webkit-user-select: none; /* Safari */&#xA;     -khtml-user-select: none; /* Konqueror HTML */&#xA;       -moz-user-select: none; /* Old versions of Firefox */&#xA;        -ms-user-select: none; /* Internet Explorer/Edge */&#xA;            user-select: none; /* Non-prefixed version, currently&#xA;                                  supported by Chrome, Edge, Opera and Firefox */&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can then use it like this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Irreducible Sum of Rationals in Golang</title>
      <link>https://andrewodendaal.com/irreducible-sum-of-rationals-in-golang/</link>
      <pubDate>Fri, 29 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/irreducible-sum-of-rationals-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You will have a list of rationals in the form:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;lst = [ [numer_1, denom_1] , ... , [numer_n, denom_n] ]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;where all numbers are positive integers. You have to produce their sum &lt;code&gt;N / D&lt;/code&gt; in an irreducible form: this means that &lt;code&gt;N&lt;/code&gt; and &lt;code&gt;D&lt;/code&gt; have only &lt;code&gt;1&lt;/code&gt; as a common divisor.&lt;/p&gt;&#xA;&lt;p&gt;Return the result in the form: &lt;code&gt;&amp;quot;N/D&amp;quot;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;If the result is an integer (&lt;code&gt;D&lt;/code&gt; evenly divides &lt;code&gt;N&lt;/code&gt;) return: &lt;code&gt;&amp;quot;n&amp;quot;&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to copy S3 objects between AWS accounts</title>
      <link>https://andrewodendaal.com/how-to-copy-s3-objects-between-aws-accounts/</link>
      <pubDate>Thu, 28 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-copy-s3-objects-between-aws-accounts/</guid>
      <description>&lt;p&gt;In your source account create a &lt;code&gt;customer-managed policy&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&#xA;    &amp;#34;Version&amp;#34;: &amp;#34;2012-10-17&amp;#34;,&#xA;    &amp;#34;Statement&amp;#34;: [&#xA;        {&#xA;            &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,&#xA;            &amp;#34;Action&amp;#34;: [&#xA;                &amp;#34;s3:ListBucket&amp;#34;,&#xA;                &amp;#34;s3:GetObject&amp;#34;&#xA;            ],&#xA;            &amp;#34;Resource&amp;#34;: [&#xA;                &amp;#34;arn:aws:s3:::source-EXAMPLE-BUCKET&amp;#34;,&#xA;                &amp;#34;arn:aws:s3:::source-EXAMPLE-BUCKET/*&amp;#34;&#xA;            ]&#xA;        },&#xA;        {&#xA;            &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,&#xA;            &amp;#34;Action&amp;#34;: [&#xA;                &amp;#34;s3:ListBucket&amp;#34;,&#xA;                &amp;#34;s3:PutObject&amp;#34;,&#xA;                &amp;#34;s3:PutObjectAcl&amp;#34;&#xA;            ],&#xA;            &amp;#34;Resource&amp;#34;: [&#xA;                &amp;#34;arn:aws:s3:::destination-EXAMPLE-BUCKET&amp;#34;,&#xA;                &amp;#34;arn:aws:s3:::destination-EXAMPLE-BUCKET/*&amp;#34;&#xA;            ]&#xA;        }&#xA;    ]&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In your destination bucket, update the &lt;code&gt;bucket policy&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&#xA;    &amp;#34;Version&amp;#34;: &amp;#34;2012-10-17&amp;#34;,&#xA;    &amp;#34;Statement&amp;#34;: [&#xA;        {&#xA;            &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,&#xA;            &amp;#34;Principal&amp;#34;: {&#xA;                &amp;#34;AWS&amp;#34;: &amp;#34;arn:aws:iam::1234567890:user/Andrew&amp;#34;&#xA;            },&#xA;            &amp;#34;Action&amp;#34;: &amp;#34;s3:PutObject&amp;#34;,&#xA;            &amp;#34;Resource&amp;#34;: &amp;#34;arn:aws:s3:::destination-EXAMPLE-BUCKET/*&amp;#34;,&#xA;            &amp;#34;Condition&amp;#34;: {&#xA;                &amp;#34;StringEquals&amp;#34;: {&#xA;                    &amp;#34;s3:x-amz-acl&amp;#34;: &amp;#34;bucket-owner-full-control&amp;#34;&#xA;                }&#xA;            }&#xA;        },&#xA;        {&#xA;            &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,&#xA;            &amp;#34;Principal&amp;#34;: {&#xA;                &amp;#34;AWS&amp;#34;: &amp;#34;arn:aws:iam::1234567890:user/Andrew&amp;#34;&#xA;            },&#xA;            &amp;#34;Action&amp;#34;: &amp;#34;s3:ListBucket&amp;#34;,&#xA;            &amp;#34;Resource&amp;#34;: &amp;#34;arn:aws:s3:::destination-EXAMPLE-BUCKET&amp;#34;&#xA;        }&#xA;    ]&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Testing the S3 copy between accounts:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to find all symlinks in a directory tree on Mac</title>
      <link>https://andrewodendaal.com/how-to-find-all-symlinks-in-a-directory-tree-on-mac/</link>
      <pubDate>Wed, 27 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-all-symlinks-in-a-directory-tree-on-mac/</guid>
      <description>&lt;p&gt;If you need to recursively find all symbolic links in a directory tree on a Mac, then you have a couple of options.&lt;/p&gt;&#xA;&lt;p&gt;You could be trying to find them because a tool like Dropbox is consuming high CPU and you need to remove them, or perhaps you want to move a directory to another machine or network drive and verifying a package is required.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-view-all-files-that-are-symlinks&#34;&gt;Option 1 – View all files that are symlinks&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ls -lR . | grep ^l&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-view-all-symlink-files-as-absolute-paths&#34;&gt;Option 2 – View all symlink-files as absolute paths&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;find . -type l -ls&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Install App Mesh on AWS EKS</title>
      <link>https://andrewodendaal.com/how-to-install-app-mesh-on-aws-eks/</link>
      <pubDate>Tue, 26 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-install-app-mesh-on-aws-eks/</guid>
      <description>&lt;p&gt;You can follow the steps below to install App Mesh on AWS EKS (Kubernetes).&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-prerequisites&#34;&gt;Step 1 – Prerequisites&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;curl -o pre_upgrade_check.sh https://raw.githubusercontent.com/aws/eks-charts/master/stable/appmesh-controller/upgrade/pre_upgrade_check.sh&#xA;sh ./pre_upgrade_check.sh&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-add-helm-repo&#34;&gt;Step 2 – Add Helm Repo&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;helm repo add eks https://aws.github.io/eks-charts&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-3-8211-add-custom-resource-definitions-crds&#34;&gt;Step 3 – Add Custom Resource Definitions (CRDs)&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl apply -k &amp;#34;https://github.com/aws/eks-charts/stable/appmesh-controller/crds?ref=master&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-4-8211-create-a-namespace-for-app-mesh&#34;&gt;Step 4 – Create a Namespace for App Mesh&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl create ns appmesh-system&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-5-8211-set-environment-variables&#34;&gt;Step 5 – Set Environment Variables&lt;/h2&gt;&#xA;&lt;p&gt;You will need to set a couple of environment variables to make things easier later.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] Kubernetes Namespace stuck in Terminating state</title>
      <link>https://andrewodendaal.com/solved-kubernetes-namespace-stuck-in-terminating-state/</link>
      <pubDate>Mon, 25 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-kubernetes-namespace-stuck-in-terminating-state/</guid>
      <description>&lt;p&gt;If you have tried to delete a Kubernetes namespace, and it has been hanging in ‘deleting&amp;rsquo; for hours on end, it&amp;rsquo;s likely that you have dangling resources that have not deleted yet.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ kubectl get ns&#xA;NAME              STATUS        AGE&#xA;apps              Active        2d19h&#xA;default           Active        3d8h&#xA;my-apps           Terminating   11h&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will prevent the namespace from being removed.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-find-resources-that-need-to-be-deleted&#34;&gt;How to find resources that need to be deleted&lt;/h2&gt;&#xA;&lt;p&gt;You can chain the &lt;code&gt;api-resources&lt;/code&gt; verbs along with a &lt;code&gt;kubectl get&lt;/code&gt; to find dangling resources:&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] Error creating: pods “my-service-a-xxx” is forbidden: error looking up service account my-apps/my-service-a: serviceaccount “my-service-a” not found</title>
      <link>https://andrewodendaal.com/solved-error-creating-pods-my-service-a-xxx-is-forbidden-error-looking-up-service-account-my-apps-my-service-a-serviceaccount-my-service-a-not-found/</link>
      <pubDate>Sun, 24 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-error-creating-pods-my-service-a-xxx-is-forbidden-error-looking-up-service-account-my-apps-my-service-a-serviceaccount-my-service-a-not-found/</guid>
      <description>&lt;p&gt;So you&amp;rsquo;ve run a &lt;code&gt;deployment&lt;/code&gt; and tried to check the &lt;code&gt;pods&lt;/code&gt; and there&amp;rsquo;s nothing there!&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;kubectl get pods&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Next step is to see what&amp;rsquo;s happening with the &lt;code&gt;replicaset&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;kubectl get rs&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then take the replicaset name and do a &lt;code&gt;describe&lt;/code&gt; on it:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;kubectl describe rs my-service-a-5549cbc6c8&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-error&#34;&gt;The error&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Events:&#xA;  Type     Reason            Age           From         Message&#xA;  ----     ------            ----          ----         -------&#xA;  Warning  FailedCreate      2m10s..  replicaset-controller  Error creating: pods &amp;#34;my-service-a-5549cbc6c8-&amp;#34; is forbidden: error looking up service account my-apps/my-service-a: serviceaccount &amp;#34;my-service-a&amp;#34; not found&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It&amp;rsquo;s down to a missing Service Account!&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] error: src refspec main does not match any</title>
      <link>https://andrewodendaal.com/solved-error-src-refspec-main-does-not-match-any/</link>
      <pubDate>Sat, 23 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-error-src-refspec-main-does-not-match-any/</guid>
      <description>&lt;p&gt;If you get the following error:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;error: src refspec main does not match any&#xA;error: failed to push some refs to &amp;#39;https://github.com/ao/xxx.git&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is because you probably haven&amp;rsquo;t committed any files to git yet!&lt;/p&gt;&#xA;&lt;h2 id=&#34;fix-for-src-refspec-main-does-not-match-any&#34;&gt;Fix for: &lt;code&gt;src refspec main does not match any&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Make sure to add your files, if they have not been added yet:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git add .&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Commit your files:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git commit -m &amp;#34;your commit message&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Push your changes to the git repo, remember to swap out the branch name as appropriate:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Force a Redeploy in Kubernetes</title>
      <link>https://andrewodendaal.com/how-to-force-a-redeploy-in-kubernetes/</link>
      <pubDate>Fri, 22 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-force-a-redeploy-in-kubernetes/</guid>
      <description>&lt;p&gt;If you need to force a redeploy of a &lt;a href=&#34;https://andrewodendaal.com/teach-me-kubernetes-part6-deployments&#34;&gt;deployment in Kubernetes&lt;/a&gt;, then you can use the &lt;code&gt;rollout&lt;/code&gt; feature.&lt;/p&gt;&#xA;&lt;p&gt;You may have an image that has been updated, but without changing the tag/version.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-optionally-update-the-imagepullpolicy&#34;&gt;Step 1 – Optionally update the &lt;code&gt;imagePullPolicy&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;If you have not changed the image version, then check your &lt;code&gt;imagePullPolicy&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In your &lt;code&gt;deployment.yaml&lt;/code&gt; file:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;containers:&#xA;  - name: backend&#xA;    image: aoms/mock_backend_python:latest&#xA;    imagePullPolicy: Always&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-get-the-deployment-name&#34;&gt;Step 2 – Get the deployment name&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl get deploy&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-3-8211-force-the-redeployment&#34;&gt;Step 3 – Force the Redeployment&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl rollout restart deploy backend&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Print to stdout in Flask using Python</title>
      <link>https://andrewodendaal.com/how-to-print-to-stdout-in-flask-using-python/</link>
      <pubDate>Thu, 21 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-print-to-stdout-in-flask-using-python/</guid>
      <description>&lt;p&gt;If you are trying to &lt;code&gt;print()&lt;/code&gt; to the console/stdout in your Flask app, but nothing is happening, then you just need to &lt;code&gt;flush&lt;/code&gt; your prints, as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;print(&amp;#39;This will print&amp;#39;, flush=True)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Restart a Deployment in Kubernetes</title>
      <link>https://andrewodendaal.com/how-to-restart-a-deployment-in-kubernetes/</link>
      <pubDate>Wed, 20 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-restart-a-deployment-in-kubernetes/</guid>
      <description>&lt;p&gt;If you need to restart a deployment in Kubernetes, perhaps because you would like to force a cycle of pods, then you can do the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-get-the-deployment-name&#34;&gt;Step 1 – Get the deployment name&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl get deployment&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-restart-the-deployment&#34;&gt;Step 2 – Restart the deployment&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl rollout restart deployment &amp;lt;deployment_name&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to push multiple Dockerfile apps to AWS ECR at the same time</title>
      <link>https://andrewodendaal.com/how-to-push-multiple-dockerfile-apps-to-aws-ecr-at-the-same-time/</link>
      <pubDate>Tue, 19 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-push-multiple-dockerfile-apps-to-aws-ecr-at-the-same-time/</guid>
      <description>&lt;p&gt;I have a parent directory containing multiple sub-directories. Each of these child directories is a different application and contains a &lt;code&gt;Dockerfile&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I want to build and push each image to AWS ECR.&lt;/p&gt;&#xA;&lt;p&gt;The directory looks as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;├── apps&#xA;    ├── microservice1&#xA;        ├── app.js&#xA;        ├── Dockerfile&#xA;        ├── package.json&#xA;        └── readiness.txt&#xA;    ├── frontend&#xA;        ├── Dockerfile&#xA;        ├── index.html&#xA;        ├── package.json&#xA;        ├── server.js&#xA;    ├── microservice2&#xA;        ├── app.py&#xA;        ├── bootstrap.sh&#xA;        ├── Dockerfile&#xA;        └── requirements.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Notice there are 3 apps, each with their own &lt;code&gt;Dockerfile&lt;/code&gt;, under the parent &lt;code&gt;apps&lt;/code&gt; directory.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create a Horizontal Pod Autoscaler in Kubernetes</title>
      <link>https://andrewodendaal.com/how-to-create-a-horizontal-pod-autoscaler-in-kubernetes/</link>
      <pubDate>Mon, 18 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-horizontal-pod-autoscaler-in-kubernetes/</guid>
      <description>&lt;p&gt;If you could like to a create a Horizontal Pod Autoscaler (&lt;code&gt;hpa&lt;/code&gt;) in Kubernetes, then you could run the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-create-a-deployment&#34;&gt;Step 1 – Create a Deployment&lt;/h2&gt;&#xA;&lt;p&gt;If you already have a deployment, then ignore this step, otherwise:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl create deployment php-apache --image=us.gcr.io/k8s-artifacts-prod/hpa-example&#xA;kubectl set resources deploy php-apache --requests=cpu=200m&#xA;kubectl expose deploy php-apache --port 80&#xA;&#xA;kubectl get pod -l app=php-apache&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-create-a-horizontal-pod-autoscaler&#34;&gt;Step 2 – Create a Horizontal Pod Autoscaler&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl autoscale deployment php-apache `#The target average CPU utilization` \&#xA;    --cpu-percent=50 \&#xA;    --min=1 `#The lower limit for the number of pods that can be set by the autoscaler` \&#xA;    --max=10 `#The upper limit for the number of pods that can be set by the autoscaler`&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-3-8211-get-your-hpa&#34;&gt;Step 3 – Get your &lt;code&gt;hpa&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl get hpa&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Run a Load Generator on Kubernetes</title>
      <link>https://andrewodendaal.com/how-to-run-a-load-generator-on-kubernetes/</link>
      <pubDate>Sun, 17 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-run-a-load-generator-on-kubernetes/</guid>
      <description>&lt;p&gt;If you would like to test &lt;code&gt;hpa&lt;/code&gt;, Horizontal Pod Autoscaling, or throw some chaos at a specific &lt;a href=&#34;https://andrewodendaal.com/teach-me-kubernetes-part6-deployments&#34;&gt;deployment in Kubernetes&lt;/a&gt;, then you could run a Load Generator&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-run-a-busybox-container&#34;&gt;Step 1 – Run a BusyBox container&lt;/h2&gt;&#xA;&lt;p&gt;The following command will use a &lt;code&gt;busybox&lt;/code&gt; container and dump you into it&amp;rsquo;s shell window:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl run -i --tty load-generator --image=busybox /bin/sh&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As an alternative, you could also run:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl --generator=run-pod/v1 run -i --tty load-generator --image=busybox /bin/sh&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-run-a-wget-loop&#34;&gt;Step 2 – Run a &lt;code&gt;wget&lt;/code&gt; loop&lt;/h2&gt;&#xA;&lt;p&gt;You can now trigger a &lt;code&gt;wget&lt;/code&gt; loop to make HTTP request calls to your deployment:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Deploy a Metrics Server in Kubernetes</title>
      <link>https://andrewodendaal.com/how-to-deploy-a-metrics-server-in-kubernetes/</link>
      <pubDate>Sat, 16 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-deploy-a-metrics-server-in-kubernetes/</guid>
      <description>&lt;p&gt;If you would like to deploy a Metrics Server in &lt;a href=&#34;https://andrewodendaal.com/tags/kubernetes&#34;&gt;Kubernetes&lt;/a&gt;, then you first need to create a namespace for it to live it, followed by installing the actual metrics server.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-install-the-metrics-server&#34;&gt;Step 1 – Install the Metrics Server&lt;/h2&gt;&#xA;&lt;p&gt;Using &lt;code&gt;kubectl&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.5.0/components.yaml&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Using &lt;code&gt;helm&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl create namespace metrics&#xA;&#xA;helm install metrics-server \&#xA;    stable/metrics-server \&#xA;    --version 2.9.0 \&#xA;    --namepsace metrics&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-get-the-metrics-server-status&#34;&gt;Step 2 – Get the Metrics Server Status&lt;/h2&gt;&#xA;&lt;p&gt;If you used &lt;code&gt;kubectl&lt;/code&gt; above, then you should be able to run:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create an AWS EKS cluster using eksctl</title>
      <link>https://andrewodendaal.com/how-to-create-an-aws-eks-cluster-using-eksctl/</link>
      <pubDate>Fri, 15 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-an-aws-eks-cluster-using-eksctl/</guid>
      <description>&lt;p&gt;&lt;code&gt;eksctl&lt;/code&gt; dramatically simplifies the creation of AWS EKS clusters, by providing a simple command-line interface.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-define-a-cluster-yaml&#34;&gt;Step 1 – Define a Cluster YAML&lt;/h2&gt;&#xA;&lt;p&gt;You can either create a file called &lt;code&gt;ekscluster.yaml&lt;/code&gt; and place the YAML in, or run the following command which will create a file called &lt;code&gt;ekscluster.yaml&lt;/code&gt; and automatically add the default YAML configuration for you.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;cat &amp;lt;&amp;lt; EOF &amp;gt; ekscluster.yaml&#xA;---&#xA;apiVersion: eksctl.io/v1alpha5&#xA;kind: ClusterConfig&#xA;&#xA;metadata:&#xA;  name: eksworkshop-eksctl&#xA;  region: ${AWS_REGION}&#xA;  version: &amp;#34;1.19&amp;#34;&#xA;&#xA;availabilityZones: [&amp;#34;${AZS[0]}&amp;#34;, &amp;#34;${AZS[1]}&amp;#34;, &amp;#34;${AZS[2]}&amp;#34;]&#xA;&#xA;managedNodeGroups:&#xA;- name: nodegroup&#xA;  desiredCapacity: 3&#xA;  instanceType: t3.small&#xA;  ssh:&#xA;    enableSsm: true&#xA;&#xA;# To enable all of the control plane logs, uncomment below:&#xA;# cloudWatch:&#xA;#  clusterLogging:&#xA;#    enableTypes: [&amp;#34;*&amp;#34;]&#xA;&#xA;secretsEncryption:&#xA;  keyARN: ${MASTER_ARN}&#xA;EOF&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2-8211-create-the-eks-cluster&#34;&gt;Step 2 – Create the EKS Cluster&lt;/h2&gt;&#xA;&lt;p&gt;Tell the &lt;code&gt;eksctl&lt;/code&gt; tool to create a new cluster using the &lt;code&gt;ekscluster.yaml&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Dockerize a Flask App</title>
      <link>https://andrewodendaal.com/how-to-dockerize-a-flask-app/</link>
      <pubDate>Thu, 14 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-dockerize-a-flask-app/</guid>
      <description>&lt;p&gt;If you have a Flask app that you would like packaged in a Docker container, then you can do the following. The steps outlined below will help you create the following directory tree:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;└── flaskapp&#xA;        ├── Dockerfile&#xA;        ├── app.py&#xA;        └── requirements.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-1-8211-create-your-flask-app&#34;&gt;Step 1 – Create your Flask app&lt;/h2&gt;&#xA;&lt;p&gt;In a new directory, create the following files:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;app.py&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from flask import Flask&#xA;app = Flask(__name__)&#xA;&#xA;@app.route(&amp;#39;/&amp;#39;)&#xA;def hello_geek():&#xA;  return &amp;#39;&amp;lt;h1&amp;gt;Hello world!&amp;lt;/h2&amp;gt;&amp;#39;&#xA;&#xA;if __name__ == &amp;#34;__main__&amp;#34;:&#xA;  app.run(debug=True)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;requirements.txt&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get an EKS Cluster name from an AWS Region</title>
      <link>https://andrewodendaal.com/how-to-get-an-eks-cluster-name-from-an-aws-region/</link>
      <pubDate>Wed, 13 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-an-eks-cluster-name-from-an-aws-region/</guid>
      <description>&lt;p&gt;You can use the &lt;code&gt;aws cli&lt;/code&gt; to get the EKS cluster name, parse the first result and return it into a variable.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;EKS_CLUSTER_NAME=$(aws eks list-clusters --region us-west-2 --query clusters[0] --output text)&#xA;echo $EKS_CLUSTER_NAME&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to automatically generate a Manifests file in Kubernetes</title>
      <link>https://andrewodendaal.com/how-to-automatically-generate-a-manifests-file-in-kubernetes/</link>
      <pubDate>Tue, 12 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-automatically-generate-a-manifests-file-in-kubernetes/</guid>
      <description>&lt;p&gt;If you want to automatically generate a manifest file in Kubernetes, you can do so by using the &lt;code&gt;kubectl run&lt;/code&gt; command coupled with a &lt;code&gt;--dry-run&lt;/code&gt; to output directly to &lt;code&gt;yaml&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl run nginx --image=nginx --port=80 --replicas=2 --expose --dry-run -o yaml&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can also output this directly to a file on disk as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl run nginx --image=nginx --port=80 --replicas=2 --expose --dry-run -o yaml &amp;gt; your-deployment-manifest.yaml&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Sort Pods by CreationTimestamp in Kubernetes</title>
      <link>https://andrewodendaal.com/how-to-sort-pods-by-creationtimestamp-in-kubernetes/</link>
      <pubDate>Mon, 11 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-sort-pods-by-creationtimestamp-in-kubernetes/</guid>
      <description>&lt;p&gt;If you need to sort a list of your pods by their CreationTimestamp, then do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl get pods -n kube-system --sort-by=metadata.creationTimestamp&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;A better way to specify the JSON path is:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl get pods -n kube-system --sort-by=&amp;#39;{.metadata.creationTimestamp}&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Jump onto a Kubernetes Pod with Bash</title>
      <link>https://andrewodendaal.com/how-to-jump-onto-a-kubernetes-pod-with-bash/</link>
      <pubDate>Sun, 10 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-jump-onto-a-kubernetes-pod-with-bash/</guid>
      <description>&lt;p&gt;If you want to jump onto a particular &lt;a href=&#34;https://andrewodendaal.com/how-to-connect-to-bash-on-a-kubernetes-pod&#34;&gt;Kubernetes Pod and run Bash&lt;/a&gt; within it, you can do so as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl exec -ti &amp;lt;pod_name&amp;gt; /bin/bash&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can get the &lt;code&gt;&amp;lt;pod_name&amp;gt;&lt;/code&gt; by running &lt;code&gt;kubectl get pods&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to run Shell Commands in a Kubernetes Cluster</title>
      <link>https://andrewodendaal.com/how-to-run-shell-commands-in-a-kubernetes-cluster/</link>
      <pubDate>Sat, 09 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-run-shell-commands-in-a-kubernetes-cluster/</guid>
      <description>&lt;p&gt;If you would like to run shell commands inside of your Kubernetes cluster, then you can use the &lt;code&gt;kubectl run&lt;/code&gt; command.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-the-syntax-looks-like&#34;&gt;What the syntax looks like&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl run --image=&amp;lt;imagename&amp;gt; &amp;lt;name&amp;gt; -restart=Never -it --rm -- /bin/sh -c &amp;#34;&amp;lt;command&amp;gt;&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Breaking this down, you pass in an &lt;code&gt;imagename&lt;/code&gt; which is the container image you would like to execute the commands in, the &lt;code&gt;name&lt;/code&gt; of this temporary container, and then &lt;code&gt;command&lt;/code&gt; you would like to run in it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Bulk Move All Email from One Account to Another using the CLI</title>
      <link>https://andrewodendaal.com/how-to-bulk-move-all-email-from-one-account-to-another-using-the-cli/</link>
      <pubDate>Fri, 08 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-bulk-move-all-email-from-one-account-to-another-using-the-cli/</guid>
      <description>&lt;p&gt;If you find yourself in a position where you need to sync all emails from one account to another, then you can use the &lt;code&gt;imapsync&lt;/code&gt; command-line tool to bulk copy, or move everything for you.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-get-imapsync&#34;&gt;Step 1 – Get &lt;code&gt;imapsync&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;You need to get the &lt;code&gt;imapsync&lt;/code&gt; tool running locally.&lt;/p&gt;&#xA;&lt;p&gt;It can be found here &lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;https://github.com/imapsync/imapsync&#34;&gt;https://github.com/imapsync/imapsync&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Alternatively, if you are using a Mac and have homebrew installed, then you&amp;rsquo;re in luck!&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Install AWS CLI on Linux</title>
      <link>https://andrewodendaal.com/how-to-install-aws-cli-on-linux/</link>
      <pubDate>Thu, 07 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-install-aws-cli-on-linux/</guid>
      <description>&lt;p&gt;You can download and install the AWS CLI on Linux as follows:&lt;/p&gt;&#xA;&lt;h2 id=&#34;perform-the-install&#34;&gt;Perform the install&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;curl &amp;#34;https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip&amp;#34; -o &amp;#34;awscliv2.zip&amp;#34;&#xA;unzip awscliv2.zip&#xA;sudo ./aws/install&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;verify-the-install&#34;&gt;Verify the install&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws --version&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Reboot Networking on Mac from CLI</title>
      <link>https://andrewodendaal.com/how-to-reboot-networking-on-mac-from-cli/</link>
      <pubDate>Wed, 06 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reboot-networking-on-mac-from-cli/</guid>
      <description>&lt;p&gt;If you need to reboot, or restart the networking interface on your Mac, by using the CLI, then you can issue the following commands:&lt;/p&gt;&#xA;&lt;h2 id=&#34;using-the-ifconfig-primary-interface&#34;&gt;Using the &lt;code&gt;ifconfig&lt;/code&gt; primary interface&lt;/h2&gt;&#xA;&lt;h3 id=&#34;tear-down-the-networking-interface&#34;&gt;Tear down the networking interface&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo ifconfig en0 down&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;restart-the-networking-interface&#34;&gt;Restart the networking interface&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo ifconfig en0 up&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;verify-the-networking-restart&#34;&gt;Verify the networking restart&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ifconfig -u en0&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;alternative-without-sudo-using-networksetup&#34;&gt;Alternative without &lt;code&gt;sudo&lt;/code&gt;, using &lt;code&gt;networksetup&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;If you need to perform the same result, but not able to run &lt;code&gt;sudo&lt;/code&gt;, then look to the &lt;code&gt;networksetup&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] fatal: unable to access &lt;git&gt;: SSL certificate problem: self signed certificate in certificate chain</title>
      <link>https://andrewodendaal.com/solved-fatal-unable-to-access-ssl-certificate-problem-self-signed-certificate-in-certificate-chain/</link>
      <pubDate>Tue, 05 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-fatal-unable-to-access-ssl-certificate-problem-self-signed-certificate-in-certificate-chain/</guid>
      <description>&lt;p&gt;If you get the following error:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;fatal: unable to access &amp;lt;git&amp;gt;: SSL certificate problem: self signed certificate in certificate chain&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;..when trying to clone a &lt;code&gt;git&lt;/code&gt; repo, then you can quickly get around it by doing one of the following.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Note that both of these solutions are merely workarounds and should be done at absolute worst case.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;workaround-solution-1&#34;&gt;Workaround Solution 1&lt;/h2&gt;&#xA;&lt;p&gt;Disable SSL verification while running the git clone.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git -c http.sslVerify=false clone &amp;lt;repository-name&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;workaround-solution-2&#34;&gt;Workaround Solution 2&lt;/h2&gt;&#xA;&lt;p&gt;Disable SSL verification globally while running the git clone.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Extract the Files in a Docker Image</title>
      <link>https://andrewodendaal.com/how-to-extract-the-files-in-a-docker-image/</link>
      <pubDate>Mon, 04 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-extract-the-files-in-a-docker-image/</guid>
      <description>&lt;p&gt;Ever needed to extract the files in a Docker container?&lt;/p&gt;&#xA;&lt;p&gt;Docker provides the &lt;code&gt;save&lt;/code&gt; sub-command.&lt;/p&gt;&#xA;&lt;h2 id=&#34;exporting-docker-files-into-a-tar-archive&#34;&gt;Exporting Docker files into a Tar Archive&lt;/h2&gt;&#xA;&lt;p&gt;The examples below use a Docker container called: &lt;code&gt;aoms/hellojava&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Swap this out with your own container as required.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;docker save aoms/hellojava &amp;gt; hellojava.tar&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;hellojava.tar&lt;/code&gt; now contains a list of files found in the Docker image.&lt;/p&gt;&#xA;&lt;h2 id=&#34;taking-it-one-step-further&#34;&gt;Taking it one step further&lt;/h2&gt;&#xA;&lt;p&gt;You can make this a bit better by extracting it into a new directory and untarring automatically:&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] Error response from daemon: No such image: Docker</title>
      <link>https://andrewodendaal.com/solved-error-response-from-daemon-no-such-image-docker/</link>
      <pubDate>Sun, 03 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-error-response-from-daemon-no-such-image-docker/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;ve run into this dreaded error:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Error response from daemon: No such image:&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then you can solve it as follows:&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1&#34;&gt;Step 1&lt;/h2&gt;&#xA;&lt;p&gt;Perform a &lt;code&gt;docker pull -a &amp;lt;org/image&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then perform a &lt;code&gt;docker images -a&lt;/code&gt; to see what the version is.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-2&#34;&gt;Step 2&lt;/h2&gt;&#xA;&lt;p&gt;This issue can occur when it is trying to map &lt;code&gt;tag&lt;/code&gt; to &lt;code&gt;latest&lt;/code&gt;, but a specific version is explicitly listed instead.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;docker tag &amp;lt;org&amp;gt;/&amp;lt;image&amp;gt;:v1 &amp;lt;new_org&amp;gt;/&amp;lt;image&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Make sure to replace &lt;code&gt;:v1&lt;/code&gt; with the specific &lt;code&gt;TAG&lt;/code&gt; that was shown from the &lt;code&gt;docker images&lt;/code&gt; command above.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Bootstrap a Web Server on AWS EC2</title>
      <link>https://andrewodendaal.com/how-to-bootstrap-a-web-server-on-aws-ec2/</link>
      <pubDate>Sat, 02 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-bootstrap-a-web-server-on-aws-ec2/</guid>
      <description>&lt;p&gt;When you launch an EC2 instance, you can use the &lt;code&gt;user-data&lt;/code&gt; to bootstrap a instance creation script.&lt;/p&gt;&#xA;&lt;p&gt;We can use the following code to start a web server and echo out it&amp;rsquo;s instance id:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#!/bin/bash&#xA;yum update -y&#xA;yum install -y httpd&#xA;systemctl start httpd&#xA;systemctl enable httpd&#xA;echo &amp;#34;&amp;lt;h1&amp;gt;Hello World from $(hostname -f)&amp;lt;/h1&amp;gt;&amp;#34; &amp;gt; /var/www/html/index.html&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;steps-to-create-a-new-bootstrapped-instance&#34;&gt;Steps to create a new bootstrapped instance&lt;/h2&gt;&#xA;&lt;h3 id=&#34;step-1-8211-launch-a-new-instance&#34;&gt;Step 1 – Launch a new instance&lt;/h3&gt;&#xA;&lt;p&gt;Login to your EC2 console and click &lt;code&gt;Launch instances&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Update Kubectl Config from AWS EKS</title>
      <link>https://andrewodendaal.com/how-to-update-kubectl-config-from-aws-eks/</link>
      <pubDate>Fri, 01 Apr 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-update-kubectl-config-from-aws-eks/</guid>
      <description>&lt;p&gt;Ever searched for &lt;code&gt;kubectl update config from aws eks&lt;/code&gt; and needed a quick result?&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-8211-validate-aws-cli&#34;&gt;Step 1 – Validate AWS CLI&lt;/h2&gt;&#xA;&lt;p&gt;Make sure that you have valid AWS Credentials setup in your &lt;code&gt;aws cli&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You can check this by typing:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws sts get-caller-identity&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will let you know where your &lt;code&gt;aws cli&lt;/code&gt; is pointing to.&lt;/p&gt;&#xA;&lt;p&gt;You may need to update your &lt;code&gt;~/.aws/credentials&lt;/code&gt; file with a &lt;code&gt;profile_name&lt;/code&gt;, &lt;code&gt;aws_access_key_id&lt;/code&gt;, &lt;code&gt;aws_secret_access_key&lt;/code&gt; and &lt;code&gt;aws_session_token&lt;/code&gt; if these are generated for you by your Single Sign On (SSO).&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Generate a Random String in Java</title>
      <link>https://andrewodendaal.com/how-to-generate-a-random-string-in-java/</link>
      <pubDate>Thu, 31 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-generate-a-random-string-in-java/</guid>
      <description>&lt;p&gt;Java provides many ways to generate random strings.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-using-apache-commons&#34;&gt;1. Using Apache Commons&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public void generatingRandomAlphanumericString_ApacheCommons() {&#xA;    String generatedString = RandomStringUtils.randomAlphanumeric(10);&#xA;    System.out.println(generatedString);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;2-using-java-8&#34;&gt;2. Using Java 8&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public void generatingRandomAlphanumericString_Java8() {&#xA;    int leftLimit = 48; // numeral &amp;#39;0&amp;#39;&#xA;    int rightLimit = 122; // letter &amp;#39;z&amp;#39;&#xA;    int targetStringLength = 10;&#xA;    Random random = new Random();&#xA;&#xA;    String generatedString = random.ints(leftLimit, rightLimit + 1)&#xA;      .filter(i -&amp;gt; (i &amp;lt;= 57 || i &amp;gt;= 65) &amp;amp;&amp;amp; (i &amp;lt;= 90 || i &amp;gt;= 97))&#xA;      .limit(targetStringLength)&#xA;      .collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append)&#xA;      .toString();&#xA;&#xA;    System.out.println(generatedString);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;3-using-plain-java&#34;&gt;3. Using Plain Java&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public void generatingRandomStringUnbounded_PlainJava() {&#xA;    byte[] array = new byte[7]; // length is bounded by 7&#xA;    new Random().nextBytes(array);&#xA;    String generatedString = new String(array, Charset.forName(&amp;#34;UTF-8&amp;#34;));&#xA;&#xA;    System.out.println(generatedString);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Generate a Random String in Python</title>
      <link>https://andrewodendaal.com/how-to-generate-a-random-string-in-python/</link>
      <pubDate>Wed, 30 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-generate-a-random-string-in-python/</guid>
      <description>&lt;p&gt;Python gives the ability to generate random strings out of the box, by using a combination of the &lt;code&gt;string&lt;/code&gt; and &lt;code&gt;random&lt;/code&gt; modules.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import string&#xA;import random&#xA;&#xA;# How many characters do you want&#xA;S = 10&#xA;&#xA;# Call random.choices() string module to find the string in Uppercase + numeric data.  &#xA;ran = &amp;#39;&amp;#39;.join(random.choices(string.ascii_uppercase + string.digits, k = S))    &#xA;&#xA;# Print the result&#xA;print(&amp;#34;The randomly generated string is : &amp;#34; + str(ran))&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Generate a Random Number/String in Terraform</title>
      <link>https://andrewodendaal.com/how-to-generate-a-random-number-string-in-terraform/</link>
      <pubDate>Tue, 29 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-generate-a-random-number-string-in-terraform/</guid>
      <description>&lt;p&gt;If you need to generate a random number or string in Terraform, then you can use the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;resource &amp;#34;random_id&amp;#34; &amp;#34;myrandom&amp;#34; {&#xA;  keepers = {&#xA;    first = &amp;#34;${timestamp()}&amp;#34;&#xA;  }     &#xA;  byte_length = 8&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then refer to it as:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;random_id.myrandom.hex&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>[Solved] Unable to connect to the server: dial tcp: lookup with AWS EKS</title>
      <link>https://andrewodendaal.com/solved-unable-to-connect-to-the-server-dial-tcp-lookup-with-aws-eks/</link>
      <pubDate>Mon, 28 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-unable-to-connect-to-the-server-dial-tcp-lookup-with-aws-eks/</guid>
      <description>&lt;p&gt;If you have received the following error while trying to issue commands to &lt;code&gt;kubectl&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Unable to connect to the server: dial tcp: lookup&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then it may be due to your kube-config being out of date. You might just need to update the local kube-config.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-update-the-local-kube-config&#34;&gt;How to update the local &lt;code&gt;kube-config&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Make sure to replace &lt;code&gt;eu-west-1&lt;/code&gt; with your cluster&amp;rsquo;s region, and replace &lt;code&gt;cluster_name&lt;/code&gt; with the name of your EKS cluster.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws eks --region &amp;#34;eu-west-1&amp;#34; update-kubeconfig --name &amp;#34;cluster_name&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-update-kube-config-from-terraform-state&#34;&gt;How to update &lt;code&gt;kube-config&lt;/code&gt; from Terraform state&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The above code makes use of the Terraform state&amp;rsquo;s output from when you generated the cluster.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Store Terraform State in AWS S3</title>
      <link>https://andrewodendaal.com/how-to-store-terraform-state-in-aws-s3/</link>
      <pubDate>Sun, 27 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-store-terraform-state-in-aws-s3/</guid>
      <description>&lt;p&gt;Storing Terraform states files locally is not recommended. Instead you should use a &lt;code&gt;backend&lt;/code&gt; such as as S3 from AWS.&lt;/p&gt;&#xA;&lt;p&gt;To do this, you just need to add the following &lt;code&gt;backend&lt;/code&gt; information in a &lt;code&gt;terraform&lt;/code&gt; block in your code:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;terraform {&#xA;  backend &amp;#34;s3&amp;#34; {&#xA;    bucket = &amp;#34;mybucket&amp;#34;&#xA;    key    = &amp;#34;path/to/my/key&amp;#34;&#xA;    region = &amp;#34;eu-west-1&amp;#34;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>[Solved] ZipArchive extension: disabled/not installed on Ubuntu</title>
      <link>https://andrewodendaal.com/solved-ziparchive-extension-disabled-not-installed-on-ubuntu/</link>
      <pubDate>Sat, 26 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-ziparchive-extension-disabled-not-installed-on-ubuntu/</guid>
      <description>&lt;p&gt;If you have come across the following error:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;ZipArchive extension:&amp;amp;nbsp;&amp;lt;strong&amp;gt;disabled/not installed&amp;lt;/strong&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;This just means that you are missing the &lt;code&gt;php-zip&lt;/code&gt; module.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-fix-the-ziparchive-extension-problem&#34;&gt;How to fix the ZipArchive extension problem&lt;/h2&gt;&#xA;&lt;p&gt;Run the following command:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo apt-get install -y php-zip&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now restart Apache2, and you&amp;rsquo;re good!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;service apache2 restart&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Calculating Cartesian Neighbors Distance in Golang</title>
      <link>https://andrewodendaal.com/calculating-cartesian-neighbors-distance-in-golang/</link>
      <pubDate>Fri, 25 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/calculating-cartesian-neighbors-distance-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;We have been searching for all the neighboring points in a Cartesian coordinate system. As we know each point in a coordinate system has eight neighboring points when we search it by range equal to 1, but now we will change the range by the third argument of our function (range is always greater than zero). For example, if range &lt;code&gt;= 2&lt;/code&gt;, count of neighboring points &lt;code&gt;= 24&lt;/code&gt;. In this challenge, a grid step is the same (&lt;code&gt;= 1&lt;/code&gt;).&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate Dominant Primes in Golang</title>
      <link>https://andrewodendaal.com/how-to-calculate-dominant-primes-in-golang/</link>
      <pubDate>Thu, 24 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-dominant-primes-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The prime number sequence starts with: &lt;code&gt;2,3,5,7,11,13,17,19...&lt;/code&gt;. Notice that &lt;code&gt;2&lt;/code&gt; is in position &lt;code&gt;one&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;3&lt;/code&gt; occupies position &lt;code&gt;two&lt;/code&gt;, which is a prime-numbered position. Similarly, &lt;code&gt;5&lt;/code&gt;, &lt;code&gt;11&lt;/code&gt; and &lt;code&gt;17&lt;/code&gt; also occupy prime-numbered positions. We shall call primes such as &lt;code&gt;3,5,11,17&lt;/code&gt; dominant primes because they occupy prime-numbered positions in the prime number sequence. Let&amp;rsquo;s call this &lt;code&gt;listA&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;As you can see from listA, for the prime range &lt;code&gt;range(0,10)&lt;/code&gt;, there are &lt;code&gt;only two&lt;/code&gt; dominant primes (&lt;code&gt;3&lt;/code&gt; and &lt;code&gt;5&lt;/code&gt;) and the sum of these primes is: &lt;code&gt;3 + 5 = 8&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] error: src refspec main does not match</title>
      <link>https://andrewodendaal.com/solved-error-src-refspec-main-does-not-match/</link>
      <pubDate>Wed, 23 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-error-src-refspec-main-does-not-match/</guid>
      <description>&lt;p&gt;When you first try and push to a &lt;code&gt;git&lt;/code&gt; repository, you may get the following error message:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;error: src refspec master does not match any.&#xA;error: failed to push some refs to &amp;#39;git@github ... .git&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is because you have not committed your files!&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-fix-src-refspec-main-does-not-match&#34;&gt;How to Fix &lt;code&gt;src refspec main does not match&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git commit -m &amp;#34;initial commit&amp;#34;&#xA;git push origin main&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The above code will commit your files that are staged, before pushing them to your desired branch.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve Simple Square Numbers in Golang</title>
      <link>https://andrewodendaal.com/how-to-solve-simple-square-numbers-in-golang/</link>
      <pubDate>Tue, 22 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-simple-square-numbers-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In this challenge, you will be given a number &lt;code&gt;n&lt;/code&gt; (&lt;code&gt;n &amp;gt; 0&lt;/code&gt;) and your task will be to return the smallest square number &lt;code&gt;N&lt;/code&gt; (&lt;code&gt;N &amp;gt; 0&lt;/code&gt;) such that &lt;code&gt;n + N&lt;/code&gt; is also a perfect square. If there is no answer, return &lt;code&gt;-1&lt;/code&gt; (&lt;code&gt;nil&lt;/code&gt; in Clojure, &lt;code&gt;Nothing&lt;/code&gt; in Haskell, &lt;code&gt;None&lt;/code&gt; in Rust).&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;solve 13 = 36&#xA;&amp;lt;em&amp;gt;; because 36 is the smallest perfect square that can be added to 13 to form a perfect square =&amp;gt; 13 + 36 = 49&amp;lt;/em&amp;gt;&#xA;&#xA;solve 3 = 1 &amp;lt;em&amp;gt;; 3 + 1 = 4, a perfect square&amp;lt;/em&amp;gt;&#xA;solve 12 = 4 &amp;lt;em&amp;gt;; 12 + 4 = 16, a perfect square&amp;lt;/em&amp;gt;&#xA;solve 9 = 16 &#xA;solve 4 = nil&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to perform Function Iteration in Golang</title>
      <link>https://andrewodendaal.com/how-to-perform-function-iteration-in-golang/</link>
      <pubDate>Mon, 21 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-perform-function-iteration-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The purpose of this challenge is to write a higher-order function returning a new function that iterates on a specified function a given number of times. This new function takes in an argument as a seed to start the computation.&lt;/p&gt;&#xA;&lt;p&gt;For instance, consider the function &lt;code&gt;getDouble&lt;/code&gt;. When run twice on value &lt;code&gt;3&lt;/code&gt;, yields &lt;code&gt;12&lt;/code&gt; as shown below.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;getDouble(3) =&amp;gt; 6&#xA;getDouble(6) =&amp;gt; 12&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Let us name the new function &lt;code&gt;createIterator&lt;/code&gt; and we should be able to obtain the same result using &lt;code&gt;createIterator&lt;/code&gt; as shown below:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Determining Integer Depth in Python</title>
      <link>https://andrewodendaal.com/determining-integer-depth-in-python/</link>
      <pubDate>Sun, 20 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/determining-integer-depth-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The &lt;code&gt;depth&lt;/code&gt; of an integer &lt;code&gt;n&lt;/code&gt; is defined to be how many multiples of &lt;code&gt;n&lt;/code&gt; it is necessary to compute before all &lt;code&gt;10&lt;/code&gt; digits have appeared at least once in some multiple.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;let see n=42&#xA;&#xA;Multiple         value         digits     comment&#xA;42*1              42            2,4 &#xA;42*2              84             8         4 existed&#xA;42*3              126           1,6        2 existed&#xA;42*4              168            -         all existed&#xA;42*5              210            0         2,1 existed&#xA;42*6              252            5         2 existed&#xA;42*7              294            9         2,4 existed&#xA;42*8              336            3         6 existed &#xA;42*9              378            7         3,8 existed&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Looking at the above table under &lt;code&gt;digits&lt;/code&gt; column you can find all the digits from `` to &lt;code&gt;9&lt;/code&gt;, Hence it required &lt;code&gt;9&lt;/code&gt; multiples of &lt;code&gt;42&lt;/code&gt; to get all the digits. So the depth of &lt;code&gt;42&lt;/code&gt; is &lt;code&gt;9&lt;/code&gt;. Write a function named &lt;code&gt;computeDepth&lt;/code&gt; which computes the depth of its integer argument. Only positive numbers greater than zero will be passed as an input.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Reverse a singly-linked list in Python</title>
      <link>https://andrewodendaal.com/how-to-reverse-a-singly-linked-list-in-python/</link>
      <pubDate>Sat, 19 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reverse-a-singly-linked-list-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Implement a function &lt;code&gt;reverse_list&lt;/code&gt; that takes a singly-linked list of nodes and returns a matching list in the reverse order.&lt;/p&gt;&#xA;&lt;p&gt;Assume the presence of a class &lt;code&gt;Node&lt;/code&gt;, which exposes the property &lt;code&gt;value&lt;/code&gt;/&lt;code&gt;Value&lt;/code&gt; and &lt;code&gt;next&lt;/code&gt;/&lt;code&gt;Next&lt;/code&gt;. &lt;code&gt;next&lt;/code&gt; must either be set to the next &lt;code&gt;Node&lt;/code&gt; in the list, or to &lt;code&gt;None&lt;/code&gt; (or &lt;code&gt;null&lt;/code&gt;) to indicate the end of the list.&lt;/p&gt;&#xA;&lt;p&gt;To assist in writing tests, a function &lt;code&gt;make_linked_list&lt;/code&gt; (&lt;code&gt;Node.asLinkedList()&lt;/code&gt; in Java) has also been defined, which converts a python list to a linked list of &lt;code&gt;Node&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calculating Simple Time Difference in Python</title>
      <link>https://andrewodendaal.com/calculating-simple-time-difference-in-python/</link>
      <pubDate>Fri, 18 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/calculating-simple-time-difference-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In this challenge, you will be given a series of times at which an alarm goes off. Your task will be to determine the maximum time interval between alarms. Each alarm starts ringing at the beginning of the corresponding minute and rings for exactly one minute. The times in the array are not in chronological order. Ignore duplicate times, if any.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;# If the alarm goes off now, it will not go off for another 23 hours and 59 minutes.&#xA;solve([&amp;#34;14:51&amp;#34;]) = &amp;#34;23:59&amp;#34;&#xA;&#xA;# The max interval that the alarm will not go off is 11 hours and 40 minutes.&#xA;solve([&amp;#34;23:00&amp;#34;,&amp;#34;04:22&amp;#34;,&amp;#34;18:05&amp;#34;,&amp;#34;06:24&amp;#34;]) == &amp;#34;11:40&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In the second example, the alarm goes off &lt;code&gt;4&lt;/code&gt; times in a day.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calculating Odd/Even number of divisors in Python</title>
      <link>https://andrewodendaal.com/calculating-odd-even-number-of-divisors-in-python/</link>
      <pubDate>Thu, 17 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/calculating-odd-even-number-of-divisors-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an integer &lt;code&gt;n&lt;/code&gt; return &lt;code&gt;&amp;quot;odd&amp;quot;&lt;/code&gt; if the number of its divisors is odd. Otherwise, return &lt;code&gt;&amp;quot;even&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: big inputs will be tested.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;All prime numbers have exactly two divisors (hence &lt;code&gt;&amp;quot;even&amp;quot;&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;For &lt;code&gt;n = 12&lt;/code&gt; the divisors are &lt;code&gt;[1, 2, 3, 4, 6, 12]&lt;/code&gt; – &lt;code&gt;&amp;quot;even&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For &lt;code&gt;n = 4&lt;/code&gt; the divisors are &lt;code&gt;[1, 2, 4]&lt;/code&gt; – &lt;code&gt;&amp;quot;odd&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calculate possibilities of throwing a coin N times in Python</title>
      <link>https://andrewodendaal.com/calculate-possibilities-of-throwing-a-coin-n-times-in-python/</link>
      <pubDate>Wed, 16 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/calculate-possibilities-of-throwing-a-coin-n-times-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In this challenge, you will be given an integer n, which is the number of times that is thrown a coin. You will have to return an array of strings for all the possibilities (heads[H] and tails[T]). Examples:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;coin(1) should return {&amp;quot;H&amp;quot;, &amp;quot;T&amp;quot;}&lt;/code&gt;&lt;br&gt;&#xA;&lt;code&gt;coin(2) should return {&amp;quot;HH&amp;quot;, &amp;quot;HT&amp;quot;, &amp;quot;TH&amp;quot;, &amp;quot;TT&amp;quot;}&lt;/code&gt;&lt;br&gt;&#xA;&lt;code&gt;coin(3) should return {&amp;quot;HHH&amp;quot;, &amp;quot;HHT&amp;quot;, &amp;quot;HTH&amp;quot;, &amp;quot;HTT&amp;quot;, &amp;quot;THH&amp;quot;, &amp;quot;THT&amp;quot;, &amp;quot;TTH&amp;quot;, &amp;quot;TTT&amp;quot;}&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;When finished sort them alphabetically.&lt;/p&gt;&#xA;&lt;p&gt;In C and C++ just return a &lt;code&gt;char*&lt;/code&gt; with all elements separated by&lt;code&gt;,&lt;/code&gt; (without space):&lt;br&gt;&#xA;&lt;code&gt;coin(2) should return &amp;quot;HH,HT,TH,TT&amp;quot;&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Convert Integer to Whitespace format in Python</title>
      <link>https://andrewodendaal.com/how-to-convert-integer-to-whitespace-format-in-python/</link>
      <pubDate>Tue, 15 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-integer-to-whitespace-format-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Hereinafter, &lt;code&gt;[space]&lt;/code&gt; refers to &lt;code&gt;&amp;quot; &amp;quot;&lt;/code&gt;, &lt;code&gt;[tab]&lt;/code&gt; refers to &lt;code&gt;&amp;quot;\t&amp;quot;&lt;/code&gt;, and &lt;code&gt;[LF]&lt;/code&gt; refers to &lt;code&gt;&amp;quot;\n&amp;quot;&lt;/code&gt; for illustrative purposes. This does not mean that you can use these placeholders in your solution.&lt;/p&gt;&#xA;&lt;p&gt;In esoteric language called &lt;!-- raw HTML omitted --&gt;Whitespace&lt;!-- raw HTML omitted --&gt;, numbers are represented in the following format:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;first character represents the sign: &lt;code&gt;[space]&lt;/code&gt; for plus, &lt;code&gt;[tab]&lt;/code&gt; for minus;&lt;/li&gt;&#xA;&lt;li&gt;characters after that and until &lt;code&gt;[LF]&lt;/code&gt; are the binary representation of the integer: &lt;code&gt;[space]&lt;/code&gt; for 0, &lt;code&gt;[tab]&lt;/code&gt; for 1.&lt;/li&gt;&#xA;&lt;li&gt;characters after that are the binary representation of the absolute value of the number, with &lt;code&gt;[space]&lt;/code&gt; for 0, &lt;code&gt;[tab]&lt;/code&gt; for 1, the rightmost bit is the least significand bit, and no leading zero bits.&lt;/li&gt;&#xA;&lt;li&gt;the binary representation is immediately followed by &lt;code&gt;[LF]&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;notes&#34;&gt;Notes&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Valid Whitespace number must always have at least two characters: a sign and the terminator. In case there are only two characters, the number is equal to zero.&lt;/li&gt;&#xA;&lt;li&gt;For the purposes of this challenge, zero must always be represented as &lt;code&gt;[space][LF]&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;In Whitespace, only space, tabulation and linefeed are meaningful characters. All other characters are ignored. However, for the purposes of this simple challenge, please do not add any other characters in the output.&lt;/li&gt;&#xA;&lt;li&gt;In this challenge, input will always be a valid negative or positive integer.&lt;/li&gt;&#xA;&lt;li&gt;For your convenience, in this challenge we will use &lt;code&gt;unbleach()&lt;/code&gt; function when evaluating your results. This function replaces whitespace characters with &lt;code&gt;[space]&lt;/code&gt;, &lt;code&gt;[tab]&lt;/code&gt;, and &lt;code&gt;[LF]&lt;/code&gt; to make fail messages more obvious. You can see how it works in Example Test Cases.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;1&lt;/code&gt; in Whitespace is &lt;code&gt;&amp;quot; \t\n&amp;quot;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;`` in Whitespace is &lt;code&gt;&amp;quot; \n&amp;quot;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;-1&lt;/code&gt; in Whitespace is &lt;code&gt;&amp;quot;\t\t\n&amp;quot;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;2&lt;/code&gt; in Whitespace is &lt;code&gt;&amp;quot; \t \n&amp;quot;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;-3&lt;/code&gt; in Whitespace is &lt;code&gt;&amp;quot;\t\t\t\n&amp;quot;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Perform Frog Jumping in Python</title>
      <link>https://andrewodendaal.com/how-to-perform-frog-jumping-in-python/</link>
      <pubDate>Mon, 14 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-perform-frog-jumping-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You have an array of integers and have a frog at the first position&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;[Frog, int, int, int, ..., int]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;The integer itself may tell you the length and the direction of the jump&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;For instance:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt; 2 = jump two indices to the right&#xA;-3 = jump three indices to the left&#xA; 0 = stay at the same position&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Your objective is to find how many jumps are needed to jump out of the array.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate the area of a regular N sides polygon inside a circle of radius R in Python</title>
      <link>https://andrewodendaal.com/how-to-calculate-the-area-of-a-regular-n-sides-polygon-inside-a-circle-of-radius-r-in-python/</link>
      <pubDate>Sun, 13 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-the-area-of-a-regular-n-sides-polygon-inside-a-circle-of-radius-r-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write the following function:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def area_of_polygon_inside_circle(circle_radius, number_of_sides):&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It should calculate the area of a regular polygon of &lt;code&gt;numberOfSides&lt;/code&gt;, &lt;code&gt;number-of-sides&lt;/code&gt;, or &lt;code&gt;number_of_sides&lt;/code&gt; sides inside a circle of radius &lt;code&gt;circleRadius&lt;/code&gt;, &lt;code&gt;circle-radius&lt;/code&gt;, or &lt;code&gt;circle_radius&lt;/code&gt; which passes through all the vertices of the polygon (such a circle is called &lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;circumscribed circle&lt;!-- raw HTML omitted --&gt; or &lt;!-- raw HTML omitted --&gt;circumcircle&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;). The answer should be a number rounded to 3 decimal places.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create an Image Host Filename Generator in Python</title>
      <link>https://andrewodendaal.com/how-to-create-an-image-host-filename-generator-in-python/</link>
      <pubDate>Sat, 12 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-an-image-host-filename-generator-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are developing an image hosting website.&lt;/p&gt;&#xA;&lt;p&gt;You have to create a function for generating random and unique image filenames.&lt;/p&gt;&#xA;&lt;p&gt;Create a function for generating a random 6 character string that will be used to access the photo URL.&lt;/p&gt;&#xA;&lt;p&gt;To make sure the name is not already in use, you are given access to a PhotoManager object.&lt;/p&gt;&#xA;&lt;p&gt;You can call it like so to make sure the name is unique&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Missing Alphabets in Python</title>
      <link>https://andrewodendaal.com/how-to-find-the-missing-alphabets-in-python/</link>
      <pubDate>Fri, 11 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-missing-alphabets-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;h3 id=&#34;task&#34;&gt;Task&lt;/h3&gt;&#xA;&lt;p&gt;Given string &lt;code&gt;s&lt;/code&gt;, which contains only letters from &lt;code&gt;a to z&lt;/code&gt; in lowercase.&lt;/p&gt;&#xA;&lt;p&gt;A set of the alphabet is given by &lt;code&gt;abcdefghijklmnopqrstuvwxyz&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;2 sets of alphabets mean 2 or more alphabets.&lt;/p&gt;&#xA;&lt;p&gt;Your task is to find the missing letter(s). You may need to output them by the order a-z. It is possible that there is more than one missing letter from more than one set of alphabet.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to move MySQL database to another drive</title>
      <link>https://andrewodendaal.com/how-to-move-mysql-database-to-another-drive/</link>
      <pubDate>Thu, 10 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-move-mysql-database-to-another-drive/</guid>
      <description>&lt;h2 id=&#34;step-1&#34;&gt;Step 1:&lt;/h2&gt;&#xA;&lt;p&gt;Login to your MySQL server, enter your password when prompted:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;mysql -u root -p&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Find out where the &lt;code&gt;data directory&lt;/code&gt; is located:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;mysql&amp;gt; select @@datadir;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Output&#xA;+-----------------+&#xA;| @@datadir       |&#xA;+-----------------+&#xA;| /var/lib/mysql/ |&#xA;+-----------------+&#xA;1 row in set (0.00 sec)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;step-2&#34;&gt;Step 2:&lt;/h2&gt;&#xA;&lt;p&gt;Now you can stop the server and check the status:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo systemctl stop mysql&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo systemctl status mysql&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It&amp;rsquo;s time to make a copy to your new mount location:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Sum of Prime-Indexed Elements in Go</title>
      <link>https://andrewodendaal.com/how-to-find-the-sum-of-prime-indexed-elements-in-go/</link>
      <pubDate>Wed, 09 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-sum-of-prime-indexed-elements-in-go/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You will be given an integer array and your task is to return the sum of elements occupying prime-numbered indices.&lt;/p&gt;&#xA;&lt;p&gt;The first element of the array is at index ``.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution &#xA;import &amp;#34;math/big&amp;#34;&#xA;func Solve(arr []int) int {&#xA;  c := 0&#xA;  for i := 0; i &amp;lt; len(arr); i++ {&#xA;    n := arr[i]  &#xA;    if big.NewInt(int64(i)).ProbablyPrime(0) {&#xA;        c += n     &#xA;    }&#xA;  }&#xA;  return c&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Longest Substring in Alphabetical Order in Python</title>
      <link>https://andrewodendaal.com/how-to-find-the-longest-substring-in-alphabetical-order-in-python/</link>
      <pubDate>Tue, 08 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-longest-substring-in-alphabetical-order-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Find the longest substring in alphabetical order.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;the longest alphabetical substring in &lt;code&gt;&amp;quot;asdfaaaabbbbcttavvfffffdf&amp;quot;&lt;/code&gt; is &lt;code&gt;&amp;quot;aaaabbbbctt&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Overview:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;There are tests with strings up to &lt;code&gt;10 000&lt;/code&gt; characters long so your code will need to be efficient.&lt;/p&gt;&#xA;&lt;p&gt;The input will only consist of lowercase characters and will be at least one letter long.&lt;/p&gt;&#xA;&lt;p&gt;If there are multiple solutions, return the one that appears first.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python&#34;&gt;The solution in Python&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calculate the Most Frequent Weekdays in Go</title>
      <link>https://andrewodendaal.com/calculate-the-most-frequent-weekdays-in-go/</link>
      <pubDate>Mon, 07 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/calculate-the-most-frequent-weekdays-in-go/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;What is your favourite day of the week? Check if it&amp;rsquo;s the most frequent day of the week in the year.&lt;/p&gt;&#xA;&lt;p&gt;You are given a year as integer (e. g. 2001). You should return the most frequent day(s) of the week in that year. The result has to be a list of days sorted by the order of days in week (e. g. &lt;code&gt;[&#39;Monday&#39;, &#39;Tuesday&#39;]&lt;/code&gt;, &lt;code&gt;[&#39;Saturday&#39;, &#39;Sunday&#39;]&lt;/code&gt;, &lt;code&gt;[&#39;Monday&#39;, &#39;Sunday&#39;]&lt;/code&gt;). Week starts with Monday.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Return Index of Matching Closing Bracket in Go</title>
      <link>https://andrewodendaal.com/return-index-of-matching-closing-bracket-in-go/</link>
      <pubDate>Sun, 06 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/return-index-of-matching-closing-bracket-in-go/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In this challenge, you will be given a string with brackets and an index of an opening bracket and your task will be to return the index of the matching closing bracket. Both the input and returned index are 0-based. An opening brace will always have a closing brace. Return an error if there is no answer.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;solve(&amp;#34;((1)23(45))(aB)&amp;#34;, 0) = 10 // the opening brace at index 0 matches the closing brace at index 10&#xA;solve(&amp;#34;((1)23(45))(aB)&amp;#34;, 1) = 3 &#xA;solve(&amp;#34;((1)23(45))(aB)&amp;#34;, 2) = -1 // there is no opening bracket at index 2, so return -1&#xA;solve(&amp;#34;((1)23(45))(aB)&amp;#34;, 6) = 9&#xA;solve(&amp;#34;((1)23(45))(aB)&amp;#34;, 11) = 14&#xA;solve(&amp;#34;((&amp;gt;)|?(*&amp;#39;))(yZ)&amp;#34;, 11) = 14&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Input will consist of letters, numbers, and special characters, but no spaces. The only brackets will be &lt;code&gt;(&lt;/code&gt; and &lt;code&gt;)&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Presign an S3 URL in AWS using AWS CLI</title>
      <link>https://andrewodendaal.com/how-to-presign-an-s3-url-in-aws-using-aws-cli/</link>
      <pubDate>Sat, 05 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-presign-an-s3-url-in-aws-using-aws-cli/</guid>
      <description>&lt;p&gt;You can use the AWS CLI to presign URLs so that objects in S3 can be shared publicly even if they are set as private.&lt;/p&gt;&#xA;&lt;p&gt;Presigned URLs are great for sharing private files in an S3 bucket&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws s3 presign s3://&amp;lt;bucket&amp;gt;/&amp;lt;file.jpg&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This can also be coupled with an expiry duration:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws s3 presign s3://&amp;lt;bucket&amp;gt;/&amp;lt;file.jpg&amp;gt; --expires-in 3600&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Download using Aria2c with Multiple Connections</title>
      <link>https://andrewodendaal.com/how-to-download-using-aria2c-with-multiple-connections/</link>
      <pubDate>Fri, 04 Mar 2022 00:06:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-download-using-aria2c-with-multiple-connections/</guid>
      <description>&lt;p&gt;If you use &lt;code&gt;aria2c&lt;/code&gt; to download files using the command-line, then you can also use it to download using multiple connections.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aria2c -x16 -s16 &amp;lt;url&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;-x&lt;/strong&gt;**,&lt;strong&gt; &lt;/strong&gt;–max-connection-per-server=**&lt;/p&gt;&#xA;&lt;p&gt;              The maximum number of connections to one server for each download.  Default: &lt;strong&gt;1&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;-s&lt;/strong&gt;**,&lt;strong&gt; &lt;/strong&gt;–&lt;strong&gt;&lt;strong&gt;-s&lt;/strong&gt;&lt;/strong&gt;plit=**&lt;/p&gt;&#xA;&lt;p&gt;              Download a file using N connections.  Default: &lt;strong&gt;5&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Parse HTML/CSS Colors in Java</title>
      <link>https://andrewodendaal.com/how-to-parse-html-css-colors-in-java/</link>
      <pubDate>Thu, 03 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-parse-html-css-colors-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In this challenge, you parse RGB colors represented by strings. The formats are primarily used in HTML and CSS. Your task is to implement a function that takes a color as a string and returns the parsed color as a map (see Examples).&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;The input string represents one of the following:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;6-digit hexadecimal&lt;/strong&gt; – &amp;ldquo;#RRGGBB&amp;rdquo;&lt;br&gt;&#xA;e.g. &amp;ldquo;#012345&amp;rdquo;, &amp;ldquo;#789abc&amp;rdquo;, &amp;ldquo;#FFA077&amp;rdquo;&lt;br&gt;&#xA;Each pair of digits represents a value of the channel in hexadecimal: 00 to FF&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;3-digit hexadecimal&lt;/strong&gt; – &amp;ldquo;#RGB&amp;rdquo;&lt;br&gt;&#xA;e.g. &amp;ldquo;#012&amp;rdquo;, &amp;ldquo;#aaa&amp;rdquo;, &amp;ldquo;#F5A&amp;rdquo;&lt;br&gt;&#xA;Each digit represents a value 0 to F which translates to 2-digit hexadecimal: 0-&amp;gt;00, 1-&amp;gt;11, 2-&amp;gt;22, and so on.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Preset color name&lt;/strong&gt;&lt;br&gt;&#xA;e.g. &amp;ldquo;red&amp;rdquo;, &amp;ldquo;BLUE&amp;rdquo;, &amp;ldquo;LimeGreen&amp;rdquo;&lt;br&gt;&#xA;You have to use the predefined map &lt;code&gt;PRESET_COLORS&lt;/code&gt; (JavaScript, Python, Ruby), &lt;code&gt;presetColors&lt;/code&gt; (Java, C#, Haskell), or &lt;code&gt;preset-colors&lt;/code&gt; (Clojure). The keys are the names of preset colors &lt;em&gt;in lower-case&lt;/em&gt; and the values are the corresponding colors in 6-digit hexadecimal (same as 1. &amp;ldquo;#RRGGBB&amp;rdquo;).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;parse(&amp;#34;#80FFA0&amp;#34;) === new RGB(128, 255, 160))&#xA;parse(&amp;#34;#3B7&amp;#34;) === new RGB( 51, 187, 119))&#xA;parse(&amp;#34;LimeGreen&amp;#34;) === new RGB( 50, 205,  50))&#xA;&#xA;// RGB class is defined as follows:&#xA;final class RGB {&#xA;    public int r, g, b;&#xA;    &#xA;    public RGB();&#xA;    public RGB(int r, int g, int b);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Solving Simple Transposition in Java</title>
      <link>https://andrewodendaal.com/solving-simple-transposition-in-java/</link>
      <pubDate>Wed, 02 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solving-simple-transposition-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Simple transposition is a basic and simple cryptography technique. We make 2 rows and put first a letter in Row 1, the second in Row 2, third in Row 1, and so on until the end. Then we put the text from Row 2 next to the Row 1 text and that&amp;rsquo;s it.&lt;/p&gt;&#xA;&lt;p&gt;Complete the function that receives a string and encrypts it with this simple transposition.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;For example, if the text to encrypt is: &lt;code&gt;&amp;quot;Simple text&amp;quot;&lt;/code&gt;, the 2 rows will be:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Binary to Text (ASCII) Conversion in Python</title>
      <link>https://andrewodendaal.com/how-to-binary-to-text-ascii-conversion-in-python/</link>
      <pubDate>Tue, 01 Mar 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-binary-to-text-ascii-conversion-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that takes in a binary string and returns the equivalent decoded text (the text is ASCII encoded).&lt;/p&gt;&#xA;&lt;p&gt;Each 8 bits on the binary string represent 1 character on the ASCII table.&lt;/p&gt;&#xA;&lt;p&gt;The input string will always be a valid binary string.&lt;/p&gt;&#xA;&lt;p&gt;Characters can be in the range from &amp;ldquo;00000000&amp;rdquo; to &amp;ldquo;11111111&amp;rdquo; (inclusive)&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; In the case of an empty binary string your function should return an empty string.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Row of the Odd Triangle in Python</title>
      <link>https://andrewodendaal.com/how-to-find-the-row-of-the-odd-triangle-in-python/</link>
      <pubDate>Mon, 28 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-row-of-the-odd-triangle-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a triangle of consecutive odd numbers:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;             1&#xA;          3     5&#xA;       7     9    11&#xA;   13    15    17    19&#xA;21    23    25    27    29&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;find the triangle&amp;rsquo;s row knowing its index (the rows are 1-indexed), e.g.:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;odd_row(1)  ==  [1]&#xA;odd_row(2)  ==  [3, 5]&#xA;odd_row(3)  ==  [7, 9, 11]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: your code should be optimized to handle big inputs.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def odd_row(n):&#xA;    m = (n - 1) * n + 1&#xA;    return [*range(m, m + n * 2, 2)]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Solving Number Zoo Patrol in Python</title>
      <link>https://andrewodendaal.com/solving-number-zoo-patrol-in-python/</link>
      <pubDate>Sun, 27 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solving-number-zoo-patrol-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that takes a shuffled list of unique numbers from &lt;code&gt;1&lt;/code&gt; to &lt;code&gt;n&lt;/code&gt; with one element missing (which can be any number including &lt;code&gt;n&lt;/code&gt;). Return this missing number.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: huge lists will be tested.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[1, 3, 4]  =&amp;gt;  2&#xA;[1, 2, 3]  =&amp;gt;  4&#xA;[4, 2, 3]  =&amp;gt;  1&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def find_missing_number(a):&#xA;    n = len(a) + 1&#xA;    return n * (n + 1) // 2 - sum(a)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Common AWS CDK CLI Commands</title>
      <link>https://andrewodendaal.com/common-aws-cdk-cli-commands/</link>
      <pubDate>Sat, 26 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/common-aws-cdk-cli-commands/</guid>
      <description>&lt;p&gt;The AWS Cloud Development Kit (CDK) comes with numerous CLI commands.&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;&lt;strong&gt;Command&lt;/strong&gt;&lt;/th&gt;&#xA;          &lt;th&gt;&lt;strong&gt;Function&lt;/strong&gt;&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;em&gt;cdk list (ls)&lt;/em&gt;&lt;/td&gt;&#xA;          &lt;td&gt;Lists the stacks in the application&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;em&gt;cdk synthesize (synth)&lt;/em&gt;&lt;/td&gt;&#xA;          &lt;td&gt;Synthesizes and prints the AWS CloudFormation template for the specified stack or stacks&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;em&gt;cdk bootstrap&lt;/em&gt;&lt;/td&gt;&#xA;          &lt;td&gt;Deploys the AWS CDK Toolkit stack, required to deploy stacks containing assets&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;em&gt;cdk deploy&lt;/em&gt;&lt;/td&gt;&#xA;          &lt;td&gt;Deploys the specified stacks&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;em&gt;cdk destroy&lt;/em&gt;&lt;/td&gt;&#xA;          &lt;td&gt;Destroys the specified stacks&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;em&gt;cdk diff&lt;/em&gt;&lt;/td&gt;&#xA;          &lt;td&gt;Compares the specified stack with the deployed stack or a local AWS CloudFormation template&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;em&gt;cdk metadata&lt;/em&gt;&lt;/td&gt;&#xA;          &lt;td&gt;Displays metadata about the specified stack&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;em&gt;cdk init&lt;/em&gt;&lt;/td&gt;&#xA;          &lt;td&gt;Creates a new AWS CDK project in the current directory from a specified template&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;em&gt;cdk context&lt;/em&gt;&lt;/td&gt;&#xA;          &lt;td&gt;Manages cached context values&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;em&gt;cdk docs (doc)&lt;/em&gt;&lt;/td&gt;&#xA;          &lt;td&gt;Opens the AWS CDK API reference in your browser&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;em&gt;cdk doctor&lt;/em&gt;&lt;/td&gt;&#xA;          &lt;td&gt;Checks your AWS CDK project for potential problems&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;Learn more about &lt;a href=&#34;https://aws.amazon.com/cdk/&#34;&gt;AWS CDK here&lt;/a&gt;, or read the &lt;a href=&#34;https://docs.aws.amazon.com/cdk/v2/guide/home.html&#34;&gt;Official Guides here&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create an S3 bucket with PublicRead in CloudFormation</title>
      <link>https://andrewodendaal.com/how-to-create-an-s3-bucket-with-publicread-in-cloudformation/</link>
      <pubDate>Fri, 25 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-an-s3-bucket-with-publicread-in-cloudformation/</guid>
      <description>&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;AWSTemplateFormatVersion: 2010-09-09&#xA;Description: Basic S3 Bucket CloudFormation template&#xA;&#xA;Resources:&#xA;  S3BucketForWebsiteContent:&#xA;    Type: AWS::S3::Bucket&#xA;    Properties:&#xA;      AccessControl: PublicRead&#xA;&#xA;Outputs:&#xA;  BucketName:&#xA;    Value: !Ref S3BucketForWebsiteContent&#xA;    Description: Name of the newly created Amazon S3 Distribution&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Create a VPC in CloudFormation</title>
      <link>https://andrewodendaal.com/how-to-create-a-vpc-in-cloudformation/</link>
      <pubDate>Thu, 24 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-vpc-in-cloudformation/</guid>
      <description>&lt;p&gt;It&amp;rsquo;s very easy to deploy a VPC using CloudFormation:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;AWSTemplateFormatVersion: 2010-09-09&#xA;Description: Deploy a VPC&#xA;&#xA;Resources:&#xA;  VPC:&#xA;    Type: AWS::EC2::VPC&#xA;    Properties:&#xA;      CidrBlock: 10.0.0.0/16&#xA;      EnableDnsHostnames: true&#xA;      Tags:&#xA;      - Key: Name&#xA;        Value: Lab VPC&#xA;&amp;lt;meta charset=&amp;#34;utf-8&amp;#34;&amp;gt;Outputs:&#xA;  VPC:&#xA;    Description: VPC&#xA;    Value: !Ref VPC&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will also output the created VPC resource information.&lt;/p&gt;&#xA;&lt;p&gt;But what if you also want to create Subnets and an attached Internet Gateway?&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;AWSTemplateFormatVersion: 2010-09-09&#xA;Description: Deploy a VPC&#xA;&#xA;Resources:&#xA;  VPC:&#xA;    Type: AWS::EC2::VPC&#xA;    Properties:&#xA;      CidrBlock: 10.0.0.0/16&#xA;      EnableDnsHostnames: true&#xA;      Tags:&#xA;      - Key: Name&#xA;        Value: Lab VPC&#xA;&#xA;  InternetGateway:&#xA;    Type: AWS::EC2::InternetGateway&#xA;    Properties:&#xA;      Tags:&#xA;      - Key: Name&#xA;        Value: Lab Internet Gateway&#xA;&#xA;  AttachGateway:&#xA;    Type: AWS::EC2::VPCGatewayAttachment&#xA;    Properties:&#xA;      VpcId: !Ref VPC&#xA;      InternetGatewayId: !Ref InternetGateway&#xA;&#xA;  PublicSubnet1:&#xA;    Type: AWS::EC2::Subnet&#xA;    Properties:&#xA;      VpcId: !Ref VPC&#xA;      CidrBlock: 10.0.0.0/24&#xA;      AvailabilityZone: !Select &#xA;        - &amp;#39;0&amp;#39;&#xA;        - !GetAZs &amp;#39;&amp;#39;&#xA;      Tags:&#xA;        - Key: Name&#xA;          Value: Public Subnet 1&#xA;&#xA;  PrivateSubnet1:&#xA;    Type: AWS::EC2::Subnet&#xA;    Properties:&#xA;      VpcId: !Ref VPC&#xA;      CidrBlock: 10.0.1.0/24&#xA;      AvailabilityZone: !Select &#xA;        - &amp;#39;0&amp;#39;&#xA;        - !GetAZs &amp;#39;&amp;#39;&#xA;      Tags:&#xA;        - Key: Name&#xA;          Value: Private Subnet 1&#xA;&#xA;  PublicRouteTable:&#xA;    Type: AWS::EC2::RouteTable&#xA;    Properties:&#xA;      VpcId: !Ref VPC&#xA;      Tags:&#xA;        - Key: Name&#xA;          Value: Public Route Table&#xA;&#xA;  PublicRoute:&#xA;    Type: AWS::EC2::Route&#xA;    Properties:&#xA;      RouteTableId: !Ref PublicRouteTable&#xA;      DestinationCidrBlock: 0.0.0.0/0&#xA;      GatewayId: !Ref InternetGateway&#xA;&#xA;  PublicSubnetRouteTableAssociation1:&#xA;    Type: AWS::EC2::SubnetRouteTableAssociation&#xA;    Properties:&#xA;      SubnetId: !Ref PublicSubnet1&#xA;      RouteTableId: !Ref PublicRouteTable&#xA;&#xA;  PrivateRouteTable:&#xA;    Type: AWS::EC2::RouteTable&#xA;    Properties:&#xA;      VpcId: !Ref VPC&#xA;      Tags:&#xA;      - Key: Name&#xA;        Value: Private Route Table&#xA;&#xA;  PrivateSubnetRouteTableAssociation1:&#xA;    Type: AWS::EC2::SubnetRouteTableAssociation&#xA;    Properties:&#xA;      SubnetId: !Ref PrivateSubnet1&#xA;      RouteTableId: !Ref PrivateRouteTable&#xA;&#xA;Outputs:&#xA;  VPC:&#xA;    Description: VPC&#xA;    Value: !Ref VPC&#xA;  AZ1:&#xA;    Description: Availability Zone 1&#xA;    Value: !GetAtt &#xA;      - PublicSubnet1&#xA;      - AvailabilityZone&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Setup Git on EC2 for AWS CodeCommit</title>
      <link>https://andrewodendaal.com/how-to-setup-git-on-ec2-for-aws-codecommit/</link>
      <pubDate>Wed, 23 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-setup-git-on-ec2-for-aws-codecommit/</guid>
      <description>&lt;p&gt;Connect to the instance:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;chmod 400 KEYPAIR.pem&#xA;ssh -i KEYPAIR.pem ec2-user@EC2PublicIP&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Install Git:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo yum install -y git&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Setup Git Credential Helper:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git config --global credential.helper &amp;#39;!aws codecommit credential-helper $@&amp;#39;&#xA;git config --global credential.UseHttpPath true&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now you can clone the CodeCommit repo which will look something like the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;https:&amp;amp;#47;&amp;amp;#47;git-codecommit.us-east-1.amazonaws.com/v1/repos/My-Repo&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>The Difference of 2 in Java</title>
      <link>https://andrewodendaal.com/the-difference-of-2-in-java/</link>
      <pubDate>Tue, 22 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-difference-of-2-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The objective is to return all pairs of integers from a given array of integers that have a difference of 2.&lt;/p&gt;&#xA;&lt;p&gt;The resulting array should be sorted in ascending order of values.&lt;/p&gt;&#xA;&lt;p&gt;Assume there are no duplicate integers in the array. The order of the integers in the input array should not matter.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[1, 2, 3, 4]  should return [[1, 3], [2, 4]]&#xA;[4, 1, 2, 3]  should also return [[1, 3], [2, 4]]&#xA;[1, 23, 3, 4, 7] should return [[1, 3]]&#xA;[4, 3, 1, 5, 6] should return [[1, 3], [3, 5], [4, 6]]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Make the Deadfish Swim in Java</title>
      <link>https://andrewodendaal.com/how-to-make-the-deadfish-swim-in-java/</link>
      <pubDate>Mon, 21 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-make-the-deadfish-swim-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a simple parser that will parse and run Deadfish.&lt;/p&gt;&#xA;&lt;p&gt;Deadfish has 4 commands, each 1 character long:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;i&lt;/code&gt; increments the value (initially ``)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;d&lt;/code&gt; decrements the value&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;s&lt;/code&gt; squares the value&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;o&lt;/code&gt; outputs the value into the return array&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Invalid characters should be ignored.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Deadfish.parse(&amp;#34;iiisdoso&amp;#34;) =- new int[] {8, 64};&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.ArrayList;&#xA;import java.util.List;&#xA;&#xA;public class DeadFish {&#xA;  public static int[] parse(String data) {&#xA;    int value = 0;&#xA;    List&amp;lt;Integer&amp;gt; result = new ArrayList&amp;lt;&amp;gt;();&#xA;    for(char letter : data.toCharArray()) {&#xA;      switch(letter) {&#xA;        case &amp;#39;i&amp;#39;: value++; break;&#xA;        case &amp;#39;d&amp;#39;: value--; break;&#xA;        case &amp;#39;s&amp;#39;: value *= value; break;&#xA;        case &amp;#39;o&amp;#39;: result.add(value); break;&#xA;        default: throw new IllegalArgumentException(&amp;#34;Not valid code letter&amp;#34;);&#xA;      }&#xA;    }&#xA;    return result.stream().mapToInt(Integer::intValue).toArray();&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Write Number in Expanded Form in Java</title>
      <link>https://andrewodendaal.com/how-to-write-number-in-expanded-form-in-java/</link>
      <pubDate>Sun, 20 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-write-number-in-expanded-form-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You will be given a number and you will need to return it as a string in &lt;!-- raw HTML omitted --&gt;Expanded Form&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Challenge.expandedForm(12); // Should return &amp;#34;10 + 2&amp;#34;&#xA;Challenge.expandedForm(42); // Should return &amp;#34;40 + 2&amp;#34;&#xA;Challenge.expandedForm(70304); // Should return &amp;#34;70000 + 300 + 4&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;NOTE: All numbers will be whole numbers greater than 0.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Challenge {&#xA;    public static String expandedForm(int num) {&#xA;      StringBuffer res = new StringBuffer();&#xA;      int d = 1;&#xA;      while(num &amp;gt; 0) {&#xA;        int nextDigit = num % 10;        &#xA;        num /= 10;&#xA;        if (nextDigit &amp;gt; 0) {&#xA;          res.insert(0, d * nextDigit);&#xA;          res.insert(0, &amp;#34; + &amp;#34;);&#xA;        }&#xA;        d *= 10;&#xA;      }&#xA;      return res.substring(3).toString();&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Is a Number Prime in Java</title>
      <link>https://andrewodendaal.com/is-a-number-prime-in-java/</link>
      <pubDate>Sat, 19 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/is-a-number-prime-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Define a function that takes one integer argument and returns a logical value &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt; depending on if the integer is a prime.&lt;/p&gt;&#xA;&lt;p&gt;Per Wikipedia, a prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You can assume you will be given an integer input.&lt;/li&gt;&#xA;&lt;li&gt;You can not assume that the integer will be only positive. You may be given negative numbers as well (or ``).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;NOTE on performance&lt;/strong&gt;: There are no fancy optimizations required, but still &lt;em&gt;the&lt;/em&gt; most trivial solutions might time out. Numbers go up to 2^31 (or similar, depends on language version). Looping all the way up to &lt;code&gt;n&lt;/code&gt;, or &lt;code&gt;n/2&lt;/code&gt;, will be too slow.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;is_prime(1)  /* false */&#xA;is_prime(2)  /* true  */&#xA;is_prime(-1) /* false */&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate Minutes to Midnight in Java</title>
      <link>https://andrewodendaal.com/how-to-calculate-minutes-to-midnight-in-java/</link>
      <pubDate>Fri, 18 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-minutes-to-midnight-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function minutesToMidnight(d) that will take a date object as the parameter. Return the number of minutes in the following format:&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;&amp;ldquo;x minute(s)&amp;rdquo;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;You will always get a date object with of today with a random timestamp.&lt;br&gt;&#xA;You have to round the number of minutes.&lt;br&gt;&#xA;Milliseconds don&amp;rsquo;t matter!&lt;code&gt;Some examples: 10.00 am =&amp;gt; &amp;quot;840 minutes&amp;quot; 23.59 pm =&amp;gt; &amp;quot;1 minute&amp;quot;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.Date;&#xA;&#xA;public class Minute {&#xA;  public String countMinutes(Date d){&#xA;     int mins=(24-d.getHours()-1)*60+60-d.getMinutes();&#xA;     if (d.getHours()==23 &amp;amp;&amp;amp; d.getMinutes()==59) return &amp;#34;1 minute&amp;#34;;&#xA;     return (d.getSeconds()!=0)?  &amp;#34;&amp;#34;+(mins-1)+&amp;#34; minutes&amp;#34; : &amp;#34;&amp;#34;+mins+&amp;#34; minutes&amp;#34;;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Change the Timestamp of a File on Mac/Linux</title>
      <link>https://andrewodendaal.com/how-to-change-the-timestamp-of-a-file-on-mac-linux/</link>
      <pubDate>Thu, 17 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-change-the-timestamp-of-a-file-on-mac-linux/</guid>
      <description>&lt;p&gt;If you have a file on your machine, and you want to change the created/modified time/date stamp, then you can use the &lt;code&gt;touch command&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;touch -t 202202011308.57 someFile.jpg&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In the above example, the timestamp will be changed to &lt;code&gt;&amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;2022-02-01 13:08:57&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Simply remove all non-decimal characters and place a period before the seconds.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Round up to the Next Multiple of 5 in Python</title>
      <link>https://andrewodendaal.com/how-to-round-up-to-the-next-multiple-of-5-in-python/</link>
      <pubDate>Wed, 16 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-round-up-to-the-next-multiple-of-5-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an integer as input, can you round it to the next (meaning, &amp;ldquo;higher&amp;rdquo;) multiple of 5?&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;input:    output:&#xA;0    -&amp;gt;   0&#xA;2    -&amp;gt;   5&#xA;3    -&amp;gt;   5&#xA;12   -&amp;gt;   15&#xA;21   -&amp;gt;   25&#xA;30   -&amp;gt;   30&#xA;-2   -&amp;gt;   0&#xA;-5   -&amp;gt;   -5&#xA;etc.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Input may be any positive or negative integer (including 0).&lt;/p&gt;&#xA;&lt;p&gt;You can assume that all inputs are valid integers.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get the Sum of the First nth Term of a Series in Java</title>
      <link>https://andrewodendaal.com/how-to-get-the-sum-of-the-first-nth-term-of-a-series-in-java/</link>
      <pubDate>Tue, 15 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-sum-of-the-first-nth-term-of-a-series-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Your task is to write a function that returns the sum of the following series up to nth term(parameter).&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Series: 1 + 1/4 + 1/7 + 1/10 + 1/13 + 1/16 +...&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You need to round the answer to 2 decimal places and return it as String.&lt;/li&gt;&#xA;&lt;li&gt;If the given value is 0 then it should return 0.00&lt;/li&gt;&#xA;&lt;li&gt;You will only be given Natural Numbers as arguments.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;1 --&amp;gt; 1 --&amp;gt; &amp;#34;1.00&amp;#34;&#xA;2 --&amp;gt; 1 + 1/4 --&amp;gt; &amp;#34;1.25&amp;#34;&#xA;5 --&amp;gt; 1 + 1/4 + 1/7 + 1/10 + 1/13 --&amp;gt; &amp;#34;1.57&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to satisfy Wilson Primes in Python</title>
      <link>https://andrewodendaal.com/how-to-satisfy-wilson-primes-in-python/</link>
      <pubDate>Mon, 14 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-satisfy-wilson-primes-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Wilson primes satisfy the following condition. Let &lt;code&gt;P&lt;/code&gt; represent a prime number.&lt;/p&gt;&#xA;&lt;p&gt;Then &lt;code&gt;((P-1)! + 1) / (P * P)&lt;/code&gt; should give a whole number.&lt;/p&gt;&#xA;&lt;p&gt;Your task is to create a function that returns &lt;code&gt;true&lt;/code&gt; if the given number is a Wilson prime.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def am_i_wilson(n):&#xA;    return n in (5, 13, 563)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def am_i_wilson(n):&#xA;    if n &amp;lt; 2 or not all(n % i for i in xrange(2, n)):&#xA;        return False&#xA;    &#xA;    import math&#xA;    return (math.factorial(n - 1) + 1) % (n ** 2) == 0&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Boot an EC2 with a WebServer Setup</title>
      <link>https://andrewodendaal.com/how-to-boot-an-ec2-with-a-webserver-setup/</link>
      <pubDate>Sun, 13 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-boot-an-ec2-with-a-webserver-setup/</guid>
      <description>&lt;p&gt;Create a new AWS EC2 instance, and set the User Script to the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#!/bin/bash&#xA;sudo su&#xA;yum update -y&#xA;yum install -y httpd.x86_64&#xA;systemctl start httpd.service&#xA;systemctl enable httpd.service&#xA;echo &amp;#34;&amp;lt;h1&amp;gt;Serving from $(hostname -f)&amp;lt;/h1&amp;gt;&amp;#34; &amp;gt; /var/www/html/index.html&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Writing a Sleigh Authentication in Python</title>
      <link>https://andrewodendaal.com/writing-a-sleigh-authentication-in-python/</link>
      <pubDate>Sat, 12 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/writing-a-sleigh-authentication-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Christmas is coming and many people dreamed of having a ride with Santa&amp;rsquo;s sleigh. But, of course, only Santa himself is allowed to use this wonderful transportation. And in order to make sure, that only he can board the sleigh, there&amp;rsquo;s an authentication mechanism.&lt;/p&gt;&#xA;&lt;p&gt;Your task is to implement the &lt;code&gt;authenticate()&lt;/code&gt; method of the sleigh, which takes the name of the person, who wants to board the sleigh and a secret password. If, and only if, the name equals &amp;ldquo;Santa Claus&amp;rdquo; and the password is &amp;ldquo;Ho Ho Ho!&amp;rdquo; &lt;em&gt;(yes, even Santa has a secret password with uppercase and lowercase letters and special characters :D)&lt;/em&gt;, the return value must be &lt;code&gt;true&lt;/code&gt;. Otherwise, it should return &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Solving for Multiple of Index in Python</title>
      <link>https://andrewodendaal.com/solving-for-multiple-of-index-in-python/</link>
      <pubDate>Fri, 11 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solving-for-multiple-of-index-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Return a new array consisting of elements which are multiple of their own index in input array (length &amp;gt; 1).&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;[22, -6, 32, 82, 9, 25] =&amp;gt; [-6, 32, 25]&lt;/p&gt;&#xA;&lt;p&gt;[68, -1, 1, -7, 10, 10] =&amp;gt; [-1, 10]&lt;/p&gt;&#xA;&lt;p&gt;[-56,-85,72,-26,-14,76,-27,72,35,-21,-67,87,0,21,59,27,-92,68] =&amp;gt; [-85, 72, 0, 68]&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def multiple_of_index(l):&#xA;    return [l[i] for i in range(1, len(l)) if l[i] % i == 0]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find an item’s Alphabet Position in Python</title>
      <link>https://andrewodendaal.com/how-to-find-an-items-alphabet-position-in-python/</link>
      <pubDate>Thu, 10 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-an-items-alphabet-position-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;When provided with a letter, return its position in the alphabet.&lt;/p&gt;&#xA;&lt;p&gt;Input :: &amp;ldquo;a&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;Ouput :: &amp;ldquo;Position of alphabet: 1&amp;rdquo;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def position(alphabet):&#xA;    return &amp;#34;Position of alphabet: {}&amp;#34;.format(ord(alphabet) - 96)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from string import ascii_lowercase&#xA;def position(char):&#xA;    return &amp;#34;Position of alphabet: {0}&amp;#34;.format(&#xA;        ascii_lowercase.index(char) + 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def position(alphabet):&#xA;    return &amp;#34;Position of alphabet: %s&amp;#34; % (&amp;#34;abcdefghijklmnopqrstuvwxyz&amp;#34;.find(alphabet) + 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import test&#xA;from solution import position&#xA;&#xA;@test.describe(&amp;#34;Fixed Tests&amp;#34;)&#xA;def fixed_tests():&#xA;    @test.it(&amp;#39;Basic Test Cases&amp;#39;)&#xA;    def basic_test_cases():&#xA;&#xA;        tests = [&#xA;            # [input, expected]&#xA;            [&amp;#34;a&amp;#34;, &amp;#34;Position of alphabet: 1&amp;#34;],&#xA;            [&amp;#34;z&amp;#34;, &amp;#34;Position of alphabet: 26&amp;#34;],&#xA;            [&amp;#34;e&amp;#34;, &amp;#34;Position of alphabet: 5&amp;#34;],&#xA;        ]&#xA;        &#xA;        for inp, exp in tests:&#xA;            test.assert_equals(position(inp), exp)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Keep up the Hoop in Java</title>
      <link>https://andrewodendaal.com/how-to-keep-up-the-hoop-in-java/</link>
      <pubDate>Wed, 09 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-keep-up-the-hoop-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Alex just got a new hula hoop, he loves it but feels discouraged because his little brother is better than him&lt;/p&gt;&#xA;&lt;p&gt;Write a program where Alex can input (n) how many times the hoop goes round and it will return him an encouraging message 🙂&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If Alex gets 10 or more hoops, return the string &amp;ldquo;Great, now move on to tricks&amp;rdquo;.&lt;/li&gt;&#xA;&lt;li&gt;If he doesn&amp;rsquo;t get 10 hoops, return the string &amp;ldquo;Keep at it until you get it&amp;rdquo;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Will there be Enough Space in Java</title>
      <link>https://andrewodendaal.com/will-there-be-enough-space-in-java/</link>
      <pubDate>Tue, 08 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/will-there-be-enough-space-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Bob is working as a bus driver. However, he has become extremely popular amongst the city&amp;rsquo;s residents. With so many passengers wanting to get aboard his bus, he sometimes has to face the problem of not having enough space left on the bus! He wants you to write a simple program telling him if he will be able to fit all the passengers.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;You have to write a function that accepts three parameters:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Swap Node Pairs In Linked List in Java</title>
      <link>https://andrewodendaal.com/how-to-swap-node-pairs-in-linked-list-in-java/</link>
      <pubDate>Mon, 07 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-swap-node-pairs-in-linked-list-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;If you are given the head node in a linked list, write a method that swaps each pair of nodes in the list, then returns the head node of the list.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;if you are given a list ordered &lt;code&gt;A,B,C,D&lt;/code&gt; the resulting list should be &lt;code&gt;B,A,D,C&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The list will be composed of &lt;code&gt;Node&lt;/code&gt;s of the following specification:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Node {&#xA;    private String value;&#xA;    public Node next;&#xA;&#xA;    public Node(String value) { this.value = value; }&#xA;&#xA;    public String getValue() { return value; }&#xA;    &#xA;    public String toString() { return this.value; }&#xA;    &#xA;    public String printList() {&#xA;      if (this.next == null) return this.toString() + &amp;#34; -&amp;gt;&amp;#34;;&#xA;      return this.toString() + &amp;#34; -&amp;gt; &amp;#34; + next.printList();&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve ‘Finding Neo’ in Java</title>
      <link>https://andrewodendaal.com/how-to-solve-finding-neo-in-java/</link>
      <pubDate>Sun, 06 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-finding-neo-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Neo is somewhere in the Matrix.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public interface Matrix {&#xA;  public int size();&#xA;  public int get(int x, int y);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You are Morpheus, and your job is to find him.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Morpheus {&#xA;  public int[] find(Matrix matrix, int neo) {&#xA;    // return Neo&amp;#39;s x and y coordinates as a two-element array&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You will need a good search strategy – the matrix is huge! But it is controlled by machines, so it is also very orderly. It is quadratic, and the following rules hold for all elements:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve a Pandigital Sequence in Java</title>
      <link>https://andrewodendaal.com/how-to-solve-a-pandigital-sequence-in-java/</link>
      <pubDate>Sat, 05 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-a-pandigital-sequence-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In mathematics, a &lt;strong&gt;pandigital number&lt;/strong&gt; is a number that in a given base has among its significant digits each digit used in the base at least once. For example, 1234567890 is a pandigital number in base 10.&lt;/p&gt;&#xA;&lt;p&gt;For simplification, in this challenge, we will consider pandigital numbers in &lt;em&gt;base 10&lt;/em&gt; and with all digits used &lt;em&gt;exactly once&lt;/em&gt;. The challenge is to calculate a sorted sequence of pandigital numbers, starting at a certain &lt;code&gt;offset&lt;/code&gt; and with a specified &lt;code&gt;size&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get Meta-Data information from an AWS EC2 Instance</title>
      <link>https://andrewodendaal.com/how-to-get-meta-data-information-from-an-aws-ec2-instance/</link>
      <pubDate>Fri, 04 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-meta-data-information-from-an-aws-ec2-instance/</guid>
      <description>&lt;p&gt;If you need to query &lt;code&gt;meta-data&lt;/code&gt; information from your running EC2 instance, you can curl the following location:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;curl http://169.254.169.254/latest/meta-data&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will provide a list of all information that can be retrieved.&lt;/p&gt;&#xA;&lt;p&gt;Say you want to get the &lt;code&gt;local IPv4 address&lt;/code&gt;, this can be done as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;curl http://169.254.169.254/latest/meta-data/local-ipv4&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can also get JSON blocks of information back, such as querying the &lt;code&gt;IAM Info&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;curl http://169.254.169.254/latest/meta-data/iam/info&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to write a Lazy Repeater Helper in Python</title>
      <link>https://andrewodendaal.com/how-to-write-a-lazy-repeater-helper-in-python/</link>
      <pubDate>Thu, 03 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-write-a-lazy-repeater-helper-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The &lt;code&gt;make_looper()&lt;/code&gt; function takes a string (of non-zero length) as an argument. It returns a function. The function it returns will return successive characters of the string on successive invocations. It will start back at the beginning of the string once it reaches the end.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;abc = make_looper(&amp;#39;abc&amp;#39;)&#xA;abc() # should return &amp;#39;a&amp;#39; on this first call&#xA;abc() # should return &amp;#39;b&amp;#39; on this second call&#xA;abc() # should return &amp;#39;c&amp;#39; on this third call&#xA;abc() # should return &amp;#39;a&amp;#39; again on this fourth call&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to write a String Case Conversion Helper in Python</title>
      <link>https://andrewodendaal.com/how-to-write-a-string-case-conversion-helper-in-python/</link>
      <pubDate>Wed, 02 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-write-a-string-case-conversion-helper-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In this challenge, you will make a function that converts between &lt;code&gt;camelCase&lt;/code&gt;, &lt;code&gt;snake_case&lt;/code&gt;, and &lt;code&gt;kebab-case&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You must write a function that changes to a given case. It must be able to handle all three case types:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;change_case(&amp;#34;snakeCase&amp;#34;, &amp;#34;snake&amp;#34;) # &amp;#34;snake_case&amp;#34;&#xA;change_case(&amp;#34;some-lisp-name&amp;#34;, &amp;#34;camel&amp;#34;) # &amp;#34;someLispName&amp;#34;&#xA;change_case(&amp;#34;map_to_all&amp;#34;, &amp;#34;kebab&amp;#34;) # &amp;#34;map-to-all&amp;#34;&#xA;change_case(&amp;#34;doHTMLRequest&amp;#34;, &amp;#34;kebab&amp;#34;) # &amp;#34;do-h-t-m-l-request&amp;#34;&#xA;change_case(&amp;#34;invalid-inPut_bad&amp;#34;, &amp;#34;kebab&amp;#34;) # None&#xA;change_case(&amp;#34;valid-input&amp;#34;, &amp;#34;huh???&amp;#34;) # None&#xA;change_case(&amp;#34;&amp;#34;, &amp;#34;camel&amp;#34;) # &amp;#34;&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Your function must deal with invalid input as shown, though it will only be passed strings. Furthermore, all valid identifiers will be lowercase except when necessary, in other words on word boundaries in &lt;code&gt;camelCase&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create Interleaving Arrays in Python</title>
      <link>https://andrewodendaal.com/how-to-create-interleaving-arrays-in-python/</link>
      <pubDate>Tue, 01 Feb 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-interleaving-arrays-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function, that accepts an arbitrary number of arrays and returns a single array generated by alternately appending elements from the passed-in arguments. If one of them is shorter than the others, the result should be padded with empty elements.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;interleave([1, 2, 3], [&amp;#34;c&amp;#34;, &amp;#34;d&amp;#34;, &amp;#34;e&amp;#34;]) == [1, &amp;#34;c&amp;#34;, 2, &amp;#34;d&amp;#34;, 3, &amp;#34;e&amp;#34;]&#xA;interleave([1, 2, 3], [4, 5]) == [1, 4, 2, 5, 3, None]&#xA;interleave([1, 2, 3], [4, 5, 6], [7, 8, 9]) == [1, 4, 7, 2, 5, 8, 3, 6, 9]&#xA;interleave([]) == []&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Largest product in a Series in Python</title>
      <link>https://andrewodendaal.com/how-to-find-the-largest-product-in-a-series-in-python/</link>
      <pubDate>Mon, 31 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-largest-product-in-a-series-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the &lt;code&gt;greatestProduct&lt;/code&gt; method so that it&amp;rsquo;ll find the greatest product of five consecutive digits in the given string of digits.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;greatestProduct(&amp;#34;123834539327238239583&amp;#34;) # should return 3240&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The input string always has more than five digits.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from itertools import islice&#xA;from functools import reduce&#xA;&#xA;def greatest_product(n):&#xA;    numbers=[int(value) for value in n]&#xA;    result=[reduce(lambda x,y: x*y, islice(numbers, i, i+5), 1) for i in range(len(numbers)-4)]&#xA;    return max(result) &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate the Least Common Multiple in Python</title>
      <link>https://andrewodendaal.com/how-to-calculate-the-least-common-multiple-in-python/</link>
      <pubDate>Sun, 30 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-the-least-common-multiple-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that calculates the &lt;em&gt;least common multiple&lt;/em&gt; of its arguments; each argument is assumed to be a non-negative integer. In the case that there are no arguments (or the provided array in compiled languages is empty), return &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from math import gcd&#xA;def lcm(*args):&#xA;    lcm=1&#xA;    for x in args:&#xA;        if x!=0:&#xA;            lcm=lcm*x//gcd(lcm,x)&#xA;        else:&#xA;            lcm=0&#xA;    return lcm&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def lcm(*args):&#xA;    gcd = lambda m,n: m if not n else gcd(n,m%n)&#xA;    return reduce( lambda x, y: x*y/gcd(x, y), args)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve Caesar Cipher Helper in Python</title>
      <link>https://andrewodendaal.com/how-to-solve-caesar-cipher-helper-in-python/</link>
      <pubDate>Sat, 29 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-caesar-cipher-helper-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a class that, when given a string, will return an &lt;strong&gt;uppercase&lt;/strong&gt; string with each letter shifted forward in the alphabet by however many spots the cipher was initialized to.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;c = CaesarCipher(5); # creates a CipherHelper with a shift of five&#xA;c.decode(&amp;#39;BFKKQJX&amp;#39;) # returns &amp;#39;WAFFLES&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If something in the string is not in the alphabet (e.g. punctuation, spaces), simply leave it as is.&lt;br&gt;&#xA;The shift will always be in the range of &lt;code&gt;[1, 26]&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Write Out Numbers in Python</title>
      <link>https://andrewodendaal.com/how-to-write-out-numbers-in-python/</link>
      <pubDate>Fri, 28 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-write-out-numbers-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function that transforms any positive number to a string representing the number in words. The function should work for all numbers between 0 and 999999.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;number2words(0)  ==&amp;gt;  &amp;#34;zero&amp;#34;&#xA;number2words(1)  ==&amp;gt;  &amp;#34;one&amp;#34;&#xA;number2words(9)  ==&amp;gt;  &amp;#34;nine&amp;#34;&#xA;number2words(10)  ==&amp;gt;  &amp;#34;ten&amp;#34;&#xA;number2words(17)  ==&amp;gt;  &amp;#34;seventeen&amp;#34;&#xA;number2words(20)  ==&amp;gt;  &amp;#34;twenty&amp;#34;&#xA;number2words(21)  ==&amp;gt;  &amp;#34;twenty-one&amp;#34;&#xA;number2words(45)  ==&amp;gt;  &amp;#34;forty-five&amp;#34;&#xA;number2words(80)  ==&amp;gt;  &amp;#34;eighty&amp;#34;&#xA;number2words(99)  ==&amp;gt;  &amp;#34;ninety-nine&amp;#34;&#xA;number2words(100)  ==&amp;gt;  &amp;#34;one hundred&amp;#34;&#xA;number2words(301)  ==&amp;gt;  &amp;#34;three hundred one&amp;#34;&#xA;number2words(799)  ==&amp;gt;  &amp;#34;seven hundred ninety-nine&amp;#34;&#xA;number2words(800)  ==&amp;gt;  &amp;#34;eight hundred&amp;#34;&#xA;number2words(950)  ==&amp;gt;  &amp;#34;nine hundred fifty&amp;#34;&#xA;number2words(1000)  ==&amp;gt;  &amp;#34;one thousand&amp;#34;&#xA;number2words(1002)  ==&amp;gt;  &amp;#34;one thousand two&amp;#34;&#xA;number2words(3051)  ==&amp;gt;  &amp;#34;three thousand fifty-one&amp;#34;&#xA;number2words(7200)  ==&amp;gt;  &amp;#34;seven thousand two hundred&amp;#34;&#xA;number2words(7219)  ==&amp;gt;  &amp;#34;seven thousand two hundred nineteen&amp;#34;&#xA;number2words(8330)  ==&amp;gt;  &amp;#34;eight thousand three hundred thirty&amp;#34;&#xA;number2words(99999)  ==&amp;gt;  &amp;#34;ninety-nine thousand nine hundred ninety-nine&amp;#34;&#xA;number2words(888888)  ==&amp;gt;  &amp;#34;eight hundred eighty-eight thousand eight hundred eighty-eight&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to do Base64 Encoding in Python</title>
      <link>https://andrewodendaal.com/how-to-do-base64-encoding-in-python/</link>
      <pubDate>Thu, 27 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-do-base64-encoding-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function that converts the value of the String to and from Base64 using the ASCII character set.&lt;/p&gt;&#xA;&lt;p&gt;Do not use built-in functions.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;# should return &amp;#39;dGhpcyBpcyBhIHN0cmluZyEh&amp;#39;&#xA;to_base_64(&amp;#39;this is a string!!&amp;#39;)&#xA;&#xA;# should return &amp;#39;this is a string!!&amp;#39;&#xA;from_base_64(&amp;#39;dGhpcyBpcyBhIHN0cmluZyEh&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can learn more about Base64 encoding and decoding &lt;!-- raw HTML omitted --&gt;here&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;CODES = &amp;#34;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/&amp;#34;;&#xA;def to_base_64(string):&#xA;    padding = 3 - len(string) % 3 if len(string) % 3 else 0&#xA;    binary = &amp;#39;&amp;#39;.join(format(ord(i),&amp;#39;08b&amp;#39;) for i in string) + &amp;#39;00&amp;#39;*padding&#xA;    return &amp;#39;&amp;#39;.join(CODES[int(binary[i:i+6], 2)] for i in range(0, len(binary), 6))&#xA;    &#xA;def from_base_64(string):&#xA;    binary = &amp;#39;&amp;#39;.join(format(CODES.find(i),&amp;#39;06b&amp;#39;) for i in string)&#xA;    return &amp;#39;&amp;#39;.join(chr(int(binary[i:i+8], 2)) for i in range(0, len(binary), 8)).rstrip(&amp;#39;\x00&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate Transport on Vacation in Java</title>
      <link>https://andrewodendaal.com/how-to-calculate-transport-on-vacation-in-java/</link>
      <pubDate>Wed, 26 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-transport-on-vacation-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;After a hard quarter in the office you decide to get some rest on a vacation. So you will book a flight for you and your girlfriend and try to leave all the mess behind you.&lt;/p&gt;&#xA;&lt;p&gt;You will need a rental car in order for you to get around in your vacation. The manager of the car rental makes you some good offers.&lt;/p&gt;&#xA;&lt;p&gt;Every day you rent the car costs $40. If you rent the car for 7 or more days, you get $50 off your total. Alternatively, if you rent the car for 3 or more days, you get $20 off your total.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Playing with the letter ‘E’ in Java</title>
      <link>https://andrewodendaal.com/playing-with-the-letter-e-in-java/</link>
      <pubDate>Tue, 25 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/playing-with-the-letter-e-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given String &lt;code&gt;str&lt;/code&gt;, return:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If given String doesn&amp;rsquo;t contain any &amp;ldquo;e&amp;rdquo;, return: &amp;ldquo;There is no &amp;ldquo;e&amp;rdquo;.&amp;rdquo;&lt;/li&gt;&#xA;&lt;li&gt;If given String is empty, return empty String.&lt;/li&gt;&#xA;&lt;li&gt;If given String is `null`&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class WithoutLetterE {&#xA;  public static String findE(String str){&#xA;    if (str==null) return null;&#xA;    if (str.equals(&amp;#34;&amp;#34;)) return &amp;#34;&amp;#34;;&#xA;    int len = str.length() - str.toLowerCase().replaceAll(&amp;#34;e&amp;#34;, &amp;#34;&amp;#34;).length();&#xA;    if (len &amp;gt; 0) return String.valueOf(len);&#xA;    if (!str.contains(&amp;#34;e&amp;#34;)) return &amp;#34;There is no \&amp;#34;e\&amp;#34;.&amp;#34;;&#xA;    return null;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Sum the Average for NBA Players in Golang</title>
      <link>https://andrewodendaal.com/how-to-sum-the-average-for-nba-players-in-golang/</link>
      <pubDate>Mon, 24 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-sum-the-average-for-nba-players-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function, called &lt;code&gt;sumPPG&lt;/code&gt;, that takes two NBA player objects/struct/Hash/Dict/Class and sums their PPG&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;iverson := NBAPlayer{ Team: &amp;#34;76ers&amp;#34;, Ppg: 11.2 }&#xA;jordan  := NBAPlayer{ Team: &amp;#34;bulls&amp;#34;, Ppg: 20.2 }&#xA;SumPpg(iverson, jordan) // =&amp;gt; 31.4&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;type NBAPlayer struct {&#xA;  Team string&#xA;  Ppg  float64&#xA;}&#xA;func SumPpg(playerOne, playerTwo NBAPlayer) float64 {&#xA;  return playerOne.Ppg+playerTwo.Ppg  &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;type NBAPlayer struct {&#xA;  Team string&#xA;  Ppg  float64&#xA;}&#xA;func SumPpg(a, b NBAPlayer) float64 {&#xA;  return float64(a.Ppg + b.Ppg)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution_test&#xA;import (&#xA;  . &amp;#34;github.com/onsi/ginkgo&amp;#34;&#xA;  . &amp;#34;github.com/onsi/gomega&amp;#34;&#xA;)&#xA;const tol=1e-6&#xA;var _ = Describe(&amp;#34;Fixed tests&amp;#34;, func() {&#xA;   It(&amp;#34;Iverson and jordan&amp;#34;, func() {&#xA;     iverson := NBAPlayer{ Team: &amp;#34;76ers&amp;#34;, Ppg: 11.2 }&#xA;     jordan  := NBAPlayer{ Team: &amp;#34;bulls&amp;#34;, Ppg: 20.2 }&#xA;     Expect(SumPpg(iverson,jordan)).To(BeNumerically(&amp;#34;~&amp;#34;,31.4,tol))&#xA;   })&#xA;  It(&amp;#34;Standard tests&amp;#34;, func(){&#xA;    player1 := NBAPlayer{ Team: &amp;#34;p1_team&amp;#34;, Ppg: 20.2   }&#xA;    player2 := NBAPlayer{ Team: &amp;#34;p2_team&amp;#34;, Ppg: 2.6    }&#xA;    player3 := NBAPlayer{ Team: &amp;#34;p3_team&amp;#34;, Ppg: 2023.2 }&#xA;    player4 := NBAPlayer{ Team: &amp;#34;p4_team&amp;#34;, Ppg: 0      }&#xA;    player5 := NBAPlayer{ Team: &amp;#34;p5_team&amp;#34;, Ppg: -5.8   }&#xA;    Expect(SumPpg(player1, player2)).To(BeNumerically(&amp;#34;~&amp;#34;,22.8      ,tol))&#xA;    Expect(SumPpg(player3, player1)).To(BeNumerically(&amp;#34;~&amp;#34;,2043.4    ,tol))&#xA;    Expect(SumPpg(player3, player4)).To(BeNumerically(&amp;#34;~&amp;#34;,2023.2    ,tol))&#xA;    Expect(SumPpg(player4, player5)).To(BeNumerically(&amp;#34;~&amp;#34;,-5.8      ,tol))&#xA;    Expect(SumPpg(player5, player2)).To(BeNumerically(&amp;#34;~&amp;#34;,2.6 - 5.8 ,tol))&#xA;  })&#xA;})&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Compute a Cube as Sums in Golang</title>
      <link>https://andrewodendaal.com/how-to-compute-a-cube-as-sums-in-golang/</link>
      <pubDate>Sun, 23 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-compute-a-cube-as-sums-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You will be given a number &lt;code&gt;n&lt;/code&gt; (where &lt;code&gt;n &amp;gt;= 1&lt;/code&gt;) and your task is to find &lt;code&gt;n&lt;/code&gt; consecutive odd numbers whose sum is exactly the cube of &lt;code&gt;n&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;**Mathematically:&lt;br&gt;&#xA;** cube = n ** 3&lt;br&gt;&#xA;sum = a1 + a2 + a3 + ….. + an&lt;br&gt;&#xA;sum == cube&lt;br&gt;&#xA;a2 == a1 + 2, a3 == a2 + 2, …….&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;For example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;FindSummands(3) == []int{7,9,11}&#xA;// ..because 7 + 9 + 11 = 27, the cube of 3.&#xA;// Note that there are only n = 3 elements in the array.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Write function &lt;code&gt;findSummands(n)&lt;/code&gt; which will return an array of n consecutive odd numbers with the sum equal to the cube of n &lt;code&gt;(n*n*n)&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Deaf Rats of Hamelin Challenge in Java</title>
      <link>https://andrewodendaal.com/the-deaf-rats-of-hamelin-challenge-in-java/</link>
      <pubDate>Sat, 22 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-deaf-rats-of-hamelin-challenge-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The &lt;!-- raw HTML omitted --&gt;Pied Piper&lt;!-- raw HTML omitted --&gt; has been enlisted to play his magical tune and coax all the rats out of town.&lt;/p&gt;&#xA;&lt;p&gt;But some of the rats are deaf and are going the wrong way!&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;How many deaf rats are there?&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;P&lt;/code&gt; = The Pied Piper&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;O~&lt;/code&gt; = Rat going left&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;~O&lt;/code&gt; = Rat going right&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;ex1 &lt;code&gt;~O~O~O~O P&lt;/code&gt; has 0 deaf rats&lt;/li&gt;&#xA;&lt;li&gt;ex2 &lt;code&gt;P O~ O~ ~O O~&lt;/code&gt; has 1 deaf rat&lt;/li&gt;&#xA;&lt;li&gt;ex3 &lt;code&gt;~O~O~O~OP~O~OO~&lt;/code&gt; has 2 deaf rats&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Next Perfect Square in Java</title>
      <link>https://andrewodendaal.com/how-to-find-the-next-perfect-square-in-java/</link>
      <pubDate>Fri, 21 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-next-perfect-square-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You might know some pretty large perfect squares. But what about the NEXT one?&lt;/p&gt;&#xA;&lt;p&gt;Complete the &lt;code&gt;findNextSquare&lt;/code&gt; method that finds the next integral perfect square after the one passed as a parameter. Recall that an integral perfect square is an integer n such that sqrt(n) is also an integer.&lt;/p&gt;&#xA;&lt;p&gt;If the parameter is itself not a perfect square then &lt;code&gt;-1&lt;/code&gt; should be returned. You may assume the parameter is non-negative.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Unique String in Python</title>
      <link>https://andrewodendaal.com/how-to-find-the-unique-string-in-python/</link>
      <pubDate>Thu, 20 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-unique-string-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;There is an array of strings. All strings contain similar letters except one. Try to find it!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;find_uniq([ &amp;#39;Aa&amp;#39;, &amp;#39;aaa&amp;#39;, &amp;#39;aaaaa&amp;#39;, &amp;#39;BbBb&amp;#39;, &amp;#39;Aaaa&amp;#39;, &amp;#39;AaAaAa&amp;#39;, &amp;#39;a&amp;#39; ]) # =&amp;gt; &amp;#39;BbBb&amp;#39;&#xA;find_uniq([ &amp;#39;abc&amp;#39;, &amp;#39;acb&amp;#39;, &amp;#39;bac&amp;#39;, &amp;#39;foo&amp;#39;, &amp;#39;bca&amp;#39;, &amp;#39;cab&amp;#39;, &amp;#39;cba&amp;#39; ]) # =&amp;gt; &amp;#39;foo&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Strings may contain spaces. Spaces are not significant, only non-spaces symbols matter.&lt;br&gt;&#xA;E.g. A string that contains only spaces is like an empty string.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s guaranteed that the array contains more than 3 strings.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to convert a PascalCase string into snake_case in Python</title>
      <link>https://andrewodendaal.com/how-to-convert-a-pascalcase-string-into-snake_case-in-python/</link>
      <pubDate>Wed, 19 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-a-pascalcase-string-into-snake_case-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the function/method so that it takes a &lt;code&gt;PascalCase&lt;/code&gt; string and returns the string in &lt;code&gt;snake_case&lt;/code&gt; notation. Lowercase characters can be numbers. If the method gets a number as input, it should return a string.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;TestController&amp;#34;  --&amp;gt;  &amp;#34;test_controller&amp;#34;&#xA;&amp;#34;MoviesAndBooks&amp;#34;  --&amp;gt;  &amp;#34;movies_and_books&amp;#34;&#xA;&amp;#34;App7Test&amp;#34;        --&amp;gt;  &amp;#34;app7_test&amp;#34;&#xA;1                 --&amp;gt;  &amp;#34;1&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import re&#xA;&#xA;def to_underscore(string):&#xA;    return re.sub(r&amp;#39;(.)([A-Z])&amp;#39;, r&amp;#39;\1_\2&amp;#39;, str(string)).lower()    &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def to_underscore(string):&#xA;    string = str(string)&#xA;    camel_case = string[0].lower()&#xA;    for c in string[1:]:&#xA;        camel_case += &amp;#39;_{}&amp;#39;.format(c.lower()) if c.isupper() else c&#xA;    return camel_case&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Convert a Hex String to RGB in Python</title>
      <link>https://andrewodendaal.com/how-to-convert-a-hex-string-to-rgb-in-python/</link>
      <pubDate>Tue, 18 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-a-hex-string-to-rgb-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;When working with color values it can sometimes be useful to extract the individual red, green, and blue (RGB) component values for a color. Implement a function that meets these requirements:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Accepts a case-insensitive hexadecimal color string as its parameter (ex. &lt;code&gt;&amp;quot;#FF9933&amp;quot;&lt;/code&gt; or &lt;code&gt;&amp;quot;#ff9933&amp;quot;&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Returns a Map&amp;lt;String, int&amp;gt; with the structure &lt;code&gt;{r: 255, g: 153, b: 51}&lt;/code&gt; where &lt;em&gt;r&lt;/em&gt;, &lt;em&gt;g&lt;/em&gt;, and &lt;em&gt;b&lt;/em&gt; range from 0 through 255&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; your implementation does not need to support the shorthand form of hexadecimal notation (ie &lt;code&gt;&amp;quot;#FFF&amp;quot;&lt;/code&gt;)&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create a Hashtag Generator in Python</title>
      <link>https://andrewodendaal.com/how-to-create-a-hashtag-generator-in-python/</link>
      <pubDate>Mon, 17 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-hashtag-generator-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a &lt;strong&gt;hashtag generator&lt;/strong&gt; &lt;!-- raw HTML omitted --&gt;function that takes a &lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;string&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;and returns a &lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;#HashCodeString&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt;of it.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;The hashtag generator should perform the following tasks.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Follow these rules:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It must start with a hashtag (&lt;code&gt;#&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;All words must have their first letter capitalized.&lt;/li&gt;&#xA;&lt;li&gt;If the final result is longer than 140 chars it must return &lt;code&gt;false&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;If the input or the result is an empty string it must return &lt;code&gt;false&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;    Hello     World   &amp;#34;                  =&amp;gt;  &amp;#34;#HelloWorld&amp;#34;&#xA;&amp;#34;&amp;#34;                                        =&amp;gt;  false&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Move Zeros to the End in Python</title>
      <link>https://andrewodendaal.com/how-to-move-zeros-to-the-end-in-python/</link>
      <pubDate>Sun, 16 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-move-zeros-to-the-end-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write an algorithm that takes an array and moves all of the zeros to the end, preserving the order of the other elements.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;move_zeros([1, 0, 1, 2, 0, 1, 3]) # returns [1, 1, 2, 1, 3, 0, 0]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def move_zeros(arr):&#xA;    l = [i for i in arr if isinstance(i, bool) or i!=0]&#xA;    return l+[0]*(len(arr)-len(l))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def move_zeros(array):&#xA;    return sorted(array, key=lambda x: x==0 and type(x) is not bool)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Regex for Gregorian Date Validation in Python</title>
      <link>https://andrewodendaal.com/regex-for-gregorian-date-validation-in-python/</link>
      <pubDate>Sat, 15 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/regex-for-gregorian-date-validation-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a regular expression that validates the gregorian date in the format &amp;ldquo;DD.MM.YYYY&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Correct date examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;23.12.2008&amp;#34;&#xA;&amp;#34;01.08.1994&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Incorrect examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;12.23.2008&amp;#34;&#xA;&amp;#34;01-Aug-1994&amp;#34;&#xA;&amp;#34; 01.08.1994&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;maximum length of validator is 400 characters to avoid hardcoding. (shortest solution to date is 170 characters)&lt;/li&gt;&#xA;&lt;li&gt;validator should process leap days (February, 29) correctly.&lt;/li&gt;&#xA;&lt;li&gt;the date is Gregorian, it&amp;rsquo;s important to determine if year is leap: &lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Gregorian_calendar&#34;&gt;https://en.wikipedia.org/wiki/Gregorian_calendar&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create Your Own Python Split Function</title>
      <link>https://andrewodendaal.com/how-to-create-your-own-python-split-function/</link>
      <pubDate>Fri, 14 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-your-own-python-split-function/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write your own implementation of the built-in &lt;code&gt;split&lt;/code&gt; function in Python.&lt;/p&gt;&#xA;&lt;p&gt;The following rules must be adhered to:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the function &lt;strong&gt;cannot&lt;/strong&gt; use, in any way, the original &lt;code&gt;split&lt;/code&gt; or &lt;code&gt;rsplit&lt;/code&gt; functions,&lt;/li&gt;&#xA;&lt;li&gt;the new function &lt;strong&gt;must&lt;/strong&gt; be a generator,&lt;/li&gt;&#xA;&lt;li&gt;it should behave as the built-in &lt;code&gt;split&lt;/code&gt;, so it will be tested that way — think of &lt;code&gt;split()&lt;/code&gt; and &lt;code&gt;split(&#39;&#39;)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python&#34;&gt;The solution in Python&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import re&#xA;def my_very_own_split(string, delimiter = None):&#xA;    if delimiter == &amp;#39;&amp;#39;: raise ValueError(&amp;#39;empty delimiter&amp;#39;)&#xA;    if delimiter == None: delimiter = &amp;#39;\s+&amp;#39;&#xA;    else: delimiter = re.escape(delimiter)&#xA;    pos = 0&#xA;    for m in re.finditer(delimiter, string):&#xA;        yield string[pos:m.start()]&#xA;        pos = m.end()&#xA;    yield string[pos:]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create a Domain Name Validator in Python</title>
      <link>https://andrewodendaal.com/how-to-create-a-domain-name-validator-in-python/</link>
      <pubDate>Thu, 13 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-domain-name-validator-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a domain name validator mostly compliant with RFC 1035, RFC 1123, and RFC 2181&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The following rules apply:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Domain name may contain subdomains (levels), hierarchically separated by . (period) character&lt;/li&gt;&#xA;&lt;li&gt;Domain name must not contain more than 127 levels, including &lt;!-- raw HTML omitted --&gt;top level (TLD)&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;li&gt;Domain name must not be longer than 253 characters (RFC specifies 255, but 2 characters are reserved for trailing dot and null character for root level)&lt;/li&gt;&#xA;&lt;li&gt;Level names must be composed out of lowercase and uppercase ASCII letters, digits and – (minus sign) character&lt;/li&gt;&#xA;&lt;li&gt;Level names must not start or end with – (minus sign) character&lt;/li&gt;&#xA;&lt;li&gt;Level names must not be longer than 63 characters&lt;/li&gt;&#xA;&lt;li&gt;Top level (TLD) must not be fully numerical&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Additionally:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to start Java Jar as Service on Linux</title>
      <link>https://andrewodendaal.com/how-to-start-java-jar-as-service-on-linux/</link>
      <pubDate>Wed, 12 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-start-java-jar-as-service-on-linux/</guid>
      <description>&lt;p&gt;If you have a Java Jar file, you can run it as a service under Linux/Ubuntu.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo ln -s /var/www/japi-0.0.1-SNAPSHOT.jar /etc/init.d/japi&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now you can use the default &lt;code&gt;init.d&lt;/code&gt; verbs [&lt;code&gt;start&lt;/code&gt;,&lt;code&gt;stop&lt;/code&gt;,&lt;code&gt;restart&lt;/code&gt;,&lt;code&gt;status&lt;/code&gt;].&lt;/p&gt;&#xA;&lt;p&gt;Additionally, &lt;code&gt;init.d&lt;/code&gt; also gives the following.&lt;/p&gt;&#xA;&lt;h2 id=&#34;usage-for-your-new-initd-service&#34;&gt;Usage for your new &lt;code&gt;init.d&lt;/code&gt; service&lt;/h2&gt;&#xA;&lt;p&gt;Usage: /etc/init.d/japi {start|stop|force-stop|restart|force-reload|status|run}&lt;/p&gt;&#xA;&lt;h2 id=&#34;start-java-service&#34;&gt;Start Java Service&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo /etc/init.d/japi start&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;stop-java-service&#34;&gt;Stop Java Service&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo /etc/init.d/japi stop&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;restart-java-service&#34;&gt;Restart Java Service&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo /etc/init.d/japi restart&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;status-information&#34;&gt;Status Information&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo /etc/init.d/japi status&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to write a validDate Regex in Python</title>
      <link>https://andrewodendaal.com/how-to-write-a-validdate-regex-in-python/</link>
      <pubDate>Tue, 11 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-write-a-validdate-regex-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Your task is to write a regular expression (regex) that will match a string only if it contains at least one valid date, in the format &lt;code&gt;[mm-dd]&lt;/code&gt; (that is, a two-digit month, followed by a dash, followed by a two-digit date, surrounded by square brackets).&lt;/p&gt;&#xA;&lt;p&gt;You should assume the year in question is &lt;em&gt;not&lt;/em&gt; a leap year. Therefore, the number of days each month should have are as follows:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Validate Passwords with Regex in Python</title>
      <link>https://andrewodendaal.com/how-to-validate-passwords-with-regex-in-python/</link>
      <pubDate>Mon, 10 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-validate-passwords-with-regex-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You need to write regex that will validate a password to make sure it meets the following criteria:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;At least six characters long&lt;/li&gt;&#xA;&lt;li&gt;contains a lowercase letter&lt;/li&gt;&#xA;&lt;li&gt;contains an uppercase letter&lt;/li&gt;&#xA;&lt;li&gt;contains a number&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Valid passwords will only be alphanumeric characters.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from re import compile, VERBOSE&#xA;&#xA;regex = compile(&amp;#34;&amp;#34;&amp;#34;&#xA;^              # begin word&#xA;(?=.*?[a-z])   # at least one lowercase letter&#xA;(?=.*?[A-Z])   # at least one uppercase letter&#xA;(?=.*?[0-9])   # at least one number&#xA;[A-Za-z\d]     # only alphanumeric&#xA;{6,}           # at least 6 characters long&#xA;$              # end word&#xA;&amp;#34;&amp;#34;&amp;#34;, VERBOSE)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create a Coordinates Validator in Golang</title>
      <link>https://andrewodendaal.com/how-to-create-a-coordinates-validator-in-golang/</link>
      <pubDate>Sun, 09 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-coordinates-validator-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You need to create a function that will validate if given parameters are valid geographical coordinates.&lt;/p&gt;&#xA;&lt;p&gt;Valid coordinates look like the following: &lt;strong&gt;&amp;ldquo;23.32353342, -32.543534534&amp;rdquo;&lt;/strong&gt;. The return value should be either &lt;strong&gt;true&lt;/strong&gt; or &lt;strong&gt;false&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Latitude (which is the first float) can be between 0 and 90, positive or negative. Longitude (which is the second float) can be between 0 and 180, positive or negative.&lt;/p&gt;&#xA;&lt;p&gt;Coordinates can only contain digits, or one of the following symbols (including space after the comma)&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Validate ISBN-10 numbers in Golang</title>
      <link>https://andrewodendaal.com/how-to-validate-isbn-10-numbers-in-golang/</link>
      <pubDate>Sat, 08 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-validate-isbn-10-numbers-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;ISBN-10 identifiers are ten digits long. The first nine characters are digits &lt;code&gt;0-9&lt;/code&gt;. The last digit can be &lt;code&gt;0-9&lt;/code&gt; or &lt;code&gt;X&lt;/code&gt;, to indicate a value of 10.&lt;/p&gt;&#xA;&lt;p&gt;An ISBN-10 number is valid if the sum of the digits multiplied by their position modulo 11 equals zero.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;For example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ISBN     : 1 1 1 2 2 2 3 3 3  9&#xA;position : 1 2 3 4 5 6 7 8 9 10&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;This is a valid ISBN, because:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create a Java GUI App that shows the Logged-in User and Hostname</title>
      <link>https://andrewodendaal.com/how-to-create-a-java-gui-app-that-shows-the-logged-in-user-and-hostname/</link>
      <pubDate>Fri, 07 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-java-gui-app-that-shows-the-logged-in-user-and-hostname/</guid>
      <description>&lt;p&gt;Create a new file called &lt;code&gt;Application.java&lt;/code&gt; and paste the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import javax.swing.*;&#xA;import java.net.InetAddress;&#xA;import java.net.UnknownHostException;&#xA;&#xA;public class Application {&#xA;    public static void main(String...args) throws UnknownHostException {&#xA;        JFrame frame = new JFrame(&amp;#34;Sample App&amp;#34;);&#xA;        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);&#xA;        frame.setSize(300,300);&#xA;&#xA;        String user = System.getProperty(&amp;#34;user.name&amp;#34;);&#xA;        String host = InetAddress.getLocalHost().getHostName();&#xA;&#xA;        JTextArea txt = new JTextArea();&#xA;        txt.setText(&#xA;                &amp;#34;\n&amp;#34; +&#xA;                &amp;#34;  User: &amp;#34;+user+&amp;#34;\n&amp;#34; +&#xA;                &amp;#34;  Host: &amp;#34;+host+&amp;#34;\n&amp;#34;&#xA;        );&#xA;        frame.getContentPane().add(txt);&#xA;&#xA;        frame.setVisible(true);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now open the terminal/command-line and type:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;java Application.java&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will show a GUI application that will have a textarea with two lines of text:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to view a Terraform Module’s Output</title>
      <link>https://andrewodendaal.com/how-to-view-a-terraform-modules-output/</link>
      <pubDate>Thu, 06 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-view-a-terraform-modules-output/</guid>
      <description>&lt;p&gt;An &lt;code&gt;output&lt;/code&gt; in Terraform is a way to view the result of an action that has been performed, or resource that has been created.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s say that you have some code to create a Load Balancer, or Assign a Public IP. Once this action is complete, the &lt;code&gt;output&lt;/code&gt; block will have access to this created value.&lt;/p&gt;&#xA;&lt;h2 id=&#34;an-simple-output-example&#34;&gt;An simple &lt;code&gt;output&lt;/code&gt; example&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;outputs.tf&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;output &amp;#34;instance_ips&amp;#34; {&#xA;  value = aws_instance.web.*.public_ip&#xA;}&#xA;&#xA;output &amp;#34;lb_address&amp;#34; {&#xA;  value = aws_alb.web.public_dns&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will output the values to the console once the &lt;code&gt;terraform apply&lt;/code&gt; step has successfully run.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Count the Characters in Python</title>
      <link>https://andrewodendaal.com/how-to-count-the-characters-in-python/</link>
      <pubDate>Wed, 05 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-count-the-characters-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The goal of this challenge is to write a function that takes two inputs: a string and a character. The function will count the number of times that character appears in the string. The count is case insensitive.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;count_char(&amp;#34;fizzbuzz&amp;#34;,&amp;#34;z&amp;#34;) # 4&#xA;count_char(&amp;#34;Fancy fifth fly aloof&amp;#34;,&amp;#34;f&amp;#34;) # 5&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The character can be any alphanumeric character.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def count_char(haystack, needle):&#xA;    count = 0&#xA;    for c in haystack:&#xA;        if c.lower()==needle.lower():&#xA;            count+=1&#xA;    return count&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Install Cuda driver for Nvidia on Ubuntu</title>
      <link>https://andrewodendaal.com/how-to-install-cuda-driver-for-nvidia-on-ubuntu/</link>
      <pubDate>Tue, 04 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-install-cuda-driver-for-nvidia-on-ubuntu/</guid>
      <description>&lt;p&gt;If you have just upgraded Ubuntu on your AWS g4dn instance and need to install/reinstall Cuda drivers for your Nvidia chipset, then you can run the following:&lt;/p&gt;&#xA;&lt;h2 id=&#34;install-cuda-drivers-for-nvidia-on-ubuntu&#34;&gt;Install Cuda drivers for Nvidia on Ubuntu&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin&#xA;sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600&#xA;sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub&#xA;sudo add-apt-repository &amp;#34;deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /&amp;#34;&#xA;sudo apt-get update&#xA;sudo apt-get -y install cuda&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-get-the-versions-for-your-own-setup&#34;&gt;How to get the versions for your own setup&lt;/h2&gt;&#xA;&lt;p&gt;Or &lt;!-- raw HTML omitted --&gt;follow the wizard here&lt;!-- raw HTML omitted --&gt; to generate the correct version numbers for your specific environment/platform:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to List all Running Services on Ubuntu</title>
      <link>https://andrewodendaal.com/how-to-list-all-running-services-on-ubuntu/</link>
      <pubDate>Mon, 03 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-list-all-running-services-on-ubuntu/</guid>
      <description>&lt;p&gt;If you need to view a list of all the services that are either running or stopped (or both) on an Ubuntu server, then you can use the following command:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;service --status-all&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will print out a list of services that may look something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;# service --status-all&#xA; [ - ]  acpid&#xA; [ + ]  apache-htcacheclean&#xA; [ + ]  apache2&#xA; [ + ]  apparmor&#xA; [ + ]  apport&#xA; [ + ]  atd&#xA; [ - ]  console-setup.sh&#xA; [ + ]  cron&#xA; [ - ]  cryptdisks&#xA; [ - ]  cryptdisks-early&#xA; [ + ]  datadog-agent&#xA; [ + ]  datadog-agent-process&#xA; [ + ]  datadog-agent-trace&#xA; [ + ]  dbus&#xA; [ - ]  docker&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;only-show-running-services-in-ubuntu&#34;&gt;Only show Running Services in Ubuntu&lt;/h2&gt;&#xA;&lt;p&gt;If you are only interested in the &lt;code&gt;running&lt;/code&gt; services, then we can filter by the &lt;code&gt;[ + ]&lt;/code&gt; items:&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] conflict: unable to remove repository reference in Docker</title>
      <link>https://andrewodendaal.com/solved-conflict-unable-to-remove-repository-reference-in-docker/</link>
      <pubDate>Sun, 02 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-conflict-unable-to-remove-repository-reference-in-docker/</guid>
      <description>&lt;p&gt;If you get the following error while trying to delete an image in Docker:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Error response from daemon: conflict: unable to remove repository reference &amp;quot;some-image&amp;quot; (must force) - container 3ab4c18d2219 is using its referenced image 133c1827439a&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;You may already have tried looking for the container, but it seems to not exist!&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-remove-the-docker-container-and-image&#34;&gt;How to Remove the Docker Container and Image&lt;/h2&gt;&#xA;&lt;p&gt;This usually means that the Docker container has already terminated, and is why you won&amp;rsquo;t see it running.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Upgrade an Ubuntu Server</title>
      <link>https://andrewodendaal.com/how-to-upgrade-an-ubuntu-server/</link>
      <pubDate>Sat, 01 Jan 2022 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-upgrade-an-ubuntu-server/</guid>
      <description>&lt;p&gt;Upgrading an Ubuntu Server is quite easy, just follow the below commands:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-tldr-just-run-the-below&#34;&gt;Option 1: Tldr; (just run the below!)&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&#xA;sudo apt dist-upgrade&#xA;sudo do-release-upgrade&#xA;reboot&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-follow-the-steps-to-upgrade-ubuntu-server&#34;&gt;Option 2: Follow the steps to Upgrade Ubuntu Server&lt;/h2&gt;&#xA;&lt;h3 id=&#34;1-update-the-packages&#34;&gt;1: Update the packages:&lt;/h3&gt;&#xA;&lt;p&gt;Start by making sure that you have all the packages and dependencies ready locally before we upgrade&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;2-update-the-dependencies-for-the-distribution&#34;&gt;2: Update the dependencies for the distribution:&lt;/h3&gt;&#xA;&lt;p&gt;&lt;code&gt;sudo apt dist-upgrade&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve Two-Sum in Java</title>
      <link>https://andrewodendaal.com/how-to-solve-two-sum-in-java/</link>
      <pubDate>Fri, 31 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-two-sum-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that takes an array of numbers (integers for the tests) and a target number. It should find two different items in the array that, when added together, give the target value. The indices of these items should then be returned in a tuple like so: &lt;code&gt;(index1, index2)&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For the purposes of this challenge, some tests may have multiple answers; any valid solutions will be accepted.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Sort the Gift Code in Java</title>
      <link>https://andrewodendaal.com/how-to-sort-the-gift-code-in-java/</link>
      <pubDate>Thu, 30 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-sort-the-gift-code-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Santa&amp;rsquo;s senior gift organizer Elf developed a way to represent up to 26 gifts by assigning a unique alphabetical character to each gift. After each gift was assigned a character, the gift organizer Elf then joined the characters to form the gift ordering code.&lt;/p&gt;&#xA;&lt;p&gt;Santa asked his organizer to order the characters in alphabetical order, but the Elf fell asleep from consuming too much hot chocolate and candy canes! Can you help him out?&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get the Numericals of a String in Java</title>
      <link>https://andrewodendaal.com/how-to-get-the-numericals-of-a-string-in-java/</link>
      <pubDate>Wed, 29 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-numericals-of-a-string-in-java/</guid>
      <description>&lt;p&gt;You are given an input string.&lt;/p&gt;&#xA;&lt;p&gt;For each symbol in the string if it&amp;rsquo;s the first character occurrence, replace it with a ‘1&amp;rsquo;, else replace it with the amount of times you&amp;rsquo;ve already seen it.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;input   =  &amp;#34;Hello, World!&amp;#34;&#xA;result  =  &amp;#34;1112111121311&amp;#34;&#xA;&#xA;input   =  &amp;#34;aaaaaaaaaaaa&amp;#34;&#xA;result  =  &amp;#34;123456789101112&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;There might be some non-ascii characters in the string.&lt;/p&gt;&#xA;&lt;p&gt;Note: there will be no int domain overflow (character occurrences will be less than 2 billion).&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Replace Noun Phrases with Pronouns  in Golang</title>
      <link>https://andrewodendaal.com/how-to-replace-noun-phrases-with-pronouns-in-golang/</link>
      <pubDate>Tue, 28 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-replace-noun-phrases-with-pronouns-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;A Noun Phrase is a phrase that can be replaced by a pronoun [he/she/it].&lt;/p&gt;&#xA;&lt;p&gt;For example, in the sentence:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;a girl ate the cookie&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&amp;ldquo;A girl&amp;rdquo; is a Noun Phrase, so we can say &amp;ldquo;&lt;strong&gt;she&lt;/strong&gt; ate the cookie.&amp;rdquo; &amp;ldquo;The cookie&amp;rdquo; is also a Noun Phrase, so we can even say &amp;ldquo;&lt;strong&gt;she&lt;/strong&gt; ate &lt;strong&gt;it&lt;/strong&gt;.&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;Both of these Noun Phrases are made up of an auxialliary (aux) [the/a] followed by a Noun (N) [girl/cookie].&lt;/p&gt;</description>
    </item>
    <item>
      <title>Maximum Positive Integer Rotations in Golang</title>
      <link>https://andrewodendaal.com/maximum-positive-integer-rotations-in-golang/</link>
      <pubDate>Mon, 27 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/maximum-positive-integer-rotations-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write &lt;code&gt;function MaxRot(n)&lt;/code&gt; which given a positive integer &lt;code&gt;n&lt;/code&gt; returns the maximum number you got doing rotations similar to the above example.&lt;/p&gt;&#xA;&lt;p&gt;So &lt;code&gt;MaxRot&lt;/code&gt; is such as:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;MaxRot(56789) should return 68957&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;MaxRot(38458215) should return 85821534&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Take a number: &lt;code&gt;56789&lt;/code&gt;. Rotate left, you get &lt;code&gt;67895&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Keep the first digit in place and rotate left the other digits: &lt;code&gt;68957&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Keep the first two digits in place and rotate the other ones: &lt;code&gt;68579&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to “Dashatize It” in Java</title>
      <link>https://andrewodendaal.com/how-to-dashatize-it-in-java/</link>
      <pubDate>Sun, 26 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-dashatize-it-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a variable &lt;code&gt;n&lt;/code&gt;,&lt;/p&gt;&#xA;&lt;p&gt;If &lt;code&gt;n&lt;/code&gt; is an integer, Return a string with dash&lt;code&gt;&#39;-&#39;&lt;/code&gt;marks before and after each odd integer, but do not begin or end the string with a dash mark. If &lt;code&gt;n&lt;/code&gt; is negative, then the negative sign should be removed.&lt;/p&gt;&#xA;&lt;p&gt;If &lt;code&gt;n&lt;/code&gt; is not an integer, return an empty value.&lt;/p&gt;&#xA;&lt;p&gt;Ex:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;dashatize(274) -&amp;gt; &amp;#39;2-7-4&amp;#39;&#xA;dashatize(6815) -&amp;gt; &amp;#39;68-1-5&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution {&#xA;    public static String dashatize(int num) {&#xA;      String n = String.valueOf(Math.abs(num)).replaceAll(&amp;#34;-&amp;#34;, &amp;#34;&amp;#34;);&#xA;      return java.util.Arrays.asList(n.split(&amp;#34;&amp;#34;)).stream()&#xA;        .map(ch -&amp;gt; Integer.valueOf(ch) % 2 !=0 ? &amp;#34;-&amp;#34;+ch+&amp;#34;-&amp;#34; : ch)&#xA;        .collect(java.util.stream.Collectors.joining(&amp;#34;&amp;#34;))&#xA;        .replaceAll(&amp;#34;--&amp;#34;, &amp;#34;-&amp;#34;)&#xA;        .replaceAll(&amp;#34;^-+&amp;#34;, &amp;#34;&amp;#34;)&#xA;        .replaceAll(&amp;#34;-+$&amp;#34;, &amp;#34;&amp;#34;);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create a Nickname Generator in Python</title>
      <link>https://andrewodendaal.com/how-to-create-a-nickname-generator-in-python/</link>
      <pubDate>Sat, 25 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-nickname-generator-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a &lt;strong&gt;nickname generator&lt;/strong&gt; function, &lt;code&gt;nicknameGenerator&lt;/code&gt; that takes a string name as an argument and returns the first 3 or 4 letters as a nickname.&lt;/p&gt;&#xA;&lt;p&gt;The nickname generator should perform the following tasks.&lt;/p&gt;&#xA;&lt;p&gt;If the 3rd letter is a consonant, return the first 3 letters.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;nickname(&amp;#34;Robert&amp;#34;) # &amp;#34;Rob&amp;#34;&#xA;nickname(&amp;#34;Kimberly&amp;#34;) # &amp;#34;Kim&amp;#34;&#xA;nickname(&amp;#34;Samantha&amp;#34;) # &amp;#34;Sam&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If the 3rd letter is a vowel, return the first 4 letters.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;nickname(&amp;#34;Jeannie&amp;#34;) # &amp;#34;Jean&amp;#34;&#xA;nickname(&amp;#34;Douglas&amp;#34;) # &amp;#34;Doug&amp;#34;&#xA;nickname(&amp;#34;Gregory&amp;#34;) # &amp;#34;Greg&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If the string is less than 4 characters, return &amp;ldquo;Error: Name too short&amp;rdquo;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Comparing Array Multiplicities in Java</title>
      <link>https://andrewodendaal.com/comparing-array-multiplicities-in-java/</link>
      <pubDate>Fri, 24 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/comparing-array-multiplicities-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given two arrays &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; write a function &lt;code&gt;comp(a, b)&lt;/code&gt; (or&lt;code&gt;compSame(a, b)&lt;/code&gt;) that checks whether the two arrays have the &amp;ldquo;same&amp;rdquo; elements, with the same &lt;em&gt;multiplicities&lt;/em&gt;. &amp;ldquo;Same&amp;rdquo; means, here, that the elements in &lt;code&gt;b&lt;/code&gt; are the elements in &lt;code&gt;a&lt;/code&gt; squared, regardless of the order.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;a = [121, 144, 19, 161, 19, 144, 19, 11]  &#xA;b = [121, 14641, 20736, 361, 25921, 361, 20736, 361]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;comp(a, b)&lt;/code&gt; returns true because in &lt;code&gt;b&lt;/code&gt; 121 is the square of 11, 14641 is the square of 121, 20736 the square of 144, 361 the square of 19, 25921 the square of 161, and so on. It gets obvious if we write &lt;code&gt;b&lt;/code&gt;‘s elements in terms of squares:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Sum of Angles in Golang</title>
      <link>https://andrewodendaal.com/how-to-find-the-sum-of-angles-in-golang/</link>
      <pubDate>Thu, 23 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-sum-of-angles-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Find the total sum of internal angles (in degrees) in an n-sided simple polygon.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;N&lt;/code&gt; will be greater than 2.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;func Angle(n int) int {&#xA;    return (n - 2) * 180&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;func Angle(n int) (r int) {&#xA;    r = (n-2)*180&#xA;    return&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;func Angle(n int) int {&#xA;    return (n/2-1) * 360 + n%2 * 180&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution_test&#xA;import (&#xA;  . &amp;#34;github.com/onsi/ginkgo&amp;#34;&#xA;  . &amp;#34;github.com/onsi/gomega&amp;#34;&#xA;)&#xA;var _ = Describe(&amp;#34;Basic tests&amp;#34;, func() {&#xA;    It(&amp;#34;Angle(3)&amp;#34;, func() { Expect(Angle(3)).To(Equal(180)) })&#xA;    It(&amp;#34;Angle(4)&amp;#34;, func() { Expect(Angle(4)).To(Equal(360)) })&#xA;})&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Find the Max Tree Node Value in Java</title>
      <link>https://andrewodendaal.com/how-to-find-the-max-tree-node-value-in-java/</link>
      <pubDate>Wed, 22 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-max-tree-node-value-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given a binary tree. Implement the method &lt;code&gt;findMax&lt;/code&gt; which returns the maximal node value in the tree.&lt;/p&gt;&#xA;&lt;p&gt;For example, the maximum in the following Tree is 11.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;              7&#xA;            /   \ &#xA;           /     \&#xA;          5       2&#xA;           \       \&#xA;           6        11          &#xA;           /\      /&#xA;          1  9   4&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Tree node values range is Integer MIN VALUE – Integer MAX VALUE constants.&lt;/li&gt;&#xA;&lt;li&gt;Tree can unbalanced and unsorted.&lt;/li&gt;&#xA;&lt;li&gt;Root node is always not null.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;You are given a tree node class as follows:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to String Search with a Wildcard in Java</title>
      <link>https://andrewodendaal.com/how-to-string-search-with-a-wildcard-in-java/</link>
      <pubDate>Tue, 21 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-string-search-with-a-wildcard-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The method below is the most simple string search algorithm. It will find the first occurrence of a word in a text string.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;haystack = the whole text&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;needle = searchword&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;wildcard = _&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;find(&amp;#34;strike&amp;#34;, &amp;#34;i will strike down upon thee&amp;#34;); // return 7&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The find method is already made.&lt;/p&gt;&#xA;&lt;p&gt;The problem is to implement wildcard(s) in the needle. If you have a _ in the needle it will match any character in the haystack.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get the AWS AccountID in Terraform</title>
      <link>https://andrewodendaal.com/how-to-get-the-aws-accountid-in-terraform/</link>
      <pubDate>Mon, 20 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-aws-accountid-in-terraform/</guid>
      <description>&lt;p&gt;If you are automating AWS resources in Terraform, then you will want to not hardcode things as much as possible.&lt;/p&gt;&#xA;&lt;p&gt;Terraform makes it possible to pull the &lt;code&gt;account_id&lt;/code&gt; from the local credentials.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-get-the-accountid-data-attributes&#34;&gt;How to get the AccountID data attributes&lt;/h2&gt;&#xA;&lt;p&gt;Create a &lt;code&gt;data.tf&lt;/code&gt; file and place the following item in it:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;data &amp;#34;aws_caller_identity&amp;#34; &amp;#34;current&amp;#34; {}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now the account_id will be available to you within your standard code as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;data.aws_caller_identity.current.account_id&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-use-the-accountid-data-attributes&#34;&gt;How to use the AccountID data attributes&lt;/h2&gt;&#xA;&lt;p&gt;This can now be used in a module, or wherever you need to reference the account id:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Error creating AppStream Fleet – InvalidRoleException</title>
      <link>https://andrewodendaal.com/error-creating-appstream-fleet-invalidroleexception/</link>
      <pubDate>Sun, 19 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/error-creating-appstream-fleet-invalidroleexception/</guid>
      <description>&lt;p&gt;If you get the following error when trying to run some Terraform:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;error creating Appstream Fleet (): InvalidRoleException: AppStream 2.0 encountered an error because your service role &#39;arn:aws:iam::&amp;lt;ACCOUNT_ID&amp;gt;:role/service-role/AmazonAppStreamServiceAccess&#39; is invalid&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;..then you just need to run your IaC again, as the roles are automatically created when you first interact with the service.&lt;/p&gt;&#xA;&lt;p&gt;Alternatively, go and have a look at what has already been created in the AWS Console.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-roles-are-required-for-appstream&#34;&gt;What roles are required for AppStream?&lt;/h2&gt;&#xA;&lt;p&gt;Role required by AWS AppStream:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create AWS AppStream resources in Terraform</title>
      <link>https://andrewodendaal.com/how-to-create-aws-appstream-resources-in-terraform/</link>
      <pubDate>Sat, 18 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-aws-appstream-resources-in-terraform/</guid>
      <description>&lt;p&gt;AWS AppStream has finally made its way into the Terraform AWS Provider.&lt;/p&gt;&#xA;&lt;p&gt;If you are using &lt;code&gt;hashicorp/aws&lt;/code&gt; version &lt;code&gt;3.67&lt;/code&gt; or above, then you can do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;terraform {&#xA;  required_version = &amp;#34;~&amp;gt; 1.0&amp;#34;&#xA;  required_providers {&#xA;    aws = {&#xA;      source  = &amp;#34;hashicorp/aws&amp;#34;&#xA;      version = &amp;#34;~&amp;gt; 3.67&amp;#34;&#xA;    }&#xA;  }&#xA;}&#xA;provider &amp;#34;aws&amp;#34; {&#xA;  region = &amp;#34;eu-west-1&amp;#34;&#xA;  default_tags {&#xA;    tags = {&#xA;      Contact = &amp;#34;you@example.com&amp;#34;&#xA;      Environment = &amp;#34;dev&amp;#34;&#xA;      DeployedBy = &amp;#34;Automation:Terraform&amp;#34;&#xA;    }&#xA;  }&#xA;}&#xA;&#xA;resource &amp;#34;aws_appstream_fleet&amp;#34; &amp;#34;example&amp;#34; {&#xA;  name          = &amp;#34;ao-tmp-fleet-1&amp;#34;&#xA;  image_name    = &amp;#34;Amazon-AppStream2-Sample-Image-02-04-2019&amp;#34;&#xA;  instance_type = &amp;#34;stream.standard.small&amp;#34;&#xA;&#xA;  compute_capacity {&#xA;    desired_instances = 1&#xA;  }&#xA;}&#xA;resource &amp;#34;aws_appstream_stack&amp;#34; &amp;#34;example&amp;#34; {&#xA;  name = &amp;#34;ao-tmp-stack-1&amp;#34;&#xA;}&#xA;resource &amp;#34;aws_appstream_fleet_stack_association&amp;#34; &amp;#34;example&amp;#34; {&#xA;  fleet_name = aws_appstream_fleet.example.name&#xA;  stack_name = aws_appstream_stack.example.name&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Stop a Goroutine in Golang</title>
      <link>https://andrewodendaal.com/how-to-stop-a-goroutine-in-golang/</link>
      <pubDate>Fri, 17 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-stop-a-goroutine-in-golang/</guid>
      <description>&lt;p&gt;It&amp;rsquo;s possible to stop a Goroutine by sending a value into it via a &lt;code&gt;signal channel&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;exit := make(chan bool)&#xA;go func() {&#xA;    for {&#xA;        select {&#xA;        case &amp;lt;- exit:&#xA;            return&#xA;        default:&#xA;            // Perform some tasks&#xA;        }&#xA;    }&#xA;}()&#xA;&#xA;// Exit the Goroutine&#xA;exit &amp;lt;- true&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As an alternative, you could also use a &lt;code&gt;WaitGroup&lt;/code&gt; and &lt;code&gt;range&lt;/code&gt; over it:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;import (&#xA;    &amp;#34;fmt&amp;#34;&#xA;    &amp;#34;sync&amp;#34;&#xA;)&#xA;func main() {&#xA;    var wg sync.WaitGroup&#xA;    c := make(chan bool)&#xA;    wg.Add(1)&#xA;    go func() {&#xA;        defer wg.Done()&#xA;        for b := range c {&#xA;            fmt.Printf(&amp;#34;Hello %t\n&amp;#34;, b)&#xA;        }&#xA;    }()&#xA;    c &amp;lt;- true&#xA;    c &amp;lt;- true&#xA;    close(c)&#xA;    wg.Wait()&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Create an Empty Branch in Git</title>
      <link>https://andrewodendaal.com/how-to-create-an-empty-branch-in-git/</link>
      <pubDate>Thu, 16 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-an-empty-branch-in-git/</guid>
      <description>&lt;p&gt;If you need to create an empty branch in git, you can follow one of the below options.&lt;/p&gt;&#xA;&lt;p&gt;If you are using git version 2.27 or newer, then follow the &lt;code&gt;switch&lt;/code&gt; route (option 1) below, otherwise fall back to the older way, using &lt;code&gt;checkout&lt;/code&gt; and &lt;code&gt;delete&lt;/code&gt; (option 2).&lt;/p&gt;&#xA;&lt;h2 id=&#34;newer-way-8211-using-switch&#34;&gt;Newer way – Using &lt;code&gt;switch&lt;/code&gt;:&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git switch --orphan &amp;lt;new branch&amp;gt;&#xA;git commit --allow-empty -m &amp;#34;Initial commit on orphan branch&amp;#34;&#xA;git push -u origin &amp;lt;new branch&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;older-way-8211-using-checkout-and-delete&#34;&gt;Older way – Using &lt;code&gt;checkout&lt;/code&gt; and &lt;code&gt;delete&lt;/code&gt;:&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git checkout --orphan &amp;lt;new branch&amp;gt;&#xA;git rm -rf .&#xA;git commit --allow-empty -m &amp;#34;root commit&amp;#34;&#xA;git push origin &amp;lt;new branch&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Get the Consonant Value in Java</title>
      <link>https://andrewodendaal.com/get-the-consonant-value-in-java/</link>
      <pubDate>Wed, 15 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-the-consonant-value-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a lowercase string that has alphabetic characters only and no spaces, return the highest value of consonant substrings. Consonants are any letters of the alphabet except &lt;code&gt;&amp;quot;aeiou&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;We shall assign the following values: &lt;code&gt;a = 1, b = 2, c = 3, .... z = 26&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For example, for the word &amp;ldquo;zodiacs&amp;rdquo;, let&amp;rsquo;s cross out the vowels. We get: &amp;ldquo;z &lt;strong&gt;&lt;!-- raw HTML omitted --&gt;o&lt;!-- raw HTML omitted --&gt;&lt;/strong&gt; d &lt;strong&gt;&lt;!-- raw HTML omitted --&gt;ia&lt;!-- raw HTML omitted --&gt;&lt;/strong&gt; cs&amp;rdquo;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Check for Factor in Python</title>
      <link>https://andrewodendaal.com/how-to-check-for-factor-in-python/</link>
      <pubDate>Tue, 14 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-check-for-factor-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;This function should test if the &lt;code&gt;factor&lt;/code&gt; is a factor of &lt;code&gt;base&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Return &lt;code&gt;true&lt;/code&gt; if it is a factor or &lt;code&gt;false&lt;/code&gt; if it is not.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;Factors are numbers you can multiply together to get another number.&lt;/p&gt;&#xA;&lt;p&gt;2 and 3 are factors of 6 because: &lt;code&gt;2 * 3 = 6&lt;/code&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You can find a factor by dividing numbers. If the remainder is 0 then the number is a factor.&lt;/li&gt;&#xA;&lt;li&gt;You can use the mod operator (&lt;code&gt;%&lt;/code&gt;) in most languages to check for a remainder&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Understanding Bitwise Operators in Python</title>
      <link>https://andrewodendaal.com/understanding-bitwise-operators-in-python/</link>
      <pubDate>Mon, 13 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/understanding-bitwise-operators-in-python/</guid>
      <description>&lt;p&gt;There are 6 binary/bitwise operators in Python:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Complement/Not (&lt;code&gt;~&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;And (&lt;code&gt;&amp;amp;&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Or (&lt;code&gt;|&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;XOR (&lt;code&gt;^&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Left Shift (&lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Right Shift (&lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;A fantastic python method to help us along our journey is &lt;code&gt;bin()&lt;/code&gt;. The &lt;code&gt;bin&lt;/code&gt; function will return a binary representation of a base 10 integer we pass to it.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; bin(1)&#xA;&amp;#39;0b1&amp;#39;&#xA;&#xA;&amp;gt;&amp;gt;&amp;gt; bin(5)&#xA;&amp;#39;0b101&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now let&amp;rsquo;s explore the 6 bitwise operators by learning a bit about each of them.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Word Values Challenge in Java</title>
      <link>https://andrewodendaal.com/word-values-challenge-in-java/</link>
      <pubDate>Sun, 12 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/word-values-challenge-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a string &lt;code&gt;&amp;quot;abc&amp;quot;&lt;/code&gt; and assuming that each letter in the string has a value equal to its position in the alphabet, our string will have a value of &lt;code&gt;1 + 2 + 3 = 6&lt;/code&gt;. This means that: &lt;code&gt;a = 1, b = 2, c = 3 ....z = 26&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You will be given a list of strings and your task will be to return the values of the strings as explained above multiplied by the position of that string in the list. For our purpose, position begins with &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to update/upgrade all Homebrew packages</title>
      <link>https://andrewodendaal.com/how-to-update-upgrade-all-homebrew-packages/</link>
      <pubDate>Sat, 11 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-update-upgrade-all-homebrew-packages/</guid>
      <description>&lt;p&gt;If you use Homebrew – and you probably should if you&amp;rsquo;re on a Mac – then you have probably installed various different applications and packages as time went on. It&amp;rsquo;s probably likely that by now, you have many different packages that are out of date and need to be upgraded to their newer versions.&lt;/p&gt;&#xA;&lt;p&gt;Luckily, Homebrew makes it very easy to upgrade everything; run the following command to upgrade everything.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] FirebaseError: Missing or insufficient permissions</title>
      <link>https://andrewodendaal.com/solved-firebaseerror-missing-or-insufficient-permissions/</link>
      <pubDate>Fri, 10 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-firebaseerror-missing-or-insufficient-permissions/</guid>
      <description>&lt;p&gt;Using Firebase and get the following error in the console?&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Uncaught Error in onSnapshot: FirebaseError: Missing or insufficient permissions.&amp;lt;br&amp;gt;at new FirestoreError (index.cjs.js:x)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-fix-the-missing-or-insufficient-permissions-error&#34;&gt;How to fix the Missing or Insufficient Permissions Error&lt;/h2&gt;&#xA;&lt;h3 id=&#34;option-1-change-rules-recommended&#34;&gt;Option 1: Change rules (Recommended)&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Login to Firebase&lt;/li&gt;&#xA;&lt;li&gt;Go to &lt;code&gt;Database&lt;/code&gt; -&amp;gt; &lt;code&gt;Rules&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Change:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;service cloud.firestore {&#xA;  match /databases/{database}/documents {&#xA;    match /{document=**} {&#xA;      allow read, write: if false;&#xA;    }&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;to:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;service cloud.firestore {&#xA;  match /databases/{database}/documents {&#xA;    match /{document=**} {&#xA;      allow read, write: if request.auth != null;&#xA;    }&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;option-2-override-authorization--disable-security&#34;&gt;Option 2: Override Authorization / Disable Security&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Login to Firebase&lt;/li&gt;&#xA;&lt;li&gt;Go to &lt;code&gt;Database&lt;/code&gt; -&amp;gt; &lt;code&gt;Rules&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Change &lt;code&gt;allow read, write&lt;/code&gt; from &lt;code&gt;false&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; [for dev]&lt;/li&gt;&#xA;&lt;li&gt;Change &lt;code&gt;allow read, write&lt;/code&gt; from &lt;code&gt;false&lt;/code&gt; to &lt;code&gt;request.auth != null&lt;/code&gt; [for prod]&lt;/li&gt;&#xA;&lt;/ol&gt;</description>
    </item>
    <item>
      <title>[Solved] Error: Cannot find module ‘../lib/cli.js’</title>
      <link>https://andrewodendaal.com/solved-error-cannot-find-module-lib-cli-js/</link>
      <pubDate>Thu, 09 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-error-cannot-find-module-lib-cli-js/</guid>
      <description>&lt;p&gt;If you try and run &lt;code&gt;npm i&lt;/code&gt; and get &lt;code&gt;Error: Cannot find module &#39;../lib/cli.js&#39;&lt;/code&gt;, then you can easily fix the problem by running the following.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-does-the-error-look&#34;&gt;How does the error look?&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Error: Cannot find module &amp;#39;../lib/cli.js&amp;#39;&#xA;Require stack:&#xA;- /usr/local/lib/node_modules/npm/bin/npm-cli.js&#xA;    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)&#xA;    at Function.Module._load (node:internal/modules/cjs/loader:778:27)&#xA;    at Module.require (node:internal/modules/cjs/loader:999:19)&#xA;    at require (node:internal/modules/cjs/helpers:102:18)&#xA;    at Object.&amp;lt;anonymous&amp;gt; (/usr/local/lib/node_modules/npm/bin/npm-cli.js:2:1)&#xA;    at Module._compile (node:internal/modules/cjs/loader:1095:14)&#xA;    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)&#xA;    at Module.load (node:internal/modules/cjs/loader:975:32)&#xA;    at Function.Module._load (node:internal/modules/cjs/loader:822:12)&#xA;    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {&#xA;  code: &amp;#39;MODULE_NOT_FOUND&amp;#39;,&#xA;  requireStack: [ &amp;#39;/usr/local/lib/node_modules/npm/bin/npm-cli.js&amp;#39; ]&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-solve-the-module-not-found-error&#34;&gt;How to solve the Module Not Found error&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;brew uninstall --ignore-dependencies node&#xA;sudo chown -R $(whoami) /usr/local/*&#xA;brew cleanup&#xA;brew install node&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will uninstall and cleanup your previous &lt;code&gt;node&lt;/code&gt; installation, making sure to set the correct permissions, before reinstalling it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to use Git Commit in GitHub Actions</title>
      <link>https://andrewodendaal.com/how-to-use-git-commit-in-github-actions/</link>
      <pubDate>Wed, 08 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-use-git-commit-in-github-actions/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;ve tried to use &lt;code&gt;git commit&lt;/code&gt; in GitHub Actions before, you may have come across the following error messages:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Author identity unknown&#xA;*** Please tell me who you are.&#xA;&#xA;Run&#xA;  git config --global user.email &amp;#34;you@example.com&amp;#34;&#xA;  git config --global user.name &amp;#34;Your Name&amp;#34;&#xA;&#xA;to set your account&amp;#39;s default identity.&#xA;Omit --global to set the identity only in this repository.&#xA;&#xA;fatal: empty ident name&#xA;    (for &amp;lt;runner@fv-az191-422.gxxxxxjfkf.bx.internal.cloudapp.net&amp;gt;) not allowed&#xA;Author identity unknown&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This can easily be fixed by doing the following:&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] Error acquiring the state lock in Terraform</title>
      <link>https://andrewodendaal.com/solved-error-acquiring-the-state-lock-in-terraform/</link>
      <pubDate>Tue, 07 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-error-acquiring-the-state-lock-in-terraform/</guid>
      <description>&lt;p&gt;If you have been handed the &lt;code&gt;Acquiring state lock&lt;/code&gt; error message about &lt;code&gt;ConditionalCheckFailedException: The conditional request&lt;/code&gt; then you have 2 options for fixing it!&lt;/p&gt;&#xA;&lt;p&gt;The error looks something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Acquiring state lock. This may take a few moments...&#xA;╷&#xA;│ Error: Error acquiring the state lock&#xA;│ &#xA;│ Error message: ConditionalCheckFailedException: The conditional request&#xA;│ failed&#xA;│ Lock Info:&#xA;│   ID:        3324a6cb-7401-3194-d650-fxxxxxx3864&#xA;│   Path:      xxxx-terraformstate-nonprod/env:/xxxx/terraform.tfstate&#xA;│   Operation: OperationTypeApply&#xA;│   Who:       root@ip-100-65-2-165&#xA;│   Version:   1.0.4&#xA;│   Created:   2021-11-29 21:00:37.652114035 +0000 UTC&#xA;│   Info:&#xA;│ &#xA;│ Terraform acquires a state lock to protect the state from being written&#xA;│ by multiple users at the same time. Please resolve the issue above and try&#xA;│ again. For most commands, you can disable locking with the &amp;#34;-lock=false&amp;#34;&#xA;│ flag, but this is not recommended.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;there-are-3-possible-ways-to-fix-this&#34;&gt;There are 3 possible ways to fix this&lt;/h2&gt;&#xA;&lt;p&gt;In short, you want to delete the lock associated. This is achieved by forcing an unlock.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Install Chocolatey on Windows PowerShell</title>
      <link>https://andrewodendaal.com/how-to-install-chocolatey-on-windows-powershell/</link>
      <pubDate>Mon, 06 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-install-chocolatey-on-windows-powershell/</guid>
      <description>&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;chocolatey.org&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;how-to-install-chocolatey-in-powershell&#34;&gt;How to Install Chocolatey in PowerShell&lt;/h2&gt;&#xA;&lt;p&gt;Open &lt;code&gt;PowerShell&lt;/code&gt; (&lt;!-- raw HTML omitted --&gt;Run PowerShell in Administrator mode&lt;!-- raw HTML omitted --&gt;) and paste the following script:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(&amp;#39;https://community.chocolatey.org/install.ps1&amp;#39;))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will install Chocolatey, and get you to the point of being able to install packages.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to run PowerShell in Administrator Mode</title>
      <link>https://andrewodendaal.com/how-to-run-powershell-in-administrator-mode/</link>
      <pubDate>Sun, 05 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-run-powershell-in-administrator-mode/</guid>
      <description>&lt;p&gt;Some &lt;code&gt;PowerShell&lt;/code&gt; commands require elevated permissions to complete.&lt;/p&gt;&#xA;&lt;p&gt;To do this, you must first open &lt;code&gt;PowerShell in Administrator Mode&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;steps-to-run-powershell-as-an-administrator&#34;&gt;Steps to Run PowerShell as an Administrator&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Click &lt;code&gt;Start&lt;/code&gt; (super key)&lt;/li&gt;&#xA;&lt;li&gt;Type &lt;code&gt;powershell&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Right-click on &lt;code&gt;Windows PowerShell&lt;/code&gt; and select &lt;code&gt;Run as administrator&lt;/code&gt;&lt;br&gt;&#xA;or;&lt;br&gt;&#xA;Select &lt;code&gt;Run as Administrator&lt;/code&gt; from the right-hand-side menu.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2021/11/image-4-430x350.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;(Run as Administrator)&lt;/p&gt;&#xA;&lt;p&gt;The application will now be started in Administrator Mode.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] Permission denied @ apply2files – /usr/local/lib/node_modules/expo-cli/node_modules/extglob/lib</title>
      <link>https://andrewodendaal.com/solved-permission-denied-apply2files-usr-local-lib-node_modules-expo-cli-node_modules-extglob-lib/</link>
      <pubDate>Sat, 04 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-permission-denied-apply2files-usr-local-lib-node_modules-expo-cli-node_modules-extglob-lib/</guid>
      <description>&lt;p&gt;If you have recently upgraded your MacOS operating system, you may get the following error in your terminal when installing some Homebrew packages:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Error: Permission denied @ apply2files - /usr/local/lib/node_modules/expo-cli/node_modules/.bin/detect-libc&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-solve-the-permissions-denied-problem&#34;&gt;How to solve the Permissions Denied problem&lt;/h2&gt;&#xA;&lt;p&gt;Simply run the following command in your terminal:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo chown -R $(whoami):admin /usr/local/* \&#xA;&amp;amp;&amp;amp; sudo chmod -R g+rwx /usr/local/*&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Or change the user directly:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo chown -R ${LOGNAME}:staff /usr/local/lib/node_modules&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Fix “is not authorized to create managed-rule” in AWS Step Functions</title>
      <link>https://andrewodendaal.com/how-to-fix-is-not-authorized-to-create-managed-rule-in-aws-step-functions/</link>
      <pubDate>Fri, 03 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-fix-is-not-authorized-to-create-managed-rule-in-aws-step-functions/</guid>
      <description>&lt;p&gt;If you have ever received the following error &lt;code&gt;is not authorized to create managed-rule&lt;/code&gt; when running a Step Function through Terraform&amp;rsquo;s AWS Provider, then you may have jumped through many different hoops trying to figure out what was wrong.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-the-quick-fix&#34;&gt;What is the Quick Fix?&lt;/h2&gt;&#xA;&lt;p&gt;Open the &lt;code&gt;role&lt;/code&gt; in &lt;code&gt;IAM&lt;/code&gt; and attach the &lt;code&gt;CloudWatchEventsFullAccess&lt;/code&gt; AWS managed policy to the permissions policies.&lt;/p&gt;&#xA;&lt;h2 id=&#34;need-more-information&#34;&gt;Need More Information?&lt;/h2&gt;&#xA;&lt;h3 id=&#34;iam-role-principal-policy-required-to-assumerole&#34;&gt;IAM Role Principal Policy required to AssumeRole&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&#xA;    &amp;#34;Version&amp;#34; : &amp;#34;2012-10-17&amp;#34;,&#xA;    &amp;#34;Statement&amp;#34; : [&#xA;        {&#xA;        &amp;#34;Effect&amp;#34; : &amp;#34;Allow&amp;#34;,&#xA;        &amp;#34;Principal&amp;#34; : {&#xA;            &amp;#34;Service&amp;#34; : &amp;#34;states.amazonaws.com&amp;#34;&#xA;        },&#xA;        &amp;#34;Action&amp;#34; : &amp;#34;sts:AssumeRole&amp;#34;&#xA;        }&#xA;    ]&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;iam-role-policy-getevents-for-stepfunctions-execution-rule&#34;&gt;IAM Role Policy GetEvents For StepFunctions Execution Rule&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&#xA;    &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,&#xA;    &amp;#34;Action&amp;#34;: [&#xA;        &amp;#34;events:PutTargets&amp;#34;,&#xA;        &amp;#34;events:PutRule&amp;#34;,&#xA;        &amp;#34;events:DescribeRule&amp;#34;&#xA;    ],&#xA;    &amp;#34;Resource&amp;#34;: [&#xA;        &amp;#34;arn:aws:events:[[region]]:[[account]]:rule/StepFunctionsGetEventsForStepFunctionsExecutionRule&amp;#34;&#xA;    ]&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;iam-role-policy-under-stepfunctions-cloudformation&#34;&gt;IAM Role Policy under StepFunctions CloudFormation&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;- Effect: Allow&#xA;  Action:&#xA;  - events:PutTargets&#xA;  - events:PutRule&#xA;  - events:DescribeRule&#xA;  Resource: &#xA;  - !Sub arn:${AWS::Partition}:events:${AWS::Region}:${AWS::AccountId}:rule/StepFunctionsGetEventsForStepFunctionsExecutionRule&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you need to limit it to a resource, then &lt;code&gt;StepFunctionsGetEventsForStepFunctionsExecutionRule&lt;/code&gt; is the one you&amp;rsquo;re looking for!&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to add Account Condition to AWS Lambda Permissions in Terraform</title>
      <link>https://andrewodendaal.com/how-to-add-account-condition-to-aws-lambda-permissions-in-terraform/</link>
      <pubDate>Thu, 02 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-add-account-condition-to-aws-lambda-permissions-in-terraform/</guid>
      <description>&lt;p&gt;If you need to lock an &lt;a href=&#34;https://andrewodendaal.com/how-to-create-a-lambda-in-terraform&#34;&gt;AWS Lambda function&lt;/a&gt; down to a source account for security reasons (PCI.Lambda.1) then you can do so by using the &lt;code&gt;source_account&lt;/code&gt; option of the &lt;code&gt;aws_lambda_permission&lt;/code&gt; Terraform resource type.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;resource &amp;#34;aws_lambda_permission&amp;#34; &amp;#34;do_something_with_bucket&amp;#34; {&#xA;  statement_id   = &amp;#34;AllowExecutionFromS3Bucket&amp;#34;&#xA;  action         = &amp;#34;lambda:InvokeFunction&amp;#34;&#xA;  function_name  = module.do_something_with_bucket.arn&#xA;  principal      = &amp;#34;s3.amazonaws.com&amp;#34;&#xA;  source_arn     = var.source_bucket_arn&#xA;  source_account = var.account_id # &amp;lt;---------- here&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We have stored the &lt;code&gt;account_id&lt;/code&gt; in a variable so that it can be updated when we initialize our Terraform context:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to AssumeRole in Terraform LocalExec Provisioner Block</title>
      <link>https://andrewodendaal.com/how-to-assumerole-in-terraform-localexec-provisioner-block/</link>
      <pubDate>Wed, 01 Dec 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-assumerole-in-terraform-localexec-provisioner-block/</guid>
      <description>&lt;p&gt;I needed to execute a Terraform &lt;code&gt;null_resource&lt;/code&gt; &lt;code&gt;provisioner&lt;/code&gt; (local-exec) block to run an &lt;code&gt;awscli&lt;/code&gt; command, but assume a role passed down to it.&lt;/p&gt;&#xA;&lt;p&gt;There was no obvious way to pass the credentials to it, or assume a role directly, so the following workaround did the trick:&lt;/p&gt;&#xA;&lt;h2 id=&#34;assumerole-and-pass-localexec-provisioner-command&#34;&gt;AssumeRole and Pass LocalExec Provisioner Command&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;resource &amp;#34;null_resource&amp;#34; &amp;#34;start-appstream-fleet&amp;#34; {&#xA;  provisioner &amp;#34;local-exec&amp;#34; {&#xA;    interpreter = [&amp;#34;/bin/bash&amp;#34;, &amp;#34;-c&amp;#34;]&#xA;    command = &amp;lt;&amp;lt;EOF&#xA;set -e&#xA;CREDENTIALS=(`aws sts assume-role \&#xA;  --role-arn ${local.workspace.role} \&#xA;  --role-session-name &amp;#34;start-appstream-fleet&amp;#34; \&#xA;  --query &amp;#34;[Credentials.AccessKeyId,Credentials.SecretAccessKey,Credentials.SessionToken]&amp;#34; \&#xA;  --output text`)&#xA;&#xA;unset AWS_PROFILE&#xA;export AWS_DEFAULT_REGION=us-east-1&#xA;export AWS_ACCESS_KEY_ID=&amp;#34;$${CREDENTIALS[0]}&amp;#34;&#xA;export AWS_SECRET_ACCESS_KEY=&amp;#34;$${CREDENTIALS[1]}&amp;#34;&#xA;export AWS_SESSION_TOKEN=&amp;#34;$${CREDENTIALS[2]}&amp;#34;&#xA;&#xA;aws appstream start-fleet --name sample-app-${var.environment}-fleet --region ${var.region} --output json&#xA;EOF&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The above code snippet runs 2 &lt;code&gt;aws cli&lt;/code&gt; commands. The first is to get the credentials, which are then stored in environment variables, followed by consuming them in the actual &lt;code&gt;aws cli&lt;/code&gt; command at the bottom.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Split and then add both sides of an array together in Java</title>
      <link>https://andrewodendaal.com/split-and-then-add-both-sides-of-an-array-together-in-java/</link>
      <pubDate>Tue, 30 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/split-and-then-add-both-sides-of-an-array-together-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You will receive an array as a parameter that contains 1 or more integers and a number &lt;code&gt;n&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Here is a little visualization of the process:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Step 1: Split the array in two:&lt;code&gt;[1, 2, 5, 7, 2, 3, 5, 7, 8] / \ [1, 2, 5, 7] [2, 3, 5, 7, 8]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Step 2: Put the arrays on top of each other: &lt;code&gt;[1, 2, 5, 7] [2, 3, 5, 7, 8]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Step 3: Add them together:&lt;code&gt;[2, 4, 7, 12, 15]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Repeat the above steps &lt;code&gt;n&lt;/code&gt; times or until there is only one number left, and then return the array.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Highest Rank Number in an Array in Golang</title>
      <link>https://andrewodendaal.com/highest-rank-number-in-an-array-in-golang/</link>
      <pubDate>Mon, 29 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/highest-rank-number-in-an-array-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the method which returns the number which is most frequent in the given input array. If there is a tie for the most frequent number, return the largest number among them.&lt;/p&gt;&#xA;&lt;p&gt;Note: no empty arrays will be given.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[12, 10, 8, 12, 7, 6, 4, 10, 12]              --&amp;gt;  12&#xA;[12, 10, 8, 12, 7, 6, 4, 10, 12, 10]          --&amp;gt;  12&#xA;[12, 10, 8, 8, 3, 3, 3, 3, 2, 4, 10, 12, 10]  --&amp;gt;   3&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sort Words by Position Index in Java</title>
      <link>https://andrewodendaal.com/sort-words-by-position-index-in-java/</link>
      <pubDate>Sun, 28 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/sort-words-by-position-index-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Your task is to sort a given string. Each word in the string will contain a single number. This number is the position the word should have in the result.&lt;/p&gt;&#xA;&lt;p&gt;Note: Numbers can be from 1 to 9. So 1 will be the first word (not 0).&lt;/p&gt;&#xA;&lt;p&gt;If the input string is empty, return an empty string. The words in the input String will only contain valid consecutive numbers.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get the Current Machine Name and Logged In User in Java</title>
      <link>https://andrewodendaal.com/how-to-get-the-current-machine-name-and-logged-in-user-in-java/</link>
      <pubDate>Sat, 27 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-current-machine-name-and-logged-in-user-in-java/</guid>
      <description>&lt;p&gt;It&amp;rsquo;s very easy to get the &lt;code&gt;current machine name&lt;/code&gt; and &lt;code&gt;logged in user&lt;/code&gt; using Java.&lt;/p&gt;&#xA;&lt;h2 id=&#34;get-the-currently-logged-in-user&#34;&gt;Get the Currently Logged in User&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;String username = System.getProperty(&amp;#34;user.name&amp;#34;);&#xA;&#xA;System.out.println(&amp;#34;Username logged in: &amp;#34; + username);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is also platform-independent.&lt;/p&gt;&#xA;&lt;h2 id=&#34;get-the-hostname-of-the-machine&#34;&gt;Get the Hostname of the Machine&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;java.net.InetAddress localMachine = java.net.InetAddress.getLocalHost();&#xA;String hostname = localMachine.getHostName();&#xA;&#xA;System.out.println(&amp;#34;Hostname of local machine: &amp;#34; + hostname);&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to set ZSH as your default Shell</title>
      <link>https://andrewodendaal.com/how-to-set-zsh-as-your-default-shell/</link>
      <pubDate>Fri, 26 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-set-zsh-as-your-default-shell/</guid>
      <description>&lt;p&gt;You may have installed ZSH and every-time you open your terminal, it opens BASH by default.&lt;/p&gt;&#xA;&lt;p&gt;How do you set your default shell to open as ZSH?&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s easy, you can just use the &lt;code&gt;change shell&lt;/code&gt; command:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;chsh -s $(which zsh)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Base64 Encode/Decode in the Terminal/CLI</title>
      <link>https://andrewodendaal.com/how-to-base64-encode-decode-in-the-terminal-cli/</link>
      <pubDate>Thu, 25 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-base64-encode-decode-in-the-terminal-cli/</guid>
      <description>&lt;p&gt;If you need to either Encode or Decode a Base64 value, there are many ways to achieve this, one of them is directly from your commandline itself!&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-encode-a-base64-value-in-cli&#34;&gt;How to Encode a Base64 value in CLI&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;echo &amp;#39;This is a test&amp;#39; | base64&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will output a base64 encoded value of &lt;code&gt;VGhpcyBpcyBhIHRlc3QK&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-decode-a-base64-value-in-cli&#34;&gt;How to Decode a Base64 value in CLI&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;echo VGhpcyBpcyBhIHRlc3QK | base64 --decode&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will output a decoded value from our base64 value of &lt;code&gt;This is a test&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Enable Syntax Highlighting in Vim</title>
      <link>https://andrewodendaal.com/how-to-enable-syntax-highlighting-in-vim/</link>
      <pubDate>Wed, 24 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-enable-syntax-highlighting-in-vim/</guid>
      <description>&lt;p&gt;There are a few different ways to enable Syntax Highlighting in Vim.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-edit-vimrc&#34;&gt;Option 1 – Edit ~/.vimrc&lt;/h2&gt;&#xA;&lt;p&gt;Add &lt;code&gt;syntax on&lt;/code&gt; to your local &lt;code&gt;~/.vimrc&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;echo &amp;#34;syntax on&amp;#34; &amp;gt;&amp;gt; ~/.vimrc&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-override-system-vim-mac&#34;&gt;Option 2 – Override System Vim (Mac)&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;cd&#xA;vim --version&#xA;xcode-select --install&#xA;ruby -e &amp;#34;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&amp;#34;&#xA;brew doctor&#xA;brew install vim --override-system-vim&#xA;vim --version&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-toggle-in-vim&#34;&gt;Option 3 – Toggle in Vim&lt;/h2&gt;&#xA;&lt;p&gt;You can use &lt;code&gt;Vim Commands&lt;/code&gt; while in Vim itself:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;:syntax on&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Create an AWS Security Group in Terraform - Securing AWS Resources with Terraform Security Groups</title>
      <link>https://andrewodendaal.com/how-to-create-an-aws-security-group-in-terraform/</link>
      <pubDate>Tue, 23 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-an-aws-security-group-in-terraform/</guid>
      <description>&lt;p&gt;Security groups are a critical component for securing resources in AWS. This guide will show you how to create and manage security groups in AWS using Terraform, a popular &lt;a href=&#34;https://andrewodendaal.com/tags/iac&#34;&gt;infrastructure-as-code tool&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;overview-of-aws-security-groups&#34;&gt;Overview of AWS Security Groups&lt;/h2&gt;&#xA;&lt;p&gt;Security groups act as a firewall to &lt;a href=&#34;https://andrewodendaal.com/securing-kubernetes-guarding-container-threats&#34;&gt;control inbound and outbound traffic&lt;/a&gt; to AWS resources like EC2 instances, RDS databases, ELB load balancers, etc. They operate at the instance level, not the subnet level.&lt;/p&gt;&#xA;&lt;p&gt;Some key characteristics of security groups:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create an AWS Security Group in CloudFormation</title>
      <link>https://andrewodendaal.com/how-to-create-an-aws-security-group-in-cloudformation/</link>
      <pubDate>Mon, 22 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-an-aws-security-group-in-cloudformation/</guid>
      <description>&lt;p&gt;Below is a simple CloudFormation script block to create a Security Group in AWS.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Resources:&#xA;  SampleAppAppstreamSG:&#xA;    Type: AWS::EC2::SecurityGroup&#xA;    Properties:&#xA;      GroupDescription: Inbound and outbound traffic for service&#xA;      GroupName: &amp;#39;sampleappsg-123&amp;#39;&#xA;      VpcId: !Ref vpcid&#xA;      Tags:&#xA;        - Key: &amp;#34;Name&amp;#34;&#xA;          Value: &amp;#34;Sample App Security Group&amp;#34;&#xA;      SecurityGroupEgress:&#xA;      - IpProtocol: &amp;#34;-1&amp;#34;&#xA;        FromPort: 0&#xA;        ToPort: 0&#xA;        CidrIp: 10.0.0.0/8&#xA;      SecurityGroupIngress:&#xA;      - IpProtocol: &amp;#34;-1&amp;#34;&#xA;        FromPort: 0&#xA;        ToPort: 0&#xA;        CidrIp: 10.0.0.0/8&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can read up more about all the possible arguments in the &lt;!-- raw HTML omitted --&gt;AWS Security Group CloudFormation Reference&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to provide Default Values for AWS CloudFormation Parameters</title>
      <link>https://andrewodendaal.com/how-to-provide-default-values-for-aws-cloudformation-parameters/</link>
      <pubDate>Sun, 21 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-provide-default-values-for-aws-cloudformation-parameters/</guid>
      <description>&lt;p&gt;AWS CloudFormation is very useful for creating template-able infrastructure definitions.&lt;/p&gt;&#xA;&lt;p&gt;One of the sections of a template, is the &lt;code&gt;Input Parameters&lt;/code&gt;, or simply &lt;code&gt;Parameters&lt;/code&gt; as CloudFormation calls it. This is a section block that llows for user defined variables to be consumed by the template.&lt;/p&gt;&#xA;&lt;p&gt;When testing, it can be useful to specify default values here.&lt;/p&gt;&#xA;&lt;p&gt;This can be achieved by adding the &lt;code&gt;Default&lt;/code&gt; key and setting a value.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Parameters:&#xA;&#xA;  environment:&#xA;    Type: String&#xA;    Default: DEV&#xA;  vpcid:&#xA;    Type: String&#xA;    Default: &amp;#34;vpc-123456789123456a&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Validate an AWS CloudFormation Template</title>
      <link>https://andrewodendaal.com/how-to-validate-an-aws-cloudformation-template/</link>
      <pubDate>Sat, 20 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-validate-an-aws-cloudformation-template/</guid>
      <description>&lt;p&gt;The AWS CLI comes with a useful subcommand to validate a CloudFormation template.&lt;/p&gt;&#xA;&lt;p&gt;Simply run the following to validate a CloudFormation template file:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws cloudformation validate-template --template-body file://cf-infra.yaml&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Remember to swap out &lt;code&gt;cf-infra.yaml&lt;/code&gt; with your CloudFormation template file.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Reverse Sort Integers in Go</title>
      <link>https://andrewodendaal.com/how-to-reverse-sort-integers-in-go/</link>
      <pubDate>Fri, 19 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reverse-sort-integers-in-go/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The two oldest ages function/method needs to be completed. It should take an array of numbers as its argument and return the &lt;strong&gt;two highest numbers within the array&lt;/strong&gt;. The returned value should be an array in the format &lt;strong&gt;[second oldest age, oldest age]&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The order of the numbers passed in could be any order. The array will always include at least 2 items. If there are two or more oldest age, then return both of them in array format.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to view the Encoded Authorization Failure Message in AWS</title>
      <link>https://andrewodendaal.com/how-to-view-the-encoded-authorization-failure-message-in-aws/</link>
      <pubDate>Thu, 18 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-view-the-encoded-authorization-failure-message-in-aws/</guid>
      <description>&lt;p&gt;You may come across a message that reads similar to the following:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;Encoded authorization failure message&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;A full message, will look something like:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;API: ec2:CreateSecurityGroup You are not authorized to perform this operation. Encoded authorization failure message: B2UTpuAS30_naB5rE3Dw5v2ENy-V5w3H0wmt6rfE8hrpUz2dCIiA5XcBCtzo4cipk_JiGxAKCvlZQy0Rr2Xi3Fg2pKdkvojgn5LOZJzVroFPqMbyJguCJWxxxxxxxDNOZGGGlT2PIxTnqLQ561_piXzApfRL2kv-cYhxnuNwJWEeX8-N15mDcswhUyoV5pYtehdupp5umWZt8mcAiatlf7JIo0Q6tobs7Iw22tWTofMIZW-qkPtrTg7YrrY2--kTF3Q9qQBJw6gjr_QGznd9Fh0OMF_dCLC70bLRg5Jtxn5HyLxZWu9sC-y6x1tebYRokj32NVqr4h8pklocEKe6iqM88xV1cHJXcstP_gvoFf22yFmIll7DcE5Llsn-lD6bsB0QWWgy81m6_X0JW6s5ea4BD2nE1GM511BS20x-gGM65fm5z2SrjU09G-kmXngugnra135eY28qqjdvIl1Knb-KnEXzrtAj_DaAehx5HizwtIdi3_Yxxxxxxx_AmwgLBDZuqEL1BLZjClw7TtVjysGeO6WJyL2NMXN7Gtvzg2AL4q_z-ROH1xxxxxxxxxxx&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-view-the-encoded-message-from-aws&#34;&gt;How to view the Encoded Message from AWS&lt;/h2&gt;&#xA;&lt;p&gt;In your terminal/commandline, you need to paste the encoded message from above (your own one) into the following &lt;code&gt;aws sts&lt;/code&gt; tool:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws sts decode-authorization-message --encoded-message &amp;lt;past_encoded_string_here&amp;gt; --query DecodedMessage --output text | jq &amp;#39;.&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If it complains about &lt;code&gt;jq&lt;/code&gt;; perhaps you don&amp;rsquo;t have it installed; then you can exclude the last section and rather use the following:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to run/execute a program from Terraform</title>
      <link>https://andrewodendaal.com/how-to-run-execute-a-program-from-terraform/</link>
      <pubDate>Wed, 17 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-run-execute-a-program-from-terraform/</guid>
      <description>&lt;p&gt;If you need to run a local application from your Terraform scripts, you can call out to the &lt;code&gt;provisioner&lt;/code&gt; &lt;code&gt;local-exec&lt;/code&gt; and issue the &lt;code&gt;command&lt;/code&gt; syntax:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;resource &amp;#34;null_resource&amp;#34; &amp;#34;dig-aoms&amp;#34; {&#xA;  provisioner &amp;#34;local-exec&amp;#34; {&#xA;    # define your command below&#xA;    # this can be any application available in your terminal/commandline, &#xA;    # along with arguments&#xA;    command = &amp;#34;dig any andrewodendaal.com&amp;#34;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to script AWS AppStream 2.0 ImageBuilder</title>
      <link>https://andrewodendaal.com/how-to-script-aws-appstream-2-0-imagebuilder/</link>
      <pubDate>Tue, 16 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-script-aws-appstream-2-0-imagebuilder/</guid>
      <description>&lt;p&gt;AppStream (2.0) is a fully managed non-persistent desktop and application service for remotely accessing your work.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;code&gt;ImageBuilder&lt;/code&gt; forms the first stage in the creation and definition of an image that can be used to stream.&lt;/p&gt;&#xA;&lt;p&gt;You can use the AWS CLI to initiate the creation of an image in ImageBuilder:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws appstream create-image-builder \&#xA;  --name &amp;lt;name&amp;gt; \&#xA;  --image-name &amp;lt;image_name&amp;gt; \&#xA;  --instance-type &amp;lt;instance_type&amp;gt; \&#xA;  --vpc-config SubnetIds=&amp;lt;subnet_ids&amp;gt;,SecurityGroupIds=&amp;lt;security_group_ids&amp;gt; \&#xA;  --iam-role-arn &amp;lt;iam_role_arn&amp;gt; \&#xA;  --enable-default-internet-access&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Swap out the above items with your own values:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Reimplement the Unix Uniq Command in Golang</title>
      <link>https://andrewodendaal.com/how-to-reimplement-the-unix-uniq-command-in-golang/</link>
      <pubDate>Mon, 15 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reimplement-the-unix-uniq-command-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Implement a function which behaves like the &lt;code&gt;uniq&lt;/code&gt; command in UNIX.&lt;/p&gt;&#xA;&lt;p&gt;It takes as input a sequence and returns a sequence in which all duplicate elements following each other have been reduced to one instance.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[&amp;#34;a&amp;#34;, &amp;#34;a&amp;#34;, &amp;#34;b&amp;#34;, &amp;#34;b&amp;#34;, &amp;#34;c&amp;#34;, &amp;#34;a&amp;#34;, &amp;#34;b&amp;#34;, &amp;#34;c&amp;#34;]  =&amp;gt;  [&amp;#34;a&amp;#34;, &amp;#34;b&amp;#34;, &amp;#34;c&amp;#34;, &amp;#34;a&amp;#34;, &amp;#34;b&amp;#34;, &amp;#34;c&amp;#34;]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package uniq&#xA;func Uniq(a []string) []string {&#xA; array := []string{}&#xA;  for i, value := range a {&#xA;    if i == 0 {&#xA;      array = append(array, value)&#xA;    } else if a[i-1] != value {&#xA;      array = append(array, value)&#xA;    }&#xA;  }&#xA;  return array&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to install GraalVM on Mac</title>
      <link>https://andrewodendaal.com/how-to-install-graalvm-on-mac/</link>
      <pubDate>Sun, 14 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-install-graalvm-on-mac/</guid>
      <description>&lt;h2 id=&#34;install-graalvm-with-homebrew&#34;&gt;Install GraalVM with Homebrew&lt;/h2&gt;&#xA;&lt;p&gt;Homebrew is &lt;em&gt;the&lt;/em&gt; preferred way to install &lt;em&gt;anything&lt;/em&gt; on your Mac.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;brew install graalvm/tap/graalvm-ce-java17&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;install-graalvm-without-homebrew&#34;&gt;Install GraalVM without Homebrew&lt;/h2&gt;&#xA;&lt;p&gt;Follow these 5 steps to get GraalVM installed on your Mac.&lt;/p&gt;&#xA;&lt;h3 id=&#34;step1&#34;&gt;Step1:&lt;/h3&gt;&#xA;&lt;p&gt;Download the official binary: &lt;a href=&#34;https://www.graalvm.org/downloads/&#34;&gt;https://www.graalvm.org/downloads/&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2021/11/image.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Unpack the archive into a folder.&lt;/p&gt;&#xA;&lt;h3 id=&#34;step2&#34;&gt;Step2:&lt;/h3&gt;&#xA;&lt;p&gt;Move the folder into the JavaVirtualMachines directory:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo mv graalvm-ce-java17-21.3.0 /Library/Java/JavaVirtualMachines&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;sudo&lt;/code&gt; is required because &lt;code&gt;/Library&lt;/code&gt; is a system directory.&lt;/p&gt;&#xA;&lt;h3 id=&#34;step3&#34;&gt;Step3:&lt;/h3&gt;&#xA;&lt;p&gt;Verify the installation using the &lt;code&gt;java_home&lt;/code&gt; utility:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Generate Random Integers with a Range in Java</title>
      <link>https://andrewodendaal.com/how-to-generate-random-integers-with-a-range-in-java/</link>
      <pubDate>Sat, 13 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-generate-random-integers-with-a-range-in-java/</guid>
      <description>&lt;p&gt;Java comes with many different ways to generate random integers, even if you need to specify a lower and upper bound to constrain your required value for.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-threadlocalrandom&#34;&gt;Option 1 – ThreadLocalRandom&lt;/h2&gt;&#xA;&lt;p&gt;Specify the &lt;code&gt;min&lt;/code&gt; and &lt;code&gt;max&lt;/code&gt; values:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.concurrent.ThreadLocalRandom;&#xA;&#xA;int randomNum = ThreadLocalRandom.current().nextInt(min, max + 1);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-random&#34;&gt;Option 2 – Random&lt;/h2&gt;&#xA;&lt;p&gt;Between `` (inclusive) and the &lt;code&gt;specified value&lt;/code&gt; (exclusive):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.Random;&#xA;&#xA;Random rn = new Random();&#xA;int range = maximum - minimum + 1;&#xA;int randomNum =  rn.nextInt(range) + minimum;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-3-8211-multiple-values&#34;&gt;Option 3 – Multiple values&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.Random;&#xA;&#xA;Random r = new Random();&#xA;int[] fiveRandomNumbers = r.ints(5, 0, 11).toArray();&#xA;int randomNumber = r.ints(1, 0, 11).findFirst().getAsInt();&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How  to create ArrayList from Array in Java</title>
      <link>https://andrewodendaal.com/how-to-create-arraylist-from-array-in-java/</link>
      <pubDate>Fri, 12 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-arraylist-from-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-problem&#34;&gt;The problem&lt;/h2&gt;&#xA;&lt;p&gt;If you have a traditional array, that looks something like the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;A[] array = {new A(1), new A(2), new A(3)};&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And you would like to convert this to an ArrayList:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ArrayList&amp;lt;Element&amp;gt; arraylist = ???;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;..then you can do the following!&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution&#34;&gt;The solution&lt;/h2&gt;&#xA;&lt;h3 id=&#34;the-technique&#34;&gt;The technique&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;new ArrayList&amp;lt;&amp;gt;(Arrays.asList(array));&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;how-to-use-it&#34;&gt;How to use it&lt;/h3&gt;&#xA;&lt;p&gt;Of course you could always simplify this one further directly as:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;List&amp;lt;ClassName&amp;gt; list = Arrays.asList(array)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;how-to-old-java&#34;&gt;How to old Java&lt;/h3&gt;&#xA;&lt;p&gt;If you are stuck in the old world of Java, you can fall back to:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Generate a Random AlphNumeric String in Linux/MacOS</title>
      <link>https://andrewodendaal.com/how-to-generate-a-random-alphnumeric-string-in-linux-macos/</link>
      <pubDate>Thu, 11 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-generate-a-random-alphnumeric-string-in-linux-macos/</guid>
      <description>&lt;p&gt;If you need to generate a random AlphaNumeric string from the Linux/MacOS Command-Line, then you can use the following script:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;dd if=/dev/random bs=8 count=1 2&amp;gt;/dev/null | od -An -tx1 | tr -d &amp;#39; \t\n&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This can also be piped into a variable as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;RANDOM_ID=$(dd if=/dev/random bs=8 count=1 2&amp;gt;/dev/null | od -An -tx1 | tr -d &amp;#39; \t\n&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The above &lt;code&gt;echo $RANDOM_ID&lt;/code&gt; will resemble something similar to: &lt;code&gt;90fa3bb51922eadc&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to check if a string is empty in Go</title>
      <link>https://andrewodendaal.com/how-to-check-if-a-string-is-empty-in-go/</link>
      <pubDate>Wed, 10 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-check-if-a-string-is-empty-in-go/</guid>
      <description>&lt;p&gt;If you need to check if a &lt;code&gt;string&lt;/code&gt; is empty in Go, then there are two possible ways to immediately verify this:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-compare-the-length&#34;&gt;Option 1 – Compare the length:&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;if len(s) &amp;gt; 0 {&#xA;    // do something with string&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-8211-compare-against-blank&#34;&gt;Option 2 – Compare against blank:&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;if s != &amp;#34;&amp;#34; {&#xA;    // do something with string&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to read a file line by line in Go</title>
      <link>https://andrewodendaal.com/how-to-read-a-file-line-by-line-in-go/</link>
      <pubDate>Tue, 09 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-read-a-file-line-by-line-in-go/</guid>
      <description>&lt;p&gt;If you need to read a file line by line in Go, then you can use the &lt;code&gt;bufio&lt;/code&gt; package as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;import (&#xA;    &amp;#34;bufio&amp;#34;&#xA;    &amp;#34;fmt&amp;#34;&#xA;    &amp;#34;log&amp;#34;&#xA;    &amp;#34;os&amp;#34;&#xA;)&#xA;func main() {&#xA;    file, err := os.Open(&amp;#34;/path/to/file.txt&amp;#34;)&#xA;    if err != nil {&#xA;        log.Fatal(err)&#xA;    }&#xA;    defer file.Close()&#xA;    scanner := bufio.NewScanner(file)&#xA;    for scanner.Scan() {&#xA;        fmt.Println(scanner.Text())&#xA;    }&#xA;    if err := scanner.Err(); err != nil {&#xA;        log.Fatal(err)&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Just note that the &lt;code&gt;Scanner&lt;/code&gt; will throw an error if any line has a character count longer than 65536. This relates back to a 64K size limit. In this case, you can use the &lt;code&gt;Buffer&lt;/code&gt; method to increase the capacity.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Floating-point Approximation in Golang</title>
      <link>https://andrewodendaal.com/floating-point-approximation-in-golang/</link>
      <pubDate>Mon, 08 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/floating-point-approximation-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Consider the function&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;f: x -&amp;gt; sqrt(1 + x) - 1&lt;/code&gt; at &lt;code&gt;x = 1e-15&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;We get: &lt;code&gt;f(x) = 4.44089209850062616e-16&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;This function involves the subtraction of a pair of similar numbers when x is near 0 and the results are significantly erroneous in this region. Using &lt;code&gt;pow&lt;/code&gt; instead of &lt;code&gt;sqrt&lt;/code&gt; doesn&amp;rsquo;t give better results.&lt;/p&gt;&#xA;&lt;p&gt;A &amp;ldquo;good&amp;rdquo; answer is &lt;code&gt;4.99999999999999875... * 1e-16&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Can you modify f(x) to give a good approximation of f(x) in the neighborhood of 0?&lt;/p&gt;</description>
    </item>
    <item>
      <title>All the Ways to Divide an Array in Two in Golang</title>
      <link>https://andrewodendaal.com/all-the-ways-to-divide-an-array-in-two-in-golang/</link>
      <pubDate>Sun, 07 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/all-the-ways-to-divide-an-array-in-two-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function &lt;code&gt;partlist&lt;/code&gt; that gives all the ways to divide an array of at least two elements into two non-empty parts.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Each two non empty parts will be in a pair&lt;/li&gt;&#xA;&lt;li&gt;Each part will be in a string&lt;/li&gt;&#xA;&lt;li&gt;Elements of a pair must be in the same order as in the original array.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;a = [&amp;#34;az&amp;#34;, &amp;#34;toto&amp;#34;, &amp;#34;picaro&amp;#34;, &amp;#34;zone&amp;#34;, &amp;#34;kiwi&amp;#34;] --&amp;gt;&#xA;[(&amp;#34;az&amp;#34;, &amp;#34;toto picaro zone kiwi&amp;#34;), (&amp;#34;az toto&amp;#34;, &amp;#34;picaro zone kiwi&amp;#34;), (&amp;#34;az toto picaro&amp;#34;, &amp;#34;zone kiwi&amp;#34;), (&amp;#34;az toto picaro zone&amp;#34;, &amp;#34;kiwi&amp;#34;)]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to check if a file exists in Go</title>
      <link>https://andrewodendaal.com/how-to-check-if-a-file-exists-in-go/</link>
      <pubDate>Sat, 06 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-check-if-a-file-exists-in-go/</guid>
      <description>&lt;p&gt;If you need to check if a file exists using Go, then you can use one of the following methods, depending on the version of Go you may be using.&lt;/p&gt;&#xA;&lt;p&gt;If you are using Go &amp;gt;=1.13, then&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;file, err := os.OpenFile(&amp;#34;/path/to/file.txt&amp;#34;)&#xA;if errors.Is(err, os.ErrNotExist) {&#xA;    // The file does not exists&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;However, it is also possible to trap an error from an &lt;code&gt;OpenFile&lt;/code&gt; attempt:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;file, err := os.OpenFile(&amp;#34;/path/to/file.txt&amp;#34;)&#xA;if os.IsNotExist(err) {&#xA;    // The file does not exists&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can also confirm if the path is also not a directory as follows:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to convert a string value to an int in Go</title>
      <link>https://andrewodendaal.com/how-to-convert-a-string-value-to-an-int-in-go/</link>
      <pubDate>Fri, 05 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-a-string-value-to-an-int-in-go/</guid>
      <description>&lt;p&gt;If you need to convert a &lt;code&gt;string&lt;/code&gt; to an &lt;code&gt;int&lt;/code&gt; in Go, then you should use the &lt;code&gt;strconv.Atoi&lt;/code&gt; function:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;import (&#xA;    &amp;#34;strconv&amp;#34;&#xA;    &amp;#34;fmt&amp;#34;&#xA;)&#xA;func main() {&#xA;    t := strconv.Atoi(&amp;#34;123&amp;#34;)&#xA;    fmt.Println(t)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Learn &lt;a href=&#34;https://andrewodendaal.com/how-to-convert-an-int-value-to-string-in-go/&#34;&gt;how to convert an int value to a string in Go&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to convert an int value to string in Go</title>
      <link>https://andrewodendaal.com/how-to-convert-an-int-value-to-string-in-go/</link>
      <pubDate>Thu, 04 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-an-int-value-to-string-in-go/</guid>
      <description>&lt;p&gt;If you need to convert an &lt;code&gt;int&lt;/code&gt; to a &lt;code&gt;string&lt;/code&gt; in Go, then you should use the &lt;code&gt;strconv.Itoa&lt;/code&gt; function:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;import (&#xA;    &amp;#34;strconv&amp;#34;&#xA;    &amp;#34;fmt&amp;#34;&#xA;)&#xA;func main() {&#xA;    t := strconv.Itoa(123)&#xA;    fmt.Println(t)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Learn &lt;a href=&#34;https://andrewodendaal.com/how-to-convert-a-string-value-to-an-int-in-go/&#34;&gt;how to convert a string value to an int in Go&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Efficiently Concatenate Strings in Go</title>
      <link>https://andrewodendaal.com/how-to-efficiently-concatenate-strings-in-go/</link>
      <pubDate>Wed, 03 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-efficiently-concatenate-strings-in-go/</guid>
      <description>&lt;p&gt;If you are using a version of Go &amp;gt;= 1.10, then you should be using the newer &lt;code&gt;strings.Builder&lt;/code&gt; pattern as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;import (&#xA;    &amp;#34;strings&amp;#34;&#xA;    &amp;#34;fmt&amp;#34;&#xA;)&#xA;func main() {&#xA;    var sb strings.Builder&#xA;    for i := 0; i &amp;lt; 100; i++ {&#xA;        sb.WriteString(&amp;#34;a&amp;#34;)&#xA;    }&#xA;    fmt.Println(sb.String())&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For older version, you should be looking to use the &lt;code&gt;bytes.Buffer&lt;/code&gt; instead:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;import (&#xA;    &amp;#34;bytes&amp;#34;&#xA;    &amp;#34;fmt&amp;#34;&#xA;)&#xA;func main() {&#xA;    var buffer bytes.Buffer&#xA;    for i := 0; i &amp;lt; 100; i++ {&#xA;        buffer.WriteString(&amp;#34;a&amp;#34;)&#xA;    }&#xA;    fmt.Println(buffer.String())&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to check if a map contains a key in Go</title>
      <link>https://andrewodendaal.com/how-to-check-if-a-map-contains-a-key-in-go/</link>
      <pubDate>Tue, 02 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-check-if-a-map-contains-a-key-in-go/</guid>
      <description>&lt;p&gt;If you have a &lt;code&gt;map&lt;/code&gt; in Go and want to only perform an action if it contains a certain key, then you can do so easily:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;if val, ok := myMap[&amp;#34;someValue&amp;#34;]; ok {&#xA;    // your code here&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The way this works is the conditional &lt;code&gt;if&lt;/code&gt; statement checks to see if a value of &lt;code&gt;someValue&lt;/code&gt; exists in the &lt;code&gt;myMap&lt;/code&gt; map variable.&lt;/p&gt;&#xA;&lt;p&gt;If it exists, it assigns the key&amp;rsquo;s value to a &lt;code&gt;val&lt;/code&gt; variable, and assigns the &lt;code&gt;ok&lt;/code&gt; variable to a truthy boolean.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Remove all Vowels from a String in Java</title>
      <link>https://andrewodendaal.com/how-to-remove-all-vowels-from-a-string-in-java/</link>
      <pubDate>Mon, 01 Nov 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-remove-all-vowels-from-a-string-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Remove all vowels from the string.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Vowels:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;a e i o u&#xA;A E I O U&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class VowelRemoval {&#xA;  public static String disemvowel(String str) {&#xA;      return str.replaceAll(&amp;#34;[aAeEiIoOuU]&amp;#34;, &amp;#34;&amp;#34;);&#xA;  } &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class VowelRemoval {&#xA;    public static String disemvowel(String str) {&#xA;        return str.replaceAll(&amp;#34;(?i)[aeiou]&amp;#34; , &amp;#34;&amp;#34;);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class VowelRemoval {&#xA;    public static String disemvowel(String str) {&#xA;        return str&#xA;          .replaceAll(&amp;#34;a&amp;#34;, &amp;#34;&amp;#34;).replaceAll(&amp;#34;A&amp;#34;, &amp;#34;&amp;#34;)&#xA;          .replaceAll(&amp;#34;e&amp;#34;, &amp;#34;&amp;#34;).replaceAll(&amp;#34;E&amp;#34;, &amp;#34;&amp;#34;)&#xA;          .replaceAll(&amp;#34;i&amp;#34;, &amp;#34;&amp;#34;).replaceAll(&amp;#34;I&amp;#34;, &amp;#34;&amp;#34;)&#xA;          .replaceAll(&amp;#34;o&amp;#34;, &amp;#34;&amp;#34;).replaceAll(&amp;#34;O&amp;#34;, &amp;#34;&amp;#34;)&#xA;          .replaceAll(&amp;#34;u&amp;#34;, &amp;#34;&amp;#34;).replaceAll(&amp;#34;U&amp;#34;, &amp;#34;&amp;#34;);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertEquals;&#xA;import org.junit.runners.JUnit4;&#xA;import java.lang.StringBuilder;&#xA;import java.util.Random;&#xA;public class Tests {&#xA;    @Test&#xA;    public void FixedTests() {&#xA;        assertEquals(&amp;#34;Ths wbst s fr lsrs LL!&amp;#34; ,&#xA;                    VowelRemoval.disemvowel(&amp;#34;This website is for losers LOL!&amp;#34;));&#xA;        assertEquals(&amp;#34;N ffns bt,\nYr wrtng s mng th wrst &amp;#39;v vr rd&amp;#34;,&#xA;                VowelRemoval.disemvowel&#xA;                (&amp;#34;No offense but,\nYour writing is among the worst I&amp;#39;ve ever read&amp;#34;));&#xA;        assertEquals(&amp;#34;Wht r y,  cmmnst?&amp;#34; , VowelRemoval.disemvowel(&amp;#34;What are you, a communist?&amp;#34;));&#xA;    }&#xA;    public static String generateRandomChars(String candidateChars, int length) {&#xA;        StringBuilder sb = new StringBuilder();&#xA;        Random random = new Random();&#xA;        for (int i = 0; i &amp;lt; length; i++) {&#xA;            sb.append(candidateChars.charAt(random.nextInt(candidateChars.length())));&#xA;        }&#xA;        return sb.toString();&#xA;    }&#xA;    public static String C(String Z) {&#xA;        return Z.replaceAll(&amp;#34;(?i)[aeiou]&amp;#34; , &amp;#34;&amp;#34;);&#xA;    }&#xA;    @Test&#xA;    public void RandomTests() {&#xA;        for(int i = 0; i &amp;lt; 100; i++) {&#xA;            String X = generateRandomChars(&#xA;                &amp;#34;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&amp;#34;, i + 3);&#xA;            assertEquals(C(X) , VowelRemoval.disemvowel(X));&#xA;        }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Loop Forever in Golang</title>
      <link>https://andrewodendaal.com/how-to-loop-forever-in-golang/</link>
      <pubDate>Sun, 31 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-loop-forever-in-golang/</guid>
      <description>&lt;p&gt;If you need to loop forever, or infinitely, in your Go code, then you have 2 options:&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1&#34;&gt;Option 1:&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;for {&#xA;  // your code here&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2&#34;&gt;Option 2:&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;for true {&#xA;  // your code here&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Just remember that you need to break out of this, otherwise it really will run forever!&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-use-in-a-go-application&#34;&gt;How to use in a Go Application&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;&#xA;func main() {&#xA;&#xA;  // OPTION 1&#xA;  for {&#xA;    // your code here&#xA;  }&#xA;&#xA;  // OPTION 2&#xA;  for true {&#xA;    // your code here&#xA;  }&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Understanding For Loops in Golang</title>
      <link>https://andrewodendaal.com/understanding-for-loops-in-golang/</link>
      <pubDate>Sat, 30 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/understanding-for-loops-in-golang/</guid>
      <description>&lt;p&gt;In Golang a &lt;code&gt;for loop&lt;/code&gt; is a way to loop through an iterable.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-most-basic-for-loop&#34;&gt;The most basic For Loop&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;i := 0&#xA;for i &amp;lt;= 3 {&#xA;  i = i + 1&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;a-classic-for-loop&#34;&gt;A classic For Loop&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;for i := 7; i &amp;lt;= 9; i++ {&#xA;  // do something&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;for-loop-without-conditions&#34;&gt;For Loop without Conditions&lt;/h2&gt;&#xA;&lt;p&gt;A &lt;code&gt;for&lt;/code&gt; without a condition will loop forever, until either a &lt;code&gt;break&lt;/code&gt; or &lt;code&gt;return&lt;/code&gt; is hit.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;for {&#xA;  // do something&#xA;  break // kill the loop&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;when-to-use-continue&#34;&gt;When to use &lt;code&gt;continue&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;A &lt;code&gt;continue&lt;/code&gt; will move to the next iteration of the loop&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] go mod init: modules disabled by GO111MODULE=off</title>
      <link>https://andrewodendaal.com/solved-go-mod-init-modules-disabled-by-go111moduleoff/</link>
      <pubDate>Fri, 29 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-go-mod-init-modules-disabled-by-go111moduleoff/</guid>
      <description>&lt;p&gt;You&amp;rsquo;ve probably just tried to initialise a new Go module, and received the following error:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;go mod init: modules disabled by GO111MODULE=off; see &#39;go help modules&#39;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;This usually happens after running a command like:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;go mod init github.com/&amp;lt;user&amp;gt;/&amp;lt;repo&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;what-is-go111module&#34;&gt;What is GO111MODULE?&lt;/h2&gt;&#xA;&lt;p&gt;From Go version 1.11, the way to deal with modules was revamped.&lt;/p&gt;&#xA;&lt;p&gt;Beforehand, it was required that you place all your Go code under a $GOPATH.&lt;/p&gt;&#xA;&lt;p&gt;Which many Go developers didn&amp;rsquo;t much like, as it seemed chaotic at best.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to UpperCase the start of each Word in a String in Golang</title>
      <link>https://andrewodendaal.com/how-to-uppercase-the-start-of-each-word-in-a-string-in-golang/</link>
      <pubDate>Thu, 28 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-uppercase-the-start-of-each-word-in-a-string-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The task is to take a string of lower-cased words and convert the sentence to upper-case the first letter/character of each word&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;this is the sentence&lt;/code&gt; would be &lt;code&gt;This Is The Sentence&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;Option 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;As a first approach, we could loop through each word, and &lt;code&gt;Title&lt;/code&gt; it before adding it back to a new string. Then make sure to trim any spaces before returning it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve Max-Min Arrays in Java</title>
      <link>https://andrewodendaal.com/how-to-solve-max-min-arrays-in-java/</link>
      <pubDate>Wed, 27 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-max-min-arrays-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given an array of unique elements, and your task is to rearrange the values so that the first max value is followed by the first minimum, followed by second max value then second min value, etc.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;For example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;solve([15,11,10,7,12]) = [15,7,12,10,11]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The first max is &lt;code&gt;15&lt;/code&gt; and the first min is &lt;code&gt;7&lt;/code&gt;. The second max is &lt;code&gt;12&lt;/code&gt; and the second min is &lt;code&gt;10&lt;/code&gt; and so on.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Smallest Integer in the Array in Golang</title>
      <link>https://andrewodendaal.com/how-to-find-the-smallest-integer-in-the-array-in-golang/</link>
      <pubDate>Tue, 26 Oct 2021 00:22:14 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-smallest-integer-in-the-array-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of integers your solution should find the smallest integer.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;For example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Given &lt;code&gt;[34, 15, 88, 2]&lt;/code&gt; your solution will return &lt;code&gt;2&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Given &lt;code&gt;[34, -345, -1, 100]&lt;/code&gt; your solution will return &lt;code&gt;-345&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;You can assume, for the purpose of this challenge, that the supplied array will not be empty.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;func SmallestIntegerFinder(numbers []int) int {&#xA;  curr := numbers[0]&#xA;  for _, v := range numbers {&#xA;    if v&amp;lt;curr {&#xA;      curr = v&#xA;    }&#xA;  }&#xA;  return curr&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to do Basic Encryption in Java</title>
      <link>https://andrewodendaal.com/basic-encryption-in-java/</link>
      <pubDate>Mon, 25 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/basic-encryption-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The most basic encryption method is to map a char to another char by a certain math rule. Because every char has an ASCII value, we can manipulate this value with a simple math expression. For example ‘a&amp;rsquo; + 1 would give us ‘b&amp;rsquo;, because ‘a&amp;rsquo; value is 97 and ‘b&amp;rsquo; value is 98.&lt;/p&gt;&#xA;&lt;p&gt;You will need to write a method that does exactly that –&lt;/p&gt;&#xA;&lt;p&gt;get a string as text and an int as the rule of manipulation, and should return encrypted text. for example:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Forming Unique Array Combinations in Golang</title>
      <link>https://andrewodendaal.com/forming-unique-array-combinations-in-golang/</link>
      <pubDate>Sun, 24 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/forming-unique-array-combinations-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given an array of arrays and your task will be to return the number of unique arrays that can be formed by picking exactly one element from each subarray.&lt;/p&gt;&#xA;&lt;p&gt;For example: &lt;code&gt;solve([[1,2],[4],[5,6]]) = 4&lt;/code&gt;, because it results in only &lt;code&gt;4&lt;/code&gt; possibilites. They are &lt;code&gt;[1,4,5],[1,4,6],[2,4,5],[2,4,6]&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Make sure that you don&amp;rsquo;t count duplicates; for example &lt;code&gt;solve([[1,2],[4,4],[5,6,6]]) = 4&lt;/code&gt;, since the extra outcomes are just duplicates.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Check if String is a Palindrome in Python</title>
      <link>https://andrewodendaal.com/how-to-check-if-string-is-a-palindrome-in-python/</link>
      <pubDate>Sat, 23 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-check-if-string-is-a-palindrome-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that checks if a given string (case insensitive) is a &lt;!-- raw HTML omitted --&gt;palindrome&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python&#34;&gt;The solution in Python&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def is_palindrome(s):&#xA;    s = s.lower()&#xA;    for i, item in enumerate(s):&#xA;        if i&amp;lt;len(s)/2:&#xA;            if s[i]!=s[len(s)-i-1]:&#xA;                return False&#xA;    return True&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def is_palindrome(s):&#xA;    s = s.lower()&#xA;    return s == s[::-1]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def is_palindrome(s):&#xA;    return s.lower()==s[::-1].lower()&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;@test.describe(&amp;#39;sample tests&amp;#39;)&#xA;def sample_tests():&#xA;    test.assert_equals(is_palindrome(&amp;#39;a&amp;#39;), True)&#xA;    test.assert_equals(is_palindrome(&amp;#39;aba&amp;#39;), True)&#xA;    test.assert_equals(is_palindrome(&amp;#39;Abba&amp;#39;), True)&#xA;    test.assert_equals(is_palindrome(&amp;#39;malam&amp;#39;), True)&#xA;    test.assert_equals(is_palindrome(&amp;#39;walter&amp;#39;), False)&#xA;    test.assert_equals(is_palindrome(&amp;#39;kodok&amp;#39;), True)&#xA;    test.assert_equals(is_palindrome(&amp;#39;Kasue&amp;#39;), False)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Find the Squares in Java</title>
      <link>https://andrewodendaal.com/how-to-find-the-squares-in-java/</link>
      <pubDate>Fri, 22 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-squares-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the function that takes an odd integer (&lt;code&gt;0 &amp;lt; n &amp;lt; 1000000&lt;/code&gt;) which is the difference between two consecutive perfect squares, and return these squares as a string in the format &lt;code&gt;&amp;quot;bigger-smaller&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;9  --&amp;gt;  &amp;#34;25-16&amp;#34;&#xA;5  --&amp;gt;  &amp;#34;9-4&amp;#34;&#xA;7  --&amp;gt;  &amp;#34;16-9&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution {&#xA;  public static String findSquares(final int n) {&#xA;    final long a = (n + 1) / 2;&#xA;    final long b = a - 1;&#xA;    return String.format(&amp;#34;%d-%d&amp;#34;, a * a, b * b);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Get Longest Word in Sentence in Java</title>
      <link>https://andrewodendaal.com/how-to-get-longest-word-in-sentence-in-java/</link>
      <pubDate>Thu, 21 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-longest-word-in-sentence-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;When given a string of space-separated words, return the word with the longest length.&lt;/p&gt;&#xA;&lt;p&gt;If there are multiple words with the longest length, return the last instance of the word with the longest length.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#39;red white blue&amp;#39; // returns string value of white&#xA;&amp;#39;red blue gold&amp;#39;  // returns gold&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution {&#xA;  public static String longestWord(String wordString) {&#xA;    String longest = &amp;#34;&amp;#34;;&#xA;    for (String word: wordString.split(&amp;#34; &amp;#34;))&#xA;      if (word.length()&amp;gt;=longest.length())&#xA;        longest = word;&#xA;    return longest;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Sum all the Integers in a String in Golang</title>
      <link>https://andrewodendaal.com/how-to-sum-all-the-integers-in-a-string-in-golang/</link>
      <pubDate>Wed, 20 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-sum-all-the-integers-in-a-string-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Implement a function that calculates the sum of the integers inside a string. For example, in the string &lt;code&gt;&amp;quot;The30quick20brown10f0x1203jumps914ov3r1349the102l4zy dog&amp;quot;&lt;/code&gt;, the sum of the integers is &lt;code&gt;3635&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Note: only positive integers will be tested.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;import (&#xA;  &amp;#34;fmt&amp;#34;&#xA;  &amp;#34;regexp&amp;#34;&#xA;  &amp;#34;strconv&amp;#34;&#xA;)&#xA;func SumOfIntegersInString(strng string) int {&#xA;  re := regexp.MustCompile(&amp;#34;[0-9]+&amp;#34;)&#xA;  fmt.Println(re.FindAllString(strng, -1))&#xA;  sum := 0&#xA;  for _, i := range re.FindAllString(strng, -1) {&#xA;    number, _ := strconv.Atoi(i)&#xA;    sum += number&#xA;  }&#xA;  return sum&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Reverse a String in Golang</title>
      <link>https://andrewodendaal.com/how-to-reverse-a-string-in-golang/</link>
      <pubDate>Tue, 19 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reverse-a-string-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the solution so that it reverses the string passed into it.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#39;world&amp;#39;  =&amp;gt;  &amp;#39;dlrow&amp;#39;&#xA;&amp;#39;word&amp;#39;   =&amp;gt;  &amp;#39;drow&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;func Solution(word string) (out string) {&#xA;  for _, v := range word {&#xA;    out = string(v) + out&#xA;  }&#xA;  return&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;import &amp;#34;strings&amp;#34;&#xA;func Solution(word string) string {    &#xA;    var b strings.Builder&#xA;    for i:=len(word)-1; i&amp;gt;-1; i-- {&#xA;      b.WriteByte(word[i])      &#xA;    }&#xA;    return b.String()&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Maximum Different of Int-Array in Java</title>
      <link>https://andrewodendaal.com/maximum-different-of-int-array-in-java/</link>
      <pubDate>Mon, 18 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/maximum-different-of-int-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You must implement a function that returns the difference between the biggest and the smallest value in a list(lst) received as a parameter.&lt;/p&gt;&#xA;&lt;p&gt;The list(&lt;code&gt;lst&lt;/code&gt;) contains integers, which means it may contain some negative numbers.&lt;/p&gt;&#xA;&lt;p&gt;If the list is empty or contains a single element, &lt;code&gt;return 0&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The list(&lt;code&gt;lst&lt;/code&gt;) is not sorted.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;maxDiff([1, 2, 3, 4]); // return 3, because 4 - 1 == 3&#xA;maxDiff([1, 2, 3, -4]); // return 7, because 3 - (-4) == 7&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Indexed Capitalization in Java</title>
      <link>https://andrewodendaal.com/indexed-capitalization-in-java/</link>
      <pubDate>Sun, 17 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/indexed-capitalization-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a string and an array of integers representing indices, capitalize all letters at the given indices.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;capitalize(&amp;quot;abcdef&amp;quot;,[1,2,5]) = &amp;quot;aBCdeF&amp;quot;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;capitalize(&amp;quot;abcdef&amp;quot;,[1,2,5,100]) = &amp;quot;aBCdeF&amp;quot;&lt;/code&gt;. There is no index 100.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The input will be a lowercase string with no spaces and an array of digits.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution;&#xA;&#xA;import java.util.*;&#xA;&#xA;public class Solution{&#xA;    public static String capitalize(String s, int[] ind){&#xA;        char[] chars = s.toCharArray();&#xA;        Arrays.stream(ind)&#xA;                .filter(c -&amp;gt; c &amp;lt; s.length())&#xA;                .forEach(c -&amp;gt; chars[c] = Character.toUpperCase(chars[c]));&#xA;        return new String(chars);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Spacify a String in Java</title>
      <link>https://andrewodendaal.com/how-to-spacify-a-string-in-java/</link>
      <pubDate>Sat, 16 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-spacify-a-string-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Modify the spacify function so that it returns the given string with spaces inserted between each character.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;spacify(&amp;#34;hello world&amp;#34;) // returns &amp;#34;h e l l o   w o r l d&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.*;&#xA;import java.util.stream.*;&#xA;&#xA;public class Spacify {&#xA;    public static String spacify(String str){&#xA;        return Arrays.stream(str.split(&amp;#34;&amp;#34;))&#xA;                .map(c -&amp;gt; c+&amp;#34; &amp;#34;)&#xA;                .collect(Collectors.joining())&#xA;                .trim();&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Spacify {&#xA;    public static String spacify(String str){&#xA;        return str.replaceAll(&amp;#34;&amp;#34;, &amp;#34; &amp;#34;).trim();&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Last Digit of a Huge Number in Golang</title>
      <link>https://andrewodendaal.com/how-to-find-the-last-digit-of-a-huge-number-in-golang/</link>
      <pubDate>Fri, 15 Oct 2021 01:47:38 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-last-digit-of-a-huge-number-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;For a given list &lt;code&gt;[x1, x2, x3, ..., xn]&lt;/code&gt; compute the last (decimal) digit of &lt;code&gt;x1 ^ (x2 ^ (x3 ^ (... ^ xn)))&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;last_digit({3, 4, 2}, 3) == 1&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;because &lt;code&gt;3 ^ (4 ^ 2) = 3 ^ 16 = 43046721&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Beware:&lt;/em&gt; powers grow incredibly fast. For example, &lt;code&gt;9 ^ (9 ^ 9)&lt;/code&gt; has more than 369 millions of digits. &lt;code&gt;lastDigit&lt;/code&gt; has to deal with such numbers efficiently.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find the Maximum Length Difference between Lists/Arrays in Python</title>
      <link>https://andrewodendaal.com/find-the-maximum-length-difference-between-lists-arrays-in-python/</link>
      <pubDate>Thu, 14 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-maximum-length-difference-between-lists-arrays-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given two arrays &lt;code&gt;a1&lt;/code&gt; and &lt;code&gt;a2&lt;/code&gt; of strings. Each string is composed of letters from &lt;code&gt;a&lt;/code&gt; to &lt;code&gt;z&lt;/code&gt;. Let &lt;code&gt;x&lt;/code&gt; be any string in the first array and &lt;code&gt;y&lt;/code&gt; be any string in the second array.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Find max(abs(length(x) − length(y)))&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;If &lt;code&gt;a1&lt;/code&gt; and/or &lt;code&gt;a2&lt;/code&gt; are empty return &lt;code&gt;-1&lt;/code&gt; in each language except in Haskell (F#) where you will return &lt;code&gt;Nothing&lt;/code&gt; (None).&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;a1 = [&amp;#34;hoqq&amp;#34;, &amp;#34;bbllkw&amp;#34;, &amp;#34;oox&amp;#34;, &amp;#34;ejjuyyy&amp;#34;, &amp;#34;plmiis&amp;#34;, &amp;#34;xxxzgpsssa&amp;#34;, &amp;#34;xxwwkktt&amp;#34;, &amp;#34;znnnnfqknaz&amp;#34;, &amp;#34;qqquuhii&amp;#34;, &amp;#34;dvvvwz&amp;#34;]&#xA;a2 = [&amp;#34;cccooommaaqqoxii&amp;#34;, &amp;#34;gggqaffhhh&amp;#34;, &amp;#34;tttoowwwmmww&amp;#34;]&#xA;mxdiflg(a1, a2) --&amp;gt; 13&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python&#34;&gt;The solution in Python&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Circularly Sort an Array in Golang</title>
      <link>https://andrewodendaal.com/how-to-circularly-sort-an-array-in-golang/</link>
      <pubDate>Wed, 13 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-circularly-sort-an-array-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;An array is &lt;strong&gt;circularly sorted&lt;/strong&gt; if the elements are sorted in ascending order but displaced, or rotated, by any number of steps.&lt;/p&gt;&#xA;&lt;p&gt;Complete the function/method that determines if the given array of integers is circularly sorted.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;These arrays are circularly sorted (&lt;code&gt;true&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[2, 3, 4, 5, 0, 1]       --&amp;gt;  [0, 1] + [2, 3, 4, 5]&#xA;[4, 5, 6, 9, 1]          --&amp;gt;  [1] + [4, 5, 6, 9]&#xA;[10, 11, 6, 7, 9]        --&amp;gt;  [6, 7, 9] + [10, 11]&#xA;[1, 2, 3, 4, 5]          --&amp;gt;  [1, 2, 3, 4, 5]&#xA;[5, 7, 43, 987, -9, 0]   --&amp;gt;  [-9, 0] + [5, 7, 43, 987]&#xA;[1, 2, 3, 4, 1]          --&amp;gt;  [1] + [1, 2, 3, 4]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;While these are not (&lt;code&gt;false&lt;/code&gt;):&lt;/p&gt;</description>
    </item>
    <item>
      <title>Largest Number Groupings in String in Python</title>
      <link>https://andrewodendaal.com/largest-number-groupings-in-string-in-python/</link>
      <pubDate>Tue, 12 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/largest-number-groupings-in-string-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are be given a string that has lowercase letters and numbers. Your task is to compare the number groupings and return the largest number. Numbers will not have leading zeros.&lt;/p&gt;&#xA;&lt;p&gt;For example, &lt;code&gt;solve(&amp;quot;gh12cdy695m1&amp;quot;) = 695&lt;/code&gt;, because this is the largest of all number groupings.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import re&#xA;def solve(s):&#xA;    return max(map(int,re.findall(r&amp;#34;(\d+)&amp;#34;, s)))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def solve(s):&#xA;    return max(map(int,&amp;#34;&amp;#34;.join(&amp;#34; &amp;#34; if x.isalpha() else x for x in s).split()))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Alternate String Casing in Golang</title>
      <link>https://andrewodendaal.com/how-to-alternate-string-casing-in-golang/</link>
      <pubDate>Mon, 11 Oct 2021 00:50:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-alternate-string-casing-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function &lt;code&gt;toWeirdCase&lt;/code&gt; (&lt;code&gt;weirdcase&lt;/code&gt; in Ruby) that accepts a string, and returns the same string with all even indexed characters in each word uppercased, and all odd indexed characters in each word lowercased. The indexing just explained is zero-based, so the zero-ith index is even, therefore that character should be uppercased and you need to start over for each word.&lt;/p&gt;&#xA;&lt;p&gt;The passed-in string will only consist of alphabetical characters and spaces(&lt;code&gt;&#39; &#39;&lt;/code&gt;). Spaces will only be present if there are multiple words. Words will be separated by a single space(&lt;code&gt;&#39; &#39;&lt;/code&gt;).&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Sort a List of Numbers in Python</title>
      <link>https://andrewodendaal.com/how-to-sort-a-list-of-numbers-in-python/</link>
      <pubDate>Sun, 10 Oct 2021 00:18:34 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-sort-a-list-of-numbers-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Finish the solution so that it sorts the passed-in array/list of numbers. If the function passes in an empty array/list or null/None value then it should return an empty array/list.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;solution([1,2,3,10,5]) # should return [1,2,3,5,10]&#xA;solution(None) # should return []&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def solution(nums):&#xA;    if not nums:&#xA;        return []&#xA;    return sorted(nums)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def solution(nums):&#xA;    return sorted(nums) if nums else []&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def solution(nums):&#xA;    return sorted(nums or [])&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import test&#xA;from solution import solution&#xA;&#xA;@test.describe(&amp;#34;Fixed Tests&amp;#34;)&#xA;def fixed_tests():&#xA;    @test.it(&amp;#39;Basic Test Cases&amp;#39;)&#xA;    def basic_test_cases():&#xA;        test.assert_equals(solution([1,2,3,10,5]), [1,2,3,5,10])&#xA;        test.assert_equals(solution(None), [])&#xA;        test.assert_equals(solution([]), [])&#xA;        test.assert_equals(solution([20,2,10]), [2,10,20])&#xA;        test.assert_equals(solution([2,20,10]), [2,10,20])&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Validate Usernames with Regex in Java</title>
      <link>https://andrewodendaal.com/how-to-validate-usernames-with-regex-in-java/</link>
      <pubDate>Sat, 09 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-validate-usernames-with-regex-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a simple regex to validate a username. Allowed characters are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;lowercase letters,&lt;/li&gt;&#xA;&lt;li&gt;numbers,&lt;/li&gt;&#xA;&lt;li&gt;underscore&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Length should be between 4 and 16 characters (both included).&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class PasswordValidation {&#xA;  public static boolean validateUsr(String s) {&#xA;    return s.matches(&amp;#34;[a-z_\\d]{4,16}&amp;#34;);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.regex.Pattern;&#xA;public class PasswordValidation {&#xA;  private static final Pattern usernamePattern = &#xA;      Pattern.compile(&amp;#34;[a-z0-9_]{4,16}&amp;#34;);&#xA;  public static boolean validateUsr(String s) {&#xA;    return usernamePattern.matcher(s).matches();&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sort Lexicographical Order of Substrings in Java</title>
      <link>https://andrewodendaal.com/sort-lexicographical-order-of-substrings-in-java/</link>
      <pubDate>Fri, 08 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/sort-lexicographical-order-of-substrings-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given two arrays of strings &lt;code&gt;a1&lt;/code&gt; and &lt;code&gt;a2&lt;/code&gt; return a sorted array &lt;code&gt;r&lt;/code&gt; in lexicographical order of the strings of &lt;code&gt;a1&lt;/code&gt; which are substrings of strings of &lt;code&gt;a2&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;code&gt;a1 = [&amp;quot;arp&amp;quot;, &amp;quot;live&amp;quot;, &amp;quot;strong&amp;quot;]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;a2 = [&amp;quot;lively&amp;quot;, &amp;quot;alive&amp;quot;, &amp;quot;harp&amp;quot;, &amp;quot;sharp&amp;quot;, &amp;quot;armstrong&amp;quot;]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;returns &lt;code&gt;[&amp;quot;arp&amp;quot;, &amp;quot;live&amp;quot;, &amp;quot;strong&amp;quot;]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;code&gt;a1 = [&amp;quot;tarp&amp;quot;, &amp;quot;mice&amp;quot;, &amp;quot;bull&amp;quot;]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;a2 = [&amp;quot;lively&amp;quot;, &amp;quot;alive&amp;quot;, &amp;quot;harp&amp;quot;, &amp;quot;sharp&amp;quot;, &amp;quot;armstrong&amp;quot;]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;returns &lt;code&gt;[]&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Perform Alphabetical Addition in Java</title>
      <link>https://andrewodendaal.com/how-to-perform-alphabetical-addition-in-java/</link>
      <pubDate>Thu, 07 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-perform-alphabetical-addition-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Your task is to add up letters to one letter.&lt;/p&gt;&#xA;&lt;p&gt;The function will be given an array of single-character Strings, each one being a letter to add.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Letters will always be lowercase.&lt;/li&gt;&#xA;&lt;li&gt;Letters can overflow (see second to last example of the description)&lt;/li&gt;&#xA;&lt;li&gt;If no letters are given, the function should return &lt;code&gt;&#39;z&#39;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;addLetters(&amp;#34;a&amp;#34;, &amp;#34;b&amp;#34;, &amp;#34;c&amp;#34;) = &amp;#34;f&amp;#34;&#xA;addLetters(&amp;#34;a&amp;#34;, &amp;#34;b&amp;#34;) = &amp;#34;c&amp;#34;&#xA;addLetters(&amp;#34;z&amp;#34;) = &amp;#34;z&amp;#34;&#xA;addLetters(&amp;#34;z&amp;#34;, &amp;#34;a&amp;#34;) = &amp;#34;a&amp;#34;&#xA;addLetters(&amp;#34;y&amp;#34;, &amp;#34;c&amp;#34;, &amp;#34;b&amp;#34;) = &amp;#34;d&amp;#34; // notice the letters overflowing&#xA;addLetters() = &amp;#34;z&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Roman Numerals Decoder in Golang</title>
      <link>https://andrewodendaal.com/roman-numerals-decoder-in-golang/</link>
      <pubDate>Wed, 06 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/roman-numerals-decoder-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function that takes a Roman numeral as its argument and returns its value as a numeric decimal integer. You don&amp;rsquo;t need to validate the form of the Roman numeral.&lt;/p&gt;&#xA;&lt;p&gt;Modern Roman numerals are written by expressing each decimal digit of the number to be encoded separately, starting with the leftmost digit and skipping any 0s. So 1990 is rendered &amp;ldquo;MCMXC&amp;rdquo; (1000 = M, 900 = CM, 90 = XC) and 2008 is rendered &amp;ldquo;MMVIII&amp;rdquo; (2000 = MM, 8 = VIII). The Roman numeral for 1666, &amp;ldquo;MDCLXVI&amp;rdquo;, uses each letter in descending order.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Subtract from Time in Golang</title>
      <link>https://andrewodendaal.com/how-to-subtract-from-time-in-golang/</link>
      <pubDate>Tue, 05 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-subtract-from-time-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Clock shows &lt;code&gt;h&lt;/code&gt; hours, &lt;code&gt;m&lt;/code&gt; minutes and &lt;code&gt;s&lt;/code&gt; seconds after midnight.&lt;/p&gt;&#xA;&lt;p&gt;Your task is to write a function that returns the time since midnight in milliseconds.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;h = 0&#xA;m = 1&#xA;s = 1&#xA;&#xA;result = 61000&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Input constraints:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;0 &amp;lt;= h &amp;lt;= 23&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;0 &amp;lt;= m &amp;lt;= 59&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;0 &amp;lt;= s &amp;lt;= 59&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;func Past(h, m, s int) int {&#xA;    return (h*3600000 + m*60000 + s*1000)    &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Encrypt Words in Java</title>
      <link>https://andrewodendaal.com/how-to-encrypt-words-in-java/</link>
      <pubDate>Mon, 04 Oct 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-encrypt-words-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You want to create secret messages which must be deciphered.&lt;/p&gt;&#xA;&lt;p&gt;Here are the conditions:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Your message is a string containing space separated words.&lt;/li&gt;&#xA;&lt;li&gt;You need to encrypt each word in the message using the following rules:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The first letter must be converted to its ASCII code.&lt;/li&gt;&#xA;&lt;li&gt;The second letter must be switched with the last letter&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;Keepin&amp;rsquo; it simple: There are no special characters in the input.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;EncryptWords.encryptThis(&amp;#34;Hello&amp;#34;) =&amp;gt; &amp;#34;72olle&amp;#34;&#xA;EncryptWords.encryptThis(&amp;#34;good&amp;#34;) =&amp;gt; &amp;#34;103doo&amp;#34;&#xA;EncryptWords.encryptThis(&amp;#34;hello world&amp;#34;) =&amp;gt; &amp;#34;104olle 119drlo&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Bit Counting in Golang</title>
      <link>https://andrewodendaal.com/bit-counting-in-golang/</link>
      <pubDate>Sun, 03 Oct 2021 03:22:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/bit-counting-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that takes an integer as input, and returns the number of bits that are equal to one in the binary representation of that number. You can guarantee that input is non-negative.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;: The binary representation of &lt;code&gt;1234&lt;/code&gt; is &lt;code&gt;10011010010&lt;/code&gt;, so the function should return &lt;code&gt;5&lt;/code&gt; in this case&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;import &amp;#34;math/bits&amp;#34;&#xA;func CountBits(n uint) int {&#xA;  return bits.OnesCount(n)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find Next Higher Number with Same Bits in Golang</title>
      <link>https://andrewodendaal.com/how-to-find-next-higher-number-with-same-bits-in-golang/</link>
      <pubDate>Sat, 02 Oct 2021 00:38:52 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-next-higher-number-with-same-bits-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Find the next higher number (int) with same ‘1&amp;rsquo;- Bits.&lt;/p&gt;&#xA;&lt;p&gt;I.e. as much &lt;code&gt;1&lt;/code&gt; bits as before and output next higher than input. Input is always an int in between 1 and 1&amp;laquo;30 (inclusive). No bad cases or special tricks…&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Input: 129  =&amp;gt; Output: 130 (10000001 =&amp;gt; 10000010)&#xA;Input: 127 =&amp;gt; Output: 191 (01111111 =&amp;gt; 10111111)&#xA;Input: 1 =&amp;gt; Output: 2 (01 =&amp;gt; 10)&#xA;Input: 323423 =&amp;gt; Output: 323439 (1001110111101011111 =&amp;gt; 1001110111101101111)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the First Non-Repeating Character in Golang</title>
      <link>https://andrewodendaal.com/how-to-find-the-first-non-repeating-character-in-golang/</link>
      <pubDate>Fri, 01 Oct 2021 00:50:38 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-first-non-repeating-character-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function named &lt;code&gt;first_non_repeating_letter&lt;/code&gt; that takes a string input, and returns the first character that is not repeated anywhere in the string.&lt;/p&gt;&#xA;&lt;p&gt;For example, if given the input &lt;code&gt;&#39;stress&#39;&lt;/code&gt;, the function should return &lt;code&gt;&#39;t&#39;&lt;/code&gt;, since the letter &lt;em&gt;t&lt;/em&gt; only occurs once in the string, and occurs first in the string.&lt;/p&gt;&#xA;&lt;p&gt;As an added challenge, upper- and lowercase letters are considered the &lt;strong&gt;same character&lt;/strong&gt;, but the function should return the correct case for the initial letter. For example, the input &lt;code&gt;&#39;sTreSS&#39;&lt;/code&gt; should return &lt;code&gt;&#39;T&#39;&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Last Fibonacci Digit in Golang</title>
      <link>https://andrewodendaal.com/how-to-find-the-last-fibonacci-digit-in-golang/</link>
      <pubDate>Thu, 30 Sep 2021 01:19:01 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-last-fibonacci-digit-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Return the last digit of the nth element in the Fibonacci sequence (starting with 1,1, to be extra clear, not with 0,1 or other numbers).&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;LastFibDigit(1) == 1&#xA;LastFibDigit(2) == 1&#xA;LastFibDigit(3) == 2&#xA;LastFibDigit(1000) == 5&#xA;LastFibDigit(1000000) == 5&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;func LastFibDigit(n int) int {&#xA;  n %= 60&#xA;  a, b := 0, 1&#xA;  for i := 0; i&amp;lt;n; i++ { a, b = b, a+b }&#xA;  return a % 10&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Validate an IP Address in Golang</title>
      <link>https://andrewodendaal.com/how-to-validate-an-ip-address-in-golang/</link>
      <pubDate>Wed, 29 Sep 2021 01:31:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-validate-an-ip-address-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write an algorithm that will identify valid IPv4 addresses in dot-decimal format. IPs should be considered valid if they consist of four octets, with values between `` and &lt;code&gt;255&lt;/code&gt;, inclusive.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;1.2.3.4&#xA;123.45.67.89&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;1.2.3&#xA;1.2.3.4.5&#xA;123.456.78.90&#xA;123.045.067.089&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Leading zeros (e.g. &lt;code&gt;01.02.03.04&lt;/code&gt;) are considered invalid&lt;/li&gt;&#xA;&lt;li&gt;Inputs are guaranteed to be a single string&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Fold an Array in Java</title>
      <link>https://andrewodendaal.com/how-to-fold-an-array-in-java/</link>
      <pubDate>Tue, 28 Sep 2021 03:18:38 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-fold-an-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In this challenge, you have to write a method that folds a given array of integers by the middle x-times.&lt;/p&gt;&#xA;&lt;p&gt;An example says more than a thousand words:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Fold 1-times:&#xA;[1,2,3,4,5] -&amp;gt; [6,6,3]&#xA;&#xA;A little visualization (NOT for the algorithm but for the idea of folding):&#xA;&#xA; Step 1         Step 2        Step 3       Step 4       Step5&#xA;                     5/           5|         5\          &#xA;                    4/            4|          4\      &#xA;1 2 3 4 5      1 2 3/         1 2 3|       1 2 3\       6 6 3&#xA;----*----      ----*          ----*        ----*        ----*&#xA;&#xA;&#xA;Fold 2-times:&#xA;[1,2,3,4,5] -&amp;gt; [9,6]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As you see, if the count of numbers is odd, the middle number will stay. Otherwise, the fold-point is between the middle-numbers, so all numbers would be added in a way.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Formatting Strings with Fmt in Golang</title>
      <link>https://andrewodendaal.com/formatting-strings-with-fmt-in-golang/</link>
      <pubDate>Mon, 27 Sep 2021 03:08:03 +0000</pubDate>
      <guid>https://andrewodendaal.com/formatting-strings-with-fmt-in-golang/</guid>
      <description>&lt;p&gt;&lt;code&gt;Fmt&lt;/code&gt; provides printing to standard output (usually the console) and formatting of strings capabilities.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-basics-of-print-and-println&#34;&gt;The basics of Print and Println&lt;/h2&gt;&#xA;&lt;p&gt;The main difference between &lt;code&gt;fmt.Print&lt;/code&gt; and &lt;code&gt;fmt.Println&lt;/code&gt; is that you only get a newline/carriage return by default with the second one. Other than that, you can make use of either for string formatting.&lt;/p&gt;&#xA;&lt;p&gt;Firstly, we need to import the &lt;code&gt;fmt&lt;/code&gt; module as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;&#xA;import &amp;#34;fmt&amp;#34; // &amp;lt;--- include fmt&#xA;&#xA;func main() {&#xA;    // main&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;example-of-fmtprint&#34;&gt;Example of fmt.Print&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;fmt.Print(&amp;#34;This is a Print test&amp;#34;)&#xA;&#xA;// &amp;#34;This is a Print test&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will print to standard output without a newline at the end.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Delete Occurrences of an Element if it occurs more than N times in Java</title>
      <link>https://andrewodendaal.com/delete-occurrences-of-an-element-if-it-occurs-more-than-n-times-in-java/</link>
      <pubDate>Sun, 26 Sep 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/delete-occurrences-of-an-element-if-it-occurs-more-than-n-times-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a list lst and a number N, create a new list that contains each number of lst at most N times without reordering. For example if N = 2, and the input is [1,2,3,1,2,1,2,3], you take [1,2,3,1,2], drop the next [1,2] since this would lead to 1 and 2 being in the result 3 times, and then take 3, which leads to [1,2,3,1,2,3].&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// return [20,37,21]&#xA;EnoughIsEnough.deleteNth(new int[] {20,37,20,21}, 1)&#xA;&#xA;// return [1, 1, 3, 3, 7, 2, 2, 2]&#xA;EnoughIsEnough.deleteNth(new int[] {1,1,3,3,7,2,2,2,2}, 3)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Read from Standard Input in Golang</title>
      <link>https://andrewodendaal.com/how-to-read-from-standard-input-in-golang/</link>
      <pubDate>Sat, 25 Sep 2021 12:53:50 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-read-from-standard-input-in-golang/</guid>
      <description>&lt;p&gt;Reading from &amp;ldquo;standard input&amp;rdquo; is really useful if you are making a command-line application and require user input.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;&#xA;import (&#xA;    &amp;#34;bufio&amp;#34;&#xA;    &amp;#34;os&amp;#34;&#xA;    &amp;#34;fmt&amp;#34;&#xA;)&#xA;&#xA;func main() {&#xA;    reader := bufio.NewReader(os.Stdin)&#xA;    s, _ := reader.ReadString(&amp;#39;\n&amp;#39;)&#xA;    fmt.Printf(s)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;First setup a new &lt;code&gt;bufio&lt;/code&gt; reader, then use &lt;code&gt;ReadString&lt;/code&gt; function, with a default wait character, which we have set to a newline (&lt;code&gt;\n&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;The application will pause at this point and wait for user input before proceeding.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Install Golang on WSL/WSL2</title>
      <link>https://andrewodendaal.com/how-to-install-golang-on-wsl-wsl2/</link>
      <pubDate>Fri, 24 Sep 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-install-golang-on-wsl-wsl2/</guid>
      <description>&lt;p&gt;If you need to install Golang on WSL under Windows 10 or higher, you can follow these few steps.&lt;/p&gt;&#xA;&lt;h2 id=&#34;first-remove-any-old-versions-lying-around&#34;&gt;First remove any old versions lying around&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo rm -rf /usr/local/go* &amp;amp;&amp;amp; sudo rm -rf /usr/local/go&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;determine-the-latest-go-version&#34;&gt;Determine the latest Go version&lt;/h2&gt;&#xA;&lt;p&gt;Go to &lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;https://golang.org/dl/&#34;&gt;https://golang.org/dl/&lt;/a&gt;&lt;!-- raw HTML omitted --&gt; and find out what the latest version is. At the time of writing this, Go is on version 1.16.&lt;/p&gt;&#xA;&lt;h2 id=&#34;install-go&#34;&gt;Install Go&lt;/h2&gt;&#xA;&lt;p&gt;Make sure to replace &lt;code&gt;1.16&lt;/code&gt; below with the updated version as required.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Validate Phone Numbers in Java</title>
      <link>https://andrewodendaal.com/how-to-validate-phone-numbers-in-java/</link>
      <pubDate>Thu, 23 Sep 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-validate-phone-numbers-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that accepts a string, and returns true if it is in the form of a phone number.&lt;br&gt;&#xA;Assume that any integer from 0-9 in any of the spots will produce a valid phone number.&lt;/p&gt;&#xA;&lt;p&gt;Only worry about the following format:&lt;br&gt;&#xA;(123) 456-7890 (don&amp;rsquo;t forget the space after the close parentheses)&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;(123) 456-7890&amp;#34;  =&amp;gt; true&#xA;&amp;#34;(1111)555 2345&amp;#34;  =&amp;gt; false&#xA;&amp;#34;(098) 123 4567&amp;#34;  =&amp;gt; false&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Sort Array by Frequency in Java</title>
      <link>https://andrewodendaal.com/how-to-sort-array-by-frequency-in-java/</link>
      <pubDate>Wed, 22 Sep 2021 01:32:33 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-sort-array-by-frequency-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Sort elements in an array by decreasing frequency of elements. If two elements have the same frequency, sort them by increasing value.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Solution.sortByFrequency(new int[]{2, 3, 5, 3, 7, 9, 5, 3, 7});&#xA;// Returns {3, 3, 3, 5, 5, 7, 7, 2, 9}&#xA;// We sort by highest frequency to lowest frequency.&#xA;// If two elements have same frequency, we sort by increasing value.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate String Rotation in Java</title>
      <link>https://andrewodendaal.com/how-to-calculate-string-rotation-in-java/</link>
      <pubDate>Tue, 21 Sep 2021 00:04:40 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-string-rotation-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that receives two strings and returns n, where n is equal to the number of characters we should shift the first string forward to match the second. The check should be case-sensitive.&lt;/p&gt;&#xA;&lt;p&gt;For instance, take the strings &amp;ldquo;fatigue&amp;rdquo; and &amp;ldquo;tiguefa&amp;rdquo;. In this case, the first string has been rotated 5 characters forward to produce the second string, so 5 would be returned. If the second string isn&amp;rsquo;t a valid rotation of the first string, the method returns -1.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Compare Strings by Sum of Chars in Java</title>
      <link>https://andrewodendaal.com/compare-strings-by-sum-of-chars-in-java/</link>
      <pubDate>Mon, 20 Sep 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/compare-strings-by-sum-of-chars-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Compare two strings by comparing the sum of their values (ASCII character code).&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For comparing treat all letters as UpperCase&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;null&lt;/code&gt; should be treated as empty strings&lt;/li&gt;&#xA;&lt;li&gt;If the string contains other characters than letters, treat the whole string as it would be empty&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Your method should return &lt;code&gt;true&lt;/code&gt;, if the strings are equal and &lt;code&gt;false&lt;/code&gt; if they are not equal.&lt;/p&gt;&#xA;&lt;h2 id=&#34;examples&#34;&gt;Examples:&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;AD&amp;#34;, &amp;#34;BC&amp;#34;  -&amp;gt; equal&#xA;&amp;#34;AD&amp;#34;, &amp;#34;DD&amp;#34;  -&amp;gt; not equal&#xA;&amp;#34;gf&amp;#34;, &amp;#34;FG&amp;#34;  -&amp;gt; equal&#xA;&amp;#34;zz1&amp;#34;, &amp;#34;&amp;#34;   -&amp;gt; equal (both are considered empty)&#xA;&amp;#34;ZzZz&amp;#34;, &amp;#34;ffPFF&amp;#34; -&amp;gt; equal&#xA;&amp;#34;kl&amp;#34;, &amp;#34;lz&amp;#34;  -&amp;gt; not equal&#xA;null, &amp;#34;&amp;#34;    -&amp;gt; equal&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Add Two Integers Without Arithmetic Operator in Java</title>
      <link>https://andrewodendaal.com/how-to-add-two-integers-without-arithmetic-operator-in-java/</link>
      <pubDate>Sun, 19 Sep 2021 00:39:48 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-add-two-integers-without-arithmetic-operator-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given two integers a, b, find The sum of them, BUT You are not allowed to use the operators + and –&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The numbers (a,b) may be positive , negative values or zeros .&lt;/li&gt;&#xA;&lt;li&gt;Returning value will be an integer .&lt;/li&gt;&#xA;&lt;li&gt;Java: the following methods are prohibited: &lt;em&gt;addExact&lt;/em&gt;, &lt;em&gt;average&lt;/em&gt;, &lt;em&gt;collect&lt;/em&gt;, &lt;em&gt;decrement&lt;/em&gt;, &lt;em&gt;increment&lt;/em&gt;, &lt;em&gt;nextAfter&lt;/em&gt;, &lt;em&gt;nextDown&lt;/em&gt;, &lt;em&gt;nextUp&lt;/em&gt;, &lt;em&gt;reduce&lt;/em&gt;, &lt;em&gt;subtractExact&lt;/em&gt;, &lt;em&gt;sum&lt;/em&gt;, &lt;em&gt;summing&lt;/em&gt; .&lt;br&gt;&#xA;The following classes are prohibited: &lt;em&gt;BigDecimal&lt;/em&gt; and &lt;em&gt;BigInteger&lt;/em&gt; .&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;1- Add (5,19) ==&amp;gt; return (24) &#xA;2- Add (-27,18) ==&amp;gt; return (-9)&#xA;3- Add (-14,-16) ==&amp;gt; return (-30)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Counting Method VarArgs in Java</title>
      <link>https://andrewodendaal.com/counting-method-varargs-in-java/</link>
      <pubDate>Sat, 18 Sep 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/counting-method-varargs-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Count how many arguments a method is called with.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;args_count(1, 2, 3) -&amp;gt; 3&#xA;args_count(1, 2, 3, 10) -&amp;gt; 4&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Some languages refer to this as the &lt;code&gt;spread operator&lt;/code&gt;. In Java, this is called a &lt;code&gt;VarArg&lt;/code&gt;, which means a Variable Amount of Arguments.&lt;/p&gt;&#xA;&lt;p&gt;Simply prepend the argument&amp;rsquo;s name with three dots (&lt;code&gt;...&lt;/code&gt;) and then refer to it like an array of elements.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Arguments {&#xA;  public static int countArgs(Object... args) {&#xA;    return args.length;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Alternatively, you could also use a &lt;code&gt;stream&lt;/code&gt; on it:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Sum Consecutives in Java</title>
      <link>https://andrewodendaal.com/how-to-sum-consecutives-in-java/</link>
      <pubDate>Fri, 17 Sep 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-sum-consecutives-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given a list/array which contains only integers (positive and negative). Your job is to sum only the numbers that are the same and consecutive. The result should be one list.&lt;/p&gt;&#xA;&lt;p&gt;Extra credit if you solve it in one line. You can assume there is never an empty list/array and there will always be an integer.&lt;/p&gt;&#xA;&lt;p&gt;Same meaning: 1 == 1&lt;/p&gt;&#xA;&lt;p&gt;1 != -1&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[1,4,4,4,0,4,3,3,1] # should return [1,12,0,4,6,1]&#xA;&#xA;&amp;#34;&amp;#34;&amp;#34;So as you can see sum of consecutives 1 is 1 &#xA;sum of 3 consecutives 4 is 12 &#xA;sum of 0... and sum of 2 &#xA;consecutives 3 is 6 ...&amp;#34;&amp;#34;&amp;#34;&#xA;&#xA;[1,1,7,7,3] # should return [2,14,3]&#xA;[-5,-5,7,7,12,0] # should return [-10,14,12,0]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Replacing Occurences of Words in Java</title>
      <link>https://andrewodendaal.com/replacing-occurences-of-words-in-java/</link>
      <pubDate>Thu, 16 Sep 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/replacing-occurences-of-words-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given a string. You must replace any occurrence of the sequence &lt;code&gt;coverage&lt;/code&gt; by &lt;code&gt;covfefe&lt;/code&gt;, however, if you don&amp;rsquo;t find the word &lt;code&gt;coverage&lt;/code&gt; in the string, you must add &lt;code&gt;covfefe&lt;/code&gt; at the end of the string with a leading space.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Covfefe {&#xA;    public static String covfefe(String tweet) {&#xA;        return tweet.contains(&amp;#34;coverage&amp;#34;) ?&#xA;                tweet.replaceAll(&amp;#34;coverage&amp;#34;, &amp;#34;covfefe&amp;#34;) :&#xA;                tweet+&amp;#34; covfefe&amp;#34;;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Convert String to LeetSpeak in Java</title>
      <link>https://andrewodendaal.com/convert-string-to-leetspeak-in-java/</link>
      <pubDate>Wed, 15 Sep 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/convert-string-to-leetspeak-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Your task is to write a function &lt;code&gt;toLeetSpeak&lt;/code&gt; that converts a regular english sentence to Leetspeak.&lt;/p&gt;&#xA;&lt;p&gt;More about LeetSpeak You can read at wiki -&amp;gt; &lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Leet&#34;&gt;https://en.wikipedia.org/wiki/Leet&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Consider only uppercase letters (no lowercase letters, no numbers) and spaces.&lt;/p&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;toLeetSpeak(&amp;#34;LEET&amp;#34;) returns &amp;#34;1337&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this challenge we use a simple LeetSpeak dialect. Use this alphabet:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&#xA;  A : &amp;#39;@&amp;#39;,&#xA;  B : &amp;#39;8&amp;#39;,&#xA;  C : &amp;#39;(&amp;#39;,&#xA;  D : &amp;#39;D&amp;#39;,&#xA;  E : &amp;#39;3&amp;#39;,&#xA;  F : &amp;#39;F&amp;#39;,&#xA;  G : &amp;#39;6&amp;#39;,&#xA;  H : &amp;#39;#&amp;#39;,&#xA;  I : &amp;#39;!&amp;#39;,&#xA;  J : &amp;#39;J&amp;#39;,&#xA;  K : &amp;#39;K&amp;#39;,&#xA;  L : &amp;#39;1&amp;#39;,&#xA;  M : &amp;#39;M&amp;#39;,&#xA;  N : &amp;#39;N&amp;#39;,&#xA;  O : &amp;#39;0&amp;#39;,&#xA;  P : &amp;#39;P&amp;#39;,&#xA;  Q : &amp;#39;Q&amp;#39;,&#xA;  R : &amp;#39;R&amp;#39;,&#xA;  S : &amp;#39;$&amp;#39;,&#xA;  T : &amp;#39;7&amp;#39;,&#xA;  U : &amp;#39;U&amp;#39;,&#xA;  V : &amp;#39;V&amp;#39;,&#xA;  W : &amp;#39;W&amp;#39;,&#xA;  X : &amp;#39;X&amp;#39;,&#xA;  Y : &amp;#39;Y&amp;#39;,&#xA;  Z : &amp;#39;2&amp;#39;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ordered Count of Characters in Python</title>
      <link>https://andrewodendaal.com/ordered-count-of-characters-in-python/</link>
      <pubDate>Tue, 14 Sep 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/ordered-count-of-characters-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Count the number of occurrences of each character and return it as a list of tuples in order of appearance. For empty output return an empty list.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ordered_count(&amp;#34;abracadabra&amp;#34;) == [(&amp;#39;a&amp;#39;, 5), (&amp;#39;b&amp;#39;, 2), (&amp;#39;r&amp;#39;, 2), (&amp;#39;c&amp;#39;, 1), (&amp;#39;d&amp;#39;, 1)]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from collections import Counter&#xA;def ordered_count(input):&#xA;    c = Counter(input)&#xA;    return sorted(list(c.items()), key=lambda x: input.index(x[0]))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def ordered_count(_input):&#xA;    l = []&#xA;    for i in _input:&#xA;        if i not in l:&#xA;            l.append(i)&#xA;    return [(i, _input.count(i)) for i in l]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Credit Card Issuer Checking in Java</title>
      <link>https://andrewodendaal.com/credit-card-issuer-checking-in-java/</link>
      <pubDate>Mon, 13 Sep 2021 01:28:41 +0000</pubDate>
      <guid>https://andrewodendaal.com/credit-card-issuer-checking-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a credit card number we can determine who the issuer/vendor is with a few basic knowns.&lt;/p&gt;&#xA;&lt;p&gt;Complete the function &lt;code&gt;getIssuer()&lt;/code&gt; that will use the values shown below to determine the card issuer for a given card number. If the number cannot be matched then the function should return the string &lt;code&gt;Unknown&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;| Card Type  | Begins With          | Number Length |&#xA;|------------|----------------------|---------------|&#xA;| AMEX       | 34 or 37             | 15            |&#xA;| Discover   | 6011                 | 16            |&#xA;| Mastercard | 51, 52, 53, 54 or 55 | 16            |&#xA;| VISA       | 4                    | 13 or 16      |&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;getIssuer(4111111111111111) == &amp;#34;VISA&amp;#34;&#xA;getIssuer(4111111111111) == &amp;#34;VISA&amp;#34;&#xA;getIssuer(4012888888881881) == &amp;#34;VISA&amp;#34;&#xA;getIssuer(378282246310005) == &amp;#34;AMEX&amp;#34;&#xA;getIssuer(6011111111111117) == &amp;#34;Discover&amp;#34;&#xA;getIssuer(5105105105105100) == &amp;#34;Mastercard&amp;#34;&#xA;getIssuer(5105105105105106) == &amp;#34;Mastercard&amp;#34;&#xA;getIssuer(9111111111111111) == &amp;#34;Unknown&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find Count of Most Frequent Item in an Array in Java</title>
      <link>https://andrewodendaal.com/find-count-of-most-frequent-item-in-an-array-in-java/</link>
      <pubDate>Sun, 12 Sep 2021 00:58:17 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-count-of-most-frequent-item-in-an-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the function to find the count of the most frequent item of an array. You can assume that input is an array of integers. For an empty array return ``&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;input array: [3, -1, -1, -1, 2, 3, -1, 3, -1, 2, 4, 9, 3]&#xA;ouptut: 5 &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.*;&#xA;&#xA;public class Solution {&#xA;  public static int mostFrequentItemCount(int[] collection) {&#xA;    if (collection.length==0) return 0;&#xA;    Map&amp;lt;Integer, Integer&amp;gt; m = new HashMap&amp;lt;&amp;gt;();&#xA;    for (Integer i : collection)&#xA;      m.merge(i, 1, Integer::sum);&#xA;    return Collections.max(m.values());&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Return Nth Smallest Element in Java</title>
      <link>https://andrewodendaal.com/return-nth-smallest-element-in-java/</link>
      <pubDate>Sat, 11 Sep 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/return-nth-smallest-element-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array/list [] of integers, Find the Nth smallest element in this array of integers&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Array/list&lt;/em&gt;&lt;/strong&gt; size is &lt;em&gt;at least 3&lt;/em&gt; .&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Array/list&amp;rsquo;s numbers&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;could be a &lt;strong&gt;&lt;em&gt;mixture&lt;/em&gt;&lt;/strong&gt; of positives , negatives and zeros&lt;/em&gt; .&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Repetition&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;in array/list&amp;rsquo;s numbers could occur&lt;/em&gt;, so don&amp;rsquo;t Remove Duplications .&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;nthSmallest({3,1,2} ,2) ==&amp;gt; return (2) &#xA;nthSmallest({15,20,7,10,4,3} ,3) ==&amp;gt; return (7) &#xA;nthSmallest({2,169,13,-5,0,-1} ,4) ==&amp;gt; return (2) &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>What temperature does your Mac CPU idle at?</title>
      <link>https://andrewodendaal.com/what-temperature-does-your-mac-cpu-idle-at/</link>
      <pubDate>Fri, 10 Sep 2021 00:26:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/what-temperature-does-your-mac-cpu-idle-at/</guid>
      <description>&lt;p&gt;Sometimes you will find that your Mac is running very hot, and you may want to keep track of it over time to see if it&amp;rsquo;s persistent or only a spike.&lt;/p&gt;&#xA;&lt;p&gt;There are tools like Intel&amp;rsquo;s Power Widget, or even the TurboBoostSwitcher that will show you graphs of these sort of things, but what about getting this information directly from the CLI?&lt;/p&gt;&#xA;&lt;p&gt;You&amp;rsquo;re in luck!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo powermetrics --samplers smc | grep -i &amp;#34;CPU die temperature&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Split String into Parts in Java</title>
      <link>https://andrewodendaal.com/split-string-into-parts-in-java/</link>
      <pubDate>Thu, 09 Sep 2021 00:22:22 +0000</pubDate>
      <guid>https://andrewodendaal.com/split-string-into-parts-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Split a given string into different strings of equal size.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Split the below string into other strings of size #3&#xA;&#xA;&amp;#39;supercalifragilisticexpialidocious&amp;#39;&#xA;&#xA;Will return a new string&#xA;&amp;#39;sup erc ali fra gil ist ice xpi ali doc iou s&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Assumptions:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;String length is always greater than 0&#xA;String has no spaces&#xA;Size is always positive&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class InParts {&#xA;    public static String splitInParts(String s, int partLength) {&#xA;        StringBuilder sb = new StringBuilder();&#xA;        char[] c = s.toCharArray();&#xA;        int k = 0;&#xA;      &#xA;        for (int i=0; i&amp;lt;c.length; i++) {&#xA;          sb.append(c[i]);&#xA;          if (k==partLength-1) {&#xA;            sb.append(&amp;#34; &amp;#34;);&#xA;            k = -1;&#xA;          }&#xA;          k++;&#xA;        }&#xA;        &#xA;        return sb.toString().trim();&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] ERROR 1030 (HY000): Got error 168 from storage engine</title>
      <link>https://andrewodendaal.com/solution-error-1030-hy000-got-error-168-from-storage-engine/</link>
      <pubDate>Wed, 08 Sep 2021 00:05:07 +0000</pubDate>
      <guid>https://andrewodendaal.com/solution-error-1030-hy000-got-error-168-from-storage-engine/</guid>
      <description>&lt;p&gt;If you are getting the following error in MySQL:&lt;br&gt;&#xA;&lt;code&gt;ERROR 1030 (HY000): Got error 168 from storage engine&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then this usually means that your server has run out of disk space!&lt;/p&gt;&#xA;&lt;p&gt;This is never a good thing, but can be resolved by simply deleting some files on the server that you don&amp;rsquo;t need.&lt;/p&gt;&#xA;&lt;h2 id=&#34;solution-1-delete-some-files&#34;&gt;Solution 1: Delete some files&lt;/h2&gt;&#xA;&lt;p&gt;If you have some files on the server that you can delete to free up some space, then do so.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Largest Pair Sum in Array in Python</title>
      <link>https://andrewodendaal.com/largest-pair-sum-in-array-in-python/</link>
      <pubDate>Tue, 07 Sep 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/largest-pair-sum-in-array-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a sequence of numbers, find the largest pair sum in the sequence.&lt;/p&gt;&#xA;&lt;p&gt;For example&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[10, 14, 2, 23, 19] --&amp;gt;  42 (= 23 + 19)&#xA;[99, 2, 2, 23, 19]  --&amp;gt; 122 (= 99 + 23)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Input sequence contains minimum two elements and every element is an integer.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def largest_pair_sum(numbers):&#xA;    return sum(sorted(numbers)[-2:])&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def largest_pair_sum(numbers):&#xA;    max1 = max(numbers)&#xA;    numbers.remove(max1)&#xA;    max2 = max(numbers)&#xA;    return max1 + max2&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Alphabet Symmetry in Python</title>
      <link>https://andrewodendaal.com/alphabet-symmetry-in-python/</link>
      <pubDate>Mon, 06 Sep 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/alphabet-symmetry-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Consider the word &lt;code&gt;&amp;quot;abode&amp;quot;&lt;/code&gt;. We can see that the letter &lt;code&gt;a&lt;/code&gt; is in position &lt;code&gt;1&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; is in position &lt;code&gt;2&lt;/code&gt;. In the alphabet, &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; are also in positions &lt;code&gt;1&lt;/code&gt; and &lt;code&gt;2&lt;/code&gt;. Notice also that &lt;code&gt;d&lt;/code&gt; and &lt;code&gt;e&lt;/code&gt; in &lt;code&gt;abode&lt;/code&gt; occupy the positions they would occupy in the alphabet, which are positions &lt;code&gt;4&lt;/code&gt; and &lt;code&gt;5&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Given an array of words, return an array of the number of letters that occupy their positions in the alphabet for each word. For example,&lt;/p&gt;</description>
    </item>
    <item>
      <title>Exes and Ohs in Java</title>
      <link>https://andrewodendaal.com/exes-and-ohs-in-java/</link>
      <pubDate>Sun, 05 Sep 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/exes-and-ohs-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Check to see if a string has the same amount of ‘x&amp;rsquo;s and ‘o&amp;rsquo;s. The method must return a boolean and be case insensitive. The string can contain any char.&lt;/p&gt;&#xA;&lt;p&gt;Examples input/output:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;XO(&amp;#34;ooxx&amp;#34;) =&amp;gt; true&#xA;XO(&amp;#34;xooxx&amp;#34;) =&amp;gt; false&#xA;XO(&amp;#34;ooxXm&amp;#34;) =&amp;gt; true&#xA;XO(&amp;#34;zpzpzpp&amp;#34;) =&amp;gt; true // when no &amp;#39;x&amp;#39; and &amp;#39;o&amp;#39; is present should return true&#xA;XO(&amp;#34;zzoo&amp;#34;) =&amp;gt; false&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.*;&#xA;&#xA;public class XO {&#xA;  &#xA;  public static boolean getXO (String str) {&#xA;    &#xA;    Map&amp;lt;String, Integer&amp;gt; m = new HashMap&amp;lt;&amp;gt;();&#xA;    m.put(&amp;#34;x&amp;#34;, 0);&#xA;    m.put(&amp;#34;o&amp;#34;, 0);&#xA;    &#xA;    for (int i = 0; i &amp;lt; str.length(); i++){&#xA;      char c = str.charAt(i);        &#xA;      &#xA;      if (Character.toLowerCase(c)==&amp;#39;x&amp;#39;)&#xA;        m.put(&amp;#34;x&amp;#34;, m.get(&amp;#34;x&amp;#34;)+1);&#xA;      &#xA;      if (Character.toLowerCase(c)==&amp;#39;o&amp;#39;)&#xA;        m.put(&amp;#34;o&amp;#34;, m.get(&amp;#34;o&amp;#34;)+1);&#xA;      &#xA;    }&#xA;    &#xA;    return m.get(&amp;#34;x&amp;#34;)==m.get(&amp;#34;o&amp;#34;);&#xA;    &#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sum of Odd Cubed Numbers in Python</title>
      <link>https://andrewodendaal.com/sum-of-odd-cubed-numbers-in-python/</link>
      <pubDate>Sat, 04 Sep 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/sum-of-odd-cubed-numbers-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Find the sum of the odd numbers within an array, after cubing the initial integers. The function should return &lt;code&gt;None&lt;/code&gt; if any of the values aren&amp;rsquo;t numbers.&lt;/p&gt;&#xA;&lt;p&gt;Note: Booleans should not be considered as numbers.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def cube_odd(arr):&#xA;    if any(type(x) is not int for x in arr):&#xA;        return None&#xA;    return sum(x ** 3 for x in arr if x % 2 != 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Halving Sum in Python</title>
      <link>https://andrewodendaal.com/halving-sum-in-python/</link>
      <pubDate>Fri, 03 Sep 2021 00:32:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/halving-sum-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a positive integer &lt;code&gt;n&lt;/code&gt;, calculate the following sum:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;n + n/2 + n/4 + n/8 + ...&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;All elements of the sum are the results of integer division.&lt;/p&gt;&#xA;&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;25  =&amp;gt;  25 + 12 + 6 + 3 + 1 = 47&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def halving_sum(n): &#xA;    total = [n]&#xA;    &#xA;    while n&amp;gt;=1:&#xA;        n = int(n/2)&#xA;        total.append(n)&#xA;        &#xA;    return sum(total)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def halving_sum(n): &#xA;    s=0&#xA;    while n: &#xA;        s+=n ; n&amp;gt;&amp;gt;=1&#xA;    return s&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Convert a LinkedList to a String in Python</title>
      <link>https://andrewodendaal.com/convert-a-linkedlist-to-a-string-in-python/</link>
      <pubDate>Thu, 02 Sep 2021 00:38:30 +0000</pubDate>
      <guid>https://andrewodendaal.com/convert-a-linkedlist-to-a-string-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Preloaded for you is a class, struct, or derived data type &lt;code&gt;Node&lt;/code&gt; (depending on the language) used to construct linked lists in this challenge:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Node():&#xA;    def __init__(self, data, next = None):&#xA;        self.data = data&#xA;        self.next = next&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Create a function &lt;code&gt;stringify&lt;/code&gt; which accepts an argument &lt;code&gt;list&lt;/code&gt;/&lt;code&gt;$list&lt;/code&gt; and returns a string representation of the list. The string representation of the list starts with the value of the current &lt;code&gt;Node&lt;/code&gt;, specified by its &lt;code&gt;data&lt;/code&gt;/&lt;code&gt;$data&lt;/code&gt;/&lt;code&gt;Data&lt;/code&gt; property, followed by a whitespace character, an arrow, and another whitespace character (&lt;code&gt;&amp;quot; -&amp;gt; &amp;quot;&lt;/code&gt;), followed by the rest of the list. The end of the string representation of a list must always end with &lt;code&gt;None&lt;/code&gt;. For example, given the following list:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Most Digits from List in Python</title>
      <link>https://andrewodendaal.com/most-digits-from-list-in-python/</link>
      <pubDate>Wed, 01 Sep 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/most-digits-from-list-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Find the number with the most digits.&lt;/p&gt;&#xA;&lt;p&gt;If two numbers in the argument array have the same number of digits, return the first one in the array.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def find_longest(xs):&#xA;    return max(xs, key=lambda x: len(str(x)))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def find_longest(arr):&#xA;    arr.sort(reverse=True) &#xA;    return arr[0]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def find_longest(arr):&#xA;    max_lenght = 0&#xA;    max_index = 0&#xA;    for cur_num in arr:&#xA;        lenght = len(str(cur_num))&#xA;        if lenght &amp;gt; max_lenght:&#xA;            max_lenght = lenght&#xA;            max_index = arr.index(cur_num)&#xA;    return arr[max_index]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import test&#xA;from solution import find_longest&#xA;&#xA;@test.describe(&amp;#34;Fixed Tests&amp;#34;)&#xA;def fixed_tests():&#xA;    @test.it(&amp;#39;Basic Test Cases&amp;#39;)&#xA;    def basic_test_cases():&#xA;        test.assert_equals(find_longest([1, 10, 100]), 100)&#xA;        test.assert_equals(find_longest([9000, 8, 800]), 9000)&#xA;        test.assert_equals(find_longest([8, 900, 500]), 900)&#xA;        test.assert_equals(find_longest([3, 40000, 100]), 40000)&#xA;        test.assert_equals(find_longest([1, 200, 100000]), 100000)&#xA;&#xA;@test.describe(&amp;#34;Random tests&amp;#34;)&#xA;def random_tests():&#xA;    &#xA;    from random import randint&#xA;    from functools import reduce&#xA;    &#xA;    sol=lambda arr: reduce(lambda a,b: b if len(str(a))&amp;lt;len(str(b)) else a,arr)&#xA;    &#xA;    for _ in range(40):&#xA;        arr=[randint(1,10**randint(1,20)) for q in range(randint(1,50))]&#xA;        expected = sol(arr)&#xA;        @test.it(f&amp;#34;Testing for find_longest({arr})&amp;#34;)&#xA;        def _():&#xA;            test.assert_equals(find_longest(arr[:]),expected)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Check if all Values in Array are Smaller in Python</title>
      <link>https://andrewodendaal.com/check-if-all-values-in-array-are-smaller-in-python/</link>
      <pubDate>Tue, 31 Aug 2021 00:24:19 +0000</pubDate>
      <guid>https://andrewodendaal.com/check-if-all-values-in-array-are-smaller-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You will be given an &lt;code&gt;array&lt;/code&gt; and a &lt;code&gt;limit&lt;/code&gt; value. You must check that all values in the array are below or equal to the limit value. If they are, return &lt;code&gt;true&lt;/code&gt;. Else, return &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You can assume all values in the array are numbers.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def small_enough(array, limit):&#xA;    return True if max(array)&amp;lt;=limit else False&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def small_enough(array, limit):&#xA;    return max(array)&amp;lt;=limit&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Maximum Product from List of Integers in Python</title>
      <link>https://andrewodendaal.com/maximum-product-from-list-of-integers-in-python/</link>
      <pubDate>Mon, 30 Aug 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/maximum-product-from-list-of-integers-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of integers, Find the maximum product &lt;em&gt;obtained from multiplying 2 adjacent numbers in the array&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;notes&#34;&gt;Notes&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Array/list size is &lt;em&gt;at least 2&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Array/list numbers could be a &lt;em&gt;mixture of positives, negatives also zeroes&lt;/em&gt; .&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;input--output-examples&#34;&gt;Input &amp;gt;Output Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;adjacentElementsProduct([1, 2, 3]); ==&amp;gt; return 6&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;explanation&#34;&gt;Explanation:&lt;/h3&gt;&#xA;&lt;p&gt;The maximum product is &lt;em&gt;obtained from multiplying&lt;/em&gt; &lt;code&gt;2 * 3 = 6&lt;/code&gt;, and they&amp;rsquo;re adjacent numbers in the array.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;adjacentElementsProduct([9, 5, 10, 2, 24, -1, -48]); ==&amp;gt; return 50&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;explanation-1&#34;&gt;Explanation:&lt;/h3&gt;&#xA;&lt;p&gt;Max product obtained &lt;em&gt;from multiplying&lt;/em&gt; &lt;code&gt;5 * 10 = 50&amp;amp;nbsp;&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sum of Array Singles in Python</title>
      <link>https://andrewodendaal.com/sum-of-array-singles-in-python/</link>
      <pubDate>Sun, 29 Aug 2021 01:42:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/sum-of-array-singles-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given an array of numbers in which two numbers occur once and the rest occur only twice. Your task is to return the sum of the numbers that occur only once.&lt;/p&gt;&#xA;&lt;p&gt;For example, &lt;code&gt;repeats([4,5,7,5,4,8]) = 15&lt;/code&gt; because only the numbers &lt;code&gt;7&lt;/code&gt; and &lt;code&gt;8&lt;/code&gt; occur once, and their sum is &lt;code&gt;15&lt;/code&gt;. Every other number occurs twice.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def repeats(arr):&#xA;    count = []&#xA;    for i in arr:&#xA;        if i not in count:&#xA;            count.append(i)&#xA;        else:&#xA;            count.remove(i)&#xA;            &#xA;    return sum(count)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Flatten and Sort an Array in Python</title>
      <link>https://andrewodendaal.com/flatten-and-sort-an-array-in-python/</link>
      <pubDate>Sat, 28 Aug 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/flatten-and-sort-an-array-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a two-dimensional array of integers, return the flattened version of the array with all the integers in the sorted (ascending) order.&lt;/p&gt;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&lt;p&gt;Given [[3, 2, 1], [4, 6, 5], [], [9, 7, 8]], your function should return [1, 2, 3, 4, 5, 6, 7, 8, 9].&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def flatten_and_sort(array):&#xA;    a = []&#xA;    for b in array:&#xA;        for c in b:&#xA;            a.append(c)&#xA;    return sorted(a)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Playing the Alphabet War in Python</title>
      <link>https://andrewodendaal.com/playing-the-alphabet-war-in-python/</link>
      <pubDate>Fri, 27 Aug 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/playing-the-alphabet-war-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;h3 id=&#34;introduction&#34;&gt;Introduction&lt;/h3&gt;&#xA;&lt;p&gt;There is a war and nobody knows – the alphabet war!&lt;br&gt;&#xA;There are two groups of hostile letters. The tension between left side letters and right side letters was too high and the war began.&lt;/p&gt;&#xA;&lt;h3 id=&#34;task&#34;&gt;Task&lt;/h3&gt;&#xA;&lt;p&gt;Write a function that accepts &lt;code&gt;fight&lt;/code&gt; string consists of only small letters and return who wins the fight. When the left side wins return &lt;code&gt;Left side wins!&lt;/code&gt;, when the right side wins return &lt;code&gt;Right side wins!&lt;/code&gt;, in other case return &lt;code&gt;Let&#39;s fight again!&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sum of numbers from 0 to N in Python</title>
      <link>https://andrewodendaal.com/sum-of-numbers-from-0-to-n-in-python/</link>
      <pubDate>Thu, 26 Aug 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/sum-of-numbers-from-0-to-n-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;We want to generate a function that computes the series starting from 0 and ending until the given number.&lt;/p&gt;&#xA;&lt;h2 id=&#34;example&#34;&gt;Example:&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;Input:&lt;/strong&gt; &amp;gt; 6&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt; 0+1+2+3+4+5+6 = 21&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Input:&lt;/strong&gt; &amp;gt; -15&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt; -15&amp;lt;0&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Input:&lt;/strong&gt; &amp;gt; 0&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt; 0=0&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def show_sequence(n):&#xA;    if n == 0:&#xA;        return &amp;#34;0=0&amp;#34;&#xA;    elif n &amp;lt; 0:&#xA;        return str(n) + &amp;#34;&amp;lt;0&amp;#34;&#xA;    else:&#xA;        counter = sum(range(n+1))&#xA;        return &amp;#39;+&amp;#39;.join(map(str, range(n+1))) + &amp;#34; = &amp;#34; + str(counter)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sorted? yes? no? how? ..in Python</title>
      <link>https://andrewodendaal.com/sorted-yes-no-how-in-python/</link>
      <pubDate>Wed, 25 Aug 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/sorted-yes-no-how-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the method which accepts an array of integers, and returns one of the following:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;&amp;quot;yes, ascending&amp;quot;&lt;/code&gt; – if the numbers in the array are sorted in an ascending order&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;&amp;quot;yes, descending&amp;quot;&lt;/code&gt; – if the numbers in the array are sorted in a descending order&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;&amp;quot;no&amp;quot;&lt;/code&gt; – otherwise&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;You can assume the array will always be valid, and there will always be one correct answer.&lt;/p&gt;&#xA;&lt;p&gt;Complete the method which accepts an array of integers, and returns one of the following:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Fix String Casing in Python</title>
      <link>https://andrewodendaal.com/how-to-fix-string-casing-in-python/</link>
      <pubDate>Tue, 24 Aug 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-fix-string-casing-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You will be given a string that may have mixed uppercase and lowercase letters and your task is to convert that string to either lowercase only or uppercase only based on:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;make as few changes as possible.&lt;/li&gt;&#xA;&lt;li&gt;if the string contains equal number of uppercase and lowercase letters, convert the string to lowercase.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;For example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;solve(&amp;#34;coDe&amp;#34;) = &amp;#34;code&amp;#34;. Lowercase characters &amp;gt; uppercase. Change only the &amp;#34;D&amp;#34; to lowercase.&#xA;solve(&amp;#34;CODe&amp;#34;) = &amp;#34;CODE&amp;#34;. Uppercase characters &amp;gt; lowecase. Change only the &amp;#34;e&amp;#34; to uppercase.&#xA;solve(&amp;#34;coDE&amp;#34;) = &amp;#34;code&amp;#34;. Upper == lowercase. Change all to lowercase.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Remove Duplicate Words from a String in Python</title>
      <link>https://andrewodendaal.com/how-to-remove-duplicate-words-from-a-string-in-python/</link>
      <pubDate>Mon, 23 Aug 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-remove-duplicate-words-from-a-string-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Remove all duplicate words from a string, leaving only single (first) words entries.&lt;/p&gt;&#xA;&lt;h3 id=&#34;example&#34;&gt;Example:&lt;/h3&gt;&#xA;&lt;p&gt;&lt;strong&gt;Input:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;‘alpha beta beta gamma gamma gamma delta alpha beta beta gamma gamma gamma delta&#39;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;‘alpha beta gamma delta&#39;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def remove_duplicate_words(s):&#xA;    def unique_list(l):&#xA;        ulist = []&#xA;        [ulist.append(x) for x in l if x not in ulist]&#xA;        return ulist&#xA;&#xA;    return &amp;#39; &amp;#39;.join(unique_list(s.split()))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def remove_duplicate_words(s):&#xA;    return &amp;#39; &amp;#39;.join(dict.fromkeys(s.split()))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Validate a Regex PIN Code in Python</title>
      <link>https://andrewodendaal.com/how-to-validate-a-regex-pin-code-in-python/</link>
      <pubDate>Sun, 22 Aug 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-validate-a-regex-pin-code-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;ATM machines allow 4 or 6 digit PIN codes and PIN codes cannot contain anything but &lt;strong&gt;exactly&lt;/strong&gt; 4 digits or exactly 6 digits.&lt;/p&gt;&#xA;&lt;p&gt;If the function is passed a valid PIN string, return &lt;code&gt;true&lt;/code&gt;, else return &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;1234&amp;#34;   --&amp;gt;  true&#xA;&amp;#34;12345&amp;#34;  --&amp;gt;  false&#xA;&amp;#34;a234&amp;#34;   --&amp;gt;  false&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def validate_pin(pin):&#xA;    return len(pin) in (4, 6) and pin.isdigit()&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import re&#xA;&#xA;def validate_pin(pin):&#xA;    return bool(re.fullmatch(&amp;#34;\d{4}|\d{6}&amp;#34;, pin))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Combine strings and remove duplicates in Python</title>
      <link>https://andrewodendaal.com/combine-strings-and-remove-duplicates-in-python/</link>
      <pubDate>Sat, 21 Aug 2021 00:03:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/combine-strings-and-remove-duplicates-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Take 2 strings &lt;code&gt;s1&lt;/code&gt; and &lt;code&gt;s2&lt;/code&gt; including only letters from &lt;code&gt;a&lt;/code&gt;to &lt;code&gt;z&lt;/code&gt;. Return a new &lt;strong&gt;sorted&lt;/strong&gt; string, the longest possible, containing distinct letters – each taken only once – coming from s1 or s2.&lt;/p&gt;&#xA;&lt;h4 id=&#34;examples&#34;&gt;Examples:&lt;/h4&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;a = &amp;#34;xyaabbbccccdefww&amp;#34;&#xA;b = &amp;#34;xxxxyyyyabklmopq&amp;#34;&#xA;longest(a, b) -&amp;gt; &amp;#34;abcdefklmopqwxy&amp;#34;&#xA;&#xA;a = &amp;#34;abcdefghijklmnopqrstuvwxyz&amp;#34;&#xA;longest(a, a) -&amp;gt; &amp;#34;abcdefghijklmnopqrstuvwxyz&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (Using a Dictionary):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def longest(a1, a2):&#xA;    a3 = list(dict.fromkeys(sorted(a1+a2)))&#xA;    return &amp;#34;&amp;#34;.join(a3)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2 (Using a Set):&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Repeat by String Index in Golang</title>
      <link>https://andrewodendaal.com/how-to-repeat-by-string-index-in-golang/</link>
      <pubDate>Fri, 20 Aug 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-repeat-by-string-index-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function that repeats each character by the amount of it&amp;rsquo;s index value of the original string.&lt;/p&gt;&#xA;&lt;h4 id=&#34;examples&#34;&gt;Examples:&lt;/h4&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;accum(&amp;#34;abcd&amp;#34;) -&amp;gt; &amp;#34;A-Bb-Ccc-Dddd&amp;#34;&#xA;accum(&amp;#34;RqaEzty&amp;#34;) -&amp;gt; &amp;#34;R-Qq-Aaa-Eeee-Zzzzz-Tttttt-Yyyyyyy&amp;#34;&#xA;accum(&amp;#34;cwAt&amp;#34;) -&amp;gt; &amp;#34;C-Ww-Aaa-Tttt&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The parameter of &lt;code&gt;accum&lt;/code&gt; is a string that includes only letters from &lt;code&gt;a..z&lt;/code&gt; and &lt;code&gt;A..Z&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;&#xA;import &amp;#34;strings&amp;#34;&#xA;&#xA;func Accum(s string) string {&#xA;    words := make([]string, len(s))&#xA;    &#xA;    for i, c := range s {&#xA;        words[i] = strings.Title(strings.Repeat(strings.ToLower(string(c)), i+1))&#xA;    }&#xA;   &#xA;    return strings.Join(words, &amp;#34;-&amp;#34;)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to make an arithmetic function in Java</title>
      <link>https://andrewodendaal.com/how-to-make-an-arithmetic-function-in-java/</link>
      <pubDate>Thu, 19 Aug 2021 00:04:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-make-an-arithmetic-function-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given two numbers and an arithmetic operator (the name of it, as a string), return the result of the two numbers having that operator used on them.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; will both be positive integers, and &lt;code&gt;a&lt;/code&gt; will always be the first number in the operation, and &lt;code&gt;b&lt;/code&gt; always the second.&lt;/p&gt;&#xA;&lt;p&gt;The four operators are &amp;ldquo;add&amp;rdquo;, &amp;ldquo;subtract&amp;rdquo;, &amp;ldquo;divide&amp;rdquo;, &amp;ldquo;multiply&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;A few examples:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;arithmetic(5, 2, &amp;#34;add&amp;#34;)      =&amp;gt; returns 7&#xA;arithmetic(5, 2, &amp;#34;subtract&amp;#34;) =&amp;gt; returns 3&#xA;arithmetic(5, 2, &amp;#34;multiply&amp;#34;) =&amp;gt; returns 10&#xA;arithmetic(5, 2, &amp;#34;divide&amp;#34;)   =&amp;gt; returns 2.5&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ArithmeticFunction.arithmetic(5, 2, &amp;#34;add&amp;#34;)      =&amp;gt; returns 7&#xA;ArithmeticFunction.arithmetic(5, 2, &amp;#34;subtract&amp;#34;) =&amp;gt; returns 3&#xA;ArithmeticFunction.arithmetic(5, 2, &amp;#34;multiply&amp;#34;) =&amp;gt; returns 10&#xA;ArithmeticFunction.arithmetic(5, 2, &amp;#34;divide&amp;#34;)   =&amp;gt; returns 2&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calculate the Third Angle of a Triangle in Go</title>
      <link>https://andrewodendaal.com/calculate-the-third-angle-of-a-triangle-in-go/</link>
      <pubDate>Wed, 18 Aug 2021 00:13:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/calculate-the-third-angle-of-a-triangle-in-go/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given two interior angles (in degrees) of a triangle.&lt;/p&gt;&#xA;&lt;p&gt;Write a function to return the 3rd.&lt;/p&gt;&#xA;&lt;p&gt;Note: only positive integers will be tested.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;&#xA;func OtherAngle(a int, b int) int {&#xA;    return 180-a-b&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;&#xA;func OtherAngle(a int, b int) int {&#xA;  if a + b &amp;gt; 180{&#xA;    return -1&#xA;  }&#xA;  return 180 - a - b&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Return Short Long Short in Python</title>
      <link>https://andrewodendaal.com/return-short-long-short-in-python/</link>
      <pubDate>Tue, 17 Aug 2021 00:48:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/return-short-long-short-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given 2 strings, &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;, return a string of the form short+long+short, with the shorter string on the outside and the longer string on the inside. The strings will not be the same length, but they may be empty ( length `` ).&lt;/p&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;solution(&amp;#34;1&amp;#34;, &amp;#34;22&amp;#34;) # returns &amp;#34;1221&amp;#34;&#xA;solution(&amp;#34;22&amp;#34;, &amp;#34;1&amp;#34;) # returns &amp;#34;1221&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def solution(a, b):&#xA;    if a.isdigit():&#xA;        if a&amp;lt;b:&#xA;            return f&amp;#34;{a}{b}{a}&amp;#34;&#xA;        else:&#xA;            return f&amp;#34;{b}{a}{b}&amp;#34;&#xA;    else:&#xA;        if len(a)&amp;lt;len(b):&#xA;            return f&amp;#34;{a}{b}{a}&amp;#34;&#xA;        else:&#xA;            return f&amp;#34;{b}{a}{b}&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Hello, Name or World in Python</title>
      <link>https://andrewodendaal.com/hello-name-or-world-in-python/</link>
      <pubDate>Mon, 16 Aug 2021 00:04:28 +0000</pubDate>
      <guid>https://andrewodendaal.com/hello-name-or-world-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Define a method &lt;code&gt;hello&lt;/code&gt; that &lt;code&gt;returns&lt;/code&gt; &amp;ldquo;Hello, Name!&amp;rdquo; to a given &lt;code&gt;name&lt;/code&gt;, or says Hello, World! if name is not given (or passed as an empty String).&lt;/p&gt;&#xA;&lt;p&gt;Assuming that &lt;code&gt;name&lt;/code&gt; is a &lt;code&gt;String&lt;/code&gt; and it checks for user typos to return a name with a first capital letter (Xxxx).&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;hello &amp;#34;john&amp;#34;   =&amp;gt; &amp;#34;Hello, John!&amp;#34;&#xA;hello &amp;#34;aliCE&amp;#34;  =&amp;gt; &amp;#34;Hello, Alice!&amp;#34;&#xA;hello          =&amp;gt; &amp;#34;Hello, World!&amp;#34; &amp;lt;em&amp;gt;# name not given&amp;lt;/em&amp;gt;&#xA;hello &amp;#34;&amp;#34;       =&amp;gt; &amp;#34;Hello, World!&amp;#34; &amp;lt;em&amp;gt;# name is an empty String&amp;lt;/em&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Add Length to Strings in Python</title>
      <link>https://andrewodendaal.com/add-length-to-strings-in-python/</link>
      <pubDate>Sun, 15 Aug 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/add-length-to-strings-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;What if we need the length of the words separated by a space to be added at the end of that same word and have it returned as an array?&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;add_length(&amp;#39;apple ban&amp;#39;) =&amp;gt; [&amp;#34;apple 5&amp;#34;, &amp;#34;ban 3&amp;#34;]&#xA;add_length(&amp;#39;you will win&amp;#39;) =&amp;gt; [&amp;#34;you 3&amp;#34;, &amp;#34;will 4&amp;#34;, &amp;#34;win 3&amp;#34;]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Your task is to write a function that takes a String and returns an Array/list with the length of each word added to each element.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Reversing Words in a String in Python</title>
      <link>https://andrewodendaal.com/how-to-reversing-words-in-a-string-in-python/</link>
      <pubDate>Sat, 14 Aug 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reversing-words-in-a-string-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that reverses the words in a given string. A word can also fit an empty string. If this is not clear enough, here are some examples:&lt;/p&gt;&#xA;&lt;p&gt;As the input may have trailing spaces, you will also need to ignore unnecessary whitespace.&lt;/p&gt;&#xA;&lt;p&gt;Example (&lt;strong&gt;Input&lt;/strong&gt; –&amp;gt; &lt;strong&gt;Output&lt;/strong&gt;)&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;Hello World&amp;#34; --&amp;gt; &amp;#34;World Hello&amp;#34;&#xA;&amp;#34;Hi There.&amp;#34; --&amp;gt; &amp;#34;There. Hi&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import re&#xA;&#xA;def reverse(st):&#xA;    return &amp;#34; &amp;#34;.join(re.sub(&amp;#39;\s+&amp;#39;, &amp;#39; &amp;#39;, st).strip().split(&amp;#34; &amp;#34;)[::-1])&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to  Remove Duplicates from List in Python</title>
      <link>https://andrewodendaal.com/how-to-remove-duplicates-from-list-in-python/</link>
      <pubDate>Fri, 13 Aug 2021 00:18:18 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-remove-duplicates-from-list-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Define a function that removes duplicates from an array of numbers and returns it as a result.&lt;/p&gt;&#xA;&lt;p&gt;The order of the sequence has to stay the same.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def distinct(seq):&#xA;    return list(dict.fromkeys(seq))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;distinct = lambda s: [e for i,e in enumerate(s) if e not in s[:i]]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def distinct(seq):&#xA;    result = []&#xA;    seen = set()&#xA;    for a in seq:&#xA;        if a not in seen:&#xA;            result.append(a)&#xA;            seen.add(a)&#xA;    return result&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import test&#xA;from solution import distinct&#xA;&#xA;@test.describe(&amp;#34;Fixed Tests&amp;#34;)&#xA;def fixed_tests():&#xA;    @test.it(&amp;#39;Basic Test Cases&amp;#39;)&#xA;    def basic_test_cases():&#xA;        test.assert_equals(distinct([1]), [1])&#xA;        test.assert_equals(distinct([1, 2]), [1, 2])&#xA;        test.assert_equals(distinct([1, 1, 2]), [1, 2])&#xA;        test.assert_equals(distinct([1, 1, 1, 2, 3, 4, 5]), [1, 2, 3, 4, 5])&#xA;        test.assert_equals(distinct([1, 2, 2, 3, 3, 4, 4, 5, 6, 7, 7, 7]), [1, 2, 3, 4, 5, 6, 7])&#xA;        &#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Format Dollars and Cents in Python</title>
      <link>https://andrewodendaal.com/how-to-format-dollars-and-cents-in-python/</link>
      <pubDate>Thu, 12 Aug 2021 00:04:19 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-format-dollars-and-cents-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The company you work for has just been awarded a contract to build a payment gateway. In order to help move things along, you have volunteered to create a function that will take a float and return the amount formatting in dollars and cents.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;39.99 becomes $39.99&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;The rest of your team will make sure that the argument is sanitized before being passed to your function although you will need to account for adding trailing zeros if they are missing (though you won&amp;rsquo;t have to worry about a dangling period).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Return `5` without any numbers in Python</title>
      <link>https://andrewodendaal.com/return-5-without-any-numbers-in-python/</link>
      <pubDate>Wed, 11 Aug 2021 00:17:59 +0000</pubDate>
      <guid>https://andrewodendaal.com/return-5-without-any-numbers-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that always returns &lt;code&gt;5&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Sounds easy right? Just bear in mind that you can&amp;rsquo;t use any of the following characters: &lt;code&gt;0123456789*+-/&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def unusual_five():&#xA;    return len([&amp;#39;a&amp;#39;,&amp;#39;b&amp;#39;,&amp;#39;c&amp;#39;,&amp;#39;d&amp;#39;,&amp;#39;e&amp;#39;])&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def unusual_five():&#xA;    return len(&amp;#34;five!&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def unusual_five():&#xA;    return (int(True &amp;lt;&amp;lt; True &amp;lt;&amp;lt; True ^ True))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 4:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def unusual_five():&#xA;    return &amp;#34;fiftyfive divided by eleven&amp;#34;.count(&amp;#34;e&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import test&#xA;from solution import unusual_five&#xA;&#xA;@test.describe(&amp;#34;Fixed Tests&amp;#34;)&#xA;def fixed_tests():&#xA;    @test.it(&amp;#39;Should return 5&amp;#39;)&#xA;    def basic_test_cases():&#xA;        test.assert_equals(unusual_five(),5,&amp;#34;lol&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Generate Range of Integers in Python</title>
      <link>https://andrewodendaal.com/how-to-generate-range-of-integers-in-python/</link>
      <pubDate>Tue, 10 Aug 2021 01:13:06 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-generate-range-of-integers-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Implement a function named generateRange(min, max, step), which takes three arguments and generates a range of integers from min to max, with the step. The first integer is the minimum value, the second is the maximum of the range and the third is the step. (min &amp;lt; max)&lt;/p&gt;&#xA;&lt;h3 id=&#34;task&#34;&gt;Task&lt;/h3&gt;&#xA;&lt;p&gt;Implement a function named&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;generate_range(2, 10, 2) # should return list of [2,4,6,8,10]&#xA;generate_range(1, 10, 3) # should return list of [1,4,7,10]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;generate_range(2, 10, 2) # should return array of [2, 4, 6, 8, 10]&#xA;generate_range(1, 10, 3) # should return array of [1, 4, 7, 10]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;note&#34;&gt;Note&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;min &amp;lt; max&lt;/li&gt;&#xA;&lt;li&gt;step &amp;gt; 0&lt;/li&gt;&#xA;&lt;li&gt;the range does not HAVE to include max (depending on the step)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Blue/Green Deployment Techniques in AWS</title>
      <link>https://andrewodendaal.com/blue-green-deployment-techniques-in-aws/</link>
      <pubDate>Mon, 09 Aug 2021 00:03:52 +0000</pubDate>
      <guid>https://andrewodendaal.com/blue-green-deployment-techniques-in-aws/</guid>
      <description>&lt;h2 id=&#34;what-are-bluegreen-deployments&#34;&gt;What are Blue/Green Deployments?&lt;/h2&gt;&#xA;&lt;p&gt;&amp;ldquo;Blue/Green Deployments&amp;rdquo; is a software deployment methodology. A terminology to suggest two mostly equal states of potential different deployable artefacts.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2021/08/image-385x350.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Within the context of Amazon Web Services (AWS), there are a couple of ways to do this.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s explore the two most common ones, then extend that theory to a third one.&lt;/p&gt;&#xA;&lt;p&gt;Thereafter, we will touch on two more that could be looked at.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-route53&#34;&gt;1. Route53&lt;/h2&gt;&#xA;&lt;p&gt;Update the DNS routing. With this technique, there is a duplicate stack for both the Blue and the Green environments, and Route53 is utilised to point the DNS to a specific point. It is extremely fast and simple to rollback using this method, by simply changing the DNS records back to what they were before.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate Powers of 2 in Python</title>
      <link>https://andrewodendaal.com/how-to-calculate-powers-of-2-in-python/</link>
      <pubDate>Sun, 08 Aug 2021 01:04:14 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-powers-of-2-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the function that takes a non-negative integer &lt;code&gt;n&lt;/code&gt; as input, and returns a list of all the powers of 2 with the exponent ranging from 0 to &lt;code&gt;n&lt;/code&gt; (inclusive).&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;n = 0  ==&amp;gt; [1]        # [2^0]&#xA;n = 1  ==&amp;gt; [1, 2]     # [2^0, 2^1]&#xA;n = 2  ==&amp;gt; [1, 2, 4]  # [2^0, 2^1, 2^2]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def powers_of_two(n):&#xA;    out = []&#xA;    for i in range(n+1):&#xA;        out.append(2**i)&#xA;    return out&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Get Planet Name By ID in Python</title>
      <link>https://andrewodendaal.com/how-to-get-planet-name-by-id-in-python/</link>
      <pubDate>Sat, 07 Aug 2021 00:09:56 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-planet-name-by-id-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function that takes in an &lt;code&gt;id&lt;/code&gt; and returns the &lt;code&gt;planet name&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def get_planet_name(id):&#xA;    return {&#xA;        1: &amp;#34;Mercury&amp;#34;,&#xA;        2: &amp;#34;Venus&amp;#34;,&#xA;        3: &amp;#34;Earth&amp;#34;,&#xA;        4: &amp;#34;Mars&amp;#34;,&#xA;        5: &amp;#34;Jupiter&amp;#34;,&#xA;        6: &amp;#34;Saturn&amp;#34;,&#xA;        7: &amp;#34;Uranus&amp;#34; , &#xA;        8: &amp;#34;Neptune&amp;#34;&#xA;    }[id]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def get_planet_name(id):&#xA;    return [&amp;#34;Mercury&amp;#34;,&amp;#34;Venus&amp;#34;,&amp;#34;Earth&amp;#34;,&amp;#34;Mars&amp;#34;,&amp;#34;Jupiter&amp;#34;,&amp;#34;Saturn&amp;#34;,&amp;#34;Uranus&amp;#34;,&amp;#34;Neptune&amp;#34;][id-1]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def get_planet_name(id):&#xA;    if   id == 1: return &amp;#34;Mercury&amp;#34;&#xA;    elif id == 2: return &amp;#34;Venus&amp;#34;&#xA;    elif id == 3: return &amp;#34;Earth&amp;#34;&#xA;    elif id == 4: return &amp;#34;Mars&amp;#34;&#xA;    elif id == 5: return &amp;#34;Jupiter&amp;#34;&#xA;    elif id == 6: return &amp;#34;Saturn&amp;#34;&#xA;    elif id == 7: return &amp;#34;Uranus&amp;#34;  &#xA;    elif id == 8: return &amp;#34;Neptune&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import test&#xA;from solution import get_planet_name&#xA;&#xA;@test.describe(&amp;#34;Fixed Tests&amp;#34;)&#xA;def fixed_tests():&#xA;    @test.it(&amp;#39;Basic Test Cases&amp;#39;)&#xA;    def basic_test_cases():&#xA;        test.assert_equals(get_planet_name(2), &amp;#39;Venus&amp;#39;)&#xA;        test.assert_equals(get_planet_name(5), &amp;#39;Jupiter&amp;#39;)&#xA;        test.assert_equals(get_planet_name(3), &amp;#39;Earth&amp;#39;)&#xA;        test.assert_equals(get_planet_name(4), &amp;#39;Mars&amp;#39;)&#xA;        test.assert_equals(get_planet_name(8), &amp;#39;Neptune&amp;#39;)&#xA;        test.assert_equals(get_planet_name(1), &amp;#39;Mercury&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Make a Directory if Not Exists in Python</title>
      <link>https://andrewodendaal.com/how-to-make-a-directory-if-not-exists-in-python/</link>
      <pubDate>Fri, 06 Aug 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-make-a-directory-if-not-exists-in-python/</guid>
      <description>&lt;p&gt;If you want to create a directory in Python, but only if it doesn&amp;rsquo;t exist, you have the following option.&lt;/p&gt;&#xA;&lt;h2 id=&#34;using-python-35-or-newer&#34;&gt;Using Python 3.5 or newer?&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from pathlib import Path&#xA;Path(&amp;#34;/your/directory&amp;#34;).mkdir(parents=True, exist_ok=True)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;alternative-option&#34;&gt;Alternative option&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import os&#xA;if not os.path.exists(&amp;#34;/your/directory&amp;#34;):&#xA;  os.makedirs(&amp;#34;/your/directory&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Square(n) Sum in Python</title>
      <link>https://andrewodendaal.com/squaren-sum-in-python/</link>
      <pubDate>Thu, 05 Aug 2021 02:17:33 +0000</pubDate>
      <guid>https://andrewodendaal.com/squaren-sum-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the square sum function so that it squares each number passed into it and then sums the results together.&lt;/p&gt;&#xA;&lt;p&gt;For example, for &lt;code&gt;[1, 2, 2]&lt;/code&gt; it should return &lt;code&gt;9&lt;/code&gt; because &lt;code&gt;1^2 + 2^2 + 2^2 = 9&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Complete the square sum function so that it squares each number passed into it and then sums the results together.&lt;/p&gt;&#xA;&lt;p&gt;For example, for &lt;code&gt;[1, 2, 2]&lt;/code&gt; it should return &lt;code&gt;9&lt;/code&gt; because &lt;code&gt;1^2 + 2^2 + 2^2 = 9&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Fill an Array in Python</title>
      <link>https://andrewodendaal.com/how-to-fill-an-array-in-python/</link>
      <pubDate>Wed, 04 Aug 2021 00:15:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-fill-an-array-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;We want an array, but not just any old array, an array with contents!&lt;/p&gt;&#xA;&lt;p&gt;Write a function that produces an array with the numbers `` to &lt;code&gt;N-1&lt;/code&gt; in it.&lt;/p&gt;&#xA;&lt;p&gt;For example, the following code will result in an array containing the numbers `` to &lt;code&gt;4&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;arr(5) # =&amp;gt; [0,1,2,3,4]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note: The parameter is optional. So you have to give it a default value.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Fix the ‘Bad Interpreter’ Error from AWS and Python 3.7</title>
      <link>https://andrewodendaal.com/how-to-fix-the-bad-interpreter-error-from-aws-and-python-3-7/</link>
      <pubDate>Tue, 03 Aug 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-fix-the-bad-interpreter-error-from-aws-and-python-3-7/</guid>
      <description>&lt;p&gt;This error often looks something like:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;.zshrc: /usr/local/bin/aws: bad interpreter:&#xA;/usr/local/opt/python/bin/python3.6: no such file or directory&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;reinstall-awscli&#34;&gt;Reinstall AWSCLI&lt;/h2&gt;&#xA;&lt;p&gt;If you have started getting the &lt;code&gt;Bad Interpreter&lt;/code&gt; error when you call &lt;code&gt;awscli&lt;/code&gt;, then you can easily fix it by running:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;brew reinstall awscli&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;force-link-the-version&#34;&gt;Force link the version&lt;/h2&gt;&#xA;&lt;p&gt;Then make sure to link to the correct version:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;brew link --overwrite awscli&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Retrieve records from MSSQLServer in Python</title>
      <link>https://andrewodendaal.com/retrieve-records-from-mssqlserver-in-python/</link>
      <pubDate>Mon, 02 Aug 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/retrieve-records-from-mssqlserver-in-python/</guid>
      <description>&lt;p&gt;The below Python code will create a connection to a MSSQLServer instance, and retrieve data from it back into a variable called &lt;code&gt;tblResults&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;# use pyodbc for database connection&#xA;import pyodbc&#xA;&#xA;# keep our database credentials in a store&#xA;secrets = {&#xA;    &amp;#39;host&amp;#39;: &amp;#39;&amp;lt;db_host&amp;gt;&amp;#39;,&#xA;    &amp;#39;Name&amp;#39;: &amp;#39;&amp;lt;db_name&amp;gt;&amp;#39;,&#xA;    &amp;#39;username&amp;#39;: &amp;#39;&amp;lt;db_username&amp;gt;&amp;#39;,&#xA;    &amp;#39;password&amp;#39;: &amp;#39;&amp;lt;db_password&amp;gt;&amp;#39;,&#xA;}&#xA;&#xA;# create a connection string&#xA;conn_str = f&amp;#34;DRIVER={{ODBC Driver 17 for SQL Server}};SERVER=tcp:{secrets[&amp;#39;host&amp;#39;]};DATABASE={secrets[&amp;#39;Name&amp;#39;]};UID={secrets[&amp;#39;username&amp;#39;]};PWD={secrets[&amp;#39;password&amp;#39;]}&amp;#34;&#xA;&#xA;# create a connection to the database&#xA;conn = pyodbc.connect(conn_str)&#xA;&#xA;# a reusable function to get data from&#xA;def sql_get(sql, conn):&#xA;    cursor = conn.cursor()&#xA;    cursor.execute(sql)&#xA;    columns = [column[0] for column in cursor.description]&#xA;    results = []&#xA;    for row in cursor.fetchall():&#xA;        results.append(dict(zip(columns, row)))&#xA;    return results&#xA;&#xA;# some variable to use in the SQL statement below&#xA;something = 13&#xA;&#xA;# make a database connection and return the results into a variable&#xA;tblResults = sql_get(&#xA;    f&amp;#34;&amp;#34;&amp;#34;SELECT * FROM tblName WHERE something=&amp;#39;{something}&amp;#39;&amp;#34;&amp;#34;&amp;#34;&#xA;, conn)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Remove Trailing Zeroes in Python</title>
      <link>https://andrewodendaal.com/how-to-remove-trailing-zeroes-in-python/</link>
      <pubDate>Sun, 01 Aug 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-remove-trailing-zeroes-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Numbers ending with zeros are boring.&lt;/p&gt;&#xA;&lt;p&gt;They might be fun in your world, but not here.&lt;/p&gt;&#xA;&lt;p&gt;Get rid of them. Only the ending ones.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;1450 -&amp;gt; 145&#xA;960000 -&amp;gt; 96&#xA;1050 -&amp;gt; 105&#xA;-1050 -&amp;gt; -105&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def no_boring_zeros(n):&#xA;    n = str(n)&#xA;    for i in range(len(n)-1, 0, -1):&#xA;        if n[i]==&amp;#34;0&amp;#34;:&#xA;            n = n[:-1:]&#xA;        else:&#xA;            return int(n)&#xA;    return int(n)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def no_boring_zeros(n):&#xA;    try:&#xA;        return int(str(n).rstrip(&amp;#39;0&amp;#39;))&#xA;    except ValueError:&#xA;        return 0&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to use Profilers in Python</title>
      <link>https://andrewodendaal.com/how-to-use-profilers-in-python/</link>
      <pubDate>Sat, 31 Jul 2021 00:05:40 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-use-profilers-in-python/</guid>
      <description>&lt;p&gt;When you have performance problems in your Python application, you can use a Profiler to help you.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-using-cprofile&#34;&gt;Step 1: Using cProfile&lt;/h2&gt;&#xA;&lt;p&gt;Your first option is to run your application with &lt;code&gt;-m cProfile&lt;/code&gt; in the cli.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s take an example application that is run as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;python app.py&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We can run it with a Profiler by doing the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;python -m cProfile -o outfile app.py&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will give you a report that shows where most of the time is spent while running your app.&lt;/p&gt;</description>
    </item>
    <item>
      <title>If you can’t Sleep, just count Sheep in Python</title>
      <link>https://andrewodendaal.com/if-you-cant-sleep-just-count-sheep-in-python/</link>
      <pubDate>Fri, 30 Jul 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/if-you-cant-sleep-just-count-sheep-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a non-negative integer, &lt;code&gt;3&lt;/code&gt; for example, return a string with a murmur: &lt;code&gt;&amp;quot;1 sheep...2 sheep...3 sheep...&amp;quot;&lt;/code&gt;. Input will always be valid, i.e. no negative integers.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def count_sheep(n):&#xA;    sheep = &amp;#39;&amp;#39;&#xA;    for i in range(n):&#xA;        sheep+=f&amp;#34;{i+1} sheep...&amp;#34;&#xA;    return sheep&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def count_sheep(n):&#xA;    return &amp;#39;&amp;#39;.join(f&amp;#34;{i} sheep...&amp;#34; for i in range(1,n+1))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def count_sheep(n):&#xA;    return (&amp;#39;{} sheep...&amp;#39;*n).format(*list(range(1,n+1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import test&#xA;from solution import count_sheep&#xA;&#xA;@test.describe(&amp;#34;Fixed Tests&amp;#34;)&#xA;def fixed_tests():&#xA;    @test.it(&amp;#39;Basic Test Cases&amp;#39;)&#xA;    def basic_test_cases():&#xA;        test.assert_equals(count_sheep(1), &amp;#34;1 sheep...&amp;#34;);&#xA;        test.assert_equals(count_sheep(2), &amp;#34;1 sheep...2 sheep...&amp;#34;)&#xA;        test.assert_equals(count_sheep(3), &amp;#34;1 sheep...2 sheep...3 sheep...&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Key-Value CLI Arguments in Python</title>
      <link>https://andrewodendaal.com/key-value-cli-arguments-in-python/</link>
      <pubDate>Thu, 29 Jul 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/key-value-cli-arguments-in-python/</guid>
      <description>&lt;p&gt;If you have a CommandLine application (CLI) written in Python, you have a number of ways that you can take arguments from the user.&lt;/p&gt;&#xA;&lt;p&gt;You could take the order from the user and assign those to variables:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import sys&#xA;print( sys.argv )&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will give you a list of all the space separated values.&lt;/p&gt;&#xA;&lt;p&gt;So if your app is called like:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;python app.py var1 var2&#xA;# [&amp;#39;app.py&amp;#39;, &amp;#39;var1&amp;#39;, &amp;#39;var2&amp;#39;]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As you can see, &lt;code&gt;sys.argv&lt;/code&gt; is a list and the arguments start from the second index location.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to use a Translation Table to Replace Characters in Python</title>
      <link>https://andrewodendaal.com/how-to-use-a-translation-table-to-replace-characters-in-python/</link>
      <pubDate>Wed, 28 Jul 2021 00:29:55 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-use-a-translation-table-to-replace-characters-in-python/</guid>
      <description>&lt;p&gt;Python provides the ability to create Translation Tables.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;our_text = &amp;#34;This is an example of some text&amp;#34;&#xA;translation_table = str.maketrans(&amp;#34;abefilostz&amp;#34;, &amp;#34;4636110572&amp;#34;)&#xA;&#xA;print(our_text)&#xA;#This is an example of some text&#xA;&#xA;print(our_text.translate(translation_table))&#xA;# Th15 15 4n 3x4mp13 06 50m3 73x7&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;First we create a Translation Table by calling &lt;code&gt;str.maketrans(x, y, z)&lt;/code&gt;, passing in our characters we want to translate from and to.&lt;/p&gt;&#xA;&lt;p&gt;Then we apply our &lt;code&gt;translate(table)&lt;/code&gt; to a string using our newly created Translation Table.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate the Sum of all Numbers in a String in Python</title>
      <link>https://andrewodendaal.com/how-to-calculate-the-sum-of-all-numbers-in-a-string-in-python/</link>
      <pubDate>Tue, 27 Jul 2021 00:48:09 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-the-sum-of-all-numbers-in-a-string-in-python/</guid>
      <description>&lt;p&gt;Let&amp;rsquo;s take the following string:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;numbers = &amp;#34;this 1 2 3 4 5 is not a 8 9 10&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;How can we sum up all the numbers in this string?&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;print(sum([int(num) for num in numbers.split(&amp;#34; &amp;#34;) if num.isnumeric()]))&#xA;#42&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In the above code snippet, we split the string by the space character, then loop through it and ignore anything that is not numeric. Then we sum up the numbers that are remaining.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find all Permutations of a String in Python</title>
      <link>https://andrewodendaal.com/how-to-find-all-permutations-of-a-string-in-python/</link>
      <pubDate>Mon, 26 Jul 2021 00:36:30 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-all-permutations-of-a-string-in-python/</guid>
      <description>&lt;p&gt;Python comes with a very useful module called &lt;code&gt;itertools&lt;/code&gt;, which allows us to calculate permutations directly.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from itertools import permutations&#xA;perms = [&amp;#39;&amp;#39;.join(p) for p in set(permutations(&amp;#39;hello&amp;#39;))]&#xA;print(perms)&#xA;print(len(perms))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will result in 60 permutations:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#[&amp;#39;helol&amp;#39;, &amp;#39;heoll&amp;#39;, &amp;#39;ehlol&amp;#39;, &amp;#39;eholl&amp;#39;, &amp;#39;ollhe&amp;#39;, &amp;#39;lheol&amp;#39;, &amp;#39;lhoel&amp;#39;, &amp;#39;lehol&amp;#39;, &amp;#39;leohl&amp;#39;, &amp;#39;hoell&amp;#39;, &amp;#39;holel&amp;#39;, &amp;#39;eohll&amp;#39;, &amp;#39;eolhl&amp;#39;, &amp;#39;olhel&amp;#39;, &amp;#39;olehl&amp;#39;, &amp;#39;lhelo&amp;#39;, &amp;#39;lhleo&amp;#39;, &amp;#39;lehlo&amp;#39;, &amp;#39;lelho&amp;#39;, &amp;#39;hlelo&amp;#39;, &amp;#39;hlleo&amp;#39;, &amp;#39;elhlo&amp;#39;, &amp;#39;ellho&amp;#39;, &amp;#39;lhloe&amp;#39;, &amp;#39;lhole&amp;#39;, &amp;#39;leloh&amp;#39;, &amp;#39;leolh&amp;#39;, &amp;#39;hlloe&amp;#39;, &amp;#39;hlole&amp;#39;, &amp;#39;elloh&amp;#39;, &amp;#39;elolh&amp;#39;, &amp;#39;lohel&amp;#39;, &amp;#39;loehl&amp;#39;, &amp;#39;oelhl&amp;#39;, &amp;#39;elhol&amp;#39;, &amp;#39;ohlel&amp;#39;, &amp;#39;olleh&amp;#39;, &amp;#39;holle&amp;#39;, &amp;#39;eollh&amp;#39;, &amp;#39;olhle&amp;#39;, &amp;#39;olelh&amp;#39;, &amp;#39;ehllo&amp;#39;, &amp;#39;hello&amp;#39;, &amp;#39;ohlle&amp;#39;, &amp;#39;oellh&amp;#39;, &amp;#39;llheo&amp;#39;, &amp;#39;lleho&amp;#39;, &amp;#39;llhoe&amp;#39;, &amp;#39;lleoh&amp;#39;, &amp;#39;llohe&amp;#39;, &amp;#39;lloeh&amp;#39;, &amp;#39;oehll&amp;#39;, &amp;#39;elohl&amp;#39;, &amp;#39;lohle&amp;#39;, &amp;#39;loelh&amp;#39;, &amp;#39;lolhe&amp;#39;, &amp;#39;loleh&amp;#39;, &amp;#39;hleol&amp;#39;, &amp;#39;hloel&amp;#39;, &amp;#39;ohell&amp;#39;]&#xA;&#xA;#60&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-find-all-permutations-without-itertools&#34;&gt;How to Find all Permutations without Itertools&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def permutations(string):&#xA;    if len(string) == 1:&#xA;        return string&#xA;&#xA;    recursive_perms = []&#xA;    for c in string:&#xA;        for perm in permutations(string.replace(c,&amp;#39;&amp;#39;,1)):&#xA;            recursive_perms.append(c+perm)&#xA;&#xA;    return set(recursive_perms)&#xA;&#xA;perms = permutations(&amp;#39;hello&amp;#39;)&#xA;print(perms)&#xA;print(len(perms))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will give us 60 items:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Fix ‘no basic auth credentials’ with Docker and AWS ECR</title>
      <link>https://andrewodendaal.com/how-to-fix-no-basic-auth-credentials-with-docker-and-aws-ecr/</link>
      <pubDate>Sun, 25 Jul 2021 00:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-fix-no-basic-auth-credentials-with-docker-and-aws-ecr/</guid>
      <description>&lt;p&gt;If you are trying to push a Docker image to AWS ECR (Elastic Container Registry) and you get a &lt;code&gt;no basic auth credentials&lt;/code&gt; error. Then you can easily fix it as follows!&lt;/p&gt;&#xA;&lt;h2 id=&#34;replicating-the-no-basic-auth-credentials-error&#34;&gt;Replicating the &lt;code&gt;no basic auth credentials&lt;/code&gt; error&lt;/h2&gt;&#xA;&lt;p&gt;You ran something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;docker tag &amp;lt;image&amp;gt; &amp;lt;account&amp;gt;.dkr.ecr.&amp;lt;region&amp;gt;.amazonaws.com/&amp;lt;app&amp;gt;&#xA;docker push &amp;lt;image&amp;gt; &amp;lt;account&amp;gt;.dkr.ecr.&amp;lt;region&amp;gt;.amazonaws.com/&amp;lt;app&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You saw something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Using default tag: latest&#xA;The push refers to repository [&amp;lt;account&amp;gt;.dkr.ecr.&amp;lt;region&amp;gt;.amazonaws.com/&amp;lt;app&amp;gt;]&#xA;2e6d5f7bxxxx: Preparing&#xA;d8db3303xxxx: Preparing&#xA;32f366d6xxxx: Preparing&#xA;no basic auth credentials&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-fix-the-problem&#34;&gt;How to fix the problem&lt;/h2&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;code&gt;no basic auth credentials&lt;/code&gt; error&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Reverse Words or Sentences in Python</title>
      <link>https://andrewodendaal.com/how-to-reverse-words-or-sentences-in-python/</link>
      <pubDate>Sat, 24 Jul 2021 00:15:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reverse-words-or-sentences-in-python/</guid>
      <description>&lt;p&gt;Let&amp;rsquo;s take the following sentence:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;words = &amp;#34;These are some words&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We can use &lt;code&gt;slices&lt;/code&gt; to reverse the order of the string:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;print( words[::-1] )&#xA;#sdrow emos era esehT&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Let&amp;rsquo;s say we wanted to reverse each word in the sentence, but keep the order of words.&lt;/p&gt;&#xA;&lt;p&gt;We can once again use &lt;code&gt;slices&lt;/code&gt;, but we will compliment it with a &lt;code&gt;list comprehension&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;print( &amp;#34; &amp;#34;.join([word[::-1] for word in words.split(&amp;#34; &amp;#34;)]) )&#xA;#esehT era emos sdrow&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-reverse-words-without-using-inbuilt-modules&#34;&gt;How to Reverse words without using inbuilt modules&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s take this a bit further. Let&amp;rsquo;s say that we were not allowed to use our cool new &lt;code&gt;slice&lt;/code&gt; toy, how could we reverse a string?&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to solve AttributeError: ‘int’ object has no attribute ‘split’ – make: [sharedmods] Error 1</title>
      <link>https://andrewodendaal.com/how-to-solve-attributeerror-int-object-has-no-attribute-split-make-sharedmods-error-1/</link>
      <pubDate>Fri, 23 Jul 2021 02:23:06 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-attributeerror-int-object-has-no-attribute-split-make-sharedmods-error-1/</guid>
      <description>&lt;p&gt;If you get the following error while trying to install something via Homebrew&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;AttributeError: &#39;int&#39; object has no attribute &#39;split&#39; - make: *** [sharedmods] Error 1&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-to-this-homebrew-issue&#34;&gt;The solution to this Homebrew issue&lt;/h2&gt;&#xA;&lt;p&gt;First try to solve the actual Homebrew issues:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will then allow you to update:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;homebrew update&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;brew tap aws/tap&#xA;brew install aws-sam-cli&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;worst-case-scenario-solution&#34;&gt;Worst case scenario solution&lt;/h2&gt;&#xA;&lt;p&gt;Then you can solve it like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo rm -rf /Library/Developer/CommandLineTools&#xA;sudo xcode-select --install&#xA;brew doctor&#xA;brew update&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-the-error-looks&#34;&gt;How the error looks&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;==&amp;gt; Installing dependencies for aws/tap/aws-sam-cli: python@3.8&#xA;==&amp;gt; Installing aws/tap/aws-sam-cli dependency: python@3.8&#xA;==&amp;gt; ./configure --prefix=/usr/local/Cellar/python@3.8/3.8.6_2 --enable-ipv6 --datarootdir=/usr/local/Cellar/python@3.8/3.8.6_2/share --datadir=/usr/local/Cellar/python&#xA;==&amp;gt; make&#xA;Last 15 lines from ~/Library/Logs/Homebrew/python@3.8/02.make:&#xA;    self.run_command(cmd_name)&#xA;  File &amp;#34;/private/tmp/python@3.8-20210711-18033-10l0nkx/Python-3.8.6/Lib/distutils/cmd.py&amp;#34;, line 313, in run_command&#xA;    self.distribution.run_command(command)&#xA;  File &amp;#34;/private/tmp/python@3.8-20210711-18033-10l0nkx/Python-3.8.6/Lib/distutils/dist.py&amp;#34;, line 985, in run_command&#xA;    cmd_obj.run()&#xA;  File &amp;#34;/private/tmp/python@3.8-20210711-18033-10l0nkx/Python-3.8.6/Lib/distutils/command/build_ext.py&amp;#34;, line 340, in run&#xA;    self.build_extensions()&#xA;  File &amp;#34;./setup.py&amp;#34;, line 320, in build_extensions&#xA;    self.detect_modules()&#xA;  File &amp;#34;./setup.py&amp;#34;, line 1695, in detect_modules&#xA;    self.detect_readline_curses()&#xA;  File &amp;#34;./setup.py&amp;#34;, line 930, in detect_readline_curses&#xA;    (tuple(int(n) for n in dep_target.split(&amp;#39;.&amp;#39;)[0:2])&#xA;AttributeError: &amp;#39;int&amp;#39; object has no attribute &amp;#39;split&amp;#39;&#xA;make: *** [sharedmods] Error 1&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Push a Docker image to AWS ECR</title>
      <link>https://andrewodendaal.com/how-to-push-a-docker-image-to-aws-ecr/</link>
      <pubDate>Thu, 22 Jul 2021 01:34:22 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-push-a-docker-image-to-aws-ecr/</guid>
      <description>&lt;p&gt;By default, Docker pushes its images to Docker Hub.&lt;/p&gt;&#xA;&lt;p&gt;While Docker Hub is a great way to share both your public and private images, you may find the rest of your infrastructure on one of the prominent cloud providers.&lt;/p&gt;&#xA;&lt;p&gt;In this instance, you are using many of the other AWS resources, so why not use Elastic Container Registry – or ECR for short – instead?&lt;/p&gt;&#xA;&lt;p&gt;In this guide, we will replace &lt;code&gt;&amp;lt;region&amp;gt;&lt;/code&gt; with your desired region in AWS. That could look something like &lt;code&gt;eu-west-2&lt;/code&gt; or &lt;code&gt;us-east-1&lt;/code&gt; perhaps.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Complete Guide: How to Base64 Encode a String in Python | Python Base64 Encoding Explained</title>
      <link>https://andrewodendaal.com/how-to-base64-encode-a-string-in-python/</link>
      <pubDate>Wed, 21 Jul 2021 00:53:23 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-base64-encode-a-string-in-python/</guid>
      <description>&lt;h1 id=&#34;how-to-base64-encode-a-string-in-python-a-comprehensive-guide&#34;&gt;How to Base64 Encode a String in Python: A Comprehensive Guide&lt;/h1&gt;&#xA;&lt;p&gt;Welcome to our comprehensive guide on how to &lt;code&gt;python base64 encode&lt;/code&gt; a string in Python. Whether you&amp;rsquo;re a beginner or an experienced Python developer, this guide will equip you with the knowledge and techniques to perform efficient and accurate base64 encoding. Let&amp;rsquo;s dive in and explore the world of Python base64 encoding together!&lt;/p&gt;&#xA;&lt;h2 id=&#34;understanding-pythons-base64-module&#34;&gt;Understanding Python&amp;rsquo;s base64 Module&lt;/h2&gt;&#xA;&lt;p&gt;Python&amp;rsquo;s built-in &lt;code&gt;base64&lt;/code&gt; module provides a convenient way to encode and decode data using the base64 encoding scheme. Before we proceed, let&amp;rsquo;s ensure we have the &lt;code&gt;base64&lt;/code&gt; module imported:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Get 10 Random Numbers in Python</title>
      <link>https://andrewodendaal.com/how-to-get-10-random-numbers-in-python/</link>
      <pubDate>Tue, 20 Jul 2021 00:15:22 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-10-random-numbers-in-python/</guid>
      <description>&lt;p&gt;The &lt;code&gt;random&lt;/code&gt; module allows you to generate &lt;code&gt;choices&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import random&#xA;print(random.choices([i for i in range(1000)], k=10))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This might give us back something like:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;[635, 450, 26, 829, 786, 563, 294, 586, 893, 953]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;explaining-randomchoice-and-randomchoices&#34;&gt;Explaining &lt;code&gt;random.choice&lt;/code&gt; and &lt;code&gt;random.choices&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;random.choice&lt;/code&gt; takes a &lt;code&gt;sequence&lt;/code&gt; as a parameter and return a single random item from it.&lt;/p&gt;&#xA;&lt;p&gt;While &lt;code&gt;random.choices&lt;/code&gt; takes a sequence as a parameter and returns a few random items from it. You can specify how many random items to return by populating the &lt;code&gt;k=&lt;/code&gt; parameter, as above.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Get the Middle Character in Python</title>
      <link>https://andrewodendaal.com/get-the-middle-character-in-python/</link>
      <pubDate>Mon, 19 Jul 2021 00:03:49 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-the-middle-character-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Return the middle character of the word. If the word&amp;rsquo;s length is odd, return the middle character. If the word&amp;rsquo;s length is even, return the middle 2 characters.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples:&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;getMiddle(&amp;#34;test&amp;#34;) # should return &amp;#34;es&amp;#34;&#xA;getMiddle(&amp;#34;testing&amp;#34;) # should return &amp;#34;t&amp;#34;&#xA;getMiddle(&amp;#34;middle&amp;#34;) # should return &amp;#34;dd&amp;#34;&#xA;getMiddle(&amp;#34;A&amp;#34;) # should return &amp;#34;A&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;input&#34;&gt;Input&lt;/h3&gt;&#xA;&lt;p&gt;A word (string) of length &lt;code&gt;0 &amp;lt; str &amp;lt; 1000&lt;/code&gt; (In javascript you may get slightly more than 1000 in some test cases due to an error in the test cases). You do not need to test for this. This is only here to tell you that you do not need to worry about your solution timing out.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Convert String to Datetime in Python</title>
      <link>https://andrewodendaal.com/convert-string-to-datetime-in-python/</link>
      <pubDate>Sun, 18 Jul 2021 09:41:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/convert-string-to-datetime-in-python/</guid>
      <description>&lt;p&gt;If you have a &lt;code&gt;string&lt;/code&gt; and want to create a &lt;code&gt;Datetime&lt;/code&gt; object out of it in Python, then you can use the Datetime Parse Time method, as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from datetime import datetime&#xA;your_datetime = datetime.strptime(&amp;#39;May 31 2021  1:23PM&amp;#39;, &amp;#39;%Y-%m-%d&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;There are 2 very useful functions of &lt;code&gt;datetime&lt;/code&gt;, namely:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;strptime&lt;/code&gt; – Parse a string&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;strftime&lt;/code&gt; – Format a string&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;A common format you may be looking for is:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;%Y-%m-%d %H:%M:%S&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Abort SQL statements after a set time in MariaDB</title>
      <link>https://andrewodendaal.com/how-to-abort-sql-statements-after-a-set-time-in-mariadb/</link>
      <pubDate>Sat, 17 Jul 2021 00:47:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-abort-sql-statements-after-a-set-time-in-mariadb/</guid>
      <description>&lt;p&gt;Sometimes you don&amp;rsquo;t want a &lt;code&gt;SELECT&lt;/code&gt; query to run for more than a set amount of time.&lt;/p&gt;&#xA;&lt;p&gt;This is a roundabout way to make your server doesn&amp;rsquo;t die from slow-running queries.&lt;/p&gt;&#xA;&lt;p&gt;Obviously, you should tweak your database and potentially run your SELECT queries through an EXPLAIN plan first. This allows you to create appropriate indexes and find why things are slow in the first place.&lt;/p&gt;&#xA;&lt;p&gt;But: sometimes you still find yourself wanting to kill queries that may run over a certain amount of time.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Multiprocessing Pools in Python</title>
      <link>https://andrewodendaal.com/multiprocessing-pools-in-python/</link>
      <pubDate>Fri, 16 Jul 2021 01:18:53 +0000</pubDate>
      <guid>https://andrewodendaal.com/multiprocessing-pools-in-python/</guid>
      <description>&lt;p&gt;Python ships with a &lt;code&gt;multiprocessing&lt;/code&gt; module that allows your code to run functions in parallel by offloading calls to available processors.&lt;/p&gt;&#xA;&lt;p&gt;In this guide, we will explore the concept of Pools and what a &lt;code&gt;Pool&lt;/code&gt; in &lt;code&gt;multiprocessing&lt;/code&gt; is.&lt;/p&gt;&#xA;&lt;h2 id=&#34;a-python-snippet-to-play-with&#34;&gt;A Python snippet to play with&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s take the following code.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import random, time&#xA;&#xA;def calculate_something(i):&#xA;    time.sleep(5)&#xA;    print(random.randint(10, 100)*i)&#xA;&#xA;for i in range(5):&#xA;   calculate_something(i)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This function will take about 5*5seconds to complete (25seconds?)&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Double Characters in Python</title>
      <link>https://andrewodendaal.com/how-to-double-characters-in-python/</link>
      <pubDate>Thu, 15 Jul 2021 01:08:33 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-double-characters-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a string, you have to return a string in which each character (case-sensitive) is repeated once.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;double_char(&amp;#34;String&amp;#34;) ==&amp;gt; &amp;#34;SSttrriinngg&amp;#34;&#xA;&#xA;double_char(&amp;#34;Hello World&amp;#34;) ==&amp;gt; &amp;#34;HHeelllloo  WWoorrlldd&amp;#34;&#xA;&#xA;double_char(&amp;#34;1234!_ &amp;#34;) ==&amp;gt; &amp;#34;11223344!!__  &amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;This can easily be done by looping through each character and appending it to a list, which we then join and return at the end:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def double_char(s):&#xA;    out = []&#xA;    for i in s:&#xA;        out.append(i+&amp;#34;&amp;#34;+i)&#xA;    return &amp;#34;&amp;#34;.join(out)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;However, we could simplify this down to a single list comprehension:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Reverse Words in Python</title>
      <link>https://andrewodendaal.com/how-to-reverse-words-in-python/</link>
      <pubDate>Wed, 14 Jul 2021 00:55:31 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reverse-words-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the function that accepts a string parameter, and reverses each word in the string. &lt;strong&gt;All&lt;/strong&gt; spaces in the string should be retained.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;This is an example!&amp;#34; ==&amp;gt; &amp;#34;sihT si na !elpmaxe&amp;#34;&#xA;&amp;#34;double  spaces&amp;#34;      ==&amp;gt; &amp;#34;elbuod  secaps&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def reverse_words(text):&#xA;    out = []&#xA;    for word in text.split(&amp;#34; &amp;#34;):&#xA;        out.append(word[::-1])&#xA;    return &amp;#34; &amp;#34;.join(out)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def reverse_words(str):&#xA;    return &amp;#39; &amp;#39;.join(s[::-1] for s in str.split(&amp;#39; &amp;#39;))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Count by X in Python</title>
      <link>https://andrewodendaal.com/how-to-count-by-x-in-python/</link>
      <pubDate>Tue, 13 Jul 2021 00:45:44 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-count-by-x-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function with two arguments that will return an array of the first (n) multiples of (x).&lt;/p&gt;&#xA;&lt;p&gt;Assume both the given number and the number of times to count will be positive numbers greater than 0.&lt;/p&gt;&#xA;&lt;p&gt;Return the results as a list.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;count_by(1,10) #should return [1,2,3,4,5,6,7,8,9,10]&#xA;count_by(2,5) #should return [2,4,6,8,10]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def count_by(x, n):&#xA;    out = []&#xA;    for i in range(n):&#xA;        out.append(x*(i+1))&#xA;    return out&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calculate the Sum of Pairs in Python</title>
      <link>https://andrewodendaal.com/calculate-the-sum-of-pairs-in-python/</link>
      <pubDate>Mon, 12 Jul 2021 00:01:55 +0000</pubDate>
      <guid>https://andrewodendaal.com/calculate-the-sum-of-pairs-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a list of integers and a single sum value, return the first two values (parse from the left please) in order of appearance that add up to form the sum.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sum_pairs([11, 3, 7, 5],         10)&#xA;#              ^--^      3 + 7 = 10&#xA;== [3, 7]&#xA;&#xA;sum_pairs([4, 3, 2, 3, 4],         6)&#xA;#          ^-----^         4 + 2 = 6, indices: 0, 2 *&#xA;#             ^-----^      3 + 3 = 6, indices: 1, 3&#xA;#                ^-----^   2 + 4 = 6, indices: 2, 4&#xA;#  * entire pair is earlier, and therefore is the correct answer&#xA;== [4, 2]&#xA;&#xA;sum_pairs([0, 0, -2, 3], 2)&#xA;#  there are no pairs of values that can be added to produce 2.&#xA;== None/nil/undefined (Based on the language)&#xA;&#xA;sum_pairs([10, 5, 2, 3, 7, 5],         10)&#xA;#              ^-----------^   5 + 5 = 10, indices: 1, 5&#xA;#                    ^--^      3 + 7 = 10, indices: 3, 4 *&#xA;#  * entire pair is earlier, and therefore is the correct answer&#xA;== [3, 7]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Negative numbers and duplicate numbers can and will appear.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to break a list into multiple lists (with maximum size) in Python</title>
      <link>https://andrewodendaal.com/how-to-break-a-list-into-multiple-lists-with-maximum-size-in-python/</link>
      <pubDate>Sun, 11 Jul 2021 00:20:20 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-break-a-list-into-multiple-lists-with-maximum-size-in-python/</guid>
      <description>&lt;p&gt;If you have a large list and want to create smaller lists of it, with a maximum amount of elements, then:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;commands = [str(i) for i in range(100)]&#xA;print(len(commands)) #100&#xA;&#xA;chunks = [commands[x:x+5] for x in range(0, len(commands), 5)]&#xA;&#xA;print(len(chunks)) #20&#xA;print(chunks)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will look like:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[&#xA;[&amp;#39;0&amp;#39;, &amp;#39;1&amp;#39;, &amp;#39;2&amp;#39;, &amp;#39;3&amp;#39;, &amp;#39;4&amp;#39;], &#xA;[&amp;#39;5&amp;#39;, &amp;#39;6&amp;#39;, &amp;#39;7&amp;#39;, &amp;#39;8&amp;#39;, &amp;#39;9&amp;#39;], &#xA;[&amp;#39;10&amp;#39;, &amp;#39;11&amp;#39;, &amp;#39;12&amp;#39;, &amp;#39;13&amp;#39;, &amp;#39;14&amp;#39;], &#xA;[&amp;#39;15&amp;#39;, &amp;#39;16&amp;#39;, &amp;#39;17&amp;#39;, &amp;#39;18&amp;#39;, &amp;#39;19&amp;#39;], &#xA;[&amp;#39;20&amp;#39;, &amp;#39;21&amp;#39;, &amp;#39;22&amp;#39;, &amp;#39;23&amp;#39;, &amp;#39;24&amp;#39;], &#xA;[&amp;#39;25&amp;#39;, &amp;#39;26&amp;#39;, &amp;#39;27&amp;#39;, &amp;#39;28&amp;#39;, &amp;#39;29&amp;#39;], &#xA;[&amp;#39;30&amp;#39;, &amp;#39;31&amp;#39;, &amp;#39;32&amp;#39;, &amp;#39;33&amp;#39;, &amp;#39;34&amp;#39;], &#xA;[&amp;#39;35&amp;#39;, &amp;#39;36&amp;#39;, &amp;#39;37&amp;#39;, &amp;#39;38&amp;#39;, &amp;#39;39&amp;#39;], &#xA;[&amp;#39;40&amp;#39;, &amp;#39;41&amp;#39;, &amp;#39;42&amp;#39;, &amp;#39;43&amp;#39;, &amp;#39;44&amp;#39;], &#xA;[&amp;#39;45&amp;#39;, &amp;#39;46&amp;#39;, &amp;#39;47&amp;#39;, &amp;#39;48&amp;#39;, &amp;#39;49&amp;#39;], &#xA;[&amp;#39;50&amp;#39;, &amp;#39;51&amp;#39;, &amp;#39;52&amp;#39;, &amp;#39;53&amp;#39;, &amp;#39;54&amp;#39;], &#xA;[&amp;#39;55&amp;#39;, &amp;#39;56&amp;#39;, &amp;#39;57&amp;#39;, &amp;#39;58&amp;#39;, &amp;#39;59&amp;#39;], &#xA;[&amp;#39;60&amp;#39;, &amp;#39;61&amp;#39;, &amp;#39;62&amp;#39;, &amp;#39;63&amp;#39;, &amp;#39;64&amp;#39;], &#xA;[&amp;#39;65&amp;#39;, &amp;#39;66&amp;#39;, &amp;#39;67&amp;#39;, &amp;#39;68&amp;#39;, &amp;#39;69&amp;#39;], &#xA;[&amp;#39;70&amp;#39;, &amp;#39;71&amp;#39;, &amp;#39;72&amp;#39;, &amp;#39;73&amp;#39;, &amp;#39;74&amp;#39;], &#xA;[&amp;#39;75&amp;#39;, &amp;#39;76&amp;#39;, &amp;#39;77&amp;#39;, &amp;#39;78&amp;#39;, &amp;#39;79&amp;#39;], &#xA;[&amp;#39;80&amp;#39;, &amp;#39;81&amp;#39;, &amp;#39;82&amp;#39;, &amp;#39;83&amp;#39;, &amp;#39;84&amp;#39;], &#xA;[&amp;#39;85&amp;#39;, &amp;#39;86&amp;#39;, &amp;#39;87&amp;#39;, &amp;#39;88&amp;#39;, &amp;#39;89&amp;#39;], &#xA;[&amp;#39;90&amp;#39;, &amp;#39;91&amp;#39;, &amp;#39;92&amp;#39;, &amp;#39;93&amp;#39;, &amp;#39;94&amp;#39;], &#xA;[&amp;#39;95&amp;#39;, &amp;#39;96&amp;#39;, &amp;#39;97&amp;#39;, &amp;#39;98&amp;#39;, &amp;#39;99&amp;#39;]&#xA;]&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Get all dates between two dates inclusive in Python</title>
      <link>https://andrewodendaal.com/get-all-dates-between-two-dates-inclusive-in-python/</link>
      <pubDate>Sat, 10 Jul 2021 00:38:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-all-dates-between-two-dates-inclusive-in-python/</guid>
      <description>&lt;p&gt;If you want to print out a list of all dates between 2 dates (a date range), then you can use the following script:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from datetime import date, timedelta&#xA;&#xA;start_date = date(2021, 5, 31)&#xA;end_date = date(2021, 7, 28)&#xA;&#xA;delta = end_date - start_date&#xA;&#xA;for i in range(delta.days + 1):&#xA;    day = start_date + timedelta(days=i)&#xA;    print(day)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will result in the following range:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;2021-05-31&#xA;2021-06-01&#xA;...&#xA;2021-07-27&#xA;2021-07-28&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To make sure that you get the format you want back:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Append a Python Dictionary to a Pandas DataFrame</title>
      <link>https://andrewodendaal.com/how-to-append-a-python-dictionary-to-a-pandas-dataframe/</link>
      <pubDate>Fri, 09 Jul 2021 00:24:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-append-a-python-dictionary-to-a-pandas-dataframe/</guid>
      <description>&lt;p&gt;If you want to append a Python dictionary to a Pandas DataFrame, you can do this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;# Create a new DataFrame&#xA;output = pd.DataFrame()&#xA;&#xA;# Append the dictionary by ignoring the index&#xA;output = output.append(dictionary, ignore_index=True)&#xA;&#xA;# View the new DataFrame&#xA;print(output.head())&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Notice the reassignment &lt;code&gt;output = output.append(...)&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Get Secret from AWS Secrets Manager in Python</title>
      <link>https://andrewodendaal.com/get-secret-from-aws-secrets-manager-in-python/</link>
      <pubDate>Thu, 08 Jul 2021 00:57:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-secret-from-aws-secrets-manager-in-python/</guid>
      <description>&lt;p&gt;You can store secrets in AWS Secret Manager and reference their ARN in AWS Systems Secret Manager.&lt;/p&gt;&#xA;&lt;p&gt;The below snippet allows you to specify the associated &lt;code&gt;parameter&lt;/code&gt; to get the secret value.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import boto3&#xA;&#xA;ssm = boto3.client(&amp;#39;ssm&amp;#39;)&#xA;secretsmanager = boto3.client(&amp;#39;secretsmanager&amp;#39;)&#xA;&#xA;parameter = ssm.get_parameter(Name=&amp;#34;/your/parameter/name&amp;#34;, WithDecryption=True)&#xA;secret = secretsmanager.get_secret_value(SecretId=parameter[&amp;#39;Parameter&amp;#39;][&amp;#39;Value&amp;#39;])&#xA;secret = json.loads(secret[&amp;#39;SecretString&amp;#39;])&#xA;&#xA;print(secret)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to do Binary Addition in Python</title>
      <link>https://andrewodendaal.com/how-to-do-binary-addition-in-python/</link>
      <pubDate>Wed, 07 Jul 2021 01:02:35 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-do-binary-addition-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Implement a function that adds two numbers together and returns their sum in binary. The conversion can be done before or after the addition.&lt;/p&gt;&#xA;&lt;p&gt;The binary number returned should be a string.&lt;/p&gt;&#xA;&lt;p&gt;Examples:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;add_binary(1, 1) == &amp;#34;10&amp;#34; (1 + 1 = 2 in decimal or 10 in binary)&#xA;add_binary(5, 9) == &amp;#34;1110&amp;#34; (5 + 9 = 14 in decimal or 1110 in binary)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;There are multiple ways to solve an &lt;code&gt;int to binary string&lt;/code&gt; problem in Python.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Auto-Adjust Excel column widths with pandas.ExcelWriter</title>
      <link>https://andrewodendaal.com/how-to-auto-adjust-excel-column-widths-with-pandas-excelwriter/</link>
      <pubDate>Tue, 06 Jul 2021 00:05:07 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-auto-adjust-excel-column-widths-with-pandas-excelwriter/</guid>
      <description>&lt;p&gt;You have successfully written your &lt;code&gt;pandas&lt;/code&gt; &lt;code&gt;Dataframe&lt;/code&gt; to an Excel file, but when you open it, all the columns are squashed up against each other.&lt;/p&gt;&#xA;&lt;p&gt;There is an easy fix to auto-adjusting your column widths.&lt;/p&gt;&#xA;&lt;h2 id=&#34;auto-adjusting-column-widths-in-pandas&#34;&gt;Auto Adjusting Column Widths in Pandas&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;writer = pd.ExcelWriter(&amp;#39;file.xlsx&amp;#39;) &#xA;df.to_excel(writer, sheet_name=&amp;#39;sheetName&amp;#39;, index=False, na_rep=&amp;#39;NaN&amp;#39;)&#xA;&#xA;for column in df:&#xA;    column_length = max(df[column].astype(str).map(len).max(), len(column))&#xA;    col_idx = df.columns.get_loc(column)&#xA;    writer.sheets[&amp;#39;sheetName&amp;#39;].set_column(col_idx, col_idx, column_length)&#xA;&#xA;writer.save()&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Sort the Odd in Python</title>
      <link>https://andrewodendaal.com/how-to-sort-the-odd-in-python/</link>
      <pubDate>Mon, 05 Jul 2021 00:28:30 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-sort-the-odd-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You will be given an array of numbers. You have to sort the odd numbers in ascending order while leaving the even numbers at their original positions.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[7, 1]  =&amp;gt;  [1, 7]&#xA;[5, 8, 6, 3, 4]  =&amp;gt;  [3, 8, 6, 5, 4]&#xA;[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]  =&amp;gt;  [1, 8, 3, 6, 5, 4, 7, 2, 9, 0]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calculate the Sum of the two lowest positive integers in Python</title>
      <link>https://andrewodendaal.com/calculate-the-sum-of-the-two-lowest-positive-integers-in-python/</link>
      <pubDate>Sun, 04 Jul 2021 01:41:16 +0000</pubDate>
      <guid>https://andrewodendaal.com/calculate-the-sum-of-the-two-lowest-positive-integers-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function that returns the sum of the two lowest positive numbers given an array of minimum 4 positive integers. No floats or non-positive integers will be passed.&lt;/p&gt;&#xA;&lt;p&gt;For example, when an array is passed like &lt;code&gt;[19, 5, 42, 2, 77]&lt;/code&gt;, the output should be &lt;code&gt;7&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;[10, 343445353, 3453445, 3453545353453]&lt;/code&gt; should return &lt;code&gt;3453455&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def sum_two_smallest_numbers(numbers):&#xA;    return sum(sorted(numbers)[:2])&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def sum_two_smallest_numbers(num_list):&#xA;    num_list.sort()&#xA;    return num_list[0] + num_list[1]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Unique In Order in Python</title>
      <link>https://andrewodendaal.com/unique-in-order-in-python/</link>
      <pubDate>Sat, 03 Jul 2021 00:42:52 +0000</pubDate>
      <guid>https://andrewodendaal.com/unique-in-order-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Implement the function &lt;code&gt;unique_in_order&lt;/code&gt; which takes as argument a sequence and returns a list of items without any elements with the same value next to each other and preserving the original order of elements.&lt;/p&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;unique_in_order(&amp;#39;AAAABBBCCDAABBB&amp;#39;) == [&amp;#39;A&amp;#39;, &amp;#39;B&amp;#39;, &amp;#39;C&amp;#39;, &amp;#39;D&amp;#39;, &amp;#39;A&amp;#39;, &amp;#39;B&amp;#39;]&#xA;unique_in_order(&amp;#39;ABBCcAD&amp;#39;)         == [&amp;#39;A&amp;#39;, &amp;#39;B&amp;#39;, &amp;#39;C&amp;#39;, &amp;#39;c&amp;#39;, &amp;#39;A&amp;#39;, &amp;#39;D&amp;#39;]&#xA;unique_in_order([1,2,2,3,3])       == [1,2,3]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def unique_in_order(iterable):&#xA;    result = []&#xA;    prev = None&#xA;    for char in iterable[0:]:&#xA;        if char != prev:&#xA;            result.append(char)&#xA;            prev = char&#xA;    return result&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Change the Hostname on Linux</title>
      <link>https://andrewodendaal.com/how-to-change-the-hostname-on-linux/</link>
      <pubDate>Fri, 02 Jul 2021 00:10:36 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-change-the-hostname-on-linux/</guid>
      <description>&lt;p&gt;On Linux, you can change the &lt;code&gt;hostname&lt;/code&gt; by using the &lt;code&gt;hostnamectl&lt;/code&gt; command.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-set-the-hostname-on-linux&#34;&gt;How to Set the Hostname on Linux&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo hostnamectl set-hostname &amp;lt;new-hostname&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo hostnamectl set-hostname server1&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;At this point, you will need to logout and back in to see the changes have taken effect.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Deploy a Docker Container to Kubernetes</title>
      <link>https://andrewodendaal.com/how-to-deploy-a-docker-container-to-kubernetes/</link>
      <pubDate>Thu, 01 Jul 2021 00:05:23 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-deploy-a-docker-container-to-kubernetes/</guid>
      <description>&lt;p&gt;Once you have a Docker container, it is really simple to &lt;a href=&#34;https://andrewodendaal.com/teach-me-kubernetes-part6-deployments&#34;&gt;deploy containers to Kubernetes&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;generate-a-deployment-yaml&#34;&gt;Generate a Deployment YAML&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;kubectl&lt;/code&gt; provides a fantastic way to help generate deployment yamls.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl create deployment &amp;lt;app_name&amp;gt; --image=&amp;lt;some/image&amp;gt; --dry-run=client -o yaml &amp;gt; &amp;lt;deployment_file_name&amp;gt;.yaml&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;perform-the-deployment&#34;&gt;Perform the Deployment&lt;/h2&gt;&#xA;&lt;p&gt;Now that we have a deployment yaml, we can simply run:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl apply -f &amp;lt;deployment_file_name&amp;gt;.yaml&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;what-next&#34;&gt;What next?&lt;/h2&gt;&#xA;&lt;p&gt;Next you might want to add a Service so that the deployment is available to the world.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Replace Characters with Alphabet Positions in Python</title>
      <link>https://andrewodendaal.com/how-to-replace-characters-with-alphabet-positions-in-python/</link>
      <pubDate>Wed, 30 Jun 2021 00:11:48 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-replace-characters-with-alphabet-positions-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a string, replace every letter with its position in the alphabet.&lt;/p&gt;&#xA;&lt;p&gt;If anything in the text isn&amp;rsquo;t a letter, ignore it and don&amp;rsquo;t return it.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;&amp;quot;a&amp;quot; = 1&lt;/code&gt;, &lt;code&gt;&amp;quot;b&amp;quot; = 2&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;alphabet_position(&amp;#34;The sunset sets at twelve o&amp;#39;clock.&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Should return &lt;code&gt;&amp;quot;20 8 5 19 21 14 19 5 20 19 5 20 19 1 20 20 23 5 12 22 5 15 3 12 15 3 11&amp;quot;&lt;/code&gt; (as a string)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Returning Highest and Lowest in Python</title>
      <link>https://andrewodendaal.com/returning-highest-and-lowest-in-python/</link>
      <pubDate>Tue, 29 Jun 2021 00:03:56 +0000</pubDate>
      <guid>https://andrewodendaal.com/returning-highest-and-lowest-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given a string of space-separated numbers and have to return the highest and lowest number.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;high_and_low(&amp;#34;1 2 3 4 5&amp;#34;)  # return &amp;#34;5 1&amp;#34;&#xA;high_and_low(&amp;#34;1 2 -3 4 5&amp;#34;) # return &amp;#34;5 -3&amp;#34;&#xA;high_and_low(&amp;#34;1 9 3 4 -5&amp;#34;) # return &amp;#34;9 -5&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;All numbers are valid &lt;code&gt;Int32&lt;/code&gt;, no &lt;em&gt;need&lt;/em&gt; to validate them.&lt;/li&gt;&#xA;&lt;li&gt;There will always be at least one number in the input string.&lt;/li&gt;&#xA;&lt;li&gt;Output string must be two numbers separated by a single space, and highest number is first.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Subtract Arrays in Python</title>
      <link>https://andrewodendaal.com/how-to-subtract-arrays-in-python/</link>
      <pubDate>Mon, 28 Jun 2021 00:07:51 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-subtract-arrays-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Implement a difference function, which subtracts one list from another and returns the result.&lt;/p&gt;&#xA;&lt;p&gt;It should remove all values from list &lt;code&gt;a&lt;/code&gt;, which are present in list &lt;code&gt;b&lt;/code&gt; keeping their order.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;arrayDiff([1,2],[1]) == [2]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If a value is present in &lt;code&gt;b&lt;/code&gt;, all of its occurrences must be removed from the other:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;arrayDiff([1,2,2,2,3],[2]) == [1,3]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python&#34;&gt;The solution in Python&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def array_diff(a, b):&#xA;    return [x for x in a if x not in b]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Detect if Numbers are in Order in Golang</title>
      <link>https://andrewodendaal.com/how-to-detect-if-numbers-are-in-order-in-golang/</link>
      <pubDate>Sun, 27 Jun 2021 00:01:55 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-detect-if-numbers-are-in-order-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In this challenge, your function receives an array of integers as input. Your task is to determine whether the numbers are in ascending order. An array is said to be in ascending order if there are no two adjacent integers where the left integer exceeds the right integer in value.&lt;/p&gt;&#xA;&lt;p&gt;For the purposes of this challenge, you may assume that all inputs are valid, i.e. non-empty arrays containing only integers.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Alternate Capitalization in Golang</title>
      <link>https://andrewodendaal.com/alternate-capitalization-in-golang/</link>
      <pubDate>Sat, 26 Jun 2021 00:06:33 +0000</pubDate>
      <guid>https://andrewodendaal.com/alternate-capitalization-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a string, capitalize the letters that occupy even indexes and odd indexes separately, and return as shown below. Index `` will be considered even.&lt;/p&gt;&#xA;&lt;p&gt;For example, &lt;code&gt;capitalize(&amp;quot;abcdef&amp;quot;) = [&#39;AbCdEf&#39;, &#39;aBcDeF&#39;]&lt;/code&gt;. See test cases for more examples.&lt;/p&gt;&#xA;&lt;p&gt;The input will be a lowercase string with no spaces.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;&#xA;import &amp;#34;unicode&amp;#34;&#xA;&#xA;func Capitalize(s string) []string {&#xA;  a, b := []rune(s),[]rune(s)&#xA;  for i := range a {&#xA;    if i%2 == 0 {&#xA;      a[i] = unicode.ToUpper(a[i])&#xA;    } else {&#xA;      b[i] = unicode.ToUpper(b[i])&#xA;    }&#xA;  }&#xA;  return []string{string(a), string(b)}&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Check if a String is Uppercase in Golang</title>
      <link>https://andrewodendaal.com/check-if-a-string-is-uppercase-in-golang/</link>
      <pubDate>Fri, 25 Jun 2021 00:05:07 +0000</pubDate>
      <guid>https://andrewodendaal.com/check-if-a-string-is-uppercase-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a method &lt;code&gt;IsUpperCase&lt;/code&gt; to see whether the string is ALL CAPS. For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;type MyString string&#xA;MyString(&amp;#34;c&amp;#34;).IsUpperCase() == false&#xA;MyString(&amp;#34;C&amp;#34;).IsUpperCase() == true&#xA;MyString(&amp;#34;hello I AM DONALD&amp;#34;).IsUpperCase() == false&#xA;MyString(&amp;#34;HELLO I AM DONALD&amp;#34;).IsUpperCase() == true&#xA;MyString(&amp;#34;ACSKLDFJSgSKLDFJSKLDFJ&amp;#34;).IsUpperCase() == false&#xA;MyString(&amp;#34;ACSKLDFJSGSKLDFJSKLDFJ&amp;#34;).IsUpperCase() == true&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this challenge, a string is said to be in ALL CAPS whenever it does not contain any lowercase letter so any string containing no letters at all is trivially considered to be in ALL CAPS.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to UpperCase a String in Golang</title>
      <link>https://andrewodendaal.com/how-to-uppercase-a-string-in-golang/</link>
      <pubDate>Thu, 24 Jun 2021 01:19:20 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-uppercase-a-string-in-golang/</guid>
      <description>&lt;p&gt;In Go, there are multiple ways to make a &lt;code&gt;string&lt;/code&gt; UpperCase, each of them are by using the &lt;code&gt;strings&lt;/code&gt; package.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-stringstoupper&#34;&gt;Option 1 (&lt;code&gt;strings.ToUpper&lt;/code&gt;):&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;func ToUpper(str string) string&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;&#xA;import (&#xA;    &amp;#34;fmt&amp;#34;&#xA;    &amp;#34;strings&amp;#34;&#xA;)&#xA;&#xA;func main() {&#xA;    str1 := &amp;#34;This is a Test&amp;#34;&#xA;    fmt.Println(strings.ToUpper(str1))&#xA;&#xA;    // &amp;#34;THIS IS A TEST&amp;#34;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2-stringstotitle&#34;&gt;Option 2 (&lt;code&gt;strings.ToTitle&lt;/code&gt;):&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;func ToTitle(str string) string&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package main&#xA;&#xA;import (&#xA;    &amp;#34;fmt&amp;#34;&#xA;    &amp;#34;strings&amp;#34;&#xA;)&#xA;&#xA;func main() {&#xA;    str1 := &amp;#34;This is a Test&amp;#34;&#xA;    fmt.Println(strings.ToTitle(str1))&#xA;&#xA;    // &amp;#34;THIS IS A TEST&amp;#34;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Return the Shortest Words in Golang</title>
      <link>https://andrewodendaal.com/return-the-shortest-words-in-golang/</link>
      <pubDate>Wed, 23 Jun 2021 00:38:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/return-the-shortest-words-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a string of words, return the length of the shortest word(s).&lt;/p&gt;&#xA;&lt;p&gt;The input string will never be empty and you do not need to account for different data types.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;import &amp;#34;strings&amp;#34;&#xA;&#xA;func FindShort(s string) int {&#xA;  shortest := len(s)&#xA;  for _, word := range strings.Split(s, &amp;#34; &amp;#34;) {&#xA;    if len(word) &amp;lt; shortest {&#xA;      shortest = len(word)&#xA;    }&#xA;  }&#xA;  return shortest&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve Pascal’s Triangle in Python</title>
      <link>https://andrewodendaal.com/how-to-solve-pascals-triangle-in-python/</link>
      <pubDate>Tue, 22 Jun 2021 00:56:16 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-pascals-triangle-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an integer &lt;code&gt;numRows&lt;/code&gt;, return the first numRows of &lt;strong&gt;Pascal&amp;rsquo;s triangle&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In &lt;strong&gt;Pascal&amp;rsquo;s triangle&lt;/strong&gt;, each number is the sum of the two numbers directly above it as shown:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2021/06/PascalTriangleAnimated2.gif&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Constraints:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;1 &amp;lt;= numRows &amp;lt;= 30&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution:&#xA;    def generate(self, numRows: int) -&amp;gt; List[List[int]]:&#xA;        triangle = [[1]]&#xA;        &#xA;        for j in range(1, numRows):&#xA;            prev = triangle[-1]&#xA;            triangle.append([1] + [prev[i]+prev[i+1] for i in range(len(prev)-1)] + [1])&#xA;            &#xA;        return triangle&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Creating a Multiplication Table for a Number in Golang</title>
      <link>https://andrewodendaal.com/creating-a-multiplication-table-for-a-number-in-golang/</link>
      <pubDate>Mon, 21 Jun 2021 00:41:35 +0000</pubDate>
      <guid>https://andrewodendaal.com/creating-a-multiplication-table-for-a-number-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Your goal is to return multiplication table for &lt;code&gt;number&lt;/code&gt; that is always an integer from 1 to 10.&lt;/p&gt;&#xA;&lt;p&gt;For example, a multiplication table (string) for &lt;code&gt;number == 5&lt;/code&gt; looks like below:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;1 * 5 = 5&#xA;2 * 5 = 10&#xA;3 * 5 = 15&#xA;4 * 5 = 20&#xA;5 * 5 = 25&#xA;6 * 5 = 30&#xA;7 * 5 = 35&#xA;8 * 5 = 40&#xA;9 * 5 = 45&#xA;10 * 5 = 50&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;P. S. You can use &lt;code&gt;\n&lt;/code&gt; in string to jump to the next line.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Remove Duplicates in an Array in Golang</title>
      <link>https://andrewodendaal.com/how-to-remove-duplicates-in-an-array-in-golang/</link>
      <pubDate>Sun, 20 Jun 2021 00:04:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-remove-duplicates-in-an-array-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Remove the left-most duplicates from a list of integers and return the result.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// Remove the 3&amp;#39;s at indices 0 and 3&#xA;// followed by removing a 4 at index 1&#xA;solve([3, 4, 4, 3, 6, 3]); // =&amp;gt; [4, 6, 3]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution &#xA;&#xA;func Solve(arr []int) (res []int) {&#xA;    visited := map[int]bool{}&#xA;    for i := len(arr) - 1; i &amp;gt;= 0; i-- {&#xA;        n := arr[i]&#xA;        if visited[n] { continue }&#xA;      &#xA;        visited[n] = true&#xA;        res = append([]int{n}, res...)&#xA;    }&#xA;  &#xA;    return&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Dry Potatoes in Golang</title>
      <link>https://andrewodendaal.com/how-to-dry-potatoes-in-golang/</link>
      <pubDate>Sat, 19 Jun 2021 00:04:33 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-dry-potatoes-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;All we eat is water and dry matter.&lt;/p&gt;&#xA;&lt;p&gt;John bought potatoes: their weight is 100 kilograms. Potatoes contain water and dry matter.&lt;/p&gt;&#xA;&lt;p&gt;The water content is 99 percent of the total weight. He thinks they are too wet and puts them in an oven – at low temperature – for them to lose some water.&lt;/p&gt;&#xA;&lt;p&gt;At the output the water content is only 98%.&lt;/p&gt;&#xA;&lt;p&gt;What is the total weight in kilograms (water content plus dry matter) coming out of the oven?&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Reverse or Rotate in Golang</title>
      <link>https://andrewodendaal.com/how-to-reverse-or-rotate-in-golang/</link>
      <pubDate>Fri, 18 Jun 2021 00:18:38 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reverse-or-rotate-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The input is a string &lt;code&gt;str&lt;/code&gt; of digits. Cut the string into chunks (a chunk here is a substring of the initial string) of size &lt;code&gt;sz&lt;/code&gt; (ignore the last chunk if its size is less than &lt;code&gt;sz&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;If a chunk represents an integer such as the &lt;strong&gt;sum of the cubes of its digits is divisible by 2&lt;/strong&gt;, reverse that chunk; otherwise rotate it to the left by one position. Put together these modified chunks and return the result as a string.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to use Coroutines in Kotlin</title>
      <link>https://andrewodendaal.com/how-to-use-coroutines-in-kotlin/</link>
      <pubDate>Thu, 17 Jun 2021 00:09:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-use-coroutines-in-kotlin/</guid>
      <description>&lt;p&gt;Coroutines are a way to handle multithreading in Kotlin, read more about it from the official docs:&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;https://kotlinlang.org/docs/coroutines-overview.html&#34;&gt;https://kotlinlang.org/docs/coroutines-overview.html&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;an-example-of-a-coroutine-in-kotlin&#34;&gt;An example of a Coroutine in Kotlin&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;val runBlocking = runBlocking {&#xA;  sleep(5)&#xA;  delay(1_000L)&#xA;  launch {&#xA;    delay(1_100L)&#xA;    note(&amp;#34;inside launch&amp;#34;)&#xA;  }&#xA;  note(&amp;#34;outside launch&amp;#34;)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;introducing-the-suspend-keyword&#34;&gt;Introducing the &lt;code&gt;suspend&lt;/code&gt; keyword&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;coroutineScopes&lt;/code&gt; need to be in wrapping &lt;code&gt;suspend&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;suspend fun coroutineFunction(): String {&#xA;  return coroutineScope {&#xA;    launch {&#xA;      println(&amp;#34;test&amp;#34;)&#xA;    }&#xA;    &amp;#34;we return this string&amp;#34;&#xA;  }&#xA;}&#xA;&#xA;runBlocking { println(coroutineFunction()) }&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;making-asynchronous-api-calls-using-coroutines&#34;&gt;Making Asynchronous API calls using Coroutines&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;suspend fun call2Apis() {&#xA;  val call1 = async {&#xA;    delay(1_000L)&#xA;    println(&amp;#34;got data from api1 @ ${Instant.now()}&amp;#34;)&#xA;    &amp;#34;some data from api1&amp;#34;&#xA;  }&#xA;  val call2 = async P&#xA;    delay(1_500L)&#xA;    println(&amp;#34;got data from api2 @ ${Instant.now()}&amp;#34;)&#xA;    &amp;#34;some data from api2&amp;#34;&#xA;  }&#xA;&#xA;  println(call1.await() + &amp;#34; ${Instant.now()}&amp;#34;)&#xA;  println(call2.await() + &amp;#34; ${Instant.now()}&amp;#34;)&#xA;&#xA;}&#xA;&#xA;runBlocking { call2Apis() }&#xA;sleep(2)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;sharing-states-between-coroutines&#34;&gt;Sharing states between Coroutines&lt;/h2&gt;&#xA;&lt;p&gt;Simply return a &lt;code&gt;coroutineScope&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Pair Type in Kotlin</title>
      <link>https://andrewodendaal.com/the-pair-type-in-kotlin/</link>
      <pubDate>Wed, 16 Jun 2021 00:10:11 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-pair-type-in-kotlin/</guid>
      <description>&lt;p&gt;&lt;code&gt;val pair: Pair&amp;lt;String, Int&amp;gt; = &amp;quot;myKey&amp;quot; to 2&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-a-pair-type&#34;&gt;What is a Pair Type?&lt;/h2&gt;&#xA;&lt;p&gt;A utility class when you want to return 2 values that are not related to one another.&lt;/p&gt;&#xA;&lt;h2 id=&#34;some-examples&#34;&gt;Some examples&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;val (a, b) = Pair(1, &amp;#34;x&amp;#34;)&#xA;println(a) // 1&#xA;println(b) // x&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Alterantively, you could use:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;val p = Pair(&amp;#34;x&amp;#34;, &amp;#34;y&amp;#34;)&#xA;println(p) // (x, y)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can refer to it as &lt;code&gt;first&lt;/code&gt; and &lt;code&gt;second&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;val p = Pair(&amp;#34;x&amp;#34;, &amp;#34;y&amp;#34;)&#xA;println(p.first) // x&#xA;println(p.second) // y&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is great for returning multiple values from a function.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Get which Quarter of the Year in Golang</title>
      <link>https://andrewodendaal.com/get-which-quarter-of-the-year-in-golang/</link>
      <pubDate>Tue, 15 Jun 2021 00:06:59 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-which-quarter-of-the-year-in-golang/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a month as an integer from 1 to 12, return to which quarter of the year it belongs as an integer number.&lt;/p&gt;&#xA;&lt;p&gt;For example: month 2 (February), is part of the first quarter; month 6 (June), is part of the second quarter; and month 11 (November), is part of the fourth quarter.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-golang&#34;&gt;The solution in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;&#xA;func QuarterOf(month int) int {&#xA;  return (month + 2) / 3&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Sum The Strings in Python</title>
      <link>https://andrewodendaal.com/how-to-sum-the-strings-in-python/</link>
      <pubDate>Mon, 14 Jun 2021 10:46:58 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-sum-the-strings-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function that takes 2 nonnegative integers in form of a string as an input, and outputs the sum (also as a string):&lt;/p&gt;&#xA;&lt;p&gt;Example: (&lt;strong&gt;Input1, Input2 –&amp;gt;Output&lt;/strong&gt;)&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;4&amp;#34;,  &amp;#34;5&amp;#34; --&amp;gt; &amp;#34;9&amp;#34;&#xA;&amp;#34;34&amp;#34;, &amp;#34;5&amp;#34; --&amp;gt; &amp;#34;39&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Notes:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If either input is an empty string, consider it as zero.&lt;/li&gt;&#xA;&lt;li&gt;Inputs and the expected output will never exceed the signed 32-bit integer limit (&lt;code&gt;2^31 - 1&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fixing: ImmutableService requires getRowNodeId() callback to be implemented, your row data need IDs</title>
      <link>https://andrewodendaal.com/fixing-immutableservice-requires-getrownodeid-callback-to-be-implemented-your-row-data-need-ids/</link>
      <pubDate>Sun, 13 Jun 2021 00:33:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/fixing-immutableservice-requires-getrownodeid-callback-to-be-implemented-your-row-data-need-ids/</guid>
      <description>&lt;p&gt;If you have gotten this error before, then you have been trying to implement a &lt;code&gt;rowData&lt;/code&gt; mapping onto Ag-Grid.. and failed!&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;ImmutableService requires getRowNodeId() callback to be implemented, your row data need IDs&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-fix-the-8216your-row-data-need-ids-error&#34;&gt;How to fix the ‘Your row data need IDs&amp;rsquo; error&lt;/h2&gt;&#xA;&lt;p&gt;The good thing, is that it&amp;rsquo;s actually quite an easy fix:&lt;/p&gt;&#xA;&lt;p&gt;Make sure that you have implemented the &lt;code&gt;getRowNodeId&lt;/code&gt; function to return an actual &lt;code&gt;id&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;this.getRowNodeId = function(data) {&#xA;  return data.id; //id is a field here&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Worst case scenario, you could always return a random number here, but that is not recommended; but it certainly does help if you&amp;rsquo;re in a sticky situation:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Undo the most recent local commits in Git</title>
      <link>https://andrewodendaal.com/how-to-undo-the-most-recent-local-commits-in-git/</link>
      <pubDate>Sat, 12 Jun 2021 01:20:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-undo-the-most-recent-local-commits-in-git/</guid>
      <description>&lt;p&gt;If you have accidentally committed the wrong files into Git, but haven&amp;rsquo;t yet pushed it to the server, you can recover, or undo your commit as follows:&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-undo-a-commit-and-redo-it&#34;&gt;How to Undo a Commit and Redo it&lt;/h2&gt;&#xA;&lt;p&gt;You have just committed a file, and find yourself here;&lt;/p&gt;&#xA;&lt;p&gt;We will call this &amp;ldquo;your accident location&amp;rdquo;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;step-1&#34;&gt;Step 1&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git commit -m &amp;#34;This is what you&amp;#39;ve just done&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;step-2&#34;&gt;Step 2&lt;/h3&gt;&#xA;&lt;p&gt;Start by resetting:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git reset HEAD~&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;step-3&#34;&gt;Step 3&lt;/h3&gt;&#xA;&lt;p&gt;Now you can edit your files as required.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Deconstruction in Kotlin</title>
      <link>https://andrewodendaal.com/deconstruction-in-kotlin/</link>
      <pubDate>Fri, 11 Jun 2021 00:07:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/deconstruction-in-kotlin/</guid>
      <description>&lt;p&gt;There are times when you need to extract an object into a number of variables.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s take the example below:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;val (id, name, position, department) = employee&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In Kotlin, this is known as a &lt;code&gt;destructuring declaration&lt;/code&gt;. These new variables can now be used independently.&lt;/p&gt;&#xA;&lt;p&gt;The compilation thereof would look something like this, but is not required:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;val id = employee.component1()&#xA;val name = employee.component2()&#xA;val position = employee.component3()&#xA;val department = employee.component4()&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;returning-multiple-values-from-a-function&#34;&gt;Returning multiple values from a Function&lt;/h2&gt;&#xA;&lt;p&gt;Much like deconstruction of variables and collections, functions too can return multiple values.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Playing with passphrases in Python</title>
      <link>https://andrewodendaal.com/playing-with-passphrases-in-python/</link>
      <pubDate>Thu, 10 Jun 2021 01:01:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/playing-with-passphrases-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Everyone knows passphrases. One can choose passphrases from poems, songs, movies names and so on but frequently they can be guessed due to common cultural references. You can get your passphrases stronger by different means. One is the following:&lt;/p&gt;&#xA;&lt;p&gt;choose a text in capital letters including or not digits and non alphabetic characters,&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;shift each letter by a given number but the transformed letter must be a letter (circular shift),&lt;/li&gt;&#xA;&lt;li&gt;replace each digit by its complement to 9,&lt;/li&gt;&#xA;&lt;li&gt;keep such as non alphabetic and non digit characters,&lt;/li&gt;&#xA;&lt;li&gt;downcase each letter in odd position, upcase each letter in even position (the first character is in position 0),&lt;/li&gt;&#xA;&lt;li&gt;reverse the whole result.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h4 id=&#34;example&#34;&gt;Example:&lt;/h4&gt;&#xA;&lt;p&gt;your text: &amp;ldquo;BORN IN 2015!&amp;rdquo;, shift 1&lt;/p&gt;</description>
    </item>
    <item>
      <title>What is a Unit in Kotlin?</title>
      <link>https://andrewodendaal.com/what-is-a-unit-in-kotlin/</link>
      <pubDate>Wed, 09 Jun 2021 00:57:51 +0000</pubDate>
      <guid>https://andrewodendaal.com/what-is-a-unit-in-kotlin/</guid>
      <description>&lt;p&gt;&lt;code&gt;Unit&lt;/code&gt; corresponds to the &lt;code&gt;void&lt;/code&gt; keyword in Java.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-a-unit-in-kotlin&#34;&gt;What is a &lt;code&gt;Unit&lt;/code&gt; in Kotlin?&lt;/h2&gt;&#xA;&lt;p&gt;If you have a function that does not return a value, you can return a &lt;code&gt;Unit&lt;/code&gt; object.&lt;/p&gt;&#xA;&lt;p&gt;Generally, you would return a &lt;code&gt;Unit&lt;/code&gt; in Kotlin where you would traditionally return a &lt;code&gt;void&lt;/code&gt; in Java.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;fun doesntReturnAnythign(): Unit {&#xA;    val one = 1&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to declare a Function in Kotlin?</title>
      <link>https://andrewodendaal.com/how-to-declare-a-function-in-kotlin/</link>
      <pubDate>Tue, 08 Jun 2021 00:30:31 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-declare-a-function-in-kotlin/</guid>
      <description>&lt;p&gt;Functions are reusable pieces of code, often called Blocks, that as the name suggests, act as building blocks to piece together a program.&lt;/p&gt;&#xA;&lt;p&gt;Each language has its own keyword for defining a function block.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-fun&#34;&gt;What is &lt;code&gt;fun&lt;/code&gt;?&lt;/h2&gt;&#xA;&lt;p&gt;The &lt;code&gt;fun&lt;/code&gt; keyword in Kotlin denotes a function, or method to wrap a reusable code block.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;fun&lt;/code&gt; prepends the name of a function as illustrated below.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;fun functionName(): String {&#xA;    return &amp;#34;A String&amp;#34;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-structure-of-a-kotlin-function&#34;&gt;The structure of a Kotlin function&lt;/h2&gt;&#xA;&lt;p&gt;The function can take any number of parameters, and a return type.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The differences between Val and Var in Kotlin</title>
      <link>https://andrewodendaal.com/the-differences-between-val-and-var-in-kotlin/</link>
      <pubDate>Mon, 07 Jun 2021 00:21:27 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-differences-between-val-and-var-in-kotlin/</guid>
      <description>&lt;p&gt;Among all the many keywords that Kotlin comes with, there exists &lt;code&gt;val&lt;/code&gt; and &lt;code&gt;var&lt;/code&gt;. What are they used for? What are the differences, and why would you use one over another?&lt;/p&gt;&#xA;&lt;p&gt;They are both used to declare variables in Kotlin. But how are they different?&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-val&#34;&gt;What is &lt;code&gt;val&lt;/code&gt;?&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;val&lt;/code&gt; is used to declare a variable that is read-only, and who&amp;rsquo;s value does not change.&lt;/p&gt;&#xA;&lt;p&gt;Note that this only applies to the parent variable, and not it&amp;rsquo;s properties. The properties of the variable are still mutable.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Automatically Resize All Columns to Fit in Ag-Grid</title>
      <link>https://andrewodendaal.com/automatically-resize-all-columns-to-fit-in-ag-grid/</link>
      <pubDate>Sun, 06 Jun 2021 02:50:51 +0000</pubDate>
      <guid>https://andrewodendaal.com/automatically-resize-all-columns-to-fit-in-ag-grid/</guid>
      <description>&lt;p&gt;If you have an Ag-Grid, and want to automatically resize all the columns to fit the width of the viewport, you can use this hack.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-implementation&#34;&gt;The implementation&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;/**&#xA;   * resizes the columns to fit the width of the grid&#xA;   * @param allowShrink if false, columns will NOT be resized when there is no &amp;#34;empty&amp;#34; horizontal space&#xA;   * https://stackoverflow.com/questions/55587083/ag-grid-sizecolumnstofit-only-when-there-is-space-available-in-the-total-grid-wi#answer-60753786&#xA;   */&#xA;  public resizeColumnsToFit(allowShrink = true) {&#xA;    if (this.gridApi) {&#xA;      if (allowShrink) {&#xA;        this.gridApi.sizeColumnsToFit();&#xA;      } else {&#xA;        /**&#xA;         * this is a &amp;#34;hacK&amp;#34; - there is no way to check if there is &amp;#34;empty&amp;#34; space in the grid using the&#xA;         * public grid api - we have to use the internal tools here.&#xA;         * it could be that some of this apis will change in future releases&#xA;         */&#xA;        const panel = this.gridApi[&amp;#34;gridPanel&amp;#34;];&#xA;        const availableWidth = this.gridApi[&amp;#34;gridPanel&amp;#34;].eBodyViewport.clientWidth;&#xA;        const columns = this.gridApi[&amp;#34;gridPanel&amp;#34;][&amp;#34;columnController&amp;#34;].getAllDisplayedColumns();&#xA;        const usedWidth = this.gridApi[&amp;#34;gridPanel&amp;#34;][&amp;#34;columnController&amp;#34;].getWidthOfColsInList(columns);&#xA;&#xA;        if (usedWidth &amp;lt; availableWidth)&#xA;          this.gridApi.sizeColumnsToFit()&#xA;      }&#xA;    }&#xA;  }&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-use-this-code&#34;&gt;How to use this code&lt;/h2&gt;&#xA;&lt;p&gt;Make sure that the following is in your HTML, to trigger the &lt;code&gt;onRowDataChanged&lt;/code&gt; event:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Get All Rows in Ag-Grid</title>
      <link>https://andrewodendaal.com/how-to-get-all-rows-in-ag-grid/</link>
      <pubDate>Sat, 05 Jun 2021 01:36:27 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-all-rows-in-ag-grid/</guid>
      <description>&lt;p&gt;The easiest way to get the content of all rows&amp;rsquo; data, back into a Javascript/Typescript array, is as follows.&lt;/p&gt;&#xA;&lt;p&gt;Simply create a blank array, then loop through the rows of the grid and append each row to the array.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;getAllRows() {&#xA;  let rowData = [];&#xA;  this.gridApi.forEachNode(node =&amp;gt; rowData.push(node.data));&#xA;  return rowData;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Find the Max Area of an Island in Python</title>
      <link>https://andrewodendaal.com/find-the-max-area-of-an-island-in-python/</link>
      <pubDate>Fri, 04 Jun 2021 00:21:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-max-area-of-an-island-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given an &lt;code&gt;m x n&lt;/code&gt; binary matrix &lt;code&gt;grid&lt;/code&gt;. An island is a group of &lt;code&gt;1&lt;/code&gt;‘s (representing land) connected &lt;strong&gt;4-directionally&lt;/strong&gt; (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;strong&gt;area&lt;/strong&gt; of an island is the number of cells with a value &lt;code&gt;1&lt;/code&gt; in the island.&lt;/p&gt;&#xA;&lt;p&gt;Return &lt;em&gt;the maximum &lt;strong&gt;area&lt;/strong&gt; of an island in &lt;/em&gt;&lt;code&gt;grid&lt;/code&gt;. If there is no island, return ``.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using Apache POI to Get or Create a Sheet in Excel using Java</title>
      <link>https://andrewodendaal.com/using-apache-poi-to-get-or-create-a-sheet-in-excel-using-java/</link>
      <pubDate>Thu, 03 Jun 2021 00:05:51 +0000</pubDate>
      <guid>https://andrewodendaal.com/using-apache-poi-to-get-or-create-a-sheet-in-excel-using-java/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Apache POI&lt;!-- raw HTML omitted --&gt; provides a mechanism to work with Excel documents.&lt;/p&gt;&#xA;&lt;p&gt;However, it has a missing feature when you want to only create a new sheet if one with that name doesn&amp;rsquo;t already exist.&lt;/p&gt;&#xA;&lt;p&gt;Luckily, it&amp;rsquo;s quite simple to get around this using the following code.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;List&amp;lt;String&amp;gt; sheets = new ArrayList&amp;lt;&amp;gt;();&#xA;for (int i = 0; i &amp;lt; workbook.getNumberOfSheets(); i++) {&#xA;    Sheet sheet = workbook.getSheetAt(i);&#xA;    sheets.add(sheet.getSheetName());&#xA;}&#xA;Sheet sheet = sheets.contains(name) ?&#xA;                workbook.getSheet(name) :&#xA;                workbook.createSheet(name);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The code uses the &lt;code&gt;workbook&lt;/code&gt; object you pass it, checks to see if a sheet with the specified name exists and then only creates one if needed. Otherwise it returns a reference to the existing one.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Simplistic TCP Finite State Machine (FSM) in Python</title>
      <link>https://andrewodendaal.com/a-simplistic-tcp-finite-state-machine-fsm-in-python/</link>
      <pubDate>Wed, 02 Jun 2021 00:02:27 +0000</pubDate>
      <guid>https://andrewodendaal.com/a-simplistic-tcp-finite-state-machine-fsm-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Automatons, or Finite State Machines (FSM), are extremely useful to programmers when it comes to software design. You will be given a simplistic version of an FSM to code for a basic TCP session.&lt;/p&gt;&#xA;&lt;p&gt;The outcome of this exercise will be to return the correct state of the TCP FSM based on the array of events given.&lt;/p&gt;&#xA;&lt;p&gt;The input array of events will consist of one or more of the following strings:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Resolve Scaling Squared Strings in Java</title>
      <link>https://andrewodendaal.com/how-to-resolve-scaling-squared-strings-in-java/</link>
      <pubDate>Tue, 01 Jun 2021 07:23:25 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-resolve-scaling-squared-strings-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given a string of &lt;code&gt;n&lt;/code&gt; lines, each substring being &lt;code&gt;n&lt;/code&gt; characters long. For example:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;s = &amp;quot;abcd\nefgh\nijkl\nmnop&amp;quot;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;We will study the &amp;ldquo;horizontal&amp;rdquo; and the &amp;ldquo;vertical&amp;rdquo; &lt;strong&gt;scaling&lt;/strong&gt; of this square of strings.&lt;/p&gt;&#xA;&lt;p&gt;A k-horizontal scaling of a string consists of replicating &lt;code&gt;k&lt;/code&gt; times each character of the string (except ‘\n&amp;rsquo;).&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Example: 2-horizontal scaling of s: =&amp;gt; &amp;ldquo;aabbccdd\neeffgghh\niijjkkll\nmmnnoopp&amp;rdquo;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;A v-vertical scaling of a string consists of replicating &lt;code&gt;v&lt;/code&gt; times each part of the squared string.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Build a Square in Python</title>
      <link>https://andrewodendaal.com/how-to-build-a-square-in-python/</link>
      <pubDate>Mon, 31 May 2021 00:16:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-build-a-square-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;I will give you an integer. Give me back a shape that is as long and wide as the integer. The integer will be a whole number between 1 and 50.&lt;/p&gt;&#xA;&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;&#xA;&lt;p&gt;&lt;code&gt;n = 3&lt;/code&gt;, so I expect a 3×3 square back just like below as a string:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;+++&#xA;+++&#xA;+++&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python&#34;&gt;The solution in Python&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def generateShape(i):&#xA;    return (i-1)*((&amp;#39;+&amp;#39;*i)+&amp;#39;\n&amp;#39;)+(&amp;#39;+&amp;#39;*i)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def generateShape(integer):&#xA;    return &amp;#39;\n&amp;#39;.join(&amp;#39;+&amp;#39; * integer for i in range(integer))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Check if String EndsWith in Python</title>
      <link>https://andrewodendaal.com/check-if-string-endswith-in-python/</link>
      <pubDate>Sun, 30 May 2021 01:54:52 +0000</pubDate>
      <guid>https://andrewodendaal.com/check-if-string-endswith-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the solution so that it returns true if the first argument(string) passed in ends with the 2nd argument (also a string).&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;strEndsWith(&amp;#39;abc&amp;#39;, &amp;#39;bc&amp;#39;) # returns true&#xA;strEndsWith(&amp;#39;abc&amp;#39;, &amp;#39;d&amp;#39;) # returns false&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python&#34;&gt;The solution in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def solution(string, ending):&#xA;    return string.endswith(ending)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;test.assert_equals(solution(&amp;#39;abcde&amp;#39;, &amp;#39;cde&amp;#39;), True)&#xA;test.assert_equals(solution(&amp;#39;abcde&amp;#39;, &amp;#39;abc&amp;#39;), False)&#xA;test.assert_equals(solution(&amp;#39;abcde&amp;#39;, &amp;#39;&amp;#39;), True)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to add a Git Submodule to an existing codebase</title>
      <link>https://andrewodendaal.com/how-to-add-a-git-submodule-to-an-existing-codebase/</link>
      <pubDate>Sat, 29 May 2021 00:24:32 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-add-a-git-submodule-to-an-existing-codebase/</guid>
      <description>&lt;p&gt;Git submodules are a way of including another repository&amp;rsquo;s code into an existing codebase, without associating it&amp;rsquo;s code or tracking history in the parent repository.&lt;/p&gt;&#xA;&lt;h2 id=&#34;add-a-git-submodule-to-an-existing-codebase&#34;&gt;Add a Git Submodule to an Existing Codebase&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;cd &amp;lt;parent_codebase_root&amp;gt;&#xA;git submodule add &amp;lt;remote_url&amp;gt; &amp;lt;destination_folder&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;So let&amp;rsquo;s say that we have a project called &lt;code&gt;project_website&lt;/code&gt;, a repository at the following path &lt;code&gt;https://github.com/user/repo.git&lt;/code&gt; and a target folder we&amp;rsquo;d like the submodule added to at &lt;code&gt;user_repo&lt;/code&gt;, we could construct our query like this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to LowerCase a String in Python</title>
      <link>https://andrewodendaal.com/how-to-lowercase-a-string-in-python/</link>
      <pubDate>Fri, 28 May 2021 00:10:50 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-lowercase-a-string-in-python/</guid>
      <description>&lt;p&gt;Python comes with a built-in method on all &lt;code&gt;String&lt;/code&gt; types, by calling &lt;code&gt;lower()&lt;/code&gt; on a String, you can immediately lower the case of that String.&lt;/p&gt;&#xA;&lt;h2 id=&#34;an-example-to-lowercase-a-string-in-python&#34;&gt;An example to LowerCase a String in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;words = &amp;#34;These are some WORDS&amp;#34;&#xA;words.lower() # &amp;lt;- How to lowerCase a String&#xA;# output: these are some words&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;These are some WORDS&amp;#34;.lower() # &amp;lt;- How to lowerCase a String&#xA;# output: these are some words&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now let&amp;rsquo;s try and see how it may look in a coding challenge:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Restart Sound Driver on a Mac</title>
      <link>https://andrewodendaal.com/how-to-restart-sound-driver-on-a-mac/</link>
      <pubDate>Thu, 27 May 2021 00:14:17 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-restart-sound-driver-on-a-mac/</guid>
      <description>&lt;p&gt;So for some strange reason, your audio has stopped playing through the Macbook Pro speakers, but if you plug in an external audio device, it still works? Or perhaps some other undesirable combination?&lt;/p&gt;&#xA;&lt;p&gt;If so, you could just try restarting the computer. That usually fixes thing right?&lt;/p&gt;&#xA;&lt;p&gt;But you have all those million apps open, all in unsaved states.. So rebooting is not the preferred approach.&lt;/p&gt;&#xA;&lt;p&gt;Try the below option to give your Apple the kick it needs!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Number to Binary Conversion in Python</title>
      <link>https://andrewodendaal.com/number-to-binary-conversion-in-python/</link>
      <pubDate>Wed, 26 May 2021 01:04:28 +0000</pubDate>
      <guid>https://andrewodendaal.com/number-to-binary-conversion-in-python/</guid>
      <description>&lt;p&gt;If you have a decimal number, and want to get it&amp;rsquo;s binary value, you can use the built-in &lt;code&gt;bin&lt;/code&gt; method.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;decimal = 32&#xA;binary = bin(decimal)&#xA;&#xA;# &amp;#39;0b100000&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We can see that it prepends the string with a &lt;code&gt;0b&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s remove this to return a usable binary value:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;decimal = 32&#xA;binary = str(bin(decimal)[2:])&#xA;&#xA;# &amp;#39;100000&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Counting Binary Gaps with Python</title>
      <link>https://andrewodendaal.com/counting-binary-gaps-with-python/</link>
      <pubDate>Tue, 25 May 2021 08:10:34 +0000</pubDate>
      <guid>https://andrewodendaal.com/counting-binary-gaps-with-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;A &lt;em&gt;binary gap&lt;/em&gt; within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N.&lt;/p&gt;&#xA;&lt;p&gt;For example, number 9 has binary representation 1001 and contains a binary gap of length 2. The number 529 has binary representation 1000010001 and contains two binary gaps: one of length 4 and one of length 3. The number 20 has binary representation 10100 and contains one binary gap of length 1. The number 15 has binary representation 1111 and has no binary gaps. The number 32 has binary representation 100000 and has no binary gaps.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Delete a Secret in Kubernetes</title>
      <link>https://andrewodendaal.com/how-to-delete-a-secret-in-kubernetes/</link>
      <pubDate>Mon, 24 May 2021 00:25:09 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-delete-a-secret-in-kubernetes/</guid>
      <description>&lt;p&gt;Once you have a secret in Kubernetes, if you know it&amp;rsquo;s name, you can delete it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-find-the-secret-name&#34;&gt;How to find the secret name&lt;/h2&gt;&#xA;&lt;p&gt;You can get the secret name as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl get secrets&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will produce an output similar to:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                  TYPE                                  DATA      AGE&#xA;admin-user-pass       Opaque                                2         11s&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now that we have the secret name, we can delete the secret&lt;/p&gt;&#xA;&lt;h2 id=&#34;deleting-a-secret-in-kubernetes&#34;&gt;Deleting a Secret in Kubernetes&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl delete secret admin-user-pass&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Decode a Secret in Kubernetes</title>
      <link>https://andrewodendaal.com/how-to-decode-a-secret-in-kubernetes/</link>
      <pubDate>Sun, 23 May 2021 00:36:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-decode-a-secret-in-kubernetes/</guid>
      <description>&lt;p&gt;Secrets in Kubernetes are encoded using &lt;code&gt;base64&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;If you have the secret name, you can ask for its value. If not, then learn &lt;!-- raw HTML omitted --&gt;how to get a secret in Kubernetes&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-retrieve-the-value-of-a-secret-in-kubernetes&#34;&gt;How to retrieve the value of a secret in Kubernetes&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl get secret admin-user-pass -o jsonpath=&amp;#39;{.data}&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will output a JSON as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&amp;#34;password&amp;#34;:&amp;#34;amYzOTJoZjc4MmhmOTMyaAo=&amp;#34;,&amp;#34;username&amp;#34;:&amp;#34;YWRtaW51c2VyCg==&amp;#34;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-decode-the-value-of-a-secret-in-kubernetes&#34;&gt;How to decode the value of a secret in Kubernetes&lt;/h2&gt;&#xA;&lt;p&gt;Values are always base64 encoded, so decoding it will look like this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Verify a Secret in Kubernetes</title>
      <link>https://andrewodendaal.com/how-to-verify-a-secret-in-kubernetes/</link>
      <pubDate>Sat, 22 May 2021 00:04:57 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-verify-a-secret-in-kubernetes/</guid>
      <description>&lt;p&gt;You have created a secret, and would like to retrieve it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;get-a-list-of-all-the-secrets-in-kubernetes&#34;&gt;Get a list of all the secrets in Kubernetes&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl get secrets&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will result in:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                  TYPE                                  DATA      AGE&#xA;admin-user-pass       Opaque                                2         11s&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-view-a-secret-in-kubernetes&#34;&gt;How to view a secret in Kubernetes&lt;/h2&gt;&#xA;&lt;p&gt;Now that we have our secret&amp;rsquo;s name, we can view it directly&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl describe secrets/admin-user-pass&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;With the following output:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Name:            admin-user-pass&#xA;Namespace:       default&#xA;Labels:          &amp;lt;none&amp;gt;&#xA;Annotations:     &amp;lt;none&amp;gt;&#xA;&#xA;Type:            Opaque&#xA;&#xA;Data&#xA;====&#xA;password:    12 bytes&#xA;username:    5 bytes&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Create a Secret in Kubernetes</title>
      <link>https://andrewodendaal.com/how-to-create-a-secret-in-kubernetes/</link>
      <pubDate>Fri, 21 May 2021 01:25:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-secret-in-kubernetes/</guid>
      <description>&lt;p&gt;Secrets allow applications to not hardcode &lt;code&gt;usernames&lt;/code&gt;, &lt;code&gt;passwords&lt;/code&gt; or additional information such as &lt;code&gt;hostnames&lt;/code&gt;, &lt;code&gt;IP addresses&lt;/code&gt; or other protected/sensitive information.&lt;/p&gt;&#xA;&lt;h2 id=&#34;create-a-secret-in-kubernetes&#34;&gt;Create a Secret in Kubernetes&lt;/h2&gt;&#xA;&lt;p&gt;It&amp;rsquo;s simple to create a &lt;a href=&#34;https://andrewodendaal.com/how-to-read-kubernetes-secrets&#34;&gt;secret in Kubernetes&lt;/a&gt;. It can either be done &lt;code&gt;--from-file&lt;/code&gt; or &lt;code&gt;--from-literal&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;option-1-from-a-file&#34;&gt;Option 1: From a File&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;echo -n &amp;#39;adminuser&amp;#39; &amp;gt; ./username.txt&#xA;echo -n &amp;#39;jf392hf782hf932h&amp;#39; &amp;gt; ./password.txt&#xA;&#xA;kubectl create secret generic admin-user-pass \&#xA;  --from-file=./username.txt \&#xA;  --from-file=./password.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The result will be something like:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;secret/admin-user-pass created&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;By default, the key name is the filename, but we could also be explicit about this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Divide an Array into Chunks in PHP</title>
      <link>https://andrewodendaal.com/how-to-divide-an-array-into-chunks-in-php/</link>
      <pubDate>Thu, 20 May 2021 00:43:23 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-divide-an-array-into-chunks-in-php/</guid>
      <description>&lt;p&gt;If you have a single-dimensional array, and want to break it into chunks, you can use the &lt;code&gt;array_chunks&lt;/code&gt; method.&lt;/p&gt;&#xA;&lt;p&gt;It takes 3 arguments:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The input array / original array&lt;/li&gt;&#xA;&lt;li&gt;The length of the new array (how many dimensions to create)&lt;/li&gt;&#xA;&lt;li&gt;A boolean to preserve the original keys or not&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;strong&amp;gt;array_chunk&amp;lt;/strong&amp;gt;(array&amp;amp;nbsp;$array,&amp;amp;nbsp;int&amp;amp;nbsp;$length,&amp;amp;nbsp;bool&amp;amp;nbsp;$preserve_keys=&amp;lt;strong&amp;gt;false&amp;lt;/strong&amp;gt;&amp;amp;nbsp;):array&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;an-example-of-dividing-an-array-into-chunks&#34;&gt;An example of dividing an array into chunks&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s take an initial starter array with 5 values&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$input_array = array(&amp;#39;a&amp;#39;, &amp;#39;b&amp;#39;, &amp;#39;c&amp;#39;, &amp;#39;d&amp;#39;, &amp;#39;e&amp;#39;);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If we said we would like to create 2 chunks:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to setup Certbot wildcard certificate on Apache</title>
      <link>https://andrewodendaal.com/how-to-setup-certbot-wildcard-certificate-on-apache/</link>
      <pubDate>Wed, 19 May 2021 01:10:46 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-setup-certbot-wildcard-certificate-on-apache/</guid>
      <description>&lt;p&gt;Certbot allows simple, quick and free provisioning of SSL certificates using LetsEncrypt.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-install-certbot&#34;&gt;How to install Certbot&lt;/h2&gt;&#xA;&lt;h3 id=&#34;option-1-recommended&#34;&gt;Option 1 (recommended)&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo snap install core; sudo snap refresh core&#xA;sudo snap install --classic certbot&#xA;sudo ln -s /snap/bin/certbot /usr/bin/certbot&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;option-2&#34;&gt;Option 2&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;apt update&#xA;apt install certbot&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-run-certbot&#34;&gt;How to run Certbot&lt;/h2&gt;&#xA;&lt;p&gt;If you want to run the automated setup and get your certificate installed directly to apache, then:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo certbot --apache&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you only want the certificate, then:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to retrieve a Secret from AWS Secrets Manager in the CLI</title>
      <link>https://andrewodendaal.com/how-to-retrieve-a-secret-from-aws-secrets-manager-in-the-cli/</link>
      <pubDate>Tue, 18 May 2021 00:13:56 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-retrieve-a-secret-from-aws-secrets-manager-in-the-cli/</guid>
      <description>&lt;p&gt;If you have stored a secret in AWS using the Secrets Manager, it is possible to use the AWS CLI to retrieve this value at a later date.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;aws secretsmanager get-secret-value --secret-id &amp;lt;ARN&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;The &lt;code&gt;arn&lt;/code&gt; is the Amazon Resource Name, which will look something like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;aws secretsmanager get-secret-value --secret-id arn:aws:secretsmanager:&amp;lt;region&amp;gt;:&amp;lt;account&amp;gt;:&amp;lt;secretname&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;get-a-secret-from-aws-secrets-manager-using-the-cli&#34;&gt;Get a Secret from AWS Secrets Manager using the CLI&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws secretsmanager get-secret-value --secret-id arn:aws:secretsmanager:eu-west-1:4872719xxxxx:secret:NameOfOurSecret-xxx&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Determine the Last Digits of N^2 == N in Java</title>
      <link>https://andrewodendaal.com/determine-the-last-digits-of-n2-n-in-java/</link>
      <pubDate>Mon, 17 May 2021 09:33:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/determine-the-last-digits-of-n2-n-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s call an integer number &lt;code&gt;N&lt;/code&gt; ‘green&amp;rsquo; if &lt;code&gt;N²&lt;/code&gt; ends with all of the digits of &lt;code&gt;N&lt;/code&gt;. Some examples:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;5&lt;/code&gt; is green, because &lt;code&gt;5² = 25&lt;/code&gt; and &lt;code&gt;25&lt;/code&gt; ends with &lt;code&gt;5&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;11&lt;/code&gt; is not green, because &lt;code&gt;11² = 121&lt;/code&gt; and &lt;code&gt;121&lt;/code&gt; does not end with &lt;code&gt;11&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;376&lt;/code&gt; is green, because &lt;code&gt;376² = 141376&lt;/code&gt; and &lt;code&gt;141376&lt;/code&gt; ends with &lt;code&gt;376&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Your task is to write a function &lt;code&gt;green&lt;/code&gt; that returns &lt;code&gt;n&lt;/code&gt;&lt;!-- raw HTML omitted --&gt;th&lt;!-- raw HTML omitted --&gt; green number, starting with &lt;code&gt;1&lt;/code&gt; – &lt;code&gt;green (1) == 1&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Expose your App through a Service in Kubernetes</title>
      <link>https://andrewodendaal.com/how-to-expose-your-app-through-a-service-in-kubernetes/</link>
      <pubDate>Sun, 16 May 2021 01:08:11 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-expose-your-app-through-a-service-in-kubernetes/</guid>
      <description>&lt;p&gt;Once you have &lt;a href=&#34;https://andrewodendaal.com/kubernetes-mastery&#34;&gt;deployed an application into Kubernetes&lt;/a&gt;, it will not be available to the outside world.&lt;/p&gt;&#xA;&lt;p&gt;For this to be possible, you need to expose it via a Service.&lt;/p&gt;&#xA;&lt;p&gt;Services can be exposed in 4 different ways:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;ClusterIP (default) – Exposes the Service via an internal IP to the cluster (only available internally)&lt;/li&gt;&#xA;&lt;li&gt;NodePort – Exposes the Service via the same port on all Nodes&lt;/li&gt;&#xA;&lt;li&gt;LoadBalancer – Creates an external LoadBalancer in the current cloud&lt;/li&gt;&#xA;&lt;li&gt;ExternalName – Maps the Service to the &lt;code&gt;externalName&lt;/code&gt;, and returns a CNAME record with it&amp;rsquo;s value&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;how-to-expose-your-app-via-a-service-in-kubernetes&#34;&gt;How to Expose your App via a Service in Kubernetes&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;kubectl get pods&lt;/code&gt; to list your available pods.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to connect to Bash on a Kubernetes pod</title>
      <link>https://andrewodendaal.com/how-to-connect-to-bash-on-a-kubernetes-pod/</link>
      <pubDate>Sat, 15 May 2021 01:27:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-connect-to-bash-on-a-kubernetes-pod/</guid>
      <description>&lt;p&gt;If you find yourself needing to jump into a &lt;a href=&#34;https://andrewodendaal.com/kubernetes-mastery&#34;&gt;Kubernetes pod&lt;/a&gt; to either diagnose an issue, or run a particular command, you can use the &lt;code&gt;bash&lt;/code&gt; connectivity functionality available from &lt;code&gt;kubectl&lt;/code&gt; itself.&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-get-the-pod-name-to-connect-to&#34;&gt;1. Get the pod name to connect to&lt;/h2&gt;&#xA;&lt;p&gt;First, you will need the pod name you want to connect to, you can get this by running &lt;code&gt;kubectl get pods&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;This will return a list similar to:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ kubectl get pods&#xA;NAME                                  READY   STATUS    RESTARTS   AGE&#xA;kubernetes-bootcamp-fb5c67579-8tghg   1/1     Running   0          7m39s&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Take node of the &lt;code&gt;name&lt;/code&gt; cell for later use.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get the Environment variables in a Kubernetes Pod</title>
      <link>https://andrewodendaal.com/how-to-get-the-environment-variables-in-a-kubernetes-pod/</link>
      <pubDate>Fri, 14 May 2021 02:01:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-environment-variables-in-a-kubernetes-pod/</guid>
      <description>&lt;p&gt;In this comprehensive guide, you will learn how to effectively get and list environment variables within a &lt;a href=&#34;https://andrewodendaal.com/kubernetes-mastery&#34;&gt;Kubernetes pod&lt;/a&gt;. Understanding how to work with environment variables is essential for managing and configuring applications running in Kubernetes clusters. We will cover step-by-step instructions to retrieve the environment variables of a pod, along with in-depth explanations and practical examples for a deeper understanding. By the end of this post, you will be proficient in using kubectl commands to handle environment variables in your Kubernetes environment.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to find out Cluster Info in Kubernetes</title>
      <link>https://andrewodendaal.com/how-to-find-out-cluster-info-in-kubernetes/</link>
      <pubDate>Thu, 13 May 2021 00:27:41 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-out-cluster-info-in-kubernetes/</guid>
      <description>&lt;p&gt;In Kubernetes, a &lt;code&gt;cluster&lt;/code&gt; is a group of machines working together.&lt;/p&gt;&#xA;&lt;p&gt;By running the &lt;code&gt;kubectl cluster-info&lt;/code&gt; command, we can find out high level information about the &lt;a href=&#34;https://andrewodendaal.com/kubernetes-mastery&#34;&gt;Kubernetes cluster&lt;/a&gt;, such as:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What address the cluster is running from&lt;/li&gt;&#xA;&lt;li&gt;Where the CoreDNS is running from&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;example-use-of-kubectl-cluser-info&#34;&gt;Example use of KubeCtl Cluser Info&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;kubectl cluster-info&lt;/code&gt; will return the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ kubectl cluster-info&#xA;&#xA;Kubernetes master is running at https://998a8a4d-354e-4203-bafb-2e25d7b39269.k8s.example.com&#xA;CoreDNS is running at https://998a8a4d-354e-4203-bafb-2e25d7b39269.k8s.example.com/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy&#xA;&#xA;To further debug and diagnose cluster problems, use &amp;#39;kubectl cluster-info dump&amp;#39;.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-get-more-information-about-the-cluster&#34;&gt;How to get more information about the cluster&lt;/h2&gt;&#xA;&lt;p&gt;You can also append the keyword &lt;code&gt;dump&lt;/code&gt; to the above command to get a full output about the cluster.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to set and use a kubeconfig in Kubernetes</title>
      <link>https://andrewodendaal.com/how-to-set-and-use-a-kubeconfig-in-kubernetes/</link>
      <pubDate>Wed, 12 May 2021 04:31:12 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-set-and-use-a-kubeconfig-in-kubernetes/</guid>
      <description>&lt;p&gt;The &lt;code&gt;kubeconfig&lt;/code&gt; file is the main configuration file that allows access to a Kubernetes cluster.&lt;/p&gt;&#xA;&lt;p&gt;When you first &lt;a href=&#34;https://andrewodendaal.com/kubernetes-mastery&#34;&gt;create your Kubernetes cluster&lt;/a&gt;, you are given a generated yaml file.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-configure-the-kubeconfig-file&#34;&gt;How to configure the kubeconfig file&lt;/h2&gt;&#xA;&lt;p&gt;The kubectl CLI has the followings preference in which kubeconfig file to use:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;by adding the &lt;code&gt;--kubeconfig &amp;lt;file&amp;gt;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;by setting a &lt;code&gt;KUBECONFIG&lt;/code&gt; environment variable&lt;/li&gt;&#xA;&lt;li&gt;by using the &lt;code&gt;$HOME/.kube/config&lt;/code&gt; file on the local machine&lt;/li&gt;&#xA;&lt;/ol&gt;</description>
    </item>
    <item>
      <title>How to Map over a List of Lists in Java</title>
      <link>https://andrewodendaal.com/how-to-map-over-a-list-of-lists-in-java/</link>
      <pubDate>Tue, 11 May 2021 00:25:01 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-map-over-a-list-of-lists-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function which maps a function over the lists in a list:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public static &amp;lt;T,R&amp;gt; R[][] gridMap(Function&amp;lt;T,R&amp;gt; fn, T[][] list)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Example 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;int[][] x = {{1,2,3},&#xA;             {4,5,6}};&#xA;&#xA;gridMap(e -&amp;gt; e + 1, x); // {{2,3,4},{5,6,7}}&#xA;gridMap(e -&amp;gt; e * e, x); // {{1,4,9},{16,25,36}}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Example 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;char[][] x = {{&amp;#39;h&amp;#39;,&amp;#39;E&amp;#39;,&amp;#39;l&amp;#39;,&amp;#39;l&amp;#39;,&amp;#39;O&amp;#39;},{&amp;#39;w&amp;#39;,&amp;#39;O&amp;#39;,&amp;#39;r&amp;#39;,&amp;#39;L&amp;#39;,&amp;#39;d&amp;#39;}};&#xA;&#xA;gridMap(e -&amp;gt; Character.toUpperCase(e), x); // {{&amp;#39;H&amp;#39;,&amp;#39;E&amp;#39;,&amp;#39;L&amp;#39;,&amp;#39;L&amp;#39;,&amp;#39;O&amp;#39;},{&amp;#39;W&amp;#39;,&amp;#39;O&amp;#39;,&amp;#39;R&amp;#39;,&amp;#39;L&amp;#39;,&amp;#39;D&amp;#39;}}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.function.Function;&#xA;import java.util.Arrays;&#xA;&#xA;public class Solution {&#xA;  public static &amp;lt;T, R&amp;gt; Object[][] gridMap(Function&amp;lt;T, R&amp;gt; fn, T[][] list) {&#xA;    return Arrays.stream(list).map(xs -&amp;gt; Arrays.stream(xs).map(fn).toArray()).toArray(Object[][]::new);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Differentiate a Polynomial in Java</title>
      <link>https://andrewodendaal.com/how-to-differentiate-a-polynomial-in-java/</link>
      <pubDate>Mon, 10 May 2021 00:03:32 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-differentiate-a-polynomial-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function that differentiates a polynomial for a given value of &lt;code&gt;x&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Your function will receive 2 arguments: a polynomial as a string, and a point to evaluate the equation as an integer.&lt;/p&gt;&#xA;&lt;h3 id=&#34;assumptions&#34;&gt;Assumptions:&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;There will be a coefficient near each &lt;code&gt;x&lt;/code&gt;, unless the coefficient equals &lt;code&gt;1&lt;/code&gt; or &lt;code&gt;-1&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;There will be an exponent near each &lt;code&gt;x&lt;/code&gt;, unless the exponent equals `` or &lt;code&gt;1&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;All exponents will be greater or equal to zero&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples:&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Equation.differenatiate(&amp;#34;12x+2&amp;#34;, 3)      ==&amp;gt;   12&#xA;Equation.differenatiate(&amp;#34;x^2+3x+2&amp;#34;, 3)   ==&amp;gt;   9&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find the Sums of Perfect Squares in Java</title>
      <link>https://andrewodendaal.com/find-the-sums-of-perfect-squares-in-java/</link>
      <pubDate>Sun, 09 May 2021 03:04:46 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-sums-of-perfect-squares-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The task is simply stated. Given an integer &lt;code&gt;n&lt;/code&gt; (&lt;code&gt;3 &amp;lt; n &amp;lt; 10&amp;lt;sup&amp;gt;9&amp;lt;/sup&amp;gt;&lt;/code&gt;), find the length of the smallest list of &lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;perfect squares&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt; which add up to &lt;code&gt;n&lt;/code&gt;. Come up with the best algorithm you can; you&amp;rsquo;ll need it!&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;sum_of_squares(17) = 2&lt;/code&gt;&lt;br&gt;&#xA;17 = 16 + 1 (4 and 1 are perfect squares).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;sum_of_squares(15) = 4&lt;/code&gt;&lt;br&gt;&#xA;15 = 9 + 4 + 1 + 1. There is no way to represent 15 as the sum of three perfect squares.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;sum_of_squares(16) = 1&lt;/code&gt;&lt;br&gt;&#xA;16 itself is a perfect square.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Time constraints:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] Error: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.4:repackage (repackage)</title>
      <link>https://andrewodendaal.com/solution-error-failed-to-execute-goal-org-springframework-bootspring-boot-maven-plugin2-4-4repackage-repackage/</link>
      <pubDate>Sat, 08 May 2021 01:18:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/solution-error-failed-to-execute-goal-org-springframework-bootspring-boot-maven-plugin2-4-4repackage-repackage/</guid>
      <description>&lt;p&gt;If you have come across this error when trying to build and deploy your Spring Boot Maven application then this post will help you!&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Error: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.4:repackage (repackage)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-fix-the-repackage-execute-goal-error&#34;&gt;How to fix the Repackage Execute Goal Error&lt;/h2&gt;&#xA;&lt;p&gt;You need to make sure you have the &lt;code&gt;mainClass&lt;/code&gt; explicitly defined under your &lt;code&gt;build&lt;/code&gt;-&amp;gt;&lt;code&gt;plugin&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;build&amp;gt;&#xA;    &amp;lt;plugins&amp;gt;&#xA;        &amp;lt;plugin&amp;gt;&#xA;            &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;&#xA;            &amp;lt;artifactId&amp;gt;spring-boot-maven-plugin&amp;lt;/artifactId&amp;gt;&#xA;            &amp;lt;configuration&amp;gt;&#xA;                &amp;lt;mainClass&amp;gt;com.example.apps.YourApplication&amp;lt;/mainClass&amp;gt;&#xA;            &amp;lt;/configuration&amp;gt;&#xA;        &amp;lt;/plugin&amp;gt;&#xA;    &amp;lt;/plugins&amp;gt;&#xA;&amp;lt;/build&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>[Solved] No main manifest attribute Solution for Jar/Maven/Gradle/Spring Boot</title>
      <link>https://andrewodendaal.com/solved-error-no-main-manifest-attribute/</link>
      <pubDate>Fri, 07 May 2021 01:43:06 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-error-no-main-manifest-attribute/</guid>
      <description>&lt;p&gt;You&amp;rsquo;ve built a Java project and packaged a .jar file.&lt;/p&gt;&#xA;&lt;p&gt;You are ready to run it outside your IDE, or deploy it somewhere.&lt;/p&gt;&#xA;&lt;p&gt;When you run it using &lt;code&gt;java -jar &amp;lt;your.jar&amp;gt;&lt;/code&gt; it says something like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;no main manifest attribute, in /src/project/target/your-jar-1.0-SNAPSHOT.jar&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-add-a-manifest-file&#34;&gt;How to add a Manifest file&lt;/h2&gt;&#xA;&lt;p&gt;You need to create a &lt;code&gt;META-INF/MANIFEST.MF&lt;/code&gt; file with the following content:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Main-Class: com.mypackage.MyClass&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The class name &lt;code&gt;com.mypackage.MyClass&lt;/code&gt; is the main class that has the &lt;em&gt;public static void main(String[] args)&lt;/em&gt; entry point in your application.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] Error – The following untracked working tree files would be overwritten by merge</title>
      <link>https://andrewodendaal.com/solution-error-the-following-untracked-working-tree-files-would-be-overwritten-by-merge/</link>
      <pubDate>Thu, 06 May 2021 00:20:05 +0000</pubDate>
      <guid>https://andrewodendaal.com/solution-error-the-following-untracked-working-tree-files-would-be-overwritten-by-merge/</guid>
      <description>&lt;p&gt;So you just tried to do a &lt;code&gt;git pull&lt;/code&gt; and got the following error:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;error: The following untracked working tree files would be overwritten by merge:&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-fix-untracked-working-trees-overwritten-merge&#34;&gt;How to fix Untracked Working Trees Overwritten Merge&lt;/h2&gt;&#xA;&lt;p&gt;You can fix this error by first adding and stashing your local files before performing the pull.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git add * &#xA;git stash&#xA;git pull&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Strip Script Tags in PHP</title>
      <link>https://andrewodendaal.com/how-to-strip-script-tags-in-php/</link>
      <pubDate>Wed, 05 May 2021 00:17:01 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-strip-script-tags-in-php/</guid>
      <description>&lt;p&gt;If you have some HTML input submitted from a user to your application, before saving it to the database, you may want to strip all &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tags so that you can prevent cross site scripting attacks and other potential issues.&lt;/p&gt;&#xA;&lt;p&gt;Below we use a Regular Expression to strip the script tag out of a variable.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$html = preg_replace(&amp;#39;#&amp;lt;script(.*?)&amp;gt;(.*?)&amp;lt;/script&amp;gt;#is&amp;#39;, &amp;#39;&amp;#39;, $html);&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Make a Spiral in Java</title>
      <link>https://andrewodendaal.com/how-to-make-a-spiral-in-java/</link>
      <pubDate>Tue, 04 May 2021 00:55:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-make-a-spiral-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Your task, is to create a NxN spiral with a given &lt;code&gt;size&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For example, spiral with size 5 should look like this:&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;and with the size 10:&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;Return value should contain array of arrays, of `` and &lt;code&gt;1&lt;/code&gt;, for example for given size &lt;code&gt;5&lt;/code&gt; result should be:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[[1,1,1,1,1],[0,0,0,0,1],[1,1,1,0,1],[1,0,0,0,1],[1,1,1,1,1]]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Because of the edge-cases for tiny spirals, the size will be at least 5.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find the Longest Common Subsequence in Java</title>
      <link>https://andrewodendaal.com/find-the-longest-common-subsequence-in-java/</link>
      <pubDate>Mon, 03 May 2021 01:14:22 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-longest-common-subsequence-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;from &lt;!-- raw HTML omitted --&gt;Wikipedia&lt;!-- raw HTML omitted --&gt;:&lt;br&gt;&#xA;The longest common subsequence (LCS) problem is the problem of finding the longest subsequence common to all sequences in a set of sequences.&lt;br&gt;&#xA;It differs from problems of finding common substrings: unlike substrings, subsequences are not required to occupy consecutive positions within the original sequences.&lt;/p&gt;&#xA;&lt;h3 id=&#34;task&#34;&gt;Task&lt;/h3&gt;&#xA;&lt;p&gt;Write a function &lt;code&gt;lcs&lt;/code&gt; that accepts two &lt;code&gt;string&lt;/code&gt;s and returns their longest common subsequence as a &lt;code&gt;string&lt;/code&gt;. Performance matters.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find First and Last Position of Element in Sorted Array in Java</title>
      <link>https://andrewodendaal.com/find-first-and-last-position-of-element-in-sorted-array-in-java/</link>
      <pubDate>Sun, 02 May 2021 00:28:30 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-first-and-last-position-of-element-in-sorted-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of integers &lt;code&gt;nums&lt;/code&gt; sorted in ascending order, find the starting and ending position of a given &lt;code&gt;target&lt;/code&gt; value.&lt;/p&gt;&#xA;&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;&#xA;&lt;p&gt;&lt;strong&gt;Follow up:&lt;/strong&gt; Could you write an algorithm with &lt;code&gt;O(log n)&lt;/code&gt; runtime complexity?&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 3:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Determine if Number is a Power of Three in Java</title>
      <link>https://andrewodendaal.com/determine-if-number-is-a-power-of-three-in-java/</link>
      <pubDate>Sat, 01 May 2021 02:58:53 +0000</pubDate>
      <guid>https://andrewodendaal.com/determine-if-number-is-a-power-of-three-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an integer &lt;code&gt;n&lt;/code&gt;, return &lt;em&gt;&lt;code&gt;true&lt;/code&gt; if it is a power of three. Otherwise, return &lt;code&gt;false&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;An integer &lt;code&gt;n&lt;/code&gt; is a power of three, if there exists an integer &lt;code&gt;x&lt;/code&gt; such that &lt;code&gt;n == 3&amp;lt;sup&amp;gt;x&amp;lt;/sup&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 3:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 4:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Count Binary Substrings in Java</title>
      <link>https://andrewodendaal.com/how-to-count-binary-substrings-in-java/</link>
      <pubDate>Fri, 30 Apr 2021 00:52:38 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-count-binary-substrings-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Give a string &lt;code&gt;s&lt;/code&gt;, count the number of non-empty (contiguous) substrings that have the same number of 0&amp;rsquo;s and 1&amp;rsquo;s, and all the 0&amp;rsquo;s and all the 1&amp;rsquo;s in these substrings are grouped consecutively.&lt;/p&gt;&#xA;&lt;p&gt;Substrings that occur multiple times are counted the number of times they occur.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;code&gt;s.length&lt;/code&gt; will be between 1 and 50,000.&lt;code&gt;s&lt;/code&gt; will only consist of &amp;ldquo;0&amp;rdquo; or &amp;ldquo;1&amp;rdquo; characters.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Download a CSV file using Javascript</title>
      <link>https://andrewodendaal.com/how-to-download-a-csv-file-using-javascript/</link>
      <pubDate>Thu, 29 Apr 2021 02:34:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-download-a-csv-file-using-javascript/</guid>
      <description>&lt;p&gt;Ever wanted to generate a CSV (comma separated values) file directly from the browser, using Javascript? Instead of going to the server..&lt;/p&gt;&#xA;&lt;p&gt;Look no further!&lt;/p&gt;&#xA;&lt;h2 id=&#34;create-a-function-to-download-a-csv-file&#34;&gt;Create a function to download a csv file&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function downloadCsv(csvData: string, filename: string) {&#xA;      const blob = new Blob([&amp;#39;\ufeff&amp;#39; + csvData], {&#xA;        type: &amp;#39;text/csv;charset=utf-8;&amp;#39;&#xA;      });&#xA;      const dwldLink = document.createElement(&amp;#34;a&amp;#34;);&#xA;      const url = URL.createObjectURL(blob);&#xA;      const isSafariBrowser = navigator.userAgent.indexOf(&amp;#39;Safari&amp;#39;) !== -1 &amp;amp;&amp;amp; navigator.userAgent.indexOf(&amp;#39;Chrome&amp;#39;) === -1;&#xA;&#xA;      //if Safari open in new window to save file with random filename.&#xA;      if (isSafariBrowser)&#xA;        dwldLink.setAttribute(&amp;#34;target&amp;#34;, &amp;#34;_blank&amp;#34;);&#xA;      &#xA;      dwldLink.setAttribute(&amp;#34;href&amp;#34;, url);&#xA;      dwldLink.setAttribute(&amp;#34;download&amp;#34;, filename+ &amp;#34;.csv&amp;#34;);&#xA;      dwldLink.style.visibility = &amp;#34;hidden&amp;#34;;&#xA;      document.body.appendChild(dwldLink);&#xA;      dwldLink.click();&#xA;      document.body.removeChild(dwldLink);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-use-our-function&#34;&gt;How to use our function&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// define some data&#xA;const data = &amp;#39;Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8\n&amp;#39; +&#xA;             &amp;#39;12345,abc.de,AB1234567890,USD,01-Jan-21,100,10000000,1.23\n&amp;#39; +&#xA;             &amp;#39;12345,abc.de,AB1234567890,USD,01-Jan-21,100,10000000,\n&amp;#39; +&#xA;             &amp;#39;12345,abc.de,AB1234567890,USD,01-Jan-21,100,&amp;#39;;&#xA;&#xA;// define a file name&#xA;const file = &amp;#39;OurFile&amp;#39;;&#xA;&#xA;// use the function&#xA;downloadCsv(data, file);&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Array Range between Integers in Java</title>
      <link>https://andrewodendaal.com/array-range-between-integers-in-java/</link>
      <pubDate>Wed, 28 Apr 2021 00:16:52 +0000</pubDate>
      <guid>https://andrewodendaal.com/array-range-between-integers-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the function that takes two integers (&lt;code&gt;a, b&lt;/code&gt;, where &lt;code&gt;a &amp;lt; b&lt;/code&gt;) and return an array of all integers between the input parameters, &lt;strong&gt;including&lt;/strong&gt; them.&lt;/p&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;a = 1&#xA;b = 4&#xA;&#xA;//[1, 2, 3, 4]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution {&#xA;&#xA;  public static int[] between(int a, int b) {&#xA;    return java.util.stream.IntStream.rangeClosed(a, b).toArray();&#xA;  }&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution {&#xA;&#xA;  public static int[] between(int a, int b) {&#xA;    int length = 0;&#xA;        for(int k = a; k &amp;lt;= b; k++){&#xA;            length++;&#xA;        }&#xA;&#xA;        int[] array = new int[length];&#xA;        int first = a;&#xA;&#xA;        for(int i = 0; i &amp;lt; length; i++){&#xA;            array[i] = first;&#xA;            first++;&#xA;&#xA;        }&#xA;        return array;&#xA;  }&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to clone a table structure in MySQL</title>
      <link>https://andrewodendaal.com/how-to-clone-a-table-structure-in-mysql/</link>
      <pubDate>Tue, 27 Apr 2021 00:03:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-clone-a-table-structure-in-mysql/</guid>
      <description>&lt;p&gt;I have often needed to clone a table without it&amp;rsquo;s data in MySQL.&lt;/p&gt;&#xA;&lt;p&gt;Oftentimes this has been because I have a continually growing temporary table and I just need to clear up some disk space. And it&amp;rsquo;s a lot faster and more guaranteed than trying to delete and optimise the table.&lt;/p&gt;&#xA;&lt;h2 id=&#34;clone-a-table-structure-without-its-data&#34;&gt;Clone a table structure without it&amp;rsquo;s data&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s say that your table in question is called table1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;create table table1tmp like table1;&#xA;drop table table1;&#xA;rename table table1tmp to table1;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you run the above queries either in quick succession, or altogether in a single statement, you will notice that this is a very fast method even on very big tables.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Number of Rectangles in a Grid in Java</title>
      <link>https://andrewodendaal.com/number-of-rectangles-in-a-grid-in-java/</link>
      <pubDate>Mon, 26 Apr 2021 01:19:01 +0000</pubDate>
      <guid>https://andrewodendaal.com/number-of-rectangles-in-a-grid-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a grid of size m x n, calculate the total number of rectangles contained in this rectangle. All integer sizes and positions are counted.&lt;/p&gt;&#xA;&lt;p&gt;Examples:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;numberOfRectangles(3, 2) == 18&#xA;numberOfRectangles(4, 4) == 100&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Here is how the 3×2 grid works (Thanks to GiacomoSorbi for the idea):&lt;/p&gt;&#xA;&lt;p&gt;1 rectangle of size 3×2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[][][]&#xA;[][][]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;2 rectangles of size 3×1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[][][]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;4 rectangles of size 2×1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[][]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;2 rectangles of size 2×2&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[][]&#xA;[][]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;3 rectangles of size 1×2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Longest vowel chain in Java</title>
      <link>https://andrewodendaal.com/longest-vowel-chain-in-java/</link>
      <pubDate>Sun, 25 Apr 2021 00:53:34 +0000</pubDate>
      <guid>https://andrewodendaal.com/longest-vowel-chain-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The vowel substrings in the word &lt;code&gt;codewarriors&lt;/code&gt; are &lt;code&gt;o,e,a,io&lt;/code&gt;. The longest of these has a length of 2. Given a lowercase string that has alphabetic characters only (both vowels and consonants) and no spaces, return the length of the longest vowel substring. Vowels are any of &lt;code&gt;aeiou&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import static java.util.stream.Stream.of;&#xA;&#xA;interface Solution {&#xA;  static int solve(String s) {&#xA;    return of(s.split(&amp;#34;[^aeiou]&amp;#34;)).mapToInt(String::length).max().orElse(0);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Determine Unique String Characters in Java</title>
      <link>https://andrewodendaal.com/determine-unique-string-characters-in-java/</link>
      <pubDate>Sat, 24 Apr 2021 00:46:32 +0000</pubDate>
      <guid>https://andrewodendaal.com/determine-unique-string-characters-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In this challenge, you will be given two strings &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; and your task will be to return the characters that are not common in the two strings.&lt;/p&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;solve(&amp;#34;xyab&amp;#34;,&amp;#34;xzca&amp;#34;) = &amp;#34;ybzc&amp;#34; &#xA;--The first string has &amp;#39;yb&amp;#39; which is not in the second string. &#xA;--The second string has &amp;#39;zc&amp;#39; which is not in the first string. &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Notice also that you return the characters from the first string concatenated with those from the second string.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Difference of Volumes of Cuboids in Java</title>
      <link>https://andrewodendaal.com/difference-of-volumes-of-cuboids-in-java/</link>
      <pubDate>Fri, 23 Apr 2021 00:37:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/difference-of-volumes-of-cuboids-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In this simple exercise, you will create a program that will take two lists of integers, &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;. Each list will consist of 3 positive integers above 0, representing the dimensions of cuboids &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;. You must find the difference of the cuboids&amp;rsquo; volumes regardless of which is bigger.&lt;/p&gt;&#xA;&lt;p&gt;For example, if the parameters passed are &lt;code&gt;([2, 2, 3], [5, 4, 1])&lt;/code&gt;, the volume of &lt;code&gt;a&lt;/code&gt; is 12 and the volume of &lt;code&gt;b&lt;/code&gt; is 20. Therefore, the function should return 8.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sort by binary ones in Java</title>
      <link>https://andrewodendaal.com/sort-by-binary-ones-in-java/</link>
      <pubDate>Thu, 22 Apr 2021 00:18:24 +0000</pubDate>
      <guid>https://andrewodendaal.com/sort-by-binary-ones-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In this example you need to implement a function that sort a list of integers based on it&amp;rsquo;s binary representation.&lt;/p&gt;&#xA;&lt;p&gt;The rules are simple:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;sort the list based on the amount of 1&amp;rsquo;s in the binary representation of each number.&lt;/li&gt;&#xA;&lt;li&gt;if two numbers have the same amount of 1&amp;rsquo;s, the shorter string goes first. (ex: &amp;ldquo;11&amp;rdquo; goes before &amp;ldquo;101&amp;rdquo; when sorting 3 and 5 respectively)&lt;/li&gt;&#xA;&lt;li&gt;if the amount of 1&amp;rsquo;s is same, lower decimal number goes first. (ex: 21 = &amp;ldquo;10101&amp;rdquo; and 25 = &amp;ldquo;11001&amp;rdquo;, then 21 goes first as is lower)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Examples:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Binomial Expansion in Java</title>
      <link>https://andrewodendaal.com/binomial-expansion-in-java/</link>
      <pubDate>Wed, 21 Apr 2021 02:23:20 +0000</pubDate>
      <guid>https://andrewodendaal.com/binomial-expansion-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a program that can do some algebra. Write a function &lt;code&gt;expand&lt;/code&gt; that takes in an expression with a single, one character variable, and expands it. The expression is in the form &lt;code&gt;(ax+b)^n&lt;/code&gt; where &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; are integers which may be positive or negative, &lt;code&gt;x&lt;/code&gt; is any single character variable, and &lt;code&gt;n&lt;/code&gt; is a natural number. If a = 1, no coefficient will be placed in front of the variable. If a = -1, a &amp;ldquo;-&amp;rdquo; will be placed in front of the variable.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Consecutive strings in Java</title>
      <link>https://andrewodendaal.com/consecutive-strings-in-java/</link>
      <pubDate>Tue, 20 Apr 2021 00:18:28 +0000</pubDate>
      <guid>https://andrewodendaal.com/consecutive-strings-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given an array(list) &lt;code&gt;strarr&lt;/code&gt; of strings and an integer &lt;code&gt;k&lt;/code&gt;. Your task is to return the &lt;strong&gt;first&lt;/strong&gt; longest string consisting of k &lt;strong&gt;consecutive&lt;/strong&gt; strings taken in the array.&lt;/p&gt;&#xA;&lt;h4 id=&#34;examples&#34;&gt;Examples&lt;/h4&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;strarr = [&amp;#34;tree&amp;#34;, &amp;#34;foling&amp;#34;, &amp;#34;trashy&amp;#34;, &amp;#34;blue&amp;#34;, &amp;#34;abcdef&amp;#34;, &amp;#34;uvwxyz&amp;#34;], k = 2&#xA;&#xA;Concatenate the consecutive strings of strarr by 2, we get:&#xA;&#xA;treefoling   (length 10)  concatenation of strarr[0] and strarr[1]&#xA;folingtrashy (&amp;#34;      12)  concatenation of strarr[1] and strarr[2]&#xA;trashyblue   (&amp;#34;      10)  concatenation of strarr[2] and strarr[3]&#xA;blueabcdef   (&amp;#34;      10)  concatenation of strarr[3] and strarr[4]&#xA;abcdefuvwxyz (&amp;#34;      12)  concatenation of strarr[4] and strarr[5]&#xA;&#xA;Two strings are the longest: &amp;#34;folingtrashy&amp;#34; and &amp;#34;abcdefuvwxyz&amp;#34;.&#xA;The first that came is &amp;#34;folingtrashy&amp;#34; so &#xA;longest_consec(strarr, 2) should return &amp;#34;folingtrashy&amp;#34;.&#xA;&#xA;In the same way:&#xA;longest_consec([&amp;#34;zone&amp;#34;, &amp;#34;abigail&amp;#34;, &amp;#34;theta&amp;#34;, &amp;#34;form&amp;#34;, &amp;#34;libe&amp;#34;, &amp;#34;zas&amp;#34;, &amp;#34;theta&amp;#34;, &amp;#34;abigail&amp;#34;], 2) --&amp;gt; &amp;#34;abigailtheta&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;n being the length of the string array, if &lt;code&gt;n = 0&lt;/code&gt; or &lt;code&gt;k &amp;gt; n&lt;/code&gt; or &lt;code&gt;k &amp;lt;= 0&lt;/code&gt; return &amp;ldquo;&amp;rdquo;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Determine the Highest Scoring Word in Java</title>
      <link>https://andrewodendaal.com/determine-the-highest-scoring-word-in-java/</link>
      <pubDate>Mon, 19 Apr 2021 00:44:31 +0000</pubDate>
      <guid>https://andrewodendaal.com/determine-the-highest-scoring-word-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a string of words, you need to find the highest scoring word.&lt;/p&gt;&#xA;&lt;p&gt;Each letter of a word scores points according to its position in the alphabet: &lt;code&gt;a = 1, b = 2, c = 3&lt;/code&gt; etc.&lt;/p&gt;&#xA;&lt;p&gt;You need to return the highest scoring word as a string.&lt;/p&gt;&#xA;&lt;p&gt;If two words score the same, return the word that appears earliest in the original string.&lt;/p&gt;&#xA;&lt;p&gt;All letters will be lowercase and all inputs will be valid.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Solving Speed Control in Java</title>
      <link>https://andrewodendaal.com/solving-speed-control-in-java/</link>
      <pubDate>Sun, 18 Apr 2021 01:06:55 +0000</pubDate>
      <guid>https://andrewodendaal.com/solving-speed-control-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In John&amp;rsquo;s car the GPS records every &lt;code&gt;s&lt;/code&gt; seconds the distance travelled from an origin (distances are measured in an arbitrary but consistent unit). For example, below is part of a record with &lt;code&gt;s = 15&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;x = [0.0, 0.19, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The sections are:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;0.0-0.19, 0.19-0.5, 0.5-0.75, 0.75-1.0, 1.0-1.25, 1.25-1.50, 1.5-1.75, 1.75-2.0, 2.0-2.25&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We can calculate John&amp;rsquo;s average hourly speed on every section and we get:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calculate Miles per Gallon to Kilometers per Litre in Java</title>
      <link>https://andrewodendaal.com/calculate-miles-per-gallon-to-kilometers-per-litre-in-java/</link>
      <pubDate>Sat, 17 Apr 2021 00:44:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/calculate-miles-per-gallon-to-kilometers-per-litre-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create an application that will display the number of kilometers per liter (output) based on the number of miles per imperial gallon (input).&lt;/p&gt;&#xA;&lt;p&gt;Make sure to round off the result to two decimal points. If the answer ends with a 0, it should be rounded off without the 0. So instead of 5.50, we should get 5.5.&lt;/p&gt;&#xA;&lt;p&gt;Some useful associations relevant to this challenge:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;1 Imperial Gallon = 4.54609188 litres&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Convert an Int to a List of Ints in Python</title>
      <link>https://andrewodendaal.com/how-to-convert-an-int-to-a-list-of-ints-in-python/</link>
      <pubDate>Fri, 16 Apr 2021 00:13:59 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-an-int-to-a-list-of-ints-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a non-negative integer, return an array / a list of the individual digits in order.&lt;/p&gt;&#xA;&lt;p&gt;Examples:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;123 =&amp;gt; [1,2,3]&#xA;1 =&amp;gt; [1]&#xA;8675309 =&amp;gt; [8,6,7,5,3,0,9]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-code&#34;&gt;The solution in Python code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def digitize(n):&#xA;    return [int(d) for d in str(n)]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def digitize(n):&#xA;    return list(map(int, str(n)))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def digitize(n):&#xA;    lst = []&#xA;    if n == 0:&#xA;        return [0]&#xA;    while n:&#xA;        n,r = divmod(n,10)&#xA;        lst.append(r)&#xA;    lst.reverse()&#xA;    return lst&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import test&#xA;from solution import digitize&#xA;&#xA;@test.describe(&amp;#34;Fixed Tests&amp;#34;)&#xA;def fixed_tests():&#xA;    @test.it(&amp;#39;Basic Test Cases&amp;#39;)&#xA;    def basic_test_cases():&#xA;        test.assert_equals(digitize(123), [1,2,3])&#xA;        test.assert_equals(digitize(1), [1])&#xA;        test.assert_equals(digitize(0), [0])&#xA;        test.assert_equals(digitize(1230), [1,2,3, 0])&#xA;        test.assert_equals(digitize(8675309), [8,6,7,5,3,0,9])&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Find the Greatest Common Divisor in Java</title>
      <link>https://andrewodendaal.com/find-the-greatest-common-divisor-in-java/</link>
      <pubDate>Thu, 15 Apr 2021 00:48:52 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-greatest-common-divisor-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Find the greatest common divisor of two positive integers. The integers can be large, so you need to find a clever solution.&lt;/p&gt;&#xA;&lt;p&gt;The inputs &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; are always greater or equal to 1, so the greatest common divisor will always be an integer that is also greater or equal to 1.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (using &lt;code&gt;Euclidean Algorithm&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class GCD {&#xA;    public static int compute(int x, int y) {&#xA;        return (x % y != 0) ? compute(y, x % y) : y;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2 (using a &lt;code&gt;loop&lt;/code&gt;):&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Create a Circular List in Python</title>
      <link>https://andrewodendaal.com/how-to-create-a-circular-list-in-python/</link>
      <pubDate>Wed, 14 Apr 2021 02:04:49 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-circular-list-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a Circular List&lt;/p&gt;&#xA;&lt;p&gt;A circular list is of finite size, but can infititely be asked for its previous and next elements. This is because it acts like it is joined at the ends and loops around.&lt;/p&gt;&#xA;&lt;p&gt;For example, imagine a CircularList of &lt;code&gt;[1, 2, 3, 4]&lt;/code&gt;. Five invocations of &lt;code&gt;next()&lt;/code&gt; in a row should return 1, 2, 3, 4 and then 1 again. At this point, five invocations of &lt;code&gt;prev()&lt;/code&gt; in a row should return 4, 3, 2, 1 and then 4 again.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Guess the Sequence in Java</title>
      <link>https://andrewodendaal.com/how-to-guess-the-sequence-in-java/</link>
      <pubDate>Tue, 13 Apr 2021 00:33:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-guess-the-sequence-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You must guess a sequence and it has something to do with the number given.&lt;/p&gt;&#xA;&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;x = 16&#xA;&#xA;result = [1, 10, 11, 12, 13, 14, 15, 16, 2, 3, 4, 5, 6, 7, 8, 9]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.stream.IntStream;&#xA;&#xA;class Challenge {&#xA;  static int[] sequence(int x) {&#xA;    return IntStream.rangeClosed(1, x)&#xA;                .mapToObj(String::valueOf)&#xA;                .sorted()&#xA;                .mapToInt(Integer::parseInt)&#xA;                .toArray();&#xA;  } &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.*;&#xA;class Challenge {&#xA;  static int[] sequence(int x) {&#xA;    String arr[] = new String[x];&#xA;    for(int i =1;i&amp;lt;=x;i++){&#xA;    arr[i-1]= &amp;#34;&amp;#34;+i;&#xA;    }&#xA;    Arrays.sort(arr);&#xA;    int[]  tor =  new int[x];&#xA;    for(int i = 0;i&amp;lt;x;i++){&#xA;      tor[i] = Integer.parseInt(arr[i]);&#xA;    }&#xA;    return tor ;&#xA;  }&#xA;  &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Reversed sequence in Java</title>
      <link>https://andrewodendaal.com/reversed-sequence-in-java/</link>
      <pubDate>Mon, 12 Apr 2021 01:48:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/reversed-sequence-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Build a function that returns an array of integers from n to 1 where &lt;code&gt;n&amp;gt;0&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Example : &lt;code&gt;n=5&lt;/code&gt; –&amp;gt; &lt;code&gt;[5,4,3,2,1]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Sequence{&#xA;&#xA;  public static int[] reverse(int n) {&#xA;    if (n&amp;lt;=0) return null;&#xA;    &#xA;    int[] out = new int[n];&#xA;    &#xA;    for (int i=n, j=0; i&amp;gt;0; i--) {&#xA;      out[j] = i;&#xA;      j++;&#xA;    }&#xA;    &#xA;    return out;&#xA;    &#xA;  }&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.stream.IntStream;&#xA;&#xA;public class Sequence{&#xA;&#xA;  public static int[] reverse(int n) {&#xA;    return IntStream.range(-n, 0).map(Math::abs).toArray();&#xA;  }&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Count the Digit in Java</title>
      <link>https://andrewodendaal.com/count-the-digit-in-java/</link>
      <pubDate>Sun, 11 Apr 2021 00:53:29 +0000</pubDate>
      <guid>https://andrewodendaal.com/count-the-digit-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Take an integer &lt;code&gt;n (n &amp;gt;= 0)&lt;/code&gt; and a digit &lt;code&gt;d (0 &amp;lt;= d &amp;lt;= 9)&lt;/code&gt; as an integer. Square all numbers &lt;code&gt;k (0 &amp;lt;= k &amp;lt;= n)&lt;/code&gt; between 0 and n. Count the numbers of digits &lt;code&gt;d&lt;/code&gt; used in the writing of all the &lt;code&gt;k**2&lt;/code&gt;. Call &lt;code&gt;nb_dig&lt;/code&gt; (or nbDig or …) the function taking &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;d&lt;/code&gt; as parameters and returning this count.&lt;/p&gt;&#xA;&lt;h4 id=&#34;examples&#34;&gt;Examples:&lt;/h4&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;n = 10, d = 1, the k*k are 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100&#xA;We are using the digit 1 in 1, 16, 81, 100. The total count is then 4.&#xA;&#xA;nb_dig(25, 1):&#xA;the numbers of interest are&#xA;1, 4, 9, 10, 11, 12, 13, 14, 19, 21 which squared are 1, 16, 81, 100, 121, 144, 169, 196, 361, 441&#xA;so there are 11 digits `1` for the squares of numbers between 0 and 25.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note that &lt;code&gt;121&lt;/code&gt; has twice the digit &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Multiply all elements in an array in Java</title>
      <link>https://andrewodendaal.com/multiply-all-elements-in-an-array-in-java/</link>
      <pubDate>Sat, 10 Apr 2021 00:34:24 +0000</pubDate>
      <guid>https://andrewodendaal.com/multiply-all-elements-in-an-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function &lt;code&gt;multiplyAll&lt;/code&gt;/&lt;code&gt;multiply_all&lt;/code&gt; which takes an array of integers as an argument. This function must return another function, which takes a single integer as an argument and returns a new array.&lt;/p&gt;&#xA;&lt;p&gt;The returned array should consist of each of the elements from the first array multiplied by the integer.&lt;/p&gt;&#xA;&lt;h3 id=&#34;example&#34;&gt;Example:&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;multiplyAll([1, 2, 3])(2) = [2, 4, 6];&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You must not mutate the original array.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] Fatal: refusing to merge unrelated histories in Git</title>
      <link>https://andrewodendaal.com/fatal-refusing-to-merge-unrelated-histories/</link>
      <pubDate>Fri, 09 Apr 2021 00:34:11 +0000</pubDate>
      <guid>https://andrewodendaal.com/fatal-refusing-to-merge-unrelated-histories/</guid>
      <description>&lt;p&gt;You have received the dreaded &lt;code&gt;fatal: refusing to merge unrelated histories&lt;/code&gt; error!&lt;/p&gt;&#xA;&lt;p&gt;You might find yourself asking one of the following questions:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What is refusing to merge unrelated histories?&lt;/li&gt;&#xA;&lt;li&gt;How do you combine two unrelated histories?&lt;/li&gt;&#xA;&lt;li&gt;What is unrelated history in git?&lt;/li&gt;&#xA;&lt;li&gt;How do you fix unrelated branches?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Well look no further, below you will learn how to solve this problem quickly and also learn about why it happens in the first place.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Credit Card Mask in Java</title>
      <link>https://andrewodendaal.com/credit-card-mask-in-java/</link>
      <pubDate>Thu, 08 Apr 2021 00:12:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/credit-card-mask-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Usually when you buy something, you&amp;rsquo;re asked whether your credit card number, phone number or answer to your most secret question is still correct. However, since someone could look over your shoulder, you don&amp;rsquo;t want that shown on your screen. Instead, we mask it.&lt;/p&gt;&#xA;&lt;p&gt;Your task is to write a function &lt;code&gt;maskify&lt;/code&gt;, which changes all but the last four characters into &lt;code&gt;&#39;#&#39;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Maskify.Maskify(&amp;#34;4556364607935616&amp;#34;); // should return &amp;#34;############5616&amp;#34;&#xA;Maskify.Maskify(&amp;#34;64607935616&amp;#34;);      // should return &amp;#34;#######5616&amp;#34;&#xA;Maskify.Maskify(&amp;#34;1&amp;#34;);                // should return &amp;#34;1&amp;#34;&#xA;Maskify.Maskify(&amp;#34;&amp;#34;);                 // should return &amp;#34;&amp;#34;&#xA;&#xA;// &amp;#34;What was the name of your first pet?&amp;#34;&#xA;Maskify.Maskify(&amp;#34;Skippy&amp;#34;);                                   // should return &amp;#34;##ippy&amp;#34;&#xA;Maskify.Maskify(&amp;#34;Nananananananananananananananana Batman!&amp;#34;); // should return &amp;#34;####################################man!&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Reverse a Number in Java</title>
      <link>https://andrewodendaal.com/how-to-reverse-a-number-in-java/</link>
      <pubDate>Wed, 07 Apr 2021 00:09:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reverse-a-number-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a number, write a function to output its reverse digits. (e.g. given 123 the answer is 321)&lt;/p&gt;&#xA;&lt;p&gt;Numbers should preserve their sign; i.e. a negative number should still be negative when reversed.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt; 123 -&amp;gt;  321&#xA;-456 -&amp;gt; -654&#xA;1000 -&amp;gt;    1&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class ReverseNumber {&#xA;&#xA;  public static int reverse(int number) {&#xA;    int result = 0;&#xA;    while(number != 0) {&#xA;      result = result * 10 + number % 10;&#xA;      number = number / 10;&#xA;    }&#xA;    return result;&#xA;  }&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Positions Average in Java</title>
      <link>https://andrewodendaal.com/positions-average-in-java/</link>
      <pubDate>Tue, 06 Apr 2021 01:11:01 +0000</pubDate>
      <guid>https://andrewodendaal.com/positions-average-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Suppose you have 4 numbers: &lt;code&gt;&#39;0&#39;, &#39;9&#39;, &#39;6&#39;, &#39;4&#39;&lt;/code&gt; and 3 strings composed with them:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;s1 = &amp;#34;6900690040&amp;#34;&#xA;s2 = &amp;#34;4690606946&amp;#34;&#xA;s3 = &amp;#34;9990494604&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Compare &lt;code&gt;s1&lt;/code&gt; and &lt;code&gt;s2&lt;/code&gt; to see how many positions they have in common: `` at index 3, &lt;code&gt;6&lt;/code&gt; at index 4, &lt;code&gt;4&lt;/code&gt; at index 8 ie 3 common positions out of ten.&lt;/p&gt;&#xA;&lt;p&gt;Compare &lt;code&gt;s1&lt;/code&gt; and &lt;code&gt;s3&lt;/code&gt; to see how many positions they have in common: &lt;code&gt;9&lt;/code&gt; at index 1, `` at index 3, &lt;code&gt;9&lt;/code&gt; at index 5 ie 3 common positions out of ten.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Determine the Date by the Day Number in Java</title>
      <link>https://andrewodendaal.com/determine-the-date-by-the-day-number-in-java/</link>
      <pubDate>Mon, 05 Apr 2021 00:26:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/determine-the-date-by-the-day-number-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;What date corresponds to the &lt;code&gt;n&lt;/code&gt;&lt;!-- raw HTML omitted --&gt;th&lt;!-- raw HTML omitted --&gt; day of the year?&lt;br&gt;&#xA;The answer depends on whether the year is a leap year or not.&lt;/p&gt;&#xA;&lt;p&gt;Write a function that will help you determine the date if you know the number of the day in the year, as well as whether the year is a leap year or not.&lt;br&gt;&#xA;The function accepts the day number and a boolean value &lt;code&gt;isLeap&lt;/code&gt; as arguments, and returns the corresponding date of the year as a string &lt;code&gt;&amp;quot;Month, day&amp;quot;&lt;/code&gt;.&lt;br&gt;&#xA;Only valid combinations of a day number and &lt;code&gt;isLeap&lt;/code&gt; will be tested.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Correct the time-string in Java</title>
      <link>https://andrewodendaal.com/correct-the-time-string-in-java/</link>
      <pubDate>Sun, 04 Apr 2021 01:20:03 +0000</pubDate>
      <guid>https://andrewodendaal.com/correct-the-time-string-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You have to create a method, that corrects a given time string.&lt;/li&gt;&#xA;&lt;li&gt;There was a problem in addition, so many of the time strings are broken.&lt;/li&gt;&#xA;&lt;li&gt;Time is formatted using the 24-hour clock, so from &lt;code&gt;00:00:00&lt;/code&gt; to &lt;code&gt;23:59:59&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;09:10:01&amp;#34; -&amp;gt; &amp;#34;09:10:01&amp;#34;  &#xA;&amp;#34;11:70:10&amp;#34; -&amp;gt; &amp;#34;12:10:10&amp;#34;  &#xA;&amp;#34;19:99:99&amp;#34; -&amp;gt; &amp;#34;20:40:39&amp;#34;  &#xA;&amp;#34;24:01:01&amp;#34; -&amp;gt; &amp;#34;00:01:01&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution {&#xA; public static String timeCorrect(String timestring) {&#xA;    if (timestring == null || !timestring.matches(&amp;#34;^\\d{2}:\\d{2}:\\d{2}$&amp;#34;)) {&#xA;      return null;&#xA;    }&#xA;    String[] split = timestring.split(&amp;#34;:&amp;#34;);&#xA;    int h = Integer.parseInt(split[0]);&#xA;    int m = Integer.parseInt(split[1]);&#xA;    int s = Integer.parseInt(split[2]);&#xA;    m += s / 60;&#xA;    s = s % 60;&#xA;    h += m / 60;&#xA;    m = m % 60;&#xA;    h = h % 24;&#xA;    return String.format(&amp;#34;%02d:%02d:%02d&amp;#34;, h, m, s);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Shifter Words Challenge in Java</title>
      <link>https://andrewodendaal.com/shifter-words-challenge-in-java/</link>
      <pubDate>Sat, 03 Apr 2021 00:07:43 +0000</pubDate>
      <guid>https://andrewodendaal.com/shifter-words-challenge-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You probably know that some characters written on a piece of paper, after turning this sheet 180 degrees, can be read, although sometimes in a different way. So, uppercase letters &amp;ldquo;H&amp;rdquo;, &amp;ldquo;I&amp;rdquo;, &amp;ldquo;N&amp;rdquo;, &amp;ldquo;O&amp;rdquo;, &amp;ldquo;S&amp;rdquo;, &amp;ldquo;X&amp;rdquo;, &amp;ldquo;Z&amp;rdquo; after rotation are not changed, the letter &amp;ldquo;M&amp;rdquo; becomes a &amp;ldquo;W&amp;rdquo;, and Vice versa, the letter &amp;ldquo;W&amp;rdquo; becomes a &amp;ldquo;M&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;We will call a word &amp;ldquo;shifter&amp;rdquo; if it consists only of letters &amp;ldquo;H&amp;rdquo;, &amp;ldquo;I&amp;rdquo;, &amp;ldquo;N&amp;rdquo;, &amp;ldquo;O&amp;rdquo;, &amp;ldquo;S&amp;rdquo;, &amp;ldquo;X&amp;rdquo;, &amp;ldquo;Z&amp;rdquo;, &amp;ldquo;M&amp;rdquo; and &amp;ldquo;W&amp;rdquo;. After turning the sheet, this word can also be read, although in a different way. So, the word &amp;ldquo;WOW &amp;ldquo;turns into the word &amp;ldquo;MOM&amp;rdquo;. On the other hand, the word &amp;ldquo;HOME&amp;rdquo; is not a shifter.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find Maximum and Minimum Values of a List in Java</title>
      <link>https://andrewodendaal.com/find-maximum-and-minimum-values-of-a-list-in-java/</link>
      <pubDate>Fri, 02 Apr 2021 01:16:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-maximum-and-minimum-values-of-a-list-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Make two functions, &lt;code&gt;max&lt;/code&gt; and &lt;code&gt;min&lt;/code&gt; that take a(n) array/vector of integers &lt;code&gt;list&lt;/code&gt; as input and outputs, respectively, the largest and lowest number in that array/vector.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;max({4,6,2,1,9,63,-134,566}) returns 566&#xA;min({-52, 56, 30, 29, -54, 0, -110}) returns -110&#xA;max({5}) returns 5&#xA;min({42, 54, 65, 87, 0}) returns 0&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;additionally&#34;&gt;Additionally&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You may consider that there will not be any empty arrays/vectors.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution {&#xA;&#xA;  public int min(int[] list) {&#xA;    java.util.Arrays.sort(list);&#xA;    return list[0];&#xA;  }&#xA;  &#xA;  public int max(int[] list) {&#xA;    java.util.Arrays.sort(list);&#xA;    return list[list.length-1];&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Valid Parentheses in Java</title>
      <link>https://andrewodendaal.com/valid-parentheses-in-java/</link>
      <pubDate>Thu, 01 Apr 2021 01:17:18 +0000</pubDate>
      <guid>https://andrewodendaal.com/valid-parentheses-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that takes a string of parentheses, and determines if the order of the parentheses is valid. The function should return &lt;code&gt;true&lt;/code&gt; if the string is valid, and &lt;code&gt;false&lt;/code&gt; if it&amp;rsquo;s invalid.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;()&amp;#34;              =&amp;gt;  true&#xA;&amp;#34;)(()))&amp;#34;          =&amp;gt;  false&#xA;&amp;#34;(&amp;#34;               =&amp;gt;  false&#xA;&amp;#34;(())((()())())&amp;#34;  =&amp;gt;  true&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;constraints&#34;&gt;Constraints&lt;/h3&gt;&#xA;&lt;p&gt;&lt;code&gt;0 &amp;lt;= input.length &amp;lt;= 100&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Along with opening (&lt;code&gt;(&lt;/code&gt;) and closing (&lt;code&gt;)&lt;/code&gt;) parenthesis, input may contain any valid ASCII characters. Furthermore, the input string may be empty and/or not contain any parentheses at all. Do &lt;strong&gt;not&lt;/strong&gt; treat other forms of brackets as parentheses (e.g. &lt;code&gt;[]&lt;/code&gt;, &lt;code&gt;{}&lt;/code&gt;, &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt;).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Boggle Word Checker in Java</title>
      <link>https://andrewodendaal.com/boggle-word-checker-in-java/</link>
      <pubDate>Wed, 31 Mar 2021 00:38:07 +0000</pubDate>
      <guid>https://andrewodendaal.com/boggle-word-checker-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that determines whether a string is a valid guess in a Boggle board, as per the rules of Boggle. A Boggle board is a 2D array of individual characters, e.g.:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[ [&amp;#39;I&amp;#39;,&amp;#39;L&amp;#39;,&amp;#39;A&amp;#39;,&amp;#39;W&amp;#39;],&#xA;  [&amp;#39;B&amp;#39;,&amp;#39;N&amp;#39;,&amp;#39;G&amp;#39;,&amp;#39;E&amp;#39;],&#xA;  [&amp;#39;I&amp;#39;,&amp;#39;U&amp;#39;,&amp;#39;A&amp;#39;,&amp;#39;O&amp;#39;],&#xA;  [&amp;#39;A&amp;#39;,&amp;#39;S&amp;#39;,&amp;#39;R&amp;#39;,&amp;#39;L&amp;#39;] ]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Valid guesses are strings which can be formed by connecting adjacent cells (horizontally, vertically, or diagonally) without re-using any previously used cells.&lt;/p&gt;&#xA;&lt;p&gt;For example, in the above board &amp;ldquo;BINGO&amp;rdquo;, &amp;ldquo;LINGO&amp;rdquo;, and &amp;ldquo;ILNBIA&amp;rdquo; would all be valid guesses, while &amp;ldquo;BUNGIE&amp;rdquo;, &amp;ldquo;BINS&amp;rdquo;, and &amp;ldquo;SINUS&amp;rdquo; would not.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Build a pile of Cubes in Kotlin</title>
      <link>https://andrewodendaal.com/build-a-pile-of-cubes-in-kotlin/</link>
      <pubDate>Tue, 30 Mar 2021 00:18:55 +0000</pubDate>
      <guid>https://andrewodendaal.com/build-a-pile-of-cubes-in-kotlin/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Your task is to construct a building which will be a pile of n cubes. The cube at the bottom will have a volume of n^3, the cube above will have volume of (n-1)^3 and so on until the top which will have a volume of 1^3.&lt;/p&gt;&#xA;&lt;p&gt;You are given the total volume m of the building. Being given m can you find the number n of cubes you will have to build?&lt;/p&gt;</description>
    </item>
    <item>
      <title>Which x for that sum in Kotlin</title>
      <link>https://andrewodendaal.com/which-x-for-that-sum-in-kotlin/</link>
      <pubDate>Mon, 29 Mar 2021 01:16:35 +0000</pubDate>
      <guid>https://andrewodendaal.com/which-x-for-that-sum-in-kotlin/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Consider the sequence &lt;code&gt;U(n, x) = x + 2x**2 + 3x**3 + .. + nx**n&lt;/code&gt; where x is a real number and n a positive integer.&lt;/p&gt;&#xA;&lt;p&gt;When &lt;code&gt;n&lt;/code&gt; goes to infinity and &lt;code&gt;x&lt;/code&gt; has a correct value (ie &lt;code&gt;x&lt;/code&gt; is in its domain of convergence &lt;code&gt;D&lt;/code&gt;), &lt;code&gt;U(n, x)&lt;/code&gt; goes to a finite limit &lt;code&gt;m&lt;/code&gt; depending on &lt;code&gt;x&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Usually given &lt;code&gt;x&lt;/code&gt; we try to find &lt;code&gt;m&lt;/code&gt;. Here we will try to find &lt;code&gt;x&lt;/code&gt; (x real, 0 &amp;lt; x &amp;lt; 1) when &lt;code&gt;m&lt;/code&gt; is given (m real, m &amp;gt; 0).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Reverse the bits in an integer in Java</title>
      <link>https://andrewodendaal.com/reverse-the-bits-in-an-integer-in-java/</link>
      <pubDate>Sun, 28 Mar 2021 00:46:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/reverse-the-bits-in-an-integer-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that reverses the bits in an integer.&lt;/p&gt;&#xA;&lt;p&gt;For example, the number &lt;code&gt;417&lt;/code&gt; is &lt;code&gt;110100001&lt;/code&gt; in binary. Reversing the binary is &lt;code&gt;100001011&lt;/code&gt; which is &lt;code&gt;267&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You can assume that the number is not negative.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import static java.lang.Integer.*;&#xA;&#xA;interface BitsOfInteger {&#xA;  static int reverse_bits(int n) {&#xA;    return parseInt(new StringBuilder(toBinaryString(n)).reverse() + &amp;#34;&amp;#34;, 2);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class BitsOfInteger {&#xA;  public static int reverse_bits(int n) {&#xA;    return Integer.parseInt(new StringBuilder().append(Integer.toBinaryString(n)).reverse().toString(), 2);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Invert values in Kotlin</title>
      <link>https://andrewodendaal.com/invert-values-in-kotlin/</link>
      <pubDate>Sat, 27 Mar 2021 01:03:53 +0000</pubDate>
      <guid>https://andrewodendaal.com/invert-values-in-kotlin/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a set of numbers, return the additive inverse of each. Each positive becomes negatives, and the negatives become positives.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;invert([1,2,3,4,5]) == [-1,-2,-3,-4,-5]&#xA;invert([1,-2,3,-4,5]) == [-1,2,-3,4,-5]&#xA;invert([]) == []&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-kotlin-code&#34;&gt;The solution in Kotlin code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;fun invert(arr: IntArray) = arr.map { -it }.toIntArray()&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;fun invert(arr: IntArray): IntArray {&#xA;    return IntArray(arr.size){ -arr[it] }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;fun invert(arr: IntArray): IntArray {&#xA;    var x = 0&#xA;    while (x &amp;lt; arr.size) {&#xA;        arr[x] = arr[x] * -1&#xA;        x++&#xA;    }&#xA;    return arr&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Assert.*;&#xA;import org.junit.Test&#xA;&#xA;class TestExample {&#xA;  @Test&#xA;  fun testFixed() {&#xA;    assertArrayEquals(intArrayOf(-1,-2,-3,-4,-5), invert(intArrayOf(1,2,3,4,5)))&#xA;    assertArrayEquals(intArrayOf(-1,2,-3,4,-5), invert(intArrayOf(1,-2,3,-4,5)))&#xA;    assertArrayEquals(intArrayOf(), invert(intArrayOf()))&#xA;    assertArrayEquals(intArrayOf(0), invert(intArrayOf(0)))&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Spring Boot no main manifest attribute, in</title>
      <link>https://andrewodendaal.com/spring-boot-no-main-manifest-attribute-in/</link>
      <pubDate>Fri, 26 Mar 2021 01:42:14 +0000</pubDate>
      <guid>https://andrewodendaal.com/spring-boot-no-main-manifest-attribute-in/</guid>
      <description>&lt;p&gt;You have created a ./target/&lt;!-- raw HTML omitted --&gt;.jar and have tried to run it using &lt;code&gt;java -jar &amp;lt;app&amp;gt;.jar&lt;/code&gt; yet receive a &lt;code&gt;spring boot no main manifest attribute, in &amp;lt;app&amp;gt;.jar&lt;/code&gt; error.&lt;/p&gt;&#xA;&lt;p&gt;Good thing is that this is really easy to solve!&lt;/p&gt;&#xA;&lt;p&gt;You can generate your jar as follows instead:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;mvn package spring-boot:repackage&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Or you could adjust your pom.xml so that you can generate your jar using a simple &lt;code&gt;mvn package&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;plugin&amp;gt;&#xA;    &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;&#xA;    &amp;lt;artifactId&amp;gt;spring-boot-maven-plugin&amp;lt;/artifactId&amp;gt;&#xA;    &amp;lt;configuration&amp;gt;&#xA;        &amp;lt;mainClass&amp;gt;com.example.Main&amp;lt;/mainClass&amp;gt;&#xA;    &amp;lt;/configuration&amp;gt;&#xA;    &amp;lt;executions&amp;gt;&#xA;        &amp;lt;execution&amp;gt;&#xA;            &amp;lt;goals&amp;gt;&#xA;                &amp;lt;goal&amp;gt;repackage&amp;lt;/goal&amp;gt;&#xA;            &amp;lt;/goals&amp;gt;&#xA;        &amp;lt;/execution&amp;gt;&#xA;    &amp;lt;/executions&amp;gt;&#xA;&amp;lt;/plugin&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Another option is to specify the following parent POM:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Moduli number system in Kotlin</title>
      <link>https://andrewodendaal.com/moduli-number-system-in-kotlin/</link>
      <pubDate>Thu, 25 Mar 2021 00:12:35 +0000</pubDate>
      <guid>https://andrewodendaal.com/moduli-number-system-in-kotlin/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;A number system with moduli is deﬁned by a vector of k moduli, &lt;code&gt;[m1,m2, ···,mk]&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The moduli must be &lt;code&gt;pairwise co-prime&lt;/code&gt;, which means that, for any pair of moduli, the only common factor is &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In such a system each number &lt;code&gt;n&lt;/code&gt; is represented by a string &lt;code&gt;&amp;quot;-x1--x2-- ... --xk-&amp;quot;&lt;/code&gt; of its residues, one for each modulus. The product &lt;code&gt;m1 * ... * mk&lt;/code&gt; must be greater than the given number &lt;code&gt;n&lt;/code&gt; which is to be converted in the moduli number system.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Smallest possible sum in Kotlin</title>
      <link>https://andrewodendaal.com/smallest-possible-sum-in-kotlin/</link>
      <pubDate>Wed, 24 Mar 2021 00:32:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/smallest-possible-sum-in-kotlin/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array X of positive integers, its elements are to be transformed by running the following operation on them as many times as required:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;if X[i] &amp;gt; X[j] then X[i] = X[i] - X[j]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;When no more transformations are possible, return its sum (&amp;ldquo;smallest possible sum&amp;rdquo;).&lt;/p&gt;&#xA;&lt;p&gt;For instance, the successive transformation of the elements of input X = [6, 9, 21] is detailed below:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;X_1 = [6, 9, 12] # -&amp;gt; X_1[2] = X[2] - X[1] = 21 - 9&#xA;X_2 = [6, 9, 6]  # -&amp;gt; X_2[2] = X_1[2] - X_1[0] = 12 - 6&#xA;X_3 = [6, 3, 6]  # -&amp;gt; X_3[1] = X_2[1] - X_2[0] = 9 - 6&#xA;X_4 = [6, 3, 3]  # -&amp;gt; X_4[2] = X_3[2] - X_3[1] = 6 - 3&#xA;X_5 = [3, 3, 3]  # -&amp;gt; X_5[1] = X_4[0] - X_4[1] = 6 - 3&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The returning output is the sum of the final transformation (here 9).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Floating-point Approximation in Kotlin</title>
      <link>https://andrewodendaal.com/floating-point-approximation-in-kotlin/</link>
      <pubDate>Tue, 23 Mar 2021 00:01:12 +0000</pubDate>
      <guid>https://andrewodendaal.com/floating-point-approximation-in-kotlin/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a semi-inclusive interval &lt;code&gt;I = [l, u)&lt;/code&gt; (l is in interval I but u is not) &lt;code&gt;l&lt;/code&gt; and &lt;code&gt;u&lt;/code&gt; being floating numbers &lt;code&gt;(0 &amp;lt;= l &amp;lt; u)&lt;/code&gt;,&lt;/li&gt;&#xA;&lt;li&gt;an integer &lt;code&gt;n (n &amp;gt; 0)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;a function &lt;code&gt;f: x (float number) -&amp;gt; f(x) (float number)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;we want to return as a list the &lt;code&gt;n&lt;/code&gt; values:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;f(l), f(l + d), ..., f(u -d)&lt;/code&gt; where &lt;code&gt;d = (u - l) / n&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Multiplication table in Kotlin</title>
      <link>https://andrewodendaal.com/multiplication-table-in-kotlin/</link>
      <pubDate>Mon, 22 Mar 2021 01:03:52 +0000</pubDate>
      <guid>https://andrewodendaal.com/multiplication-table-in-kotlin/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create an NxN multiplication table, of size provided in parameter.&lt;/p&gt;&#xA;&lt;p&gt;for example, when given &lt;code&gt;size&lt;/code&gt; is 3:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;1 2 3&#xA;2 4 6&#xA;3 6 9&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;for given example, the return value should be: &lt;code&gt;[[1,2,3],[2,4,6],[3,6,9]]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-kotlin&#34;&gt;The solution in Kotlin&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;&#xA;object Solution {&#xA;    fun multiplicationTable(size: Int) = Array&amp;lt;IntArray&amp;gt;(size) {&#xA;        i -&amp;gt; (1..size).map { it * (i + 1) }.toIntArray()&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;package solution&#xA;&#xA;object Solution {&#xA;    fun multiplicationTable(size: Int): Array&amp;lt;IntArray&amp;gt; {&#xA;        return Array(size){i -&amp;gt; IntArray(size){(it + 1) * (i + 1)}}&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Strip Comments in Kotlin</title>
      <link>https://andrewodendaal.com/strip-comments-in-kotlin/</link>
      <pubDate>Sun, 21 Mar 2021 00:32:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/strip-comments-in-kotlin/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the solution so that it strips all text that follows any of a set of comment markers passed in. Any whitespace at the end of the line should also be stripped out.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Given an input string of:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;apples, pears # and bananas&#xA;grapes&#xA;bananas !apples&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The output expected would be:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;apples, pears&#xA;grapes&#xA;bananas&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The code would be called like so:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var result = solution(&amp;#34;apples, pears # and bananas\ngrapes\nbananas !apples&amp;#34;, charArrayOf(&amp;#39;#&amp;#39;, &amp;#39;!&amp;#39;))&#xA;// result should == &amp;#34;apples, pears\ngrapes\nbananas&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-kotlin&#34;&gt;The solution in Kotlin&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Experimenting with a sequence of complex numbers in Kotlin</title>
      <link>https://andrewodendaal.com/experimenting-with-a-sequence-of-complex-numbers-in-kotlin/</link>
      <pubDate>Sat, 20 Mar 2021 00:13:17 +0000</pubDate>
      <guid>https://andrewodendaal.com/experimenting-with-a-sequence-of-complex-numbers-in-kotlin/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Consider the sequence &lt;code&gt;S(n, z) = (1 - z)(z + z**2 + z**3 + ... + z**n)&lt;/code&gt; where &lt;code&gt;z&lt;/code&gt; is a complex number and &lt;code&gt;n&lt;/code&gt; a positive integer (n &amp;gt; 0).&lt;/p&gt;&#xA;&lt;p&gt;When &lt;code&gt;n&lt;/code&gt; goes to infinity and &lt;code&gt;z&lt;/code&gt; has a correct value (ie &lt;code&gt;z&lt;/code&gt; is in its domain of convergence &lt;code&gt;D&lt;/code&gt;), &lt;code&gt;S(n, z)&lt;/code&gt; goes to a finite limit &lt;code&gt;lim&lt;/code&gt; depending on &lt;code&gt;z&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Experiment with &lt;code&gt;S(n, z)&lt;/code&gt; to guess the domain of convergence &lt;code&gt;D&lt;/code&gt;of &lt;code&gt;S&lt;/code&gt; and &lt;code&gt;lim&lt;/code&gt; value when &lt;code&gt;z&lt;/code&gt; is in &lt;code&gt;D&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>pt-online-schema-change Add Index</title>
      <link>https://andrewodendaal.com/pt-online-schema-change-add-index/</link>
      <pubDate>Fri, 19 Mar 2021 02:02:48 +0000</pubDate>
      <guid>https://andrewodendaal.com/pt-online-schema-change-add-index/</guid>
      <description>&lt;p&gt;Percona has a great toolkit that allows you to perform schema changes on a MySQL or MariaDB database without any downtime, it works by creating a new table with the same schema, making the changes to it and applying triggers for insertion, deletion and all updates, all while performing your valuable schema updates for you!&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-add-an-index-to-a-mysql-or-mariadb-database-without-downtime&#34;&gt;How to Add an Index to a MySQL or MariaDB database without downtime&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;pt-online-schema-change --alter &#39;add index ix_&amp;lt;COLUMN_NAME&amp;gt; (&amp;lt;COLUMN_NAME&amp;gt;)&#39; D=&amp;lt;DATABASE_NAME&amp;gt;,t=&amp;lt;TABLE_NAME&amp;gt; --dry-run&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sums of Parts in Kotlin</title>
      <link>https://andrewodendaal.com/sums-of-parts-in-kotlin/</link>
      <pubDate>Thu, 18 Mar 2021 01:26:54 +0000</pubDate>
      <guid>https://andrewodendaal.com/sums-of-parts-in-kotlin/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Let us consider this example (array written in general format):&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;ls = [0, 1, 3, 6, 10]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Its following parts:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ls = [0, 1, 3, 6, 10]&#xA;ls = [1, 3, 6, 10]&#xA;ls = [3, 6, 10]&#xA;ls = [6, 10]&#xA;ls = [10]&#xA;ls = []&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The corresponding sums are (put together in a list): &lt;code&gt;[20, 20, 19, 16, 10, 0]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;The function &lt;code&gt;parts_sums&lt;/code&gt; (or its variants in other languages) will take as parameter a list &lt;code&gt;ls&lt;/code&gt; and return a list of the sums of its parts as defined above.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Diophantine Equation in Kotlin</title>
      <link>https://andrewodendaal.com/diophantine-equation-in-kotlin/</link>
      <pubDate>Wed, 17 Mar 2021 01:52:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/diophantine-equation-in-kotlin/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In mathematics, a &lt;!-- raw HTML omitted --&gt;Diophantine equation&lt;!-- raw HTML omitted --&gt; is a polynomial equation, usually with two or more unknowns, such that only the integer solutions are sought or studied.&lt;/p&gt;&#xA;&lt;p&gt;In this challenge we want to find all integers &lt;code&gt;x, y&lt;/code&gt; (&lt;code&gt;x &amp;gt;= 0, y &amp;gt;= 0&lt;/code&gt;) solutions of a diophantine equation of the form:&lt;/p&gt;&#xA;&lt;h4 id=&#34;x2---4--y2--n&#34;&gt;x&lt;!-- raw HTML omitted --&gt;2&lt;!-- raw HTML omitted --&gt; – 4 * y&lt;!-- raw HTML omitted --&gt;2&lt;!-- raw HTML omitted --&gt; = n&lt;/h4&gt;&#xA;&lt;p&gt;(where the unknowns are &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt;, and &lt;code&gt;n&lt;/code&gt; is a given positive number) in decreasing order of the positive x&lt;!-- raw HTML omitted --&gt;i&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Matrix Addition in Java</title>
      <link>https://andrewodendaal.com/matrix-addition-in-java/</link>
      <pubDate>Tue, 16 Mar 2021 00:15:33 +0000</pubDate>
      <guid>https://andrewodendaal.com/matrix-addition-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that accepts two square matrices (&lt;code&gt;N x N&lt;/code&gt; two dimensional arrays), and return the sum of the two. Both matrices being passed into the function will be of size &lt;code&gt;N x N&lt;/code&gt; (square), containing only integers.&lt;/p&gt;&#xA;&lt;p&gt;How to sum two matrices:&lt;/p&gt;&#xA;&lt;p&gt;Take each cell &lt;code&gt;[n][m]&lt;/code&gt; from the first matrix, and add it with the same &lt;code&gt;[n][m]&lt;/code&gt; cell from the second matrix. This will be cell &lt;code&gt;[n][m]&lt;/code&gt; of the solution matrix.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Numbers that are a power of their sum of digits  in Java</title>
      <link>https://andrewodendaal.com/numbers-that-are-a-power-of-their-sum-of-digits-in-java/</link>
      <pubDate>Mon, 15 Mar 2021 00:18:55 +0000</pubDate>
      <guid>https://andrewodendaal.com/numbers-that-are-a-power-of-their-sum-of-digits-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The number 81 has a special property, a certain power of the sum of its digits is equal to 81 (nine squared). Eighty one (81), is the first number in having this property (not considering numbers of one digit). The next one, is 512. Let&amp;rsquo;s see both cases with the details&lt;/p&gt;&#xA;&lt;p&gt;8 + 1 = 9 and 9&lt;!-- raw HTML omitted --&gt;2&lt;!-- raw HTML omitted --&gt; = 81&lt;/p&gt;</description>
    </item>
    <item>
      <title>Integer triangles in Java</title>
      <link>https://andrewodendaal.com/integer-triangles-in-java/</link>
      <pubDate>Sun, 14 Mar 2021 01:36:29 +0000</pubDate>
      <guid>https://andrewodendaal.com/integer-triangles-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You have to give the number of different integer triangles with one angle of 120 degrees which perimeters are under or equal a certain value. Each side of an integer triangle is an integer value.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// number of integer triangles,&#xA;give_triang(max. perimeter)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;with sides a, b, and c integers such that:&lt;/p&gt;&#xA;&lt;p&gt;a + b + c &amp;lt;= max. perimeter&lt;/p&gt;&#xA;&lt;p&gt;See some of the following cases&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// No Integer triangles with perimeter under or equal five&#xA;give_triang(5) // 0&#xA;&#xA;// One integer triangle of (120 degrees). It&amp;#39;s (3, 5, 7)&#xA;give_triang(15) // 1&#xA;&#xA;// Three triangles: (3, 5, 7), (6, 10, 14) and (7, 8, 13)&#xA;give_triang(30) // 3&#xA;&#xA;// (3, 5, 7), (5, 16, 19), (6, 10, 14), (7, 8, 13) and (9, 15, 21) are the triangles with perim under or equal 50.&#xA;give_triang(50) // 5&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Minimum path in squares in Java</title>
      <link>https://andrewodendaal.com/minimum-path-in-squares-in-java/</link>
      <pubDate>Sat, 13 Mar 2021 01:49:30 +0000</pubDate>
      <guid>https://andrewodendaal.com/minimum-path-in-squares-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You&amp;rsquo;re given a square consisting of random numbers, like so:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var square = [&#xA;    [1,2,3],&#xA;    [4,8,2],&#xA;    [1,5,3]&#xA;];&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Your job is to calculate the minimum total cost when moving from the upper left corner to the coordinate given. You&amp;rsquo;re only allowed to move right or down.&lt;/p&gt;&#xA;&lt;p&gt;In the above example the minimum path would be:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var square = [&#xA;    [1,2,3],&#xA;    [_,_,2],&#xA;    [_,_,3]&#xA;];&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Giving a total of 11. Start and end position are included.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Pascal’s Diagonals in Java</title>
      <link>https://andrewodendaal.com/pascals-diagonals-in-java/</link>
      <pubDate>Fri, 12 Mar 2021 00:05:17 +0000</pubDate>
      <guid>https://andrewodendaal.com/pascals-diagonals-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function that returns an array containing the first &lt;code&gt;l&lt;/code&gt; digits from the &lt;code&gt;n&lt;/code&gt;th diagonal of &lt;!-- raw HTML omitted --&gt;Pascal&amp;rsquo;s triangle&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;n = 0&lt;/code&gt; should generate the first diagonal of the triangle (the ‘ones&amp;rsquo;). The first number in each diagonal should be 1.&lt;/p&gt;&#xA;&lt;p&gt;If &lt;code&gt;l = 0&lt;/code&gt;, return an empty array. Assume that both &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;l&lt;/code&gt; will be non-negative integers in all test cases.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Maximum Contiguous Sum in Java</title>
      <link>https://andrewodendaal.com/maximum-contiguous-sum-in-java/</link>
      <pubDate>Thu, 11 Mar 2021 01:22:05 +0000</pubDate>
      <guid>https://andrewodendaal.com/maximum-contiguous-sum-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an unsorted array of integer values, find the maximum positive sum of any contiguous range within the array.&lt;/p&gt;&#xA;&lt;p&gt;An array containing only negative values can return 0. Your solution should be efficient enough to not throw a timeout exception.&lt;/p&gt;&#xA;&lt;h3 id=&#34;example&#34;&gt;Example:&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// returns 24&#xA;maxContiguousSum([3, -4, 8, 7, -10, 19, -3]);&#xA;&#xA;// returns 5&#xA;maxContiguousSum([-8, -10, -12, -2, -3, 5]);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;visual-example&#34;&gt;Visual example:&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[3, -4, 8, 7, -10, 19, -3]&#xA;       |_____________|&#xA;             ||&#xA;             \/&#xA;             24&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fibonacci Streaming in Java</title>
      <link>https://andrewodendaal.com/fibonacci-streaming-in-java/</link>
      <pubDate>Wed, 10 Mar 2021 00:03:12 +0000</pubDate>
      <guid>https://andrewodendaal.com/fibonacci-streaming-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You&amp;rsquo;re going to provide a needy programmer a utility method that generates an infinite sized, sequential &lt;code&gt;IntStream&lt;/code&gt; which contains all the numbers in a fibonacci sequence.&lt;/p&gt;&#xA;&lt;p&gt;A fibonacci sequence starts with two &lt;code&gt;1&lt;/code&gt;s. Every element afterwards is the sum of the two previous elements. See:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;1, 1, 2, 3, 5, 8, 13, ..., 89, 144, 233, 377, ...&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.function.IntSupplier;&#xA;import java.util.stream.IntStream;&#xA;&#xA;public class Utility {&#xA;&#xA;    public static IntStream generateFibonacciSequence() {&#xA;        return IntStream.generate(new IntSupplier() {&#xA;            int a = 0;&#xA;            int b = 1;&#xA;&#xA;            @Override&#xA;            public int getAsInt() {&#xA;                int x = a + b;&#xA;                a = b;&#xA;                b = x;&#xA;                return a;&#xA;            }&#xA;        });&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Base-2 in Java</title>
      <link>https://andrewodendaal.com/base-2-in-java/</link>
      <pubDate>Tue, 09 Mar 2021 02:06:06 +0000</pubDate>
      <guid>https://andrewodendaal.com/base-2-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In this challenge you must convert integers numbers from and to a negative-base binary system.&lt;/p&gt;&#xA;&lt;p&gt;Negative-base systems can accommodate all the same numbers as standard place-value systems, but both positive and negative numbers are represented without the use of a minus sign (or, in computer representation, a sign bit); this advantage is countered by an increased complexity of arithmetic operations.&lt;/p&gt;&#xA;&lt;p&gt;To help understand, the first eight digits (in decimal) of the Base(-2) system is:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Unique digits sequence in Java</title>
      <link>https://andrewodendaal.com/unique-digits-sequence-in-java/</link>
      <pubDate>Mon, 08 Mar 2021 09:20:57 +0000</pubDate>
      <guid>https://andrewodendaal.com/unique-digits-sequence-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Consider the following series:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;0,1,2,3,4,5,6,7,8,9,10,22,11,20,13,24...&lt;/code&gt;There is nothing special between numbers `` and &lt;code&gt;10&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s start with the number &lt;code&gt;10&lt;/code&gt; and derive the sequence. &lt;code&gt;10&lt;/code&gt; has digits &lt;code&gt;1&lt;/code&gt; and &lt;code&gt;. The next possible number that does not have a&amp;amp;nbsp;`1`&amp;amp;nbsp;or a&amp;amp;nbsp;&lt;/code&gt; is &lt;code&gt;22&lt;/code&gt;. All other numbers between &lt;code&gt;10&lt;/code&gt; and &lt;code&gt;22&lt;/code&gt; have a &lt;code&gt;1&lt;/code&gt; or a ``.&lt;/p&gt;&#xA;&lt;p&gt;From &lt;code&gt;22&lt;/code&gt;, the next number that does not have a &lt;code&gt;2&lt;/code&gt; is &lt;code&gt;11&lt;/code&gt;. Note that &lt;code&gt;30&lt;/code&gt; is also a possibility because it is the next &lt;em&gt;higher&lt;/em&gt; number that does not have a &lt;code&gt;2&lt;/code&gt;, but we must select the &lt;em&gt;lowest&lt;/em&gt; number that fits and &lt;strong&gt;is not already in the sequence&lt;/strong&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Palindrome integer composition in Java</title>
      <link>https://andrewodendaal.com/palindrome-integer-composition-in-java/</link>
      <pubDate>Sun, 07 Mar 2021 01:07:31 +0000</pubDate>
      <guid>https://andrewodendaal.com/palindrome-integer-composition-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The palindromic number &lt;code&gt;595&lt;/code&gt; is interesting because it can be written as the sum of consecutive squares: &lt;code&gt;6^2 + 7^2 + 8^2 + 9^2 + 10^2 + 11^2 + 12^2 = 595&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;There are exactly eleven palindromes below one-thousand that can be written as consecutive square sums. Note that &lt;code&gt;1 = 0^2 + 1^2&lt;/code&gt; has not been included as this problem is concerned with the squares of positive integers.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Count IP Addresses in Java</title>
      <link>https://andrewodendaal.com/count-ip-addresses-in-java/</link>
      <pubDate>Sat, 06 Mar 2021 00:28:26 +0000</pubDate>
      <guid>https://andrewodendaal.com/count-ip-addresses-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Implement a function that receives two IPv4 addresses, and returns the number of addresses between them (including the first one, excluding the last one).&lt;/p&gt;&#xA;&lt;p&gt;All inputs will be valid IPv4 addresses in the form of strings. The last address will always be greater than the first one.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ips_between(&amp;#34;10.0.0.0&amp;#34;, &amp;#34;10.0.0.50&amp;#34;)  ==   50 &#xA;ips_between(&amp;#34;10.0.0.0&amp;#34;, &amp;#34;10.0.1.0&amp;#34;)   ==  256 &#xA;ips_between(&amp;#34;20.0.0.10&amp;#34;, &amp;#34;20.0.1.0&amp;#34;)  ==  246&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class CountIPAddresses {&#xA;&#xA;  public static long ipsBetween(String start, String end) {&#xA;    return convertToLong(end) - convertToLong(start);&#xA;  }&#xA;  &#xA;  private static long convertToLong(String ip) {&#xA;    long res = 0;&#xA;    for (String s : ip.split(&amp;#34;[.]&amp;#34;) )&#xA;      res = res * 256 + Long.parseLong(s);&#xA;    return res;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Shortest Knight Path in Java</title>
      <link>https://andrewodendaal.com/shortest-knight-path-in-java/</link>
      <pubDate>Fri, 05 Mar 2021 01:11:09 +0000</pubDate>
      <guid>https://andrewodendaal.com/shortest-knight-path-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given two different positions on a chess board, find the least number of moves it would take a knight to get from one to the other. The positions will be passed as two arguments in algebraic notation. For example, &lt;code&gt;knight(&amp;quot;a3&amp;quot;, &amp;quot;b5&amp;quot;)&lt;/code&gt; should return 1.&lt;/p&gt;&#xA;&lt;p&gt;The knight is not allowed to move off the board. The board is 8×8.&lt;/p&gt;&#xA;&lt;p&gt;For information on knight moves, see &lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Knight_%28chess%29&#34;&gt;https://en.wikipedia.org/wiki/Knight_%28chess%29&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>All Balanced Parentheses in Java</title>
      <link>https://andrewodendaal.com/all-balanced-parentheses-in-java/</link>
      <pubDate>Thu, 04 Mar 2021 02:13:33 +0000</pubDate>
      <guid>https://andrewodendaal.com/all-balanced-parentheses-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that makes a list of strings representing all of the ways you can balance &lt;code&gt;n&lt;/code&gt; pairs of parentheses&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;balancedParens(0) returns ArrayList&amp;lt;String&amp;gt; with element:  &amp;#34;&amp;#34;&#xA;balancedParens(1) returns ArrayList&amp;lt;String&amp;gt; with element:  &amp;#34;()&amp;#34;&#xA;balancedParens(2) returns ArrayList&amp;lt;String&amp;gt; with elements: &amp;#34;()()&amp;#34;,&amp;#34;(())&amp;#34;&#xA;balancedParens(3) returns ArrayList&amp;lt;String&amp;gt; with elements: &amp;#34;()()()&amp;#34;,&amp;#34;(())()&amp;#34;,&amp;#34;()(())&amp;#34;,&amp;#34;(()())&amp;#34;,&amp;#34;((()))&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.ArrayList;&#xA;&#xA;public class BalancedParens {&#xA;&#xA;    public static ArrayList &amp;lt;String&amp;gt; balancedParens (int n) {&#xA;        ArrayList&amp;lt;String&amp;gt; lst = new ArrayList&amp;lt;&amp;gt;();&#xA;        StringBuilder sb = new StringBuilder();&#xA;        dfs(sb,lst,0,0,n);&#xA;        return lst;&#xA;    }&#xA;    &#xA;    private static void dfs(StringBuilder sb, ArrayList&amp;lt;String&amp;gt; lst, int open, int close, int max) {&#xA;        if (close==max) {&#xA;            lst.add(sb.toString());&#xA;            return;&#xA;        }&#xA;        if (open&amp;gt;close)  {&#xA;            sb.append(&amp;#39;)&amp;#39;);&#xA;            dfs(sb,lst,open,close+1,max);&#xA;            sb.deleteCharAt(sb.length()-1);&#xA;        }&#xA;        if (open&amp;lt;max) {&#xA;            sb.append(&amp;#39;(&amp;#39;);&#xA;            dfs(sb,lst,open+1,close,max);&#xA;            sb.deleteCharAt(sb.length()-1);&#xA;        }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Human readable duration format in Java</title>
      <link>https://andrewodendaal.com/human-readable-duration-format-in-java/</link>
      <pubDate>Wed, 03 Mar 2021 02:40:07 +0000</pubDate>
      <guid>https://andrewodendaal.com/human-readable-duration-format-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Your task in order to complete this challenge is to write a function which formats a duration, given as a number of seconds, in a human-friendly way.&lt;/p&gt;&#xA;&lt;p&gt;The function must accept a non-negative integer. If it is zero, it just returns &lt;code&gt;&amp;quot;now&amp;quot;&lt;/code&gt;. Otherwise, the duration is expressed as a combination of &lt;code&gt;years&lt;/code&gt;, &lt;code&gt;days&lt;/code&gt;, &lt;code&gt;hours&lt;/code&gt;, &lt;code&gt;minutes&lt;/code&gt; and &lt;code&gt;seconds&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;It is much easier to understand with an example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;//returns &amp;#34;1 minute and 2 seconds&amp;#34;&#xA;TimeFormatter.formatDuration(62)&#xA;&#xA;//returns &amp;#34;1 hour, 1 minute and 2 seconds&amp;#34;&#xA;TimeFormatter.formatDuration(3662)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;For the purpose of this challenge, a year is 365 days and a day is 24 hours.&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Simple string expansion in Java</title>
      <link>https://andrewodendaal.com/simple-string-expansion-in-java/</link>
      <pubDate>Tue, 02 Mar 2021 00:49:22 +0000</pubDate>
      <guid>https://andrewodendaal.com/simple-string-expansion-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Consider the following expansion:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// because &amp;#34;ab&amp;#34; repeats 3 times&#xA;solve(&amp;#34;3(ab)&amp;#34;) == &amp;#34;ababab&amp;#34;&#xA;&#xA;// because &amp;#34;a3(b)&amp;#34; == &amp;#34;abbb&amp;#34;, which repeats twice.&#xA;solve(&amp;#34;2(a3(b))&amp;#34;) == &amp;#34;abbbabbb&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Given a string, return the expansion of that string.&lt;/p&gt;&#xA;&lt;p&gt;Input will consist of only lowercase letters and numbers (1 to 9) in valid parenthesis. There will be no letters or numbers after the last closing parenthesis.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution{&#xA;    public static String solve(String s){&#xA;        String new_s = &amp;#34;&amp;#34;;&#xA;        for(char ch : new StringBuilder(s).reverse().toString().toCharArray()) {&#xA;          if(Character.isDigit(ch)) new_s = new_s.repeat(Integer.parseInt(ch + &amp;#34;&amp;#34;));&#xA;          if(Character.isLetter(ch)) new_s = ch + new_s; &#xA;        }&#xA;        return new_s;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Hamming Numbers in Java</title>
      <link>https://andrewodendaal.com/hamming-numbers-in-java/</link>
      <pubDate>Mon, 01 Mar 2021 02:14:22 +0000</pubDate>
      <guid>https://andrewodendaal.com/hamming-numbers-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;A &lt;em&gt;&lt;!-- raw HTML omitted --&gt;Hamming number&lt;!-- raw HTML omitted --&gt;&lt;/em&gt; is a positive integer of the form 2&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;i&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;3&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;j&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;5&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;k&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;, for some non-negative integers &lt;em&gt;i&lt;/em&gt;, &lt;em&gt;j&lt;/em&gt;, and &lt;em&gt;k&lt;/em&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Block sequence in Java</title>
      <link>https://andrewodendaal.com/block-sequence-in-java/</link>
      <pubDate>Sun, 28 Feb 2021 00:34:57 +0000</pubDate>
      <guid>https://andrewodendaal.com/block-sequence-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Consider the following array:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[1, 12, 123, 1234, 12345, 123456, 1234567, 12345678, 123456789, 12345678910, 1234567891011...]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If we join these blocks of numbers, we come up with an infinite sequence which starts with &lt;code&gt;112123123412345123456...&lt;/code&gt;. The list is infinite.&lt;/p&gt;&#xA;&lt;p&gt;You will be given an number (&lt;code&gt;n&lt;/code&gt;) and your task will be to return the element at that index in the sequence, where &lt;code&gt;1 ≤ n ≤ 10^18&lt;/code&gt;. Assume the indexes start with &lt;code&gt;1&lt;/code&gt;, not ``. For example:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Roman Numerals Helper in Java</title>
      <link>https://andrewodendaal.com/roman-numerals-helper-in-java/</link>
      <pubDate>Sat, 27 Feb 2021 00:44:15 +0000</pubDate>
      <guid>https://andrewodendaal.com/roman-numerals-helper-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a RomanNumerals class that can convert a roman numeral to and from an integer value. It should follow the API demonstrated in the examples below. Multiple roman numeral values will be tested for each helper method.&lt;/p&gt;&#xA;&lt;p&gt;Modern Roman numerals are written by expressing each digit separately starting with the left most digit and skipping any digit with a value of zero. In Roman numerals 1990 is rendered: 1000=M, 900=CM, 90=XC; resulting in MCMXC. 2008 is written as 2000=MM, 8=VIII; or MMVIII. 1666 uses each Roman symbol in descending order: MDCLXVI.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Closest pair of points in linearithmic time in Java</title>
      <link>https://andrewodendaal.com/closest-pair-of-points-in-linearithmic-time-in-java/</link>
      <pubDate>Fri, 26 Feb 2021 01:03:36 +0000</pubDate>
      <guid>https://andrewodendaal.com/closest-pair-of-points-in-linearithmic-time-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a number of points on a plane, your task is to find two points with the smallest distance between them in linearithmic &lt;!-- raw HTML omitted --&gt;O(n log n)&lt;!-- raw HTML omitted --&gt; time.&lt;/p&gt;&#xA;&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;  1  2  3  4  5  6  7  8  9&#xA;1  &#xA;2    . A&#xA;3                . D&#xA;4                   . F       &#xA;5             . C&#xA;6              &#xA;7                . E&#xA;8    . B&#xA;9                   . G&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For the plane above, the input will be:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find sum of top-left to bottom-right diagonals in Java</title>
      <link>https://andrewodendaal.com/find-sum-of-top-left-to-bottom-right-diagonals-in-java/</link>
      <pubDate>Thu, 25 Feb 2021 00:25:06 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-sum-of-top-left-to-bottom-right-diagonals-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a square matrix (i.e. an array of subarrays), find the sum of values from the first value of the first array, the second value of the second array, the third value of the third array, and so on…&lt;/p&gt;&#xA;&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;array = [[1, 2],&#xA;         [3, 4]]&#xA;&#xA;diagonal sum: 1 + 4 = 5&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;array = [[5, 9, 1, 0],&#xA;         [8, 7, 2, 3],&#xA;         [1, 4, 1, 9],&#xA;         [2, 3, 8, 2]]&#xA;&#xA;diagonal sum: 5 + 7 + 1 + 2 = 15&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sweeping trees in Java</title>
      <link>https://andrewodendaal.com/sweeping-trees-in-java/</link>
      <pubDate>Wed, 24 Feb 2021 00:02:18 +0000</pubDate>
      <guid>https://andrewodendaal.com/sweeping-trees-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You will be given a list of strings representing nodes in a &lt;!-- raw HTML omitted --&gt;rooted tree&lt;!-- raw HTML omitted --&gt;. A visual representation of a very simple rooted tree could be:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;        +----+&#xA;        |root|&#xA;        ++--++&#xA;         |  |&#xA;    +----+  +----+&#xA;    v            v&#xA;+------+      +------+&#xA;|node A|      |node B|&#xA;+------+      +------+&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this case, the root node has two children, nodes A and B. A more complex example would be:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Detect Pangram in Java</title>
      <link>https://andrewodendaal.com/detect-pangram-in-java/</link>
      <pubDate>Tue, 23 Feb 2021 00:51:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/detect-pangram-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;A pangram is a sentence that contains every single letter of the alphabet at least once. For example, the sentence &amp;ldquo;The quick brown fox jumps over the lazy dog&amp;rdquo; is a pangram, because it uses the letters A-Z at least once (case is irrelevant).&lt;/p&gt;&#xA;&lt;p&gt;Given a string, detect whether or not it is a pangram. Return True if it is, False if not. Ignore numbers and punctuation.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (using a Character loop):&lt;/p&gt;</description>
    </item>
    <item>
      <title>Remove the parentheses in Java</title>
      <link>https://andrewodendaal.com/remove-the-parentheses-in-java/</link>
      <pubDate>Mon, 22 Feb 2021 00:08:07 +0000</pubDate>
      <guid>https://andrewodendaal.com/remove-the-parentheses-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In this challenge you are given a string for example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;example(unwanted thing)example&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Your task is to remove everything inside the parentheses as well as the parentheses themselves.&lt;/p&gt;&#xA;&lt;p&gt;The example above would return:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;exampleexample&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;notes&#34;&gt;Notes&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Other than parentheses only letters and spaces can occur in the string. Don&amp;rsquo;t worry about other brackets like &lt;code&gt;&amp;quot;[]&amp;quot;&lt;/code&gt; and &lt;code&gt;&amp;quot;{}&amp;quot;&lt;/code&gt; as these will never appear.&lt;/li&gt;&#xA;&lt;li&gt;There can be multiple parentheses.&lt;/li&gt;&#xA;&lt;li&gt;The parentheses can be nested.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>What century is it in Java</title>
      <link>https://andrewodendaal.com/what-century-is-it-in-java/</link>
      <pubDate>Sun, 21 Feb 2021 00:25:29 +0000</pubDate>
      <guid>https://andrewodendaal.com/what-century-is-it-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Return the century of the input year. The input will always be a 4 digit string, so there is no need for validation.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;1999&amp;#34; --&amp;gt; &amp;#34;20th&amp;#34;&#xA;&amp;#34;2011&amp;#34; --&amp;gt; &amp;#34;21st&amp;#34;&#xA;&amp;#34;2154&amp;#34; --&amp;gt; &amp;#34;22nd&amp;#34;&#xA;&amp;#34;2259&amp;#34; --&amp;gt; &amp;#34;23rd&amp;#34;&#xA;&amp;#34;1124&amp;#34; --&amp;gt; &amp;#34;12th&amp;#34;&#xA;&amp;#34;2000&amp;#34; --&amp;gt; &amp;#34;20th&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution{&#xA;  public static String whatCentury(int year) {&#xA;    int century = (year + 99) / 100;&#xA;    if (century / 10 == 1) return century + &amp;#34;th&amp;#34;;&#xA;    switch(century % 10) {&#xA;      case 1: return century + &amp;#34;st&amp;#34;;&#xA;      case 2: return century + &amp;#34;nd&amp;#34;;&#xA;      case 3: return century + &amp;#34;rd&amp;#34;;&#xA;      default: return century + &amp;#34;th&amp;#34;;&#xA;    }&#xA;   }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Lost number in number sequence in Java</title>
      <link>https://andrewodendaal.com/lost-number-in-number-sequence-in-java/</link>
      <pubDate>Sat, 20 Feb 2021 01:12:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/lost-number-in-number-sequence-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;An ordered sequence of numbers from 1 to N is given. One number might have deleted from it, then the remaining numbers were mixed. Find the number that was deleted.&lt;/p&gt;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The starting array sequence is &lt;code&gt;[1,2,3,4,5,6,7,8,9]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;The mixed array with one deleted number is &lt;code&gt;[3,2,4,6,7,8,1,9]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Your function should return the int &lt;code&gt;5&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;If no number was deleted from the array and no difference with it, your function should return the int ``.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Simple string reversal in Java</title>
      <link>https://andrewodendaal.com/simple-string-reversal-in-java/</link>
      <pubDate>Fri, 19 Feb 2021 02:07:34 +0000</pubDate>
      <guid>https://andrewodendaal.com/simple-string-reversal-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In this challenge, we are going to reverse a string while maintaining the spaces (if any) in their original place.&lt;/p&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;solve(&amp;#34;our code&amp;#34;) = &amp;#34;edo cruo&amp;#34;&#xA;-- Normal reversal without spaces is &amp;#34;edocruo&amp;#34;. &#xA;-- However, there is a space at index 3, so the string becomes &amp;#34;edo cruo&amp;#34;&#xA;&#xA;solve(&amp;#34;your code rocks&amp;#34;) = &amp;#34;skco redo cruoy&amp;#34;. &#xA;solve(&amp;#34;andrew&amp;#34;) = &amp;#34;werdna&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;More examples in the test cases. All input will be lower case letters and in some cases spaces.&lt;/p&gt;</description>
    </item>
    <item>
      <title>int32 to IPv4 in Java</title>
      <link>https://andrewodendaal.com/int32-to-ipv4-in-java/</link>
      <pubDate>Thu, 18 Feb 2021 01:44:32 +0000</pubDate>
      <guid>https://andrewodendaal.com/int32-to-ipv4-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Take the following IPv4 address: &lt;code&gt;128.32.10.1&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;This address has 4 octets where each octet is a single byte (or 8 bits).&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1st octet &lt;code&gt;128&lt;/code&gt; has the binary representation: &lt;code&gt;10000000&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;2nd octet &lt;code&gt;32&lt;/code&gt; has the binary representation: &lt;code&gt;00100000&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;3rd octet &lt;code&gt;10&lt;/code&gt; has the binary representation: &lt;code&gt;00001010&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;4th octet &lt;code&gt;1&lt;/code&gt; has the binary representation: &lt;code&gt;00000001&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So &lt;code&gt;128.32.10.1&lt;/code&gt; == &lt;code&gt;10000000.00100000.00001010.00000001&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Because the above IP address has 32 bits, we can represent it as the unsigned 32-bit number: &lt;code&gt;2149583361&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Perimeter of squares in a rectangle in Java</title>
      <link>https://andrewodendaal.com/perimeter-of-squares-in-a-rectangle-in-java/</link>
      <pubDate>Wed, 17 Feb 2021 01:13:31 +0000</pubDate>
      <guid>https://andrewodendaal.com/perimeter-of-squares-in-a-rectangle-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The drawing shows 6 squares the sides of which have a length of 1, 1, 2, 3, 5, 8. It&amp;rsquo;s easy to see that the sum of the perimeters of these squares is : &lt;code&gt;4 * (1 + 1 + 2 + 3 + 5 + 8) = 4 * 20 = 80&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Could you give the sum of the perimeters of all the squares in a rectangle when there are n + 1 squares disposed in the same manner as in the drawing:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Palindrome chain length in Java</title>
      <link>https://andrewodendaal.com/palindrome-chain-length-in-java/</link>
      <pubDate>Tue, 16 Feb 2021 00:06:46 +0000</pubDate>
      <guid>https://andrewodendaal.com/palindrome-chain-length-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Number is a palindrome if it is equal to the number with digits in reversed order. For example, &lt;code&gt;5&lt;/code&gt;, &lt;code&gt;44&lt;/code&gt;, &lt;code&gt;171&lt;/code&gt;, &lt;code&gt;4884&lt;/code&gt; are palindromes, and &lt;code&gt;43&lt;/code&gt;, &lt;code&gt;194&lt;/code&gt;, &lt;code&gt;4773&lt;/code&gt; are not.&lt;/p&gt;&#xA;&lt;p&gt;Write a function which takes a positive integer and returns the number of special steps needed to obtain a palindrome. The special step is: &amp;ldquo;reverse the digits, and add to the original number&amp;rdquo;. If the resulting number is not a palindrome, repeat the procedure with the sum until the resulting number is a palindrome.&lt;/p&gt;</description>
    </item>
    <item>
      <title>String array duplicates in Java</title>
      <link>https://andrewodendaal.com/string-array-duplicates-in-java/</link>
      <pubDate>Mon, 15 Feb 2021 00:28:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/string-array-duplicates-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given an array of strings and your task is to remove all consecutive duplicate letters from each string in the array.&lt;/p&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;dup([&amp;quot;abracadabra&amp;quot;,&amp;quot;allottee&amp;quot;,&amp;quot;assessee&amp;quot;]) = [&amp;quot;abracadabra&amp;quot;,&amp;quot;alote&amp;quot;,&amp;quot;asese&amp;quot;]&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;dup([&amp;quot;kelless&amp;quot;,&amp;quot;keenness&amp;quot;]) = [&amp;quot;keles&amp;quot;,&amp;quot;kenes&amp;quot;]&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Strings will be lowercase only, no spaces. See test cases for more examples.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (using &lt;code&gt;StringBuilders&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution{    &#xA;    public static String[] dup(String[] arr){&#xA;        String[] strings = new String[arr.length];&#xA;&#xA;        for (int h = 0; h &amp;lt; arr.length; h++) {&#xA;&#xA;            String str = arr[h];&#xA;&#xA;            StringBuilder sb = new StringBuilder();&#xA;            char current = 0;&#xA;            char last = 0;&#xA;            for (int i = 0; i &amp;lt; str.length(); i++) {&#xA;                current = str.charAt(i);&#xA;                if (current!=last) sb.append(current);&#xA;                last = current;&#xA;            }&#xA;            strings[h] = sb.toString();&#xA;&#xA;        }&#xA;&#xA;        return strings;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2 (reusing the input array):&lt;/p&gt;</description>
    </item>
    <item>
      <title>Even or Odd Array Sum in Java</title>
      <link>https://andrewodendaal.com/even-or-odd-array-sum-in-java/</link>
      <pubDate>Sun, 14 Feb 2021 00:16:34 +0000</pubDate>
      <guid>https://andrewodendaal.com/even-or-odd-array-sum-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a list of numbers, determine whether the sum of its elements is odd or even.&lt;/p&gt;&#xA;&lt;p&gt;Give your answer as a string matching &lt;code&gt;&amp;quot;odd&amp;quot;&lt;/code&gt; or &lt;code&gt;&amp;quot;even&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;If the input array is empty consider it as: &lt;code&gt;[0]&lt;/code&gt; (array with a zero).&lt;/p&gt;&#xA;&lt;h3 id=&#34;example&#34;&gt;Example:&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;odd_or_even([0])          ==  &amp;#34;even&amp;#34;&#xA;odd_or_even([0, 1, 4])    ==  &amp;#34;odd&amp;#34;&#xA;odd_or_even([0, -1, -5])  ==  &amp;#34;even&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (using &lt;code&gt;streams&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution {&#xA;  public static String oddOrEven (int[] array) {&#xA;    return (java.util.Arrays.stream(array).sum()%2==0) &#xA;      ? &amp;#34;even&amp;#34; : &amp;#34;odd&amp;#34;;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2 (using &lt;code&gt;forloop&lt;/code&gt;):&lt;/p&gt;</description>
    </item>
    <item>
      <title>String Permutations in Java</title>
      <link>https://andrewodendaal.com/string-permutations-in-java/</link>
      <pubDate>Sat, 13 Feb 2021 00:04:28 +0000</pubDate>
      <guid>https://andrewodendaal.com/string-permutations-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In this challenge, you have to create all permutations of an input string and remove duplicates if present. This means you have to shuffle all letters from the input in all possible orders.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Permutations.singlePermutations(&amp;#34;a&amp;#34;) // [&amp;#34;a&amp;#34;]&#xA;Permutations.singlePermutations(&amp;#34;ab&amp;#34;) // [&amp;#34;ab&amp;#34;, &amp;#34;ba&amp;#34;]&#xA;Permutations.singlePermutations(&amp;#34;aabb&amp;#34;) // [&amp;#34;aabb&amp;#34;,&amp;#34;abab&amp;#34;,&amp;#34;abba&amp;#34;,&amp;#34;baab&amp;#34;,&amp;#34;baba&amp;#34;,&amp;#34;bbaa&amp;#34;]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The order of the permutations doesn&amp;rsquo;t matter.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import static java.util.Collections.singletonList;&#xA;import static java.util.stream.Collectors.toList;&#xA;&#xA;import java.util.List;&#xA;&#xA;class Permutations {&#xA;&#xA;  public static List&amp;lt;String&amp;gt; singlePermutations(final String s) {&#xA;    return permute(&amp;#34;&amp;#34;, s);&#xA;  }&#xA;&#xA;  private static List&amp;lt;String&amp;gt; permute(final String prefix, final String s) {&#xA;  &#xA;    return s.isEmpty()&#xA;        ? singletonList(prefix)&#xA;        : s.chars()&#xA;            .distinct()&#xA;            .mapToObj(i -&amp;gt; (char) i)&#xA;            .map(c -&amp;gt; permute(prefix + c, takeOut(s, c)))&#xA;            .flatMap(List::stream)&#xA;            .collect(toList());&#xA;  }&#xA;&#xA;  static String takeOut(final String s, final char c) {&#xA;    final int i = s.indexOf(c);&#xA;    return s.substring(0, i) + s.substring(i + 1);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Remove a Specific Element of an Array in Java</title>
      <link>https://andrewodendaal.com/remove-a-specific-element-of-an-array-in-java/</link>
      <pubDate>Fri, 12 Feb 2021 00:01:17 +0000</pubDate>
      <guid>https://andrewodendaal.com/remove-a-specific-element-of-an-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You will be given a certain array of length &lt;code&gt;n&lt;/code&gt;, such that &lt;code&gt;n &amp;gt; 4&lt;/code&gt;, having positive and negative integers but there will be no zeroes and all the elements will occur once in it.&lt;/p&gt;&#xA;&lt;p&gt;We may obtain an amount of &lt;code&gt;n&lt;/code&gt; sub-arrays of length &lt;code&gt;n - 1&lt;/code&gt;, removing one element at a time (from left to right).&lt;/p&gt;&#xA;&lt;p&gt;For each subarray, let&amp;rsquo;s calculate the product and sum of its elements with the corresponding absolute value of the quotient, &lt;code&gt;q = SubProduct/SubSum&lt;/code&gt; (if it is possible, SubSum cannot be 0). Then we select the array with the lowest value of &lt;code&gt;|q|&lt;/code&gt;(absolute value)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Upside down numbers in Java</title>
      <link>https://andrewodendaal.com/upside-down-numbers-in-java/</link>
      <pubDate>Thu, 11 Feb 2021 02:41:33 +0000</pubDate>
      <guid>https://andrewodendaal.com/upside-down-numbers-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Consider the numbers &lt;code&gt;6969&lt;/code&gt; and &lt;code&gt;9116&lt;/code&gt;. When you rotate them &lt;code&gt;180 degrees&lt;/code&gt; (upside down), these numbers remain the same. To clarify, if we write them down on a paper and turn the paper upside down, the numbers will be the same. Try it and see! Some numbers such as &lt;code&gt;2&lt;/code&gt; or &lt;code&gt;5&lt;/code&gt; don&amp;rsquo;t yield numbers when rotated.&lt;/p&gt;&#xA;&lt;p&gt;Given a range, return the count of upside down numbers within that range. For example, &lt;code&gt;solve(0,10) = 3&lt;/code&gt;, because there are only &lt;code&gt;3&lt;/code&gt; upside down numbers &lt;code&gt;&amp;gt;= 0 and &amp;lt; 10&lt;/code&gt;. They are &lt;code&gt;0, 1, 8&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rotate matrix counter-clockwise N times in Java</title>
      <link>https://andrewodendaal.com/rotate-matrix-counter-clockwise-n-times-in-java/</link>
      <pubDate>Wed, 10 Feb 2021 00:59:56 +0000</pubDate>
      <guid>https://andrewodendaal.com/rotate-matrix-counter-clockwise-n-times-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In this challenge your mission is to rotate matrix counter-clockwise &lt;code&gt;N&lt;/code&gt; times.&lt;/p&gt;&#xA;&lt;p&gt;So, you will have 2 inputs:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;1) matrix&#xA;&#xA;2) a number, how many times to turn it&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And the output is turned matrix.&lt;/p&gt;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;matrix = [[1, 2, 3, 4],&#xA;          [5, 6, 7, 8],&#xA;          [9, 10, 11, 12],&#xA;          [13, 14, 15, 16]]&#xA;&#xA;times_to_turn = 1&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It should return this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[[4, 8, 12, 16],&#xA; [3, 7, 11, 15],&#xA; [2, 6, 10, 14],&#xA; [1, 5, 9, 13]])&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note: all matrixes will be square. Also, random tests will have big numbers in the input (times to turn)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Unable to import module “lambda_function”: No module named “pymysql”</title>
      <link>https://andrewodendaal.com/unable-to-import-module-lambda_function-no-module-named-pymysql/</link>
      <pubDate>Tue, 09 Feb 2021 01:21:07 +0000</pubDate>
      <guid>https://andrewodendaal.com/unable-to-import-module-lambda_function-no-module-named-pymysql/</guid>
      <description>&lt;p&gt;If you receive the following error message when trying to run &lt;code&gt;pymysql&lt;/code&gt; on AWS Lambda:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Unable to import module &amp;quot;lambda_function&amp;quot;: No module named &amp;quot;pymysql&amp;quot;&lt;/code&gt; then you can fix this by running a Custom Lambda Layer.&lt;/p&gt;&#xA;&lt;p&gt;To do this, you can boot up an EC2 instance (or a Linux instance anywhere else) and run the following set of commands:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#create module directory&#xA;mkdir -p temp/python&#xA;cd temp/python&#xA;&#xA;#install pymysql module&#xA;pip install pymysql -t .&#xA;cd ..&#xA;&#xA;#create a zip file using installed module&#xA;zip -r9 ../pymysql.zip .&#xA;&#xA;#create the lambda layer&#xA;aws lambda publish-layer-version --layer-name pymysql \&#xA;--description &amp;#34;pymysql for mysql access&amp;#34; \&#xA;--zip-file fileb://../pymysql.zip \&#xA;--compatible-runtimes python3.8&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Once this is done, you will be able to head back to AWS Lambda, click on &lt;code&gt;Layers&lt;/code&gt; and view your custom layer waiting there for you to use!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Square Matrix Multiplication in Java</title>
      <link>https://andrewodendaal.com/square-matrix-multiplication-in-java/</link>
      <pubDate>Mon, 08 Feb 2021 00:21:56 +0000</pubDate>
      <guid>https://andrewodendaal.com/square-matrix-multiplication-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that accepts two square (&lt;code&gt;NxN&lt;/code&gt;) matrices (two dimensional arrays), and returns the product of the two. Only square matrices will be given.&lt;/p&gt;&#xA;&lt;p&gt;How to multiply two square matrices: &lt;/p&gt;&#xA;&lt;p&gt;We are given two matrices, A and B, of size 2×2 (note: tests are not limited to 2×2). Matrix C, the solution, will be equal to the product of A and B. To fill in cell &lt;code&gt;[0][0]&lt;/code&gt; of matrix C, you need to compute: &lt;code&gt;A[0][0] * B[0][0] + A[0][1] * B[1][0]&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Count the divisible numbers in Java</title>
      <link>https://andrewodendaal.com/count-the-divisible-numbers-in-java/</link>
      <pubDate>Sun, 07 Feb 2021 01:24:08 +0000</pubDate>
      <guid>https://andrewodendaal.com/count-the-divisible-numbers-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the function that takes 3 numbers &lt;code&gt;x, y and k&lt;/code&gt; (where &lt;code&gt;x ≤ y&lt;/code&gt;), and returns the number of integers within the range &lt;code&gt;[x..y]&lt;/code&gt; (both ends included) that are divisible by &lt;code&gt;k&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;More scientifically: &lt;code&gt;{ i : x ≤ i ≤ y, i mod k = 0 }&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;&#xA;&lt;p&gt;Given &lt;code&gt;x = 6, y = 11, k = 2&lt;/code&gt; the function should return &lt;code&gt;3&lt;/code&gt;, because there are three numbers divisible by &lt;code&gt;2&lt;/code&gt; between &lt;code&gt;6&lt;/code&gt; and &lt;code&gt;11&lt;/code&gt;: &lt;code&gt;6, 8, 10&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Averages of numbers in Java</title>
      <link>https://andrewodendaal.com/averages-of-numbers-in-java/</link>
      <pubDate>Sat, 06 Feb 2021 00:47:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/averages-of-numbers-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;h3 id=&#34;get-the-averages-of-these-numbers&#34;&gt;Get the averages of these numbers&lt;/h3&gt;&#xA;&lt;p&gt;Write a method, that gets an array of integer-numbers and return an array of the averages of each integer-number and his follower, if there is one.&lt;/p&gt;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Input:  [ 1, 3, 5, 1, -10]&#xA;Output:  [ 2, 4, 3, -4.5]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If the array has 0 or 1 values or is null, your method should return an empty array.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Decimal to Factorial and Back in Java</title>
      <link>https://andrewodendaal.com/decimal-to-factorial-and-back-in-java/</link>
      <pubDate>Fri, 05 Feb 2021 01:49:05 +0000</pubDate>
      <guid>https://andrewodendaal.com/decimal-to-factorial-and-back-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Coding decimal numbers with factorials is a way of writing out numbers in a base system that depends on factorials, rather than powers of numbers.&lt;/p&gt;&#xA;&lt;p&gt;In this system, the last digit is always `` and is in base 0!. The digit before that is either &lt;code&gt;0 or 1&lt;/code&gt; and is in base 1!. The digit before that is either &lt;code&gt;0, 1, or 2&lt;/code&gt; and is in base 2!, etc. More generally, the nth-to-last digit is always &lt;code&gt;0, 1, 2, ..., n&lt;/code&gt; and is in base n!.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Vowel Count in Java</title>
      <link>https://andrewodendaal.com/vowel-count-in-java/</link>
      <pubDate>Thu, 04 Feb 2021 00:07:16 +0000</pubDate>
      <guid>https://andrewodendaal.com/vowel-count-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Return the number (count) of vowels in the given string. &lt;/p&gt;&#xA;&lt;p&gt;We will consider &lt;code&gt;a, e, i, o, u&lt;/code&gt; as vowels for this challenge (but not &lt;code&gt;y&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;The input string will only consist of lower case letters and/or spaces.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Vowels {&#xA;&#xA;  public static int getCount(String str) {&#xA;    int vowelsCount = 0;&#xA;    char[] chars = str.toCharArray();&#xA;    for (char c : chars) {&#xA;      if (c==&amp;#39;a&amp;#39; || c==&amp;#39;e&amp;#39; || c==&amp;#39;i&amp;#39; || c==&amp;#39;o&amp;#39; || c==&amp;#39;u&amp;#39;)&#xA;        vowelsCount++;&#xA;    }&#xA;    return vowelsCount;&#xA;  }&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Equal Sides Of An Array in Java</title>
      <link>https://andrewodendaal.com/equal-sides-of-an-array-in-java/</link>
      <pubDate>Wed, 03 Feb 2021 00:47:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/equal-sides-of-an-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are going to be given an array of integers. Your job is to take that array and find an index N where the sum of the integers to the left of N is equal to the sum of the integers to the right of N. If there is no index that would make this happen, return &lt;code&gt;-1&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;for-example&#34;&gt;&lt;strong&gt;For example:&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s say you are given the array &lt;code&gt;{1,2,3,4,3,2,1}&lt;/code&gt;:&lt;br&gt;&#xA;Your function will return the index &lt;code&gt;3&lt;/code&gt;, because at the 3rd position of the array, the sum of left side of the index (&lt;code&gt;{1,2,3}&lt;/code&gt;) and the sum of the right side of the index (&lt;code&gt;{3,2,1}&lt;/code&gt;) both equal &lt;code&gt;6&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Largest 5 digit number in a series in Java</title>
      <link>https://andrewodendaal.com/largest-5-digit-number-in-a-series-in-java/</link>
      <pubDate>Tue, 02 Feb 2021 00:27:57 +0000</pubDate>
      <guid>https://andrewodendaal.com/largest-5-digit-number-in-a-series-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In the following 6 digit number:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;283910&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;91&lt;/code&gt; is the greatest sequence of 2 consecutive digits.&lt;/p&gt;&#xA;&lt;p&gt;In the following 10 digit number:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;1234567890&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;67890&lt;/code&gt; is the greatest sequence of 5 consecutive digits.&lt;/p&gt;&#xA;&lt;p&gt;Complete the solution so that it returns the greatest sequence of five consecutive digits found within the number given. The number will be passed in as a string of only digits. It should return a five-digit integer. The number passed may be as large as 1000 digits.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Next smaller number with the same digits in Java</title>
      <link>https://andrewodendaal.com/next-smaller-number-with-the-same-digits-in-java/</link>
      <pubDate>Mon, 01 Feb 2021 01:06:54 +0000</pubDate>
      <guid>https://andrewodendaal.com/next-smaller-number-with-the-same-digits-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that takes a positive integer and returns the next smaller positive integer containing the same digits.&lt;/p&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;nextSmaller(21) == 12&#xA;nextSmaller(531) == 513&#xA;nextSmaller(2071) == 2017&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Return -1 (for &lt;code&gt;Haskell&lt;/code&gt;: return &lt;code&gt;Nothing&lt;/code&gt;, for &lt;code&gt;Rust&lt;/code&gt;: return &lt;code&gt;None&lt;/code&gt;), when there is no smaller number that contains the same digits. Also return -1 when the next smaller number with the same digits would require the leading digit to be zero.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Count of positives / sum of negatives in Java</title>
      <link>https://andrewodendaal.com/count-of-positives-sum-of-negatives-in-java/</link>
      <pubDate>Sun, 31 Jan 2021 01:30:36 +0000</pubDate>
      <guid>https://andrewodendaal.com/count-of-positives-sum-of-negatives-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of integers.&lt;/p&gt;&#xA;&lt;p&gt;Return an array, where the first element is the count of positives numbers and the second element is sum of negative numbers.&lt;/p&gt;&#xA;&lt;p&gt;If the input array is empty or null, return an empty array.&lt;/p&gt;&#xA;&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;&#xA;&lt;p&gt;For input &lt;code&gt;[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -11, -12, -13, -14, -15]&lt;/code&gt;, you should return &lt;code&gt;[10, -65]&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find the stray number in Java</title>
      <link>https://andrewodendaal.com/find-the-stray-number-in-java/</link>
      <pubDate>Sat, 30 Jan 2021 00:55:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-stray-number-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given an &lt;em&gt;odd-length&lt;/em&gt; array of integers, in which all of them are the same, except for one single number.&lt;/p&gt;&#xA;&lt;p&gt;Complete the method which accepts such an array, and returns that single different number.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The input array will always be valid!&lt;/strong&gt; (odd-length &amp;gt;= 3)&lt;/p&gt;&#xA;&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[1, 1, 2] ==&amp;gt; 2&#xA;[17, 17, 3, 17, 17, 17, 17] ==&amp;gt; 3&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.*;&#xA;&#xA;class Solution {&#xA;  static int stray(int[] numbers) {&#xA;    Map&amp;lt;Integer, Integer&amp;gt; map = new HashMap&amp;lt;&amp;gt;();&#xA;    &#xA;    for (int i=0; i&amp;lt;numbers.length; i++) {&#xA;      Integer def = map.getOrDefault(numbers[i], 0);&#xA;      map.put(numbers[i], ++def);&#xA;    }&#xA;    &#xA;    for(Integer key : map.keySet()) {&#xA;      System.out.println(key);&#xA;      System.out.println(map.get(key));&#xA;      if (map.get(key)==1) return key;&#xA;    }&#xA;    &#xA;    return 0;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>4 By 4 Skyscrapers in Java</title>
      <link>https://andrewodendaal.com/4-by-4-skyscrapers-in-java/</link>
      <pubDate>Fri, 29 Jan 2021 00:15:19 +0000</pubDate>
      <guid>https://andrewodendaal.com/4-by-4-skyscrapers-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In a grid of 4 by 4 squares you want to place a skyscraper in each square with only some clues:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The height of the skyscrapers is between 1 and 4&lt;/li&gt;&#xA;&lt;li&gt;No two skyscrapers in a row or column may have the same number of floors&lt;/li&gt;&#xA;&lt;li&gt;A clue is the number of skyscrapers that you can see in a row or column from the outside&lt;/li&gt;&#xA;&lt;li&gt;Higher skyscrapers block the view of lower skyscrapers located behind them&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Can you write a program that can solve this puzzle?&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Fix: package org.junit.jupiter.api does not exist</title>
      <link>https://andrewodendaal.com/how-to-fix-package-org-junit-jupiter-api-does-not-exist/</link>
      <pubDate>Thu, 28 Jan 2021 01:34:44 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-fix-package-org-junit-jupiter-api-does-not-exist/</guid>
      <description>&lt;h2 id=&#34;the-problem&#34;&gt;The problem&lt;/h2&gt;&#xA;&lt;p&gt;If you have received the &lt;code&gt;package org.junit.jupiter.api deos not exist&lt;/code&gt; error when trying to run a JUnit Java Test with Maven, it&amp;rsquo;s because of a missing dependency in your pom.xml file.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution&#34;&gt;The solution&lt;/h2&gt;&#xA;&lt;p&gt;Add the following &lt;code&gt;dependency&lt;/code&gt; entry to your &lt;code&gt;pom.xml&lt;/code&gt; file:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;dependencies&amp;gt;&#xA;&#xA;    &amp;lt;!-- add the junit dependency here --&amp;gt;&#xA;    &amp;lt;dependency&amp;gt;&#xA;        &amp;lt;groupId&amp;gt;org.junit.jupiter&amp;lt;/groupId&amp;gt;&#xA;        &amp;lt;artifactId&amp;gt;junit-jupiter-api&amp;lt;/artifactId&amp;gt;&#xA;        &amp;lt;version&amp;gt;5.7.0&amp;lt;/version&amp;gt;&#xA;        &amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;&#xA;    &amp;lt;/dependency&amp;gt;&#xA;&#xA;&amp;lt;/dependencies&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Programmatically Filter ag-Grid Columns in Angular</title>
      <link>https://andrewodendaal.com/how-to-programmatically-filter-ag-grid-columns-in-angular/</link>
      <pubDate>Wed, 27 Jan 2021 00:30:52 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-programmatically-filter-ag-grid-columns-in-angular/</guid>
      <description>&lt;p&gt;You can easily control the column filtering in ag-Grid by using the &lt;code&gt;getFilterInstance&lt;/code&gt; and &lt;code&gt;setModel&lt;/code&gt; methods associated to the column you need filtering. Once done, remember to call &lt;code&gt;onFilterChanged&lt;/code&gt; to apply your changes.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// a list of all your items you want to filter&#xA;// make sure to create a list of strings&#xA;// a list of numbers won&amp;#39;t work&#xA;const listOfItems = data.map((row) =&amp;gt; row.ComeColumnItem.toString())&#xA;&#xA;// get the filter instance per column&#xA;const filterInstance = this.gridApi?.getFilterInstance(&amp;#39;YourColumnName&amp;#39;)&#xA;&#xA;// get the existing model in-case you want to modify it&#xA;const model = this.gridApi?.getModel()&#xA;&#xA;// or set a new one&#xA;filterInstance?.setModel({&#xA;  type: &amp;#39;set&amp;#39;,&#xA;  values: listOfItems&#xA;})&#xA;&#xA;// remember to apply the changes when done!&#xA;this.gridApi?.onFilterChanged()&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Sum by Factors in Java</title>
      <link>https://andrewodendaal.com/sum-by-factors-in-java/</link>
      <pubDate>Tue, 26 Jan 2021 00:26:26 +0000</pubDate>
      <guid>https://andrewodendaal.com/sum-by-factors-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of positive or negative integers&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;I= [i&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;,..,i&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;you have to produce a sorted array P of the form&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;[ [p, sum of all i&amp;lt;sub&amp;gt;j&amp;lt;/sub&amp;gt;&amp;amp;nbsp;of I for which p is a prime factor (p positive) of i&amp;lt;sub&amp;gt;j&amp;lt;/sub&amp;gt;] ...]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;P will be sorted by increasing order of the prime numbers. The final result has to be given as a string in Java, C#, C, C++ and as an array of arrays in other languages.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Count the divisors of a number in Java</title>
      <link>https://andrewodendaal.com/count-the-divisors-of-a-number-in-java/</link>
      <pubDate>Mon, 25 Jan 2021 00:36:32 +0000</pubDate>
      <guid>https://andrewodendaal.com/count-the-divisors-of-a-number-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Count the number of divisors of a positive integer &lt;code&gt;n&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Random tests go up to &lt;code&gt;n = 500000&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;numberOfDivisors(4)  == 3 // 1, 2, 4&#xA;numberOfDivisors(5)  == 2 // 1, 5&#xA;numberOfDivisors(12) == 6 // 1, 2, 3, 4, 6, 12&#xA;numberOfDivisors(30) == 8 // 1, 2, 3, 5, 6, 10, 15, 30&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class FindDivisor {&#xA;&#xA;  public long numberOfDivisors(int n) {&#xA;      long counter = 0;&#xA;      for(int i=1; i&amp;lt;=n; i++){&#xA;          if(n % i == 0){&#xA;          counter++;&#xA;          }&#xA;      }&#xA;      return counter;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>My smallest code interpreter in Java</title>
      <link>https://andrewodendaal.com/my-smallest-code-interpreter-aka-brainfk-in-java/</link>
      <pubDate>Sun, 24 Jan 2021 00:21:24 +0000</pubDate>
      <guid>https://andrewodendaal.com/my-smallest-code-interpreter-aka-brainfk-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Inspired from real-world &lt;!-- raw HTML omitted --&gt;Brainf**k&lt;!-- raw HTML omitted --&gt;, we want to create an interpreter of that language which will support the following instructions:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;&amp;gt;&lt;/code&gt; increment the data pointer (to point to the next cell to the right).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;&amp;lt;&lt;/code&gt; decrement the data pointer (to point to the next cell to the left).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;+&lt;/code&gt; increment (increase by one, truncate overflow: 255 + 1 = 0) the byte at the data pointer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;-&lt;/code&gt; decrement (decrease by one, treat as unsigned byte: 0 – 1 = 255 ) the byte at the data pointer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;.&lt;/code&gt; output the byte at the data pointer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;,&lt;/code&gt; accept one byte of input, storing its value in the byte at the data pointer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[&lt;/code&gt; if the byte at the data pointer is zero, then instead of moving the instruction pointer forward to the next command, jump it forward to the command after the matching &lt;code&gt;]&lt;/code&gt; command.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;]&lt;/code&gt; if the byte at the data pointer is nonzero, then instead of moving the instruction pointer forward to the next command, jump it back to the command after the matching &lt;code&gt;[&lt;/code&gt; command.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The function will take in input…&lt;/p&gt;</description>
    </item>
    <item>
      <title>Pick peaks in Java</title>
      <link>https://andrewodendaal.com/pick-peaks-in-java/</link>
      <pubDate>Sat, 23 Jan 2021 01:23:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/pick-peaks-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that returns the positions and the values of the &amp;ldquo;peaks&amp;rdquo; (or local maxima) of a numeric array.&lt;/p&gt;&#xA;&lt;p&gt;For example, the array &lt;code&gt;arr = [0, 1, 2, 5, 1, 0]&lt;/code&gt; has a peak at position &lt;code&gt;3&lt;/code&gt; with a value of &lt;code&gt;5&lt;/code&gt; (since &lt;code&gt;arr[3]&lt;/code&gt; equals &lt;code&gt;5&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;The output will be returned as a &amp;ldquo;Map&amp;lt;String,List&amp;gt;&lt;code&gt;with two key-value pairs:&lt;/code&gt;&amp;ldquo;pos&amp;rdquo;&lt;code&gt;and&lt;/code&gt;&amp;ldquo;peaks&amp;rdquo;&lt;code&gt;. If there is no peak in the given array, simply return&lt;/code&gt;{&amp;ldquo;pos&amp;rdquo; =&amp;gt; [], &amp;ldquo;peaks&amp;rdquo; =&amp;gt; []}`.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Number of trailing zeros of N in Java</title>
      <link>https://andrewodendaal.com/number-of-trailing-zeros-of-n-in-java/</link>
      <pubDate>Fri, 22 Jan 2021 03:59:19 +0000</pubDate>
      <guid>https://andrewodendaal.com/number-of-trailing-zeros-of-n-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a program that will calculate the number of trailing zeros in a factorial of a given number.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;N! = 1 * 2 * 3 * ... * N&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Be careful &lt;code&gt;1000!&lt;/code&gt; has 2568 digits…&lt;/p&gt;&#xA;&lt;p&gt;For more info, see: &lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://mathworld.wolfram.com/Factorial.html&#34;&gt;http://mathworld.wolfram.com/Factorial.html&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;zeros(6) = 1&#xA;// 6! = 1 * 2 * 3 * 4 * 5 * 6 = 720 --&amp;gt; 1 trailing zero&#xA;&#xA;zeros(12) = 2&#xA;// 12! = 479001600 --&amp;gt; 2 trailing zeros&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Alphabetic Anagrams in Java</title>
      <link>https://andrewodendaal.com/alphabetic-anagrams-in-java/</link>
      <pubDate>Thu, 21 Jan 2021 00:41:30 +0000</pubDate>
      <guid>https://andrewodendaal.com/alphabetic-anagrams-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Consider a &amp;ldquo;word&amp;rdquo; as any sequence of capital letters A-Z (not limited to just &amp;ldquo;dictionary words&amp;rdquo;). For any word with at least two different letters, there are other words composed of the same letters but in a different order (for instance, STATIONARILY/ANTIROYALIST, which happen to both be dictionary words; for our purposes &amp;ldquo;AAIILNORSTTY&amp;rdquo; is also a &amp;ldquo;word&amp;rdquo; composed of the same letters as these two).&lt;/p&gt;&#xA;&lt;p&gt;We can then assign a number to every word, based on where it falls in an alphabetically sorted list of all words made up of the same group of letters. One way to do this would be to generate the entire list of words and find the desired one, but this would be slow if the word is long.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Remove file from Git without deleting locally</title>
      <link>https://andrewodendaal.com/remove-file-from-git-without-deleting-locally/</link>
      <pubDate>Wed, 20 Jan 2021 00:41:51 +0000</pubDate>
      <guid>https://andrewodendaal.com/remove-file-from-git-without-deleting-locally/</guid>
      <description>&lt;p&gt;If you find yourself in a position where you have already committed some files to git, and they are in the remote repository already, but you want to remove them from you repository without deleting them locally, you can do the following:&lt;/p&gt;&#xA;&lt;p&gt;Introducing the &lt;code&gt;git rm --cached&lt;/code&gt; command:&lt;/p&gt;&#xA;&lt;h2 id=&#34;remove-a-folder-from-git&#34;&gt;Remove a folder from Git&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;git rm --cached -r FolderName&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;remove-a-file-from-git&#34;&gt;Remove a file from git&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;git rm --cached SomeFile.ext&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;and-then-what&#34;&gt;And then what?&lt;/h2&gt;&#xA;&lt;p&gt;Now that the files have been removed from the local git cache, you should probably either commit the changes you&amp;rsquo;ve made, or add an entry to your local &lt;code&gt;.gitignore&lt;/code&gt; file and then commit the changes.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Recover a secret string from random triplets in Java</title>
      <link>https://andrewodendaal.com/recover-a-secret-string-from-random-triplets-in-java/</link>
      <pubDate>Tue, 19 Jan 2021 00:47:12 +0000</pubDate>
      <guid>https://andrewodendaal.com/recover-a-secret-string-from-random-triplets-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;There is a secret string which is unknown to you. Given a collection of random triplets from the string, recover the original string.&lt;/p&gt;&#xA;&lt;p&gt;A triplet here is defined as a sequence of three letters such that each letter occurs somewhere before the next in the given string. &amp;ldquo;whi&amp;rdquo; is a triplet for the string &amp;ldquo;whatisup&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;As a simplification, you may assume that no letter occurs more than once in the secret string.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Range Extraction in Java</title>
      <link>https://andrewodendaal.com/range-extraction-in-java/</link>
      <pubDate>Mon, 18 Jan 2021 00:47:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/range-extraction-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;A format for expressing an ordered list of integers is to use a comma separated list of either&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;individual integers&lt;/li&gt;&#xA;&lt;li&gt;or a range of integers denoted by the starting integer separated from the end integer in the range by a dash, ‘-‘. The range includes all integers in the interval including both endpoints. It is not considered a range unless it spans at least 3 numbers. For example &amp;ldquo;12,13,15-17&amp;rdquo;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Complete the solution so that it takes a list of integers in increasing order and returns a correctly formatted string in the range format.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Reversed Words in Java</title>
      <link>https://andrewodendaal.com/reversed-words-in-java/</link>
      <pubDate>Sun, 17 Jan 2021 00:07:51 +0000</pubDate>
      <guid>https://andrewodendaal.com/reversed-words-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the solution so that it reverses all of the words within the string passed in.&lt;/p&gt;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ReverseWords.reverseWords(&amp;#34;The greatest victory is that which requires no battle&amp;#34;);&#xA;// should return &amp;#34;battle no requires which that is victory greatest The&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (using &lt;code&gt;StringBuilder&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class ReverseWords{&#xA;&#xA; public static String reverseWords(String str){&#xA;     String[] words = str.split(&amp;#34; &amp;#34;);&#xA;   &#xA;     StringBuilder sb = new StringBuilder();&#xA;     &#xA;     for (int i=words.length-1; i&amp;gt;=0; i--) {&#xA;         sb.append(words[i]).append(&amp;#34; &amp;#34;);&#xA;     }&#xA;     &#xA;     return sb.toString().trim();&#xA; }&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2 (using &lt;code&gt;Arrays&lt;/code&gt;):&lt;/p&gt;</description>
    </item>
    <item>
      <title>CamelCase Method in Java</title>
      <link>https://andrewodendaal.com/camelcase-method-in-java/</link>
      <pubDate>Sat, 16 Jan 2021 00:09:40 +0000</pubDate>
      <guid>https://andrewodendaal.com/camelcase-method-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a simple &lt;code&gt;CamelCase&lt;/code&gt; method for strings.&lt;/p&gt;&#xA;&lt;p&gt;All words must have their first letter capitalized without spaces.&lt;/p&gt;&#xA;&lt;h3 id=&#34;example&#34;&gt;Example:&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// &amp;#34;HelloCase&amp;#34;&#xA;camelCase(&amp;#34;hello case&amp;#34;);&#xA;&#xA;// &amp;#34;CamelCaseWord&amp;#34;&#xA;camelCase(&amp;#34;camel case word&amp;#34;);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution {&#xA;&#xA;    public static String camelCase(String str) {&#xA;        String[] words = str.trim().split(&amp;#34;\\s+&amp;#34;);&#xA;        if (words.length==0) return &amp;#34;&amp;#34;;&#xA;        StringBuilder sb = new StringBuilder();&#xA;      &#xA;        for (int i=0; i&amp;lt;words.length; i++) {&#xA;            String word = words[i];&#xA;            if (word.length()&amp;gt;1) {&#xA;              String s = word.substring(0, 1).toUpperCase() + word.substring(1, word.length());&#xA;              sb.append(s);&#xA;            } else {&#xA;              sb.append(word.toUpperCase());&#xA;            }&#xA;        }&#xA;      &#xA;        return sb.toString();&#xA;    }&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Even or Odd in Java</title>
      <link>https://andrewodendaal.com/even-or-odd-in-java/</link>
      <pubDate>Fri, 15 Jan 2021 01:01:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/even-or-odd-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function that takes an integer as an argument and returns &amp;ldquo;Even&amp;rdquo; for even numbers or &amp;ldquo;Odd&amp;rdquo; for odd numbers.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class EvenOrOdd {&#xA;    public static String even_or_odd(int number) {&#xA;        return number%2==0 ? &amp;#34;Even&amp;#34; : &amp;#34;Odd&amp;#34;;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertEquals;&#xA;import org.junit.runners.JUnit4;&#xA;&#xA;public class EvenOrOddTest {&#xA;    @Test&#xA;    public void testEvenOrOdd() {&#xA;        EvenOrOdd eoo = new EvenOrOdd();&#xA;        assertEquals(eoo.even_or_odd(6), &amp;#34;Even&amp;#34;);&#xA;        assertEquals(eoo.even_or_odd(7), &amp;#34;Odd&amp;#34;);       &#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Square Every Digit in Java</title>
      <link>https://andrewodendaal.com/square-every-digit-in-java/</link>
      <pubDate>Thu, 14 Jan 2021 01:14:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/square-every-digit-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You need to square every digit of a number and concatenate them.&lt;/p&gt;&#xA;&lt;p&gt;For example, if we run 9119 through the function, 811181 will come out, because 9&lt;!-- raw HTML omitted --&gt;2&lt;!-- raw HTML omitted --&gt; is 81 and 1&lt;!-- raw HTML omitted --&gt;2&lt;!-- raw HTML omitted --&gt; is 1.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The function accepts an integer and returns an integer.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class SquareDigit {&#xA;&#xA;  public int squareDigits(int n) {&#xA;    String result = &amp;#34;&amp;#34;; &#xA;    &#xA;    while (n != 0) {&#xA;      int digit = n % 10 ;&#xA;      result = digit*digit + result ;&#xA;      n /= 10 ;&#xA;    }&#xA;    &#xA;    return Integer.parseInt(result) ;&#xA;  }&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Simple number sequence in Java</title>
      <link>https://andrewodendaal.com/simple-number-sequence-in-java/</link>
      <pubDate>Wed, 13 Jan 2021 00:15:21 +0000</pubDate>
      <guid>https://andrewodendaal.com/simple-number-sequence-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given a string of numbers in sequence and your task will be to return the missing number. If there is no number missing or there is an error in the sequence, return &lt;code&gt;-1&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;missing(&amp;#34;123567&amp;#34;) = 4 &#xA;missing(&amp;#34;899091939495&amp;#34;) = 92&#xA;missing(&amp;#34;9899101102&amp;#34;) = 100&#xA;missing(&amp;#34;599600601602&amp;#34;) = -1 -- no number missing&#xA;missing(&amp;#34;8990919395&amp;#34;) = -1 -- error in sequence. Both 92 and 94 missing.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The sequence will always be in ascending order.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Roman Numerals Encoder in Java</title>
      <link>https://andrewodendaal.com/roman-numerals-encoder-in-java/</link>
      <pubDate>Tue, 12 Jan 2021 00:40:34 +0000</pubDate>
      <guid>https://andrewodendaal.com/roman-numerals-encoder-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function taking a positive integer as its parameter and returning a string containing the Roman Numeral representation of that integer.&lt;/p&gt;&#xA;&lt;p&gt;Modern Roman numerals are written by expressing each digit separately starting with the left most digit and skipping any digit with a value of zero. In Roman numerals 1990 is rendered: 1000=M, 900=CM, 90=XC; resulting in MCMXC. 2008 is written as 2000=MM, 8=VIII; or MMVIII. 1666 uses each Roman symbol in descending order: MDCLXVI.&lt;/p&gt;</description>
    </item>
    <item>
      <title>First Variation on Caesar Cipher in Java</title>
      <link>https://andrewodendaal.com/first-variation-on-caesar-cipher-in-java/</link>
      <pubDate>Mon, 11 Jan 2021 00:13:27 +0000</pubDate>
      <guid>https://andrewodendaal.com/first-variation-on-caesar-cipher-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The action of a Caesar cipher is to replace each plaintext letter (plaintext letters are from ‘a&amp;rsquo; to ‘z&amp;rsquo; or from ‘A&amp;rsquo; to ‘Z&amp;rsquo;) with a different one a fixed number of places up or down the alphabet.&lt;/p&gt;&#xA;&lt;p&gt;This program performs a variation of the Caesar shift. The shift increases by 1 for each &lt;strong&gt;character&lt;/strong&gt; (on each iteration).&lt;/p&gt;&#xA;&lt;p&gt;If the shift is initially 1, the first character of the message to be encoded will be shifted by 1, the second character will be shifted by 2, etc…&lt;/p&gt;</description>
    </item>
    <item>
      <title>Century From Year in Java</title>
      <link>https://andrewodendaal.com/century-from-year-in-java/</link>
      <pubDate>Sun, 10 Jan 2021 01:35:27 +0000</pubDate>
      <guid>https://andrewodendaal.com/century-from-year-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The first century spans from the &lt;strong&gt;year 1&lt;/strong&gt; &lt;em&gt;up to&lt;/em&gt; and &lt;strong&gt;including the year 100&lt;/strong&gt;, &lt;strong&gt;The second&lt;/strong&gt; – &lt;em&gt;from the year 101 up to and including the year 200&lt;/em&gt;, etc.&lt;/p&gt;&#xA;&lt;h3 id=&#34;task-&#34;&gt;Task :&lt;/h3&gt;&#xA;&lt;p&gt;Given a year, return the century it is in.&lt;/p&gt;&#xA;&lt;h3 id=&#34;input--output-examples-&#34;&gt;Input, Output Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;centuryFromYear(1705)  returns (18)&#xA;centuryFromYear(1900)  returns (19)&#xA;centuryFromYear(1601)  returns (17)&#xA;centuryFromYear(2000)  returns (20)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution {&#xA;  public static int century(int number) {&#xA;    return (number + 99) / 100;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find the Smallest Number in Java</title>
      <link>https://andrewodendaal.com/find-the-smallest-number-in-java/</link>
      <pubDate>Sat, 09 Jan 2021 01:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-smallest-number-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You have a positive number &lt;code&gt;n&lt;/code&gt; consisting of digits. You can do &lt;strong&gt;at most&lt;/strong&gt; one operation: Choosing the index of a digit in the number, remove this digit at that index and insert it back to another or at the same place in the number in order to find the smallest number you can get.&lt;/p&gt;&#xA;&lt;p&gt;#Task: Return an array or a tuple or a string depending on the language (see &amp;ldquo;Sample Tests&amp;rdquo;) with&lt;/p&gt;</description>
    </item>
    <item>
      <title>Convert Array to Tree in Java</title>
      <link>https://andrewodendaal.com/convert-array-to-tree-in-java/</link>
      <pubDate>Fri, 08 Jan 2021 00:37:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/convert-array-to-tree-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given a non-null array of integers. Implement the method &lt;strong&gt;arrayToTree&lt;/strong&gt; which creates a binary tree from its values in accordance to their order, while creating nodes by depth from left to right.&lt;/p&gt;&#xA;&lt;p&gt;For example, given the array [17, 0, -4, 3, 15] you should create the following tree:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;    17&#xA;   /  \&#xA;  0   -4&#xA; / \&#xA;3   15 &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The class TreeNode is available for you:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class TreeNode {&#xA;&#xA;    TreeNode left;&#xA;    TreeNode right;&#xA;    int value;&#xA;&#xA;    TreeNode(int value, TreeNode left, TreeNode right) {&#xA;        this.value = value;&#xA;        this.left = left;&#xA;        this.right = right;&#xA;    }&#xA;&#xA;    TreeNode(int value) {&#xA;        this(value, null, null);&#xA;    }&#xA;&#xA;    @Override&#xA;    public boolean equals(Object other) {&#xA;        ... // Already implemented for you and used in test cases &#xA;    }&#xA;    ...&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Common Denominators in Java</title>
      <link>https://andrewodendaal.com/common-denominators-in-java/</link>
      <pubDate>Thu, 07 Jan 2021 00:19:14 +0000</pubDate>
      <guid>https://andrewodendaal.com/common-denominators-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You will have a list of rationals in the form&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{ {numer_1, denom_1} , ... {numer_n, denom_n} } &#xA;or&#xA;[ [numer_1, denom_1] , ... [numer_n, denom_n] ] &#xA;or&#xA;[ (numer_1, denom_1) , ... (numer_n, denom_n) ] &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;where all numbers are positive ints. You have to produce a result in the form:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;(N_1, D) ... (N_n, D) &#xA;or&#xA;[ [N_1, D] ... [N_n, D] ] &#xA;or&#xA;[ (N_1&amp;#39;, D) , ... (N_n, D) ] &#xA;or&#xA;{{N_1, D} ... {N_n, D}} &#xA;or&#xA;&amp;#34;(N_1, D) ... (N_n, D)&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;depending on the language (See Example tests)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Primes in Numbers in Java</title>
      <link>https://andrewodendaal.com/primes-in-numbers-in-java/</link>
      <pubDate>Wed, 06 Jan 2021 01:19:08 +0000</pubDate>
      <guid>https://andrewodendaal.com/primes-in-numbers-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a positive number n &amp;gt; 1 find the prime factor decomposition of n. The result will be a string with the following form :&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &amp;#34;(p1**n1)(p2**n2)...(pk**nk)&amp;#34;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;where &lt;code&gt;a ** b&lt;/code&gt; means &lt;code&gt;a&lt;/code&gt; to the power of &lt;code&gt;b&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;with the p(i) in increasing order and n(i) empty if n(i) is 1.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Example: n = 86240 should return &amp;#34;(2**5)(5)(7**2)(11)&amp;#34;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;class&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;PrimeDecomp&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;static&lt;/span&gt; String &lt;span style=&#34;color:#a6e22e&#34;&gt;factors&lt;/span&gt;(&lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt; lst) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        String result &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; (&lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt; fac &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; 2; fac &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;=&lt;/span&gt; lst; &lt;span style=&#34;color:#f92672&#34;&gt;++&lt;/span&gt;fac) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt; count;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; (count &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; 0; lst &lt;span style=&#34;color:#f92672&#34;&gt;%&lt;/span&gt; fac &lt;span style=&#34;color:#f92672&#34;&gt;==&lt;/span&gt; 0; &lt;span style=&#34;color:#f92672&#34;&gt;++&lt;/span&gt;count) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                lst &lt;span style=&#34;color:#f92672&#34;&gt;/=&lt;/span&gt; fac;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; (count &lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; 0) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                result &lt;span style=&#34;color:#f92672&#34;&gt;+=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;(&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; fac &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; (count &lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; 1 &lt;span style=&#34;color:#f92672&#34;&gt;?&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;**&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; count : &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;) &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;)&amp;#34;&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; result;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Maximum subarray sum in Java</title>
      <link>https://andrewodendaal.com/maximum-subarray-sum-in-java/</link>
      <pubDate>Tue, 05 Jan 2021 01:28:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/maximum-subarray-sum-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The maximum sum subarray problem consists in finding the maximum sum of a contiguous subsequence in an array or list of integers:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Max.sequence(new int[]{-2, 1, -3, 4, -1, 2, 1, -5, 4});&#xA;// should be 6: {4, -1, 2, 1}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Easy case is when the list is made up of only positive numbers and the maximum sum is the sum of the whole array. If the list is made up of only negative numbers, return 0 instead.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Validate Credit Card Number in Java</title>
      <link>https://andrewodendaal.com/validate-credit-card-number-in-java/</link>
      <pubDate>Mon, 04 Jan 2021 02:28:25 +0000</pubDate>
      <guid>https://andrewodendaal.com/validate-credit-card-number-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s implement the &lt;!-- raw HTML omitted --&gt;Luhn Algorithm&lt;!-- raw HTML omitted --&gt;, which is used to help validate credit card numbers.&lt;/p&gt;&#xA;&lt;p&gt;Given a positive integer of up to 16 digits, return &lt;code&gt;true&lt;/code&gt; if it is a valid credit card number, and &lt;code&gt;false&lt;/code&gt; if it is not.&lt;/p&gt;&#xA;&lt;p&gt;Here is the algorithm:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Double every other digit, scanning &lt;strong&gt;from right to left&lt;/strong&gt;, starting from the second digit (from the right).Another way to think about it is: if there are an &lt;strong&gt;even&lt;/strong&gt; number of digits, double every other digit starting with the &lt;strong&gt;first&lt;/strong&gt;; if there are an &lt;strong&gt;odd&lt;/strong&gt; number of digits, double every other digit starting with the &lt;strong&gt;second&lt;/strong&gt;:&lt;code&gt;1714 ==&amp;gt; [1*, 7, 1*, 4] ==&amp;gt; [2, 7, 2, 4] 12345 ==&amp;gt; [1, 2*, 3, 4*, 5] ==&amp;gt; [1, 4, 3, 8, 5] 891 ==&amp;gt; [8, 9*, 1] ==&amp;gt; [8, 18, 1]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;If a resulting number is greater than &lt;code&gt;9&lt;/code&gt;, replace it with the sum of its own digits (which is the same as subtracting &lt;code&gt;9&lt;/code&gt; from it):&lt;code&gt;[8, 18*, 1] ==&amp;gt; [8, (1+8), 1] ==&amp;gt; [8, 9, 1] or: [8, 18*, 1] ==&amp;gt; [8, (18-9), 1] ==&amp;gt; [8, 9, 1]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Sum all of the final digits:&lt;code&gt;[8, 9, 1] ==&amp;gt; 8 + 9 + 1 = 18&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Finally, take that sum and divide it by &lt;code&gt;10&lt;/code&gt;. If the remainder equals zero, the original credit card number is valid. &lt;code&gt;18 (modulus) 10 ==&amp;gt; 8 , which is not equal to 0, so this is not a valid credit card number&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find the unique number using Java</title>
      <link>https://andrewodendaal.com/find-the-unique-number-using-java/</link>
      <pubDate>Sun, 03 Jan 2021 00:07:35 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-unique-number-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;There is an array with some numbers. All numbers are equal except for one. Try to find it!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Solution.findUniq(new double[]{ 1, 1, 1, 2, 1, 1 }); // =&amp;gt; 2&#xA;Solution.findUniq(new double[]{ 0, 0, 0.55, 0, 0 }); // =&amp;gt; 0.55&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It&amp;rsquo;s guaranteed that array contains at least 3 numbers.&lt;/p&gt;&#xA;&lt;p&gt;The tests contain some very huge arrays, so think about performance.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.Arrays;&#xA; public class Solution {&#xA;    public static double findUniq(double[] arr) {&#xA;      Arrays.sort(arr);&#xA;      return arr[0] == arr[1] ? arr[arr.length-1]:arr[0];&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find The Parity Outlier in Java</title>
      <link>https://andrewodendaal.com/find-the-parity-outlier-in-java/</link>
      <pubDate>Sat, 02 Jan 2021 01:07:42 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-parity-outlier-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given an array (which will have a length of at least 3, but could be very large) containing integers. The array is either entirely comprised of odd integers or entirely comprised of even integers except for a single integer &lt;code&gt;N&lt;/code&gt;. Write a method that takes the array as an argument and returns this &amp;ldquo;outlier&amp;rdquo; &lt;code&gt;N&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[2, 4, 0, 100, 4, 11, 2602, 36]&#xA;Should return: 11 (the only odd number)&#xA;&#xA;[160, 3, 1719, 19, 11, 13, -21]&#xA;Should return: 160 (the only even number)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find the missing letter using Java</title>
      <link>https://andrewodendaal.com/find-the-missing-letter-using-java/</link>
      <pubDate>Fri, 01 Jan 2021 01:50:09 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-missing-letter-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a method that takes an array of consecutive (increasing) letters as input and that returns the missing letter in the array.&lt;/p&gt;&#xA;&lt;p&gt;You will always get an valid array. And it will be always exactly one letter be missing. The length of the array will always be at least 2.&lt;br&gt;&#xA;The array will always contain letters in only one case.&lt;/p&gt;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&lt;p&gt;[‘a&amp;rsquo;,&amp;lsquo;b&amp;rsquo;,&amp;lsquo;c&amp;rsquo;,&amp;rsquo;d&amp;rsquo;,&amp;lsquo;f&amp;rsquo;] -&amp;gt; ‘e&amp;rsquo; [‘O&amp;rsquo;,&amp;lsquo;Q&amp;rsquo;,&amp;lsquo;R&amp;rsquo;,&amp;lsquo;S&amp;rsquo;] -&amp;gt; ‘P&amp;rsquo;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[&amp;#34;a&amp;#34;,&amp;#34;b&amp;#34;,&amp;#34;c&amp;#34;,&amp;#34;d&amp;#34;,&amp;#34;f&amp;#34;] -&amp;gt; &amp;#34;e&amp;#34;&#xA;[&amp;#34;O&amp;#34;,&amp;#34;Q&amp;#34;,&amp;#34;R&amp;#34;,&amp;#34;S&amp;#34;] -&amp;gt; &amp;#34;P&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;(Use the English alphabet with 26 letters!)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Determine the order of braces is valid using Java</title>
      <link>https://andrewodendaal.com/determine-the-order-of-braces-is-valid-using-java/</link>
      <pubDate>Thu, 31 Dec 2020 01:42:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/determine-the-order-of-braces-is-valid-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that takes a string of braces, and determines if the order of the braces is valid. It should return &lt;code&gt;true&lt;/code&gt; if the string is valid, and &lt;code&gt;false&lt;/code&gt; if it&amp;rsquo;s invalid.&lt;/p&gt;&#xA;&lt;p&gt;All input strings will be nonempty, and will only consist of parentheses, brackets and curly braces: &lt;code&gt;()[]{}&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-is-considered-valid&#34;&gt;What is considered Valid?&lt;/h3&gt;&#xA;&lt;p&gt;A string of braces is considered valid if all braces are matched with the correct brace.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] PKIX path building failed: unable to find valid certification path to requested target</title>
      <link>https://andrewodendaal.com/solved-pkix-path-building-failed-unable-to-find-valid-certification-path-to-requested-target/</link>
      <pubDate>Wed, 30 Dec 2020 02:02:44 +0000</pubDate>
      <guid>https://andrewodendaal.com/solved-pkix-path-building-failed-unable-to-find-valid-certification-path-to-requested-target/</guid>
      <description>&lt;h2 id=&#34;the-problem&#34;&gt;The problem&lt;/h2&gt;&#xA;&lt;p&gt;It may happen to you that when you try and pull some Java dependencies, you will get the annoying &lt;code&gt;PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target&lt;/code&gt; error.&lt;/p&gt;&#xA;&lt;p&gt;It may look something like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.4.0 from/to tpvr-ibm (https://nexus-***.***.***.***:8081/nexus/content/repositories/tpvr-ibm): PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-recommended&#34;&gt;The solution (recommended)&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Go to URL in your browser:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;firefox – click on HTTPS certificate chain (the lock icon right next to URL address). Click &lt;code&gt;&amp;quot;more info&amp;quot; &amp;gt; &amp;quot;security&amp;quot; &amp;gt; &amp;quot;show certificate&amp;quot; &amp;gt; &amp;quot;details&amp;quot; &amp;gt; &amp;quot;export..&amp;quot;&lt;/code&gt;. Pickup the name and choose file type example.cer&lt;/li&gt;&#xA;&lt;li&gt;chrome – click on site icon left to address in address bar, select &amp;ldquo;Certificate&amp;rdquo; -&amp;gt; &amp;ldquo;Details&amp;rdquo; -&amp;gt; &amp;ldquo;Export&amp;rdquo; and save in format &amp;ldquo;Der-encoded binary, single certificate&amp;rdquo;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;Now you have file with keystore and you have to add it to your JVM. Determine location of cacerts files&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Windows: &lt;code&gt;C:\Program Files (x86)\Java\jre1.8.0_22\lib\security\cacerts&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Mac: &lt;code&gt;/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home/jre/lib/security/cacerts&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;Next import the &lt;code&gt;example.cer&lt;/code&gt; file into cacerts in command line:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;what-commands-to-run&#34;&gt;What commands to run&lt;/h2&gt;&#xA;&lt;p&gt;Navigate to the security path:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the odd int in Java</title>
      <link>https://andrewodendaal.com/how-to-find-the-odd-int-in-java/</link>
      <pubDate>Tue, 29 Dec 2020 01:19:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-odd-int-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of integers, find the one that appears an odd number of times.&lt;/p&gt;&#xA;&lt;p&gt;There will always be only one integer that appears an odd number of times.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (using &lt;code&gt;streams&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import static java.util.Arrays.stream;&#xA;&#xA;public class FindOdd {&#xA;  public static int findIt(int[] arr) {&#xA;    return stream(arr).reduce(0, (x, y) -&amp;gt; x ^ y);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2 (using &lt;code&gt;xor&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class FindOdd {&#xA;  public static int findIt(int[] A) {&#xA;    int odd = 0;&#xA;    &#xA;    for (int i : A) {&#xA;      odd ^= i;&#xA;    }&#xA;  &#xA;    return odd;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3 (using a &lt;code&gt;TreeSet&lt;/code&gt;):&lt;/p&gt;</description>
    </item>
    <item>
      <title>Count the number of Duplicates in Java</title>
      <link>https://andrewodendaal.com/count-the-number-of-duplicates-in-java/</link>
      <pubDate>Mon, 28 Dec 2020 01:42:41 +0000</pubDate>
      <guid>https://andrewodendaal.com/count-the-number-of-duplicates-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that will return the count of &lt;strong&gt;distinct case-insensitive&lt;/strong&gt; alphabetic characters and numeric digits that occur more than once in the input string. The input string can be assumed to contain only alphabets (both uppercase and lowercase) and numeric digits.&lt;/p&gt;&#xA;&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;&#xA;&lt;p&gt;&amp;ldquo;abcde&amp;rdquo; -&amp;gt; 0 &lt;code&gt;# no characters repeats more than once&lt;/code&gt;&lt;br&gt;&#xA;&amp;ldquo;aabbcde&amp;rdquo; -&amp;gt; 2 &lt;code&gt;# &#39;a&#39; and &#39;b&#39;&lt;/code&gt;&lt;br&gt;&#xA;&amp;ldquo;aabBcde&amp;rdquo; -&amp;gt; 2 &lt;code&gt;# &#39;a&#39; occurs twice and &#39;b&#39; twice (`b` and `B`)&lt;/code&gt;&lt;br&gt;&#xA;&amp;ldquo;indivisibility&amp;rdquo; -&amp;gt; 1 &lt;code&gt;# &#39;i&#39; occurs six times&lt;/code&gt;&lt;br&gt;&#xA;&amp;ldquo;Indivisibilities&amp;rdquo; -&amp;gt; 2 &lt;code&gt;# &#39;i&#39; occurs seven times and &#39;s&#39; occurs twice&lt;/code&gt;&lt;br&gt;&#xA;&amp;ldquo;aA11&amp;rdquo; -&amp;gt; 2 &lt;code&gt;# &#39;a&#39; and &#39;1&#39;&lt;/code&gt;&lt;br&gt;&#xA;&amp;ldquo;ABBA&amp;rdquo; -&amp;gt; 2 &lt;code&gt;# &#39;A&#39; and &#39;B&#39; each occur twice&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calculating Simple Max Digit Sum in Java</title>
      <link>https://andrewodendaal.com/calculating-simple-max-digit-sum-in-java/</link>
      <pubDate>Sun, 27 Dec 2020 00:45:21 +0000</pubDate>
      <guid>https://andrewodendaal.com/calculating-simple-max-digit-sum-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In this challenge, you will be given an integer &lt;code&gt;n&lt;/code&gt; and your task will be to return &lt;code&gt;the largest integer that is &amp;lt;= n and has the highest digit sum&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;solve(100) = 99. Digit Sum for 99 = 9 + 9 = 18. No other number &amp;lt;= 100 has a higher digit sum.&#xA;solve(10) = 9&#xA;solve(48) = 48. Note that 39 is also an option, but 48 is larger.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Input range is &lt;code&gt;0 &amp;lt; n &amp;lt; 1e11&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>The String Combat Challenge in Java</title>
      <link>https://andrewodendaal.com/the-string-combat-challenge-in-java/</link>
      <pubDate>Sat, 26 Dec 2020 01:08:29 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-string-combat-challenge-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;After a long conflict, the rulers of Nek and Glo have decided that a final duel should decide the fate of their countries. Each ruler will select their best knights and send them into battle, one after another. The last standing team will win the crown.&lt;/p&gt;&#xA;&lt;p&gt;But the knights don&amp;rsquo;t want to die for nothing, so they ask you, the wise technomagican, to derive which team will win. Can you help them?&lt;/p&gt;</description>
    </item>
    <item>
      <title>Solving Single Word Pig Latin in Java</title>
      <link>https://andrewodendaal.com/solving-single-word-pig-latin-in-java/</link>
      <pubDate>Fri, 25 Dec 2020 00:20:35 +0000</pubDate>
      <guid>https://andrewodendaal.com/solving-single-word-pig-latin-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Pig Latin is an English language game where the goal is to hide the meaning of a word from people not aware of the rules.&lt;/p&gt;&#xA;&lt;p&gt;So, the goal of this challenge is to write a function that encodes a single word string to pig latin.&lt;/p&gt;&#xA;&lt;p&gt;The rules themselves are rather easy:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;The word starts with a vowel(a,e,i,o,u) -&amp;gt; return the original string plus &amp;ldquo;way&amp;rdquo;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;The word starts with a consonant -&amp;gt; move consonants from the beginning of the word to the end of the word until the first vowel, then return it plus &amp;ldquo;ay&amp;rdquo;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Count the Days in Java</title>
      <link>https://andrewodendaal.com/count-the-days-in-java/</link>
      <pubDate>Thu, 24 Dec 2020 00:54:51 +0000</pubDate>
      <guid>https://andrewodendaal.com/count-the-days-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Little Annie is very excited for upcoming events. She want&amp;rsquo;s to know how many days she have to wait for a specific event.&lt;/p&gt;&#xA;&lt;p&gt;Your job is to help her out.&lt;/p&gt;&#xA;&lt;p&gt;Task: Write a function which returns the number of days from today till the given date. The function will take a Date object as parameter. You have to round the amount of days.&lt;/p&gt;&#xA;&lt;p&gt;If the event is in the past, return &lt;strong&gt;&amp;ldquo;The day is in the past!&amp;rdquo;&lt;/strong&gt;&lt;br&gt;&#xA;If the event is today, return &lt;strong&gt;&amp;ldquo;Today is the day!&amp;rdquo;&lt;/strong&gt;&lt;br&gt;&#xA;Else, return &lt;strong&gt;&amp;ldquo;x days&amp;rdquo;&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Java HashMap Create or Increment Value</title>
      <link>https://andrewodendaal.com/java-hashmap-create-or-increment-value/</link>
      <pubDate>Wed, 23 Dec 2020 01:30:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/java-hashmap-create-or-increment-value/</guid>
      <description>&lt;p&gt;If you are using a &lt;code&gt;HashMap&lt;/code&gt; to keep a running total of a series of elements, then you often need to increment a &lt;code&gt;HashMap&lt;/code&gt; item, but if it doesn&amp;rsquo;t exist in the map yet, then you need to rather create it.&lt;/p&gt;&#xA;&lt;p&gt;There are a number of ways to do this, let&amp;rsquo;s explore some of these.&lt;/p&gt;&#xA;&lt;h2 id=&#34;using-merge-and-sum-in-java-8&#34;&gt;Using Merge and Sum in Java 8&lt;/h2&gt;&#xA;&lt;p&gt;My absolute favourite is to use Java 8&amp;rsquo;s ability to do the below:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Get the Strongest even number in an interval in Java</title>
      <link>https://andrewodendaal.com/get-the-strongest-even-number-in-an-interval-in-java/</link>
      <pubDate>Tue, 22 Dec 2020 02:02:27 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-the-strongest-even-number-in-an-interval-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;A strongness of an even number is the number of times we can successively divide by 2 until we reach an odd number starting with an even number n.&lt;/p&gt;&#xA;&lt;p&gt;For example, if n = 12, then&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;12 / 2 = 6&lt;/li&gt;&#xA;&lt;li&gt;6 / 2 = 3&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So we divided successively 2 times and we reached 3, so the strongness of 12 is &lt;code&gt;2&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;If n = 16 then&lt;/p&gt;</description>
    </item>
    <item>
      <title>What time is it? in Java</title>
      <link>https://andrewodendaal.com/what-time-is-it-in-java/</link>
      <pubDate>Mon, 21 Dec 2020 02:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/what-time-is-it-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;How many times have we been asked this simple question in our daily lives by family, friends and strangers alike?&lt;/p&gt;&#xA;&lt;p&gt;In this challenge you take a look at your watch and answer this question in proper English. Sometimes you have your watch in 24h format and others in 12h. The AM/PM part of the time is always disregarded as the asker knows whether it&amp;rsquo;s morning or afternoon.&lt;/p&gt;&#xA;&lt;h5 id=&#34;requirements&#34;&gt;Requirements:&lt;/h5&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Mind the punctuation for the full hours; &lt;strong&gt;o&amp;rsquo;clock&lt;/strong&gt; is written as one word.&lt;/li&gt;&#xA;&lt;li&gt;Spacing between individual words is strictly limited to one space. Cardinal numbers greater than 20 are hyphenated (e.g. &amp;ldquo;twenty-one&amp;rdquo;).&lt;/li&gt;&#xA;&lt;li&gt;Input is always going to be a non-null string in the format \d{2}:\d{2}(\s?[ap]m)?&lt;/li&gt;&#xA;&lt;li&gt;Both 12h and 24h input may be present. In case of 12h input disregard the am/pm part.&lt;/li&gt;&#xA;&lt;li&gt;Remember that in 24h midnight is denoted as 00:00.&lt;/li&gt;&#xA;&lt;li&gt;There may or may not be a space between the minutes and the am/pm part in 12h format.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h5 id=&#34;examples&#34;&gt;Examples:&lt;/h5&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;toHumanTime(&amp;#34;05:28 pm&amp;#34;); // twenty-eight minutes past five&#xA;toHumanTime(&amp;#34;12:00&amp;#34;);    // twelve o&amp;#39;clock&#xA;toHumanTime(&amp;#34;03:45am&amp;#34;);  // quarter to four&#xA;toHumanTime(&amp;#34;07:15&amp;#34;);    // quarter past seven&#xA;toHumanTime(&amp;#34;23:30&amp;#34;);    // half past eleven&#xA;toHumanTime(&amp;#34;00:01&amp;#34;);    // one minute past twelve&#xA;toHumanTime(&amp;#34;17:51&amp;#34;);    // nine minutes to six &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building a String Pyramid in Java</title>
      <link>https://andrewodendaal.com/building-a-string-pyramid-in-java/</link>
      <pubDate>Sun, 20 Dec 2020 02:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/building-a-string-pyramid-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You have to build a pyramid.&lt;/p&gt;&#xA;&lt;p&gt;This pyramid should be built from characters from a given string.&lt;/p&gt;&#xA;&lt;p&gt;You have to create the code for these four methods:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public static String watchPyramidFromTheSide(String characters)&#xA;&#xA;public static String watchPyramidFromAbove(String characters)&#xA;&#xA;public static int countVisibleCharactersOfThePyramid(String characters)&#xA;&#xA;public static int countAllCharactersOfThePyramid(String characters)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The first method (&amp;ldquo;FromTheSide&amp;rdquo;) shows the pyramid as you would see from the side.&lt;br&gt;&#xA;The second method (&amp;ldquo;FromAbove&amp;rdquo;) shows the pyramid as you would see from above.&lt;br&gt;&#xA;The third method (&amp;ldquo;CountVisibleCharacters&amp;rdquo;) should return the count of all characters, that are visible from outside the pyramid.&lt;br&gt;&#xA;The forth method (&amp;ldquo;CountAllCharacters&amp;rdquo;) should count all characters of the pyramid. Consider that the pyramid is completely solid and has no holes or rooms in it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cartesian coordinates from degree angle in Java</title>
      <link>https://andrewodendaal.com/cartesian-coordinates-from-degree-angle-in-java/</link>
      <pubDate>Sat, 19 Dec 2020 02:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/cartesian-coordinates-from-degree-angle-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a simple function that takes polar coordinates (an angle in degrees and a radius) and returns the equivalent cartesian coordinates (rounded to 10 places).&lt;/p&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;coordinates(90,1)&lt;/code&gt; &lt;code&gt;=&amp;gt; (0.0, 1.0)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;coordinates(45, 1)&lt;/code&gt; &lt;code&gt;=&amp;gt; (0.7071067812, 0.7071067812)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.awt.geom.Point2D;&#xA;&#xA;class CoordinatesInspector {&#xA;  Point2D.Double coordinates(Double degrees, Double radius) {&#xA;    return new Point2D.Double(&#xA;        Math.round(radius * Math.cos(Math.toRadians(degrees)) * 10e9) / 10e9,&#xA;        Math.round(radius * Math.sin(Math.toRadians(degrees)) * 10e9) / 10e9);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sort array by sorting its smallest sub-array in Java</title>
      <link>https://andrewodendaal.com/sort-array-by-sorting-its-smallest-sub-array-in-java/</link>
      <pubDate>Fri, 18 Dec 2020 02:08:41 +0000</pubDate>
      <guid>https://andrewodendaal.com/sort-array-by-sorting-its-smallest-sub-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of integers, arr, find out 2 indices m, n(0&amp;lt;=m&amp;lt;=arr.length-1, 0&amp;lt;=n&amp;lt;=arr.length-1, m&amp;lt;=n), so that as long as all elements in the subarray(from index m to n, indices m and n inclusive) are sorted properly, with this sorted subarray relacing original subarray, the whole array is sorted (no matter ascendingly or descendingly).&lt;/p&gt;&#xA;&lt;p&gt;The subarray should include the least number of elements, means (n-m) must be of the smallest value, and n should also be the smallest one.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Excessively Abundant Numbers in Java</title>
      <link>https://andrewodendaal.com/excessively-abundant-numbers-in-java/</link>
      <pubDate>Thu, 17 Dec 2020 02:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/excessively-abundant-numbers-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;An abundant number or excessive number is a number for which the sum of its proper divisors is greater than the number itself.&lt;/p&gt;&#xA;&lt;p&gt;The integer 12 is the first abundant number. Its proper divisors are 1, 2, 3, 4 and 6 for a total of 16 (&amp;gt; 12).&lt;/p&gt;&#xA;&lt;p&gt;Derive function &lt;code&gt;abundantNumber(num)/abundant_number(num)&lt;/code&gt; which returns &lt;code&gt;true/True/.true.&lt;/code&gt; if &lt;code&gt;num&lt;/code&gt; is abundant, &lt;code&gt;false/False/.false.&lt;/code&gt; if not.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (using &lt;code&gt;IntStream&lt;/code&gt;):&lt;/p&gt;</description>
    </item>
    <item>
      <title>Unique Substring From Joined Strings in Java</title>
      <link>https://andrewodendaal.com/unique-substring-from-joined-strings-in-java/</link>
      <pubDate>Wed, 16 Dec 2020 02:59:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/unique-substring-from-joined-strings-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that takes two strings, &lt;strong&gt;A&lt;/strong&gt; and &lt;strong&gt;B&lt;/strong&gt;, and returns the length of the longest possible substring that can be formed from the concatenation of either &lt;strong&gt;A + B&lt;/strong&gt; or &lt;strong&gt;B + A&lt;/strong&gt; containing only characters that do not appear in both A and B.&lt;/p&gt;&#xA;&lt;h2 id=&#34;example&#34;&gt;Example:&lt;/h2&gt;&#xA;&lt;p&gt;Given the strings &amp;ldquo;piquancy&amp;rdquo; and &amp;ldquo;refocusing&amp;rdquo;:&lt;br&gt;&#xA;A = &amp;ldquo;piquancy&amp;rdquo;&lt;br&gt;&#xA;B = &amp;ldquo;refocusing&amp;rdquo;&lt;br&gt;&#xA;A + B = &amp;ldquo;piquancyrefocusing&amp;rdquo;&lt;br&gt;&#xA;B + A = &amp;ldquo;refocusingpiquancy&amp;rdquo;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Converting from Base 10 to 16 (Decimal to Hex) in Java</title>
      <link>https://andrewodendaal.com/converting-from-base-10-to-16-decimal-to-hex-in-java/</link>
      <pubDate>Tue, 15 Dec 2020 00:04:38 +0000</pubDate>
      <guid>https://andrewodendaal.com/converting-from-base-10-to-16-decimal-to-hex-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Convert an &lt;code&gt;integer&lt;/code&gt; which is base 10, to a &lt;code&gt;hexadecimal&lt;/code&gt; base 16 &lt;code&gt;string&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Java provides various built-in options such as &lt;code&gt;Integer.toString(a, 16)&lt;/code&gt;, or &lt;code&gt;String.format(&amp;quot;0x%X&amp;quot;, a)&lt;/code&gt;, or &lt;code&gt;Integer.toHexString(a)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Hexadecimal{&#xA;    public static String convertToHex(int a){&#xA;        return &amp;#34;0x&amp;#34;+Integer.toHexString(a).toUpperCase();&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Hexadecimal{&#xA;&#xA;private static final String hexDigits = &amp;#34;0123456789ABCDEF&amp;#34;;&#xA;    public static String convertToHex(int a) {&#xA;        String hexadecimal = &amp;#34;&amp;#34;;&#xA;&#xA;        while (a &amp;gt; 0) {&#xA;            int digit = a % 16;&#xA;            hexadecimal = hexDigits.charAt(digit) + hexadecimal;&#xA;            a = a / 16;&#xA;        }&#xA;        return &amp;#34;0x&amp;#34; + hexadecimal;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Format Numbers by Prepending 0 to single-digit numbers in Javascript</title>
      <link>https://andrewodendaal.com/how-to-format-numbers-by-prepending-0-to-single-digit-numbers-in-javascript/</link>
      <pubDate>Mon, 14 Dec 2020 01:40:53 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-format-numbers-by-prepending-0-to-single-digit-numbers-in-javascript/</guid>
      <description>&lt;p&gt;If you have a single-digit number, and you need to format it to always have at-least two digits, then you can use the below function to solve your problem:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function toAtleastTwoPlaces(n){&#xA;    return n &amp;gt; 9 ? &amp;#34;&amp;#34; + n: &amp;#34;0&amp;#34; + n;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When testing the above method, you could do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;toAtleastTwoPlaces(9);   //Returns &amp;#34;09&amp;#34;&#xA;toAtleastTwoPlaces(10);  //Returns &amp;#34;10&amp;#34;&#xA;toAtleastTwoPlaces(999); //Returns &amp;#34;999&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is especially useful where you need to format dates:&lt;/p&gt;</description>
    </item>
    <item>
      <title>String polynomial converter in Java</title>
      <link>https://andrewodendaal.com/string-polynomial-converter-in-java/</link>
      <pubDate>Sun, 13 Dec 2020 01:29:23 +0000</pubDate>
      <guid>https://andrewodendaal.com/string-polynomial-converter-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Your task is to programe:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;String convertToString(int[] pol) {....}&lt;/code&gt; The method returns given by a parameter, (integer array) which represents a polynomial, the representation of the polynomial in String format. NOTE:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;array{a, b, c, d, e,...., z}&#xA;      0  1  2  3  4 ....  n&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The numbers indicate the grade of the polynomial, where n is a positive integer always. Some examples:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;array{0,1,-2,0,5}  -&amp;gt; convertToString(array) -&amp;gt; &amp;#34;5x^4-2x^2+x&amp;#34;&#xA;array{1,1,-2,0,0}  -&amp;gt; convertToString(array) -&amp;gt; &amp;#34;-2x^2+x+1&amp;#34;&#xA;array{}  -&amp;gt; convertToString(array) -&amp;gt; &amp;#34;&amp;#34;&#xA;array{0,0,7,0,0}  -&amp;gt; convertToString(array) -&amp;gt; &amp;#34;7x^2&amp;#34;&#xA;array{1,0,0,0,0}  -&amp;gt; convertToString(array) -&amp;gt; &amp;#34;1&amp;#34;&#xA;array{0,1,-1,0,5,0,0,1}  -&amp;gt; convertToString(array) -&amp;gt; &amp;#34;x^7+5x^4-x^2+x&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Remove all Exclamation Marks from a String in Java</title>
      <link>https://andrewodendaal.com/how-to-remove-all-exclamation-marks-from-a-string-in-java/</link>
      <pubDate>Sat, 12 Dec 2020 02:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-remove-all-exclamation-marks-from-a-string-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write function RemoveExclamationMarks which removes all exclamation marks from a given string.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;    static String removeExclamationMarks(String s) {&#xA;        return s.replaceAll(&amp;#34;!&amp;#34;, &amp;#34;&amp;#34;);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;    static String removeExclamationMarks(String s) {&#xA;        return s.replace(&amp;#34;!&amp;#34;, &amp;#34;&amp;#34;);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution-in-java&#34;&gt;Test cases to validate our solution in Java&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import java.util.Random;&#xA;import java.util.stream.*;&#xA;import static org.junit.Assert.assertEquals;&#xA;&#xA;public class SolutionTest {&#xA;&#xA;    @Test&#xA;    public void testSimpleString1() {&#xA;        assertEquals(&amp;#34;Hello World&amp;#34;, Solution.removeExclamationMarks(&amp;#34;Hello World!&amp;#34;));&#xA;    }&#xA;    &#xA;    @Test&#xA;    public void testSimpleString2() {&#xA;        assertEquals(&amp;#34;Hello World&amp;#34;, Solution.removeExclamationMarks(&amp;#34;Hello World!!!&amp;#34;));&#xA;    }&#xA;    &#xA;    @Test&#xA;    public void testSimpleString3() {&#xA;        assertEquals(&amp;#34;Hi Hello&amp;#34;, Solution.removeExclamationMarks(&amp;#34;Hi! Hello!&amp;#34;));&#xA;    }&#xA;    &#xA;    @Test&#xA;    public void testRandomString() {&#xA;        String rs = String.format(&amp;#34;%s!%s %s!%s&amp;#34;, randomString(), randomString(), randomString(), randomString());&#xA;        assertEquals(solution(rs), Solution.removeExclamationMarks(rs));&#xA;    }&#xA;    &#xA;    private String randomString() {&#xA;        Random random = new Random();&#xA;        String abc = &amp;#34;ABCDEFGHIJKLMNOPQRSTUVWXYZbcdefghijklmnopqrstuvwxyz&amp;#34;;&#xA;        return IntStream.range(0, 10)&#xA;                        .mapToObj(__ -&amp;gt; (char) abc.charAt(random.nextInt(abc.length())))&#xA;                        .map(String::valueOf)&#xA;                        .collect(Collectors.joining(&amp;#34;&amp;#34;));&#xA;    }&#xA;    &#xA;    private String solution(String s) {&#xA;        return s.replaceAll(&amp;#34;!&amp;#34;, &amp;#34;&amp;#34;);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Convert a Number to a String in Java</title>
      <link>https://andrewodendaal.com/how-to-convert-a-number-to-a-string-in-java/</link>
      <pubDate>Fri, 11 Dec 2020 03:52:07 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-a-number-to-a-string-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;We need a function that can transform a number into a string.&lt;/p&gt;&#xA;&lt;p&gt;What ways of achieving this do you know?&lt;/p&gt;&#xA;&lt;h4 id=&#34;examples&#34;&gt;Examples:&lt;/h4&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Solution.numberToString(123); // returns &amp;#34;123&amp;#34;;   &#xA;Solution.numberToString(999); // returns &amp;#34;999&amp;#34;;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;The easiest way to do this is to use the &lt;code&gt;String.valueOf&lt;/code&gt; method to take an integer and return a string:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;  public static String numberToString(int num) {&#xA;    return String.valueOf(num);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This can also be done the other way around, using the &lt;code&gt;Integer.toString&lt;/code&gt; method:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Remove Spaces in a String in Java</title>
      <link>https://andrewodendaal.com/how-to-remove-spaces-in-a-string-in-java/</link>
      <pubDate>Thu, 10 Dec 2020 01:00:23 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-remove-spaces-in-a-string-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Simple, remove the spaces from the string, then return the resultant string.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;    static String noSpace(final String x) {&#xA;        return x.replace(&amp;#34; &amp;#34;, &amp;#34;&amp;#34;);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;An alternative:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;    static String noSpace(final String x) {&#xA;        return x.replaceAll(&amp;#34;\\s+&amp;#34;,&amp;#34;&amp;#34;);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-java-solution&#34;&gt;Test cases to validate our Java solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import java.util.Random;&#xA;import static org.junit.Assert.assertEquals;&#xA;&#xA;public class SolutionTest {&#xA;    @Test public void testSomething() {&#xA;        assertEquals(&amp;#34;8j8mBliB8gimjB8B8jlB&amp;#34;, Solution.noSpace(&amp;#34;8 j 8   mBliB8g  imjB8B8  jl  B&amp;#34;));&#xA;        assertEquals(&amp;#34;88Bifk8hB8BB8BBBB888chl8BhBfd&amp;#34;, Solution.noSpace(&amp;#34;8 8 Bi fk8h B 8 BB8B B B  B888 c hl8 BhB fd&amp;#34;));&#xA;        assertEquals(&amp;#34;8aaaaaddddr&amp;#34;, Solution.noSpace(&amp;#34;8aaaaa dddd r     &amp;#34;));&#xA;        assertEquals(&amp;#34;jfBmgklf8hg88lbe8&amp;#34;, Solution.noSpace(&amp;#34;jfBm  gk lf8hg  88lbe8 &amp;#34;));&#xA;        assertEquals(&amp;#34;8jaam&amp;#34;, Solution.noSpace(&amp;#34;8j aam&amp;#34;));&#xA;    }&#xA;    &#xA;    private static final String chars = &amp;#34;abc defg hij klm no pq rstuvw xyz&amp;#34;;&#xA;&#xA;    @Test public void randomTests() {&#xA;        Random random = new Random();&#xA;        StringBuilder sb = new StringBuilder();&#xA;        for (int i = 0; i &amp;lt; 20; i++) {&#xA;            int length = random.nextInt(15) + 1;&#xA;            for (int j = 0; j &amp;lt; length; j++) {&#xA;                int index = random.nextInt(chars.length());&#xA;                sb.append(chars.charAt(index));&#xA;            }&#xA;            String input = sb.toString();&#xA;            sb.setLength(0);&#xA;            assertEquals(input.replaceAll(&amp;#34; &amp;#34;, &amp;#34;&amp;#34;), Solution.noSpace(input));&#xA;        }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How many stairs will Suzuki climb in 20 years? in Java</title>
      <link>https://andrewodendaal.com/how-many-stairs-will-suzuki-climb-in-20-years-in-java/</link>
      <pubDate>Wed, 09 Dec 2020 01:49:03 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-many-stairs-will-suzuki-climb-in-20-years-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Suzuki is a monk who climbs a large staircase to the monastery as part of a ritual. Some days he climbs more stairs than others depending on the number of students he must train in the morning. He is curious how many stairs might be climbed over the next 20 years and has spent a year marking down his daily progress.&lt;/p&gt;&#xA;&lt;p&gt;The sum of all the stairs logged in a year will be used for estimating the number he might climb in 20.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Determine if N is divisible by X and Y in Java</title>
      <link>https://andrewodendaal.com/determine-if-n-is-divisible-by-x-and-y-in-java/</link>
      <pubDate>Tue, 08 Dec 2020 00:51:34 +0000</pubDate>
      <guid>https://andrewodendaal.com/determine-if-n-is-divisible-by-x-and-y-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function that checks if a number &lt;code&gt;n&lt;/code&gt; is divisible by two numbers &lt;code&gt;x&lt;/code&gt; &lt;strong&gt;AND&lt;/strong&gt; &lt;code&gt;y&lt;/code&gt;. All inputs are positive, non-zero digits.&lt;/p&gt;&#xA;&lt;h4 id=&#34;examples&#34;&gt;Examples&lt;/h4&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;1) n =   3, x = 1, y = 3 =&amp;gt;  true because   3 is divisible by 1 and 3&#xA;2) n =  12, x = 2, y = 6 =&amp;gt;  true because  12 is divisible by 2 and 6&#xA;3) n = 100, x = 5, y = 3 =&amp;gt; false because 100 is not divisible by 3&#xA;4) n =  12, x = 7, y = 5 =&amp;gt; false because  12 is neither divisible by 7 nor 5&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Sum a Mixed Array in Java</title>
      <link>https://andrewodendaal.com/how-to-sum-a-mixed-array-in-java/</link>
      <pubDate>Mon, 07 Dec 2020 01:40:11 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-sum-a-mixed-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of integers as strings and numbers, return the sum of the array values as if all were numbers.&lt;/p&gt;&#xA;&lt;p&gt;Return your answer as a number.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (using &lt;code&gt;stream&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.List;&#xA;&#xA;public class MixedSum {&#xA;&#xA;  public int sum(List&amp;lt;?&amp;gt; mixed) {&#xA;    return mixed.stream().mapToInt(o -&amp;gt; Integer.parseInt(o.toString())).sum();&#xA;  }&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2 (the harder way):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.List;&#xA;&#xA;public class MixedSum {&#xA;  public int sum(List&amp;lt;?&amp;gt; mixed) { &#xA;      int sum = 0;&#xA;    &#xA;      for (Object element : mixed) {&#xA;        if (element instanceof Integer) {&#xA;          sum += (Integer) element;&#xA;        } else if (element instanceof String) {&#xA;          sum += Integer.parseInt( (String) element );&#xA;        }&#xA;      }&#xA;      return sum;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3 (using &lt;code&gt;Objects&lt;/code&gt;):&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calculate the Volume of a Cuboid in Java</title>
      <link>https://andrewodendaal.com/calculate-the-volume-of-a-cuboid-in-java/</link>
      <pubDate>Sun, 06 Dec 2020 09:45:07 +0000</pubDate>
      <guid>https://andrewodendaal.com/calculate-the-volume-of-a-cuboid-in-java/</guid>
      <description>&lt;p&gt;A Cuboid is a geometric object that is more or less cubic in shape. It is a solid which has six rectangular faces at right angles to each other.&lt;/p&gt;&#xA;&lt;p&gt;The formula to calculate a cuboid is pretty simple, just multiple the length by the width by the height to get the total volume. We want to calculate &lt;strong&gt;volume of cuboid&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Additionally, the volume of cuboid test case below validates the Java code solution.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find the first non-consecutive number in Java</title>
      <link>https://andrewodendaal.com/find-the-first-non-consecutive-number-in-java/</link>
      <pubDate>Sat, 05 Dec 2020 01:24:29 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-first-non-consecutive-number-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Your task is to find the first element of an array that is not consecutive.&lt;/p&gt;&#xA;&lt;p&gt;By not consecutive we mean not exactly 1 larger than the previous element of the array.&lt;/p&gt;&#xA;&lt;p&gt;E.g. If we have an array &lt;code&gt;[1,2,3,4,6,7,8]&lt;/code&gt; then &lt;code&gt;1&lt;/code&gt; then &lt;code&gt;2&lt;/code&gt; then &lt;code&gt;3&lt;/code&gt; then &lt;code&gt;4&lt;/code&gt; are all consecutive but &lt;code&gt;6&lt;/code&gt; is not, so that&amp;rsquo;s the first non-consecutive number.&lt;/p&gt;&#xA;&lt;p&gt;If the whole array is consecutive then return &lt;code&gt;null&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Alternating String Casing in Java</title>
      <link>https://andrewodendaal.com/alternating-string-casing-in-java/</link>
      <pubDate>Fri, 04 Dec 2020 00:43:36 +0000</pubDate>
      <guid>https://andrewodendaal.com/alternating-string-casing-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;h3 id=&#34;alternating-case--alternating-case&#34;&gt;altERnaTIng cAsE &amp;lt;=&amp;gt; ALTerNAtiNG CaSe&lt;/h3&gt;&#xA;&lt;p&gt;Define &lt;code&gt;String.prototype.toAlternatingCase&lt;/code&gt; (or a similar function/method &lt;em&gt;such as&lt;/em&gt; &lt;code&gt;to_alternating_case&lt;/code&gt;/&lt;code&gt;toAlternatingCase&lt;/code&gt;/&lt;code&gt;ToAlternatingCase&lt;/code&gt; in your selected language; &lt;strong&gt;see the initial solution for details&lt;/strong&gt;) such that each lowercase letter becomes uppercase and each uppercase letter becomes lowercase. For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;StringUtils.toAlternativeString(&amp;#34;hello world&amp;#34;) == &amp;#34;HELLO WORLD&amp;#34;&#xA;StringUtils.toAlternativeString(&amp;#34;HELLO WORLD&amp;#34;) == &amp;#34;hello world&amp;#34;&#xA;StringUtils.toAlternativeString(&amp;#34;hello WORLD&amp;#34;) == &amp;#34;HELLO world&amp;#34;&#xA;StringUtils.toAlternativeString(&amp;#34;HeLLo WoRLD&amp;#34;) == &amp;#34;hEllO wOrld&amp;#34;&#xA;StringUtils.toAlternativeString(&amp;#34;12345&amp;#34;) == &amp;#34;12345&amp;#34; // Non-alphabetical characters are unaffected&#xA;StringUtils.toAlternativeString(&amp;#34;1a2b3c4d5e&amp;#34;) == &amp;#34;1A2B3C4D5E&amp;#34;&#xA;StringUtils.toAlternativeString(&amp;#34;StringUtils.toAlternatingCase&amp;#34;) == &amp;#34;sTRINGuTILS.TOaLTERNATINGcASE&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As usual, your function/method should be pure, i.e. it should &lt;strong&gt;not&lt;/strong&gt; mutate the original string.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Solving the Pythagorean Triple in Java</title>
      <link>https://andrewodendaal.com/solving-the-pythagorean-triple-in-java/</link>
      <pubDate>Thu, 03 Dec 2020 01:37:57 +0000</pubDate>
      <guid>https://andrewodendaal.com/solving-the-pythagorean-triple-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of 3 integers &lt;code&gt;a, b and c&lt;/code&gt;, determine if they form a pythagorean triple.&lt;/p&gt;&#xA;&lt;p&gt;A pythagorean triple is formed when:&lt;/p&gt;&#xA;&lt;h2 id=&#34;c2--a2--b2&#34;&gt;c&lt;!-- raw HTML omitted --&gt;2&lt;!-- raw HTML omitted --&gt; = a&lt;!-- raw HTML omitted --&gt;2&lt;!-- raw HTML omitted --&gt; + b&lt;!-- raw HTML omitted --&gt;2&lt;!-- raw HTML omitted --&gt;&lt;/h2&gt;&#xA;&lt;p&gt;where &lt;code&gt;c&lt;/code&gt; is the largest value of &lt;code&gt;a, b, c&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For example: &lt;code&gt;a = 3, b = 4, c = 5&lt;/code&gt; forms a pythagorean triple, because 5&lt;!-- raw HTML omitted --&gt;2&lt;!-- raw HTML omitted --&gt; = 3&lt;!-- raw HTML omitted --&gt;2&lt;!-- raw HTML omitted --&gt; + 4&lt;!-- raw HTML omitted --&gt;2&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Correct the Mistakes of the Character Recognition Software in Java</title>
      <link>https://andrewodendaal.com/how-to-correct-the-mistakes-of-the-character-recognition-software-in-java/</link>
      <pubDate>Wed, 02 Dec 2020 00:18:30 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-correct-the-mistakes-of-the-character-recognition-software-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Character recognition software is widely used to digitise printed texts. Thus the texts can be edited, searched and stored on a computer.&lt;/p&gt;&#xA;&lt;p&gt;When documents (especially pretty old ones written with a typewriter), are digitised character recognition softwares often make mistakes.&lt;/p&gt;&#xA;&lt;p&gt;Your task is correct the errors in the digitised text. You only have to handle the following mistakes:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;S&lt;/code&gt; is misinterpreted as &lt;code&gt;5&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;O&lt;/code&gt; is misinterpreted as ``&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;I&lt;/code&gt; is misinterpreted as &lt;code&gt;1&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The test cases contain numbers only by mistake.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Solving “Duck Duck Goose” in Java</title>
      <link>https://andrewodendaal.com/solving-duck-duck-goose-in-java/</link>
      <pubDate>Tue, 01 Dec 2020 01:28:38 +0000</pubDate>
      <guid>https://andrewodendaal.com/solving-duck-duck-goose-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The objective of &lt;!-- raw HTML omitted --&gt;Duck, duck, goose&lt;!-- raw HTML omitted --&gt; is to &lt;em&gt;walk in a circle&lt;/em&gt;, tapping on each player&amp;rsquo;s head until one is chosen.&lt;/p&gt;&#xA;&lt;p&gt;Task: Given an array of Player objects (an array of associative arrays in PHP) and an index (&lt;strong&gt;1-based&lt;/strong&gt;), return the &lt;code&gt;name&lt;/code&gt; of the chosen Player(&lt;code&gt;name&lt;/code&gt; is a property of &lt;code&gt;Player&lt;/code&gt; objects, e.g &lt;code&gt;Player.name&lt;/code&gt;)&lt;/p&gt;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;duck_duck_goose([a, b, c, d], 1) should return a.name&#xA;duck_duck_goose([a, b, c, d], 5) should return a.name&#xA;duck_duck_goose([a, b, c, d], 4) should return d.name&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (&lt;code&gt;returning the modulo&lt;/code&gt;):&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calculate averages from an int array in Java</title>
      <link>https://andrewodendaal.com/calculate-averages-from-an-int-array-in-java/</link>
      <pubDate>Mon, 30 Nov 2020 00:52:16 +0000</pubDate>
      <guid>https://andrewodendaal.com/calculate-averages-from-an-int-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write function avg which calculates average of numbers in given list.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (working through the problem):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution {&#xA;  public static double find_average(int[] array){&#xA;    double sum = 0;&#xA;    &#xA;    for(int i=0; i&amp;lt;array.length; i++) {&#xA;      sum+=array[i];&#xA;    }&#xA;    &#xA;    return sum/array.length;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2 (using &lt;code&gt;streams&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.Arrays;&#xA;public class Solution {&#xA;  public static double find_average(int[] array){&#xA;    return Arrays.stream(array).average().orElse(0);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 3 (using an &lt;code&gt;IntStream&lt;/code&gt;):&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Rotate a String in Java</title>
      <link>https://andrewodendaal.com/how-to-rotate-a-string-in-java/</link>
      <pubDate>Sun, 29 Nov 2020 00:59:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-rotate-a-string-in-java/</guid>
      <description>&lt;p&gt;Rotating a &lt;code&gt;String&lt;/code&gt; in Java is a common interview question, and albeit it quite a simple one, it tests many fundamental concepts. Did I mention that it can also be done fairly quickly too!&lt;/p&gt;&#xA;&lt;h2 id=&#34;rotating-a-string-in-java&#34;&gt;Rotating a String in Java&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Rotater {&#xA;&#xA;    public static void main(String...args) {&#xA;&#xA;        Rotater r = new Rotater();&#xA;&#xA;        System.out.println(r.rotateLeft(&amp;#34;test&amp;#34;, 1));&#xA;        System.out.println(r.rotateRight(&amp;#34;test&amp;#34;, 1));&#xA;&#xA;    }&#xA;&#xA;    private String rotateLeft(String value, int n) {&#xA;        return value.substring(n) + value.substring(0, n);&#xA;    }&#xA;&#xA;    private String rotateRight(String value, int n) {&#xA;        return rotateLeft(value, value.length() - n);&#xA;    }&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;With the above code, we can rotate a string both left and right, but we don&amp;rsquo;t take into account any edge cases, exception handling, input validation or out of bounds problems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calculate the Sum without highest and lowest number in Java</title>
      <link>https://andrewodendaal.com/calculate-the-sum-without-highest-and-lowest-number-in-java/</link>
      <pubDate>Sat, 28 Nov 2020 00:17:50 +0000</pubDate>
      <guid>https://andrewodendaal.com/calculate-the-sum-without-highest-and-lowest-number-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Sum all the numbers of the array except the highest and the lowest element (the value, not the index!).&lt;br&gt;&#xA;(The highest/lowest element is respectively only one element at each edge, even if there are more than one with the same value!)&lt;/p&gt;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{ 6, 2, 1, 8, 10 } =&amp;gt; 16&#xA;{ 1, 1, 11, 2, 3 } =&amp;gt; 6&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If array is empty, null or None, or if only 1 Element exists, return 0.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Convert a String to an Array in Java</title>
      <link>https://andrewodendaal.com/how-to-convert-a-string-to-an-array-in-java/</link>
      <pubDate>Fri, 27 Nov 2020 04:04:15 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-a-string-to-an-array-in-java/</guid>
      <description>&lt;p&gt;Java makes it easy to convert a string to an array by providing the built-in &lt;code&gt;.split()&lt;/code&gt; method on the &lt;code&gt;String&lt;/code&gt; object.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function to split a string and convert it into an array of words. For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;Robin Singh&amp;#34; ==&amp;gt; [&amp;#34;Robin&amp;#34;, &amp;#34;Singh&amp;#34;]&#xA;&#xA;&amp;#34;I love arrays they are my favorite&amp;#34; ==&amp;gt; [&amp;#34;I&amp;#34;, &amp;#34;love&amp;#34;, &amp;#34;arrays&amp;#34;, &amp;#34;they&amp;#34;, &amp;#34;are&amp;#34;, &amp;#34;my&amp;#34;, &amp;#34;favorite&amp;#34;]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;This is a really simple one, you just &lt;code&gt;split&lt;/code&gt; the &lt;code&gt;string&lt;/code&gt; with the &lt;code&gt;space&lt;/code&gt; character:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Loop and Combine Three Strings in Java</title>
      <link>https://andrewodendaal.com/how-to-loop-and-combine-three-strings-in-java/</link>
      <pubDate>Thu, 26 Nov 2020 00:20:56 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-loop-and-combine-three-strings-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function that will return a string that combines all of the letters of the three inputed strings in groups. Taking the first letter of all of the inputs and grouping them next to each other. Do this for every letter, see example below!&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;E.g. Input: &amp;ldquo;aa&amp;rdquo;, &amp;ldquo;bb&amp;rdquo; , &amp;ldquo;cc&amp;rdquo; =&amp;gt; Output: &amp;ldquo;abcabc&amp;rdquo;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Note: You can expect all of the inputs to be the same length.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Localize The Barycenter of a Triangle in Java</title>
      <link>https://andrewodendaal.com/how-to-localize-the-barycenter-of-a-triangle-in-java/</link>
      <pubDate>Wed, 25 Nov 2020 01:40:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-localize-the-barycenter-of-a-triangle-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2020/11/image-8.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;The medians of a triangle are the segments that unit the vertices with the midpoint of their opposite sides. The three medians of a triangle intersect at the same point, called the barycenter or the centroid. Given a triangle, defined by the cartesian coordinates of its vertices we need to localize its barycenter or centroid.&lt;/p&gt;&#xA;&lt;p&gt;The function &lt;code&gt;bar_triang() or barTriang or bar-triang&lt;/code&gt;, receives the coordinates of the three vertices &lt;code&gt;A, B and C&lt;/code&gt; as three different arguments and outputs the coordinates of the barycenter &lt;code&gt;O&lt;/code&gt; in an array &lt;code&gt;[xO, yO]&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate a Valid Square in Java</title>
      <link>https://andrewodendaal.com/how-to-calculate-a-valid-square-in-java/</link>
      <pubDate>Tue, 24 Nov 2020 00:03:24 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-a-valid-square-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given the coordinates of four points in 2D space &lt;code&gt;p1&lt;/code&gt;, &lt;code&gt;p2&lt;/code&gt;, &lt;code&gt;p3&lt;/code&gt; and &lt;code&gt;p4&lt;/code&gt;, return &lt;code&gt;true&lt;/code&gt; &lt;em&gt;if the four points construct a square&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The coordinate of a point &lt;code&gt;p&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;&lt;/code&gt; is represented as &lt;code&gt;[x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;, y&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;]&lt;/code&gt;. The input is &lt;strong&gt;not&lt;/strong&gt; given in any order.&lt;/p&gt;&#xA;&lt;p&gt;A &lt;strong&gt;valid square&lt;/strong&gt; has four equal sides with positive length and four equal angles (90-degree angles).&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate Age Range Compatibility as an Equation in Java</title>
      <link>https://andrewodendaal.com/how-to-calculate-age-range-compatibility-as-an-equation-in-java/</link>
      <pubDate>Mon, 23 Nov 2020 00:58:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-age-range-compatibility-as-an-equation-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Everybody knows the classic &lt;!-- raw HTML omitted --&gt;&amp;ldquo;half your age plus seven&amp;rdquo;&lt;!-- raw HTML omitted --&gt; dating rule that a lot of people follow (including myself). It&amp;rsquo;s the ‘recommended&amp;rsquo; age range in which to date someone.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2020/11/image-5.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;minimum age &amp;lt;= your age &amp;lt;= maximum age&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Given an integer (1 &amp;lt;= n &amp;lt;= 100) representing a person&amp;rsquo;s age, return their minimum and maximum age range.&lt;/p&gt;&#xA;&lt;p&gt;This equation doesn&amp;rsquo;t work when the age &amp;lt;= 14, so use this equation instead:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Longest Mountain in Array in Java</title>
      <link>https://andrewodendaal.com/how-to-find-the-longest-mountain-in-array-in-java/</link>
      <pubDate>Sun, 22 Nov 2020 02:41:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-longest-mountain-in-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s call any (contiguous) subarray B (of A) a &lt;em&gt;mountain&lt;/em&gt; if the following properties hold:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;B.length &amp;gt;= 3&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;There exists some &lt;code&gt;0 &amp;lt; i&amp;amp;nbsp;&amp;lt; B.length - 1&lt;/code&gt; such that &lt;code&gt;B[0] &amp;lt; B[1] &amp;lt; ... B[i-1] &amp;lt; B[i] &amp;gt; B[i+1] &amp;gt; ... &amp;gt; B[B.length - 1]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;(Note that B could be any subarray of A, including the entire array A.)&lt;/p&gt;&#xA;&lt;p&gt;Given an array &lt;code&gt;A&lt;/code&gt; of integers, return the length of the longest &lt;em&gt;mountain&lt;/em&gt;. &lt;/p&gt;</description>
    </item>
    <item>
      <title>How to tell what the CHMOD value of a file/directory is</title>
      <link>https://andrewodendaal.com/how-to-tell-what-the-chmod-value-of-a-file-directory-is/</link>
      <pubDate>Sat, 21 Nov 2020 00:57:59 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-tell-what-the-chmod-value-of-a-file-directory-is/</guid>
      <description>&lt;p&gt;&lt;code&gt;chmod&lt;/code&gt; alters the permissions for a file or directory, you could allow full read/write access to a file or directory by running the following command:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;chmod 777 myfile.ext&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You could do the same on a directory recursively:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;chmod -R 777 mydirectory&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;But if we look at the directory listing of this path now, we can&amp;rsquo;t tell what integer value this affected:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ ls -lash&#xA;&#xA;0 -rwxrwxrwx   1 ao  staff     0B 18 Nov 13:29 myfile.ext&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-get-the-chmod-value&#34;&gt;How to get the CHMOD value&lt;/h2&gt;&#xA;&lt;p&gt;If we want to get the actual integer value back, we could use the &lt;code&gt;stat&lt;/code&gt; command and tell it what we want from it:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve the “Decode a String” Challenge in Java</title>
      <link>https://andrewodendaal.com/how-to-solve-the-decode-a-string-challenge-in-java/</link>
      <pubDate>Fri, 20 Nov 2020 01:42:32 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-the-decode-a-string-challenge-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an encoded string, return its decoded string.&lt;/p&gt;&#xA;&lt;p&gt;The encoding rule is: &lt;code&gt;k[encoded_string]&lt;/code&gt;, where the &lt;em&gt;encoded_string&lt;/em&gt; inside the square brackets is being repeated exactly &lt;em&gt;k&lt;/em&gt; times. Note that &lt;em&gt;k&lt;/em&gt; is guaranteed to be a positive integer.&lt;/p&gt;&#xA;&lt;p&gt;You may assume that the input string is always valid; No extra white spaces, square brackets are well-formed, etc.&lt;/p&gt;&#xA;&lt;p&gt;Furthermore, you may assume that the original data does not contain any digits and that digits are only for those repeat numbers, &lt;em&gt;k&lt;/em&gt;. For example, there won&amp;rsquo;t be input like &lt;code&gt;3a&lt;/code&gt; or &lt;code&gt;2[4]&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to cleanup a /var/log/journal in Linux</title>
      <link>https://andrewodendaal.com/how-to-cleanup-a-var-log-journal-in-linux/</link>
      <pubDate>Thu, 19 Nov 2020 00:06:48 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-cleanup-a-var-log-journal-in-linux/</guid>
      <description>&lt;p&gt;You may find your &lt;code&gt;/var/log/journal&lt;/code&gt; directory taking up a lot of disk-space.&lt;/p&gt;&#xA;&lt;p&gt;How do you go about removing, or deleting all these files under &lt;code&gt;var log journal&lt;/code&gt; without the system complaining and falling over?&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-tell-how-much-space-is-being-taken&#34;&gt;How to tell how much space is being taken?&lt;/h2&gt;&#xA;&lt;p&gt;You can ask the &lt;code&gt;journalctl&lt;/code&gt; command directly, using the &lt;code&gt;--disk-usage&lt;/code&gt; argument:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;journalctl --disk-usage&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It will report something like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Journals take up 3.9G on disk.&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;fix-option-1-not-ideal&#34;&gt;Fix: Option 1 (not ideal):&lt;/h2&gt;&#xA;&lt;p&gt;Go and adjust its config under &lt;code&gt;/etc/systemd/journald.conf&lt;/code&gt;, making sure to pay attention to the &lt;code&gt;SystemMaxUse&lt;/code&gt; key; set this to something reasonable, like &lt;code&gt;50M&lt;/code&gt; perhaps.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Maximum Difference Between Node and Ancestor in Java</title>
      <link>https://andrewodendaal.com/how-to-find-the-maximum-difference-between-node-and-ancestor-in-java/</link>
      <pubDate>Wed, 18 Nov 2020 00:43:35 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-maximum-difference-between-node-and-ancestor-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given the &lt;code&gt;root&lt;/code&gt; of a binary tree, find the maximum value &lt;code&gt;V&lt;/code&gt; for which there exist &lt;strong&gt;different&lt;/strong&gt; nodes &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt; where &lt;code&gt;V = |A.val - B.val|&lt;/code&gt; and &lt;code&gt;A&lt;/code&gt; is an ancestor of &lt;code&gt;B&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;A node &lt;code&gt;A&lt;/code&gt; is an ancestor of &lt;code&gt;B&lt;/code&gt; if either: any child of &lt;code&gt;A&lt;/code&gt; is equal to &lt;code&gt;B&lt;/code&gt;, or any child of &lt;code&gt;A&lt;/code&gt; is an ancestor of &lt;code&gt;B&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2020/11/image-3.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Integral using Java</title>
      <link>https://andrewodendaal.com/how-to-find-the-integral-using-java/</link>
      <pubDate>Tue, 17 Nov 2020 01:43:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-integral-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function that finds the &lt;!-- raw HTML omitted --&gt;integral&lt;!-- raw HTML omitted --&gt; of the expression passed.&lt;/p&gt;&#xA;&lt;p&gt;In order to find the integral all you need to do is add one to the &lt;code&gt;exponent&lt;/code&gt; (the second argument), and divide the &lt;code&gt;coefficient&lt;/code&gt; (the first argument) by that new number.&lt;/p&gt;&#xA;&lt;p&gt;For example for &lt;code&gt;3x^2&lt;/code&gt;, the integral would be &lt;code&gt;1x^3&lt;/code&gt;: we added 1 to the exponent, and divided the coefficient by that new number).&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Build Strings from a Size in Java</title>
      <link>https://andrewodendaal.com/how-to-build-strings-from-a-size-in-java/</link>
      <pubDate>Mon, 16 Nov 2020 01:18:54 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-build-strings-from-a-size-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function &lt;code&gt;stringy&lt;/code&gt; that takes a &lt;code&gt;size&lt;/code&gt; and returns a &lt;code&gt;string&lt;/code&gt; of alternating &lt;code&gt;&#39;1s&#39;&lt;/code&gt; and &lt;code&gt;&#39;0s&#39;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The string should start with a &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;A string with &lt;code&gt;size&lt;/code&gt; 6 should return :&lt;code&gt;&#39;101010&#39;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;With &lt;code&gt;size&lt;/code&gt; 4 should return : &lt;code&gt;&#39;1010&#39;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;With &lt;code&gt;size&lt;/code&gt; 12 should return : &lt;code&gt;&#39;101010101010&#39;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The size will always be positive and will only use whole numbers.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution {&#xA;  public static String stringy(int size) {&#xA;    int last = 1;&#xA;    StringBuilder sb = new StringBuilder();&#xA;    &#xA;    for (int i=0; i&amp;lt;size; i++) {&#xA;      sb.append(last);&#xA;      last = last==0 ? 1 : 0;&#xA;    }&#xA;    &#xA;    return sb.toString();&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We could make this a little simpler by doing the following:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Best Time to Buy and Sell Stock in Java</title>
      <link>https://andrewodendaal.com/best-time-to-buy-and-sell-stock-in-java/</link>
      <pubDate>Sun, 15 Nov 2020 01:59:41 +0000</pubDate>
      <guid>https://andrewodendaal.com/best-time-to-buy-and-sell-stock-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Say you have an array for which the &lt;em&gt;i&lt;/em&gt;&lt;!-- raw HTML omitted --&gt;th&lt;!-- raw HTML omitted --&gt; element is the price of a given stock on day &lt;em&gt;i&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock), design an algorithm to find the maximum profit.&lt;/p&gt;&#xA;&lt;p&gt;Note that you cannot sell a stock before you buy one.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve the “To square(root) or not to square(root)” Challenge in Java</title>
      <link>https://andrewodendaal.com/how-to-solve-the-to-squareroot-or-not-to-squareroot-challenge-in-java/</link>
      <pubDate>Sat, 14 Nov 2020 00:43:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-the-to-squareroot-or-not-to-squareroot-challenge-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a method, that will get an integer array as parameter and will process every number from this array.&lt;br&gt;&#xA;Return a new array with processing every number of the input-array like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;If the number has an integer square root, take this, otherwise square the number.&#xA;&#xA;[4,3,9,7,2,1] -&amp;gt; [2,9,3,49,4,1]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The input array will always contain only positive numbers and will never be empty or null.&lt;/p&gt;&#xA;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertEquals;&#xA;import org.junit.runners.JUnit4;&#xA;import java.util.Arrays;&#xA;&#xA;public class SolutionTest {&#xA;    @Test&#xA;    public void basicTests() {&#xA;        int[] input = new int[] { 4, 3, 9, 7, 2, 1 };&#xA;        int[] expected = new int[] { 2, 9, 3, 49, 4, 1 };&#xA;        assertEquals(Arrays.toString(expected), Arrays.toString(Squarer.squareOrSquareRoot(input)));&#xA;&#xA;        input = new int[] { 100, 101, 5, 5, 1, 1 };&#xA;        expected = new int[] { 10, 10201, 25, 25, 1, 1 };&#xA;        assertEquals(Arrays.toString(expected), Arrays.toString(Squarer.squareOrSquareRoot(input)));&#xA;&#xA;        input = new int[] { 1, 2, 3, 4, 5, 6 };&#xA;        expected = new int[] { 1, 4, 9, 2, 25, 36 };&#xA;        assertEquals(Arrays.toString(expected), Arrays.toString(Squarer.squareOrSquareRoot(input)));        &#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (using a &lt;code&gt;loop&lt;/code&gt;):&lt;/p&gt;</description>
    </item>
    <item>
      <title>Solving the Rule of Divisibility by 13 in Java</title>
      <link>https://andrewodendaal.com/solving-the-rule-of-divisibility-by-13-in-java/</link>
      <pubDate>Fri, 13 Nov 2020 02:01:03 +0000</pubDate>
      <guid>https://andrewodendaal.com/solving-the-rule-of-divisibility-by-13-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;wikipedia.com&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;When you divide the successive powers of &lt;code&gt;10&lt;/code&gt; by &lt;code&gt;13&lt;/code&gt; you get the following remainders of the integer divisions:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;1, 10, 9, 12, 3, 4&lt;/code&gt; because:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2020/11/image-6.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;(For &amp;ldquo;mod&amp;rdquo; you can see: &lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Modulo_operation&#34;&gt;https://en.wikipedia.org/wiki/Modulo_operation&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;)&lt;/p&gt;&#xA;&lt;p&gt;Then the whole pattern repeats. Hence the following method:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate Buddy Strings in Java</title>
      <link>https://andrewodendaal.com/how-to-calculate-buddy-strings-in-java/</link>
      <pubDate>Thu, 12 Nov 2020 00:39:23 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-buddy-strings-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given two strings &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt; of lowercase letters, return &lt;code&gt;true&lt;/code&gt;&lt;em&gt; if you can swap two letters in &lt;/em&gt;&lt;code&gt;A&lt;/code&gt;&lt;em&gt; so the result is equal to &lt;/em&gt;&lt;code&gt;B&lt;/code&gt;&lt;em&gt;, otherwise, return &lt;/em&gt;&lt;code&gt;false&lt;/code&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Swapping letters is defined as taking two indices &lt;code&gt;i&lt;/code&gt; and &lt;code&gt;j&lt;/code&gt; (0-indexed) such that &lt;code&gt;i != j&lt;/code&gt; and swapping the characters at &lt;code&gt;A[i]&lt;/code&gt; and &lt;code&gt;A[j]&lt;/code&gt;. For example, swapping at indices `` and &lt;code&gt;2&lt;/code&gt; in &lt;code&gt;&amp;quot;abcd&amp;quot;&lt;/code&gt; results in &lt;code&gt;&amp;quot;cbad&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Flip a Binary Matrix in Java</title>
      <link>https://andrewodendaal.com/how-to-flip-a-binary-matrix-in-java/</link>
      <pubDate>Wed, 11 Nov 2020 00:44:27 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-flip-a-binary-matrix-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a binary matrix &lt;code&gt;A&lt;/code&gt;, we want to flip the image horizontally, then invert it, and return the resulting image.&lt;/p&gt;&#xA;&lt;p&gt;To flip an image horizontally means that each row of the image is reversed.  For example, flipping &lt;code&gt;[1, 1, 0]&lt;/code&gt; horizontally results in &lt;code&gt;[0, 1, 1]&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;To invert an image means that each &lt;code&gt;&amp;amp;nbsp;is replaced by&amp;amp;nbsp;`1`, and each&amp;amp;nbsp;`1`&amp;amp;nbsp;is replaced by&amp;amp;nbsp;&lt;/code&gt;. For example, inverting &lt;code&gt;[0, 1, 1]&lt;/code&gt; results in &lt;code&gt;[1, 0, 0]&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Tilt a Binary Tree in Java</title>
      <link>https://andrewodendaal.com/how-to-tilt-a-binary-tree-in-java/</link>
      <pubDate>Tue, 10 Nov 2020 00:59:43 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-tilt-a-binary-tree-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given the &lt;code&gt;root&lt;/code&gt; of a binary tree, return &lt;em&gt;the sum of every tree node&amp;rsquo;s &lt;strong&gt;tilt&lt;/strong&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;The &lt;strong&gt;tilt&lt;/strong&gt; of a tree node is the &lt;strong&gt;absolute difference&lt;/strong&gt; between the sum of all left subtree node &lt;strong&gt;values&lt;/strong&gt; and all right subtree node &lt;strong&gt;values&lt;/strong&gt;. If a node does not have a left child, then the sum of the left subtree node &lt;strong&gt;values&lt;/strong&gt; is treated as ``. The rule is similar if there the node does not have a right child.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to solve the House Robber Challenge in Java</title>
      <link>https://andrewodendaal.com/how-to-solve-the-house-robber-challenge-in-java/</link>
      <pubDate>Mon, 09 Nov 2020 00:47:14 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-the-house-robber-challenge-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and &lt;strong&gt;it will automatically contact the police if two adjacent houses were broken into on the same night&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Given a list of non-negative integers representing the amount of money of each house, determine the maximum amount of money you can rob tonight &lt;strong&gt;without alerting the police&lt;/strong&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve the Bag of Tokens Challenge in Java</title>
      <link>https://andrewodendaal.com/how-to-solve-the-bag-of-tokens-challenge-in-java/</link>
      <pubDate>Sun, 08 Nov 2020 02:37:30 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-the-bag-of-tokens-challenge-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You have an initial &lt;strong&gt;power&lt;/strong&gt; of &lt;code&gt;P&lt;/code&gt;, an initial &lt;strong&gt;score&lt;/strong&gt; of ``, and a bag of &lt;code&gt;tokens&lt;/code&gt; where &lt;code&gt;tokens[i]&lt;/code&gt; is the value of the &lt;code&gt;i&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt;&lt;/code&gt; token (0-indexed).&lt;/p&gt;&#xA;&lt;p&gt;Your goal is to maximize your total &lt;strong&gt;score&lt;/strong&gt; by potentially playing each token in one of two ways:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If your current &lt;strong&gt;power&lt;/strong&gt; is at least &lt;code&gt;tokens[i]&lt;/code&gt;, you may play the &lt;code&gt;i&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt;&lt;/code&gt; token face up, losing &lt;code&gt;tokens[i]&lt;/code&gt; &lt;strong&gt;power&lt;/strong&gt; and gaining &lt;code&gt;1&lt;/code&gt; &lt;strong&gt;score&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;If your current &lt;strong&gt;score&lt;/strong&gt; is at least &lt;code&gt;1&lt;/code&gt;, you may play the &lt;code&gt;i&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt;&lt;/code&gt; token face down, gaining &lt;code&gt;tokens[i]&lt;/code&gt; &lt;strong&gt;power&lt;/strong&gt; and losing &lt;code&gt;1&lt;/code&gt; &lt;strong&gt;score&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Each token may be played &lt;strong&gt;at most&lt;/strong&gt; once and &lt;strong&gt;in any order&lt;/strong&gt;. You do &lt;strong&gt;not&lt;/strong&gt; have to play all the tokens.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Smallest Divisor Given a Threshold in Java</title>
      <link>https://andrewodendaal.com/how-to-find-the-smallest-divisor-given-a-threshold-in-java/</link>
      <pubDate>Sat, 07 Nov 2020 00:59:43 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-smallest-divisor-given-a-threshold-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of integers &lt;code&gt;nums&lt;/code&gt; and an integer &lt;code&gt;threshold&lt;/code&gt;, we will choose a positive integer divisor and divide all the array by it and sum the result of the division. Find the &lt;strong&gt;smallest&lt;/strong&gt; divisor such that the result mentioned above is less than or equal to &lt;code&gt;threshold&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Each result of division is rounded to the nearest integer greater than or equal to that element. (For example: 7/3 = 3 and 10/2 = 5).&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Sort and Star a String Array in Java</title>
      <link>https://andrewodendaal.com/how-to-sort-and-star-a-string-array-in-java/</link>
      <pubDate>Fri, 06 Nov 2020 00:48:18 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-sort-and-star-a-string-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You will be given a vector of strings. You must sort it alphabetically (case-sensitive, and based on the ASCII values of the chars) and then return the first value.&lt;/p&gt;&#xA;&lt;p&gt;The returned value must be a string, and have &lt;code&gt;&amp;quot;***&amp;quot;&lt;/code&gt; between each of its letters.&lt;/p&gt;&#xA;&lt;p&gt;You should not remove or add elements from/to the array.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;At first we could approach the problem by using the built-in &lt;code&gt;Arrays.sort()&lt;/code&gt; method and then looping through the first string, placing asterisks inbetween each letter:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Count Consecutive Characters in Java</title>
      <link>https://andrewodendaal.com/how-to-count-consecutive-characters-in-java/</link>
      <pubDate>Thu, 05 Nov 2020 09:20:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-count-consecutive-characters-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a string &lt;code&gt;s&lt;/code&gt;, the power of the string is the maximum length of a non-empty substring that contains only one unique character.&lt;/p&gt;&#xA;&lt;p&gt;Return &lt;em&gt;the power&lt;/em&gt; of the string.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 3:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 4:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 5:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Abbreviate a Two Word Name in Java</title>
      <link>https://andrewodendaal.com/how-to-abbreviate-a-two-word-name-in-java/</link>
      <pubDate>Wed, 04 Nov 2020 02:26:24 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-abbreviate-a-two-word-name-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function to convert a name into initials. This challenge strictly takes two words with one space in between them.&lt;/p&gt;&#xA;&lt;p&gt;The output should be two capital letters with a dot separating them.&lt;/p&gt;&#xA;&lt;p&gt;It should look like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Sam Harris&lt;/code&gt; =&amp;gt; &lt;code&gt;S.H&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Patrick Feeney&lt;/code&gt; =&amp;gt; &lt;code&gt;P.F&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;This is a really easy one, basically what we will do is the following:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Convert our &lt;code&gt;name&lt;/code&gt; &lt;code&gt;toUpperCase&lt;/code&gt; so that we can just pull out the characters we want.&lt;/li&gt;&#xA;&lt;li&gt;Convert the &lt;code&gt;name&lt;/code&gt; String into 2 separate values, stored in a &lt;code&gt;names&lt;/code&gt; array.&lt;/li&gt;&#xA;&lt;li&gt;Return the first character of each, using &lt;code&gt;charAt(0)&lt;/code&gt; with a dot inbetween.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class AbbreviateTwoWords {&#xA;&#xA;  public static String abbrevName(String name) {&#xA;    name = name.toUpperCase();&#xA;    &#xA;    String[] names = name.split(&amp;#34; &amp;#34;);&#xA;    &#xA;    return names[0].charAt(0)+&amp;#34;.&amp;#34;+names[1].charAt(0);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solutionn&#34;&gt;Test cases to validate our solutionn&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertEquals;&#xA;import org.junit.runners.JUnit4;&#xA;&#xA;public class SolutionTest {&#xA; &#xA;    @Test&#xA;    public void testFixed() {&#xA;        assertEquals(&amp;#34;S.H&amp;#34;, AbbreviateTwoWords.abbrevName(&amp;#34;Sam Harris&amp;#34;));&#xA;        assertEquals(&amp;#34;P.F&amp;#34;, AbbreviateTwoWords.abbrevName(&amp;#34;Patrick Feenan&amp;#34;));&#xA;        assertEquals(&amp;#34;E.C&amp;#34;, AbbreviateTwoWords.abbrevName(&amp;#34;Evan Cole&amp;#34;));&#xA;        assertEquals(&amp;#34;P.F&amp;#34;, AbbreviateTwoWords.abbrevName(&amp;#34;P Favuzzi&amp;#34;));&#xA;        assertEquals(&amp;#34;D.M&amp;#34;, AbbreviateTwoWords.abbrevName(&amp;#34;David Mendieta&amp;#34;));&#xA;        assertEquals(&amp;#34;Z.K&amp;#34;, AbbreviateTwoWords.abbrevName(&amp;#34;Zenon Kapusta&amp;#34;));&#xA;        &#xA;        assertEquals(&amp;#34;G.C&amp;#34;, AbbreviateTwoWords.abbrevName(&amp;#34;george clooney&amp;#34;));&#xA;        assertEquals(&amp;#34;M.M&amp;#34;, AbbreviateTwoWords.abbrevName(&amp;#34;marky mark&amp;#34;));&#xA;        assertEquals(&amp;#34;E.D&amp;#34;, AbbreviateTwoWords.abbrevName(&amp;#34;eliza doolittle&amp;#34;));&#xA;        assertEquals(&amp;#34;R.W&amp;#34;, AbbreviateTwoWords.abbrevName(&amp;#34;reese witherspoon&amp;#34;));&#xA;    }&#xA;    &#xA;    @Test&#xA;    public void testRandom() {&#xA;      for(int i = 0; i &amp;lt; 200; i++){&#xA;        String testString = makeString();&#xA;        assertEquals(randomTest(testString), AbbreviateTwoWords.abbrevName(testString));&#xA;      }&#xA;    }&#xA;    &#xA;    private String makeString() {&#xA;        return makeWord(1, 20) + &amp;#34; &amp;#34; + makeWord(1, 20);&#xA;      }&#xA;    &#xA;    private String makeWord(int min, int max) {&#xA;      String word = &amp;#34;&amp;#34;;&#xA;      String[] possible = &amp;#34;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&amp;#34;.split(&amp;#34;&amp;#34;);&#xA;      int length = (int) (Math.random() * max) + min;&#xA;    &#xA;      for(int i=0; i &amp;lt; length; i++) {&#xA;          int index = (int) (Math.random() * possible.length);&#xA;          word += possible[index];&#xA;      }&#xA;    &#xA;      return word;&#xA;    }&#xA;    &#xA;    private String randomTest(String name){&#xA;      String[] nameSplit = name.toUpperCase().split(&amp;#34; &amp;#34;);&#xA;      return nameSplit[0].substring(0, 1) + &amp;#39;.&amp;#39; + nameSplit[1].substring(0, 1);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Sort a Linked List using Insertion Sort in Java</title>
      <link>https://andrewodendaal.com/how-to-sort-a-linked-list-using-insertion-sort-in-java/</link>
      <pubDate>Tue, 03 Nov 2020 01:21:06 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-sort-a-linked-list-using-insertion-sort-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Sort a linked list using insertion sort.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2020/11/Insertion-sort-example-300px.gif&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;A graphical example of insertion sort. The partially sorted list (black) initially contains only the first element in the list.&lt;!-- raw HTML omitted --&gt;With each iteration, one element (red) is removed from the input data and inserted in-place into the sorted list&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Algorithm of Insertion Sort:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list.&lt;/li&gt;&#xA;&lt;li&gt;At each iteration, insertion sort removes one element from the input data, finds the location it belongs within the sorted list, and inserts it there.&lt;/li&gt;&#xA;&lt;li&gt;It repeats until no input elements remain.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Remove First and Last Character in a String in Java</title>
      <link>https://andrewodendaal.com/how-to-remove-first-and-last-character-in-a-string-in-java/</link>
      <pubDate>Mon, 02 Nov 2020 02:21:09 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-remove-first-and-last-character-in-a-string-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The goal is to create a function that removes the first and last characters of a string. You don&amp;rsquo;t have to worry with strings with less than two characters.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class RemoveChars {&#xA;    public static String remove(String str) {&#xA;        return str.substring(1, str.length()-1);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-java-solution&#34;&gt;Test cases to validate our Java solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;&#xA;import static org.junit.Assert.assertEquals;&#xA;&#xA;public class RemoveCharsTest {&#xA;&#xA;    @Test&#xA;    public void testRemoval() {&#xA;        assertEquals(&amp;#34;loquen&amp;#34;, RemoveChars.remove(&amp;#34;eloquent&amp;#34;));&#xA;        assertEquals(&amp;#34;ountr&amp;#34;, RemoveChars.remove(&amp;#34;country&amp;#34;));&#xA;        assertEquals(&amp;#34;erso&amp;#34;, RemoveChars.remove(&amp;#34;person&amp;#34;));&#xA;        assertEquals(&amp;#34;lac&amp;#34;, RemoveChars.remove(&amp;#34;place&amp;#34;));&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Distribute Halloween Candies by Rating Value in Java</title>
      <link>https://andrewodendaal.com/how-to-distribute-halloween-candies-by-rating-value-in-java/</link>
      <pubDate>Sun, 01 Nov 2020 02:38:29 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-distribute-halloween-candies-by-rating-value-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;There are &lt;em&gt;N&lt;/em&gt; children standing in a line. Each child is assigned a rating value.&lt;/p&gt;&#xA;&lt;p&gt;You are giving candies to these children subjected to the following requirements:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Each child must have at least one candy.&lt;/li&gt;&#xA;&lt;li&gt;Children with a higher rating get more candies than their neighbors.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;What is the minimum candies you must give?&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Distribute Halloween Candies in Java</title>
      <link>https://andrewodendaal.com/how-to-distribute-halloween-candies-in-java/</link>
      <pubDate>Sat, 31 Oct 2020 00:11:01 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-distribute-halloween-candies-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You have &lt;code&gt;n&lt;/code&gt; &lt;code&gt;candies&lt;/code&gt;, the &lt;code&gt;i&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt;&lt;/code&gt; candy is of type &lt;code&gt;candies[i]&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You want to distribute the candies equally between a sister and a brother so that each of them gets &lt;code&gt;n / 2&lt;/code&gt; candies (&lt;code&gt;n&lt;/code&gt; is even). The sister loves to collect different types of candies, so you want to give her the &lt;strong&gt;maximum number of different types&lt;/strong&gt; of candies.&lt;/p&gt;&#xA;&lt;p&gt;Return &lt;em&gt;the maximum number of different types&lt;/em&gt; of candies you can give to the sister.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve the Maximize Distance to Closest Person Challenge in Java</title>
      <link>https://andrewodendaal.com/how-to-solve-the-maximize-distance-to-closest-person-challenge-in-java/</link>
      <pubDate>Fri, 30 Oct 2020 00:25:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-the-maximize-distance-to-closest-person-challenge-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given an array representing a row of &lt;code&gt;seats&lt;/code&gt; where &lt;code&gt;seats[i] = 1&lt;/code&gt; represents a person sitting in the &lt;code&gt;i&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt;&lt;/code&gt; seat, and &lt;code&gt;seats[i] = 0&lt;/code&gt; represents that the &lt;code&gt;i&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt;&lt;/code&gt; seat is empty &lt;strong&gt;(0-indexed)&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;There is at least one empty seat, and at least one person sitting.&lt;/p&gt;&#xA;&lt;p&gt;Alex wants to sit in the seat such that the distance between him and the closest person to him is maximized. &lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Get Character from ASCII Value in Java</title>
      <link>https://andrewodendaal.com/how-to-get-character-from-ascii-value-in-java/</link>
      <pubDate>Thu, 29 Oct 2020 01:01:29 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-character-from-ascii-value-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function which takes a number and returns the corresponding ASCII char for that value.&lt;/p&gt;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Ascii.getChar(65) // =&amp;gt; &amp;#39;A&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For ASCII table, you can refer to &lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://www.asciitable.com/&#34;&gt;http://www.asciitable.com/&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Ascii {&#xA;  public static char getChar(int c) {&#xA;    return (char) c;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases-to-validate-our-solution&#34;&gt;Test cases to validate our solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertEquals;&#xA;import org.junit.runners.JUnit4;&#xA;&#xA;public class SolutionTest {&#xA;    @Test&#xA;    public void testChar() {&#xA;        assertEquals(&amp;#39;7&amp;#39;, Ascii.getChar(55));&#xA;        assertEquals(&amp;#39;8&amp;#39;, Ascii.getChar(56));&#xA;        assertEquals(&amp;#39;9&amp;#39;, Ascii.getChar(57));&#xA;        assertEquals(&amp;#39;:&amp;#39;, Ascii.getChar(58));&#xA;        assertEquals(&amp;#39;;&amp;#39;, Ascii.getChar(59));&#xA;        assertEquals(&amp;#39;&amp;lt;&amp;#39;, Ascii.getChar(60));&#xA;        assertEquals(&amp;#39;=&amp;#39;, Ascii.getChar(61));&#xA;        assertEquals(&amp;#39;&amp;gt;&amp;#39;, Ascii.getChar(62));&#xA;        assertEquals(&amp;#39;?&amp;#39;, Ascii.getChar(63));&#xA;        assertEquals(&amp;#39;@&amp;#39;, Ascii.getChar(64));&#xA;        assertEquals(&amp;#39;A&amp;#39;, Ascii.getChar(65));&#xA;        assertEquals(&amp;#34;getChar should return a `char`&amp;#34;, 0, Character.compare(&amp;#39;!&amp;#39;, Ascii.getChar(33)));&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Finding a Needle in a Haystack in Java</title>
      <link>https://andrewodendaal.com/finding-a-needle-in-a-haystack-in-java/</link>
      <pubDate>Wed, 28 Oct 2020 01:50:17 +0000</pubDate>
      <guid>https://andrewodendaal.com/finding-a-needle-in-a-haystack-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Can you find the needle in the haystack?&lt;/p&gt;&#xA;&lt;p&gt;Write a function &lt;code&gt;findNeedle()&lt;/code&gt; that takes an &lt;code&gt;array&lt;/code&gt; full of junk but containing one &lt;code&gt;&amp;quot;needle&amp;quot;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;After your function finds the needle it should return a message (as a string) that says:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;&amp;quot;found the needle at position &amp;quot;&lt;/code&gt; plus the &lt;code&gt;index&lt;/code&gt; it found the needle, so:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;findNeedle(new Object[] {&amp;#34;hay&amp;#34;, &amp;#34;junk&amp;#34;, &amp;#34;hay&amp;#34;, &amp;#34;hay&amp;#34;, &amp;#34;moreJunk&amp;#34;, &amp;#34;needle&amp;#34;, &amp;#34;randomJunk&amp;#34;})&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;should return &lt;code&gt;&amp;quot;found the needle at position 5&amp;quot;&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve the Champagne Tower in Java</title>
      <link>https://andrewodendaal.com/how-to-solve-the-champagne-tower-in-java/</link>
      <pubDate>Tue, 27 Oct 2020 00:45:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-the-champagne-tower-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;We stack glasses in a pyramid, where the &lt;strong&gt;first&lt;/strong&gt; row has &lt;code&gt;1&lt;/code&gt; glass, the &lt;strong&gt;second&lt;/strong&gt; row has &lt;code&gt;2&lt;/code&gt; glasses, and so on until the 100&lt;!-- raw HTML omitted --&gt;th&lt;!-- raw HTML omitted --&gt; row.  Each glass holds one cup (&lt;code&gt;250&lt;/code&gt;ml) of champagne.&lt;/p&gt;&#xA;&lt;p&gt;Then, some champagne is poured in the first glass at the top.  When the topmost glass is full, any excess liquid poured will fall equally to the glass immediately to the left and right of it.  When those glasses become full, any excess champagne will fall equally to the left and right of those glasses, and so on.  (A glass at the bottom row has its excess champagne fall on the floor.)&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve the 132 Pattern in Java</title>
      <link>https://andrewodendaal.com/how-to-solve-the-132-pattern-in-java/</link>
      <pubDate>Mon, 26 Oct 2020 01:14:44 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-the-132-pattern-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of &lt;code&gt;n&lt;/code&gt; integers &lt;code&gt;nums&lt;/code&gt;, a &lt;strong&gt;132 pattern&lt;/strong&gt; is a subsequence of three integers &lt;code&gt;nums[i]&lt;/code&gt;, &lt;code&gt;nums[j]&lt;/code&gt; and &lt;code&gt;nums[k]&lt;/code&gt; such that &lt;code&gt;i &amp;lt; j &amp;lt; k&lt;/code&gt; and &lt;code&gt;nums[i] &amp;lt; nums[k] &amp;lt; nums[j]&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Return &lt;em&gt;&lt;code&gt;true&lt;/code&gt; if there is a &lt;strong&gt;132 pattern&lt;/strong&gt; in &lt;code&gt;nums&lt;/code&gt;, otherwise, return &lt;code&gt;false&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;**Follow up: **The &lt;code&gt;O(n^2)&lt;/code&gt; is trivial, could you come up with the &lt;code&gt;O(n logn)&lt;/code&gt; or the &lt;code&gt;O(n)&lt;/code&gt; solution?&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Replace all Vowels in a String in Java</title>
      <link>https://andrewodendaal.com/how-to-replace-all-vowels-in-a-string-in-java/</link>
      <pubDate>Sun, 25 Oct 2020 00:23:30 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-replace-all-vowels-in-a-string-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Replace all vowel to exclamation mark in the sentence. &lt;code&gt;aeiouAEIOU&lt;/code&gt; is vowel.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;replace(&amp;#34;Hi!&amp;#34;) === &amp;#34;H!!&amp;#34;&#xA;replace(&amp;#34;!Hi! Hi!&amp;#34;) === &amp;#34;!H!! H!!&amp;#34;&#xA;replace(&amp;#34;aeiou&amp;#34;) === &amp;#34;!!!!!&amp;#34;&#xA;replace(&amp;#34;ABCDE&amp;#34;) === &amp;#34;!BCD!&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;We could use a &lt;code&gt;StringBuilder&lt;/code&gt; and a &lt;code&gt;switch&lt;/code&gt; &lt;code&gt;case&lt;/code&gt; as a first attempt:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution {&#xA;    public static String replace(final String s) {&#xA;      StringBuilder sb = new StringBuilder();&#xA;      for (int i=0; i&amp;lt;s.length(); i++) {&#xA;        switch(Character.toLowerCase(s.charAt(i))) {&#xA;            case &amp;#39;a&amp;#39;:&#xA;            case &amp;#39;e&amp;#39;:&#xA;            case &amp;#39;i&amp;#39;:&#xA;            case &amp;#39;o&amp;#39;:&#xA;            case &amp;#39;u&amp;#39;:&#xA;              sb.append(&amp;#34;!&amp;#34;);&#xA;              break;&#xA;            default:&#xA;              sb.append(s.charAt(i));&#xA;              break;&#xA;        }&#xA;      }&#xA;      return sb.toString();&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;A more efficient method using &lt;code&gt;replaceAll&lt;/code&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Get the N-th Power in Java</title>
      <link>https://andrewodendaal.com/how-to-get-the-n-th-power-in-java/</link>
      <pubDate>Sat, 24 Oct 2020 03:40:09 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-n-th-power-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given an array with positive numbers and a number N. You should find the N-th power of the element in the array with the index N. If N is outside of the array, then return -1. Don&amp;rsquo;t forget that the first element has the index 0.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s look at a few examples:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;array = [1, 2, 3, 4] and N = 2, then the result is 3^2 == 9;&lt;/li&gt;&#xA;&lt;li&gt;array = [1, 2, 3] and N = 3, but N is outside of the array, so the result is -1.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution {&#xA;  public static int nthPower(int[] array, int n) {&#xA;    return n &amp;gt;= array.length ? -1 : (int) Math.pow(array[n], n);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;An alternative mapping:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Count the Minimum Depth of a Binary Tree in Java</title>
      <link>https://andrewodendaal.com/how-to-count-the-minimum-depth-of-a-binary-tree-in-java/</link>
      <pubDate>Fri, 23 Oct 2020 01:51:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-count-the-minimum-depth-of-a-binary-tree-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a binary tree, find its minimum depth.&lt;/p&gt;&#xA;&lt;p&gt;The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; A leaf is a node with no children.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2020/10/image-7.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Constraints:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The number of nodes in the tree is in the range &lt;code&gt;[0, 10&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;-1000 &amp;lt;= Node.val &amp;lt;= 1000&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-definition-for-a-binary-tree-node&#34;&gt;The definition for a binary tree node&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt; public class TreeNode {&#xA;     int val;&#xA;     TreeNode left;&#xA;     TreeNode right;&#xA;     TreeNode() {}&#xA;     TreeNode(int val) { this.val = val; }&#xA;     TreeNode(int val, TreeNode left, TreeNode right) {&#xA;         this.val = val;&#xA;         this.left = left;&#xA;         this.right = right;&#xA;     }&#xA; }&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;First we need to make sure that we catch our 2 edge cases:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve the House Robber II Challenge in Java</title>
      <link>https://andrewodendaal.com/how-to-solve-the-house-robber-ii-challenge-in-java/</link>
      <pubDate>Thu, 22 Oct 2020 01:35:42 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-the-house-robber-ii-challenge-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are &lt;strong&gt;arranged in a circle.&lt;/strong&gt; That means the first house is the neighbor of the last one. Meanwhile, adjacent houses have a security system connected, and &lt;strong&gt;it will automatically contact the police if two adjacent houses were broken into on the same night&lt;/strong&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Clone a Graph in Java</title>
      <link>https://andrewodendaal.com/how-to-clone-a-graph-in-java/</link>
      <pubDate>Wed, 21 Oct 2020 00:01:25 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-clone-a-graph-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a reference of a node in a &lt;strong&gt;&lt;!-- raw HTML omitted --&gt;connected&lt;!-- raw HTML omitted --&gt;&lt;/strong&gt; undirected graph.&lt;/p&gt;&#xA;&lt;p&gt;Return a &lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;deep copy&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt; (clone) of the graph. Effectively a &lt;strong&gt;graph copy&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Each node in the graph contains a val (&lt;code&gt;int&lt;/code&gt;) and a list (&lt;code&gt;List[Node]&lt;/code&gt;) of its neighbors.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Node {&#xA;    public int val;&#xA;    public List&amp;lt;Node&amp;gt; neighbors;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Test case format:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Return Random Values in Java</title>
      <link>https://andrewodendaal.com/how-to-return-random-values-in-java/</link>
      <pubDate>Tue, 20 Oct 2020 00:54:36 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-return-random-values-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Ghost objects are instantiated without any arguments.&lt;/p&gt;&#xA;&lt;p&gt;Ghost objects are given a random color attribute of white&amp;quot; or &amp;ldquo;yellow&amp;rdquo; or &amp;ldquo;purple&amp;rdquo; or &amp;ldquo;red&amp;rdquo; when instantiated&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Ghost ghost = new Ghost();&#xA;ghost.getColor(); //=&amp;gt; &amp;#34;white&amp;#34; or &amp;#34;yellow&amp;#34; or &amp;#34;purple&amp;#34; or &amp;#34;red&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;All this challenge is really asking us to do is to create a class method that can return random colour strings when called.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;We make use of the &lt;code&gt;java.util.Random&lt;/code&gt; class to generate a couple of random values for us to use within a &lt;code&gt;switch&lt;/code&gt; statement.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Compare Version Numbers in Java</title>
      <link>https://andrewodendaal.com/how-to-compare-version-numbers-in-java/</link>
      <pubDate>Mon, 19 Oct 2020 00:50:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-compare-version-numbers-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Compare two version numbers &lt;em&gt;version1&lt;/em&gt; and &lt;em&gt;version2&lt;/em&gt;.&lt;br&gt;&#xA;If &lt;code&gt;&amp;lt;em&amp;gt;version1&amp;lt;/em&amp;gt;&amp;amp;nbsp;&amp;gt;&amp;amp;nbsp;&amp;lt;em&amp;gt;version2&amp;lt;/em&amp;gt;&lt;/code&gt; return &lt;code&gt;1;&lt;/code&gt; if &lt;code&gt;&amp;lt;em&amp;gt;version1&amp;lt;/em&amp;gt;&amp;amp;nbsp;&amp;lt;&amp;amp;nbsp;&amp;lt;em&amp;gt;version2&amp;lt;/em&amp;gt;&lt;/code&gt; return &lt;code&gt;-1;&lt;/code&gt;otherwise return ``.&lt;/p&gt;&#xA;&lt;p&gt;You may assume that the version strings are non-empty and contain only digits and the &lt;code&gt;.&lt;/code&gt; character.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;code&gt;.&lt;/code&gt; character does not represent a decimal point and is used to separate number sequences.&lt;/p&gt;&#xA;&lt;p&gt;For instance, &lt;code&gt;2.5&lt;/code&gt; is not &amp;ldquo;two and a half&amp;rdquo; or &amp;ldquo;half way to version three&amp;rdquo;, it is the fifth second-level revision of the second first-level revision.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Return the First N Elements in Java</title>
      <link>https://andrewodendaal.com/how-to-return-the-first-n-elements-in-java/</link>
      <pubDate>Sun, 18 Oct 2020 02:54:22 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-return-the-first-n-elements-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a method &lt;strong&gt;take&lt;/strong&gt; that accepts a list/array and a number &lt;strong&gt;n&lt;/strong&gt;, and returns a list/array array of the first &lt;strong&gt;n&lt;/strong&gt; elements from the list/array.&lt;/p&gt;&#xA;&lt;p&gt;If you need help, here&amp;rsquo;s a reference:&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;https://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#copyOfRange(int%5B%5D,%20int,%20int)&#34;&gt;https://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#copyOfRange(int[],%20int,%20int)&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertArrayEquals;&#xA;import org.junit.runners.JUnit4;&#xA;import java.util.*;&#xA;&#xA;public class SolutionTest {&#xA;    @Test&#xA;    public void basicTests() {&#xA;        assertArrayEquals(&amp;#34;should return the first 3 items&amp;#34;, new int[]{0, 1, 2}, ZywOo.take(new int[]{0, 1, 2, 3, 5, 8, 13}, 3));&#xA;        assertArrayEquals(&amp;#34;should return 0 items&amp;#34;, new int[0], ZywOo.take(new int[]{0, 1, 2, 3, 5, 8, 13}, 0));&#xA;        assertArrayEquals(&amp;#34;empty array should return empty array&amp;#34;, new int[0], ZywOo.take(new int[0], 3));&#xA;    }&#xA;    &#xA;    @Test&#xA;    public void randomTests() {&#xA;      for (int i = 0; i &amp;lt; 100; i++) {&#xA;        int n = (int)Math.floor(100 * Math.random());&#xA;        int[] randomArray = generateRandomArray();&#xA;        &#xA;        assertArrayEquals(&amp;#34;Testing with array &amp;#34; + Arrays.toString(randomArray) + &amp;#34; and n = &amp;#34; + n, solution(randomArray, n), ZywOo.take(randomArray, n));&#xA;      }&#xA;     &#xA;    }&#xA;    &#xA;    private int[] solution(int[] arr, int n) {&#xA;      return arr.length &amp;gt; 0 &amp;amp;&amp;amp; arr.length &amp;gt; n ? Arrays.copyOfRange(arr, 0, n) : arr;&#xA;    }&#xA;    &#xA;    private int[] generateRandomArray() {&#xA;      int length = (int)Math.floor(100 * Math.random());&#xA;      int min = (int)Math.floor(-100 * Math.random());&#xA;      int max = (int)Math.floor( 100 * Math.random());&#xA;      return new Random().ints(length, min, max).toArray();&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Search a 2d Matrix/Array in Java</title>
      <link>https://andrewodendaal.com/how-to-search-a-2d-matrix-array-in-java/</link>
      <pubDate>Sat, 17 Oct 2020 00:47:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-search-a-2d-matrix-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write an efficient algorithm that searches for a value in an &lt;code&gt;m x n&lt;/code&gt; matrix. This matrix has the following properties:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Integers in each row are sorted from left to right.&lt;/li&gt;&#xA;&lt;li&gt;The first integer of each row is greater than the last integer of the previous row.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2020/10/image-2.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2020/10/image-3.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 3:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calculate the Surface Area and Volume of a Box with Java</title>
      <link>https://andrewodendaal.com/calculate-the-surface-area-and-volume-of-a-box-with-java/</link>
      <pubDate>Fri, 16 Oct 2020 01:51:29 +0000</pubDate>
      <guid>https://andrewodendaal.com/calculate-the-surface-area-and-volume-of-a-box-with-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that returns the total surface area and volume of a box as an array: &lt;code&gt;[area, volume]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;We know that the formula to calculate the area of a box is as follows:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;2(h × W) + 2(h × L) + 2(W × L)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;We also know that the formula to calculate the volume of a box is as follows:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;W x h x H&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find Numbers which are Divisible by given Number in Java</title>
      <link>https://andrewodendaal.com/find-numbers-which-are-divisible-by-given-number-in-java/</link>
      <pubDate>Thu, 15 Oct 2020 09:11:58 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-numbers-which-are-divisible-by-given-number-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the function which takes two arguments and returns all numbers which are divisible by the given divisor. First argument is an array of &lt;code&gt;numbers&lt;/code&gt; and the second is the &lt;code&gt;divisor&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;divisibleBy([1, 2, 3, 4, 5, 6], 2) == [2, 4, 6]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (using &lt;code&gt;streams&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.stream.*;&#xA;import java.util.Arrays;&#xA;&#xA;public class EvenNumbers {&#xA;  public static int[] divisibleBy(int[] numbers, int divider) {&#xA;  &#xA;    return Arrays.stream(numbers)&#xA;                 .filter(i -&amp;gt; (i % divider) == 0)&#xA;                 .toArray();&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2 (writing the code ourselves):&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Split a Subdirectory to a New Git Repository and Keep the History</title>
      <link>https://andrewodendaal.com/how-to-split-a-subdirectory-to-a-new-git-repository-and-keep-the-history/</link>
      <pubDate>Wed, 14 Oct 2020 09:34:46 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-split-a-subdirectory-to-a-new-git-repository-and-keep-the-history/</guid>
      <description>&lt;p&gt;There comes a time when you need to split out a subdirectory into it&amp;rsquo;s own git repo.&lt;/p&gt;&#xA;&lt;p&gt;This is a very simple task if you don&amp;rsquo;t care about persisting the git history for any changes that were made in that subdirectory.&lt;/p&gt;&#xA;&lt;p&gt;However, if you would like to keep all the history of the subdirectory only, and not of the overall entire repository itself, then you can perform the following bunch of steps:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Get the Maximum XOR of Two Numbers in an Array in Java</title>
      <link>https://andrewodendaal.com/get-the-maximum-xor-of-two-numbers-in-an-array-in-java/</link>
      <pubDate>Tue, 13 Oct 2020 02:12:48 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-the-maximum-xor-of-two-numbers-in-an-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a &lt;strong&gt;non-empty&lt;/strong&gt; array of numbers, a&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;, a&lt;!-- raw HTML omitted --&gt;1&lt;!-- raw HTML omitted --&gt;, a&lt;!-- raw HTML omitted --&gt;2&lt;!-- raw HTML omitted --&gt;, … , a&lt;!-- raw HTML omitted --&gt;n-1&lt;!-- raw HTML omitted --&gt;, where 0 ≤ a&lt;!-- raw HTML omitted --&gt;i&lt;!-- raw HTML omitted --&gt; &amp;lt; 2&lt;!-- raw HTML omitted --&gt;31&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Find the maximum result of a&lt;!-- raw HTML omitted --&gt;i&lt;!-- raw HTML omitted --&gt; XOR a&lt;!-- raw HTML omitted --&gt;j&lt;!-- raw HTML omitted --&gt;, where 0 ≤ &lt;em&gt;i&lt;/em&gt;, &lt;em&gt;j&lt;/em&gt; &amp;lt; &lt;em&gt;n&lt;/em&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Get the Opposite of a Number in Java</title>
      <link>https://andrewodendaal.com/how-to-get-the-opposite-of-a-number-in-java/</link>
      <pubDate>Mon, 12 Oct 2020 09:28:09 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-opposite-of-a-number-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a number, find its opposite.&lt;/p&gt;&#xA;&lt;p&gt;Examples:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;1: -1&#xA;14: -14&#xA;-34: 34&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;We return the number itself multiplied by a negative 1.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution {&#xA;    public static int opposite(int number) {&#xA;        return number *= -1;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This can be simplified further as:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution {&#xA;    public static int opposite(int number) {&#xA;        return -number;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;There is also a built in method to help with this if you prefer, called &lt;code&gt;Math.negateExact()&lt;/code&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Area or Perimeter of a 4-sided Polygon using Java</title>
      <link>https://andrewodendaal.com/how-to-find-the-area-or-perimeter-of-a-4-sided-polygon-using-java/</link>
      <pubDate>Sun, 11 Oct 2020 11:12:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-area-or-perimeter-of-a-4-sided-polygon-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given the &lt;code&gt;length&lt;/code&gt; and &lt;code&gt;width&lt;/code&gt; of a 4-sided polygon. The polygon can either be a rectangle or a square.&lt;br&gt;&#xA;If it is a square, return its area. If it is a rectangle, return its perimeter.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;area_or_perimeter(6, 10) --&amp;gt; 32&#xA;area_or_perimeter(4, 4) --&amp;gt; 16&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;Given that we know that:&lt;/p&gt;&#xA;&lt;p&gt;The area of a square is: &lt;code&gt;l x h&lt;/code&gt; and the area of a rectangle is &lt;code&gt;2(l+h)&lt;/code&gt;, we can create the following code, differentiating on the if conditional statement that &lt;code&gt;l==w&lt;/code&gt;, or, length is equal to width, which would mean a square, otherwise a rectangle:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Parse Int from Char in Java</title>
      <link>https://andrewodendaal.com/how-to-parse-int-from-char-in-java/</link>
      <pubDate>Sat, 10 Oct 2020 00:31:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-parse-int-from-char-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;We take in a &lt;code&gt;String&lt;/code&gt; where the first place contains a number, write a function that takes in this &lt;code&gt;String&lt;/code&gt; and returns an &lt;code&gt;int&lt;/code&gt; containing it.&lt;/p&gt;&#xA;&lt;p&gt;For correct answer program should return int from 0 to 9.&lt;/p&gt;&#xA;&lt;p&gt;Assume test input string always valid and may look like &amp;ldquo;1 year old&amp;rdquo; or &amp;ldquo;5 years old&amp;rdquo;, etc.. The first char is number only.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;We take in a &lt;code&gt;String&lt;/code&gt;, and get the first character, which is done by using &lt;code&gt;charAt(0)&lt;/code&gt;. As this is a &lt;code&gt;char&lt;/code&gt; type, we can append a &lt;code&gt;-&#39;0&#39;&lt;/code&gt; to it and cast it back to an int using &lt;code&gt;(ing)&lt;/code&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Search a Binary Tree in Java</title>
      <link>https://andrewodendaal.com/how-to-search-a-binary-tree-in-java/</link>
      <pubDate>Fri, 09 Oct 2020 10:06:07 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-search-a-binary-tree-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a &lt;strong&gt;sorted&lt;/strong&gt; (in ascending order) integer array &lt;code&gt;nums&lt;/code&gt; of &lt;code&gt;n&lt;/code&gt; elements and a &lt;code&gt;target&lt;/code&gt; value, write a function to search &lt;code&gt;target&lt;/code&gt; in &lt;code&gt;nums&lt;/code&gt;. If &lt;code&gt;target&lt;/code&gt; exists, then return its index, otherwise return &lt;code&gt;-1&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You may assume that all elements in &lt;code&gt;nums&lt;/code&gt; are unique.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;n&lt;/code&gt; will be in the range &lt;code&gt;[1, 10000]&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The value of each element in &lt;code&gt;nums&lt;/code&gt; will be in the range &lt;code&gt;[-9999, 9999]&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java-code&#34;&gt;The solution in Java code&lt;/h2&gt;&#xA;&lt;p&gt;We call the &lt;code&gt;search()&lt;/code&gt; method which recursively calls the &lt;code&gt;binarySearch()&lt;/code&gt; method for each level.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Rotate a Singly Linked List in Java</title>
      <link>https://andrewodendaal.com/how-to-rotate-a-singly-linked-list-in-java/</link>
      <pubDate>Thu, 08 Oct 2020 00:47:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-rotate-a-singly-linked-list-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a linked list, rotate the list to the right by &lt;em&gt;k&lt;/em&gt; places, where &lt;em&gt;k&lt;/em&gt; is non-negative.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;</description>
    </item>
    <item>
      <title>How to Insert into a Binary Search Tree using Java</title>
      <link>https://andrewodendaal.com/how-to-insert-into-a-binary-search-tree-using-java/</link>
      <pubDate>Wed, 07 Oct 2020 00:57:16 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-insert-into-a-binary-search-tree-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given the &lt;code&gt;root&lt;/code&gt; node of a binary search tree (BST) and a &lt;code&gt;value&lt;/code&gt; to insert into the tree. Return &lt;em&gt;the root node of the BST after the insertion&lt;/em&gt;. It is &lt;strong&gt;guaranteed&lt;/strong&gt; that the new value does not exist in the original BST.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Notice&lt;/strong&gt; that there may exist multiple valid ways for the insertion, as long as the tree remains a BST after insertion. You can return &lt;strong&gt;any of them&lt;/strong&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find the Complement of Base 10 Integer in Java</title>
      <link>https://andrewodendaal.com/find-the-complement-of-base-10-integer-in-java/</link>
      <pubDate>Tue, 06 Oct 2020 08:44:41 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-complement-of-base-10-integer-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Every non-negative integer &lt;code&gt;N&lt;/code&gt; has a binary representation.  For example, &lt;code&gt;5&lt;/code&gt; can be represented as &lt;code&gt;&amp;quot;101&amp;quot;&lt;/code&gt; in binary, &lt;code&gt;11&lt;/code&gt; as &lt;code&gt;&amp;quot;1011&amp;quot;&lt;/code&gt; in binary, and so on.  Note that except for &lt;code&gt;N = 0&lt;/code&gt;, there are no leading zeroes in any binary representation.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;em&gt;complement&lt;/em&gt; of a binary representation is the number in binary you get when changing every &lt;code&gt;1&lt;/code&gt; to a &lt;code&gt;&amp;amp;nbsp;and&amp;amp;nbsp;&lt;/code&gt; to a &lt;code&gt;1&lt;/code&gt;.  For example, the complement of &lt;code&gt;&amp;quot;101&amp;quot;&lt;/code&gt; in binary is &lt;code&gt;&amp;quot;010&amp;quot;&lt;/code&gt; in binary.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Solve the Number of Recent Calls Challenge in Java</title>
      <link>https://andrewodendaal.com/solve-the-number-of-recent-calls-challenge-in-java/</link>
      <pubDate>Mon, 05 Oct 2020 01:05:12 +0000</pubDate>
      <guid>https://andrewodendaal.com/solve-the-number-of-recent-calls-challenge-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You have a &lt;code&gt;RecentCounter&lt;/code&gt; class which counts the number of recent requests within a certain time frame.&lt;/p&gt;&#xA;&lt;p&gt;Implement the &lt;code&gt;RecentCounter&lt;/code&gt; class:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;RecentCounter()&lt;/code&gt; Initializes the counter with zero recent requests.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;int ping(int t)&lt;/code&gt; Adds a new request at time &lt;code&gt;t&lt;/code&gt;, where &lt;code&gt;t&lt;/code&gt; represents some time in milliseconds, and returns the number of requests that has happened in the past &lt;code&gt;3000&lt;/code&gt; milliseconds (including the new request). Specifically, return the number of requests that have happened in the inclusive range &lt;code&gt;[t - 3000, t]&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;It is &lt;strong&gt;guaranteed&lt;/strong&gt; that every call to &lt;code&gt;ping&lt;/code&gt; uses a strictly larger value of &lt;code&gt;t&lt;/code&gt; than the previous call.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate the Summation of a Number in Java</title>
      <link>https://andrewodendaal.com/how-to-calculate-the-summation-of-a-number-in-java/</link>
      <pubDate>Sun, 04 Oct 2020 02:53:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-the-summation-of-a-number-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a program that finds the summation of every number from 1 to num. The number will always be a positive integer greater than 0.&lt;/p&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;summation(2) -&amp;gt; 3&#xA;1 + 2&#xA;&#xA;summation(8) -&amp;gt; 36&#xA;1 + 2 + 3 + 4 + 5 + 6 + 7 + 8&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class Solution {&#xA;&#xA;    public static int summation(int n) {&#xA;        int runningTotal = 0;&#xA;      &#xA;        for (int i=1; i&amp;lt;=n; i++) runningTotal += i;&#xA;      &#xA;        return runningTotal;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;A simpler alternative is to do the following:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate all Unique Combinations of a Target using Backtracking in Java</title>
      <link>https://andrewodendaal.com/how-to-calculate-all-unique-combinations-of-a-target-using-backtracking-in-java/</link>
      <pubDate>Sat, 03 Oct 2020 02:39:08 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-all-unique-combinations-of-a-target-using-backtracking-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of &lt;strong&gt;distinct&lt;/strong&gt; integers &lt;code&gt;candidates&lt;/code&gt; and a target integer &lt;code&gt;target&lt;/code&gt;, return &lt;em&gt;a list of all &lt;strong&gt;unique combinations&lt;/strong&gt; of &lt;/em&gt;&lt;code&gt;candidates&lt;/code&gt;&lt;em&gt; where the chosen numbers sum to &lt;/em&gt;&lt;code&gt;target&lt;/code&gt;&lt;em&gt;.&lt;/em&gt; You may return the combinations in &lt;strong&gt;any order&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;strong&gt;same&lt;/strong&gt; number may be chosen from &lt;code&gt;candidates&lt;/code&gt; an &lt;strong&gt;unlimited number of times&lt;/strong&gt;. Two combinations are unique if the frequency of at least one of the chosen numbers is different.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Who is going to pay for the wall? in Python</title>
      <link>https://andrewodendaal.com/who-is-going-to-pay-for-the-wall-in-python/</link>
      <pubDate>Fri, 02 Oct 2020 01:54:33 +0000</pubDate>
      <guid>https://andrewodendaal.com/who-is-going-to-pay-for-the-wall-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Don Drumphet lives in a nice neighborhood, but one of his neighbors has started to let his house go. Don Drumphet wants to build a wall between his house and his neighbor’s, and is trying to get the neighborhood association to pay for it. He begins to solicit his neighbors to petition to get the association to build the wall. Unfortunately for Don Drumphet, he cannot read very well, has a very limited attention span, and can only remember two letters from each of his neighbors’ names. As he collects signatures, he insists that his neighbors keep truncating their names until two letters remain, and he can finally read them.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calculate the Total Amount of Points using Java</title>
      <link>https://andrewodendaal.com/calculate-the-total-amount-of-points-using-java/</link>
      <pubDate>Thu, 01 Oct 2020 00:47:40 +0000</pubDate>
      <guid>https://andrewodendaal.com/calculate-the-total-amount-of-points-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Our football team finished the championship. The result of each match look like &amp;ldquo;x:y&amp;rdquo;. Results of all matches are recorded in the collection.&lt;/p&gt;&#xA;&lt;p&gt;For example: &lt;code&gt;[&amp;quot;3:1&amp;quot;, &amp;quot;2:2&amp;quot;, &amp;quot;0:1&amp;quot;, ...]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Write a function that takes such collection and counts the points of our team in the championship. Rules for counting points for each match:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if x&amp;gt;y – 3 points&lt;/li&gt;&#xA;&lt;li&gt;if x&amp;lt;y – 0 point&lt;/li&gt;&#xA;&lt;li&gt;if x=y – 1 point&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Notes:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calculate the biggest of 3 numbers using Java</title>
      <link>https://andrewodendaal.com/calculate-the-biggest-of-3-numbers-using-java/</link>
      <pubDate>Wed, 30 Sep 2020 02:00:38 +0000</pubDate>
      <guid>https://andrewodendaal.com/calculate-the-biggest-of-3-numbers-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;h3 id=&#34;task&#34;&gt;Task&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Given&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;three integers&lt;/em&gt; &lt;code&gt;a&lt;/code&gt; ,&lt;code&gt;b&lt;/code&gt; ,&lt;code&gt;c&lt;/code&gt;, &lt;strong&gt;&lt;em&gt;return&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;the &lt;strong&gt;&lt;em&gt;largest number&lt;/em&gt;&lt;/strong&gt; obtained after inserting the following operators and brackets&lt;/em&gt;: &lt;code&gt;+&lt;/code&gt;, &lt;code&gt;*&lt;/code&gt;, &lt;code&gt;()&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;In other words , &lt;strong&gt;&lt;em&gt;try every combination of a,b,c with [*+()] , and return the Maximum Obtained&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;consider-an-example-&#34;&gt;Consider an Example :&lt;/h3&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;With the numbers are 1, 2 and 3&lt;/em&gt;&lt;/strong&gt; , &lt;em&gt;here are some ways of placing signs and brackets&lt;/em&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;1 * (2 + 3) = 5&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;1 * 2 * 3 = 6&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;1 + 2 * 3 = 7&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(1 + 2) * 3 = 9&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So &lt;strong&gt;&lt;em&gt;the maximum value&lt;/em&gt;&lt;/strong&gt; that you can obtain is &lt;strong&gt;&lt;em&gt;9&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find the missing element between two arrays in Python</title>
      <link>https://andrewodendaal.com/find-the-missing-element-between-two-arrays-in-python/</link>
      <pubDate>Tue, 29 Sep 2020 08:52:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-missing-element-between-two-arrays-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given two integer arrays where the second array is a shuffled duplicate of the first array with one element missing, find the missing element.&lt;/p&gt;&#xA;&lt;p&gt;Please note, there may be duplicates in the arrays, so checking if a numerical value exists in one and not the other is not a valid solution.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;find_missing([1, 2, 2, 3], [1, 2, 3]) =&amp;gt; 2&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;find_missing([6, 1, 3, 6, 8, 2], [3, 6, 6, 1, 2]) =&amp;gt; 8&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The first array will always have at least one element.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Count an Array of Boolean Values in Java</title>
      <link>https://andrewodendaal.com/how-to-count-an-array-of-boolean-values-in-java/</link>
      <pubDate>Mon, 28 Sep 2020 01:04:49 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-count-an-array-of-boolean-values-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Consider an array/list of sheep where some sheep may be missing from their place. We need a function that counts the number of sheep present in the array (true means present).&lt;/p&gt;&#xA;&lt;p&gt;For example,&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[true,  true,  true,  false,&#xA;  true,  true,  true,  true ,&#xA;  true,  false, true,  false,&#xA;  true,  false, false, true ,&#xA;  true,  true,  true,  true ,&#xA;  false, false, true,  true]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The correct answer would be 17.&lt;/p&gt;&#xA;&lt;p&gt;Hint: Don&amp;rsquo;t forget to check for bad values like &lt;code&gt;null&lt;/code&gt;/&lt;code&gt;undefined&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve the Car Pooling Challenge in Java</title>
      <link>https://andrewodendaal.com/how-to-solve-the-car-pooling-challenge-in-java/</link>
      <pubDate>Sun, 27 Sep 2020 01:18:07 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-the-car-pooling-challenge-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are driving a vehicle that has &lt;code&gt;capacity&lt;/code&gt; empty seats initially available for passengers.  The vehicle &lt;strong&gt;only&lt;/strong&gt; drives east (ie. it &lt;strong&gt;cannot&lt;/strong&gt; turn around and drive west.)&lt;/p&gt;&#xA;&lt;p&gt;Given a list of &lt;code&gt;trips&lt;/code&gt;, &lt;code&gt;trip[i] = [num_passengers, start_location, end_location]&lt;/code&gt; contains information about the &lt;code&gt;i&lt;/code&gt;-th trip: the number of passengers that must be picked up, and the locations to pick them up and drop them off.  The locations are given as the number of kilometers due east from your vehicle&amp;rsquo;s initial location.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Repeat a String in Java</title>
      <link>https://andrewodendaal.com/how-to-repeat-a-string-in-java/</link>
      <pubDate>Sat, 26 Sep 2020 03:03:07 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-repeat-a-string-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function called &lt;code&gt;repeat_str&lt;/code&gt; which repeats the given string &lt;code&gt;src&lt;/code&gt; exactly &lt;code&gt;count&lt;/code&gt; times.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;repeatStr(6, &amp;#34;I&amp;#34;) // &amp;#34;IIIIII&amp;#34;&#xA;repeatStr(5, &amp;#34;Hello&amp;#34;) // &amp;#34;HelloHelloHelloHelloHello&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;Java comes with a &lt;code&gt;built-in&lt;/code&gt; on the &lt;code&gt;String&lt;/code&gt; class. Called &lt;code&gt;repeat&lt;/code&gt;, which allows you to very easily repeat that string &lt;code&gt;n&lt;/code&gt; number of times.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;Hello&amp;#34;.repeat(2); // &amp;#34;HelloHello&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;using-stringrepeat&#34;&gt;Using String::repeat()&lt;/h3&gt;&#xA;&lt;p&gt;Therefore, we could solve our above problem as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;  static String repeatStr(int repeat, String string) {&#xA;    return string.repeat(repeat);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Obviously, we probably want to validate our input before we just do it, so maybe wrap it in a ternary:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Smallest Integer in the Array in Java</title>
      <link>https://andrewodendaal.com/how-to-find-the-smallest-integer-in-the-array-in-java/</link>
      <pubDate>Fri, 25 Sep 2020 01:58:50 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-smallest-integer-in-the-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of integers your solution should find the smallest integer.&lt;/p&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Given &lt;code&gt;[34, 15, 88, 2]&lt;/code&gt; your solution will return &lt;code&gt;2&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Given &lt;code&gt;[34, -345, -1, 100]&lt;/code&gt; your solution will return &lt;code&gt;-345&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;You can assume, for the purpose of this challenge, that the supplied array will not be empty.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (using &lt;code&gt;Arrays.sort&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.Arrays;&#xA;&#xA;public class SmallestIntegerFinder {&#xA;    public static int findSmallestInt(int[] args) {&#xA;&#xA;        Arrays.sort(args);&#xA;      &#xA;        return args[0];&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2 (using &lt;code&gt;streams&lt;/code&gt;):&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Count Odd Numbers Below N using Java</title>
      <link>https://andrewodendaal.com/how-to-count-odd-numbers-below-n-using-java/</link>
      <pubDate>Thu, 24 Sep 2020 08:51:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-count-odd-numbers-below-n-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a number &lt;strong&gt;n&lt;/strong&gt;, return the number of positive odd numbers below &lt;strong&gt;n&lt;/strong&gt;, EASY!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;oddCount(7) //=&amp;gt; 3, i.e [1, 3, 5]&#xA;oddCount(15) //=&amp;gt; 7, i.e [1, 3, 5, 7, 9, 11, 13]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Expect large Inputs!&lt;/p&gt;&#xA;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertEquals;&#xA;import org.junit.runners.JUnit4;&#xA;&#xA;public class SolutionTest {&#xA;    @Test&#xA;    public void fixedTests() {&#xA;        assertEquals(7, OddNumbers.oddCount(15));&#xA;        assertEquals(7511, OddNumbers.oddCount(15023));&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;At first we would approach this in a programming type of way:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get the Length of the Last Word in a String using Java</title>
      <link>https://andrewodendaal.com/how-to-get-the-length-of-the-last-word-in-a-string-using-java/</link>
      <pubDate>Wed, 23 Sep 2020 02:34:43 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-length-of-the-last-word-in-a-string-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a string &lt;em&gt;s&lt;/em&gt; consists of upper/lower-case alphabets and empty space characters &lt;code&gt;&#39; &#39;&lt;/code&gt;, return the length of last word (last word means the last appearing word if we loop from left to right) in the string.&lt;/p&gt;&#xA;&lt;p&gt;If the last word does not exist, return 0.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; A word is defined as a &lt;strong&gt;maximal substring&lt;/strong&gt; consisting of non-space characters only.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;    public int lengthOfLastWord(String s) {&#xA;        // catch edge case of blank input&#xA;        if (s.length()&amp;lt;=0) return 0;&#xA;        &#xA;        // split into words&#xA;        String[] words = s.split(&amp;#34;\\s+&amp;#34;);&#xA;        &#xA;        // if one or less words, then return the length of the trimmed string&#xA;        if (words.length&amp;lt;=1) return s.trim().length();&#xA;        &#xA;        // get the alst word&#xA;        String lastWord = words[words.length-1];&#xA;        &#xA;        // return the last word&amp;#39;s length&#xA;        return lastWord.length();&#xA;        &#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Convert a Number to Reversed Array of Digits in Java</title>
      <link>https://andrewodendaal.com/how-to-convert-a-number-to-reversed-array-of-digits-in-java/</link>
      <pubDate>Tue, 22 Sep 2020 02:16:11 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-a-number-to-reversed-array-of-digits-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a random non-negative number, you have to return the digits of this number within an array in reverse order.&lt;/p&gt;&#xA;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertArrayEquals;&#xA;&#xA;public class DigitizeExampleTests {&#xA;  @Test&#xA;  public void tests() {&#xA;    assertArrayEquals(new int[] {1, 3, 2, 5, 3}, ConvertAndReverse.digitize(35231));&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;solution-in-java&#34;&gt;Solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (using &lt;code&gt;Streams&lt;/code&gt; and &lt;code&gt;StringBuilder&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.util.*;&#xA;&#xA;public class ConvertAndReverse {&#xA;  public static int[] digitize(long n) {&#xA;    StringBuilder sb = new StringBuilder(Long.toString(n)).reverse();&#xA;    &#xA;    return Arrays.stream(sb.toString().split(&amp;#34;&amp;#34;))&#xA;                  .mapToInt(Integer::parseInt)&#xA;                  .toArray();&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2 (using &lt;code&gt;StringBuilder&lt;/code&gt; and &lt;code&gt;Streams&lt;/code&gt;):&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve Unique Paths III in Java</title>
      <link>https://andrewodendaal.com/how-to-solve-unique-paths-iii-in-java/</link>
      <pubDate>Mon, 21 Sep 2020 08:08:15 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-unique-paths-iii-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;On a 2-dimensional &lt;code&gt;grid&lt;/code&gt;, there are 4 types of squares:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;1&lt;/code&gt; represents the starting square.  There is exactly one starting square.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;2&lt;/code&gt; represents the ending square.  There is exactly one ending square.&lt;/li&gt;&#xA;&lt;li&gt;`` represents empty squares we can walk over.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;-1&lt;/code&gt; represents obstacles that we cannot walk over.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Return the number of 4-directional walks from the starting square to the ending square, that &lt;strong&gt;walk over every non-obstacle square exactly once&lt;/strong&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Find the Mean/Average of a List of Numbers in Java</title>
      <link>https://andrewodendaal.com/how-to-find-the-mean-average-of-a-list-of-numbers-in-java/</link>
      <pubDate>Sun, 20 Sep 2020 02:00:23 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-mean-average-of-a-list-of-numbers-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Find the mean (average) of a list of numbers in an array.&lt;/p&gt;&#xA;&lt;p&gt;To find the mean (average) of a set of numbers add all of the numbers together and divide by the number of values in the list.&lt;/p&gt;&#xA;&lt;p&gt;For an example list of &lt;code&gt;1, 3, 5, 7&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;1. Add all of the numbers&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;1+3+5+7 = 16&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;2. Divide by the number of values in the list. In this example there are 4 numbers in the list.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Calculate BMI in Java</title>
      <link>https://andrewodendaal.com/how-to-calculate-bmi-in-java/</link>
      <pubDate>Sat, 19 Sep 2020 02:00:26 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-calculate-bmi-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;BMI&lt;/code&gt; stands for Body Mass Index and is a value derived from the mass and height of a person. The BMI is defined as &lt;code&gt;the body mass divided by the square of the body height&lt;/code&gt;, and is universally expressed in units of kg/m², resulting from mass in kilograms and height in metres. &lt;!-- raw HTML omitted --&gt;Wikipedia&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Write function BMI that calculates body mass index (bmi = weight / height ^ 2).&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve the Robot Bounded In Circle Challenge in Java</title>
      <link>https://andrewodendaal.com/how-to-solve-the-robot-bounded-in-circle-challenge-in-java/</link>
      <pubDate>Fri, 18 Sep 2020 01:14:11 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-solve-the-robot-bounded-in-circle-challenge-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;On an infinite plane, a robot initially stands at &lt;code&gt;(0, 0)&lt;/code&gt; and faces north.  The robot can receive one of three instructions:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;&amp;quot;G&amp;quot;&lt;/code&gt;: go straight 1 unit;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;&amp;quot;L&amp;quot;&lt;/code&gt;: turn 90 degrees to the left;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;&amp;quot;R&amp;quot;&lt;/code&gt;: turn 90 degress to the right.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The robot performs the &lt;code&gt;instructions&lt;/code&gt; given in order, and repeats them forever.&lt;/p&gt;&#xA;&lt;p&gt;Return &lt;code&gt;true&lt;/code&gt; if and only if there exists a circle in the plane such that the robot never leaves the circle.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Convert a String to a Number in Java</title>
      <link>https://andrewodendaal.com/how-to-convert-a-string-to-a-number-in-java/</link>
      <pubDate>Thu, 17 Sep 2020 01:56:05 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-a-string-to-a-number-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;We need a function that can transform a string into a number. What ways of achieving this do you know?&lt;/p&gt;&#xA;&lt;p&gt;Note: Don&amp;rsquo;t worry, all inputs will be strings, and every string is a perfectly valid representation of an integral number.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;stringToNumber(&amp;#34;1234&amp;#34;) == 1234&#xA;stringToNumber(&amp;#34;605&amp;#34; ) == 605&#xA;stringToNumber(&amp;#34;1405&amp;#34;) == 1405&#xA;stringToNumber(&amp;#34;-7&amp;#34;  ) == -7&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertEquals;&#xA;&#xA;public class StringToNumberTest {   &#xA;    @Test&#xA;    public void test1(){&#xA;      assertEquals(&amp;#34;stringToNumber(1234)&amp;#34;, 1234 , StringToNumber.stringToNumber(&amp;#34;1234&amp;#34;));&#xA;    }&#xA;    @Test&#xA;    public void test2(){&#xA;      assertEquals(&amp;#34;stringToNumber(605)&amp;#34;, 605 , StringToNumber.stringToNumber(&amp;#34;605&amp;#34;));&#xA;    }&#xA;    @Test&#xA;    public void test3(){&#xA;      assertEquals(&amp;#34;stringToNumber(1405)&amp;#34;, 1405 , StringToNumber.stringToNumber(&amp;#34;1405&amp;#34;));&#xA;    }&#xA;    @Test&#xA;    public void test4(){&#xA;      assertEquals(&amp;#34;stringToNumber(-7)&amp;#34;, -7 , StringToNumber.stringToNumber(&amp;#34;-7&amp;#34;));&#xA;    }&#xA;    @Test&#xA;    public void test5(){&#xA;      for(int i = 0; i &amp;lt; 100; ++i) {&#xA;        int t = (int)Math.round(Math.random() * 500000);&#xA;        assertEquals(&amp;#34;stringToNumber(&amp;#34; + t + &amp;#34;)&amp;#34;, t , StringToNumber.stringToNumber(Integer.toString(t)));&#xA;      }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (using &lt;code&gt;parseInt&lt;/code&gt;):&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Convert an Integer to Binary using Java</title>
      <link>https://andrewodendaal.com/how-to-convert-an-integer-to-binary-using-java/</link>
      <pubDate>Wed, 16 Sep 2020 00:58:09 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-an-integer-to-binary-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a non-negative integer &lt;code&gt;n&lt;/code&gt;, write a function &lt;code&gt;toBinary&lt;/code&gt;/&lt;code&gt;ToBinary&lt;/code&gt; which returns that number in a binary format.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;to_binary(1)  /* should return 1 */&#xA;to_binary(5)  /* should return 101 */&#xA;to_binary(11) /* should return 1011 */&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertEquals;&#xA;import org.junit.runners.JUnit4;&#xA;&#xA;&#xA;public class ConvertTest {&#xA;    @Test&#xA;    public void testToBinary() {&#xA;  &#x9;&#x9;assertEquals(1, BinaryConvert.toBinary(1));&#xA;  &#x9;&#x9;assertEquals(10, BinaryConvert.toBinary(2));&#xA;  &#x9;&#x9;assertEquals(11, BinaryConvert.toBinary(3));&#xA;  &#x9;&#x9;assertEquals(101, BinaryConvert.toBinary(5));&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class BinaryConvert {&#xA;&#xA;  public static int toBinary(int n) {&#xA;    // Use the `toBinaryString` method of the Integer class&#xA;    // convert it back to an `int` using the `parseInt` method of the Integer class&#xA;    // return the result&#xA;    return Integer.parseInt(Integer.toBinaryString(n));&#xA;  }&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Alternative 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create a Logical Operator in Java</title>
      <link>https://andrewodendaal.com/how-to-create-a-logical-operator-in-java/</link>
      <pubDate>Tue, 15 Sep 2020 01:43:17 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-logical-operator-in-java/</guid>
      <description>&lt;p&gt;Exclusive &amp;ldquo;or&amp;rdquo; (&lt;code&gt;xor&lt;/code&gt;) Logical Operator&lt;/p&gt;&#xA;&lt;p&gt;In some scripting languages like PHP, there exists a logical operator (e.g. &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt;, &lt;code&gt;||&lt;/code&gt;, &lt;code&gt;and&lt;/code&gt;, &lt;code&gt;or&lt;/code&gt;, etc.) called the &amp;ldquo;Exclusive Or&amp;rdquo;. The exclusive or evaluates two booleans. It then returns true if &lt;strong&gt;exactly one of the two expressions are true&lt;/strong&gt;, false otherwise. For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// since both are false&#xA;false xor false == false&#xA;&#xA;// exactly one of the two expressions are true&#xA;true xor false == true&#xA;&#xA;// exactly one of the two expressions are true&#xA;false xor true == true&#xA;&#xA;// Both are true.  &amp;#34;xor&amp;#34; only returns true if EXACTLY one of the two expressions evaluate to true.&#xA;true xor true == false &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-create-a-logical-operator-in-java&#34;&gt;How to create a Logical Operator in Java&lt;/h2&gt;&#xA;&lt;p&gt;As Java does not ship out the box with this functionality, we can easily create it ourselves.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to merge sorted integer arrays (without duplicates) in Java</title>
      <link>https://andrewodendaal.com/how-to-merge-sorted-integer-arrays-without-duplicates-in-java/</link>
      <pubDate>Mon, 14 Sep 2020 01:08:12 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-merge-sorted-integer-arrays-without-duplicates-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that merges two sorted arrays into a single one. The arrays only contain integers. Also, the final outcome must be sorted and not have any duplicate.&lt;/p&gt;&#xA;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertArrayEquals;&#xA;&#xA;import java.util.ArrayList;&#xA;import java.util.List;&#xA;import java.util.Random;&#xA;import java.util.function.Function;&#xA;import java.util.stream.IntStream;&#xA;&#xA;public class SolutionTest {&#xA;&#xA;  @Test&#xA;  public void fixedTest() {&#xA;&#xA;    assertArrayEquals(new int[] { 1, 2, 3, 4, 5, 6 }, Merger.mergeArrays(new int[] { 1, 3, 5 }, new int[] { 2, 4, 6 }));&#xA;    assertArrayEquals(new int[] { 2, 4, 6, 8 }, Merger.mergeArrays(new int[] { 2, 4, 8 }, new int[] { 2, 4, 6 }));&#xA;    assertArrayEquals(new int[] { 1, 2, 3 }, Merger.mergeArrays(new int[] { 1, 2, 3 }, new int[] {}));&#xA;    assertArrayEquals(new int[0], Merger.mergeArrays(new int[0], new int[0]));&#xA;&#xA;    assertArrayEquals(IntStream.rangeClosed(1, 15).toArray(), Merger.mergeArrays(IntStream.rangeClosed(1, 10).toArray(), IntStream.rangeClosed(5, 15).toArray()));&#xA;    assertArrayEquals(new int[] { 1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15 }, Merger.mergeArrays(IntStream.rangeClosed(1, 5).toArray(), IntStream.rangeClosed(10, 15).toArray()));&#xA;    assertArrayEquals(IntStream.rangeClosed(-5, 20).toArray(), Merger.mergeArrays(IntStream.rangeClosed(-5, 10).toArray(), IntStream.rangeClosed(-2, 20).toArray()));&#xA;  }&#xA;&#xA;  private static final Random rnd = new Random();&#xA;&#xA;  @Test&#xA;  public void randomTest() {&#xA;&#xA;    for (int i = 0; i &amp;lt; 100; ++i) {&#xA;&#xA;      int[] source = IntStream.generate(() -&amp;gt; { return rnd.nextInt(200) - 100; }).limit(200).distinct().sorted().toArray();&#xA;      List&amp;lt;Integer&amp;gt; one = new ArrayList&amp;lt;&amp;gt;();&#xA;      List&amp;lt;Integer&amp;gt; two = new ArrayList&amp;lt;&amp;gt;();&#xA;&#xA;      for (int num : source) {&#xA;&#xA;        (rnd.nextBoolean() ? one : two).add(num);&#xA;&#xA;        if (rnd.nextInt(10) &amp;lt; 2)&#xA;          (rnd.nextBoolean() ? one : two).add(num);&#xA;&#xA;      }&#xA;&#xA;      Function&amp;lt;List&amp;lt;Integer&amp;gt;, int[]&amp;gt; asPrimitive = array -&amp;gt; array.stream().mapToInt(n -&amp;gt; n.intValue()).toArray();&#xA;      assertArrayEquals(source, Merger.mergeArrays(asPrimitive.apply(one), asPrimitive.apply(two)));&#xA;    }&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (using &lt;code&gt;streams&lt;/code&gt;):&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find the Force of Gravity Between Two Objects with Java</title>
      <link>https://andrewodendaal.com/find-the-force-of-gravity-between-two-objects-with-java/</link>
      <pubDate>Sun, 13 Sep 2020 01:23:27 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-force-of-gravity-between-two-objects-with-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Your job is to find the gravitational force between two spherical objects (obj1 , obj2).&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2020/09/24318d64aad1cbd0d8c2cced79b64699c9ed1a2c.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;two-arrays-are-give-&#34;&gt;Two arrays are give :&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;arr_val&lt;/code&gt; (value array), consists of 3 elements&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1st element : mass of obj 1&lt;/li&gt;&#xA;&lt;li&gt;2nd element : mass of obj 2&lt;/li&gt;&#xA;&lt;li&gt;3rd element : distance between their centers&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;arr_unit&lt;/code&gt; (unit array), consists of 3 elements&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1st element : unit for mass of obj 1&lt;/li&gt;&#xA;&lt;li&gt;2nd element : unit for mass of obj 2&lt;/li&gt;&#xA;&lt;li&gt;3rd element : unit for distance between their centers&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;mass-units-are-&#34;&gt;Mass units are :&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;kilogram (kg)&lt;/li&gt;&#xA;&lt;li&gt;gram (g)&lt;/li&gt;&#xA;&lt;li&gt;milligram (mg)&lt;/li&gt;&#xA;&lt;li&gt;microgram (μg)&lt;/li&gt;&#xA;&lt;li&gt;pound (lb)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;distance-units-are-&#34;&gt;Distance units are :&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;meter (m)&lt;/li&gt;&#xA;&lt;li&gt;centimeter (cm)&lt;/li&gt;&#xA;&lt;li&gt;millimeter (mm)&lt;/li&gt;&#xA;&lt;li&gt;micrometer (μm)&lt;/li&gt;&#xA;&lt;li&gt;feet (ft)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;note&#34;&gt;Additional notes&lt;/h3&gt;&#xA;&lt;p&gt;value of G = 6.67 x 10&lt;!-- raw HTML omitted --&gt;-11&lt;!-- raw HTML omitted --&gt;N.kg&lt;!-- raw HTML omitted --&gt;–2&lt;!-- raw HTML omitted --&gt;.m&lt;!-- raw HTML omitted --&gt;2&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to zoom text by mouse wheel in IntelliJ Idea</title>
      <link>https://andrewodendaal.com/how-to-zoom-text-by-mouse-wheel-in-intellij-idea/</link>
      <pubDate>Sat, 12 Sep 2020 02:35:35 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-zoom-text-by-mouse-wheel-in-intellij-idea/</guid>
      <description>&lt;p&gt;It&amp;rsquo;s a common requirement to be able to zoom in or out while working in the code editor in IntelliJ Idea.&lt;/p&gt;&#xA;&lt;p&gt;This is achieved on Windows with &lt;code&gt;CTRL&lt;/code&gt;+&lt;code&gt;Mouse Wheel&lt;/code&gt;, or on Mac with &lt;code&gt;CMD&lt;/code&gt;+&lt;code&gt;Mouse Wheel&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This feature is not enabled by default, but luckily it&amp;rsquo;s very simple to enable this.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-enable-mouse-wheel-zoom-in-intellij&#34;&gt;How to enable mouse wheel zoom in IntelliJ&lt;/h2&gt;&#xA;&lt;p&gt;Open the Settings, or Preferences window.&lt;/p&gt;&#xA;&lt;p&gt;On Windows you can press &lt;code&gt;CTRL&lt;/code&gt;+&lt;code&gt;ALT&lt;/code&gt;+&lt;code&gt;S&lt;/code&gt;, and on Mac you can press &lt;code&gt;CMD&lt;/code&gt;+&lt;code&gt;,&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Playing the Bulls and Cows Game in Java</title>
      <link>https://andrewodendaal.com/playing-the-bulls-and-cows-game-in-java/</link>
      <pubDate>Fri, 11 Sep 2020 02:36:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/playing-the-bulls-and-cows-game-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are playing the following &lt;!-- raw HTML omitted --&gt;Bulls and Cows&lt;!-- raw HTML omitted --&gt; game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a guess, you provide a hint that indicates how many digits in said guess match your secret number exactly in both digit and position (called &amp;ldquo;bulls&amp;rdquo;) and how many digits match the secret number but locate in the wrong position (called &amp;ldquo;cows&amp;rdquo;). Your friend will use successive guesses and hints to eventually derive the secret number.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calculate the Sum of Root To Leaf Binary Numbers in Java</title>
      <link>https://andrewodendaal.com/calculate-the-sum-of-root-to-leaf-binary-numbers-in-java/</link>
      <pubDate>Thu, 10 Sep 2020 01:36:58 +0000</pubDate>
      <guid>https://andrewodendaal.com/calculate-the-sum-of-root-to-leaf-binary-numbers-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a binary tree, each node has value `` or &lt;code&gt;1&lt;/code&gt;.  Each root-to-leaf path represents a binary number starting with the most significant bit.  For example, if the path is &lt;code&gt;0 -&amp;gt; 1 -&amp;gt; 1 -&amp;gt; 0 -&amp;gt; 1&lt;/code&gt;, then this could represent &lt;code&gt;01101&lt;/code&gt; in binary, which is &lt;code&gt;13&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For all leaves in the tree, consider the numbers represented by the path from the root to that leaf.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Remove an Exclamation Mark from the End of String using Python</title>
      <link>https://andrewodendaal.com/remove-an-exclamation-mark-from-the-end-of-string-using-python/</link>
      <pubDate>Wed, 09 Sep 2020 01:39:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/remove-an-exclamation-mark-from-the-end-of-string-using-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Remove a exclamation mark from the end of string. You can assume that the input data is always a string, no need to verify it.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;remove(&amp;#34;Hi!&amp;#34;) === &amp;#34;Hi&amp;#34;&#xA;remove(&amp;#34;Hi!!!&amp;#34;) === &amp;#34;Hi!!&amp;#34;&#xA;remove(&amp;#34;!Hi&amp;#34;) === &amp;#34;!Hi&amp;#34;&#xA;remove(&amp;#34;!Hi!&amp;#34;) === &amp;#34;!Hi&amp;#34;&#xA;remove(&amp;#34;Hi! Hi!&amp;#34;) === &amp;#34;Hi! Hi&amp;#34;&#xA;remove(&amp;#34;Hi&amp;#34;) === &amp;#34;Hi&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;test.describe(&amp;#34;Basic Tests&amp;#34;)&#xA;&#xA;tests = [&#xA;    #[input, [expected]],&#xA;    [&amp;#34;Hi!&amp;#34;, &amp;#34;Hi&amp;#34;],&#xA;    [&amp;#34;Hi!!!&amp;#34;,&amp;#34;Hi!!&amp;#34;],&#xA;    [&amp;#34;!Hi&amp;#34;, &amp;#34;!Hi&amp;#34;],&#xA;    [&amp;#34;!Hi!&amp;#34;, &amp;#34;!Hi&amp;#34;],&#xA;    [&amp;#34;Hi! Hi!&amp;#34;, &amp;#34;Hi! Hi&amp;#34;],&#xA;    [&amp;#34;Hi&amp;#34;, &amp;#34;Hi&amp;#34;],&#xA;]&#xA;&#xA;for inp, exp in tests:&#xA;    test.assert_equals(remove(inp), exp)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python&#34;&gt;The solution in Python&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to “Rock Paper Scissors” in Java</title>
      <link>https://andrewodendaal.com/how-to-rock-paper-scissors-in-java/</link>
      <pubDate>Tue, 08 Sep 2020 01:35:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-rock-paper-scissors-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s play Rock Paper Scissors! You have to return which player won! In case of a draw return &lt;code&gt;Draw!&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples:&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;rps(&amp;#39;scissors&amp;#39;,&amp;#39;paper&amp;#39;) // Player 1 won!&#xA;rps(&amp;#39;scissors&amp;#39;,&amp;#39;rock&amp;#39;) // Player 2 won!&#xA;rps(&amp;#39;paper&amp;#39;,&amp;#39;paper&amp;#39;) // Draw!&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;the-rules-of-the-game-rock-paper-scissors&#34;&gt;The rules of the game Rock Paper Scissors&lt;/h3&gt;&#xA;&lt;p&gt;The rules of the game Rock Paper Scissors is quite simple.&lt;/p&gt;&#xA;&lt;p&gt;Rock beats scissors, scissors beats paper, and paper beats rock.&lt;/p&gt;&#xA;&lt;p&gt;Below is an illustration showing the cyclical routes.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Compare within Margin using Python</title>
      <link>https://andrewodendaal.com/compare-within-margin-using-python/</link>
      <pubDate>Mon, 07 Sep 2020 08:15:35 +0000</pubDate>
      <guid>https://andrewodendaal.com/compare-within-margin-using-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function &lt;code&gt;close_compare&lt;/code&gt; that accepts 3 parameters: &lt;code&gt;a&lt;/code&gt;, &lt;code&gt;b&lt;/code&gt;, and an optional &lt;code&gt;margin&lt;/code&gt;. The function should return whether &lt;code&gt;a&lt;/code&gt; is lower than, close to, or higher than &lt;code&gt;b&lt;/code&gt;. &lt;code&gt;a&lt;/code&gt; is &amp;ldquo;close to&amp;rdquo; &lt;code&gt;b&lt;/code&gt; if &lt;code&gt;margin&lt;/code&gt; is higher than or equal to the difference between &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;When &lt;code&gt;a&lt;/code&gt; is lower than &lt;code&gt;b&lt;/code&gt;, return &lt;code&gt;-1&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;When &lt;code&gt;a&lt;/code&gt; is higher than &lt;code&gt;b&lt;/code&gt;, return &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;When &lt;code&gt;a&lt;/code&gt; is close to &lt;code&gt;b&lt;/code&gt;, return ``.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Get the mean of an array in Java</title>
      <link>https://andrewodendaal.com/get-the-mean-of-an-array-in-java/</link>
      <pubDate>Sun, 06 Sep 2020 10:40:05 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-the-mean-of-an-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;It&amp;rsquo;s the academic year&amp;rsquo;s end, fateful moment of your school report. The averages must be calculated. All the students come to you and entreat you to calculate their average for them. Easy ! You just need to write a script.&lt;/p&gt;&#xA;&lt;p&gt;Return the average of the given array rounded &lt;strong&gt;down&lt;/strong&gt; to its nearest integer.&lt;/p&gt;&#xA;&lt;p&gt;The array will never be empty.&lt;/p&gt;&#xA;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertEquals;&#xA;import org.junit.runners.JUnit4;&#xA;&#xA;&#xA;public class SolutionTest {&#xA;  &#x9;@Test&#xA;&#x9;public void simpleTest() {&#xA;&#x9;&#x9;assertEquals(2,School.getAverage(new int[] {2,2,2,2}));&#xA;&#x9;&#x9;assertEquals(3,School.getAverage(new int[] {1,2,3,4,5}));&#xA;&#x9;&#x9;assertEquals(1,School.getAverage(new int[] {1,1,1,1,1,1,1,2}));&#xA;&#x9;}&#xA;  &#xA;&#xA;  &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Remove the time challenge in Python</title>
      <link>https://andrewodendaal.com/remove-the-time-challenge-in-python/</link>
      <pubDate>Sat, 05 Sep 2020 10:51:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/remove-the-time-challenge-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You&amp;rsquo;re re-designing a blog and the blog&amp;rsquo;s posts have the following format for showing the date and time a post was made:&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Weekday&lt;/em&gt; &lt;em&gt;Month&lt;/em&gt; &lt;em&gt;Day&lt;/em&gt;, &lt;em&gt;time&lt;/em&gt; e.g., Friday May 2, 7pm&lt;/p&gt;&#xA;&lt;p&gt;You&amp;rsquo;re running out of screen real estate, and on some pages you want to display a shorter format, &lt;em&gt;Weekday&lt;/em&gt; &lt;em&gt;Month&lt;/em&gt; &lt;em&gt;Day&lt;/em&gt; that omits the time.&lt;/p&gt;&#xA;&lt;p&gt;Write a function, shortenToDate, that takes the Website date/time in its original string format, and returns the shortened format.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Convert Hex to Decimal in Java</title>
      <link>https://andrewodendaal.com/how-to-convert-hex-to-decimal-in-java/</link>
      <pubDate>Fri, 04 Sep 2020 08:42:52 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-hex-to-decimal-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that converts an input string contains a &lt;code&gt;hex&lt;/code&gt; value, and return a &lt;code&gt;decimal&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.*;&#xA;&#xA;public class ExampleTests {&#xA;&#xA;  @Test&#xA;  public void examples() {&#xA;      // assertEquals(&amp;#34;expected&amp;#34;, &amp;#34;actual&amp;#34;);&#xA;      assertEquals(1, ConvertHexToDec.hexToDec(&amp;#34;1&amp;#34;));&#xA;      assertEquals(10, ConvertHexToDec.hexToDec(&amp;#34;a&amp;#34;));&#xA;      assertEquals(16, ConvertHexToDec.hexToDec(&amp;#34;10&amp;#34;));&#xA;      assertEquals(255, ConvertHexToDec.hexToDec(&amp;#34;FF&amp;#34;));&#xA;      assertEquals(-12, ConvertHexToDec.hexToDec(&amp;#34;-C&amp;#34;));&#xA;  }&#xA;  &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;In Java, it is really easy to convert Hex to Decimal.&lt;/p&gt;&#xA;&lt;p&gt;You simply use the &lt;code&gt;Integer&lt;/code&gt; class and call the &lt;code&gt;parseInt&lt;/code&gt; method, making sure to also provide the base that you want to convert from.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Character with Longest Consecutive Repetition in Java</title>
      <link>https://andrewodendaal.com/character-with-longest-consecutive-repetition-in-java/</link>
      <pubDate>Thu, 03 Sep 2020 01:21:09 +0000</pubDate>
      <guid>https://andrewodendaal.com/character-with-longest-consecutive-repetition-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;For a given string &lt;code&gt;s&lt;/code&gt; find the character &lt;code&gt;c&lt;/code&gt; (or &lt;code&gt;C&lt;/code&gt;) with longest consecutive repetition and return:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Object[]{c, l};&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;where &lt;code&gt;l&lt;/code&gt; (or &lt;code&gt;L&lt;/code&gt;) is the length of the repetition. If there are two or more characters with the same &lt;code&gt;l&lt;/code&gt; return the first in order of appearance.&lt;/p&gt;&#xA;&lt;p&gt;For empty string return:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Object[]{&amp;#34;&amp;#34;, 0}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertArrayEquals;&#xA;import org.junit.runners.JUnit4;&#xA;&#xA;public class SolutionTest {&#xA;    @Test&#xA;    public void exampleTests() {&#xA;        assertArrayEquals(new Object[]{&amp;#34;a&amp;#34;, 4}, Solution.longestRepetition(&amp;#34;aaaabb&amp;#34;));&#xA;        assertArrayEquals(new Object[]{&amp;#34;a&amp;#34;, 4}, Solution.longestRepetition(&amp;#34;bbbaaabaaaa&amp;#34;));&#xA;        assertArrayEquals(new Object[]{&amp;#34;u&amp;#34;, 3}, Solution.longestRepetition(&amp;#34;cbdeuuu900&amp;#34;));&#xA;        assertArrayEquals(new Object[]{&amp;#34;b&amp;#34;, 5}, Solution.longestRepetition(&amp;#34;abbbbb&amp;#34;));&#xA;        assertArrayEquals(new Object[]{&amp;#34;a&amp;#34;, 2}, Solution.longestRepetition(&amp;#34;aabb&amp;#34;));&#xA;        assertArrayEquals(new Object[]{&amp;#34;&amp;#34;, 0}, Solution.longestRepetition(&amp;#34;&amp;#34;));&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in java&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Check if List contains Item in Python</title>
      <link>https://andrewodendaal.com/check-if-list-contains-item-in-python/</link>
      <pubDate>Wed, 02 Sep 2020 01:19:41 +0000</pubDate>
      <guid>https://andrewodendaal.com/check-if-list-contains-item-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a method that accepts a list and an item, and returns &lt;code&gt;true&lt;/code&gt; if the item belongs to the list, otherwise &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;list = [0,1,2,3,5,8,13,2,2,2,11];&#xA;Test.assert_equals(include(list, 100), False, &amp;#34;list does not include 100&amp;#34;)&#xA;Test.assert_equals(include(list, 2), True, &amp;#34;list includes 2 multiple times&amp;#34;)&#xA;Test.assert_equals(include(list, 11), True, &amp;#34;list includes 11&amp;#34;)&#xA;Test.assert_equals(include(list, &amp;#34;2&amp;#34;), False, &amp;#34;list includes 2 (integer), not &amp;#39;&amp;#39;2&amp;#39;&amp;#39; (string)&amp;#34;)&#xA;Test.assert_equals(include([], 0), False, &amp;#34;empty list doesn&amp;#39;t include anything&amp;#34;)&#xA;Test.assert_equals(include(list, 0), True, &amp;#34;list includes 0&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python&#34;&gt;The solution in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def include(arr,item):&#xA;    return item in arr&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How To Create a User and Grant Permissions in MySQL</title>
      <link>https://andrewodendaal.com/how-to-create-a-user-and-grant-permissions-in-mysql/</link>
      <pubDate>Tue, 01 Sep 2020 00:32:57 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-user-and-grant-permissions-in-mysql/</guid>
      <description>&lt;h2 id=&#34;how-to-create-a-user&#34;&gt;How to create a user&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;CREATE USER &amp;#39;myuser&amp;#39;@&amp;#39;localhost&amp;#39; IDENTIFIED BY &amp;#39;mypassword&amp;#39;;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;how-to-delete-a-user&#34;&gt;How to delete a user&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DROP USER &amp;#39;myuser&amp;#39;@&amp;#39;localhost&amp;#39;;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-grant-permissions&#34;&gt;How to grant permissions&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;GRANT ALL PRIVILEGES ON * . * TO &amp;#39;myuser&amp;#39;@&amp;#39;localhost&amp;#39;;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-apply-those-permissions&#34;&gt;How to apply those permissions&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;FLUSH PRIVILEGES;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;going-a-bit-deeper&#34;&gt;Going a bit deeper&lt;/h2&gt;&#xA;&lt;h3 id=&#34;different-types-of-grants&#34;&gt;Different types of Grants&lt;/h3&gt;&#xA;&lt;p&gt;&lt;code&gt;ALL PRIVILEGES&lt;/code&gt; : Full access to everything, globally unless restricted to a database&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;CREATE&lt;/code&gt; : Create databases and tables&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;DROP&lt;/code&gt; : Delete databases and tables&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;DELETE&lt;/code&gt; : Delete rows from tables&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Remove Vowels with Python</title>
      <link>https://andrewodendaal.com/how-to-remove-vowels-with-python/</link>
      <pubDate>Mon, 31 Aug 2020 00:37:31 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-remove-vowels-with-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function called &lt;code&gt;shortcut&lt;/code&gt; to remove all the &lt;strong&gt;lowercase&lt;/strong&gt; vowels in a given string.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;shortcut(&amp;#34;codewars&amp;#34;) # --&amp;gt; cdwrs&#xA;shortcut(&amp;#34;goodbye&amp;#34;)  # --&amp;gt; gdby&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Don&amp;rsquo;t worry about uppercase vowels.&lt;/p&gt;&#xA;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import random&#xA;&#xA;Test.describe(&amp;#34;Easy&amp;#34;)&#xA;for t in [&#xA;  [&amp;#34;hello&amp;#34;,&amp;#34;hll&amp;#34;],&#xA;  [&amp;#34;hellooooo&amp;#34;,&amp;#34;hll&amp;#34;],&#xA;  [&amp;#34;how are you today?&amp;#34;,&amp;#34;hw r y tdy?&amp;#34;],&#xA;  [&amp;#34;complain&amp;#34;,&amp;#34;cmpln&amp;#34;],&#xA;  [&amp;#34;never&amp;#34;,&amp;#34;nvr&amp;#34;]&#xA;]:&#xA;    ans,exp = shortcut(t[0]), t[1]&#xA;    Test.assert_equals(ans,exp)&#xA;&#xA;Test.describe(&amp;#34;Not so easy&amp;#34;)&#xA;for t in [&#xA;  [&amp;#34;a e i o u, borriquito como tu&amp;#34;,&amp;#34;    , brrqt cm t&amp;#34;,&amp;#34;Isolated vowels let spaces between them&amp;#34;],&#xA;  [&amp;#34;Explicit is better than implicit&amp;#34;, &amp;#34;Explct s bttr thn mplct&amp;#34;,&amp;#34;Should remove only lowercase vowel&amp;#34;],&#xA;  [&amp;#34;Beautiful is better than Ugly&amp;#34;, &amp;#34;Btfl s bttr thn Ugly&amp;#34;,&amp;#34;Should remove only lowercase vowel&amp;#34;]&#xA;]:&#xA;    ans,exp = shortcut(t[0]), t[1]&#xA;    Test.assert_equals(ans,exp)&#xA;&#xA;#  &#xA;for t in random.sample([&#xA;  [&amp;#34;We are the Knights who say ni!&amp;#34;,&amp;#34;W r th Knghts wh sy n!&amp;#34;],&#xA;  [&amp;#34;Nobody expects the Spanish Inquisition!&amp;#34;,&amp;#34;Nbdy xpcts th Spnsh Inqstn!&amp;#34;],&#xA;  [&amp;#34;He&amp;#39;s not the messiah. He&amp;#39;s a very naughty boy!&amp;#34;,&amp;#34;H&amp;#39;s nt th mssh. H&amp;#39;s  vry nghty by!&amp;#34;],&#xA;  [&amp;#34;It&amp;#39;s just a flesh wound.&amp;#34;,&amp;#34;It&amp;#39;s jst  flsh wnd.&amp;#34;],&#xA;  [&amp;#34;You don&amp;#39;t frighten us, English pig dogs.&amp;#34;,&amp;#34;Y dn&amp;#39;t frghtn s, Englsh pg dgs.&amp;#34;],&#xA;  [&amp;#34;Mate, this parrot wouldn&amp;#39;t VOOM if you put four million volts through it!&amp;#34;,&amp;#34;Mt, ths prrt wldn&amp;#39;t VOOM f y pt fr mlln vlts thrgh t!&amp;#34;],&#xA;  [&amp;#34;Five is a sufficiently close approximation to infinity.&amp;#34;,&amp;#34;Fv s  sffcntly cls pprxmtn t nfnty.&amp;#34;]&#xA;],7):&#xA;    ans,exp = shortcut(t[0]), t[1]&#xA;    Test.assert_equals(ans,exp)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python&#34;&gt;The solution in Python&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 (long way):&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to find all files in a directory with extension</title>
      <link>https://andrewodendaal.com/how-to-find-all-files-in-a-directory-with-extension/</link>
      <pubDate>Sun, 30 Aug 2020 01:05:29 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-all-files-in-a-directory-with-extension/</guid>
      <description>&lt;p&gt;I needed to find all files in a directory on Linux that ended with the file extension &lt;code&gt;.php&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-find-all-files-in-a-directory-with-extension&#34;&gt;How to find all files in a directory with extension&lt;/h2&gt;&#xA;&lt;p&gt;You can do this as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;cd &amp;lt;your directory path&amp;gt;&#xA;&#xA;find . -type f -name &amp;#34;*.php&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-find-other-file-extensions-in-a-directory&#34;&gt;How to find other file extensions in a directory&lt;/h2&gt;&#xA;&lt;p&gt;Just swap out the &lt;code&gt;.php&lt;/code&gt; value for another file extension that you would like to search for instead.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Sort a List in Python</title>
      <link>https://andrewodendaal.com/how-to-sort-a-list-in-python/</link>
      <pubDate>Sat, 29 Aug 2020 01:30:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-sort-a-list-in-python/</guid>
      <description>&lt;p&gt;In this tutorial, you will learn how to sort a list in Python, by following the below three steps:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Options to sort a list in Python&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What is the difference between &amp;ldquo;sort&amp;rdquo; and &amp;ldquo;sorted&amp;rdquo;&lt;/li&gt;&#xA;&lt;li&gt;An example of using &amp;ldquo;sort&amp;rdquo;&lt;/li&gt;&#xA;&lt;li&gt;An example of using &amp;ldquo;sorted&amp;rdquo;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;How to Sort a List in Reverse&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Sort a list in Reverse using &amp;ldquo;sort&amp;rdquo;&lt;/li&gt;&#xA;&lt;li&gt;Sort a list in Reverse using &amp;ldquo;sorted&amp;rdquo;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;Sort with a Custom Function using Key&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;1-options-to-sort-a-list-in-python&#34;&gt;1. Options to sort a list in Python&lt;/h2&gt;&#xA;&lt;p&gt;There exist two main options, those are &lt;code&gt;sort()&lt;/code&gt; and &lt;code&gt;sorted()&lt;/code&gt;, let&amp;rsquo;s explore them below.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cryptanalysis Word Patterns in Java</title>
      <link>https://andrewodendaal.com/cryptanalysis-word-patterns-in-java/</link>
      <pubDate>Fri, 28 Aug 2020 00:58:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/cryptanalysis-word-patterns-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In cryptanalysis, words patterns can be a useful tool in cracking simple ciphers.&lt;/p&gt;&#xA;&lt;p&gt;A word pattern is a description of the patterns of letters occurring in a word, where each letter is given an integer code in order of appearance. So the first letter is given the code 0, and second is then assigned 1 if it is different to the first letter or 0 otherwise, and so on.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to divide a number in Python</title>
      <link>https://andrewodendaal.com/how-to-divide-a-number-in-python/</link>
      <pubDate>Thu, 27 Aug 2020 09:10:44 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-divide-a-number-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Your task is to create function&lt;code&gt;isDivideBy&lt;/code&gt; (or &lt;code&gt;is_divide_by&lt;/code&gt;) to check if an integer number is divisible by each out of two arguments.&lt;/p&gt;&#xA;&lt;p&gt;A few cases:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;(-12, 2, -6)  -&amp;gt;  true&#xA;(-12, 2, -5)  -&amp;gt;  false&#xA;&#xA;(45, 1, 6)    -&amp;gt;  false&#xA;(45, 5, 15)   -&amp;gt;  true&#xA;&#xA;(4, 1, 4)     -&amp;gt;  true&#xA;(15, -5, 3)   -&amp;gt;  true&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Test.describe(&amp;#34;Basic Tests&amp;#34;)&#xA;Test.it(&amp;#34;should pass basic tests&amp;#34;)&#xA;Test.assert_equals(is_divide_by(-12, 2, -6), True)&#xA;Test.assert_equals(is_divide_by(-12, 2, -5), False)&#xA;Test.assert_equals(is_divide_by(45, 1, 6), False)&#xA;Test.assert_equals(is_divide_by(45, 5, 15), True)&#xA;Test.assert_equals(is_divide_by(4, 1, 4), True)&#xA;Test.assert_equals(is_divide_by(15, -5, 3), True)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;understanding-how-to-solve-this&#34;&gt;Understanding how to solve this&lt;/h2&gt;&#xA;&lt;p&gt;To resolve this problem, we need to understand how to find if a number can be divided without a remainder in Python. This is similar to other mathematical operations you might perform in Python, like &lt;a href=&#34;https://andrewodendaal.com/find-the-intersection-of-two-arrays-in-python&#34;&gt;finding the intersection of two arrays&lt;/a&gt; or &lt;a href=&#34;https://andrewodendaal.com/custom-rgb-to-hex-conversion-with-python&#34;&gt;converting RGB to Hex&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Read Kubernetes Secrets</title>
      <link>https://andrewodendaal.com/how-to-read-kubernetes-secrets/</link>
      <pubDate>Wed, 26 Aug 2020 03:10:34 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-read-kubernetes-secrets/</guid>
      <description>&lt;p&gt;Kubernetes secrets is a great way to store secret values that only Kubernetes can access in your hosted applications.&lt;/p&gt;&#xA;&lt;p&gt;There are times when you might need to view these secrets in plain-text. This is probably because you want to validate the value or use it manually elsewhere.&lt;/p&gt;&#xA;&lt;p&gt;In this tutorial we will go through how to achieve this and read Kubernetes secrets using &lt;code&gt;kubectl&lt;/code&gt; for the command-line.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;tl;dr&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;kubectl get secret &amp;lt;SECRET_NAME&amp;gt; -o jsonpath=&amp;#34;{.data.&amp;lt;DATA&amp;gt;}&amp;#34; | base64 --decode&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In the above sample code, simply replace &lt;code&gt;&amp;lt;SECRET_NAME&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;DATA&amp;gt;&lt;/code&gt; with your own values.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Backspaces in String Challenge using Java</title>
      <link>https://andrewodendaal.com/backspaces-in-string-challenge-using-java/</link>
      <pubDate>Tue, 25 Aug 2020 09:57:27 +0000</pubDate>
      <guid>https://andrewodendaal.com/backspaces-in-string-challenge-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Assume &lt;code&gt;&amp;quot;#&amp;quot;&lt;/code&gt; is like a backspace in string. This means that string &lt;code&gt;&amp;quot;a#bc#d&amp;quot;&lt;/code&gt; actually is &lt;code&gt;&amp;quot;bd&amp;quot;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Your task is to process a string with &lt;code&gt;&amp;quot;#&amp;quot;&lt;/code&gt; symbols.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;abc#d##c&amp;#34;      ==&amp;gt;  &amp;#34;ac&amp;#34;&#xA;&amp;#34;abc##d######&amp;#34;  ==&amp;gt;  &amp;#34;&amp;#34;&#xA;&amp;#34;#######&amp;#34;       ==&amp;gt;  &amp;#34;&amp;#34;&#xA;&amp;#34;&amp;#34;              ==&amp;gt;  &amp;#34;&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertEquals;&#xA;import org.junit.runners.JUnit4;&#xA;&#xA;public class SolutionTest {&#xA;    @Test&#xA;    public void testCleanString() {&#xA;        final BackspacesInString bis = new BackspacesInString();&#xA;        assertEquals(&amp;#34;ac&amp;#34;, bis.cleanString(&amp;#34;abc#d##c&amp;#34;));&#xA;        assertEquals(&amp;#34;&amp;#34;, bis.cleanString(&amp;#34;abc####d##c#&amp;#34;));&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How many times to Kaprekar’s constant using Python</title>
      <link>https://andrewodendaal.com/how-many-times-to-kaprekars-constant-using-python/</link>
      <pubDate>Mon, 24 Aug 2020 08:47:06 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-many-times-to-kaprekars-constant-using-python/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;6174&lt;/strong&gt; is known as &lt;strong&gt;Kaprekar&amp;rsquo;s constant&lt;/strong&gt; after the Indian mathematician D. R. Kaprekar. This number is notable for the following rule:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Take any four-digit number, using at least two different digits (leading zeros are allowed).&lt;/li&gt;&#xA;&lt;li&gt;Arrange the digits in descending and then in ascending order to get two four-digit numbers, adding leading zeros if necessary.&lt;/li&gt;&#xA;&lt;li&gt;Subtract the smaller number from the bigger number.&lt;/li&gt;&#xA;&lt;li&gt;Go back to step 2 and repeat.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The above process, known as &lt;!-- raw HTML omitted --&gt;Kaprekar&amp;rsquo;s routine&lt;!-- raw HTML omitted --&gt;, will always reach its &lt;!-- raw HTML omitted --&gt;fixed point&lt;!-- raw HTML omitted --&gt;, 6174, in at most 7 iterations. Once 6174 is reached, the process will continue yielding 7641 – 1467 = 6174. For example, choose 3524:5432 – 2345 = 30878730 – 0378 = 83528532 – 2358 = 61747641 – 1467 = &lt;strong&gt;6174&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to check if a String is a Number in Python</title>
      <link>https://andrewodendaal.com/how-to-check-if-a-string-is-a-number-in-python/</link>
      <pubDate>Sun, 23 Aug 2020 03:09:28 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-check-if-a-string-is-a-number-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a string s, write a method (function) that will return true if its a valid single integer or floating number or false if its not.&lt;/p&gt;&#xA;&lt;p&gt;Valid examples, should return true:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;isDigit(&amp;#34;3&amp;#34;)&#xA;isDigit(&amp;#34;  3  &amp;#34;)&#xA;isDigit(&amp;#34;-3.23&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;should return false:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;isDigit(&amp;#34;3-4&amp;#34;)&#xA;isDigit(&amp;#34;  3   5&amp;#34;)&#xA;isDigit(&amp;#34;3 5&amp;#34;)&#xA;isDigit(&amp;#34;zero&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;test.assert_equals(isDigit(&amp;#34;s2324&amp;#34;), False)&#xA;test.assert_equals(isDigit(&amp;#34;-234.4&amp;#34;), True)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python&#34;&gt;The solution in Python&lt;/h2&gt;&#xA;&lt;p&gt;Option 1(with &lt;code&gt;try&lt;/code&gt;/&lt;code&gt;except&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;# create a function&#xA;def isDigit(string):&#xA;    # use a `try/except` block&#xA;    try:&#xA;        # True if can convert to a float&#xA;        float(string)&#xA;        return True&#xA;    except:&#xA;        # otherwise return False&#xA;        return False&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Option 2(with &lt;code&gt;regex/Regular expression&lt;/code&gt;):&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Write a Custom Comparator in Python</title>
      <link>https://andrewodendaal.com/how-to-write-a-custom-comparator-in-python/</link>
      <pubDate>Sat, 22 Aug 2020 01:48:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-write-a-custom-comparator-in-python/</guid>
      <description>&lt;p&gt;Generally, you want to use the built-in &lt;code&gt;sorted()&lt;/code&gt; function which takes a custom comparator as its parameter. We need to pay attention to the fact that in Python 3 the parameter name and semantics have changed.&lt;/p&gt;&#xA;&lt;h3 id=&#34;how-the-custom-comparator-works&#34;&gt;How the custom comparator works&lt;/h3&gt;&#xA;&lt;p&gt;When providing a custom comparator, it should generally return an integer/float value that follows the following pattern (as with most other programming languages and frameworks):&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;return a negative value (&lt;code&gt;&amp;lt; 0&lt;/code&gt;) when the left item should be sorted &lt;em&gt;before&lt;/em&gt; the right item&lt;/li&gt;&#xA;&lt;li&gt;return a positive value (&lt;code&gt;&amp;gt; 0&lt;/code&gt;) when the left item should be sorted &lt;em&gt;after&lt;/em&gt; the right item&lt;/li&gt;&#xA;&lt;li&gt;return `` when both the left and the right item have the same weight and should be ordered &amp;ldquo;equally&amp;rdquo; without precedence&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a comparator for a list of phonetic words for the letters of the &lt;!-- raw HTML omitted --&gt;greek alphabet&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to delete an AWS WAF – Web ACL</title>
      <link>https://andrewodendaal.com/how-to-delete-an-aws-waf-web-acl/</link>
      <pubDate>Fri, 21 Aug 2020 01:33:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-delete-an-aws-waf-web-acl/</guid>
      <description>&lt;p&gt;Usually, it&amp;rsquo;s quite easy to delete an AWS WAF, or Web ACL. But sometimes you may come across the following error when attempting to delete the actual WAF:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;AWS WAF couldn’t perform the operation because your resource is being used by another resource or it’s associated with another resource.&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2020/08/image-4-1024x423.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-this-means&#34;&gt;What this means&lt;/h2&gt;&#xA;&lt;p&gt;When you get this error, it means that there is something attached to the WAF that is currently using it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Sort an Integer in Python</title>
      <link>https://andrewodendaal.com/how-to-sort-an-integer-in-python/</link>
      <pubDate>Thu, 20 Aug 2020 08:41:49 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-sort-an-integer-in-python/</guid>
      <description>&lt;p&gt;Let&amp;rsquo;s say that you have an integer with value of &lt;code&gt;9271&lt;/code&gt; and you want to sort it either ascending(&lt;code&gt;1279&lt;/code&gt;) or descending(&lt;code&gt;9721&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;How would you do this in Python? How would you sort an integer in either ascending or descending order?&lt;/p&gt;&#xA;&lt;h2 id=&#34;sorting-our-integer&#34;&gt;Sorting our integer&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s set our integer to &lt;code&gt;n&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;n = 9271&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now let&amp;rsquo;s sort it:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sorted([i for i in str(n)])&#xA;&#xA;# This will give us a list in ascending order&#xA;# [&amp;#39;1&amp;#39;, &amp;#39;2&amp;#39;, &amp;#39;7&amp;#39;, &amp;#39;9&amp;#39;]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We can as easily do it the other way:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Upgrade PIP</title>
      <link>https://andrewodendaal.com/how-to-upgrade-pip/</link>
      <pubDate>Wed, 19 Aug 2020 11:55:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-upgrade-pip/</guid>
      <description>&lt;p&gt;In this tutorial, you will learn how to upgrade PIP.&lt;/p&gt;&#xA;&lt;p&gt;You will also learn how to check the current version of PIP, as well as downgrade to a previous version of PIP if you really need to.&lt;/p&gt;&#xA;&lt;h2 id=&#34;tldr-how-to-upgrade-pip&#34;&gt;TLDR; How to Upgrade PIP&lt;/h2&gt;&#xA;&lt;p&gt;The most obvious way, if &lt;code&gt;python&lt;/code&gt; is mapped to the version you want pip to be upgraded on:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;python -m pip install --upgrade pip&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;or if you are running &lt;code&gt;python3&lt;/code&gt; from the &lt;code&gt;python3&lt;/code&gt; command itself:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Copy a File in Python</title>
      <link>https://andrewodendaal.com/how-to-copy-a-file-in-python/</link>
      <pubDate>Tue, 18 Aug 2020 07:46:26 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-copy-a-file-in-python/</guid>
      <description>&lt;p&gt;In this tutorial, you will learn how to copy a file using Python from a directory to another directory, or if you&amp;rsquo;re on Windows, then from a Folder to another Folder.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;shutil.copyfile&lt;/code&gt; is a tool that is often used to copy a file in Python, below is an example of it&amp;rsquo;s usage, you can &lt;!-- raw HTML omitted --&gt;read more about it on the Python docs&lt;!-- raw HTML omitted --&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Conway’s Game of Life – Unlimited Edition – in Python</title>
      <link>https://andrewodendaal.com/conways-game-of-life-unlimited-edition-in-python/</link>
      <pubDate>Mon, 17 Aug 2020 07:30:17 +0000</pubDate>
      <guid>https://andrewodendaal.com/conways-game-of-life-unlimited-edition-in-python/</guid>
      <description>&lt;h2 id=&#34;what-is-this&#34;&gt;What is this?&lt;/h2&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;geeksforgeeks.org&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;how-the-game-works&#34;&gt;How the game works&lt;/h2&gt;&#xA;&lt;p&gt;Because the Game of Life is built on a grid of nine squares, every cell has eight neighboring cells,as shown in the given figure. A given cell (i, j) in the simulation is accessed on a grid [i][j], where i and j are the row and column indices, respectively. The value of a given cell at a given instant of time depends on the state of its neighbors at the previous time step. Conway’s Game of Life has four rules.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Most frequently used words in a text  with Python</title>
      <link>https://andrewodendaal.com/most-frequently-used-words-in-a-text-with-python/</link>
      <pubDate>Sun, 16 Aug 2020 02:16:11 +0000</pubDate>
      <guid>https://andrewodendaal.com/most-frequently-used-words-in-a-text-with-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that, given a string of text (possibly with punctuation and line-breaks), returns an array of the top-3 most occurring words, in descending order of the number of occurrences.&lt;/p&gt;&#xA;&lt;h3 id=&#34;assumptions&#34;&gt;Assumptions:&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A word is a string of letters (A to Z) optionally containing one or more apostrophes (‘) in ASCII. (No need to handle fancy punctuation.)&lt;/li&gt;&#xA;&lt;li&gt;Matches should be case-insensitive, and the words in the result should be lowercased.&lt;/li&gt;&#xA;&lt;li&gt;Ties may be broken arbitrarily.&lt;/li&gt;&#xA;&lt;li&gt;If a text contains fewer than three unique words, then either the top-2 or top-1 words should be returned, or an empty array if a text contains no words.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples:&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;top_3_words(&amp;#34;In a village of La Mancha, the name of which I have no desire to call to&#xA;mind, there lived not long since one of those gentlemen that keep a lance&#xA;in the lance-rack, an old buckler, a lean hack, and a greyhound for&#xA;coursing. An olla of rather more beef than mutton, a salad on most&#xA;nights, scraps on Saturdays, lentils on Fridays, and a pigeon or so extra&#xA;on Sundays, made away with three-quarters of his income.&amp;#34;)&#xA;# =&amp;gt; [&amp;#34;a&amp;#34;, &amp;#34;of&amp;#34;, &amp;#34;on&amp;#34;]&#xA;&#xA;top_3_words(&amp;#34;e e e e DDD ddd DdD: ddd ddd aa aA Aa, bb cc cC e e e&amp;#34;)&#xA;# =&amp;gt; [&amp;#34;e&amp;#34;, &amp;#34;ddd&amp;#34;, &amp;#34;aa&amp;#34;]&#xA;&#xA;top_3_words(&amp;#34;  //wont won&amp;#39;t won&amp;#39;t&amp;#34;)&#xA;# =&amp;gt; [&amp;#34;won&amp;#39;t&amp;#34;, &amp;#34;wont&amp;#34;]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;bonus-points-not-really-but-just-for-fun&#34;&gt;Bonus points:&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Avoid creating an array whose memory footprint is roughly as big as the input text.&lt;/li&gt;&#xA;&lt;li&gt;Avoid sorting the entire array of unique words.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from random import choice, randint, sample, shuffle, choices&#xA;import re&#xA;from collections import Counter&#xA;&#xA;&#xA;def check(s, this=None):                                            # this: only for debugging purpose&#xA;    returned_result = top_3_words(s) if this is None else this&#xA;    fs = Counter(w for w in re.findall(r&amp;#34;[a-zA-Z&amp;#39;]+&amp;#34;, s.lower()) if w != &amp;#34;&amp;#39;&amp;#34; * len(w))&#xA;    exp,expected_frequencies = map(list,zip(*fs.most_common(3))) if fs else ([],[])&#xA;    &#xA;    msg = &amp;#39;&amp;#39;&#xA;    wrong_words = [w for w in returned_result if not fs[w]]&#xA;    actual_freq = [fs[w] for w in returned_result]&#xA;    &#xA;    if wrong_words:&#xA;        msg = &amp;#39;Incorrect match: words not present in the string. Your output: {}. One possible valid answer: {}&amp;#39;.format(returned_result, exp)&#xA;    elif len(set(returned_result)) != len(returned_result):&#xA;        msg = &amp;#39;The result should not contain copies of the same word. Your output: {}. One possible output: {}&amp;#39;.format(returned_result, exp)&#xA;    elif actual_freq!=expected_frequencies:&#xA;        msg = &amp;#34;Incorrect frequencies: {} should be {}. Your output: {}. One possible output: {}&amp;#34;.format(actual_freq, expected_frequencies, returned_result, exp)&#xA;    &#xA;    Test.expect(not msg, msg)&#xA;&#xA;&#xA;&#xA;@test.describe(&amp;#34;Fixed tests&amp;#34;)&#xA;def fixed_tests():&#xA;&#xA;    TESTS = (&#xA;    &amp;#34;a a a  b  c c  d d d d  e e e e e&amp;#34;,&#xA;    &amp;#34;e e e e DDD ddd DdD: ddd ddd aa aA Aa, bb cc cC e e e&amp;#34;,&#xA;    &amp;#34;  //wont won&amp;#39;t won&amp;#39;t &amp;#34;,&#xA;    &amp;#34;  , e   .. &amp;#34;,&#xA;    &amp;#34;  ...  &amp;#34;,&#xA;    &amp;#34;  &amp;#39;  &amp;#34;,&#xA;    &amp;#34;  &amp;#39;&amp;#39;&amp;#39;  &amp;#34;,&#xA;    &amp;#34;&amp;#34;&amp;#34;In a village of La Mancha, the name of which I have no desire to cao&#xA;    mind, there lived not long since one of those gentlemen that keep a lance&#xA;    in the lance-rack, an old buckler, a lean hack, and a greyhound for&#xA;    coursing. An olla of rather more beef than mutton, a salad on most&#xA;    nights, scraps on Saturdays, lentils on Fridays, and a pigeon or so extra&#xA;    on Sundays, made away with three-quarters of his income.&amp;#34;&amp;#34;&amp;#34;,&#xA;    &amp;#34;a a a  b  c c X&amp;#34;,&#xA;    &amp;#34;a a c b b&amp;#34;,&#xA;    )&#xA;    for s in TESTS: check(s)&#xA;    &#xA;@test.describe(&amp;#34;Random tests&amp;#34;)&#xA;def random_tests():&#xA;    &#xA;    def gen_word():&#xA;        return &amp;#34;&amp;#34;.join(choice(&amp;#34;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;#39;&amp;#34;) for _ in range(randint(3, 10)))&#xA;    &#xA;    def gen_string():&#xA;        words = []&#xA;        nums = choices(range(1, 31), k=20)&#xA;        for _ in range(randint(0, 20)):&#xA;            words += [gen_word()] * nums.pop()&#xA;        shuffle(words)&#xA;        s = &amp;#34;&amp;#34;&#xA;        while words:&#xA;            s += words.pop() + &amp;#34;&amp;#34;.join(choice(&amp;#34;-,.?!_:;/ &amp;#34;) for _ in range(randint(1, 5)))&#xA;        return s&#xA;    &#xA;    @test.it(&amp;#34;Tests&amp;#34;)&#xA;    def it_1():&#xA;        for _ in range(100): check(gen_string())&#xA;            &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-using-python&#34;&gt;The solution using Python&lt;/h2&gt;&#xA;&lt;p&gt;Option 1:&lt;/p&gt;</description>
    </item>
    <item>
      <title>The SongDecoder Dubstep Challenge with Java</title>
      <link>https://andrewodendaal.com/the-songdecoder-dubstep-challenge-with-java/</link>
      <pubDate>Sat, 15 Aug 2020 02:50:17 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-songdecoder-dubstep-challenge-with-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Polycarpus works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of old songs and make dubstep remixes from them.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s assume that a song consists of some number of words (that don&amp;rsquo;t contain WUB). To make the dubstep remix of this song, Polycarpus inserts a certain number of words &amp;ldquo;WUB&amp;rdquo; before the first word of the song (the number may be zero), after the last word (the number may be zero), and between words (at least one between any pair of neighbouring words), and then the boy glues together all the words, including &amp;ldquo;WUB&amp;rdquo;, in one string and plays the song at the club.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Break camelCase Challenge in Java</title>
      <link>https://andrewodendaal.com/break-camelcase-challenge-in-java/</link>
      <pubDate>Fri, 14 Aug 2020 07:34:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/break-camelcase-challenge-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the solution so that the function will break up camel casing, using a space between words.&lt;/p&gt;&#xA;&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;solution(&amp;#34;camelCasing&amp;#34;)  ==  &amp;#34;camel Casing&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertEquals;&#xA;import org.junit.runners.JUnit4;&#xA;&#xA;public class SolutionTest {&#xA;    @Test&#xA;    public void tests() {&#xA;      assertEquals( &amp;#34;Incorrect&amp;#34;, &amp;#34;camel Casing&amp;#34;, Solution.camelCase(&amp;#34;camelCasing&amp;#34;));&#xA;      assertEquals( &amp;#34;Incorrect&amp;#34;, &amp;#34;camel Casing Test&amp;#34;, Solution.camelCase(&amp;#34;camelCasingTest&amp;#34;));&#xA;      assertEquals( &amp;#34;Incorrect&amp;#34;, &amp;#34;camelcasingtest&amp;#34;, Solution.camelCase(&amp;#34;camelcasingtest&amp;#34;));&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;  public static String camelCase(String input) {&#xA;    String out = &amp;#34;&amp;#34;;&#xA;    &#xA;    for (int i=0; i&amp;lt;input.length(); i++) {&#xA;      String c = Character.toString(input.charAt(i));&#xA;      if (c.equals(c.toUpperCase())) {&#xA;        out+=&amp;#34; &amp;#34;;&#xA;      }&#xA;      out+=c;&#xA;    }&#xA;    &#xA;    return out;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Sort Binary Tree by Levels using Python</title>
      <link>https://andrewodendaal.com/sort-binary-tree-by-levels-using-python/</link>
      <pubDate>Thu, 13 Aug 2020 00:14:32 +0000</pubDate>
      <guid>https://andrewodendaal.com/sort-binary-tree-by-levels-using-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given a binary tree:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Node:&#xA;    def __init__(self, L, R, n):&#xA;        self.left = L&#xA;        self.right = R&#xA;        self.value = n&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Your task is to return the list with elements from tree sorted by levels, which means the root element goes first, then root children (from left to right) are second and third, and so on.&lt;/p&gt;&#xA;&lt;p&gt;Return empty list if root is &lt;code&gt;None&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Example 1 – following tree:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Split a String with Python</title>
      <link>https://andrewodendaal.com/how-to-split-a-string-with-python/</link>
      <pubDate>Wed, 12 Aug 2020 08:26:31 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-split-a-string-with-python/</guid>
      <description>&lt;p&gt;Splitting a string in Python is really easy.&lt;/p&gt;&#xA;&lt;p&gt;You simply take a &lt;code&gt;string&lt;/code&gt; and apply the &lt;code&gt;split()&lt;/code&gt; method.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;&amp;quot;Your String&amp;quot;.split()&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;See some examples of the Python Split String method:&lt;/p&gt;&#xA;&lt;h2 id=&#34;a-python-split-string-8211-example&#34;&gt;A Python Split String – Example&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;# Your string&#xA;a_string = &amp;#34;This is our string&amp;#34;&#xA;&#xA;# Split into a list&#xA;a_list = a_string.split()&#xA;&#xA;# Print the list&#xA;print(a_list)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;python-split-string-8211-syntax&#34;&gt;Python Split String – Syntax&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;string.split(separator, maxsplit)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameter-values&#34;&gt;Parameter Values&lt;/h2&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;&lt;/th&gt;&#xA;          &lt;th&gt;&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Parameter&lt;/td&gt;&#xA;          &lt;td&gt;Description&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;separator&lt;/td&gt;&#xA;          &lt;td&gt;Optional – What to split the string on. The default is the whitespace character&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;maxsplit&lt;/td&gt;&#xA;          &lt;td&gt;Optional – How many splits to perform. The default is -1, meaning “no limit”&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;h2 id=&#34;some-examples-for-python-split-string&#34;&gt;Some examples for Python Split String&lt;/h2&gt;&#xA;&lt;p&gt;Use a comma (&lt;code&gt;,&lt;/code&gt;) as the separator:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to fix the Terraform stuck on “Refreshing state…” problem</title>
      <link>https://andrewodendaal.com/how-to-fix-the-terraform-stuck-on-refreshing-state-problem/</link>
      <pubDate>Tue, 11 Aug 2020 00:24:18 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-fix-the-terraform-stuck-on-refreshing-state-problem/</guid>
      <description>&lt;p&gt;Terraform is a fantastic tool to help automate your infrastructure as code.&lt;/p&gt;&#xA;&lt;p&gt;Quite a few times however, I have noticed a few strange issues, one of them is when Terraform gets stuck while refreshing the state.&lt;/p&gt;&#xA;&lt;p&gt;This can happen when running &lt;code&gt;terraform plan&lt;/code&gt; or in-fact, when running a range of other commands that require the state-file to be refreshed and used.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-problem&#34;&gt;The problem&lt;/h2&gt;&#xA;&lt;p&gt;Terraform gets stuck on this message:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Refreshing Terraform state in-memory prior to plan…&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>The “Split Strings” Challenge using Java</title>
      <link>https://andrewodendaal.com/the-split-strings-challenge-using-java/</link>
      <pubDate>Mon, 10 Aug 2020 07:41:20 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-split-strings-challenge-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the solution so that it splits the string into pairs of two characters. If the string contains an odd number of characters then it should replace the missing second character of the final pair with an underscore (‘_&amp;rsquo;).&lt;/p&gt;&#xA;&lt;p&gt;Examples:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;StringSplit.solution(&amp;#34;abc&amp;#34;) // should return {&amp;#34;ab&amp;#34;, &amp;#34;c_&amp;#34;}&#xA;StringSplit.solution(&amp;#34;abcdef&amp;#34;) // should return {&amp;#34;ab&amp;#34;, &amp;#34;cd&amp;#34;, &amp;#34;ef&amp;#34;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertEquals;&#xA;import org.junit.runners.JUnit4;&#xA;import java.util.Arrays;&#xA;&#xA;public class SampleTest {&#xA;    @Test&#xA;    public void testEvenString() {&#xA;       String s = &amp;#34;abcdef&amp;#34;;&#xA;       String s1 = &amp;#34;HelloWorld&amp;#34;;&#xA;       assertEquals(&amp;#34;Should handle even string&amp;#34;,&amp;#34;[ab, cd, ef]&amp;#34;, Arrays.toString(StringSplit.solution(s)));&#xA;       assertEquals(&amp;#34;Should handle even string&amp;#34;,&amp;#34;[He, ll, oW, or, ld]&amp;#34;, Arrays.toString(StringSplit.solution(s1)));&#xA;    }&#xA;    &#xA;    @Test&#xA;    public void testOddString() {&#xA;       String s = &amp;#34;abcde&amp;#34;;&#xA;       String s1 = &amp;#34;LovePizza&amp;#34;;&#xA;       assertEquals(&amp;#34;Should handle odd string&amp;#34;,&amp;#34;[ab, cd, e_]&amp;#34;, Arrays.toString(StringSplit.solution(s)));&#xA;       assertEquals(&amp;#34;Should handle odd string&amp;#34;,&amp;#34;[Lo, ve, Pi, zz, a_]&amp;#34;, Arrays.toString(StringSplit.solution(s1)));&#xA;    }&#xA;  &#xA;  &#xA;    @Test&#xA;    public void testEmptyString() {&#xA;       String s = &amp;#34;&amp;#34;;&#xA;       assertEquals(&amp;#34;Should handle empty string&amp;#34;,&amp;#34;[]&amp;#34;, Arrays.toString(StringSplit.solution(s)));&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class StringSplit {&#xA;    public static String[] solution(String s) {&#xA;      &#xA;        // if it&amp;#39;s blank, then return&#xA;        if (s.length()==0) return new String[0];&#xA;      &#xA;        // if not even, then add an underscore to the end&#xA;        if (s.length()%2!=0) {&#xA;          s+=&amp;#34;_&amp;#34;;&#xA;        }&#xA;      &#xA;        // determine the space needed for the return array&#xA;        int spaceNeeded = s.length()/2;&#xA;        &#xA;        // create a new array to populate and return&#xA;        String[] out = new String[spaceNeeded];&#xA;      &#xA;        // create an builder index&#xA;        int j = 0;&#xA;      &#xA;        // loop through the input string&#xA;        for (int i=0; i&amp;lt;s.length(); i++) {&#xA;          &#xA;          // create a new string to build&#xA;          StringBuilder sb = new StringBuilder();&#xA;          // add the current item&#xA;          sb.append(s.charAt(i));&#xA;          // add the next item&#xA;          sb.append(s.charAt(i+1));&#xA;          &#xA;          // populate our output string as we go&#xA;          out[j] = sb.toString();&#xA;          &#xA;          // increment both counters&#xA;          i++;&#xA;          j++;&#xA;        }&#xA;      &#xA;        // return the built string&#xA;        return out;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;A simple alternative using regular expressions:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Converting to PigLatin with Python</title>
      <link>https://andrewodendaal.com/converting-to-piglatin-with-python/</link>
      <pubDate>Sun, 09 Aug 2020 02:07:52 +0000</pubDate>
      <guid>https://andrewodendaal.com/converting-to-piglatin-with-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Move the first letter of each word to the end of it, then add &amp;ldquo;ay&amp;rdquo; to the end of the word. Leave punctuation marks untouched. This string manipulation challenge is similar to other Python exercises like &lt;a href=&#34;https://andrewodendaal.com/counting-smiley-faces-with-python&#34;&gt;counting smiley faces&lt;/a&gt; or &lt;a href=&#34;https://andrewodendaal.com/find-the-intersection-of-two-arrays-in-python&#34;&gt;finding the intersection of two arrays&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;pig_it(&amp;#39;Pig latin is cool&amp;#39;) # igPay atinlay siay oolcay&#xA;pig_it(&amp;#39;Hello world !&amp;#39;)     # elloHay orldway !&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Test.assert_equals(pig_it(&amp;#39;Pig latin is cool&amp;#39;),&amp;#39;igPay atinlay siay oolcay&amp;#39;)&#xA;Test.assert_equals(pig_it(&amp;#39;This is my string&amp;#39;),&amp;#39;hisTay siay ymay tringsay&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-write-the-code-in-python&#34;&gt;How to write the code in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def pig_it(text):&#xA;    words = text.split(&amp;#34; &amp;#34;)&#xA;    &#xA;    new_words = []&#xA;    &#xA;    for word in words:&#xA;        if word.isalpha():&#xA;            new_word = word[1:] + word[0] + &amp;#34;ay&amp;#34;&#xA;            new_words.append(new_word)&#xA;        else:&#xA;            new_words.append(word)&#xA;        &#xA;        &#xA;    return &amp;#34; &amp;#34;.join(new_words)&#xA;    &#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Solving the “Double Cola” Challenge using Java</title>
      <link>https://andrewodendaal.com/solving-the-double-cola-challenge-using-java/</link>
      <pubDate>Sat, 08 Aug 2020 02:30:24 +0000</pubDate>
      <guid>https://andrewodendaal.com/solving-the-double-cola-challenge-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a &amp;ldquo;Double Cola&amp;rdquo; drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, drinks it and doubles! The resulting two Sheldons go to the end of the queue. Then the next in the queue (Leonard) buys a can, drinks it and gets to the end of the queue as two Leonards, and so on.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Convert Seconds to Human Readable Time (HH:MM:SS) using Java</title>
      <link>https://andrewodendaal.com/convert-seconds-to-human-readable-time-hhmmss-using-java/</link>
      <pubDate>Fri, 07 Aug 2020 09:12:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/convert-seconds-to-human-readable-time-hhmmss-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function, which takes a non-negative integer (seconds) as input and returns the time in a human-readable format (&lt;code&gt;HH:MM:SS&lt;/code&gt;)&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;HH&lt;/code&gt; = hours, padded to 2 digits, range: 00 – 99&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;MM&lt;/code&gt; = minutes, padded to 2 digits, range: 00 – 59&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;SS&lt;/code&gt; = seconds, padded to 2 digits, range: 00 – 59&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The maximum time never exceeds 359999 (&lt;code&gt;99:59:59&lt;/code&gt;)&lt;/p&gt;&#xA;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertEquals;&#xA;&#xA;public class ExampleTest {&#xA;  @Test&#xA;  public void Tests() {&#xA;    assertEquals(&amp;#34;makeReadable(0)&amp;#34;, &amp;#34;00:00:00&amp;#34;, HumanReadableTime.makeReadable(0));&#xA;    assertEquals(&amp;#34;makeReadable(5)&amp;#34;, &amp;#34;00:00:05&amp;#34;, HumanReadableTime.makeReadable(5));&#xA;    assertEquals(&amp;#34;makeReadable(60)&amp;#34;, &amp;#34;00:01:00&amp;#34;, HumanReadableTime.makeReadable(60));&#xA;    assertEquals(&amp;#34;makeReadable(86399)&amp;#34;, &amp;#34;23:59:59&amp;#34;, HumanReadableTime.makeReadable(86399));&#xA;    assertEquals(&amp;#34;makeReadable(359999)&amp;#34;, &amp;#34;99:59:59&amp;#34;, HumanReadableTime.makeReadable(359999));&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class HumanReadableTime {&#xA;  public static String makeReadable(int seconds) {&#xA;    &#xA;    return String.format(&amp;#34;%02d:%02d:%02d&amp;#34;, seconds / 3600, (seconds % 3600) / 60, (seconds % 60));&#xA;    &#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Solving the “Mexican Wave” Challenge using Java</title>
      <link>https://andrewodendaal.com/solving-the-mexican-wave-challenge-using-java/</link>
      <pubDate>Thu, 06 Aug 2020 01:10:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/solving-the-mexican-wave-challenge-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;h3 id=&#34;task&#34;&gt;Task&lt;/h3&gt;&#xA;&lt;p&gt;Your task is to create a function that turns a string into a Mexican Wave. You will be passed a string and you must return that string in an array where an uppercase letter is a person standing up.&lt;/p&gt;&#xA;&lt;h3 id=&#34;rules&#34;&gt;Rules&lt;/h3&gt;&#xA;&lt;p&gt;1.  The input string will always be lowercase but may be empty.&lt;br&gt;&#xA;2.  If the character in the string is whitespace then pass over it as if it was an empty seat.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Multiples of 3 and 5 with Python</title>
      <link>https://andrewodendaal.com/multiples-of-3-and-5-with-python/</link>
      <pubDate>Wed, 05 Aug 2020 08:02:18 +0000</pubDate>
      <guid>https://andrewodendaal.com/multiples-of-3-and-5-with-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;This &lt;strong&gt;multiples of 3&lt;/strong&gt; and &lt;strong&gt;multiples of 5&lt;/strong&gt; challenge is a variation of the common &lt;a href=&#34;https://andrewodendaal.com/what-is-fizz-buzz/&#34;&gt;FizzBuzz&lt;/a&gt; question.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.&lt;/p&gt;&#xA;&lt;p&gt;Finish the solution so that it returns the sum of all the multiples of 3 or 5 &lt;strong&gt;below&lt;/strong&gt; the number passed in. This challenge requires similar modulo operations as seen in &lt;a href=&#34;https://andrewodendaal.com/how-to-divide-a-number-in-python&#34;&gt;how to divide a number in Python&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Solving the “Catching Car Mileage Numbers” Challenge using Python</title>
      <link>https://andrewodendaal.com/solving-the-catching-car-mileage-numbers-challenge-using-python/</link>
      <pubDate>Tue, 04 Aug 2020 01:08:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/solving-the-catching-car-mileage-numbers-challenge-using-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s make it so Bob &lt;strong&gt;never&lt;/strong&gt; misses another interesting number. We&amp;rsquo;ve hacked into his car&amp;rsquo;s computer, and we have a box hooked up that reads mileage numbers. We&amp;rsquo;ve got a box glued to his dash that lights up yellow or green depending on whether it receives a &lt;code&gt;1&lt;/code&gt; or a &lt;code&gt;2&lt;/code&gt; (respectively).&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s up to you, intrepid warrior, to glue the parts together. Write the function that parses the mileage number input, and returns a &lt;code&gt;2&lt;/code&gt; if the number is &amp;ldquo;interesting&amp;rdquo; (see below), a &lt;code&gt;1&lt;/code&gt; if an interesting number occurs within the next two miles, or a `` if the number is not interesting.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Counting smiley faces with Python</title>
      <link>https://andrewodendaal.com/counting-smiley-faces-with-python/</link>
      <pubDate>Mon, 03 Aug 2020 08:08:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/counting-smiley-faces-with-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array (arr) as an argument complete the function &lt;code&gt;countSmileys&lt;/code&gt; that should return the total number of smiling faces.&lt;/p&gt;&#xA;&lt;p&gt;Rules for a smiling face:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Each smiley face must contain a valid pair of eyes. Eyes can be marked as &lt;code&gt;:&lt;/code&gt; or &lt;code&gt;;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;A smiley face can have a nose but it does not have to. Valid characters for a nose are &lt;code&gt;-&lt;/code&gt; or &lt;code&gt;~&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Every smiling face must have a smiling mouth that should be marked with either &lt;code&gt;)&lt;/code&gt; or &lt;code&gt;D&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;No additional characters are allowed except for those mentioned.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Convert String to Camel Case using Java</title>
      <link>https://andrewodendaal.com/convert-string-to-camel-case-using-java/</link>
      <pubDate>Sun, 02 Aug 2020 02:00:56 +0000</pubDate>
      <guid>https://andrewodendaal.com/convert-string-to-camel-case-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Complete the method/function so that it converts dash/underscore delimited words into camel casing. The first word within the output should be capitalized &lt;strong&gt;only&lt;/strong&gt; if the original word was capitalized (known as Upper Camel Case, also often referred to as Pascal case).&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;toCamelCase(&amp;#34;the-stealth-warrior&amp;#34;); // returns &amp;#34;theStealthWarrior&amp;#34;&#xA;&#xA;toCamelCase(&amp;#34;The_Stealth_Warrior&amp;#34;); // returns &amp;#34;TheStealthWarrior&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertEquals;&#xA;import org.junit.runners.JUnit4;&#xA;&#xA;public class SolutionTest {&#xA;    @Test&#xA;    public void testSomeUnderscoreLowerStart() {&#xA;      String input = &amp;#34;the_Stealth_Warrior&amp;#34;;&#xA;      System.out.println(&amp;#34;input: &amp;#34;+input);      &#xA;      assertEquals(&amp;#34;theStealthWarrior&amp;#34;, Solution.toCamelCase(input));&#xA;    }&#xA;    @Test&#xA;    public void testSomeDashLowerStart() {&#xA;      String input = &amp;#34;the-Stealth-Warrior&amp;#34;;&#xA;      System.out.println(&amp;#34;input: &amp;#34;+input);      &#xA;      assertEquals(&amp;#34;theStealthWarrior&amp;#34;, Solution.toCamelCase(input));&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import java.lang.StringBuilder;&#xA;class Solution{&#xA;&#xA;  // Our method&#xA;  static String toCamelCase(String s){&#xA;&#xA;    // create a StringBuilder to create our output string&#xA;    StringBuilder sb = new StringBuilder();&#xA;    &#xA;    // determine when the next capital letter will be&#xA;    Boolean nextCapital = false;&#xA;&#xA;    // loop through the string&#xA;    for (int i=0; i&amp;lt;s.length(); i++) {&#xA;&#xA;      // if the current character is a letter&#xA;      if (Character.isLetter(s.charAt(i))) {&#xA;&#xA;        // get the current character&#xA;        char tmp = s.charAt(i);&#xA;&#xA;        // make it a capital if required&#xA;        if (nextCapital) tmp = Character.toUpperCase(tmp);&#xA;&#xA;        // add it to our output string&#xA;        sb.append(tmp);&#xA;&#xA;        // make sure the next character isn&amp;#39;t a capital&#xA;        nextCapital = false;&#xA;&#xA;      } else {&#xA;        // otherwise the next letter should be a capital&#xA;        nextCapital = true;&#xA;      }&#xA;    }&#xA;    &#xA;    // return our output string&#xA;    return sb.toString();&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Setup an SSH Server on AWS</title>
      <link>https://andrewodendaal.com/how-to-setup-an-ssh-server-on-aws/</link>
      <pubDate>Sat, 01 Aug 2020 09:25:48 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-setup-an-ssh-server-on-aws/</guid>
      <description>&lt;p&gt;Basic instructions on how to set up an SSH server on an Ubuntu 16.04/18.04 EC2 instance.&lt;/p&gt;&#xA;&lt;h3 id=&#34;step-1-8211-create-a-new-user&#34;&gt;&lt;strong&gt;Step 1 – Create a New User&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo adduser testuser&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;step-2-8211-create-a-directory-for-file-transfers&#34;&gt;&lt;strong&gt;Step 2 – Create a Directory for File Transfers&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo mkdir -p /var/sftp/uploads&#xA;sudo chown root:root /var/sftp&#xA;sudo chmod 755 /var/sftp&#xA;sudo chown testuser:testuser /var/sftp/uploads&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;step-3-8211-restrict-access-to-one-directory&#34;&gt;&lt;strong&gt;Step 3 – Restrict Access to One Directory&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;Open the SSH server configuration file&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo nano /etc/ssh/sshd_config&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Add the following to the bottom of the file:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Convert Numeric Words into Numbers using Python</title>
      <link>https://andrewodendaal.com/how-to-convert-numeric-words-into-numbers-using-python/</link>
      <pubDate>Fri, 31 Jul 2020 01:31:08 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-convert-numeric-words-into-numbers-using-python/</guid>
      <description>&lt;h2 id=&#34;challenge&#34;&gt;Challenge&lt;/h2&gt;&#xA;&lt;p&gt;Using Python, we want to convert words into numbers. In this challenge, we will explore how to convert a string into an integer.&lt;/p&gt;&#xA;&lt;p&gt;The strings simply represent the numbers in words. Let&amp;rsquo;s convert these words into numbers.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples:&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&amp;ldquo;one&amp;rdquo; =&amp;gt; 1&lt;/li&gt;&#xA;&lt;li&gt;&amp;ldquo;twenty&amp;rdquo; =&amp;gt; 20&lt;/li&gt;&#xA;&lt;li&gt;&amp;ldquo;two hundred forty-six&amp;rdquo; =&amp;gt; 246&lt;/li&gt;&#xA;&lt;li&gt;&amp;ldquo;seven hundred eighty-three thousand nine hundred and nineteen&amp;rdquo; =&amp;gt; 783919&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;additional-notes&#34;&gt;Additional Notes:&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The minimum number is &amp;ldquo;zero&amp;rdquo; (inclusively)&lt;/li&gt;&#xA;&lt;li&gt;The maximum number, which must be supported is 1 million (inclusively)&lt;/li&gt;&#xA;&lt;li&gt;The &amp;ldquo;and&amp;rdquo; in e.g. &amp;ldquo;one hundred and twenty-four&amp;rdquo; is optional, in some cases it&amp;rsquo;s present and in others, it&amp;rsquo;s not&lt;/li&gt;&#xA;&lt;li&gt;All tested numbers are valid, you don&amp;rsquo;t need to validate them&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;test-cases-to-convert-words-into-numbers&#34;&gt;Test cases to convert words into numbers&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Test.assert_equals(parse_int(&amp;#39;one&amp;#39;), 1)&#xA;Test.assert_equals(parse_int(&amp;#39;twenty&amp;#39;), 20)&#xA;Test.assert_equals(parse_int(&amp;#39;two hundred forty-six&amp;#39;), 246)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python-to-convert-words-into-numbers&#34;&gt;The solution in Python to convert words into numbers&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def parse_int(textnum, numwords={}):&#xA;    # create our default word-lists&#xA;    if not numwords:&#xA;&#xA;      # singles&#xA;      units = [&#xA;        &amp;#34;zero&amp;#34;, &amp;#34;one&amp;#34;, &amp;#34;two&amp;#34;, &amp;#34;three&amp;#34;, &amp;#34;four&amp;#34;, &amp;#34;five&amp;#34;, &amp;#34;six&amp;#34;, &amp;#34;seven&amp;#34;, &amp;#34;eight&amp;#34;,&#xA;        &amp;#34;nine&amp;#34;, &amp;#34;ten&amp;#34;, &amp;#34;eleven&amp;#34;, &amp;#34;twelve&amp;#34;, &amp;#34;thirteen&amp;#34;, &amp;#34;fourteen&amp;#34;, &amp;#34;fifteen&amp;#34;,&#xA;        &amp;#34;sixteen&amp;#34;, &amp;#34;seventeen&amp;#34;, &amp;#34;eighteen&amp;#34;, &amp;#34;nineteen&amp;#34;,&#xA;      ]&#xA;&#xA;      # tens&#xA;      tens = [&amp;#34;&amp;#34;, &amp;#34;&amp;#34;, &amp;#34;twenty&amp;#34;, &amp;#34;thirty&amp;#34;, &amp;#34;forty&amp;#34;, &amp;#34;fifty&amp;#34;, &amp;#34;sixty&amp;#34;, &amp;#34;seventy&amp;#34;, &amp;#34;eighty&amp;#34;, &amp;#34;ninety&amp;#34;]&#xA;&#xA;      # larger scales&#xA;      scales = [&amp;#34;hundred&amp;#34;, &amp;#34;thousand&amp;#34;, &amp;#34;million&amp;#34;, &amp;#34;billion&amp;#34;, &amp;#34;trillion&amp;#34;]&#xA;&#xA;      # divisors&#xA;      numwords[&amp;#34;and&amp;#34;] = (1, 0)&#xA;&#xA;      # perform our loops and start the swap&#xA;      for idx, word in enumerate(units):    numwords[word] = (1, idx)&#xA;      for idx, word in enumerate(tens):     numwords[word] = (1, idx * 10)&#xA;      for idx, word in enumerate(scales):   numwords[word] = (10 ** (idx * 3 or 2), 0)&#xA;&#xA;    # primary loop&#xA;    current = result = 0&#xA;    # loop while splitting to break into individual words&#xA;    for word in textnum.replace(&amp;#34;-&amp;#34;,&amp;#34; &amp;#34;).split():&#xA;        # if problem then fail-safe&#xA;        if word not in numwords:&#xA;          raise Exception(&amp;#34;Illegal word: &amp;#34; + word)&#xA;&#xA;        # use the index by the multiplier&#xA;        scale, increment = numwords[word]&#xA;        current = current * scale + increment&#xA;        &#xA;        # if larger than 100 then push for a round 2&#xA;        if scale &amp;gt; 100:&#xA;            result += current&#xA;            current = 0&#xA;&#xA;    # return the result plus the current&#xA;    return result + current&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Solve The Triangle of Odd Numbers using Python</title>
      <link>https://andrewodendaal.com/solve-the-triangle-of-odd-numbers-using-python/</link>
      <pubDate>Thu, 30 Jul 2020 08:13:12 +0000</pubDate>
      <guid>https://andrewodendaal.com/solve-the-triangle-of-odd-numbers-using-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given the triangle of consecutive odd numbers:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;             1&#xA;          3     5&#xA;       7     9    11&#xA;   13    15    17    19&#xA;21    23    25    27    29&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Calculate the row sums of this triangle from the row index (starting at index 1) e.g.:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;row_sum_odd_numbers(1); # 1&#xA;row_sum_odd_numbers(2); # 3 + 5 = 8&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Test.assert_equals(row_sum_odd_numbers(1), 1)&#xA;Test.assert_equals(row_sum_odd_numbers(2), 8)&#xA;Test.assert_equals(row_sum_odd_numbers(13), 2197)&#xA;Test.assert_equals(row_sum_odd_numbers(19), 6859)&#xA;Test.assert_equals(row_sum_odd_numbers(41), 68921)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-code&#34;&gt;The solution in code&lt;/h2&gt;&#xA;&lt;p&gt;While there are many ways to achieve this, the absolute most simple is to realise that the solution is just a &lt;code&gt;n^3&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>“Who likes it” code Challenge in Python</title>
      <link>https://andrewodendaal.com/who-likes-it-code-challenge-in-python/</link>
      <pubDate>Wed, 29 Jul 2020 08:43:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/who-likes-it-code-challenge-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The Challenge&lt;/h2&gt;&#xA;&lt;p&gt;You probably know the &amp;ldquo;like&amp;rdquo; system from Facebook and other pages. People can &amp;ldquo;like&amp;rdquo; blog posts, pictures or other items. We want to create the text that should be displayed next to such an item.&lt;/p&gt;&#xA;&lt;p&gt;Implement a function &lt;code&gt;likes :: [String] -&amp;gt; String&lt;/code&gt;, which must take in input array, containing the names of people who like an item. It must return the display text as shown in the examples:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Python 4 New Features Planned</title>
      <link>https://andrewodendaal.com/python-4-new-features-planned/</link>
      <pubDate>Tue, 28 Jul 2020 01:24:52 +0000</pubDate>
      <guid>https://andrewodendaal.com/python-4-new-features-planned/</guid>
      <description>&lt;p&gt;It took the Python community a long time to move from Python 2 to Python 3. Now as we approach the possible end of Python 3 version history, we are approaching a potential Python 4.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-to-expect-in-python-4&#34;&gt;What to expect in Python 4&lt;/h2&gt;&#xA;&lt;p&gt;Other than Python version 4 being mentioned in the PEP documentation, there is currently no formal writeup of the Python 4 feature-set.&lt;/p&gt;&#xA;&lt;p&gt;Therefore we have to either believe that it will be the next version after 3.9, and will simply become 3.10. Otherwise it will fall back to version 4.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Custom RGB To Hex Conversion with Python</title>
      <link>https://andrewodendaal.com/custom-rgb-to-hex-conversion-with-python/</link>
      <pubDate>Mon, 27 Jul 2020 01:06:46 +0000</pubDate>
      <guid>https://andrewodendaal.com/custom-rgb-to-hex-conversion-with-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;The rgb function is incomplete. Complete it so that passing in RGB decimal values will result in a hexadecimal representation being returned. Valid decimal values for RGB are 0 – 255. Any values that fall out of that range must be rounded to the closest valid value.&lt;/p&gt;&#xA;&lt;p&gt;Note: Your answer should always be 6 characters long, the shorthand with 3 will not work here.&lt;/p&gt;&#xA;&lt;p&gt;The following are examples of expected output values:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sort a Java Integer in Descending Order</title>
      <link>https://andrewodendaal.com/sort-a-java-integer-in-descending-order/</link>
      <pubDate>Sun, 26 Jul 2020 02:55:42 +0000</pubDate>
      <guid>https://andrewodendaal.com/sort-a-java-integer-in-descending-order/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Your task is to make a function that can take any non-negative integer as an argument and return it with its digits in descending order. Essentially, rearrange the digits to create the highest possible number.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples:&lt;/h3&gt;&#xA;&lt;p&gt;Input: &lt;code&gt;42145&lt;/code&gt; Output: &lt;code&gt;54421&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Input: &lt;code&gt;145263&lt;/code&gt; Output: &lt;code&gt;654321&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Input: &lt;code&gt;123456789&lt;/code&gt; Output: &lt;code&gt;987654321&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertEquals;&#xA;&#xA;public class DescendingOrderTest {&#xA;&#xA;    @Test&#xA;    public void test_01() {&#xA;        assertEquals(0, DescendingOrder.sortDesc(0));&#xA;    }    &#xA;&#xA;    @Test&#xA;    public void test_02() {&#xA;        assertEquals(51, DescendingOrder.sortDesc(15));&#xA;    }&#xA;    &#xA;    @Test&#xA;    public void test_03() {&#xA;        assertEquals(987654321, DescendingOrder.sortDesc(123456789));&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class DescendingOrder {&#xA;  public static int sortDesc(final int num) {&#xA;    &#xA;    // return if a negative number&#xA;    if (num&amp;lt;0) return num;&#xA;    &#xA;    // our number we will return&#xA;    int sortedNumber = 0;&#xA;    &#xA;    // loop with a maximum number int&#xA;    // perform loop in reverse&#xA;    for (int i = 9; i &amp;gt;= 0; i--) {&#xA;        // set a local number variable&#xA;        int tmpNumber = num;&#xA;        // while greater than 0&#xA;        while (tmpNumber &amp;gt; 0) {&#xA;            // get the digit&#xA;            int digit = tmpNumber % 10;&#xA;            // check for the greatest digit in the given number&#xA;            if (digit == i) {&#xA;                // build the sortedNumber value&#xA;                sortedNumber *= 10;&#xA;                sortedNumber += digit;&#xA;            }&#xA;            // reduce the loop variable&#xA;            tmpNumber /= 10;&#xA;        }&#xA;    }&#xA;    // return our sorted number&#xA;    return sortedNumber;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Get the Sum of Digits / Digital Root using Java</title>
      <link>https://andrewodendaal.com/get-the-sum-of-digits-digital-root-using-java/</link>
      <pubDate>Sat, 25 Jul 2020 00:40:19 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-the-sum-of-digits-digital-root-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Digital root&lt;!-- raw HTML omitted --&gt; is the &lt;em&gt;recursive sum of all the digits in a number.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Given &lt;code&gt;n&lt;/code&gt;, take the sum of the digits of &lt;code&gt;n&lt;/code&gt;. If that value has more than one digit, continue reducing in this way until a single-digit number is produced. This is only applicable to the natural numbers.&lt;/p&gt;&#xA;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;    16  --&amp;gt;  1 + 6 = 7&#xA;   942  --&amp;gt;  9 + 4 + 2 = 15  --&amp;gt;  1 + 5 = 6&#xA;132189  --&amp;gt;  1 + 3 + 2 + 1 + 8 + 9 = 24  --&amp;gt;  2 + 4 = 6&#xA;493193  --&amp;gt;  4 + 9 + 3 + 1 + 9 + 3 = 29  --&amp;gt;  2 + 9 = 11  --&amp;gt;  1 + 1 = 2&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;tests-cases&#34;&gt;Tests cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import org.junit.Test;&#xA;import static org.junit.Assert.assertEquals;&#xA;&#xA;public class DRootExampleTest {&#xA;    @Test&#xA;    public void Tests() {&#xA;      assertEquals( &amp;#34;Nope!&amp;#34; , 7, DRoot.digital_root(16));&#xA;      assertEquals( &amp;#34;Nope!&amp;#34; , 6, DRoot.digital_root(456));&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public class DRoot {&#xA;  public static int digital_root(int n) {&#xA;    &#xA;    // return the number if less than 10&#xA;    // this is to break out of the recursion loop&#xA;    if (n&amp;lt;10) return n;&#xA;    &#xA;    // set an output variable&#xA;    int out = 0;&#xA;    &#xA;    // while we still have numbers, loop&#xA;    while(n&amp;gt;0) {&#xA;      // increment our output by the base&#xA;      out += n % 10;&#xA;      // reduce the base by the same amount&#xA;      n = n / 10;&#xA;    }&#xA;  &#xA;    // return a recursion of the output&#xA;    return digital_root(out);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to write a Chain Adding Function in Python</title>
      <link>https://andrewodendaal.com/how-to-write-a-chain-adding-function-in-python/</link>
      <pubDate>Fri, 24 Jul 2020 01:00:20 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-write-a-chain-adding-function-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;We want to create a function that will add numbers together when called in succession.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;add(1)(2);&#xA;# returns 3&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We also want to be able to continue to add numbers to our chain.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;add(1)(2)(3) # 6&#xA;add(1)(2)(3)(4) # 10&#xA;add(1)(2)(3)(4)(5) # 15&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;and so on.&lt;/p&gt;&#xA;&lt;p&gt;A single call should return the number passed in.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;add(1); # 1&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We should be able to store the returned values and reuse them.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;addTwo = add(2)&#xA;addTwo # 2&#xA;addTwo + 5 # 7&#xA;addTwo(3) # 5&#xA;addTwo(3)(5) # 10&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We can assume any number being passed in will be valid whole number.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Get the next biggest number with the same digits using Python</title>
      <link>https://andrewodendaal.com/get-the-next-biggest-number-with-the-same-digits-using-python/</link>
      <pubDate>Thu, 23 Jul 2020 01:38:03 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-the-next-biggest-number-with-the-same-digits-using-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Create a function that takes a positive integer and returns the next bigger number that can be formed by rearranging its digits. For example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;12 ==&amp;gt; 21&#xA;513 ==&amp;gt; 531&#xA;2017 ==&amp;gt; 2071&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;nextBigger(num: 12)   # returns 21&#xA;nextBigger(num: 513)  # returns 531&#xA;nextBigger(num: 2017) # returns 2071&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If the digits can&amp;rsquo;t be rearranged to form a bigger number, return &lt;code&gt;-1&lt;/code&gt; (or &lt;code&gt;nil&lt;/code&gt; in Swift):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;9 ==&amp;gt; -1&#xA;111 ==&amp;gt; -1&#xA;531 ==&amp;gt; -1&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;nextBigger(num: 9)   # returns nil&#xA;nextBigger(num: 111) # returns nil&#xA;nextBigger(num: 531) # returns nil&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Test.assert_equals(next_bigger(12),21)&#xA;Test.assert_equals(next_bigger(513),531)&#xA;Test.assert_equals(next_bigger(2017),2071)&#xA;Test.assert_equals(next_bigger(414),441)&#xA;Test.assert_equals(next_bigger(144),414)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python&#34;&gt;The solution in Python&lt;/h2&gt;&#xA;&lt;p&gt;This problem requires careful manipulation of digits and arrays, similar to other Python challenges like &lt;a href=&#34;https://andrewodendaal.com/find-the-intersection-of-two-arrays-in-python&#34;&gt;finding the intersection of two arrays&lt;/a&gt; or &lt;a href=&#34;https://andrewodendaal.com/how-to-get-the-last-element-of-a-list-in-python&#34;&gt;getting the last element of a list&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Solving Tribonacci Sequence with Python</title>
      <link>https://andrewodendaal.com/solving-tribonacci-sequence-with-python/</link>
      <pubDate>Wed, 22 Jul 2020 00:48:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/solving-tribonacci-sequence-with-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;As the name may already reveal, it works basically like a Fibonacci, but summing the last 3 (instead of 2) numbers of the sequence to generate the next.&lt;/p&gt;&#xA;&lt;p&gt;So, if we are to start our Tribonacci sequence with &lt;code&gt;[1, 1, 1]&lt;/code&gt; as a starting input (AKA &lt;em&gt;signature&lt;/em&gt;), we have this sequence:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[1, 1 ,1, 3, 5, 9, 17, 31, ...]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;But what if we started with &lt;code&gt;[0, 0, 1]&lt;/code&gt; as a signature? As starting with &lt;code&gt;[0, 1]&lt;/code&gt; instead of &lt;code&gt;[1, 1]&lt;/code&gt; basically &lt;em&gt;shifts&lt;/em&gt; the common Fibonacci sequence by once place, you may be tempted to think that we would get the same sequence shifted by 2 places, but that is not the case and we would get:&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Casino Chips Problem Solved with Python</title>
      <link>https://andrewodendaal.com/the-casino-chips-problem-solved-with-python/</link>
      <pubDate>Tue, 21 Jul 2020 10:46:55 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-casino-chips-problem-solved-with-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given three piles of casino chips: white, green and black chips:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the first pile contains only white chips&lt;/li&gt;&#xA;&lt;li&gt;the second pile contains only green chips&lt;/li&gt;&#xA;&lt;li&gt;the third pile contains only black chips&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Each day you take exactly two chips of different colors and head to the casino. You can chose any color, but you are not allowed to take two chips of the same color in a day.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Check if Isogram using Python</title>
      <link>https://andrewodendaal.com/check-if-isogram-using-python/</link>
      <pubDate>Mon, 20 Jul 2020 08:20:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/check-if-isogram-using-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;An isogram is a word that has no repeating letters, consecutive or non-consecutive. Implement a function that determines whether a string that contains only letters is an isogram. Assume the empty string is an isogram. Ignore letter case.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;is_isogram(&amp;#34;Dermatoglyphics&amp;#34; ) == true&#xA;is_isogram(&amp;#34;aba&amp;#34; ) == false&#xA;is_isogram(&amp;#34;moOse&amp;#34; ) == false # -- ignore letter case&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;test-cases&#34;&gt;Test cases&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Test.assert_equals(is_isogram(&amp;#34;Dermatoglyphics&amp;#34;), True )&#xA;Test.assert_equals(is_isogram(&amp;#34;isogram&amp;#34;), True )&#xA;Test.assert_equals(is_isogram(&amp;#34;aba&amp;#34;), False, &amp;#34;same chars may not be adjacent&amp;#34; )&#xA;Test.assert_equals(is_isogram(&amp;#34;moOse&amp;#34;), False, &amp;#34;same chars may not be same case&amp;#34; )&#xA;Test.assert_equals(is_isogram(&amp;#34;isIsogram&amp;#34;), False )&#xA;Test.assert_equals(is_isogram(&amp;#34;&amp;#34;), True, &amp;#34;an empty string is a valid isogram&amp;#34; )&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-solution-in-python&#34;&gt;The solution in Python&lt;/h2&gt;&#xA;&lt;p&gt;First pass, using a dictionary (&lt;code&gt;dict&lt;/code&gt;):&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find the Longest Common Prefix using Python</title>
      <link>https://andrewodendaal.com/find-the-longest-common-prefix-using-python/</link>
      <pubDate>Sun, 19 Jul 2020 11:33:31 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-longest-common-prefix-using-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function to find the longest common prefix string amongst an array of strings. This string manipulation challenge requires careful handling of arrays, similar to &lt;a href=&#34;https://andrewodendaal.com/how-to-get-the-last-element-of-a-list-in-python&#34;&gt;getting the last element of a list in Python&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;If there is no common prefix, return an empty string &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt;. For more Python string challenges, you might also be interested in &lt;a href=&#34;https://andrewodendaal.com/converting-to-piglatin-with-python&#34;&gt;converting to PigLatin&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Count and Say with Python</title>
      <link>https://andrewodendaal.com/count-and-say-with-python/</link>
      <pubDate>Sat, 18 Jul 2020 13:29:25 +0000</pubDate>
      <guid>https://andrewodendaal.com/count-and-say-with-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;he count-and-say sequence is the sequence of integers with the first five terms as following:&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;code&gt;1&lt;/code&gt; is read off as &lt;code&gt;&amp;quot;one 1&amp;quot;&lt;/code&gt; or &lt;code&gt;11&lt;/code&gt;.&lt;br&gt;&#xA;&lt;code&gt;11&lt;/code&gt; is read off as &lt;code&gt;&amp;quot;two 1s&amp;quot;&lt;/code&gt; or &lt;code&gt;21&lt;/code&gt;.&lt;br&gt;&#xA;&lt;code&gt;21&lt;/code&gt; is read off as &lt;code&gt;&amp;quot;one 2&lt;/code&gt;, then &lt;code&gt;one 1&amp;quot;&lt;/code&gt; or &lt;code&gt;1211&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Given an integer &lt;em&gt;n&lt;/em&gt; where 1 ≤ &lt;em&gt;n&lt;/em&gt; ≤ 30, generate the &lt;em&gt;n&lt;/em&gt;&lt;!-- raw HTML omitted --&gt;th&lt;!-- raw HTML omitted --&gt; term of the count-and-say sequence. You can do so recursively, in other words from the previous member read off the digits, counting the number of digits in groups of the same digit.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Plus One problem solved with Python</title>
      <link>https://andrewodendaal.com/the-plus-one-problem-solved-with-python/</link>
      <pubDate>Fri, 17 Jul 2020 01:42:40 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-plus-one-problem-solved-with-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a &lt;strong&gt;non-empty&lt;/strong&gt; array of digits representing a non-negative integer, increment one to the integer. This challenge involves array manipulation similar to &lt;a href=&#34;https://andrewodendaal.com/find-the-intersection-of-two-arrays-in-python&#34;&gt;finding the intersection of two arrays&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The digits are stored such that the most significant digit is at the head of the list, and each element in the array contains a single digit. For more Python array challenges, you might also be interested in &lt;a href=&#34;https://andrewodendaal.com/how-to-get-the-last-element-of-a-list-in-python&#34;&gt;getting the last element of a list&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Solving the Single Number problem in Python</title>
      <link>https://andrewodendaal.com/solving-the-single-number-problem-in-python/</link>
      <pubDate>Thu, 16 Jul 2020 10:48:05 +0000</pubDate>
      <guid>https://andrewodendaal.com/solving-the-single-number-problem-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a &lt;strong&gt;non-empty&lt;/strong&gt; array of integers, every element appears &lt;em&gt;twice&lt;/em&gt; except for one. Find that single one.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python&#34;&gt;The solution in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def singleNumber(nums):&#xA;    # create a dictionary/hashmap&#xA;    found = {}&#xA;&#xA;    # loop through the nums&#xA;    for i in nums:&#xA;        # add to map if not found&#xA;        if i not in found:&#xA;            found[i] = i&#xA;        else:&#xA;            # otherwise remove it&#xA;            del found[i]&#xA;&#xA;    # loop through the found map and return the first item&#xA;    for i in found:&#xA;        return i&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Rotate a Matrix List in Python</title>
      <link>https://andrewodendaal.com/rotate-a-matrix-list-in-python/</link>
      <pubDate>Wed, 15 Jul 2020 10:13:19 +0000</pubDate>
      <guid>https://andrewodendaal.com/rotate-a-matrix-list-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;You are given an &lt;em&gt;n&lt;/em&gt; x &lt;em&gt;n&lt;/em&gt; 2D matrix representing an image.&lt;/p&gt;&#xA;&lt;p&gt;Rotate the image by 90 degrees (clockwise).&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;You have to rotate the image &lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;in-place&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;, which means you have to modify the input 2D matrix directly. &lt;strong&gt;DO NOT&lt;/strong&gt; allocate another 2D matrix and do the rotation.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Check if Valid Sudoku Blocks in Java</title>
      <link>https://andrewodendaal.com/check-if-valid-sudoku-blocks-in-java/</link>
      <pubDate>Tue, 14 Jul 2020 09:10:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/check-if-valid-sudoku-blocks-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge-of-solving-valid-sudoku-blocks&#34;&gt;The challenge of solving valid Sudoku blocks&lt;/h2&gt;&#xA;&lt;p&gt;Determine if a 9×9 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;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Each row must contain the digits &lt;code&gt;1-9&lt;/code&gt; without repetition.&lt;/li&gt;&#xA;&lt;li&gt;Each column must contain the digits &lt;code&gt;1-9&lt;/code&gt; without repetition.&lt;/li&gt;&#xA;&lt;li&gt;Each of the 9 &lt;code&gt;3x3&lt;/code&gt; sub-boxes of the grid must contain the digits &lt;code&gt;1-9&lt;/code&gt; without repetition.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/Sudoku-by-L2G-20050714.svg.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;(A partially filled sudoku which is valid.)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find the Intersection of Two Arrays in Python</title>
      <link>https://andrewodendaal.com/find-the-intersection-of-two-arrays-in-python/</link>
      <pubDate>Mon, 13 Jul 2020 09:21:27 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-intersection-of-two-arrays-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given two arrays, write a function to compute their intersection.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Each element in the result should appear as many times as it shows in both arrays.&lt;/li&gt;&#xA;&lt;li&gt;The result can be in any order.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;This is a common array manipulation problem that&amp;rsquo;s similar to other Python challenges like &lt;a href=&#34;https://andrewodendaal.com/counting-smiley-faces-with-python&#34;&gt;counting smiley faces&lt;/a&gt; or &lt;a href=&#34;https://andrewodendaal.com/get-the-next-biggest-number-with-the-same-digits-using-python&#34;&gt;getting the next biggest number with the same digits&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rotate an Array K Times in Python</title>
      <link>https://andrewodendaal.com/rotate-an-array-k-times-in-python/</link>
      <pubDate>Sun, 12 Jul 2020 13:58:50 +0000</pubDate>
      <guid>https://andrewodendaal.com/rotate-an-array-k-times-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array, rotate the array to the right by &lt;em&gt;k&lt;/em&gt; steps, where &lt;em&gt;k&lt;/em&gt; is non-negative.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Constraints:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;1 &amp;lt;= nums.length &amp;lt;= 2 * 10^4&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;It&amp;rsquo;s guaranteed that &lt;code&gt;nums[i]&lt;/code&gt; fits in a 32 bit-signed integer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;k &amp;gt;= 0&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python&#34;&gt;The solution in Python&lt;/h2&gt;&#xA;&lt;p&gt;Option 1 could be as follows:&lt;/p&gt;</description>
    </item>
    <item>
      <title>FizzBuzz in Java</title>
      <link>https://andrewodendaal.com/fizzbuzz-in-java/</link>
      <pubDate>Sat, 11 Jul 2020 00:07:41 +0000</pubDate>
      <guid>https://andrewodendaal.com/fizzbuzz-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a program that outputs the string representation of numbers from 1 to &lt;em&gt;n&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”. For numbers which are multiples of both three and five output “FizzBuzz”.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;    public List&amp;lt;String&amp;gt; fizzBuzz(int n) {&#xA;        List&amp;lt;String&amp;gt; l = new ArrayList&amp;lt;&amp;gt;();&#xA;        &#xA;        for (int i=1; i&amp;lt;=n; i++) {&#xA;            if (i%3==0 &amp;amp;&amp;amp; i%5==0) {&#xA;              l.add(&amp;#34;FizzBuzz&amp;#34;);  &#xA;            } else if (i%3==0) {&#xA;                l.add(&amp;#34;Fizz&amp;#34;);&#xA;            } else if (i%5==0) {&#xA;                l.add(&amp;#34;Buzz&amp;#34;);&#xA;            } else {&#xA;                l.add(&amp;#34;&amp;#34;+i);&#xA;            }&#xA;        }&#xA;        &#xA;        return l;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Python Splices reimplemented in Java</title>
      <link>https://andrewodendaal.com/python-splices-reimplemented-in-java/</link>
      <pubDate>Fri, 10 Jul 2020 10:58:26 +0000</pubDate>
      <guid>https://andrewodendaal.com/python-splices-reimplemented-in-java/</guid>
      <description>&lt;p&gt;Python has a fantastic feature called &lt;code&gt;slices&lt;/code&gt;. It allows you to work with a &lt;code&gt;list&lt;/code&gt;, &lt;code&gt;set&lt;/code&gt; or &lt;code&gt;string&lt;/code&gt; by it&amp;rsquo;s index items.&lt;/p&gt;&#xA;&lt;p&gt;E.g.:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;string_sample = &amp;#34;hello world&amp;#34;&#xA;&#xA;string_sample[:-1]&#xA;&amp;gt;&amp;gt;&amp;gt; &amp;#34;hello worl&amp;#34;&#xA;&#xA;string_sample[-1]&#xA;&amp;gt;&amp;gt;&amp;gt; &amp;#34;d&amp;#34;&#xA;&#xA;string_sample[3]&#xA;&amp;gt;&amp;gt;&amp;gt; &amp;#34;l&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can also do things like:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;string_sample[3:5]&#xA;&amp;gt;&amp;gt;&amp;gt; &amp;#39;lo&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Or even in reverse!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;string_sample[::-1]&#xA;&amp;gt;&amp;gt;&amp;gt; &amp;#39;dlrow olleh&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;a-possible-java-implementation&#34;&gt;A possible Java implementation&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;public String slice_start(String s, int startIndex) {&#xA;    if (startIndex &amp;lt; 0) startIndex = s.length() + startIndex;&#xA;    return s.substring(startIndex);&#xA;}&#xA;&#xA;public String slice_end(String s, int endIndex) {&#xA;    if (endIndex &amp;lt; 0) endIndex = s.length() + endIndex;&#xA;    return s.substring(0, endIndex);&#xA;}&#xA;&#xA;public String slice_range(String s, int startIndex, int endIndex) {&#xA;    if (startIndex &amp;lt; 0) startIndex = s.length() + startIndex;&#xA;    if (endIndex &amp;lt; 0) endIndex = s.length() + endIndex;&#xA;    return s.substring(startIndex, endIndex);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Solving Two Sum in Python</title>
      <link>https://andrewodendaal.com/solving-two-sum-in-python/</link>
      <pubDate>Thu, 09 Jul 2020 10:47:06 +0000</pubDate>
      <guid>https://andrewodendaal.com/solving-two-sum-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of integers, return &lt;strong&gt;indices&lt;/strong&gt; of the two numbers such that they add up to a specific target.&lt;/p&gt;&#xA;&lt;p&gt;You may assume that each input would have &lt;strong&gt;&lt;em&gt;exactly&lt;/em&gt;&lt;/strong&gt; one solution, and you may not use the &lt;em&gt;same&lt;/em&gt; element twice.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;the-solution-in-python&#34;&gt;The solution in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution:&#xA;    def twoSum(self, nums: List[int], target: int) -&amp;gt; List[int]:&#xA;        # keep a hashmap of items found&#xA;        seen = {}&#xA;        &#xA;        # loop through the nums, with int and value&#xA;        for i, v in enumerate(nums):&#xA;            # set remaining to the target minus the value&#xA;            remaining = target - v&#xA;            # check if the new value is in the hashmap&#xA;            if remaining in seen:&#xA;                # return it and the index&#xA;                return [seen[remaining], i]&#xA;            # otherwise, put it on the map instead&#xA;            seen[v] = i&#xA;        &#xA;        # nothing found, return an empty list&#xA;        return []&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Get the Next Small Integer in Python</title>
      <link>https://andrewodendaal.com/get-the-next-small-integer-in-python/</link>
      <pubDate>Wed, 08 Jul 2020 08:58:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-the-next-small-integer-in-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;def solution(A)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A.&lt;/p&gt;&#xA;&lt;p&gt;For example, given &lt;code&gt;A = [1, 3, 6, 4, 1, 2]&lt;/code&gt;, the function should return 5.&lt;/p&gt;&#xA;&lt;p&gt;Given &lt;code&gt;A = [1, 2, 3]&lt;/code&gt;, the function should return 4.&lt;/p&gt;&#xA;&lt;p&gt;Given &lt;code&gt;A = [−1, −3]&lt;/code&gt;, the function should return 1.&lt;/p&gt;&#xA;&lt;p&gt;Write an &lt;strong&gt;efficient&lt;/strong&gt; algorithm for the following assumptions:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Is a Valid Palindrome with Java</title>
      <link>https://andrewodendaal.com/is-a-valid-palindrome-with-java/</link>
      <pubDate>Tue, 07 Jul 2020 09:54:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/is-a-valid-palindrome-with-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; For the purpose of this problem, we define empty string as valid palindrome.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Constraints:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;s&lt;/code&gt; consists only of printable ASCII characters.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution-in-java&#34;&gt;The solution in Java&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;    // take in a String&#xA;    public boolean isPalindrome(String s) {&#xA;        &#xA;        // remove all non-alphanumeric characters and lowercase everything&#xA;        s = s.replaceAll(&amp;#34;\\P{Alnum}&amp;#34;, &amp;#34;&amp;#34;).toLowerCase();&#xA;        &#xA;        // loop through the String&#xA;        for (int i=0; i&amp;lt;s.length(); i++) {&#xA;            // if the beginning and last characters don&amp;#39;t match, return false&#xA;            // also walk in both directions and do the same&#xA;            if (s.charAt(i)!=s.charAt(s.length()-i-1))&#xA;                return false;&#xA;        }&#xA;        &#xA;        // return true if we get here&#xA;        return true;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Is a Valid Anagram with Java</title>
      <link>https://andrewodendaal.com/is-a-valid-anagram-with-java/</link>
      <pubDate>Mon, 06 Jul 2020 11:15:24 +0000</pubDate>
      <guid>https://andrewodendaal.com/is-a-valid-anagram-with-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given two strings &lt;em&gt;s&lt;/em&gt; and &lt;em&gt;t &lt;/em&gt;, write a function to determine if &lt;em&gt;t&lt;/em&gt; is an anagram of &lt;em&gt;s&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;br&gt;&#xA;You may assume the string contains only lowercase alphabets.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Follow up:&lt;/strong&gt;&lt;br&gt;&#xA;What if the inputs contain Unicode characters? How would you adapt your solution to such a case?&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to ReImplement strStr() in Java</title>
      <link>https://andrewodendaal.com/how-to-reimplement-strstr-in-java/</link>
      <pubDate>Sun, 05 Jul 2020 11:12:40 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reimplement-strstr-in-java/</guid>
      <description>&lt;h2 id=&#34;what-we-want-to-achieve&#34;&gt;What we want to achieve&lt;/h2&gt;&#xA;&lt;p&gt;Return the index of the first occurrence of needle in haystack, or &lt;strong&gt;-1&lt;/strong&gt; if needle is not part of haystack.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;how-to-code-this&#34;&gt;How to code this&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;    public int strStr(String haystack, String needle) {&#xA;        // If needle is an empty string&#xA;        if (needle.isEmpty()) return 0;&#xA;&#xA;        // If the needle is not within the haystack&#xA;        if (!haystack.contains(needle)) return -1;&#xA;&#xA;        // declare an index and the needle&amp;#39;s length&#xA;        int index = 0;&#xA;        int len = needle.length();&#xA;        &#xA;        // loop through the hackstack minus the needle&amp;#39;s length&#xA;        for (int i = 0; i &amp;lt;= haystack.length() - len; i++) {&#xA;            // compare the needle with the hackstack new string&#xA;            // created from using substring, start-&amp;gt;end&#xA;            if (haystack.substring(i, i + len).equals(needle)) {&#xA;                // set the index and exit&#xA;                index = i;&#xA;                break;&#xA;            }&#xA;        }&#xA;        return index;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Third Maximum Number with Java</title>
      <link>https://andrewodendaal.com/third-maximum-number-with-java/</link>
      <pubDate>Sat, 04 Jul 2020 13:50:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/third-maximum-number-with-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a &lt;strong&gt;non-empty&lt;/strong&gt; array of integers, return the &lt;strong&gt;third&lt;/strong&gt; maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n).&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 3:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;the-solution&#34;&gt;The solution&lt;/h2&gt;&#xA;&lt;p&gt;I have seen many possible resolutions to this problem, but my favourite has to be the following:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Quickly Hide all Icons on a Mac’s Desktop</title>
      <link>https://andrewodendaal.com/how-to-quickly-hide-all-icons-on-a-macs-desktop/</link>
      <pubDate>Fri, 03 Jul 2020 09:18:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-quickly-hide-all-icons-on-a-macs-desktop/</guid>
      <description>&lt;h2 id=&#34;why-the-need-to-hide-icons&#34;&gt;Why the need to hide icons?&lt;/h2&gt;&#xA;&lt;p&gt;Perhaps you have a &lt;code&gt;screen-share session&lt;/code&gt; coming up and you want a nice clean desktop to show everyone. Also, nobody will see all your funny files and folders as they wait for you.&lt;/p&gt;&#xA;&lt;p&gt;Just open the &lt;code&gt;Terminal&lt;/code&gt; and enter the following to hide all icons:&lt;/p&gt;&#xA;&lt;p&gt;If you&amp;rsquo;re not familiar with the &lt;code&gt;Terminal&lt;/code&gt;; it is a Mac application that allows you to enter commands like the ones below, to enable and disable advanced features, among other things.&lt;/p&gt;</description>
    </item>
    <item>
      <title>First Unique Character in a String using Java</title>
      <link>https://andrewodendaal.com/first-unique-character-in-a-string-using-java/</link>
      <pubDate>Thu, 02 Jul 2020 02:04:22 +0000</pubDate>
      <guid>https://andrewodendaal.com/first-unique-character-in-a-string-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a string, find the first non-repeating character in it and return its index. If it doesn&amp;rsquo;t exist, return -1.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; You may assume the string contains only lowercase English letters.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-solution&#34;&gt;The solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;    // take in a String and return an int containing the index&#xA;    public int firstUniqChar(String s) {&#xA;        // create a HashMap to hold our counts&#xA;        HashMap&amp;lt;Character, Integer&amp;gt; h = new HashMap&amp;lt;&amp;gt;();&#xA;        // get the string&amp;#39;s length&#xA;        int len = s.length();&#xA;        &#xA;        // loop to populate the HashMap&#xA;        for(int i=0; i&amp;lt;len; i++) {&#xA;            // get the Character&#xA;            char c = s.charAt(i);&#xA;            // add or update HashMap entry&#xA;            h.put(c, h.getOrDefault(c, 0)+1);&#xA;        }&#xA;        &#xA;        // loop to look for non-duplicates&#xA;        for(int i=0; i&amp;lt;len; i++) {&#xA;            // get the Character&#xA;            char c = s.charAt(i);&#xA;            // if only have 1 item, then we found our match&#xA;            if (h.get(c)==1)&#xA;                return i;&#xA;        }&#xA;        &#xA;        // return -1 if all else fails&#xA;        return -1;&#xA;        &#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to fix the Release Version 5 Not Supported error in IntelliJ</title>
      <link>https://andrewodendaal.com/how-to-fix-the-release-version-5-not-supported-error-in-intellij/</link>
      <pubDate>Wed, 01 Jul 2020 01:19:11 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-fix-the-release-version-5-not-supported-error-in-intellij/</guid>
      <description>&lt;p&gt;What do you do when you create a new Maven Java project, and when you run it, you get the following error:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Error:java: error: release version 5 not supported&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Sometimes the error could also read as follows:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;java: Source option 5 is no longer supported. Use 6 or later.&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Luckily for us, the solution is exactly the same!&lt;/p&gt;&#xA;&lt;h2 id=&#34;solution&#34;&gt;Solution&lt;/h2&gt;&#xA;&lt;p&gt;Open the project&amp;rsquo;s &lt;code&gt;pom.xml&lt;/code&gt; file and add the following snippet:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;properties&amp;gt;&#xA;    &amp;lt;maven.compiler.source&amp;gt;1.8&amp;lt;/maven.compiler.source&amp;gt;&#xA;    &amp;lt;maven.compiler.target&amp;gt;1.8&amp;lt;/maven.compiler.target&amp;gt;&#xA;&amp;lt;/properties&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now open the Maven side-panel, and click the &lt;code&gt;Report All Maven Projects&lt;/code&gt; button.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Facebook’s custom IPv6 range</title>
      <link>https://andrewodendaal.com/facebooks-custom-ipv6-range/</link>
      <pubDate>Tue, 30 Jun 2020 10:51:21 +0000</pubDate>
      <guid>https://andrewodendaal.com/facebooks-custom-ipv6-range/</guid>
      <description>&lt;p&gt;I noticed an interesting thing with a certain visitor after posting a blog post to &lt;!-- raw HTML omitted --&gt;Facebook&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The IP address that the Facebook crawler uses to visit the site on callback to get meta-data has a custom IPv6 sub-range.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;IPv6: 2a03:2880:ff:1a::face:b00c&#xA;Host: fwdproxy-prn-026.fbsv.net&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Notice &lt;code&gt;2a03:2880:ff:1a::&amp;lt;strong&amp;gt;face:b00c&amp;lt;/strong&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-this-is-done&#34;&gt;How this is done&lt;/h2&gt;&#xA;&lt;p&gt;The IPv4 addresses could only use regular integers (decimal); numbers between 0 and 9.&lt;/p&gt;&#xA;&lt;p&gt;However, IPv6 can use any and all hexadecimal; 0-9 and a-f.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Reverse an Integer in Java</title>
      <link>https://andrewodendaal.com/how-to-reverse-an-integer-in-java/</link>
      <pubDate>Mon, 29 Jun 2020 01:02:18 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reverse-an-integer-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given a 32-bit signed integer, reverse digits of an integer.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 3:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;br&gt;&#xA;Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: [−2&lt;!-- raw HTML omitted --&gt;31&lt;!-- raw HTML omitted --&gt;,  2&lt;!-- raw HTML omitted --&gt;31 &lt;!-- raw HTML omitted --&gt;− 1]. For the purpose of this problem, assume that your function returns 0 when the reversed integer overflows.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Reverse a String in-place using Java</title>
      <link>https://andrewodendaal.com/reverse-a-string-in-place-using-java/</link>
      <pubDate>Sun, 28 Jun 2020 11:02:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/reverse-a-string-in-place-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Write a function that reverses a string. The input string is given as an array of characters &lt;code&gt;char[]&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Do not allocate extra space for another array, you must do this by &lt;strong&gt;modifying the input array &lt;!-- raw HTML omitted --&gt;in-place&lt;!-- raw HTML omitted --&gt;&lt;/strong&gt; with O(1) extra memory.&lt;/p&gt;&#xA;&lt;p&gt;You may assume all the characters consist of &lt;!-- raw HTML omitted --&gt;printable ascii characters&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Check if a Java array Contains Duplicates</title>
      <link>https://andrewodendaal.com/check-if-a-java-array-contains-duplicates/</link>
      <pubDate>Sat, 27 Jun 2020 10:03:55 +0000</pubDate>
      <guid>https://andrewodendaal.com/check-if-a-java-array-contains-duplicates/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of integers, find if the array contains any duplicates.&lt;/p&gt;&#xA;&lt;p&gt;Your function should return true if any value appears at least twice in the array, and it should return false if every element is distinct.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 3:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;the-solution&#34;&gt;The solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;    // return a boolean from the primitive int array input&#xA;    public boolean containsDuplicate(int[] nums) {&#xA;        // create a HashMap to hold our values&#xA;        HashMap&amp;lt;Integer, Integer&amp;gt; hm = new HashMap&amp;lt;&amp;gt;();&#xA;        &#xA;        // loop through the input array&#xA;        for (int i=0; i&amp;lt;nums.length; i++) {&#xA;            // return true if we have seen a duplicate&#xA;            // otherwise add the int to the HashMap&#xA;            if (hm.get(nums[i])!=null) return true;&#xA;            else hm.put(nums[i], 1);&#xA;        }&#xA;        &#xA;        // return false if all else fails&#xA;        return false;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Find All Numbers Disappeared in an Array using Python</title>
      <link>https://andrewodendaal.com/find-all-numbers-disappeared-in-an-array-using-python/</link>
      <pubDate>Fri, 26 Jun 2020 08:28:36 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-all-numbers-disappeared-in-an-array-using-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of integers where 1 ≤ a[i] ≤ &lt;em&gt;n&lt;/em&gt; (&lt;em&gt;n&lt;/em&gt; = size of array), some elements appear twice and others appear once.&lt;/p&gt;&#xA;&lt;p&gt;Find all the elements of [1, &lt;em&gt;n&lt;/em&gt;] inclusive that do not appear in this array.&lt;/p&gt;&#xA;&lt;p&gt;Could you do it without extra space and in O(&lt;em&gt;n&lt;/em&gt;) runtime? You may assume the returned list does not count as extra space.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;the-solution&#34;&gt;The solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution:&#xA;    # our method&#xA;    def findDisappearedNumbers(self, nums: List[int]) -&amp;gt; List[int]:&#xA;        # get the length / amount of items&#xA;        l=len(nums)&#xA;        # create a `set` to remove duplicates&#xA;        nums=set(nums)&#xA;        # create a new array to return&#xA;        d=[]&#xA;&#xA;        # loop through the amount of items in the input array&#xA;        for i in range(1,l+1):&#xA;            # if the item is not in the input list&#xA;            if i not in nums:&#xA;                # add it to the return list&#xA;                d.append(i)&#xA;&#xA;        # return the new array&#xA;        return d&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>The Array Height Checker Problem in Java</title>
      <link>https://andrewodendaal.com/the-array-height-checker-problem-in-java/</link>
      <pubDate>Thu, 25 Jun 2020 08:06:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-array-height-checker-problem-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Students are asked to stand in non-decreasing order of heights for an annual photo.&lt;/p&gt;&#xA;&lt;p&gt;Return the minimum number of students that must move in order for all students to be standing in non-decreasing order of height.&lt;/p&gt;&#xA;&lt;p&gt;Notice that when a group of students is selected they can reorder in any possible way between themselves and the non selected students remain on their seats.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find the Squares of a Sorted Array in Java</title>
      <link>https://andrewodendaal.com/find-the-squares-of-a-sorted-array-in-java/</link>
      <pubDate>Wed, 24 Jun 2020 09:06:03 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-squares-of-a-sorted-array-in-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of integers &lt;code&gt;A&lt;/code&gt; sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;1 &amp;lt;= A.length &amp;lt;= 10000&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;-10000 &amp;lt;= A[i] &amp;lt;= 10000&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;A&lt;/code&gt; is sorted in non-decreasing order.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;the-solution&#34;&gt;The solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;    // return the sorted array squared&#xA;    public int[] sortedSquares(int[] A) {&#xA;        // create a new primitive int array&#xA;        int[] res = new int[A.length];&#xA;        // loop through the input array&#xA;        for (int i=0; i&amp;lt;A.length; i++) {&#xA;            // square each value&#xA;            res[i] = A[i] * A[i];&#xA;        }&#xA;        &#xA;        // finally sort the array&#xA;        Arrays.sort(res);&#xA;        &#xA;        // return the array&#xA;        return res;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Sorting a Java Array by Parity</title>
      <link>https://andrewodendaal.com/sorting-a-java-array-by-parity/</link>
      <pubDate>Tue, 23 Jun 2020 09:49:30 +0000</pubDate>
      <guid>https://andrewodendaal.com/sorting-a-java-array-by-parity/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array &lt;code&gt;A&lt;/code&gt; of non-negative integers, return an array consisting of all the even elements of &lt;code&gt;A&lt;/code&gt;, followed by all the odd elements of &lt;code&gt;A&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You may return any answer array that satisfies this condition.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;1 &amp;lt;= A.length &amp;lt;= 5000&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;0 &amp;lt;= A[i] &amp;lt;= 5000&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;the-solution&#34;&gt;The solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;    // return a sorted primitive int array&#xA;    public int[] sortArrayByParity(int[] A) {&#xA;        &#xA;        // keep track of place&#xA;        int lastIndex = 0;&#xA;        &#xA;        // loop through input array&#xA;        for (int i=0; i&amp;lt;A.length; i++) {&#xA;            // if we found an even number&#xA;            if (A[i]%2==0) {&#xA;                // keep track of the values&#xA;                int lastValue = A[lastIndex];&#xA;                int thisValue = A[i];&#xA;                &#xA;                // swap the values&#xA;                A[i] = lastValue;&#xA;                A[lastIndex] = thisValue;&#xA;                &#xA;                // increment our swap index&#xA;                lastIndex++;&#xA;            }&#xA;        }&#xA;        &#xA;        // return a sorted array&#xA;        return A;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Remove Duplicates from Sorted Array in Java</title>
      <link>https://andrewodendaal.com/remove-duplicates-from-sorted-array-in-java/</link>
      <pubDate>Mon, 22 Jun 2020 13:20:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/remove-duplicates-from-sorted-array-in-java/</guid>
      <description>&lt;p&gt;Say you have an array of primitive integers and you want to remove all duplicates.&lt;/p&gt;&#xA;&lt;p&gt;You can find out how many non-duplicate integers are in the array with this method:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;    public int removeDuplicates(int[] nums) {&#xA;        &#xA;        if (nums.length == 0) return 0;&#xA;        int i = 0;&#xA;        for (int j = 1; j &amp;lt; nums.length; j++) {&#xA;            if (nums[j] != nums[i]) {&#xA;                i++;&#xA;                nums[i] = nums[j];&#xA;            }&#xA;        }&#xA;        return i + 1;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Because we pass the &lt;code&gt;nums&lt;/code&gt; array in as a reference, and modify the variable in-place with no additional space, you could just continue using it as is.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Replace Elements with Greatest Element on Right Side using Java</title>
      <link>https://andrewodendaal.com/replace-elements-with-greatest-element-on-right-side-using-java/</link>
      <pubDate>Sun, 21 Jun 2020 00:03:32 +0000</pubDate>
      <guid>https://andrewodendaal.com/replace-elements-with-greatest-element-on-right-side-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array &lt;code&gt;arr&lt;/code&gt;, replace every element in that array with the greatest element among the elements to its right, and replace the last element with &lt;code&gt;-1&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;After doing so, return the array.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Constraints:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;1 &amp;lt;= arr.length &amp;lt;= 10^4&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;1 &amp;lt;= arr[i] &amp;lt;= 10^5&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution&#34;&gt;The solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;    public int[] replaceElements(int[] arr) {&#xA;        // loop through all array items&#xA;        for (int i=0; i&amp;lt;arr.length; i++) {&#xA;            &#xA;            // if the last item&#xA;            if (i==arr.length-1) {&#xA;                // set the last item&#xA;                arr[i] = -1;&#xA;            } else {&#xA;&#xA;                // set a variable to check biggest value against&#xA;                int biggest = 0;&#xA;                // loop through the internal looperr&#xA;                for(int j=i+1; j&amp;lt;arr.length; j++) {&#xA;                    // if the next value is bigger than our&#xA;                    // current biggest, then update it&#xA;                    if (arr[j]&amp;gt;biggest) biggest = arr[j];&#xA;                }&#xA;                // replace the current value with the biggest found&#xA;                arr[i] = biggest;&#xA;            }&#xA;        }&#xA;        // return our array of ints&#xA;        return arr;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>The Valid Mountain Array Problem using Java</title>
      <link>https://andrewodendaal.com/the-valid-mountain-array-problem-using-java/</link>
      <pubDate>Sat, 20 Jun 2020 16:59:16 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-valid-mountain-array-problem-using-java/</guid>
      <description>&lt;h2 id=&#34;introducing-the-problem&#34;&gt;Introducing the problem&lt;/h2&gt;&#xA;&lt;p&gt;Given an array &lt;code&gt;A&lt;/code&gt; of integers, return &lt;code&gt;true&lt;/code&gt; if and only if it is a &lt;em&gt;valid mountain array&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Recall that A is a mountain array if and only if:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;A.length &amp;gt;= 3&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;There exists some &lt;code&gt;i&lt;/code&gt; with &lt;code&gt;0 &amp;lt; i&amp;amp;nbsp;&amp;lt; A.length - 1&lt;/code&gt; such that:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;A[0] &amp;lt; A[1] &amp;lt; ... A[i-1] &amp;lt; A[i]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;A[i] &amp;gt; A[i+1] &amp;gt; ... &amp;gt; A[A.length - 1]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2020/06/image-3.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-constraints&#34;&gt;The constraints&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>HashMaps (aka: Dictionaries) in Python</title>
      <link>https://andrewodendaal.com/hashmaps-aka-dictionaries-in-python/</link>
      <pubDate>Fri, 19 Jun 2020 15:35:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/hashmaps-aka-dictionaries-in-python/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;Java has a built-in called &lt;code&gt;HashMap&lt;/code&gt;. It allows you to store and very quickly retrieve key value pairs.&lt;/p&gt;&#xA;&lt;p&gt;In Python, this is called a &lt;code&gt;dictionary&lt;/code&gt; and appears very similar to a JSON Object for those familiar with Javascript and similar languages.&lt;/p&gt;&#xA;&lt;h2 id=&#34;dictionaries-as-hashmaps&#34;&gt;Dictionaries as HashMaps&lt;/h2&gt;&#xA;&lt;p&gt;An example of a dictionary in Python is as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ages = {&amp;#34;Bob&amp;#34;:25, &amp;#34;James&amp;#34;:54, &amp;#34;Darren&amp;#34;:44}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The same can be created using the &lt;code&gt;dict&lt;/code&gt; keyword:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ages = dict({&amp;#34;Bob&amp;#34;:25, &amp;#34;James&amp;#34;:54, &amp;#34;Darren&amp;#34;:44})&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;A third way to create and populate this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find Numbers with Even Number of Digits using Java</title>
      <link>https://andrewodendaal.com/find-numbers-with-even-number-of-digits-using-java/</link>
      <pubDate>Thu, 18 Jun 2020 14:18:01 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-numbers-with-even-number-of-digits-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;Given an array &lt;code&gt;nums&lt;/code&gt; of integers, return how many of them contain an &lt;strong&gt;even number&lt;/strong&gt; of digits.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Constraints:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;1 &amp;lt;= nums.length &amp;lt;= 500&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;1 &amp;lt;= nums[i] &amp;lt;= 10^5&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution&#34;&gt;The solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Solution {&#xA;    public int findNumbers(int[] nums) {&#xA;        // keep track of the amount to return&#xA;        int evens = 0;&#xA;        &#xA;        // loop through all the nums&#xA;        for (int i=0; i&amp;lt;nums.length; i++) {&#xA;            &#xA;            int digits = 0, num = nums[i];&#xA;            // while we divide by 10&#xA;            while (num!=0) {&#xA;                num /= 10;&#xA;                // increment our count&#xA;                ++digits;&#xA;            }&#xA;            &#xA;            // increment if even&#xA;            if (digits%2==0) evens++;&#xA;            &#xA;        }&#xA;        &#xA;        return evens;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>The Relational Database Model</title>
      <link>https://andrewodendaal.com/the-relational-database-model/</link>
      <pubDate>Wed, 17 Jun 2020 11:28:53 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-relational-database-model/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Relational databases first made an appearance in the mid-1970s, between the years 1974 and 1977 with the creation of Ingres and System R which led to the creation of MS SQL Server, Sybase, Wang?s PACE and Britton-Lee to name a few (Quickbase, n.d.).&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;It was only until the 1980s that SQL (Structured Query Language) became the standard query language used by relational databases.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to use a Java HashSet by example</title>
      <link>https://andrewodendaal.com/how-to-use-a-java-hashset-by-example/</link>
      <pubDate>Tue, 16 Jun 2020 12:18:53 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-use-a-java-hashset-by-example/</guid>
      <description>&lt;h2 id=&#34;what-is-a-hashset&#34;&gt;What is a HashSet&lt;/h2&gt;&#xA;&lt;p&gt;A &lt;code&gt;HashSet&lt;/code&gt; is an unordered collection containing unique elements. It has the standard collection operations Add, Remove, Contains, but since it uses a hash-based implementation, these operations are O(1)&lt;/p&gt;&#xA;&lt;h2 id=&#34;learn-with-a-programming-question&#34;&gt;Learn with a Programming Question&lt;/h2&gt;&#xA;&lt;p&gt;Given an integer array with &lt;strong&gt;even&lt;/strong&gt; length, where different numbers in this array represent different &lt;strong&gt;kinds&lt;/strong&gt; of candies. Each number means one candy of the corresponding kind. You need to distribute these candies &lt;strong&gt;equally&lt;/strong&gt; in number to brother and sister. Return the maximum number of &lt;strong&gt;kinds&lt;/strong&gt; of candies the sister could gain.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Get The Shortest Path in Binary Matrix using Python</title>
      <link>https://andrewodendaal.com/get-the-shortest-path-in-binary-matrix-using-python/</link>
      <pubDate>Mon, 15 Jun 2020 15:05:48 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-the-shortest-path-in-binary-matrix-using-python/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The challenge&lt;/h2&gt;&#xA;&lt;p&gt;In an N by N square grid, each cell is either empty (0) or blocked (1).&lt;/p&gt;&#xA;&lt;p&gt;A &lt;em&gt;clear path from top-left to bottom-right&lt;/em&gt; has length &lt;code&gt;k&lt;/code&gt; if and only if it is composed of cells &lt;code&gt;C_1, C_2, ..., C_k&lt;/code&gt; such that:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Adjacent cells &lt;code&gt;C_i&lt;/code&gt; and &lt;code&gt;C_{i+1}&lt;/code&gt; are connected 8-directionally (ie., they are different and share an edge or corner)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C_1&lt;/code&gt; is at location &lt;code&gt;(0, 0)&lt;/code&gt; (ie. has value &lt;code&gt;grid[0][0]&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C_k&lt;/code&gt; is at location &lt;code&gt;(N-1, N-1)&lt;/code&gt; (ie. has value &lt;code&gt;grid[N-1][N-1]&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;If &lt;code&gt;C_i&lt;/code&gt; is located at &lt;code&gt;(r, c)&lt;/code&gt;, then &lt;code&gt;grid[r][c]&lt;/code&gt; is empty (ie. &lt;code&gt;grid[r][c] ==&amp;amp;nbsp;0&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Return the length of the shortest such clear path from top-left to bottom-right.  If such a path does not exist, return -1.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Palindrome Partitioning in Python</title>
      <link>https://andrewodendaal.com/palindrome-partitioning-in-python/</link>
      <pubDate>Sun, 14 Jun 2020 14:41:15 +0000</pubDate>
      <guid>https://andrewodendaal.com/palindrome-partitioning-in-python/</guid>
      <description>&lt;h2 id=&#34;the-problem&#34;&gt;The problem&lt;/h2&gt;&#xA;&lt;p&gt;Given a string &lt;em&gt;s&lt;/em&gt;, partition &lt;em&gt;s&lt;/em&gt; such that every substring of the partition is a palindrome.&lt;/p&gt;&#xA;&lt;p&gt;Return all possible palindrome partitioning of &lt;em&gt;s&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;the-solution&#34;&gt;The solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def partition(self, s: str) -&amp;gt; List[List[str]]:&#xA;    ret = []&#xA;    def isPal(s):&#xA;        return s == s[::-1]&#xA;&#xA;    def fn(s, l):&#xA;        if not s:&#xA;            ret.append(l)&#xA;            return&#xA;        for i in range(1, len(s)+1):&#xA;            if isPal(s[:i]):&#xA;                fn(s[i:], l+[s[:i]])&#xA;    fn(s, [])&#xA;    return ret&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Faster alternative to MySQL Delete Table Contents / Truncate</title>
      <link>https://andrewodendaal.com/faster-alternative-to-mysql-delete-table-contents/</link>
      <pubDate>Sat, 13 Jun 2020 09:33:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/faster-alternative-to-mysql-delete-table-contents/</guid>
      <description>&lt;p&gt;From time to time you might have some rather big tables that you want to delete all the data quickly and start afresh.&lt;/p&gt;&#xA;&lt;p&gt;You have a few options at this point. The first you?ll probably look at is:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;DELETE FROM `table_name`&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;The benefit of doing this is DELETE provides the ability to Rollback if all hell breaks loose, but it also means that it will take longer because it requires more memory to store all this additional data&lt;/p&gt;</description>
    </item>
    <item>
      <title>Best Time to Buy and Sell Stock with Python</title>
      <link>https://andrewodendaal.com/best-time-to-buy-and-sell-stock-with-python/</link>
      <pubDate>Fri, 12 Jun 2020 12:28:52 +0000</pubDate>
      <guid>https://andrewodendaal.com/best-time-to-buy-and-sell-stock-with-python/</guid>
      <description>&lt;h2 id=&#34;the-problem&#34;&gt;The problem&lt;/h2&gt;&#xA;&lt;p&gt;Say you have an array &lt;code&gt;prices&lt;/code&gt; for which the &lt;em&gt;i&lt;/em&gt;&lt;!-- raw HTML omitted --&gt;th&lt;!-- raw HTML omitted --&gt; element is the price of a given stock on day &lt;em&gt;i&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Design an algorithm to find the maximum profit. You may complete as many transactions as you like (i.e., buy one and sell one share of the stock multiple times).&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; You may not engage in multiple transactions at the same time (i.e., you must sell the stock before you buy again).&lt;/p&gt;</description>
    </item>
    <item>
      <title>IPv4 CIDR Chart</title>
      <link>https://andrewodendaal.com/ipv4-cidr-chart/</link>
      <pubDate>Thu, 11 Jun 2020 00:04:11 +0000</pubDate>
      <guid>https://andrewodendaal.com/ipv4-cidr-chart/</guid>
      <description>&lt;p&gt;CIDR stands for &lt;code&gt;Classless Inter-Domain Routing&lt;/code&gt; and is a method for allocating IP addresses as well as for IP routing.&lt;/p&gt;&#xA;&lt;p&gt;It was introduced in 1993 by the Internet Engineering Task Force to replace the previous &lt;code&gt;classful network addressing architecture&lt;/code&gt; on the internet.&lt;/p&gt;&#xA;&lt;p&gt;When choosing a CIDR range for your network, the following chart will show you how many maximum IP&amp;rsquo;s you can have on that network.&lt;/p&gt;&#xA;&lt;p&gt;For example, &lt;code&gt;/32&lt;/code&gt; will give you &lt;code&gt;1 usable IP&lt;/code&gt;, &lt;code&gt;/24&lt;/code&gt; will give you &lt;code&gt;256 usable IPs&lt;/code&gt;, while &lt;code&gt;/3&lt;/code&gt; will give you &lt;code&gt;512 million usable IPs&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Recursively Delete Files and Folders and all Contents using PHP</title>
      <link>https://andrewodendaal.com/recursively-delete-files-and-folders-and-all-contents-using-php/</link>
      <pubDate>Wed, 10 Jun 2020 10:01:12 +0000</pubDate>
      <guid>https://andrewodendaal.com/recursively-delete-files-and-folders-and-all-contents-using-php/</guid>
      <description>&lt;p&gt;Below is a quick and easy way to recursively delete all files and folders in a given path using PHP.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function destroy_dir($dir) {&#xA;  if (!is_dir($dir) || is_link($dir))&#xA;    return unlink($dir);&#xA;&#xA;  foreach (scandir($dir) as $file) {&#xA;    if ($file == &amp;#34;.&amp;#34; || $file == &amp;#34;..&amp;#34;)&#xA;      continue;&#xA;    if (!destroy_dir($dir.&amp;#34;/&amp;#34;.$file)) {&#xA;      chmod($dir.&amp;#34;/&amp;#34;.$file, 0777);&#xA;      if (!destroy_dir($dir.&amp;#34;/&amp;#34;.$file)) return false;&#xA;    }&#xA;  }&#xA;  return rmdir($dir);&#xA;}&#xA;&#xA;destroy_dir(&amp;#34;/var/www/site/public_html/directory/&amp;#34;);&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Product Update: ADD becomes Serengeti</title>
      <link>https://andrewodendaal.com/product-update-add-becomes-serengeti/</link>
      <pubDate>Tue, 09 Jun 2020 10:01:23 +0000</pubDate>
      <guid>https://andrewodendaal.com/product-update-add-becomes-serengeti/</guid>
      <description>&lt;p&gt;As a product update; The &amp;ldquo;Autonomous Distributed Database&amp;rdquo;, otherwise known as simply &lt;code&gt;ADD&lt;/code&gt; has been renamed to &lt;code&gt;Serengeti&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;strong&gt;Serengeti&lt;/strong&gt; is a vast ecosystem in east-central Africa. It spans 12,000 square miles (30,000 square kilometers), according to NASA, giving rise to its name, which is derived from the Maasai language and means &amp;ldquo;endless plains.&amp;rdquo; This region of Africa is located in north Tanzania and extends to southwestern Kenya.&lt;/p&gt;&#xA;&lt;p&gt;Much the same, the Serengeti database project is a truly autonomous distributed system that has no visible ending nor capacity. There is the potential to scale it infinitely, horizontally without downtime or data loss.&lt;/p&gt;</description>
    </item>
    <item>
      <title>SQL to Append all Fields if Shorter than a set Length</title>
      <link>https://andrewodendaal.com/sql-to-append-all-fields-if-shorter-than-a-set-length/</link>
      <pubDate>Mon, 08 Jun 2020 07:46:31 +0000</pubDate>
      <guid>https://andrewodendaal.com/sql-to-append-all-fields-if-shorter-than-a-set-length/</guid>
      <description>&lt;p&gt;This came in very handy for me at one point because I needed to have a certain field in each row 14 characters long, but half of them were only 12 characters long.&lt;/p&gt;&#xA;&lt;p&gt;In MySQL:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;update `table` set `field` = CONCAT(`field`, &amp;#39;1&amp;#39;) where LEN(`field`) = 13;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In MSSQL:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;update `table` set `field` = CONCAT(`field`, &amp;#39;1&amp;#39;) where LENGTH(`field`) = 13;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Validate Email Address in Javascript</title>
      <link>https://andrewodendaal.com/validate-email-address-in-javascript/</link>
      <pubDate>Sun, 07 Jun 2020 11:44:03 +0000</pubDate>
      <guid>https://andrewodendaal.com/validate-email-address-in-javascript/</guid>
      <description>&lt;p&gt;Below is a nice little Javascript RegularExpression to validate email addresses.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;/^\w.+@[a-zA-Z_.]+?\.[a-zA-Z.]{2,3}$/&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;..and to use it..&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;if (/^\w.+@[a-zA-Z_.]+?\.[a-zA-Z.]{2,3}$/.test(email)) alert(&amp;#34;Success&amp;#34;);&#xA;else alert(&amp;#34;Fail&amp;#34;);&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Remove hash from window.location in Javascript</title>
      <link>https://andrewodendaal.com/remove-hash-from-window-location-in-javascript/</link>
      <pubDate>Sat, 06 Jun 2020 12:12:30 +0000</pubDate>
      <guid>https://andrewodendaal.com/remove-hash-from-window-location-in-javascript/</guid>
      <description>&lt;p&gt;&lt;code&gt;E.g. URL:&amp;lt;br&amp;gt;http://example.com/?option=1&amp;amp;task=2&amp;amp;listing_id=36&amp;amp;layout=4&amp;amp;table=5#some_hash_value_here&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;So how would you get the current URL using Javascript?&lt;/p&gt;&#xA;&lt;p&gt;That is really easy, you can use window.location.href or just simply window.location.&lt;/p&gt;&#xA;&lt;p&gt;But how do you replace the #hash at the end if it exists?&lt;/p&gt;&#xA;&lt;p&gt;That too is quite easy, you can just do something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;window.location.href.split(&amp;#34;#&amp;#34;)[0]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;or&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;window.location.href.substr(0, window.location.href.indexOf(&amp;#34;#&amp;#34;))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;So now that we have the value of the current URL how do we refresh the page with it?&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Benefits and Dangers of Artificial Intelligence</title>
      <link>https://andrewodendaal.com/benefits-and-dangers-of-artificial-intelligence/</link>
      <pubDate>Fri, 05 Jun 2020 13:18:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/benefits-and-dangers-of-artificial-intelligence/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Artificial Intelligence (AI) is usually defined as the science of making computers do things that require intelligence when done by humans. (Jack Copeland, 2000)&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;current-benefits-of-ai&#34;&gt;Current Benefits of AI&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Replicate the decisions and actions of humans without human shortcomings.&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Computers don&amp;rsquo;t get fatigued and tired.&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Computers are not biased by emotions.&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Tasks are scalable and can be done very quickly and effectively.&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;current-dangers-of-ai&#34;&gt;Current Dangers of AI&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Some decisions require a level of &lt;!-- raw HTML omitted --&gt;grey area&lt;!-- raw HTML omitted --&gt;.&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Replacing jobs and roles done by humans leading to a higher level of unemployment and poverty.&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Viruses and bugs in code leading to catastrophic circumstances such as accidents with self-driving cars and in aviation systems.&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;There are many trends currently taking place in the field of AI.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Decoded String at Index using Java</title>
      <link>https://andrewodendaal.com/the-decoded-string-at-index-using-java/</link>
      <pubDate>Thu, 04 Jun 2020 11:25:56 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-decoded-string-at-index-using-java/</guid>
      <description>&lt;h2 id=&#34;the-challenge&#34;&gt;The Challenge&lt;/h2&gt;&#xA;&lt;p&gt;An encoded string &lt;code&gt;S&lt;/code&gt; is given.  To find and write the &lt;em&gt;decoded&lt;/em&gt; string to a tape, the encoded string is read &lt;strong&gt;one character at a time&lt;/strong&gt; and the following steps are taken:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the character read is a letter, that letter is written onto the tape.&lt;/li&gt;&#xA;&lt;li&gt;If the character read is a digit (say &lt;code&gt;d&lt;/code&gt;), the entire current tape is repeatedly written &lt;code&gt;d-1&lt;/code&gt; more times in total.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Now for some encoded string &lt;code&gt;S&lt;/code&gt;, and an index &lt;code&gt;K&lt;/code&gt;, find and return the &lt;code&gt;K&lt;/code&gt;-th letter (1 indexed) in the decoded string.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Timing Issues in Real-time systems</title>
      <link>https://andrewodendaal.com/timing-issues-in-real-time-systems/</link>
      <pubDate>Wed, 03 Jun 2020 10:05:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/timing-issues-in-real-time-systems/</guid>
      <description>&lt;h2 id=&#34;what-are-real-time-systems&#34;&gt;&lt;strong&gt;What are Real-time Systems?&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;If you look up the term &amp;ldquo;real-time&amp;rdquo; in a dictionary, it will tell you that it is the actual time during which a process takes place or an event occurs (Dictionary.com, n.d.).&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;In computing, it is more often than not due to when an event is created and specific data service is able to respond with the newly updated event in its index.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find the Minimum Absolute Difference in BST using Java</title>
      <link>https://andrewodendaal.com/find-the-minimum-absolute-difference-in-bst-using-java/</link>
      <pubDate>Tue, 02 Jun 2020 11:35:49 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-the-minimum-absolute-difference-in-bst-using-java/</guid>
      <description>&lt;h2 id=&#34;the-question&#34;&gt;The question&lt;/h2&gt;&#xA;&lt;p&gt;Given a binary search tree with non-negative values, find the minimum &lt;!-- raw HTML omitted --&gt;absolute difference&lt;!-- raw HTML omitted --&gt; between values of any two nodes.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;There are at least two nodes in this BST.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-solution&#34;&gt;The solution&lt;/h2&gt;&#xA;&lt;p&gt;We will start with a stub to build out:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;/**&#xA; * Definition for a binary tree node.&#xA; * public class TreeNode {&#xA; *     int val;&#xA; *     TreeNode left;&#xA; *     TreeNode right;&#xA; *     TreeNode() {}&#xA; *     TreeNode(int val) { this.val = val; }&#xA; *     TreeNode(int val, TreeNode left, TreeNode right) {&#xA; *         this.val = val;&#xA; *         this.left = left;&#xA; *         this.right = right;&#xA; *     }&#xA; * }&#xA; */&#xA;class Solution {&#xA;    public int getMinimumDifference(TreeNode root) {&#xA;        &#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Of this, the meat really comes in with the &lt;code&gt;getMinimumDifference&lt;/code&gt; method.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Get the Second Highest Salary in MySQL</title>
      <link>https://andrewodendaal.com/get-the-second-highest-salary-in-mysql/</link>
      <pubDate>Mon, 01 Jun 2020 11:43:08 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-the-second-highest-salary-in-mysql/</guid>
      <description>&lt;h2 id=&#34;the-problem&#34;&gt;The problem&lt;/h2&gt;&#xA;&lt;p&gt;Write a SQL query to get the second highest salary from the &lt;code&gt;Employee&lt;/code&gt; table.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;For example, given the above Employee table, the query should return &lt;code&gt;200&lt;/code&gt; as the second highest salary. If there is no second highest salary, then the query should return &lt;code&gt;null&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;the-solution&#34;&gt;The solution&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SELECT DISTINCT&#xA;    Salary AS SecondHighestSalary&#xA;FROM&#xA;    Employee&#xA;ORDER BY Salary DESC&#xA;LIMIT 1 OFFSET 1&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-output&#34;&gt;The output&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&amp;#34;headers&amp;#34;: [&amp;#34;SecondHighestSalary&amp;#34;], &amp;#34;values&amp;#34;: [[200]]}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Find Maximum Subarrays using Java</title>
      <link>https://andrewodendaal.com/find-maximum-subarrays-using-java/</link>
      <pubDate>Sun, 31 May 2020 10:22:07 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-maximum-subarrays-using-java/</guid>
      <description>&lt;h2 id=&#34;the-problem&#34;&gt;The problem&lt;/h2&gt;&#xA;&lt;p&gt;Given an integer array &lt;code&gt;nums&lt;/code&gt;, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;the-code&#34;&gt;The code&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// This method takes an array of `ints` and returns an `int`&#xA;public int maxSubArray(int[] nums) {&#xA;    // Set some `max` variables,&#xA;    // ..firstly the minimum `Integer` value&#xA;    // ..secondly `0`&#xA;    int max = Integer.MIN_VALUE;&#xA;    int iMax = 0;&#xA;&#xA;    // Loop through all input `nums`&#xA;    for(int num : nums) {&#xA;        // increment the `iMax` each loop&#xA;        iMax = iMax + num;&#xA;        // check if `num` is bigger than `iMax`&#xA;        if(iMax &amp;lt; num) {&#xA;            // set `iMax` to the `num`&#xA;            iMax = num;&#xA;        }&#xA;        // set the `max` to the max of both our variables&#xA;        max = Math.max(max,iMax);&#xA;    }&#xA;    // return the `max`&#xA;    return max;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Finding Number Complements using Java</title>
      <link>https://andrewodendaal.com/finding-number-complements-using-java/</link>
      <pubDate>Sat, 30 May 2020 12:03:54 +0000</pubDate>
      <guid>https://andrewodendaal.com/finding-number-complements-using-java/</guid>
      <description>&lt;h2 id=&#34;the-problem&#34;&gt;The problem&lt;/h2&gt;&#xA;&lt;p&gt;Given a &lt;strong&gt;positive&lt;/strong&gt; integer &lt;code&gt;num&lt;/code&gt;, output its complement number. The complement strategy is to flip the bits of its binary representation.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Constraints:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The given integer &lt;code&gt;num&lt;/code&gt; is guaranteed to fit within the range of a 32-bit signed integer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;num &amp;gt;= 1&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;You could assume no leading zero bit in the integer’s binary representation.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;the-code&#34;&gt;The code&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// Our method that takes in an `int` and returns an `int`&#xA;public int findComplement(int num) {&#xA;    // Duplicate the input for reference&#xA;    int originalNum = num;&#xA;&#xA;    // Set a variable for looping on an index&#xA;    long i = 1;&#xA;    // Loop while `i` is less or equal to `originalNum`&#xA;    while(i&amp;lt;=originalNum) {&#xA;        // Shift the variables&#xA;        num ^= i;&#xA;        i &amp;lt;&amp;lt;= 1;&#xA;    }&#xA;    // Return the resultant `num`&#xA;    return num;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Forensic Analysis on Linux (Unix)</title>
      <link>https://andrewodendaal.com/forensic-analysis-on-linux-unix/</link>
      <pubDate>Fri, 29 May 2020 09:50:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/forensic-analysis-on-linux-unix/</guid>
      <description>&lt;p&gt;Operating Systems come in a few competing choices, of which the major players are Apple&amp;rsquo;s MacOS, Microsoft&amp;rsquo;s Windows and then the various flavours of Linux, of which most are open-sourced while the remainder are proprietary to their vendors.&lt;/p&gt;&#xA;&lt;p&gt;Of the three, Windows is the most dissimilar, with MacOS and Linux sharing a similar BSD/Unix platform running behind the scenes. This gives MacOS and Linux similar traits when it comes to logging, analysing and tracing system event-logs.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Self Dividing Numbers using Python</title>
      <link>https://andrewodendaal.com/self-dividing-numbers-using-python/</link>
      <pubDate>Thu, 28 May 2020 09:42:03 +0000</pubDate>
      <guid>https://andrewodendaal.com/self-dividing-numbers-using-python/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;A &lt;em&gt;self-dividing number&lt;/em&gt; is a number that is divisible by every digit it contains.&lt;/p&gt;&#xA;&lt;p&gt;For example, 128 is a self-dividing number because &lt;code&gt;128 % 1 == 0&lt;/code&gt;, &lt;code&gt;128 % 2 == 0&lt;/code&gt;, and &lt;code&gt;128 % 8 == 0&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Also, a self-dividing number is not allowed to contain the digit zero.&lt;/p&gt;&#xA;&lt;p&gt;Given a lower and upper number bound, output a list of every possible self dividing number, including the bounds if possible.&lt;/p&gt;</description>
    </item>
    <item>
      <title>RuntimeError: thread.__init__() not called (Python)</title>
      <link>https://andrewodendaal.com/runtimeerror-thread-init-not-called-python/</link>
      <pubDate>Wed, 27 May 2020 09:37:42 +0000</pubDate>
      <guid>https://andrewodendaal.com/runtimeerror-thread-init-not-called-python/</guid>
      <description>&lt;p&gt;Today I got a really dumb error from Python.&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;RuntimeError: thread.&lt;strong&gt;init&lt;/strong&gt;() not called&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;But luckily it&amp;rsquo;s really easy to fix!&lt;/p&gt;&#xA;&lt;p&gt;Below is the code before (with the error):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class SomeThread(Thread):&#xA;    def __init__(self, myVar):&#xA;        self.sMyVar = str(myVar)&#xA;    def run(self):&#xA;        self.sMyVar = &amp;#34;bla..&amp;#34; + self.sMyVar&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And now for the code that resolved the problem:&lt;/p&gt;</description>
    </item>
    <item>
      <title>All About Distributed Databases</title>
      <link>https://andrewodendaal.com/distributed-databases/</link>
      <pubDate>Tue, 26 May 2020 11:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/distributed-databases/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;A database &amp;ldquo;is a structured collection of data. Card indices, printed catalogues of archaeological artefacts and telephone directories are all examples of databases&amp;rdquo;.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;We are going to examine databases that are prevalent in computer systems and go through the core differences between Local and Distributed Databases.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;local&#34;&gt;Local&lt;/h2&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;A local database is an isolated database that is stored on a single computer and does not share its data outside of itself or its direct access network.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Network systems security risks</title>
      <link>https://andrewodendaal.com/network-systems-security-risks/</link>
      <pubDate>Mon, 25 May 2020 09:28:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/network-systems-security-risks/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Networking has played a vital part in the transfer of information as well as the accessibility of information that was never available to previous generations with the rapid increase of internet-connected devices.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Along with the benefits of computing devices being connected to one another for information sharing, online shopping and many other helpful tasks, there is also a real threat present. This is termed under the overarching &amp;ldquo;Network Security&amp;rdquo; realm of topics.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Communications and The Software Development Process</title>
      <link>https://andrewodendaal.com/communications-and-the-software-development-process/</link>
      <pubDate>Sun, 24 May 2020 20:20:41 +0000</pubDate>
      <guid>https://andrewodendaal.com/communications-and-the-software-development-process/</guid>
      <description>&lt;p&gt;Software Engineering or the Software Development Process is broken down into the following phases.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Requirements&lt;/li&gt;&#xA;&lt;li&gt;Design&lt;/li&gt;&#xA;&lt;li&gt;Implementation&lt;/li&gt;&#xA;&lt;li&gt;Verification&lt;/li&gt;&#xA;&lt;li&gt;Maintenance &lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Communication can often breakdown in the system analysis phases. As a knock on effect, the requirements and design can end up not being correctly implemented during the mid to latter stages of software development.&lt;/p&gt;&#xA;&lt;p&gt;Without correct communication, a software system can end up not meeting the requirements initially laid out by the end client – or whomever requested the system in the first place.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Get the total size of all the files in a directory</title>
      <link>https://andrewodendaal.com/get-the-total-size-of-all-the-files-in-a-directory/</link>
      <pubDate>Sat, 23 May 2020 19:00:11 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-the-total-size-of-all-the-files-in-a-directory/</guid>
      <description>&lt;p&gt;It&amp;rsquo;s amazing how many times I&amp;rsquo;ve need to find out the total size of all the files in a directory on one of our servers.&lt;/p&gt;&#xA;&lt;p&gt;I have grown to love the simplicity of the `du` command.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;du -sh&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;du&lt;/code&gt; = Display disk Usage statistics&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;s&lt;/code&gt; tells us to display an entry for each specified file, while &lt;code&gt;h&lt;/code&gt; is for &amp;ldquo;human-readable&amp;rdquo; output.&lt;/p&gt;&#xA;&lt;p&gt;This will use the unit suffixes of Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Structured and Object-Oriented Programming</title>
      <link>https://andrewodendaal.com/structured-and-object-oriented-programming/</link>
      <pubDate>Fri, 22 May 2020 12:30:29 +0000</pubDate>
      <guid>https://andrewodendaal.com/structured-and-object-oriented-programming/</guid>
      <description>&lt;p&gt;Software development has really come a long way over the past few decades.&lt;/p&gt;&#xA;&lt;p&gt;Programming used to always be about doing things in a very procedural way, this means that each line of code is executed in the order that it is written (or placed) in a source code document – we refer to a file where programming code is stored as &amp;ldquo;source code&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;This is still very much a core basis when writing code, except as software applications have gotten infinitely more expansive and complex, there has been more of a need to reuse sections of code and make it more &amp;ldquo;modular&amp;rdquo;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Moving a MySQL Database without downtime</title>
      <link>https://andrewodendaal.com/moving-a-mysql-database-without-downtime/</link>
      <pubDate>Thu, 21 May 2020 12:45:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/moving-a-mysql-database-without-downtime/</guid>
      <description>&lt;p&gt;At &lt;!-- raw HTML omitted --&gt;Statvoo Analytics&lt;!-- raw HTML omitted --&gt; we found ourselves in the position where we needed to move our master MySQL database without ANY downtime and for anyone who&amp;rsquo;s tried to do this, you will know how hard this can be if it is not done exactly right.&lt;/p&gt;&#xA;&lt;p&gt;Below I will run through the steps to get the job done efficiently and with no downtime (unless you mess it up that is).&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to use Google Analytics in AngularJS</title>
      <link>https://andrewodendaal.com/how-to-use-google-analytics-in-angularjs/</link>
      <pubDate>Wed, 20 May 2020 14:00:21 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-use-google-analytics-in-angularjs/</guid>
      <description>&lt;p&gt;It seems to be quite a popular question with not as many answers to hold the weight.&lt;/p&gt;&#xA;&lt;p&gt;Google Analytics has always been more of a pageviews type tracking use case and up until a few years ago that was all anyone ever really did anyways. However,  the web has gotten a lot more complicated with the introduction of javascript and heavy ajax based sites and web applications.&lt;/p&gt;&#xA;&lt;p&gt;This has caused quite a change in how &lt;strong&gt;Analytics Tools&lt;/strong&gt; are used and how they are expected to &lt;strong&gt;gather statistics&lt;/strong&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Converting from Legacy to Client-Server or Distributed Systems</title>
      <link>https://andrewodendaal.com/converting-from-legacy-to-client-server-or-distributed-systems/</link>
      <pubDate>Tue, 19 May 2020 12:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/converting-from-legacy-to-client-server-or-distributed-systems/</guid>
      <description>&lt;h2 id=&#34;what-is-a-legacy-system&#34;&gt;&lt;strong&gt;What is a legacy system?&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;A legacy system is a computing system that has been around for a very long period of time, tends to be difficult to maintain, is prone to issues such as lack of scalability and feature additions, usually centralised in operation and is still heavily utilised in a particular organisation.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-a-client-server--distributed-system&#34;&gt;&lt;strong&gt;What is a client-server / distributed system?&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;A distributed system is a decentralised networked cluster of computers (servers) that are able to scale according to peaks and troughs in usage (Manoj A. Thomas, 2009), is modular in the way components are reused and code is arranged as well as more maintainable by a team of developers that are trained in relevant new technologies.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Conceptual Architectural Views, with a focus on the Development View</title>
      <link>https://andrewodendaal.com/conceptual-architectural-views-with-a-focus-on-the-development-view/</link>
      <pubDate>Mon, 18 May 2020 11:20:54 +0000</pubDate>
      <guid>https://andrewodendaal.com/conceptual-architectural-views-with-a-focus-on-the-development-view/</guid>
      <description>&lt;h2 id=&#34;what-is-conceptual-architectural-views&#34;&gt;&lt;strong&gt;What is Conceptual Architectural Views?&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Architectural views are abstractions, or simplifications, of the entire design, in which important characteristics are made more visible by leaving details aside. (Eclipse, n.d.)&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;They are divided into four main sub-categories as illustrated below when using the 4+1 modelling system:&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2017/06/pasted-image-0.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Each of the above segments paints a different perspective view on the architecture of a complex system, allowing for a simplified look into the inner workings and how everything works together.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Assessing Reusable Parts in a Software Architecture</title>
      <link>https://andrewodendaal.com/assessing-reusable-parts-in-a-software-architecture/</link>
      <pubDate>Sun, 17 May 2020 13:00:43 +0000</pubDate>
      <guid>https://andrewodendaal.com/assessing-reusable-parts-in-a-software-architecture/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;During the Software Development Life Cycle (SDLC) the development team will come to realise that parts of any application have already been created before and there is the potential for those parts to be reused time and again going forward.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;In the last few years, the culture of software development has moved towards Q&amp;amp;A sites such as StackOverflow to answer common daily problems that developers face. This has also led to many &amp;ldquo;Accepted Answers&amp;rdquo; being associated with these common issues and many developers have become quite indolent and simply copy/paste the code snippets directly from these types of websites straight into their application code they plan to ship. If and when it then resolves the problem they are facing, there is a high chance that the pasted code will eventually find it&amp;rsquo;s way into a production environment as is, or with very little change whatsoever.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>An Introduction to 2-Tier and 3-Tier Client-Server Systems</title>
      <link>https://andrewodendaal.com/an-introduction-to-2-tier-and-3-tier-client-server-systems/</link>
      <pubDate>Sat, 16 May 2020 12:31:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/an-introduction-to-2-tier-and-3-tier-client-server-systems/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;All software systems can be grouped in either a 2-tier or a 3-tier formation.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;The former is essentially where all clients contain application and business logic code to read from a datastore themselves (STC, n.d.) and the latter by comparison relies on a thin client that talks to an application layer server that contains business logic which in turn communicates with the datastore.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Remove the Outermost Parentheses using Python</title>
      <link>https://andrewodendaal.com/remove-the-outermost-parentheses-using-python/</link>
      <pubDate>Fri, 15 May 2020 10:13:40 +0000</pubDate>
      <guid>https://andrewodendaal.com/remove-the-outermost-parentheses-using-python/</guid>
      <description>&lt;h2 id=&#34;the-question&#34;&gt;The Question&lt;/h2&gt;&#xA;&lt;p&gt;A valid parentheses string is either empty &lt;code&gt;(&amp;quot;&amp;quot;)&lt;/code&gt;, &lt;code&gt;&amp;quot;(&amp;quot; + A + &amp;quot;)&amp;quot;&lt;/code&gt;, or &lt;code&gt;A + B&lt;/code&gt;, where &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt; are valid parentheses strings, and &lt;code&gt;+&lt;/code&gt; represents string concatenation.  For example, &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt;, &lt;code&gt;&amp;quot;()&amp;quot;&lt;/code&gt;, &lt;code&gt;&amp;quot;(())()&amp;quot;&lt;/code&gt;, and &lt;code&gt;&amp;quot;(()(()))&amp;quot;&lt;/code&gt; are all valid parentheses strings.&lt;/p&gt;&#xA;&lt;p&gt;A valid parentheses string &lt;code&gt;S&lt;/code&gt; is &lt;strong&gt;primitive&lt;/strong&gt; if it is nonempty, and there does not exist a way to split it into &lt;code&gt;S = A+B&lt;/code&gt;, with &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt; nonempty valid parentheses strings.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Pros and Cons of Agile in Software Development</title>
      <link>https://andrewodendaal.com/the-pros-and-cons-of-agile-in-software-development/</link>
      <pubDate>Thu, 14 May 2020 11:11:31 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-pros-and-cons-of-agile-in-software-development/</guid>
      <description>&lt;h2 id=&#34;what-is-agile-in-software-engineering&#34;&gt;&lt;strong&gt;What is Agile in Software Engineering?&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Agile approaches help teams respond to unpredictability through incremental, iterative work cadences and empirical feedback. (AgileMethodology.org, 2008)&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;advantages-of-agile&#34;&gt;&lt;strong&gt;Advantages of Agile&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Flexibility&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;Potentially the main advantage to Agile is the ability to be more ?flexible? or ?agile? in terms of evolving a project as it develops as opposed to taking on a mammoth list of project requirements and only being able to show the customer the end result at project completion. (Kelly Waters, 2007)&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Visibility&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;By undertaking a defined list of ?tasks? per ?sprint?, it allows all involved business units and customers to see the project unfolding at regular checkpoints before their eyes and provides the ability to make informed decisions about what additional backlog tasks should be added or removed for an overall better final project goal.&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Ability to make iterative changes&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;Taking on smaller pieces of work allows developers to not be stuck with large refactoring of code when big sections of the project need to be re-worked at a later stage. (Alexander Mikula, 2015)&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Development led project management&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;By giving project management tasks back to the development team, team members are aligned in what needs to be done and they have an knowledgeable invested interest in excelling at their individual tasks laid out by themselves.&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Cost control&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;Undertaking sections of work at a time highlights how much of the project has been completed and what still needs to be done. This allows feature requests and backlog items to be aligned with remaining budgets allocated to the project.&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;disadvantages-of-agile&#34;&gt;&lt;strong&gt;Disadvantages of Agile&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Scope creep&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;Customers/analysts add features/tasks as the project evolves, making it difficult to complete the project without adding additional scope. (Stephen Haunts, 2014)&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Does not scale well&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;Teams should be no more than approximately 10 members otherwise it gets harder to manage (Robert Galen, 2015).&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Requires more re-work&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;Tasks undertaken separately without knowledge of the wider project roadmap, code often needs to be refactored to make room for additional specifications at a later stage.&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Demanding on participants time&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;With developers involved in: planning, design, implementation, demos, retrospectives and more; it can be difficult to allocate a decent amount of time towards ?coding? per sprint. Often spending over 20% time on discussions per sprint. (Andrew Odendaal, 2016)&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Testing costs can be higher&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;Need for QA to test each feature each sprint as opposed to only at the end of the project, this can add a lot more cost and resource. (Donald Patti, 2010)&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Agile can be negative on a project when you have inexperienced developers that need hand-holding and are not able to take on tasks by themselves, there is a steep learning curve and more senior developers will need to spent a lot more time managing the processes.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Contemporary and beneficial uses of Big-Data Systems</title>
      <link>https://andrewodendaal.com/contemporary-and-beneficial-uses-of-big-data-systems/</link>
      <pubDate>Wed, 13 May 2020 13:28:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/contemporary-and-beneficial-uses-of-big-data-systems/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Big data is a term applied to datasets whose size or type is beyond the ability of traditional relational databases to capture, manage, and process the data with low-latency. (IBM, 2018)&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-vs-of-big-data&#34;&gt;The V&amp;rsquo;s of Big Data&lt;/h2&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;They share at least one or more of the common V&amp;rsquo;s; known as &lt;!-- raw HTML omitted --&gt;Volume&lt;!-- raw HTML omitted --&gt;, &lt;!-- raw HTML omitted --&gt;Velocity&lt;!-- raw HTML omitted --&gt; and &lt;!-- raw HTML omitted --&gt;Variety&lt;!-- raw HTML omitted --&gt;.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Distributed Database Systems Observations</title>
      <link>https://andrewodendaal.com/distributed-database-systems-observations/</link>
      <pubDate>Tue, 12 May 2020 12:01:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/distributed-database-systems-observations/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Traditional database systems were a centralised powerful database server that housed all operations pertaining to the database. &lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;There are countless reasons that this is unsustainable when larger databases are employed, specifically for globally distributed companies and popular applications as already known today.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;A single database server may suit many database&amp;rsquo;s requirements, but at some point, there may be a need to scale up to support higher demand or for global capacity requirements of sorts (Shalom, 2017).&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Functions of an Operating System</title>
      <link>https://andrewodendaal.com/functions-of-an-operating-system/</link>
      <pubDate>Mon, 11 May 2020 09:58:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/functions-of-an-operating-system/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;I am in a bit of an unusual situation where &amp;ldquo;I use&amp;rdquo; a combination of three different laptops, which each run different platforms. Namely; &lt;!-- raw HTML omitted --&gt;MacOS&lt;!-- raw HTML omitted --&gt; primarily at work with a combination of Linux servers and then &lt;!-- raw HTML omitted --&gt;Windows&lt;!-- raw HTML omitted --&gt; as well as &lt;!-- raw HTML omitted --&gt;Ubuntu&lt;!-- raw HTML omitted --&gt; on two separate home laptops that I switch between on my desk all the time between tasks.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>ORDER BY RAND() – Faster Alternative</title>
      <link>https://andrewodendaal.com/order-by-rand-faster-alternative/</link>
      <pubDate>Sun, 10 May 2020 16:48:29 +0000</pubDate>
      <guid>https://andrewodendaal.com/order-by-rand-faster-alternative/</guid>
      <description>&lt;p&gt;MySQL&amp;rsquo;s &lt;code&gt;ORDER BY RAND()&lt;/code&gt; function can be so useful for returning random items from a table, in fact, we have used it a million times over the years.&lt;/p&gt;&#xA;&lt;p&gt;The problem comes when your database tables start getting really big.&lt;/p&gt;&#xA;&lt;p&gt;We found a very nice alternative to using it and thought it useful to post here for everyone else to use and/or provide feedback on.&lt;/p&gt;&#xA;&lt;p&gt;Say you have a SQL query as follows: (slow on big tables)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Top-down vs Bottom-up Database Design</title>
      <link>https://andrewodendaal.com/top-down-vs-bottom-up-database-design/</link>
      <pubDate>Sat, 09 May 2020 11:34:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/top-down-vs-bottom-up-database-design/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;There are essentially two different approaches one can take when designing databases; these, from a high-level analytic point of view, narrow down to what is typically called &amp;ldquo;Top-down&amp;rdquo; and &amp;ldquo;Bottom-up&amp;rdquo; philosophies or methods.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;While these methodologies can appear profoundly unique, they share the shared objective of joining a system by portraying the greater part of the association between the procedures.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to keep your web server or blog up when you get a traffic spike</title>
      <link>https://andrewodendaal.com/how-to-keep-your-web-server-or-blog-up-when-you-get-a-traffic-spike/</link>
      <pubDate>Fri, 08 May 2020 13:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-keep-your-web-server-or-blog-up-when-you-get-a-traffic-spike/</guid>
      <description>&lt;p&gt;So you&amp;rsquo;re about to be featured on some very high ranking website.&lt;/p&gt;&#xA;&lt;p&gt;You&amp;rsquo;re worried that when all the visitors come rushing towards you, your web server?is going to crash and burn.?Well, you&amp;rsquo;re probably right!&lt;/p&gt;&#xA;&lt;p&gt;Did you know that &lt;strong&gt;95% of all websites&lt;/strong&gt; on the internet are not able to handle more than 30 concurrent visitors the way they are setup?&lt;/p&gt;&#xA;&lt;p&gt;Even worse still, most websites run off of either Shared hosting or un-tweaked VPS configurations that are not meant to handle many visitors in the first place.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get the UTC Timestamp in Python</title>
      <link>https://andrewodendaal.com/how-to-get-the-utc-timestamp-in-python/</link>
      <pubDate>Thu, 07 May 2020 08:36:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-utc-timestamp-in-python/</guid>
      <description>&lt;p&gt;All dates in your server applications should be stored in the UTC timezone.&lt;/p&gt;&#xA;&lt;p&gt;This is because you always want to store time without the offset of the timezone you may be working in.&lt;/p&gt;&#xA;&lt;p&gt;Clients of your application may be in many different timezones around the world. However, storing all data in the UTC or GMT (same thing) timezone, is ideal as it gives your application the ability to present times and dates back in the same methodology.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to setup the AWS CLI for multiple profiles</title>
      <link>https://andrewodendaal.com/how-to-setup-the-aws-cli-for-multiple-profiles/</link>
      <pubDate>Wed, 06 May 2020 09:54:56 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-setup-the-aws-cli-for-multiple-profiles/</guid>
      <description>&lt;p&gt;The AWS CLI provides the ability to use the wide range of Amazon Web Services tools and services straight from the command-line. If you&amp;rsquo;re working with AWS, you might also be interested in &lt;a href=&#34;https://andrewodendaal.com/how-to-push-docker-images-to-aws-ecr&#34;&gt;how to push Docker images to AWS ECR&lt;/a&gt; or &lt;a href=&#34;https://andrewodendaal.com/how-to-get-the-size-of-an-aws-s3-bucket&#34;&gt;how to get the size of an AWS S3 bucket&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;However, sometimes it&amp;rsquo;s useful to be able to login to multiple AWS accounts. Luckily, this is possible by adding an additional &lt;code&gt;profile&lt;/code&gt; to your local configuration and then specifying it when making calls to respective services. This is especially useful when &lt;a href=&#34;https://andrewodendaal.com/how-to-make-an-http-request-in-aws-lambda-using-python&#34;&gt;making HTTP requests in AWS Lambda using Python&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get the size of an AWS S3 bucket</title>
      <link>https://andrewodendaal.com/how-to-get-the-size-of-an-aws-s3-bucket/</link>
      <pubDate>Tue, 05 May 2020 09:03:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-size-of-an-aws-s3-bucket/</guid>
      <description>&lt;p&gt;If you need to get the size of an AWS S3 folder, or even an entire bucket, you can do so with the following command:&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;If you don&amp;rsquo;t use &lt;code&gt;aws cli profiles&lt;/code&gt;, then you can leave out the &lt;code&gt;profile&lt;/code&gt; part like this:&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;Remember to replace &lt;code&gt;&amp;lt;bucket_name&amp;gt;&lt;/code&gt; with your own bucket name.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Comparing Java and Javascript</title>
      <link>https://andrewodendaal.com/comparing-java-and-javascript/</link>
      <pubDate>Mon, 04 May 2020 12:14:51 +0000</pubDate>
      <guid>https://andrewodendaal.com/comparing-java-and-javascript/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Perhaps the first thing that most people ask when they hear the names of these two programming languages are. &amp;ldquo;Why do they have the same name?&amp;rdquo; and &amp;ldquo;Are they the same thing?&amp;rdquo;.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;There is a general misconception that because Java and Javascript share a similar name to one another, that they are indeed one and the same; but in reality, they are very different languages, which each address different types of problems and only share the smallest of traits.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>An Introduction to Data Structures</title>
      <link>https://andrewodendaal.com/data-structures/</link>
      <pubDate>Sun, 03 May 2020 00:53:54 +0000</pubDate>
      <guid>https://andrewodendaal.com/data-structures/</guid>
      <description>&lt;p&gt;When bringing up the topic of “Data Structures”, it is first important to understand what they are. TechTarget states that “a data structure is a specialized format for organizing and storing data”. This provides a high-level definition to get you started; so let’s explore it a little deeper.&lt;/p&gt;&#xA;&lt;p&gt;Below are a few examples of common data structures:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Primitive types&lt;/strong&gt;: &lt;em&gt;Boolean&lt;/em&gt;, &lt;em&gt;Integer&lt;/em&gt;, &lt;em&gt;Double&lt;/em&gt;, &lt;em&gt;Character&lt;/em&gt;, &lt;em&gt;String&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Composite/Non-primitive types&lt;/strong&gt;: &lt;em&gt;Array&lt;/em&gt;, &lt;em&gt;Record&lt;/em&gt;, &lt;em&gt;Union&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Abstract types&lt;/strong&gt;: &lt;em&gt;List&lt;/em&gt;, &lt;em&gt;Associate Array&lt;/em&gt;, &lt;em&gt;Stack&lt;/em&gt;, &lt;em&gt;Queue&lt;/em&gt;, &lt;em&gt;Tree&lt;/em&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Relational Database Proprietary Extensions</title>
      <link>https://andrewodendaal.com/relational-database-proprietary-extensions/</link>
      <pubDate>Sat, 02 May 2020 02:14:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/relational-database-proprietary-extensions/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Standard Query Language – or SQL for short – is a language designed for relational databases that allows end users such as developers and database administrators (DBAs) to manipulate data.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Whether that be &lt;!-- raw HTML omitted --&gt;&lt;em&gt;&lt;!-- raw HTML omitted --&gt;INSERT&lt;!-- raw HTML omitted --&gt;&lt;/em&gt;&lt;!-- raw HTML omitted --&gt;-ing, &lt;!-- raw HTML omitted --&gt;&lt;em&gt;&lt;!-- raw HTML omitted --&gt;UPDATE&lt;!-- raw HTML omitted --&gt;&lt;/em&gt;&lt;!-- raw HTML omitted --&gt;-ing, &lt;!-- raw HTML omitted --&gt;&lt;em&gt;&lt;!-- raw HTML omitted --&gt;DELETE&lt;!-- raw HTML omitted --&gt;&lt;/em&gt;&lt;!-- raw HTML omitted --&gt;-ing, &lt;!-- raw HTML omitted --&gt;&lt;em&gt;&lt;!-- raw HTML omitted --&gt;SELECT&lt;!-- raw HTML omitted --&gt;&lt;/em&gt;&lt;!-- raw HTML omitted --&gt;-ing or otherwise &lt;!-- raw HTML omitted --&gt;&lt;em&gt;&lt;!-- raw HTML omitted --&gt;ALTER&lt;!-- raw HTML omitted --&gt;&lt;/em&gt;&lt;!-- raw HTML omitted --&gt;-ing almost any amount of data; SQL provides an effective way of utilising the database system/engine by providing standardised language to do so.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Locks used in Database Management Systems</title>
      <link>https://andrewodendaal.com/locks-used-in-database-management-systems/</link>
      <pubDate>Fri, 01 May 2020 12:24:40 +0000</pubDate>
      <guid>https://andrewodendaal.com/locks-used-in-database-management-systems/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Database Management Systems (DBMS?) are designed to store any amount of data that can then be retrieved or manipulated at a later date.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;In order to make sure that the data can be concurrently utilised in parallel by numerous processes or users, it is important to have some form of Locking enforced so that if a particular record is being modified or created, then another process is not allowed to simultaneously adjust the same record. If databases did not appoint locks, then the data could easily be overwritten and therefore become inconsistent and corrupt.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Tail and Grep: display all output but highlight search matches</title>
      <link>https://andrewodendaal.com/tail-and-grep-display-all-output-but-highlight-search-matches/</link>
      <pubDate>Thu, 30 Apr 2020 11:24:17 +0000</pubDate>
      <guid>https://andrewodendaal.com/tail-and-grep-display-all-output-but-highlight-search-matches/</guid>
      <description>&lt;p&gt;I &lt;code&gt;tail&lt;/code&gt; logs quite a lot.&lt;/p&gt;&#xA;&lt;p&gt;An example would be to tail the Apache2 access logs.&lt;/p&gt;&#xA;&lt;p&gt;This is simple to do:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;tail -f /var/log/apache2/access.log&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will show a trail of all access log entries as they come in.&lt;/p&gt;&#xA;&lt;p&gt;What if we only wanted to see when Googlebot accessed the site?&lt;/p&gt;&#xA;&lt;h2 id=&#34;highlight-entries&#34;&gt;Highlight entries&lt;/h2&gt;&#xA;&lt;p&gt;We could filter only these results:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;tail -f /var/log/apache2/access.log | grep -i googlebot&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will tail all logs, and &lt;code&gt;grep&lt;/code&gt; will only shows results for case-insensitive instances of &lt;code&gt;googlebot&lt;/code&gt; entries.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Convert URL String into a Javascript Object</title>
      <link>https://andrewodendaal.com/convert-url-string-into-a-javascript-object/</link>
      <pubDate>Wed, 29 Apr 2020 09:43:31 +0000</pubDate>
      <guid>https://andrewodendaal.com/convert-url-string-into-a-javascript-object/</guid>
      <description>&lt;p&gt;Sometimes you find yourself with a String, something like &lt;!-- raw HTML omitted --&gt; and you want to repeatably access elements of it correctly.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s say that you want to only get the origin of a URL, or maybe the host, or even protocol, how would you do this?&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-url-object&#34;&gt;The URL object&lt;/h2&gt;&#xA;&lt;p&gt;Javascript brings you the &lt;code&gt;URL&lt;/code&gt; object, which allows you to instantiate it with a string, and optionally a base to work from.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to make an HTTP Request in AWS Lambda using Python</title>
      <link>https://andrewodendaal.com/how-to-make-an-http-request-in-aws-lambda-using-python/</link>
      <pubDate>Tue, 28 Apr 2020 09:28:05 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-make-an-http-request-in-aws-lambda-using-python/</guid>
      <description>&lt;p&gt;The &lt;code&gt;requests&lt;/code&gt; module for Python is very useful in helping simplify HTTP/s requests from Python, but how would you use it in an AWS Lambda script?&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-8211-use-requests-import&#34;&gt;Option 1 – Use &lt;code&gt;requests&lt;/code&gt; import&lt;/h2&gt;&#xA;&lt;p&gt;The &lt;code&gt;requests&lt;/code&gt; library is very popular among Python enthusiasts.&lt;/p&gt;&#xA;&lt;p&gt;You will need to create a custom lambda layer and include &lt;code&gt;requests&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;This will allow you to use &lt;code&gt;import requests&lt;/code&gt; in your code.&lt;/p&gt;&#xA;&lt;h3 id=&#34;download-the-folder-package&#34;&gt;Download the folder package&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;pip install requests -t .&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Run this command on your local machine, then zip your working directory and upload to AWS.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to fix a Javascript Uncaught ReferenceError</title>
      <link>https://andrewodendaal.com/how-to-fix-a-javascript-uncaught-referenceerror/</link>
      <pubDate>Mon, 27 Apr 2020 10:13:14 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-fix-a-javascript-uncaught-referenceerror/</guid>
      <description>&lt;p&gt;Sometimes you may get an error that looks something like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Uncaught ReferenceError: &amp;lt;some_variable_or_function&amp;gt; is not defined&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;At first this can be quite the pain, but it usually just means that that variable, or function has either not been defined, or it isn&amp;rsquo;t ready for use yet.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s good practice to wrap this bit of code into a conditional check.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-original-code&#34;&gt;The original code&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;if (variable_or_function) {&#xA;    //console.log(variable_or_function);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;the-improved-code&#34;&gt;The improved code&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;if (typeof variable_or_function !== &amp;#39;undefined&amp;#39;) {&#xA;    //console.log(variable_or_function);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;alternate-methods&#34;&gt;Alternate methods&lt;/h2&gt;&#xA;&lt;p&gt;Does not execute if yourvar is &lt;code&gt;undefined&lt;/code&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Resolving InsufficientPrivilege Errors in Redshift</title>
      <link>https://andrewodendaal.com/resolving-insufficientprivilege-errors-in-redshift/</link>
      <pubDate>Sun, 26 Apr 2020 15:36:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/resolving-insufficientprivilege-errors-in-redshift/</guid>
      <description>&lt;p&gt;If you are getting the mysterious error:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;[ERROR] InsufficientPrivilege: permission denied for schema errors&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then you can easily resolve this by running the following SQL:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;GRANT USAGE ON SCHEMA &amp;lt;schema_name&amp;gt; TO &amp;lt;redshift_user&amp;gt;;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Another common error that often follows this, is:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;[ERROR] InsufficientPrivilege: permission denied for relation &amp;lt;table&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Luckily, this too can be resolved by running the following SQL:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;GRANT USAGE ON SCHEMA &amp;lt;schema_name&amp;gt; TO &amp;lt;redshift_user&amp;gt;;&#xA;GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA &amp;lt;schema_name&amp;gt; TO &amp;lt;redshift_user&amp;gt;;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to increase column size in Redshift database tables</title>
      <link>https://andrewodendaal.com/how-to-increase-column-size-in-redshift-database-tables/</link>
      <pubDate>Sat, 25 Apr 2020 03:47:46 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-increase-column-size-in-redshift-database-tables/</guid>
      <description>&lt;p&gt;It is only possible to alter &lt;code&gt;VARCHAR&lt;/code&gt; columns, and only under the following circumstances:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You can not alter a column with compression encodings &lt;code&gt;BYTEDICT&lt;/code&gt;, &lt;code&gt;RUNLENGTH&lt;/code&gt;, &lt;code&gt;TEXT255&lt;/code&gt;, or &lt;code&gt;TEXT32K&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;You can not decrease the size less than the maximum size of existing data.&lt;/li&gt;&#xA;&lt;li&gt;You can not alter columns with default values.&lt;/li&gt;&#xA;&lt;li&gt;You can not alter columns with &lt;code&gt;UNIQUE&lt;/code&gt;, &lt;code&gt;PRIMARY KEY&lt;/code&gt;, or &lt;code&gt;FOREIGN KEY&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;You can not alter columns inside a multi-statement block &lt;code&gt;(BEGIN...END)&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;sql-to-increase-the-size-of-redshift-alter-table&#34;&gt;SQL to increase the size of (Redshift Alter Table)&lt;/h2&gt;&#xA;&lt;p&gt;It&amp;rsquo;s very simple to perform a &lt;code&gt;Redshift Alter Table&lt;/code&gt; command to alter the column length, or alter the column varchar length:&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] The provided execution role does not have permissions to call CreateNetworkInterface on EC2</title>
      <link>https://andrewodendaal.com/the-provided-execution-role-does-not-have-permissions-to-call-createnetworkinterface-on-ec2/</link>
      <pubDate>Fri, 24 Apr 2020 10:36:30 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-provided-execution-role-does-not-have-permissions-to-call-createnetworkinterface-on-ec2/</guid>
      <description>&lt;p&gt;If you are trying to get an AWS Lambda added attached to a VPC, but get the error message:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;The provided execution role does not have permissions to call CreateNetworkInterface on EC2&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;there-are-3-ways-to-solve-this-problem&#34;&gt;There are 3 ways to solve this problem&lt;/h2&gt;&#xA;&lt;p&gt;Below we will look at 3 different options when it comes to solving this problem:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Fix the problem in Terraform&lt;/li&gt;&#xA;&lt;li&gt;Fix the problem in CloudFormation / SAM&lt;/li&gt;&#xA;&lt;li&gt;Fix the problem Manually in the AWS Console&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;how-to-fix-the-problem-in-terraform&#34;&gt;How to fix the problem in Terraform&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;resource &amp;#34;aws_iam_role_policy_attachment&amp;#34; &amp;#34;AWSLambdaVPCAccessExecutionRole&amp;#34; {&#xA;  role       = aws_iam_role.lambda.name&#xA;  policy_arn = &amp;#34;arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole&amp;#34;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-fix-the-problem-in-cloudformation&#34;&gt;How to fix the problem in CloudFormation&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Type: &amp;#34;AWS::IAM::Role&amp;#34;&#xA;Properties:&#xA;  RoleName: &amp;#34;lambda-with-vpc-access&amp;#34;&#xA;  ManagedPolicyArns:&#xA;    - &amp;#34;arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole&amp;#34;&#xA;  AssumeRolePolicyDocument:&#xA;    Version: &amp;#34;2012-10-17&amp;#34;&#xA;    Statement:&#xA;      - Effect: Allow&#xA;        Action:&#xA;          - sts:AssumeRole&#xA;        Principal:&#xA;          Service:&#xA;            - lambda.amazonaws.com&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-fix-this-problem-manually-in-the-aws-console&#34;&gt;How to fix this problem Manually in the AWS Console&lt;/h2&gt;&#xA;&lt;p&gt;Then you can resolve this by adding a custom Inline Policy to the Lambda execution role under the Permissions tab.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Entity and Referential Integrity in Relational Databases</title>
      <link>https://andrewodendaal.com/entity-and-referential-integrity-in-relational-databases/</link>
      <pubDate>Thu, 23 Apr 2020 15:27:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/entity-and-referential-integrity-in-relational-databases/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Data integrity is the overall completeness, accuracy and consistency of data (Techopedia, n.d.).&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;In order to achieve data integrity, it is important to analyse Entity and Referential integrity constraints.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Entity Integrity&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Focuses on Primary keys.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Each table should have a primary key and each record must be unique and not null.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Data Warehouses vs Data Marts</title>
      <link>https://andrewodendaal.com/data-warehouses-vs-data-marts/</link>
      <pubDate>Wed, 22 Apr 2020 12:13:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/data-warehouses-vs-data-marts/</guid>
      <description>&lt;p&gt;Although the terms &amp;ldquo;data warehouse&amp;rdquo; and &amp;ldquo;data mart&amp;rdquo; sound similar, they are quite different. It is important to first understand how they differ in order to define some characteristics and practical applications for each.&lt;/p&gt;&#xA;&lt;p&gt;Serra (2012) has a great explanation of data warehouses as being &amp;ldquo;a single organizational repository of enterprise-wide data across many or all subject areas&amp;rdquo;; while Inmon classifies the data mart as &amp;ldquo;a logical view or a physical extract of a larger data warehouse, usually isolated for the need to have a special data model or schema&amp;rdquo; (n.d.).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Amazon’s custom Whois date entry</title>
      <link>https://andrewodendaal.com/amazons-custom-whois-date-entry/</link>
      <pubDate>Tue, 21 Apr 2020 08:39:40 +0000</pubDate>
      <guid>https://andrewodendaal.com/amazons-custom-whois-date-entry/</guid>
      <description>&lt;p&gt;&lt;code&gt;Whois&lt;/code&gt; is an online service that let&amp;rsquo;s you know registration information about a website or IP address.&lt;/p&gt;&#xA;&lt;p&gt;For the most part, Whois aggregations are not that standard, however, per gTLD (&lt;code&gt;.com&lt;/code&gt;, &lt;code&gt;.net&lt;/code&gt;, &lt;code&gt;.yourkitchsink&lt;/code&gt;) they try their best to apply the same overall guidance and regulatory patterns.&lt;/p&gt;&#xA;&lt;p&gt;Most individuals, as well as businesses will go about registering their domain name through a service such as GoDaddy, Namecheap, or some other common domain registrar.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Graph Databases and their Properties</title>
      <link>https://andrewodendaal.com/graph-databases-and-their-properties/</link>
      <pubDate>Mon, 20 Apr 2020 11:41:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/graph-databases-and-their-properties/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;The concept of a graph in mathematics is simply a collection of elements which are typically called Nodes and are joined together by Edges. Each Node represents a piece of information in the graph and each Edge represents some relationship or connection between any of the two Nodes (Cox, 2017).&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;A graph database is simply a database that models itself on the connections that Nodes represent in a mathematical graph structure.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to add SSH keys to GitHub</title>
      <link>https://andrewodendaal.com/how-to-add-ssh-keys-to-github/</link>
      <pubDate>Sun, 19 Apr 2020 02:08:54 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-add-ssh-keys-to-github/</guid>
      <description>&lt;p&gt;When working with GitHub, you will need to identify yourself. The default way is using your username and password. However, you can also create an SSH key-pair that can be used instead.&lt;/p&gt;&#xA;&lt;p&gt;By using this technique, you can generate a password and not have to use it each and every time.&lt;/p&gt;&#xA;&lt;p&gt;You can also reuse your machine&amp;rsquo;s generated key-pair for other SSH services.&lt;/p&gt;&#xA;&lt;p&gt;A private and public key is created locally on your machine, and the private key always stays on your own machine. The public key can then be shared with services such as GitHub.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Get the Maximum Length of a Concatenated String with Unique Characters in Python</title>
      <link>https://andrewodendaal.com/get-the-maximum-length-of-a-concatenated-string-with-unique-characters-in-python/</link>
      <pubDate>Sat, 18 Apr 2020 12:00:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-the-maximum-length-of-a-concatenated-string-with-unique-characters-in-python/</guid>
      <description>&lt;h2 id=&#34;the-problem&#34;&gt;The problem&lt;/h2&gt;&#xA;&lt;p&gt;Given an array of strings &lt;code&gt;arr&lt;/code&gt;. String &lt;code&gt;s&lt;/code&gt; is a concatenation of a sub-sequence of &lt;code&gt;arr&lt;/code&gt; which have &lt;strong&gt;unique characters&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Return &lt;em&gt;the maximum possible length&lt;/em&gt; of &lt;code&gt;s&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;example-test-cases&#34;&gt;Example test-cases&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 3:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;constraints&#34;&gt;Constraints&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;1 &amp;lt;= arr.length &amp;lt;= 16&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;1 &amp;lt;= arr[i].length &amp;lt;= 26&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;arr[i]&lt;/code&gt; contains only lower case English letters.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;how-to-write-the-code&#34;&gt;How to write the code&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def maxLength(arr: List[str]) -&amp;gt; int:&#xA;  result = [float(&amp;#39;-inf&amp;#39;)]&#xA;&#xA;  unique_char(&amp;#34;&amp;#34;, arr, 0, result)&#xA;&#xA;  if not result[0] == float(&amp;#39;-inf&amp;#39;):&#xA;    return result[0]&#xA;  return 0&#xA;&#xA;&#xA;def unique_char(cur, arr, index, result):&#xA;  # End of the array&#xA;  if index == len(arr):&#xA;    return&#xA;&#xA;  # Iterating from the current word to the end of the array&#xA;  for index in range(index,len(arr)):&#xA;&#xA;    # If current word + next word have all unique characters&#xA;    if len(set(cur + arr[index])) == len(list(cur + arr[index])):&#xA;      # Compare the actual lenth with the previous max&#xA;      result[0] = max(result[0],len(cur + arr[index]))&#xA;      # Make a new call with concatenate words&#xA;      unique_char(cur + arr[index], arr, index + 1,result)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Apache Kafka’s Role in Big Data Streaming Analytics</title>
      <link>https://andrewodendaal.com/apache-kafkas-role-in-big-data-streaming-analytics/</link>
      <pubDate>Fri, 17 Apr 2020 12:15:55 +0000</pubDate>
      <guid>https://andrewodendaal.com/apache-kafkas-role-in-big-data-streaming-analytics/</guid>
      <description>&lt;p&gt;The world of Big Data started out as a way of storing and querying obscene amounts of information by comparison to what yesteryears were able to achieve. However, most value in said data is primarily found in the real time or streaming information that is presented as it first enters the system. As data gets old, it also gets stale and less useful to many business systems.&lt;/p&gt;&#xA;&lt;p&gt;Streaming analytics platforms have come a long way with numerous open source projects offering advanced products such as Flink, Spark Streaming, Samza and Storm; which are all at the forefront of the arena in their respective strengths.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Mitigating Risks with Software Development Outsourcing</title>
      <link>https://andrewodendaal.com/mitigating-risks-with-software-development-outsourcing/</link>
      <pubDate>Thu, 16 Apr 2020 12:30:46 +0000</pubDate>
      <guid>https://andrewodendaal.com/mitigating-risks-with-software-development-outsourcing/</guid>
      <description>&lt;p&gt;In the Oxford Dictionary, the term &amp;ldquo;outsourcing&amp;rdquo; is simply defined as obtaining goods or services by contract from an outside supplier (OxfordDictionaries.com, n.d.).&lt;/p&gt;&#xA;&lt;p&gt;When it comes to software development, the same is true, with many companies opting to use economically cheaper labour to extend or swap out their workforce in order to enhance their endeavours and reduce costs across the board.&lt;/p&gt;&#xA;&lt;p&gt;Countries such as India, Russia, China and Mexico have a lower Cost of Living (Numbeo.com, 2017) and are among the most common places to outsource to (Lisa DiCarlo, 2003).&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Primary Data Types in Java</title>
      <link>https://andrewodendaal.com/the-primary-data-types-in-java/</link>
      <pubDate>Wed, 15 Apr 2020 11:08:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-primary-data-types-in-java/</guid>
      <description>&lt;p&gt;In Java there are eight basic data types; which are: &lt;code&gt;byte&lt;/code&gt;, &lt;code&gt;short&lt;/code&gt;, &lt;code&gt;int&lt;/code&gt;, &lt;code&gt;long&lt;/code&gt;, &lt;code&gt;float&lt;/code&gt;, &lt;code&gt;double&lt;/code&gt;, &lt;code&gt;boolean&lt;/code&gt; and &lt;code&gt;char&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;It could realistically be said that a Java developer&amp;rsquo;s time is primarily spent using these particular variable types to store, retrieve and manipulate data to complete most programming tasks. However, there are many times that these primitive variables don&amp;rsquo;t quite suffice and additional data types need to be explored and used instead.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Comparing Objects in Java</title>
      <link>https://andrewodendaal.com/comparing-objects-in-java/</link>
      <pubDate>Tue, 14 Apr 2020 08:16:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/comparing-objects-in-java/</guid>
      <description>&lt;p&gt;&lt;em&gt;TLDR;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;when-to-use--in-java&#34;&gt;When to use &lt;code&gt;==&lt;/code&gt; in Java&lt;/h3&gt;&#xA;&lt;p&gt;When comparing two operands. It is used to check whether two operands are equal or not.&lt;!-- raw HTML omitted --&gt;It&amp;rsquo;s best to only use it when working with primitive data types, such as &lt;!-- raw HTML omitted --&gt;int&lt;!-- raw HTML omitted --&gt;, &lt;!-- raw HTML omitted --&gt;float&lt;!-- raw HTML omitted --&gt;, &lt;!-- raw HTML omitted --&gt;char&lt;!-- raw HTML omitted --&gt; or sometimes even &lt;!-- raw HTML omitted --&gt;Booleans&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Overloading Operators in Java</title>
      <link>https://andrewodendaal.com/overloading-operators-in-java/</link>
      <pubDate>Mon, 13 Apr 2020 03:42:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/overloading-operators-in-java/</guid>
      <description>&lt;p&gt;As with many programming languages such as C, C++ and C# (known commonly as the C family), it is possible to &amp;ldquo;overload methods&amp;rdquo; (sometimes called functions if not used in classes, such as C) in order to take a different amount of parameters so that they can be used in multiple scenarios with similar internals.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2017/04/image01-1.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;As Java is derived from the C style of languages (C family), it too can perform Method Overloading.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>uncaught typeerror: $ is not a function</title>
      <link>https://andrewodendaal.com/uncaught-typeerror-is-not-a-function/</link>
      <pubDate>Sun, 12 Apr 2020 10:45:08 +0000</pubDate>
      <guid>https://andrewodendaal.com/uncaught-typeerror-is-not-a-function/</guid>
      <description>&lt;p&gt;The &lt;code&gt;dollar-sign&lt;/code&gt; (&lt;code&gt;$&lt;/code&gt;) in Javascript has for many years now been associated with jQuery.&lt;/p&gt;&#xA;&lt;p&gt;When you see this error:&lt;/p&gt;&#xA;&lt;p&gt;&amp;ldquo;uncaught typeerror: $ &lt;a href=&#34;https://andrewodendaal.com/how-to-write-anonymous-functions-in-javascript/&#34;&gt;is not a function&lt;/a&gt;&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;It almost always means that a jQuery piece of code is being run before the jQuery library has been initialised and loaded.&lt;/p&gt;&#xA;&lt;p&gt;Oftentimes, your code will wait for jQuery to load before continuing any processing, this is almost always done as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$(document).ready(function(){&#xA;    // jQuery code is in here&#xA;});&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;However, it&amp;rsquo;s not uncommon to get an &amp;ldquo;TypeError: $ &lt;a href=&#34;https://andrewodendaal.com/how-to-write-anonymous-functions-in-javascript/&#34;&gt;is not a function&lt;/a&gt;&amp;rdquo; error in response.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get the last element of a list in Python</title>
      <link>https://andrewodendaal.com/how-to-get-the-last-element-of-a-list-in-python/</link>
      <pubDate>Sat, 11 Apr 2020 13:55:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-last-element-of-a-list-in-python/</guid>
      <description>&lt;p&gt;Let&amp;rsquo;s say that you have a Python list with the following 5 foods:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;foods = [&amp;#34;pizza&amp;#34;, &amp;#34;pasta&amp;#34;, &amp;#34;steak&amp;#34;, &amp;#34;chicken&amp;#34;, &amp;#34;olives&amp;#34;]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;How do we go about getting the last item?&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1&#34;&gt;Option 1&lt;/h2&gt;&#xA;&lt;p&gt;It&amp;rsquo;s actually really easy, you can select the index item by it&amp;rsquo;s total length minus one.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;last_item = foods[len(foods)-1]&#xA;&#xA;# &amp;#34;olives&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;option-2&#34;&gt;Option 2&lt;/h2&gt;&#xA;&lt;p&gt;Python has some really fantastic functionality around making your life easier. One of those such things is the ability to use &lt;code&gt;slices&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to embed a web server in your Python3 app</title>
      <link>https://andrewodendaal.com/how-to-embed-a-web-server-in-your-python3-app/</link>
      <pubDate>Fri, 10 Apr 2020 09:50:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-embed-a-web-server-in-your-python3-app/</guid>
      <description>&lt;p&gt;This is not the first time that I created a Python3 application that spat out some output and required access to it via an HTTP server.&lt;/p&gt;&#xA;&lt;p&gt;While there are numerous ways to achieve this, a really simple way is to embed an HTTP server directly in your Python3 application, and have it serve your output directly when called.&lt;/p&gt;&#xA;&lt;h2 id=&#34;a-sample-web-server-in-python&#34;&gt;A sample web server in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from http.server import HTTPServer, BaseHTTPRequestHandler&#xA;&#xA;&#xA;class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):&#xA;&#xA;    def do_GET(self):&#xA;        self.send_response(200)&#xA;        self.end_headers()&#xA;        # Add additional output here&#xA;        self.wfile.write(b&amp;#39;Hello, world!&amp;#39;)&#xA;&#xA;&#xA;httpd = HTTPServer((&amp;#39;&amp;#39;, 8000), SimpleHTTPRequestHandler)&#xA;httpd.serve_forever()&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to get the Range Sum of Binary Search Tree using Java</title>
      <link>https://andrewodendaal.com/how-to-get-the-range-sum-of-binary-search-tree-using-java/</link>
      <pubDate>Thu, 09 Apr 2020 09:48:26 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-range-sum-of-binary-search-tree-using-java/</guid>
      <description>&lt;p&gt;Given the &lt;code&gt;root&lt;/code&gt; node of a binary search tree, return the sum of values of all nodes with value between &lt;code&gt;L&lt;/code&gt; and &lt;code&gt;R&lt;/code&gt; (inclusive).&lt;/p&gt;&#xA;&lt;p&gt;The binary search tree is guaranteed to have unique values.&lt;/p&gt;&#xA;&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;&#xA;&lt;p&gt;Example1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Input: root = [10,5,15,3,7,null,18], L = 7, R = 15&#xA;Output: 32&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Example2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Input: root = [10,5,15,3,7,13,18,1,null,6], L = 6, R = 10&#xA;Output: 23&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;our-solution-in-java&#34;&gt;Our solution in Java&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;/**&#xA; * Definition for a binary tree node.&#xA; * public class TreeNode {&#xA; *     int val;&#xA; *     TreeNode left;&#xA; *     TreeNode right;&#xA; *     TreeNode(int x) { val = x; }&#xA; * }&#xA; */&#xA;class Solution {&#xA;    public int rangeSumBST(TreeNode root, int L, int R) {&#xA;        //output variable&#xA;        int output = 0;&#xA;        &#xA;        // Create a stack&#xA;        Stack&amp;lt;TreeNode&amp;gt; stack = new Stack();&#xA;        // Add the root node&#xA;        stack.push(root);&#xA;        &#xA;        // loop through each element &#xA;        while (!stack.isEmpty()) {&#xA;            &#xA;            // remove last item from stack&#xA;            TreeNode node = stack.pop();&#xA;            // if the node exists&#xA;            if (node != null) {&#xA;                &#xA;                // incrememnt output counts&#xA;                if (L &amp;lt;= node.val &amp;amp;&amp;amp; node.val &amp;lt;= R)&#xA;                    output += node.val;&#xA;                &#xA;                // push if left&#xA;                if (L &amp;lt; node.val)&#xA;                    stack.push(node.left);&#xA;                &#xA;                // push if right&#xA;                if (node.val &amp;lt; R)&#xA;                    stack.push(node.right);&#xA;            }&#xA;        }&#xA;        &#xA;        // return our count&#xA;        return output;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to duplicate zeros in place using Python</title>
      <link>https://andrewodendaal.com/how-to-duplicate-zeros-in-place-using-python/</link>
      <pubDate>Wed, 08 Apr 2020 14:00:15 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-duplicate-zeros-in-place-using-python/</guid>
      <description>&lt;p&gt;Given a fixed length array &lt;code&gt;arr&lt;/code&gt; of integers, duplicate each occurrence of zero, shifting the remaining elements to the right.&lt;/p&gt;&#xA;&lt;p&gt;Note that elements beyond the length of the original array are not written.&lt;/p&gt;&#xA;&lt;p&gt;Do the above modifications to the input array &lt;strong&gt;in place&lt;/strong&gt;, do not return anything from your function.&lt;/p&gt;&#xA;&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;&#xA;&lt;p&gt;Example1:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Input: [1,0,2,3,0,4,5,0]&#xA;Output: null&#xA;Explanation: After calling your function, the input array is modified to: [1,0,0,2,3,0,0,4]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Example2:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Input: [1,2,3]&#xA;Output: null&#xA;Explanation: After calling your function, the input array is modified to: [1,2,3]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;writing-the-code&#34;&gt;Writing the code&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;# declare our function&#xA;def duplicateZeros(arr):&#xA;&#xA;    # create our incrementor&#xA;    i = 0&#xA;&#xA;    # loop through all dynamic elements&#xA;    while i &amp;lt; len(arr)-1:&#xA;        # if the character is a zero&#xA;        if arr[i]==0:&#xA;            # remove the last item from the array&#xA;            arr.pop()&#xA;            # insert a zero in front of current element&#xA;            arr.insert(i+1, 0)&#xA;            # move one place forward&#xA;            i += 1&#xA;&#xA;        # increment to the next character&#xA;        i += 1&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>A Quick Introduction to Asyncio in Python3</title>
      <link>https://andrewodendaal.com/a-quick-introduction-to-asyncio-in-python3/</link>
      <pubDate>Tue, 07 Apr 2020 12:26:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/a-quick-introduction-to-asyncio-in-python3/</guid>
      <description>&lt;p&gt;Python has never been the best at doing multiple things at the same time.&lt;/p&gt;&#xA;&lt;p&gt;While there are ways to mostly resolve this, such as using the &lt;a href=&#34;https://andrewodendaal.com/multiprocessing-in-python3/&#34;&gt;Multiprocessing library&lt;/a&gt;, it always seems a bit make-shift to me.&lt;/p&gt;&#xA;&lt;p&gt;So many other languages have fantastic ways of resolving these types of issues, and Python now has an &lt;code&gt;Async&lt;/code&gt; way too!&lt;/p&gt;&#xA;&lt;h2 id=&#34;introducing-asyncio&#34;&gt;Introducing Asyncio&lt;/h2&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;https://docs.python.org/3/library/asyncio.html&#34;&gt;https://docs.python.org/3/library/asyncio.html&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to replace newlines with commas in CLI</title>
      <link>https://andrewodendaal.com/how-to-replace-newlines-with-commas-in-cli/</link>
      <pubDate>Mon, 06 Apr 2020 11:10:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-replace-newlines-with-commas-in-cli/</guid>
      <description>&lt;p&gt;If you need to replace all newline characters with a comma, or perhaps some other delimiter, then using the build-in &lt;code&gt;tr&lt;/code&gt; utility will work very well for you.&lt;/p&gt;&#xA;&lt;p&gt;Possible use-cases for this is if you need to transport a configuration file with multiple lines into a single input field, or store the file&amp;rsquo;s contents within an environment variable.&lt;/p&gt;&#xA;&lt;p&gt;My personal use-case was to store an &lt;code&gt;~/.aws/credentials&lt;/code&gt; file in an environment variable.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to make a disk cache using PHP</title>
      <link>https://andrewodendaal.com/how-to-make-a-disk-cache-using-php/</link>
      <pubDate>Sun, 05 Apr 2020 17:04:01 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-make-a-disk-cache-using-php/</guid>
      <description>&lt;p&gt;If you have a busy PHP driven website and don&amp;rsquo;t want to make constant queries to the database for each user that will see the same data, then you can easily resolve this problem by letting the first of these visitors generate a cache for the consecutive visitors. This technique is similar to other PHP performance optimizations like &lt;a href=&#34;https://andrewodendaal.com/a-php-mail-class&#34;&gt;using a PHP mail class&lt;/a&gt; or &lt;a href=&#34;https://andrewodendaal.com/sending-data-from-javascript-to-php&#34;&gt;sending data from JavaScript to PHP&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Letting this cache last for a few minutes allows your database to not get overloaded and allows for a much faster website experience as well as a much cheaper hosting bill for you at the end of the month.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to remove files without a certain extension?</title>
      <link>https://andrewodendaal.com/how-to-remove-files-without-a-certain-extension/</link>
      <pubDate>Sat, 04 Apr 2020 09:34:11 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-remove-files-without-a-certain-extension/</guid>
      <description>&lt;p&gt;You have a directory with a lot of files, and you want to delete only the files that don&amp;rsquo;t match a specific extension.&lt;/p&gt;&#xA;&lt;p&gt;This is a simple task when using the &lt;code&gt;find&lt;/code&gt; command-line utility.&lt;/p&gt;&#xA;&lt;h2 id=&#34;delete-a-single-extension&#34;&gt;Delete a single extension&lt;/h2&gt;&#xA;&lt;p&gt;You can delete all files that do not have the following &lt;code&gt;*.txt&lt;/code&gt; extension:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;find . -type f ! -name &amp;#34;*.txt&amp;#34; -exec rm {} \;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;delete-multiple-extensions&#34;&gt;Delete multiple extensions&lt;/h2&gt;&#xA;&lt;p&gt;You can delete all files that do not have the following &lt;code&gt;*.txt&lt;/code&gt; or &lt;code&gt;*.exe&lt;/code&gt; extensions.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to debug an Apache 404 error</title>
      <link>https://andrewodendaal.com/how-to-debug-an-apache-404-error/</link>
      <pubDate>Fri, 03 Apr 2020 14:55:11 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-debug-an-apache-404-error/</guid>
      <description>&lt;p&gt;So you are getting an error &lt;code&gt;404&lt;/code&gt; or perhaps even worse, a &lt;code&gt;500&lt;/code&gt;!&lt;/p&gt;&#xA;&lt;p&gt;The error in your Apache2 logs looks something like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;***.162.245.*** - - [03/Apr/2020:12:49:50 +0000] &amp;quot;GET /robots.txt HTTP/1.1&amp;quot; 404 89670 &amp;quot;-&amp;quot; &amp;quot;Mozilla/5.0 (compatible; SomeUserAgent/2.1; +https://example.com)&amp;quot;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;In a perfect world, you&amp;rsquo;d only have a single site/domain on this host, so will know that the &lt;code&gt;robots.txt&lt;/code&gt; file would reside in the Apache root serving directory.&lt;/p&gt;&#xA;&lt;p&gt;However, I just happen to (as you?) have a ton of VirtualHosts on this machine, so am not sure which &lt;code&gt;robots.txt&lt;/code&gt; file is missing..&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Reorder Data in Log Files using Python</title>
      <link>https://andrewodendaal.com/how-to-reorder-data-in-log-files-using-python/</link>
      <pubDate>Thu, 02 Apr 2020 12:08:06 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reorder-data-in-log-files-using-python/</guid>
      <description>&lt;p&gt;Let&amp;rsquo;s say that you have an array or a list, or &lt;code&gt;logs&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Each of these logs is a space-delimited string of words.&lt;/p&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;logs = [&amp;quot;dig1 8 1 5 1&amp;quot;,&amp;quot;let1 art can&amp;quot;,&amp;quot;dig2 3 6&amp;quot;,&amp;quot;let2 own kit dig&amp;quot;,&amp;quot;let3 art zero&amp;quot;]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;The task is to reorder these logs and return them in the following acceptance criteria:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The first entry (identifier) of each log is ignored but still returned&lt;/li&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;The letter-logs&lt;!-- raw HTML omitted --&gt; are returned before the digit-logs&lt;/li&gt;&#xA;&lt;li&gt;The identifier is only used to sort these there is a tie&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;how-to-analyse-the-problem&#34;&gt;How to analyse the problem&lt;/h2&gt;&#xA;&lt;p&gt;At first glance, this appears to be something that could be easily solved by looping through each log entry and if the second part of the entry is a &lt;code&gt;string&lt;/code&gt; type, then adding it to a &lt;code&gt;tempA&lt;/code&gt; list, otherwise adding it to a &lt;code&gt;tempB&lt;/code&gt; list.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Another WTF Javascript Moment</title>
      <link>https://andrewodendaal.com/another-wtf-javascript-moment/</link>
      <pubDate>Wed, 01 Apr 2020 14:06:51 +0000</pubDate>
      <guid>https://andrewodendaal.com/another-wtf-javascript-moment/</guid>
      <description>&lt;p&gt;Javascript is a powerful language, but sometimes it doesn&amp;rsquo;t always do what you expect it to.&lt;/p&gt;&#xA;&lt;p&gt;Take the following expression for example. It&amp;rsquo;s a simple &lt;code&gt;if&lt;/code&gt; statement that checks to see if &lt;code&gt;true&lt;/code&gt; and then runs the code within the block.&lt;/p&gt;&#xA;&lt;p&gt;Running the code results in the block being executed, however, when we directly compare the statement&amp;rsquo;s comparison against a false value, we can see that it is in fact, not actually true.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Bring Back GROUP BY in MySQL</title>
      <link>https://andrewodendaal.com/how-to-bring-back-group-by-in-mysql/</link>
      <pubDate>Tue, 31 Mar 2020 10:28:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-bring-back-group-by-in-mysql/</guid>
      <description>&lt;p&gt;If you are suddenly not able to perform &lt;code&gt;GROUP BY&lt;/code&gt; statements as you used to after a MySQL/MariaDB version update, then you will have noticed the change forced upon you.&lt;/p&gt;&#xA;&lt;p&gt;You can re-enable the previous &lt;code&gt;GROUP BY&lt;/code&gt; behaviour by editing your &lt;code&gt;/etc/mysql/my.cnf&lt;/code&gt; and adding in the following line below the &lt;code&gt;[mysqld]&lt;/code&gt; section:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[mysqld]&#xA;sql_mode = &amp;#34;STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will allow you to &lt;code&gt;GROUP BY&lt;/code&gt; without having to return all those specific columns as well.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to implement a Queue using Stacks in Python</title>
      <link>https://andrewodendaal.com/how-to-implement-a-queue-using-stacks-in-python/</link>
      <pubDate>Mon, 30 Mar 2020 11:01:58 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-implement-a-queue-using-stacks-in-python/</guid>
      <description>&lt;p&gt;A common programming interview question, and for a change, one that you will actually be able to use in the job, is that of implementing a Queue by means of using Stacks in Python.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-5-common-operations-of-a-queue&#34;&gt;The 5 common operations of a Queue&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Instantiation&lt;/li&gt;&#xA;&lt;li&gt;push(val)&lt;/li&gt;&#xA;&lt;li&gt;pop()&lt;/li&gt;&#xA;&lt;li&gt;peek()&lt;/li&gt;&#xA;&lt;li&gt;empty()&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;what-each-operation-does&#34;&gt;What each operation does&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;Instantiation&lt;/code&gt; is the Queue&amp;rsquo;s storage object that will be used.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class MyQueue:&#xA;&#xA;    def __init__(self):&#xA;        &amp;#34;&amp;#34;&amp;#34;&#xA;        Initialize your data structure here.&#xA;        &amp;#34;&amp;#34;&amp;#34;&#xA;        self.stack = []&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;push(val)&lt;/code&gt; is the way to add data to the Queue.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find positions of largest groups of characters in a String with Python</title>
      <link>https://andrewodendaal.com/find-positions-of-largest-groups-of-characters-in-a-string-with-python/</link>
      <pubDate>Sun, 29 Mar 2020 14:53:15 +0000</pubDate>
      <guid>https://andrewodendaal.com/find-positions-of-largest-groups-of-characters-in-a-string-with-python/</guid>
      <description>&lt;h2 id=&#34;the-question&#34;&gt;The question&lt;/h2&gt;&#xA;&lt;p&gt;Take a string &lt;code&gt;S&lt;/code&gt; of lowercase letters.&lt;/p&gt;&#xA;&lt;p&gt;These letters form consecutive groupings of like characters.&lt;/p&gt;&#xA;&lt;p&gt;Find groups with 3 or more like characters and return a list of lists of starting and ending index for each character group.&lt;/p&gt;&#xA;&lt;h2 id=&#34;elaboration-and-examples&#34;&gt;Elaboration and examples&lt;/h2&gt;&#xA;&lt;p&gt;If we show an example, we could say &lt;code&gt;S = &amp;quot;abbcccdeffffy&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This string has 2 groups, &lt;code&gt;c&lt;/code&gt; and &lt;code&gt;f&lt;/code&gt; who&amp;rsquo;s consecutive characters are of 3 or more.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to make Git “forget” about a file that was tracked but is now in .gitignore?</title>
      <link>https://andrewodendaal.com/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore/</link>
      <pubDate>Sat, 28 Mar 2020 12:17:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore/</guid>
      <description>&lt;p&gt;You can ignore certain files and folders from being committed to Git by means of including a &lt;code&gt;.gitignore&lt;/code&gt; file.&lt;/p&gt;&#xA;&lt;p&gt;Unfortunately, you may have forgotten to include certain entries and now find that there are files and/or folders that git will want to commit.&lt;/p&gt;&#xA;&lt;p&gt;To start with, you should make sure that the relative path to the file or folder is included in your &lt;code&gt;.gitignore&lt;/code&gt; file.&lt;/p&gt;&#xA;&lt;p&gt;Then run one of the below commands.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Purge the BinLog for MySQL and MariaDB</title>
      <link>https://andrewodendaal.com/how-to-purge-the-binlog-for-mysql-and-mariadb/</link>
      <pubDate>Fri, 27 Mar 2020 12:30:51 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-purge-the-binlog-for-mysql-and-mariadb/</guid>
      <description>&lt;p&gt;If you see lots of disk space quickly disappearing on your MySQL or MariaDB server, then you may want to look into the &lt;code&gt;BinLog&lt;/code&gt; directory, it is located at &lt;code&gt;/var/log/mysql/&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In my case I saw this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;usr@server-1:/var/log/mysql# ll&#xA;total 5571044&#xA;drwxr-s---  2 x x         4096 Mar 25 18:18 ./&#xA;drwxrwxr-x 12 x  x      4096 Mar 25 05:25 ../&#xA;-rw-rw----  1 x x    104857748 Mar 23 09:29 mariadb-bin.000301&#xA;-rw-rw----  1 x x    104859422 Mar 23 10:07 mariadb-bin.000302&#xA;-rw-rw----  1 x x    104857708 Mar 23 11:10 mariadb-bin.000303&#xA;-rw-rw----  1 x x    104860750 Mar 23 12:29 mariadb-bin.000304&#xA;...truncated...&#xA;-rw-rw----  1 x x    104857809 Mar 25 16:46 mariadb-bin.000352&#xA;-rw-rw----  1 x x    104858231 Mar 25 17:17 mariadb-bin.000353&#xA;-rw-rw----  1 x x    104857709 Mar 25 18:18 mariadb-bin.000354&#xA;-rw-rw----  1 x x     24833125 Mar 25 18:32 mariadb-bin.000355&#xA;-rw-rw----  1 x x         1870 Mar 25 18:18 mariadb-bin.index&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I looked to see how much space this was all taking:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Measure Execution Time in Google Colab</title>
      <link>https://andrewodendaal.com/how-to-measure-execution-time-in-google-colab/</link>
      <pubDate>Thu, 26 Mar 2020 16:19:21 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-measure-execution-time-in-google-colab/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Google Colab&lt;!-- raw HTML omitted --&gt; is a fantastic environment to write Python code using Jupyter Notebooks, hosted for free by Google.&lt;/p&gt;&#xA;&lt;p&gt;If you&amp;rsquo;ve ever used Jupyter Notebooks before, it is the same principle, you write Python code in a cell and you are able to execute each cell as you require.&lt;/p&gt;&#xA;&lt;h2 id=&#34;measure-execution-time&#34;&gt;Measure Execution Time&lt;/h2&gt;&#xA;&lt;p&gt;But how would you measure the time each cell takes to execute?&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to fake a User Agent in Python</title>
      <link>https://andrewodendaal.com/how-to-fake-a-user-agent-in-python/</link>
      <pubDate>Wed, 25 Mar 2020 14:49:49 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-fake-a-user-agent-in-python/</guid>
      <description>&lt;p&gt;A &lt;code&gt;User-Agent&lt;/code&gt; is a bunch of text that is sent with every HTTP and HTTPS request. The server processing this request is able to determine what type of device and browser has made the request.&lt;/p&gt;&#xA;&lt;p&gt;Often times servers use this parameter to restrict access to the resource.&lt;/p&gt;&#xA;&lt;p&gt;However, it&amp;rsquo;s easy to fake a User-Agent when using Python to make HTTP and HTTPS requests.&lt;/p&gt;&#xA;&lt;h2 id=&#34;using-requests-library&#34;&gt;Using Requests Library&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import requests&#xA;&#xA;user_agent = &amp;#39;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36&amp;#39;&#xA;&#xA;response = requests.get(&amp;#39;https://andrewodendaal.com&amp;#39;, headers={&amp;#39;User-Agent&amp;#39;: user_agent})&#xA;html = response.content&#xA;print(response.content)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;using-urllib-library&#34;&gt;Using URLLib Library&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import urllib.request&#xA;&#xA;user_agent = &amp;#39;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36&amp;#39;&#xA;&#xA;request = urllib.request.Request(&amp;#39;https://andrewodendaal.com&amp;#39;, headers={&amp;#39;User-Agent&amp;#39;: user_agent})&#xA;response = urllib.request.urlopen(request)&#xA;html = response.read()&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Delete from a Table where rows match in Another Table – MySQL</title>
      <link>https://andrewodendaal.com/how-to-delete-from-a-table-where-rows-match-in-another-table-mysql/</link>
      <pubDate>Tue, 24 Mar 2020 09:58:34 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-delete-from-a-table-where-rows-match-in-another-table-mysql/</guid>
      <description>&lt;p&gt;So you have a table where you want to delete a bunch of rows, based on a particular column being matched in another table.&lt;/p&gt;&#xA;&lt;p&gt;This is easily achievable with MySQL.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DELETE FROM TABLE1&#xA;WHERE domain IN (&#xA;&#x9;SELECT domain FROM TABLE2&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The above SQL will delete all rows in &lt;code&gt;TABLE1&lt;/code&gt; that are found in &lt;code&gt;TABLE2&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;But what if we need to limit which records are returned from &lt;code&gt;TABLE2&lt;/code&gt;?&lt;/p&gt;&#xA;&lt;p&gt;That&amp;rsquo;s simple too. All we need to do is add a traditional &lt;code&gt;WHERE&lt;/code&gt; clause to our select statement.&lt;/p&gt;</description>
    </item>
    <item>
      <title>REPLACE INTO instead of INSERT INTO – MySQL</title>
      <link>https://andrewodendaal.com/replace-into-instead-of-insert-into-mysql/</link>
      <pubDate>Mon, 23 Mar 2020 13:52:24 +0000</pubDate>
      <guid>https://andrewodendaal.com/replace-into-instead-of-insert-into-mysql/</guid>
      <description>&lt;p&gt;There are many occasions where you need to &lt;code&gt;INSERT&lt;/code&gt; a record into a MySQL database table, but the record already exists.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;INSERT INTO queue_domains (domain) VALUES(&#39;statvoo.com&#39;)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;This will result in a &lt;code&gt;Duplicate entry &#39;statvoo.com&#39; for key &#39;domain&#39;&lt;/code&gt; error&lt;/p&gt;&#xA;&lt;p&gt;A nice and simple way to resolve this is to use &lt;code&gt;REPLACE INTO&lt;/code&gt; instead.&lt;/p&gt;&#xA;&lt;p&gt;This will look to see if the item already exists and will simply replace it.&lt;/p&gt;&#xA;&lt;p&gt;This is faster than doing a &lt;code&gt;SELECT&lt;/code&gt; followed by an &lt;code&gt;INSERT&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Read the bottom n lines of a file in Python</title>
      <link>https://andrewodendaal.com/read-the-bottom-n-lines-of-a-file-in-python/</link>
      <pubDate>Sun, 22 Mar 2020 11:02:44 +0000</pubDate>
      <guid>https://andrewodendaal.com/read-the-bottom-n-lines-of-a-file-in-python/</guid>
      <description>&lt;h2 id=&#34;using-operating-system-commands-in-python&#34;&gt;Using Operating System Commands in Python&lt;/h2&gt;&#xA;&lt;p&gt;Use the Linux/Mac &lt;code&gt;tail&lt;/code&gt; command to provide the data:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;line = subprocess.check_output([&amp;#39;tail&amp;#39;, &amp;#39;-1&amp;#39;, somefile.txt])&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;creating-a-python-only-script&#34;&gt;Creating a Python Only Script&lt;/h2&gt;&#xA;&lt;p&gt;Read the whole file into memory and only print out the last line/s:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;with open(&amp;#39;somefile.txt&amp;#39;, &amp;#39;r&amp;#39;) as f:&#xA;    lines = f.read().splitlines()&#xA;    last_line = lines[-1]&#xA;    print(last_line)&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Format a Number as a Currency in Javascript</title>
      <link>https://andrewodendaal.com/how-to-format-a-number-as-a-currency-in-javascript/</link>
      <pubDate>Sat, 21 Mar 2020 13:54:03 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-format-a-number-as-a-currency-in-javascript/</guid>
      <description>&lt;p&gt;There are quite a few ways to format a number as a currency value in Javascript. This is a common task when building web applications, similar to other string manipulations like &lt;a href=&#34;https://andrewodendaal.com/remove-hash-from-window-location-in-javascript&#34;&gt;removing hash from window location&lt;/a&gt; or &lt;a href=&#34;https://andrewodendaal.com/how-to-tell-if-a-string-contains-a-substring-in-javascript&#34;&gt;checking if a string contains a substring&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;doing-it-yourself&#34;&gt;Doing it yourself&lt;/h2&gt;&#xA;&lt;p&gt;The easiest of which is that of using the built-in &lt;code&gt;toFixed()&lt;/code&gt; method.&lt;/p&gt;&#xA;&lt;p&gt;Often times you will either have a string, integer or floating-point number (/double) and will need to output a value that looks like a currency.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Change the Timezone on Ubuntu Server</title>
      <link>https://andrewodendaal.com/how-to-change-the-timezone-on-ubuntu-server/</link>
      <pubDate>Fri, 20 Mar 2020 10:42:32 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-change-the-timezone-on-ubuntu-server/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;ve ever typed &lt;code&gt;date&lt;/code&gt; into your Ubuntu Server and seen a different time or timezone appear than you expected, then it probably means that this tutorial is for you.&lt;/p&gt;&#xA;&lt;h2 id=&#34;check-current-timezone&#34;&gt;Check current timezone&lt;/h2&gt;&#xA;&lt;p&gt;Start by checking what data is returned using the following command:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;timedatectl&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;In my case, I wanted to make sure my server&amp;rsquo;s time was in UTC, London. However, it was reported as being in Berlin.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ timedatectl&#xA;&#xA;                      Local time: Fri 2020-03-20 11:08:41 CET&#xA;                  Universal time: Fri 2020-03-20 10:08:41 UTC&#xA;                        RTC time: Fri 2020-03-20 10:08:42&#xA;                       Time zone: Europe/Berlin (CET, +0100)&#xA;       System clock synchronized: yes&#xA;systemd-timesyncd.service active: yes&#xA;                 RTC in local TZ: no&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Ubuntu uses symbolic files to link configurations for timezones.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to make a Python script Pip-installable</title>
      <link>https://andrewodendaal.com/how-to-make-a-python-script-pip-installable/</link>
      <pubDate>Thu, 19 Mar 2020 10:28:25 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-make-a-python-script-pip-installable/</guid>
      <description>&lt;p&gt;As Python developers, we&amp;rsquo;ve all used &lt;code&gt;pip&lt;/code&gt; to install applications, but speaking to other Python developers, it&amp;rsquo;s not always clear how to make your own application/script &lt;code&gt;pip-installable&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;automation tip&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;steps-involved&#34;&gt;Steps involved&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Create a python script, or application&lt;/li&gt;&#xA;&lt;li&gt;Add and configure a setup file&lt;/li&gt;&#xA;&lt;li&gt;Build your new Pip Package Locally&lt;/li&gt;&#xA;&lt;li&gt;Upload them both to the Python Package Index (PyPi)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So let&amp;rsquo;s run through these 4 steps to get you going.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Host an AngularJS site on AWS S3</title>
      <link>https://andrewodendaal.com/how-to-host-an-angularjs-site-on-aws-s3/</link>
      <pubDate>Wed, 18 Mar 2020 11:24:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-host-an-angularjs-site-on-aws-s3/</guid>
      <description>&lt;p&gt;AngularJS is a Javascript Framework that allows you to create dynamic front-end web applications easily.&lt;/p&gt;&#xA;&lt;p&gt;I have traditionally packaged these applications through NodeJS, and Grunt (or Gulp) in particular.&lt;/p&gt;&#xA;&lt;p&gt;Once it needs to be hosted for the whole world to see, I always used to push the static folder up to an Apache2 or Nginx Linux web server.&lt;/p&gt;&#xA;&lt;p&gt;There&amp;rsquo;s really not a massive need for this though, as it&amp;rsquo;s easily possible to AngularJS applications completely serverless using a combination of AWS S3 and Cloudflare.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to send emails using Python and AWS SES SMTP</title>
      <link>https://andrewodendaal.com/how-to-send-emails-using-python-and-aws-ses-smtp/</link>
      <pubDate>Tue, 17 Mar 2020 10:52:40 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-send-emails-using-python-and-aws-ses-smtp/</guid>
      <description>&lt;p&gt;Sending emails using Python and AWS&amp;rsquo; SES service is really easy. They provide an SMTP server that you can authenticate against and send email programmatically from your python scripts.&lt;/p&gt;&#xA;&lt;p&gt;There is a wonderfully simple Python package called &lt;code&gt;emails&lt;/code&gt; I like to use for this purpose.&lt;/p&gt;&#xA;&lt;p&gt;If you&amp;rsquo;re not running a &lt;a href=&#34;https://andrewodendaal.com/how-to-setup-and-use-the-python-virtual-environment/&#34;&gt;Python Virtual Environment&lt;/a&gt;, then start by &lt;a href=&#34;https://andrewodendaal.com/how-to-setup-and-use-the-python-virtual-environment/&#34;&gt;getting started here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Otherwise, continue reading!&lt;/p&gt;&#xA;&lt;h2 id=&#34;getting-aws-ses-smtp-setup&#34;&gt;Getting AWS SES SMTP Setup&lt;/h2&gt;&#xA;&lt;p&gt;In order to start sending emails using AWS SES, and the SMTP server in particular, you will need to:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Generate a random number between two numbers in JavaScript</title>
      <link>https://andrewodendaal.com/generate-a-random-number-between-two-numbers-in-javascript/</link>
      <pubDate>Mon, 16 Mar 2020 16:30:08 +0000</pubDate>
      <guid>https://andrewodendaal.com/generate-a-random-number-between-two-numbers-in-javascript/</guid>
      <description>&lt;p&gt;If you need to generate a random number between two numbers in JavaScript, then you are in the right place! Here you will learn javascript random number generation.&lt;/p&gt;&#xA;&lt;p&gt;We can easily do this by using a combination of built-in &lt;code&gt;Math&lt;/code&gt; functions.&lt;/p&gt;&#xA;&lt;h2 id=&#34;javascript-random-number-from-mathrandom&#34;&gt;Javascript Random Number from Math.random()&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s start by using &lt;code&gt;Math.random()&lt;/code&gt; to generate a random number. Now we will take that and multiply it by &lt;code&gt;max - min + 1&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Why Password Managers are Not the Solution</title>
      <link>https://andrewodendaal.com/why-password-managers-are-not-the-solution/</link>
      <pubDate>Sun, 15 Mar 2020 16:51:35 +0000</pubDate>
      <guid>https://andrewodendaal.com/why-password-managers-are-not-the-solution/</guid>
      <description>&lt;h2 id=&#34;why-a-password-manager&#34;&gt;Why a Password Manager?&lt;/h2&gt;&#xA;&lt;p&gt;Password managers exist for two main reasons.&lt;/p&gt;&#xA;&lt;p&gt;Firstly, to generate strong passwords and secondly so that you don&amp;rsquo;t end up using the same password on all your websites or apps that you frequent.&lt;/p&gt;&#xA;&lt;p&gt;On the surface, that sounds like a pretty good idea.&lt;/p&gt;&#xA;&lt;p&gt;Imagine you use the same password for a number of websites, then one of those websites gets hacked. The hackers will now try the same credentials on a range of sites. Oftentimes they will be able to successfully login because people don&amp;rsquo;t protect their stuff more than this.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Read the top n lines of a file in Python</title>
      <link>https://andrewodendaal.com/read-the-top-n-lines-of-a-file-in-python/</link>
      <pubDate>Sat, 14 Mar 2020 10:56:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/read-the-top-n-lines-of-a-file-in-python/</guid>
      <description>&lt;p&gt;Sometimes you may need to read the top &lt;code&gt;n&lt;/code&gt; lines of a file using Python.&lt;/p&gt;&#xA;&lt;p&gt;We start by opening the file for reading and then using a list comprehension we iterate through the range of lines we want to return:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;N = 10&#xA;filename = &amp;#34;file.txt&amp;#34;&#xA;&#xA;with open(filename) as myfile:&#xA;    head = [next(myfile) for x in range(N)]&#xA;&#xA;print(head)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Another way you can do this is by looping through each line individually:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How Fast is your Website?</title>
      <link>https://andrewodendaal.com/how-fast-is-your-website/</link>
      <pubDate>Fri, 13 Mar 2020 12:52:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-fast-is-your-website/</guid>
      <description>&lt;p&gt;I operate a bunch of different sites and have done for many years now.&lt;/p&gt;&#xA;&lt;p&gt;Some of them get quite a lot of traffic and require a high level of uptime.&lt;/p&gt;&#xA;&lt;p&gt;To monitor the uptime of these sites, I use various tools to alert me when a site is unreachable, when a specific resource is returning an unexpected status code, or if one of the database heavy pages starts taking a while to respond to requests.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Git Reset a Single File</title>
      <link>https://andrewodendaal.com/how-to-git-reset-a-single-file/</link>
      <pubDate>Thu, 12 Mar 2020 09:28:56 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-git-reset-a-single-file/</guid>
      <description>&lt;p&gt;It&amp;rsquo;s very easy to reset files that have not yet been committed to git.&lt;/p&gt;&#xA;&lt;h2 id=&#34;reset-a-single-file&#34;&gt;Reset a single file&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git reset &amp;lt;filename&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can also specify the filename as the path to the file, like so:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git reset ./the/actual/relatvive/path/with/filename.ext&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will checkout the file from HEAD.&lt;/p&gt;&#xA;&lt;p&gt;It is important to note that should you have a file that is the same name as a branch, you will need to rather run the following command:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Introducing Variables in Golang</title>
      <link>https://andrewodendaal.com/introducing-variables-in-golang/</link>
      <pubDate>Wed, 11 Mar 2020 14:07:14 +0000</pubDate>
      <guid>https://andrewodendaal.com/introducing-variables-in-golang/</guid>
      <description>&lt;p&gt;Golang comes with a decent offering around variables that you can use to store, retrieve and manipulate information.&lt;/p&gt;&#xA;&lt;p&gt;A variable is defined with the &lt;code&gt;var&lt;/code&gt; keyword followed by the name of the variable, the type and then the assignment itself.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-name-a-variable-in-golang&#34;&gt;How to name a variable in Golang&lt;/h2&gt;&#xA;&lt;p&gt;Variable names must:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Start with a letter&lt;/li&gt;&#xA;&lt;li&gt;May contain letters, numbers or the underscore &lt;code&gt;_&lt;/code&gt; character.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Variable names that start with numbers or special characters are not allowed.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Golang cannot convert (type string) to type int</title>
      <link>https://andrewodendaal.com/golang-cannot-convert-type-string-to-type-int/</link>
      <pubDate>Tue, 10 Mar 2020 08:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/golang-cannot-convert-type-string-to-type-int/</guid>
      <description>&lt;p&gt;Every language has it&amp;rsquo;s ways of converting data types. One of the most common data types to convert between is that of strings (&lt;code&gt;string&lt;/code&gt;) and integers (&lt;code&gt;int&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;If you&amp;rsquo;ve ever tried to do this in Golang, you would know that&amp;rsquo;s it isn&amp;rsquo;t all that simple at first.&lt;/p&gt;&#xA;&lt;p&gt;The easiest way to convert between String and Integers in Golang is as follows:&lt;/p&gt;&#xA;&lt;h2 id=&#34;string-to-integer&#34;&gt;String to Integer&lt;/h2&gt;&#xA;&lt;p&gt;My go-to option to resolve this problem would be with the &lt;code&gt;strconv&lt;/code&gt; module.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Learn Golang as a Python Developer</title>
      <link>https://andrewodendaal.com/learn-golang-as-a-python-developer/</link>
      <pubDate>Mon, 09 Mar 2020 08:51:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/learn-golang-as-a-python-developer/</guid>
      <description>&lt;p&gt;Learning Go or Golang as a Python developer, programmer or software engineer is easier than you think.&lt;/p&gt;&#xA;&lt;p&gt;While there are quite a lot of things to learn and get familiar with, there are many benefits and many common characteristics.&lt;/p&gt;&#xA;&lt;h2 id=&#34;why-learn-go-as-a-python-developer&#34;&gt;Why learn Go as a Python developer&lt;/h2&gt;&#xA;&lt;p&gt;I find Python to be a very powerful and useful programming language, having used it on a wide range of projects for an even wider range of tasks. From Platform Engineering automation to &lt;a href=&#34;https://andrewodendaal.com/machine-learning-mastery-series&#34;&gt;Machine Learning&lt;/a&gt; and Artificial Intelligence, to building User Interfaces and creating APIs as well as building entire websites and web applications. Python has served me well and will continue to do so.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Remove Special Characters in a String using Bash</title>
      <link>https://andrewodendaal.com/remove-special-characters-in-a-string-using-bash/</link>
      <pubDate>Sun, 08 Mar 2020 12:39:46 +0000</pubDate>
      <guid>https://andrewodendaal.com/remove-special-characters-in-a-string-using-bash/</guid>
      <description>&lt;p&gt;Programming languages provide the ability to remove special characters from a string quite easily.&lt;/p&gt;&#xA;&lt;p&gt;Sometimes you need to also do this from your command-line using Bash.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s say we have a bash variable called &lt;code&gt;USER_EMAIL&lt;/code&gt; and we want to remove any periods, underscores, dashes and the &lt;code&gt;@&lt;/code&gt; symbol, how would we go about this?&lt;/p&gt;&#xA;&lt;p&gt;We could pipe our variable to a useful command called &lt;code&gt;tr&lt;/code&gt; (which is the &lt;code&gt;translate or delete characters&lt;/code&gt; tool) and strip these specifics before pushing the output back to a new bash variable.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Get the Amount of Days Between Two Dates in Python</title>
      <link>https://andrewodendaal.com/get-the-amount-of-days-between-two-dates-in-python/</link>
      <pubDate>Sat, 07 Mar 2020 08:22:05 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-the-amount-of-days-between-two-dates-in-python/</guid>
      <description>&lt;p&gt;Let&amp;rsquo;s say that you have two dates:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;2019-01-29&amp;#34;&#xA;&amp;#34;2019-06-30&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;How would you create a function that would return the number of days between these two dates?&lt;/p&gt;&#xA;&lt;h2 id=&#34;introducing-the-datetime-package&#34;&gt;Introducing the Datetime Package&lt;/h2&gt;&#xA;&lt;p&gt;Python comes with a built-in library called &lt;code&gt;datetime&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;We start by importing the &lt;code&gt;date&lt;/code&gt; module.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from datetime import date&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;With this date module, we have access to an object format of the &lt;code&gt;date&lt;/code&gt; type.&lt;/p&gt;&#xA;&lt;h2 id=&#34;writing-our-function&#34;&gt;Writing our Function&lt;/h2&gt;&#xA;&lt;p&gt;Next, we should write our function that takes in two dates and returns the number of days between them.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Always run Python 3 from Bash</title>
      <link>https://andrewodendaal.com/how-to-always-run-python-3-from-bash/</link>
      <pubDate>Fri, 06 Mar 2020 08:29:41 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-always-run-python-3-from-bash/</guid>
      <description>&lt;p&gt;Given a directory that contains:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;|&#xA;|- app.py&#xA;|- requirements.txt&#xA;|- ...&#xA;|- &amp;lt;- other-files -&amp;gt;&#xA;|- ...&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We can create a &lt;code&gt;runme.sh&lt;/code&gt; file to always make sure we are running &lt;code&gt;python 3&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;create-a-shell-script&#34;&gt;Create a shell script&lt;/h2&gt;&#xA;&lt;p&gt;Create a file called &lt;code&gt;runme.sh&lt;/code&gt; and put the following code in:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;python -c &amp;#39;import sys; exit(1) if sys.version_info.major &amp;lt; 3 else exit(0)&amp;#39;&#xA;&#xA;if [[ $? == 0 ]]; then&#xA;    [ ! -d &amp;#34;venv&amp;#34; ] &amp;amp;&amp;amp; virtualenv -p python venv&#xA;    . venv/bin/activate&#xA;    pip install -r requirements.txt&#xA;else&#xA;    [ ! -d &amp;#34;venv&amp;#34; ] &amp;amp;&amp;amp; virtualenv -p python3 venv&#xA;    . venv/bin/activate&#xA;    pip3 install -r requirements.txt&#xA;fi&#xA;&#xA;python app.py&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now instead of running &lt;code&gt;python app.py&lt;/code&gt; or &lt;code&gt;python3 app.py&lt;/code&gt;, you can simply run &lt;code&gt;sh runme.sh&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Run the Kubernetes Dashboard Locally</title>
      <link>https://andrewodendaal.com/how-to-run-the-kubernetes-dashboard-locally/</link>
      <pubDate>Thu, 05 Mar 2020 10:42:42 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-run-the-kubernetes-dashboard-locally/</guid>
      <description>&lt;p&gt;Kubernetes comes with a pretty nice dashboard to view &lt;code&gt;clusters&lt;/code&gt;, &lt;code&gt;worker groups&lt;/code&gt;, &lt;code&gt;nodes&lt;/code&gt; and &lt;code&gt;pods&lt;/code&gt;. As well as a ton of other useful things.&lt;/p&gt;&#xA;&lt;p&gt;This tutorial presumes that you already have a &lt;a href=&#34;https://andrewodendaal.com/kubernetes-mastery&#34;&gt;Kubernetes cluster setup&lt;/a&gt; and running and have access to it through &lt;code&gt;kubectl&lt;/code&gt; in your command-line.&lt;/p&gt;&#xA;&lt;h2 id=&#34;steps-to-run-kubernetes-dashboard&#34;&gt;Steps to run Kubernetes Dashboard&lt;/h2&gt;&#xA;&lt;p&gt;Start by downloading the &lt;code&gt;metrics-server&lt;/code&gt; and applying it to your &lt;code&gt;kubectl&lt;/code&gt; config.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DOWNLOAD_URL=$(curl -Ls &amp;#34;https://api.github.com/repos/kubernetes-sigs/metrics-server/releases/latest&amp;#34; | jq -r .tarball_url)&#xA;DOWNLOAD_VERSION=$(grep -o &amp;#39;[^/v]*$&amp;#39; &amp;lt;&amp;lt;&amp;lt; $DOWNLOAD_URL)&#xA;curl -Ls $DOWNLOAD_URL -o metrics-server-$DOWNLOAD_VERSION.tar.gz&#xA;mkdir metrics-server-$DOWNLOAD_VERSION&#xA;tar -xzf metrics-server-$DOWNLOAD_VERSION.tar.gz --directory metrics-server-$DOWNLOAD_VERSION --strip-components 1&#xA;kubectl apply -f metrics-server-$DOWNLOAD_VERSION/deploy/1.8+/&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Next, we will start setting up the &lt;code&gt;metrics-server&lt;/code&gt;, ready for action!&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to tell if a year is a Leap Year in Python</title>
      <link>https://andrewodendaal.com/how-to-tell-if-a-year-is-a-leap-year-in-python/</link>
      <pubDate>Wed, 04 Mar 2020 09:57:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-tell-if-a-year-is-a-leap-year-in-python/</guid>
      <description>&lt;p&gt;Given that we are in a leap year this year (2020), it would be nice to know how to programmatically calculate this.&lt;/p&gt;&#xA;&lt;p&gt;Luckily, this is a repeatable pattern that we can write some code for.&lt;/p&gt;&#xA;&lt;h2 id=&#34;so-what-is-a-leap-year&#34;&gt;So what is a leap year?&lt;/h2&gt;&#xA;&lt;p&gt;A &lt;code&gt;leap year&lt;/code&gt; is a year that has 29 days in the month of February.&lt;/p&gt;&#xA;&lt;p&gt;Astronomical years have a quarter of a day more than our calendar years that we follow, so to make sure this matches up continually, our calendar introduces an additional day every 4 years.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Reverse a Linked List in Python</title>
      <link>https://andrewodendaal.com/how-to-reverse-a-linked-list-in-python/</link>
      <pubDate>Tue, 03 Mar 2020 10:00:25 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reverse-a-linked-list-in-python/</guid>
      <description>&lt;p&gt;It&amp;rsquo;s important to know about data types and one that comes up fairly regularly is that of Linked Lists.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s write the following base code to create a Linked List.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;# Defintion of a single Node&#xA;class Node:&#xA;  # takes input data and next node&#xA;  def __init__(self, data = None, next=None): &#xA;    self.data = data&#xA;    self.next = next&#xA;&#xA;# Definition of a Linked List&#xA;class LinkedList:&#xA;  def __init__(self):  &#xA;    self.head = None&#xA;  &#xA;  # Insert a node into our Linked List&#xA;  def insert(self, data):&#xA;    newNode = Node(data)&#xA;    if(self.head):&#xA;      current = self.head&#xA;      while(current.next):&#xA;        current = current.next&#xA;      current.next = newNode&#xA;    else:&#xA;      self.head = newNode&#xA;  &#xA;  # Print our Linked List so we can see how it looks&#xA;  def render(self):&#xA;    current = self.head&#xA;    while(current):&#xA;      print(current.data)&#xA;      current = current.next&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now that we have a base class, let&amp;rsquo;s insert a couple of nodes and print it out to see what we are working with:&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Docker Quickstart Guide for Developers</title>
      <link>https://andrewodendaal.com/the-docker-quickstart-guide-for-developers/</link>
      <pubDate>Mon, 02 Mar 2020 08:14:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-docker-quickstart-guide-for-developers/</guid>
      <description>&lt;p&gt;This Docker Quickstart Guide for Developers aims to get developers familiar with Docker as quickly as possible.&lt;/p&gt;&#xA;&lt;p&gt;Providing you with the knowledge to be able to use Docker in your personal and professional projects.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-docker&#34;&gt;What is Docker?&lt;/h2&gt;&#xA;&lt;p&gt;Docker is a tool written in &lt;!-- raw HTML omitted --&gt;Golang&lt;!-- raw HTML omitted --&gt; that provides the ability to run applications within things called containers.&lt;/p&gt;&#xA;&lt;p&gt;It removes the age-old &amp;ldquo;works on my machine&amp;rdquo; problems that plagued many software developers and testers lives.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Follow Redirects with cURL for CLI or PHP</title>
      <link>https://andrewodendaal.com/how-to-follow-redirects-with-curl-for-cli-or-php/</link>
      <pubDate>Sun, 01 Mar 2020 12:07:17 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-follow-redirects-with-curl-for-cli-or-php/</guid>
      <description>&lt;p&gt;Let&amp;rsquo;s take a really common example. Say we want to follow redirects with cURL for &lt;code&gt;google.com&lt;/code&gt;. It is common to curl follow redirect a URL.&lt;/p&gt;&#xA;&lt;h2 id=&#34;follow-redirects-with-curl-in-the-commandline&#34;&gt;Follow Redirects with cURL in the CommandLine&lt;/h2&gt;&#xA;&lt;p&gt;If you navigate directly to google in the command-line using &lt;code&gt;curl&lt;/code&gt;, you will be taken to a &lt;code&gt;301 redirect&lt;/code&gt; URL.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;curl google.com&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#&amp;lt;HTML&amp;gt;&amp;lt;HEAD&amp;gt;&amp;lt;meta http-equiv=&amp;#34;content-type&amp;#34; content=&amp;#34;text/html;charset=utf-8&amp;#34;&amp;gt;&#xA;#&amp;lt;TITLE&amp;gt;301 Moved&amp;lt;/TITLE&amp;gt;&amp;lt;/HEAD&amp;gt;&amp;lt;BODY&amp;gt;&#xA;#&amp;lt;H1&amp;gt;301 Moved&amp;lt;/H1&amp;gt;&#xA;#The document has moved&#xA;#&amp;lt;A HREF=&amp;#34;http://www.google.com/&amp;#34;&amp;gt;here&amp;lt;/A&amp;gt;.&#xA;#&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This makes sure that you follow the proper canonical URL as set by the particular website in question.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to tell if a String contains a Substring in Javascript</title>
      <link>https://andrewodendaal.com/how-to-tell-if-a-string-contains-a-substring-in-javascript/</link>
      <pubDate>Sat, 29 Feb 2020 00:27:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-tell-if-a-string-contains-a-substring-in-javascript/</guid>
      <description>&lt;p&gt;Javascript comes with some pretty good support for determining if a string contains a substring.&lt;/p&gt;&#xA;&lt;p&gt;There is the newer &lt;code&gt;includes&lt;/code&gt; function which was introduced in ES2015 which allows you to tell if a string contains a substring. This function returns a boolean value of &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#39;our example string&amp;#39;.includes(&amp;#39;example&amp;#39;)&#xA;&#xA;// returns true&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Alternatively, if you need to either:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Have support for older versions of Javascript&lt;/li&gt;&#xA;&lt;li&gt;Need to not only know if a string contains a substring, but also it&amp;rsquo;s position within the string..&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Then &lt;code&gt;indexOf&lt;/code&gt; is a better match for you.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to package a Python app (pip) for PyPi</title>
      <link>https://andrewodendaal.com/how-to-package-a-python-app-pip-for-pypi/</link>
      <pubDate>Fri, 28 Feb 2020 01:01:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-package-a-python-app-pip-for-pypi/</guid>
      <description>&lt;p&gt;In this tutorial, we will create a Python application that can be installed directly from &lt;code&gt;pip&lt;/code&gt; that will show the 10 latest blog posts from &lt;a href=&#34;https://andrewodendaal.com&#34;&gt;this website&lt;/a&gt; (the one you are reading this on!).&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;getting-started&#34;&gt;Getting started&lt;/h2&gt;&#xA;&lt;p&gt;Make sure you have registered at &lt;!-- raw HTML omitted --&gt;Pypy&lt;!-- raw HTML omitted --&gt; and have an account, we will need this to upload our package once we&amp;rsquo;re done.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to find the longest Palindrome in a String using Python</title>
      <link>https://andrewodendaal.com/how-to-find-the-longest-palindrome-in-a-string-using-python/</link>
      <pubDate>Thu, 27 Feb 2020 11:24:20 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-find-the-longest-palindrome-in-a-string-using-python/</guid>
      <description>&lt;p&gt;This occasionally comes up during coding interviews and is actually quite a decent way to test someone&amp;rsquo;s aptitude of moving back and forth on a string to determine if and where palindromes exist.&lt;/p&gt;&#xA;&lt;p&gt;If we simply said: &amp;ldquo;return a boolean if a string is a palindrome&amp;rdquo;, then threw a couple tests cases at the function, we would expect the developer to loop through the first half of a string while comparing the second half, if it matched all the way to the central pivot, then &amp;ldquo;yes, the string is a palindrome&amp;rdquo;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to write Anonymous Functions in Javascript</title>
      <link>https://andrewodendaal.com/how-to-write-anonymous-functions-in-javascript/</link>
      <pubDate>Wed, 26 Feb 2020 08:31:53 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-write-anonymous-functions-in-javascript/</guid>
      <description>&lt;p&gt;There is a lot of power in Javascript syntax. One of those powerful things is that of Javascript Anonymous Functions.&lt;/p&gt;&#xA;&lt;p&gt;But what is an Anonymous Function in Javascript?&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;It is a function that does not have a name or one that has been hidden out of scope around its creation.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;A common use of a Javascript Anonymous Function is to guarantee that the same variable names or function names are not already used within the same document.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to use Docker to test any Linux distribution locally</title>
      <link>https://andrewodendaal.com/how-to-use-docker-to-test-any-linux-distribution-locally/</link>
      <pubDate>Tue, 25 Feb 2020 08:19:32 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-use-docker-to-test-any-linux-distribution-locally/</guid>
      <description>&lt;p&gt;I often need to test a specific Linux binary or make sure something works as expected from &lt;code&gt;yum install&lt;/code&gt; or &lt;code&gt;apt install&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;To do this, it&amp;rsquo;s common to have a virtual machine lying around, or even a VPS that you can just quickly log into.&lt;/p&gt;&#xA;&lt;p&gt;Things are a bit easier and quicker if you use Docker.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s run two tests, the first one to get going with Ubuntu, and the second to get going with Centos.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get the Maximum Depth of a Binary Tree in Python</title>
      <link>https://andrewodendaal.com/how-to-get-the-maximum-depth-of-a-binary-tree-in-python/</link>
      <pubDate>Mon, 24 Feb 2020 08:15:35 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-maximum-depth-of-a-binary-tree-in-python/</guid>
      <description>&lt;p&gt;Let&amp;rsquo;s say that you have a binary tree and we needed to know it&amp;rsquo;s maximum depth.&lt;/p&gt;&#xA;&lt;p&gt;Binary tree input data &lt;code&gt;[3,9,20,null,null,15,7]&lt;/code&gt; could be visualised as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;    3&#xA;   / \&#xA;  9  20&#xA;    /  \&#xA;   15   7&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In the above example, the depth would be 3. As there are 3 levels.&lt;/p&gt;&#xA;&lt;p&gt;How would we write some Python code to work this out?&lt;/p&gt;&#xA;&lt;p&gt;As usual, a TreeNode is defined as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class TreeNode:&#xA;    def __init__(self, x):&#xA;        self.val = x&#xA;        self.left = None&#xA;        self.right = None&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As we need to loop through the same data types, this would be a perfect time to practice some recursion!&lt;/p&gt;</description>
    </item>
    <item>
      <title>What is Fizz Buzz?</title>
      <link>https://andrewodendaal.com/what-is-fizz-buzz/</link>
      <pubDate>Sun, 23 Feb 2020 01:32:55 +0000</pubDate>
      <guid>https://andrewodendaal.com/what-is-fizz-buzz/</guid>
      <description>&lt;p&gt;Fizz buzz is a common programming interview question.&lt;/p&gt;&#xA;&lt;p&gt;The problem statement usually reads something like this:&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Hackerrank.com&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;If we break this down, the challenge is for us to prove that we know how to:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Loop through a specific set of numbers&lt;/li&gt;&#xA;&lt;li&gt;Tell if something is a multiple of 3&lt;/li&gt;&#xA;&lt;li&gt;Tell if something is a multiple of 5&lt;/li&gt;&#xA;&lt;li&gt;Tell if something is a multiple of both 3 and 5&lt;/li&gt;&#xA;&lt;li&gt;Know the correct order to check the above cases&lt;/li&gt;&#xA;&lt;li&gt;Ignore everything else&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The main thing here is to know about the modulo operator (&lt;code&gt;%&lt;/code&gt;). As that tells us if there are remainders after the division of one number by another.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Deploy a Helm “Hello World” app onto Kubernetes</title>
      <link>https://andrewodendaal.com/how-to-deploy-a-helm-hello-world-app-onto-kubernetes/</link>
      <pubDate>Sat, 22 Feb 2020 00:10:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-deploy-a-helm-hello-world-app-onto-kubernetes/</guid>
      <description>&lt;p&gt;We will create a simple Hello World static HTTP Service using Helm, package it and release it to an AWS EKS Cluster.&lt;/p&gt;&#xA;&lt;p&gt;This tutorial expects you to have &lt;code&gt;kubectl&lt;/code&gt; as well as &lt;code&gt;helm&lt;/code&gt; installed on your computer.&lt;/p&gt;&#xA;&lt;h2 id=&#34;build-our-docker-image&#34;&gt;Build our Docker image&lt;/h2&gt;&#xA;&lt;p&gt;Create a file called &lt;code&gt;Dockerfile&lt;/code&gt; and place the below into it:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;FROM busybox&#xA;ADD index.html /www/index.html&#xA;EXPOSE 8008&#xA;CMD httpd -p 8008 -h /www; tail -f /dev/null&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now we need to create our &lt;code&gt;index.html&lt;/code&gt; file.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to write a Quicksort Algorithm in Python</title>
      <link>https://andrewodendaal.com/how-to-write-a-quicksort-algorithm-in-python/</link>
      <pubDate>Fri, 21 Feb 2020 10:15:53 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-write-a-quicksort-algorithm-in-python/</guid>
      <description>&lt;p&gt;While there are libraries available for all programming languages that offer abilities to sort list, arrays and collections, it is important to know how this is achieved.&lt;/p&gt;&#xA;&lt;p&gt;Learning how to write a quicksort algorithm yourself gives the ability to better understand the programming language of your choice and how to optimise code where possible.&lt;/p&gt;&#xA;&lt;p&gt;Today we will explore writing a quicksort algorithm in the Python programming language.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s start by defining a list of integers that are clearly not in order:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Reverse a String or List using Python</title>
      <link>https://andrewodendaal.com/how-to-reverse-a-string-or-list-using-python/</link>
      <pubDate>Thu, 20 Feb 2020 11:15:22 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reverse-a-string-or-list-using-python/</guid>
      <description>&lt;p&gt;Python comes with the power of &lt;code&gt;slicing&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s try it with a &lt;code&gt;String&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; example1 = &amp;#39;hello world&amp;#39;&#xA;&#xA;&amp;gt;&amp;gt;&amp;gt; example1[::-1]&#xA;&#xA;&amp;#39;dlrow olleh&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now let&amp;rsquo;s try the same with a &lt;code&gt;List&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; example2 = [&amp;#39;h&amp;#39;,&amp;#39;e&amp;#39;,&amp;#39;l&amp;#39;,&amp;#39;l&amp;#39;,&amp;#39;o&amp;#39;,&amp;#39; &amp;#39;,&amp;#39;w&amp;#39;,&amp;#39;o&amp;#39;,&amp;#39;r&amp;#39;,&amp;#39;l&amp;#39;,&amp;#39;d&amp;#39;]&#xA;&#xA;&amp;gt;&amp;gt;&amp;gt; example2[::-1]&#xA;&#xA;[&amp;#39;d&amp;#39;, &amp;#39;l&amp;#39;, &amp;#39;r&amp;#39;, &amp;#39;o&amp;#39;, &amp;#39;w&amp;#39;, &amp;#39; &amp;#39;, &amp;#39;o&amp;#39;, &amp;#39;l&amp;#39;, &amp;#39;l&amp;#39;, &amp;#39;e&amp;#39;, &amp;#39;h&amp;#39;]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As we can see by passing in the third argument to our slice of &lt;code&gt;-1&lt;/code&gt;, we are able to reverse the return value.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get the IP address in Python</title>
      <link>https://andrewodendaal.com/how-to-get-the-ip-address-in-python/</link>
      <pubDate>Wed, 19 Feb 2020 10:30:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-ip-address-in-python/</guid>
      <description>&lt;p&gt;Python exposes a &lt;code&gt;socket&lt;/code&gt; library that allows us to perform networking tasks such as getting the IP Address as well as getting the Hostname of our system.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import socket&#xA;&#xA;try:&#xA;  host_name = socket.gethostname()&#xA;  host_ip = socket.gethostbyname(host_name)&#xA;  print(f&amp;#34;Hostname: {host_name}&amp;#34;)&#xA;  print(f&amp;#34;IP : {host_ip}&amp;#34;)&#xA;except:&#xA;  print(&amp;#34;Could not get the IP Address or Hostname&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The above code imports the socket library and then runs a safe block of code.&lt;/p&gt;&#xA;&lt;p&gt;We need to first get the hostname and then use that to get the IP Address.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Reverse a Binary Tree in Python</title>
      <link>https://andrewodendaal.com/how-to-reverse-a-binary-tree-in-python/</link>
      <pubDate>Tue, 18 Feb 2020 08:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-reverse-a-binary-tree-in-python/</guid>
      <description>&lt;p&gt;&lt;code&gt;Reversing a Binary Tree&lt;/code&gt; is a common programming interview question.&lt;/p&gt;&#xA;&lt;p&gt;By learning how to Reverse a Binary Tree in Python, you are working towards fundamental data structure algorithms commonly found in Computer Science degrees and across the industry.&lt;/p&gt;&#xA;&lt;p&gt;If we take a look at the following Data Tree Image, we will notice a few common points.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2020/02/Screenshot-2020-02-17-at-11.46.39-298x300.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Firstly, a &lt;code&gt;binary tree&lt;/code&gt; simply means a tree that contains between 1 and 2 child nodes.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] Unable to Detach AWS Network Interface</title>
      <link>https://andrewodendaal.com/unable-to-detach-aws-network-interface/</link>
      <pubDate>Mon, 17 Feb 2020 10:37:08 +0000</pubDate>
      <guid>https://andrewodendaal.com/unable-to-detach-aws-network-interface/</guid>
      <description>&lt;p&gt;&lt;code&gt;You do not have permission to access the specified resource.&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you are seeing this error appears up when trying to delete or detach a Network Interface within AWS, then you need to read what the description column says, find that item and then delete that first.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2020/02/Screenshot-2020-02-17-at-10.33.23.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;We can see in this instance, we need to first delete an ELB starting with ID &lt;code&gt;a4e6efd6&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Head over to the Load Balancers tab and search for that ELB:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to delete a file in Python</title>
      <link>https://andrewodendaal.com/how-to-delete-a-file-in-python/</link>
      <pubDate>Sun, 16 Feb 2020 00:57:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-delete-a-file-in-python/</guid>
      <description>&lt;h2 id=&#34;a-quick-solution-in-python&#34;&gt;A quick solution in Python&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import os&#xA;os.remove(&amp;#34;filename.txt&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The above code will delete a file in Python, it will not however delete a directory, or a directory containing files. For this we will need to explore a bit more..&lt;/p&gt;&#xA;&lt;h2 id=&#34;check-file-exists-before-deleting&#34;&gt;Check file exists before deleting&lt;/h2&gt;&#xA;&lt;p&gt;First check if the file exists before deleting it:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import os&#xA;&#xA;if os.path.exists(&amp;#34;filename.txt&amp;#34;):&#xA;  os.remove(&amp;#34;filename.txt&amp;#34;)&#xA;else:&#xA;  print(&amp;#34;The file doesn&amp;#39;t exist&amp;#34;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;delete-a-directoryfolder&#34;&gt;Delete a directory/folder&lt;/h2&gt;&#xA;&lt;p&gt;Sometimes you may want to delete an entire folder as well:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to safely parse JSON in Javascript</title>
      <link>https://andrewodendaal.com/how-to-safely-parse-json-in-javascript/</link>
      <pubDate>Sat, 15 Feb 2020 14:16:53 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-safely-parse-json-in-javascript/</guid>
      <description>&lt;p&gt;&lt;code&gt;JSON&lt;/code&gt; stands for &lt;strong&gt;J&lt;/strong&gt;ava&lt;strong&gt;s&lt;/strong&gt;cript &lt;strong&gt;O&lt;/strong&gt;bject &lt;strong&gt;N&lt;/strong&gt;otation and has become wildly popular to transport and store data between application, databases and more.&lt;/p&gt;&#xA;&lt;p&gt;However, it is not always obvious that a piece of data your application is trying to use may be of type JSON, or be correctly sanitised.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s take a simple Javascript function as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function getNameFromJSONString(jsonString) {&#xA;    &#xA;    // Dangerous!&#xA;    json = JSON.parse(jsonString);&#xA;    &#xA;    // Dangerous again!&#xA;    return json.name;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;What the above function does is take in a string which it believes is a stringified/serialised JSON (perhaps stored in a database), parse it back to a Javascript Object and then return an attribute called &lt;code&gt;name&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Check if an HTML Checkbox is checked using Javascript</title>
      <link>https://andrewodendaal.com/check-if-an-html-checkbox-is-checked-using-javascript/</link>
      <pubDate>Fri, 14 Feb 2020 13:26:34 +0000</pubDate>
      <guid>https://andrewodendaal.com/check-if-an-html-checkbox-is-checked-using-javascript/</guid>
      <description>&lt;p&gt;While processing forms in web development, it&amp;rsquo;s a common requirement to be able to tell if a checkbox has been checked or not.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s not immediately obvious though. Let&amp;rsquo;s dispell this and provide some ways to &lt;code&gt;check if a checkbox is checked&lt;/code&gt; using Javascript.&lt;/p&gt;&#xA;&lt;p&gt;First, we need an HTML checkbox to play around with.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;input type=&amp;#34;checkbox&amp;#34; class=&amp;#34;myCheckbox&amp;#34; /&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;using-javascript&#34;&gt;Using Javascript&lt;/h2&gt;&#xA;&lt;p&gt;Using regular Javascript, we can tell if it is checked by using the following Javascript:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Push Docker Images to AWS ECR</title>
      <link>https://andrewodendaal.com/how-to-push-docker-images-to-aws-ecr/</link>
      <pubDate>Thu, 13 Feb 2020 09:11:14 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-push-docker-images-to-aws-ecr/</guid>
      <description>&lt;p&gt;Docker images are usually stored on &lt;!-- raw HTML omitted --&gt;Docker Hub&lt;!-- raw HTML omitted --&gt;, but &lt;!-- raw HTML omitted --&gt;AWS&amp;rsquo;s Elastic Container Registry&lt;!-- raw HTML omitted --&gt; can also be used. It&amp;rsquo;s a great solution and this post teaches you how to push Docker images to AWS&amp;rsquo; Elastic Container Registry (ECR).&lt;/p&gt;&#xA;&lt;h2 id=&#34;create-a-repository&#34;&gt;Create a Repository&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s start by using the &lt;code&gt;aws-cli&lt;/code&gt; to create a repository.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;aws ecr create-repository --repository-name myname&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This command successfully creates a repository and outputs the following JSON:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to monitor Network Traffic on Linux</title>
      <link>https://andrewodendaal.com/how-to-monitor-network-traffic-on-linux/</link>
      <pubDate>Wed, 12 Feb 2020 09:42:59 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-monitor-network-traffic-on-linux/</guid>
      <description>&lt;p&gt;There is a fantastic tool to see and monitor Bandwidth and Network Traffic on Linux.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s called &lt;code&gt;bmon&lt;/code&gt; and it works out of the box.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-setup-and-use&#34;&gt;How to Setup and Use&lt;/h2&gt;&#xA;&lt;p&gt;On Ubuntu &lt;code&gt;apt-get install bmon&lt;/code&gt;, or in newer versions, you can also just say &lt;code&gt;apt install bmon&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;On Centos &lt;code&gt;yum install bmon&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Once you have it installed, you can start the monitor by running &lt;code&gt;bmon&lt;/code&gt; from the command-line.&lt;/p&gt;&#xA;&lt;p&gt;You will be presented with multiple network interfaces (NICs).&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Merge Javascript Objects</title>
      <link>https://andrewodendaal.com/how-to-merge-javascript-objects/</link>
      <pubDate>Tue, 11 Feb 2020 08:49:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-merge-javascript-objects/</guid>
      <description>&lt;p&gt;A Javascript Object – now just called &lt;code&gt;JSON&lt;/code&gt; – is a collection of values and properties stored as a map.&lt;/p&gt;&#xA;&lt;p&gt;How would you merge two or more Javascript objects together thought?&lt;/p&gt;&#xA;&lt;p&gt;In ECMAScript 2018, the Object &lt;code&gt;Spread&lt;/code&gt; operator will do the trick for you in no time, let&amp;rsquo;s try it out.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var jso1 = {&#xA;  &amp;#34;name&amp;#34;: &amp;#34;John&amp;#34;,&#xA;  &amp;#34;colour&amp;#34;: &amp;#34;green&amp;#34;,&#xA;};&#xA;&#xA;var jso2 = {&#xA;  &amp;#34;name&amp;#34;: &amp;#34;Andrew&amp;#34;,&#xA;  &amp;#34;symbol&amp;#34;: &amp;#34;arrow&amp;#34;,&#xA;};&#xA;&#xA;var merged = {...jso1, ...jso2};&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The result of this would be to combine all the elements and override any newer ones where applicable.&lt;/p&gt;</description>
    </item>
    <item>
      <title>When to use Pip3 instead of Pip in Python</title>
      <link>https://andrewodendaal.com/when-to-use-pip3-instead-of-pip-in-python/</link>
      <pubDate>Mon, 10 Feb 2020 11:39:09 +0000</pubDate>
      <guid>https://andrewodendaal.com/when-to-use-pip3-instead-of-pip-in-python/</guid>
      <description>&lt;p&gt;If you have multiple versions of Python installed on a system, such as both Python 2.7 and Python 3.6+. Then &lt;code&gt;pip&lt;/code&gt; will often refer to the Python2 bin, while &lt;code&gt;pip3&lt;/code&gt; will point to the Python3 bin.&lt;/p&gt;&#xA;&lt;p&gt;You can easily tell what your own setup is by running the following commands in a terminal window / command-line.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ which pip&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ which pip3&#xA;&#xA;/usr/local/bin/pip3&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It is also useful to know what version of Python you have on your system and where it is, as Pip is always coupled with it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to use Screen on Linux</title>
      <link>https://andrewodendaal.com/how-to-use-screen-on-linux/</link>
      <pubDate>Sun, 09 Feb 2020 08:36:44 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-use-screen-on-linux/</guid>
      <description>&lt;p&gt;&lt;code&gt;Screen&lt;/code&gt; on Linux is a popular command-line program that lets you multiplex between interactive shells.&lt;/p&gt;&#xA;&lt;p&gt;What that means is, you can use &lt;code&gt;screen&lt;/code&gt; to save and restore running of commands.&lt;/p&gt;&#xA;&lt;h2 id=&#34;screen-in-action&#34;&gt;&lt;code&gt;Screen&lt;/code&gt; in action&lt;/h2&gt;&#xA;&lt;p&gt;The best way to test this out is to SSH into a server.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sh user@150.xx.xxx.xx&#xA;&#xA;user@server:~#&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;At this stage, you can execute &lt;code&gt;man screen&lt;/code&gt; to learn all the commands available to you.&lt;/p&gt;&#xA;&lt;p&gt;You can issue a &lt;code&gt;screen -list&lt;/code&gt; to show all screen sessions that may already be open.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Transfer a domain from Namecheap</title>
      <link>https://andrewodendaal.com/transfer-a-domain-from-namecheap/</link>
      <pubDate>Sat, 08 Feb 2020 14:06:08 +0000</pubDate>
      <guid>https://andrewodendaal.com/transfer-a-domain-from-namecheap/</guid>
      <description>&lt;p&gt;Namecheap is a pretty good registrar. As its name says, yes, it is usually pretty cheap. I would also like to point out that I personally have nothing bad to say about Namecheap and that their service is overall pretty positive. But as with most things, there occasionally comes time to make a change. This change happens to be to transfer a domain hosted at Namecheap.&lt;/p&gt;&#xA;&lt;p&gt;Recently I have been moving most of my domains to Cloudflare, who don&amp;rsquo;t currently offer registrations but do offer to take the domains once registered.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Package a Python App using Nuitka</title>
      <link>https://andrewodendaal.com/how-to-package-a-python-app-using-nuitka/</link>
      <pubDate>Fri, 07 Feb 2020 08:02:54 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-package-a-python-app-using-nuitka/</guid>
      <description>&lt;p&gt;Learn how to package a Python app in this tutorial.&lt;/p&gt;&#xA;&lt;p&gt;For the most part, once you&amp;rsquo;ve written your Python code, you simply deploy it to a server, install the environment, grab the dependencies and you&amp;rsquo;re done.&lt;/p&gt;&#xA;&lt;p&gt;However, there are times when you may want to provide your app to someone else and don&amp;rsquo;t want the hassle of getting them setup with all the training around making sure they have Python on their machine and can run your app.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Introduction to NPM</title>
      <link>https://andrewodendaal.com/introduction-to-npm/</link>
      <pubDate>Thu, 06 Feb 2020 10:08:15 +0000</pubDate>
      <guid>https://andrewodendaal.com/introduction-to-npm/</guid>
      <description>&lt;h2 id=&#34;what-is-npm&#34;&gt;What is NPM?&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;NPM&lt;/code&gt; stands for Node Package Manager, and is the default way to extend your Node applications.&lt;/p&gt;&#xA;&lt;p&gt;There are an absolute ton of packages available to install and use immediately, making NPM wildly popular for software developers.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-node&#34;&gt;What is Node?&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;Node.js&lt;/code&gt;, or often simply just &lt;code&gt;Node&lt;/code&gt;, is a Javascript runtime environment that allows Javascript code to be executed outside of the web browser.&lt;/p&gt;&#xA;&lt;p&gt;It first came about in 2009 when the creator (Ryan Dahl) took Google&amp;rsquo;s V8 Javascript Engine which powers its Chrome browser, and repurposed it. Adding in additional logic allowing it to be used independently to execute Javascript on the server.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create a Symbolic Link on Linux / Mac</title>
      <link>https://andrewodendaal.com/how-to-create-a-symbolic-link-on-linux-mac/</link>
      <pubDate>Wed, 05 Feb 2020 10:49:20 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-create-a-symbolic-link-on-linux-mac/</guid>
      <description>&lt;p&gt;A symbolic link – or often just &lt;code&gt;sym-link&lt;/code&gt; – is a pointer or shortcut to where the actual file lives on a filesystem. What does it take to create a symbolic link?&lt;/p&gt;&#xA;&lt;p&gt;The &lt;code&gt;ln&lt;/code&gt; command actually describes it pretty well:&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;The manual&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;why-would-i-need-a-symbolic-link&#34;&gt;Why would I need a Symbolic Link?&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;When should you create a symbolic link&lt;/code&gt; is a question I am often asked.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Non-interactive git clone (ssh fingerprint prompt)</title>
      <link>https://andrewodendaal.com/non-interactive-git-clone-ssh-fingerprint-prompt/</link>
      <pubDate>Tue, 04 Feb 2020 18:32:40 +0000</pubDate>
      <guid>https://andrewodendaal.com/non-interactive-git-clone-ssh-fingerprint-prompt/</guid>
      <description>&lt;p&gt;If you have ever been in the annoying situation where you had to run &lt;code&gt;git clone&lt;/code&gt; from a server that you did not have interactive access to, such as a continuous integration/deployment box or other. Then you may have run into the dreaded &lt;code&gt;Are you sure you want to continue connecting (yes/no)?&lt;/code&gt; dialogue.&lt;/p&gt;&#xA;&lt;p&gt;Usually, at this stage, you would be stuck, as you need a way to tell it &lt;code&gt;yes&lt;/code&gt;, but there&amp;rsquo;s no input!&lt;/p&gt;</description>
    </item>
    <item>
      <title>When your Python code is much faster with PyPy</title>
      <link>https://andrewodendaal.com/when-your-python-code-is-much-faster-with-pypy/</link>
      <pubDate>Tue, 04 Feb 2020 12:37:06 +0000</pubDate>
      <guid>https://andrewodendaal.com/when-your-python-code-is-much-faster-with-pypy/</guid>
      <description>&lt;p&gt;Python is a very powerful language, there are so many libraries available for it.&lt;/p&gt;&#xA;&lt;p&gt;However, many developers will complain about its speed by comparison to certain other languages, for example, C or C++. If you&amp;rsquo;re new to Python, you might want to first check out &lt;a href=&#34;https://andrewodendaal.com/how-to-learn-python-programming-quickly&#34;&gt;how to learn Python programming quickly&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This is because Python is an interpreted language by design, as opposed to being compiled. Meaning that each time it executes, the instructions need to be converted right there on the spot, making for slower overall execution times. When working with Python, it&amp;rsquo;s also important to know &lt;a href=&#34;https://andrewodendaal.com/how-to-setup-and-use-the-python-virtual-environment&#34;&gt;how to setup and use the Python virtual environment&lt;/a&gt; for better dependency management.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What it takes to be a Platform Engineer in 2020</title>
      <link>https://andrewodendaal.com/what-it-takes-to-be-a-platform-engineer-in-2020/</link>
      <pubDate>Mon, 03 Feb 2020 00:44:17 +0000</pubDate>
      <guid>https://andrewodendaal.com/what-it-takes-to-be-a-platform-engineer-in-2020/</guid>
      <description>&lt;p&gt;Platform Engineering is something that grew out of a mix of what software developers and sysadmins had been doing for years.&lt;/p&gt;&#xA;&lt;p&gt;The only real difference is that most software these days either lives somewhere in some cloud or various services that support it do. Meaning that someone needs to design it, scale it and support it. This is not traditionally within the scope of a software engineer&amp;rsquo;s day job and requires a range of specialisms oftentimes not found with a developer&amp;rsquo;s direct focus.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Introduction to PIP – Python Package Manager</title>
      <link>https://andrewodendaal.com/introduction-to-pip-python-package-manager/</link>
      <pubDate>Sun, 02 Feb 2020 17:57:34 +0000</pubDate>
      <guid>https://andrewodendaal.com/introduction-to-pip-python-package-manager/</guid>
      <description>&lt;p&gt;Python comes with a fully equipped package manager called &lt;code&gt;PIP&lt;/code&gt; – which stands for the &lt;code&gt;Python Package Manager&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;PIP gives your python applications access to thousands of popular libraries, packages or modules for free.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-does-pip-mean&#34;&gt;What does PIP mean?&lt;/h2&gt;&#xA;&lt;p&gt;PIP is actually a recursive acronym which stands for:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;PIP Installs Python&lt;/li&gt;&#xA;&lt;li&gt;PIP Installs Packages&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;before-continuing&#34;&gt;Before Continuing&lt;/h2&gt;&#xA;&lt;p&gt;As usual, it is recommended to do everything in a &lt;a href=&#34;https://andrewodendaal.com/how-to-setup-and-use-the-python-virtual-environment/&#34;&gt;Python Virtual Environment&lt;/a&gt;. Making sure that you are running Python3 is also important, as Python2 has reached End of Life, and this is a welcome thing!&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to build a website quickly using PHP</title>
      <link>https://andrewodendaal.com/how-to-build-a-website-quickly-using-php/</link>
      <pubDate>Sat, 01 Feb 2020 14:14:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-build-a-website-quickly-using-php/</guid>
      <description>&lt;p&gt;PHP is a powerful scripting language created for the web.&lt;/p&gt;&#xA;&lt;p&gt;It has come a long way since it’s initial inception in 1994.&lt;/p&gt;&#xA;&lt;p&gt;It was originally created to build websites quickly and easily and has become a lot more than that.&lt;/p&gt;&#xA;&lt;p&gt;While many developers and companies use PHP along with extensive and oftentimes heavy frameworks, there is no reason that you have to do that; you can build websites quickly and very easily by making use of many standard PHP functions.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to replace all occurrences of a string in Javascript</title>
      <link>https://andrewodendaal.com/how-to-replace-all-occurrences-of-a-string-in-javascript/</link>
      <pubDate>Fri, 31 Jan 2020 12:07:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-replace-all-occurrences-of-a-string-in-javascript/</guid>
      <description>&lt;p&gt;I have pretty much resigned myself to the fact that in Javascript, there are really only two ways to do a proper search and replace.&lt;/p&gt;&#xA;&lt;p&gt;Firstly, we need a base string to start manipulating, so let&amp;rsquo;s create our test subject:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var ourString = &amp;#34;This is a great string and we love it&amp;#34;;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;So now the options are as follows, &lt;code&gt;replace&lt;/code&gt;, &lt;code&gt;regular expression replace&lt;/code&gt; and &lt;code&gt;split/join&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;javascript-replace&#34;&gt;Javascript Replace&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ourString.replace(&amp;#34; &amp;#34;, &amp;#34;-&amp;#34;)&#xA;&#xA;&amp;#34;This-is a great string and we love it&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As we can see with this method, it only replaces single occurrences in the string, which may be what you are trying to achieve, but it certainly wasn&amp;rsquo;t for this case!&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to exit Vim</title>
      <link>https://andrewodendaal.com/how-to-exit-vim/</link>
      <pubDate>Thu, 30 Jan 2020 11:32:19 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-exit-vim/</guid>
      <description>&lt;p&gt;If only I had a dollar for every time I saw someone sitting at their computer, trying for the life of them to exit vim&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;TLDR;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;code&gt;Vim&lt;/code&gt; or sometimes just &lt;code&gt;vi&lt;/code&gt; is a command-line (&lt;code&gt;cli&lt;/code&gt;) application that lets you edit documents. It&amp;rsquo;s massively popular and my personal go-to editor when I&amp;rsquo;m on a Linux box. Particularly if I&amp;rsquo;m editing remote files on a webserver or other.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Setup and Use the Python Virtual Environment</title>
      <link>https://andrewodendaal.com/how-to-setup-and-use-the-python-virtual-environment/</link>
      <pubDate>Tue, 28 Jan 2020 09:23:42 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-setup-and-use-the-python-virtual-environment/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Python&lt;!-- raw HTML omitted --&gt; is a fantastic language that continues to help so many businesses and individuals. It offers readable syntax to get started, yet extensive amounts of control and flexibility to move into the more advanced areas of software engineering. Python the number one choice for many because it is packed with the power of unparalleled libraries, it recommended to run them through a &lt;a href=&#34;https://andrewodendaal.com/how-to-setup-and-use-the-python-virtual-environment/&#34;&gt;python virtual environment&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Introducing the Hetzner Cloud</title>
      <link>https://andrewodendaal.com/introducing-the-hetzner-cloud/</link>
      <pubDate>Mon, 27 Jan 2020 15:52:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/introducing-the-hetzner-cloud/</guid>
      <description>&lt;p&gt;I could honestly not tell you how many hosting providers I&amp;rsquo;ve tried over the past 15 years. Probably more than 30, 40… Easily!&lt;/p&gt;&#xA;&lt;p&gt;Today I would like to introduce you to the Hetzner Cloud. No, I do not work for Hetzner, or have any affiliation to them whatsoever, this is purely a sharing exercise as I have noticed that when I speak of them in my professional capacity, most colleagues don&amp;rsquo;t know about them. Not sure why, as most people know about Digital Ocean and a few others, but with the same token, these people don&amp;rsquo;t tend to know about Linode, Vultr, OVH, and some others. Most people within my profession only know and care about the big players, such as AWS, GCP and Azure.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Multiprocessing in Python3</title>
      <link>https://andrewodendaal.com/multiprocessing-in-python3/</link>
      <pubDate>Tue, 14 Jan 2020 14:13:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/multiprocessing-in-python3/</guid>
      <description>&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import multiprocessing&#xA;&#xA;def runner(k):&#xA;  print(k)&#xA;&#xA;processes = []&#xA;for i in range(10):&#xA;  p = multiprocessing.Process(target=runner, args=(i,))&#xA;  processes.append(p)&#xA;  p.start()&#xA;&#xA;for j in range(len(processes)):&#xA;  processes[j].join()&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now that you have the code; let&amp;rsquo;s explain:&lt;/p&gt;&#xA;&lt;p&gt;Import the &lt;code&gt;multiprocessing&lt;/code&gt; library&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import multiprocessing&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Define the function that will run each time a process is executed&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def runner(k):&#xA;  print(k)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Keep track of all the processes&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;processes = []&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;How many processes do you want to run?&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;for i in range(10):&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Send some arguments to the running function&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Install MongoDB on Mac</title>
      <link>https://andrewodendaal.com/how-to-install-mongodb-on-mac/</link>
      <pubDate>Sat, 04 Jan 2020 23:55:58 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-install-mongodb-on-mac/</guid>
      <description>&lt;p&gt;You can use Homebrew to install MongoDB on a Mac.&lt;/p&gt;&#xA;&lt;p&gt;For ages you were able to simply do:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;brew install mongodb&lt;/code&gt;, but more recently, that has stopped working as it was removed from homebrew-core. Now, you need to do it as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;brew services stop mongodb&#xA;brew uninstall mongodb&#xA;&#xA;brew tap mongodb/brew&#xA;brew install mongodb-community&#xA;brew services start mongodb-community&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can read more about it &lt;!-- raw HTML omitted --&gt;here&lt;!-- raw HTML omitted --&gt; if you&amp;rsquo;d like.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Best Note Taking Apps</title>
      <link>https://andrewodendaal.com/the-best-note-taking-apps/</link>
      <pubDate>Fri, 20 Dec 2019 09:09:50 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-best-note-taking-apps/</guid>
      <description>&lt;p&gt;We&amp;rsquo;re all using a Note Taking App these days, they&amp;rsquo;re incredibly useful and come jam packed with loads of features. But which ones shine out from the rest and which should you use in 2019?&lt;/p&gt;&#xA;&lt;p&gt;Among the many tens to hundreds of possible candidates, I have chosen the seemingly obvious top 5 to explore in this post. These were initially chosen from my own experience having used many over the past few years to find the ultimate single Note Taking app to conquer all others.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Delete large amount of files in directory</title>
      <link>https://andrewodendaal.com/how-to-delete-large-amount-of-files-in-directory/</link>
      <pubDate>Mon, 09 Dec 2019 13:29:51 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-delete-large-amount-of-files-in-directory/</guid>
      <description>&lt;p&gt;So you have clearly got a very large amount of files!&lt;/p&gt;&#xA;&lt;p&gt;If you issue the conventional &lt;code&gt;rm -rf *&lt;/code&gt; within the directory, you will get an error &lt;code&gt;-bash: /bin/rm: Argument list too long&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You can still easily remove these files, just make sure to use the &lt;code&gt;find&lt;/code&gt; command instead!&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;find . -type f -delete&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Merge multiple files, removing duplicate values</title>
      <link>https://andrewodendaal.com/how-to-merge-multiple-files-removing-duplicate-values/</link>
      <pubDate>Mon, 25 Nov 2019 17:51:56 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-merge-multiple-files-removing-duplicate-values/</guid>
      <description>&lt;p&gt;If you have multiple files and you want to remove duplicate values from, while creating a single file.&lt;/p&gt;&#xA;&lt;p&gt;File1 (one.txt):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;123&#xA;123&#xA;234&#xA;345&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;File2 (two.txt):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;123&#xA;678&#xA;567&#xA;890&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As you can see, the two files contain some duplicates. You can easily remove these using the following command:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sort -u one.txt two.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will output:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;123&#xA;234&#xA;345&#xA;567&#xA;678&#xA;890&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can as easily pipe this into a third file as follows:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Unable to delete an AWS Internet Gateway</title>
      <link>https://andrewodendaal.com/unable-to-delete-an-aws-internet-gateway/</link>
      <pubDate>Fri, 22 Nov 2019 13:16:31 +0000</pubDate>
      <guid>https://andrewodendaal.com/unable-to-delete-an-aws-internet-gateway/</guid>
      <description>&lt;p&gt;So you need to delete an AWS Internet Gateway, sounds good.&lt;/p&gt;&#xA;&lt;p&gt;You navigate to the VPC (Virtual Private Cloud) dashboard and go to Internet Gateways.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2019/11/image.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;At this stage you select &amp;ldquo;Actions&amp;rdquo; and choose the &amp;ldquo;Detach VPC&amp;rdquo; option.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2019/11/image-1.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;In a perfect world, this would return a &amp;ldquo;success&amp;rdquo; and the IG would be deleted.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2019/11/image-2.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;But sometimes this isn&amp;rsquo;t the case and you have to do a little more.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2019/11/image-3.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How Distributed Applications Work</title>
      <link>https://andrewodendaal.com/how-distributed-application-work/</link>
      <pubDate>Mon, 29 Jul 2019 14:14:56 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-distributed-application-work/</guid>
      <description>&lt;p&gt;Distributed Applications come in a wide range of sizes, usages and resource availabilities.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;What is a Distributed Application?&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;A perfect example of a Distributed Application is a multiple node database application such as &lt;!-- raw HTML omitted --&gt;Cassandra&lt;!-- raw HTML omitted --&gt;, &lt;!-- raw HTML omitted --&gt;HBase&lt;!-- raw HTML omitted --&gt; or &lt;a href=&#34;https://andrewodendaal.com/serengeti/&#34;&gt;Serengeti&lt;/a&gt;. These applications make use of multiple instances of themselves to be able to address vast amounts of data are stored across many networked computer systems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Why Artificial Intelligence (AI) won’t necessarily take your job</title>
      <link>https://andrewodendaal.com/why-artificial-intelligence-ai-wont-necessarily-take-your-job/</link>
      <pubDate>Tue, 09 Jul 2019 08:34:27 +0000</pubDate>
      <guid>https://andrewodendaal.com/why-artificial-intelligence-ai-wont-necessarily-take-your-job/</guid>
      <description>&lt;p&gt;Artificial Intelligence, or simply AI these days, is when computers are able to perform tasks that humans would otherwise do.&lt;/p&gt;&#xA;&lt;p&gt;While this is incredibly exciting for many, it can be absolutely terrifying for others. Specifically those in roles that AI tends to current target.&lt;/p&gt;&#xA;&lt;p&gt;After all, losing your bread and butter to a computer just seems wrong, but the reality of it is that some roles are already being swapped out for the lesser emotional, more rapidly replicable being of the twenty first century.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The difference between ‘git fetch’ and ‘git pull’</title>
      <link>https://andrewodendaal.com/the-difference-between-git-fetch-and-git-pull/</link>
      <pubDate>Mon, 08 Jul 2019 18:30:26 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-difference-between-git-fetch-and-git-pull/</guid>
      <description>&lt;h2 id=&#34;git-pull-vs-fetch&#34;&gt;Git Pull vs Fetch&lt;/h2&gt;&#xA;&lt;p&gt;Many of us take a look at &lt;code&gt;git fetch&lt;/code&gt; and &lt;code&gt;git pull&lt;/code&gt; and believe them to do the exact same thing! This is just not true.&lt;/p&gt;&#xA;&lt;p&gt;So what exactly is the difference and when should you use one over the other?&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-difference-between-pull-and-fetch&#34;&gt;The Difference Between Pull and Fetch&lt;/h2&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;p class=&amp;quot;schema-faq-answer&amp;quot;&amp;gt;&#xA;  The &amp;lt;code&amp;gt;fetch&amp;lt;/code&amp;gt; command goes to the remote repository and gets the latest information about the branch, commits, references (tags) and all the file objects. This is then returned to the local git instance so that it knows what to do when you want to issue a &amp;lt;code&amp;gt;merge&amp;lt;/code&amp;gt;.&#xA;&amp;lt;/p&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;p class=&amp;quot;schema-faq-answer&amp;quot;&amp;gt;&#xA;  The &amp;lt;code&amp;gt;pull&amp;lt;/code&amp;gt; command essentially does a &amp;lt;code&amp;gt;git fetch&amp;lt;/code&amp;gt; and a &amp;lt;code&amp;gt;git merge&amp;lt;/code&amp;gt; on the respective branch.&#xA;&amp;lt;/p&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h2 id=&#34;roundup&#34;&gt;Roundup&lt;/h2&gt;&#xA;&lt;p&gt;So when would you ever use &lt;code&gt;git fetch&lt;/code&gt; then? Well, it&amp;rsquo;s for when you want to get all the information about changes without merging those changes into your local branch and overwriting your local working copy. It is also very useful for when you want to get the meta about a tag without pulling that tag&amp;rsquo;s reference data back over your local branch.&lt;/p&gt;</description>
    </item>
    <item>
      <title>7 Ways to Make Money Online from Home</title>
      <link>https://andrewodendaal.com/7-ways-to-make-money-online-from-home/</link>
      <pubDate>Mon, 08 Jul 2019 13:39:50 +0000</pubDate>
      <guid>https://andrewodendaal.com/7-ways-to-make-money-online-from-home/</guid>
      <description>&lt;h2 id=&#34;1-create-a-website--blog&#34;&gt;1. Create a website / blog&lt;/h2&gt;&#xA;&lt;p&gt;There are numerous ways to make money when you create a website or blog. It&amp;rsquo;s really cheap and easy to do these days as well, with so many available options, some are even free. But how do you monetise your new online presence once you have created something?&lt;/p&gt;&#xA;&lt;p&gt;There are a few obvious ways, which include:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Sell things on your website&lt;/li&gt;&#xA;&lt;li&gt;Advertising on your website&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;These are probably the most common ways to make money online from home for almost free.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Investigation of insider attacks with computer forensics</title>
      <link>https://andrewodendaal.com/investigation-of-insider-attacks-with-computer-forensics/</link>
      <pubDate>Sun, 07 Oct 2018 12:22:38 +0000</pubDate>
      <guid>https://andrewodendaal.com/investigation-of-insider-attacks-with-computer-forensics/</guid>
      <description>&lt;p&gt;Cyber-attacks do not always originate from outside of the target organisation. Veritably around twenty-five percent of all data breaches occur from the inside, from employees or trusted individuals within the organisation (TechBeacon, 2018).&lt;/p&gt;&#xA;&lt;p&gt;Employees that have access to internal records, intellectual property or intramural trade secrets need to be watched as closely as any external party or connection should be.&lt;/p&gt;&#xA;&lt;h3 id=&#34;why-employees-are-a-risk&#34;&gt;Why employees are a risk&lt;/h3&gt;&#xA;&lt;p&gt;Employees can trigger internal cyber-attacks, steal intellectual property or even publicly release internal affairs and private information for a number of reasons, which could include:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Squid Proxy behind a Load Balancer on AWS</title>
      <link>https://andrewodendaal.com/squid-proxy-behind-a-load-balancer-on-aws/</link>
      <pubDate>Thu, 04 Oct 2018 11:39:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/squid-proxy-behind-a-load-balancer-on-aws/</guid>
      <description>&lt;p&gt;Squid is a proxy software that allows a computer without internet access to proxy through another computer that does have internet access.&lt;/p&gt;&#xA;&lt;p&gt;Squid is very easy to get setup and the computer that needs internet just needs to specify environment variables called &lt;code&gt;HTTP_PROXY&lt;/code&gt; and &lt;code&gt;HTTPS_PROXY&lt;/code&gt; which have the value of &lt;code&gt;http://squid.ip.address:3128/&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;The complication comes in where you need a Squid instance (sitting on an EC2) to sit behind an AWS load balancer. This is usually done for a number of reasons, such as service redundancy, uptime guarantees or even mitigating against maintenance schedules.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to install a Ruby Gem without Root on a Mac</title>
      <link>https://andrewodendaal.com/how-to-install-a-ruby-gem-without-root-on-a-mac/</link>
      <pubDate>Mon, 01 Oct 2018 11:38:11 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-install-a-ruby-gem-without-root-on-a-mac/</guid>
      <description>&lt;p&gt;Gems are little packaged Ruby applications that allow you to extend the ecosystem and reuse countless online sources.&lt;/p&gt;&#xA;&lt;p&gt;If you don&amp;rsquo;t have Root on your Mac (work at a large company?) but you still want to use a Gem or two, then you will usually get the following error when attempting to install:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ERROR:  While executing gem ... (Gem::FilePermissionError)&#xA;    You don&amp;#39;t have write permissions for the /Library/Ruby/Gems/2.0.0 directory.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is incredible annoying, but something you can&amp;rsquo;t avoid. So better find a workaround and move on!&lt;/p&gt;</description>
    </item>
    <item>
      <title>The dark truth behind Advertising on the internet</title>
      <link>https://andrewodendaal.com/the-dark-truth-behind-advertising-on-the-internet/</link>
      <pubDate>Mon, 01 Oct 2018 09:56:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-dark-truth-behind-advertising-on-the-internet/</guid>
      <description>&lt;h3 id=&#34;the-story&#34;&gt;The story&lt;/h3&gt;&#xA;&lt;p&gt;Steve has a website which sells carpets in London.&lt;/p&gt;&#xA;&lt;p&gt;Steve&amp;rsquo;s carpet business has been doing really well and Peter has recently noticed just how well. Peter decides to get into the same business and decides to build a website too.&lt;/p&gt;&#xA;&lt;p&gt;Peter&amp;rsquo;s website is soon complete and he has a little stock to get started.. but nobody visits his website. So he decides to take out some online ads.&lt;/p&gt;</description>
    </item>
    <item>
      <title>International hosting governments and forensic email cases</title>
      <link>https://andrewodendaal.com/international-hosting-governments-and-forensic-email-cases/</link>
      <pubDate>Sun, 30 Sep 2018 21:59:03 +0000</pubDate>
      <guid>https://andrewodendaal.com/international-hosting-governments-and-forensic-email-cases/</guid>
      <description>&lt;p&gt;Cyber forensics is hard, but it is even harder when servers are hosted in different geographical locations and an investigation needs all localities to cooperate and hand over every part of the data consistently.&lt;/p&gt;&#xA;&lt;p&gt;This is primarily due to privacy laws that each region may apply or carry out in differing ways.&lt;/p&gt;&#xA;&lt;h3 id=&#34;multiple-regions&#34;&gt;Multiple regions&lt;/h3&gt;&#xA;&lt;p&gt;Even if a compilation can source multiple regions data; dealing with international governments could mean prolonged wait times, unfamiliar processes to follow or even citizens of those regions withholding data due to privacy rights within that region.&lt;/p&gt;</description>
    </item>
    <item>
      <title>When to give up on your startup/product</title>
      <link>https://andrewodendaal.com/when-to-give-up-on-your-startup-product/</link>
      <pubDate>Fri, 28 Sep 2018 11:46:22 +0000</pubDate>
      <guid>https://andrewodendaal.com/when-to-give-up-on-your-startup-product/</guid>
      <description>&lt;p&gt;One of the hardest things you can do after trying to get a startup or product off the ground is to simply give up and call it a day.&lt;/p&gt;&#xA;&lt;p&gt;After all, you&amp;rsquo;ve put an awful lot of blood, sweat and tears into it, and you have probably done this for months, if not even years!&lt;/p&gt;&#xA;&lt;p&gt;As a life-long software developer, I&amp;rsquo;ve always had side projects going, some from small ideas to others that I have truly invested a lot of time and money into. We all seem to fall down this same path and who doesn&amp;rsquo;t want their own company, doing exactly what they want to do?&lt;/p&gt;</description>
    </item>
    <item>
      <title>Just SSH to my Jump Box!</title>
      <link>https://andrewodendaal.com/just-ssh-to-my-jump-box/</link>
      <pubDate>Wed, 26 Sep 2018 22:14:23 +0000</pubDate>
      <guid>https://andrewodendaal.com/just-ssh-to-my-jump-box/</guid>
      <description>&lt;p&gt;I am a professional software engineer and do an absolute ton of devops work as well.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve actually never been hired into devops roles as I always go in as a programmer, but I also always end up doing devops as well for various reasons.&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-tasks&#34;&gt;What tasks?&lt;/h3&gt;&#xA;&lt;p&gt;These usually include things like:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I like to get my code running on infrastructure as soon as possible for Proof of Concepts (POCs) and the like.&lt;/li&gt;&#xA;&lt;li&gt;I&amp;rsquo;m often one of the first people in the team, or am part of starting the project.&lt;/li&gt;&#xA;&lt;li&gt;I have a good grasp on the system admin side of things and like to get my hands dirty.&lt;/li&gt;&#xA;&lt;li&gt;I made the first prototypes of the software so like to get all the other parts up so that new joiners have a good understanding of how things work together.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;One of the things I have found about getting this all going each time is that I end up with usually quite a lot of rapidly changing Compute machines (EC2s) and other services. It is perfectly fine for me to login and get the latest IPs to SSH to, or keep a local config, but as soon as I have a team that needs to start using them, connecting to things or getting onto boxes to made changes then this doesn&amp;rsquo;t really work all that well.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Counting in Python using a list</title>
      <link>https://andrewodendaal.com/counting-in-python-using-a-list/</link>
      <pubDate>Tue, 25 Sep 2018 13:24:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/counting-in-python-using-a-list/</guid>
      <description>&lt;p&gt;So before we begin, let me just tell you that this is a pretty useless thing to do.. But I was playing around with it while waiting for a C++ project to finish compiling, so why not!&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The code (&lt;!-- raw HTML omitted --&gt;click here for the Gist&lt;!-- raw HTML omitted --&gt;):&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;magic = 0x616f-0x414f&#xA;&#xA;numbers = [&#xA;    (magic/0x186A0),&#xA;    (magic/0x3E8/8),&#xA;    (magic/0x3E8/4),&#xA;    (magic/0o1534-7),&#xA;    (magic/0x3E8/2),&#xA;    (magic/0o2534-1),&#xA;    (magic/0o2544),&#xA;    (magic/0o075/19),&#xA;    (magic/0o064/19),&#xA;    (magic/0o1654)&#xA;]&#xA;&#xA;i = c = numbers[0]&#xA;&#xA;while True:&#xA;    print(&amp;#39;%d%d&amp;#39; % (c, round(numbers[int(i)])))&#xA;    i += 1&#xA;    if i&amp;gt;len(numbers)-1:&#xA;        i = 0&#xA;        c += 1&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you ran it, it would look like this!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Show the desktop’s image name on a Mac</title>
      <link>https://andrewodendaal.com/show-the-desktops-image-name-on-a-mac/</link>
      <pubDate>Sun, 23 Sep 2018 16:50:40 +0000</pubDate>
      <guid>https://andrewodendaal.com/show-the-desktops-image-name-on-a-mac/</guid>
      <description>&lt;p&gt;Sometimes you just need to know where that image shown on your desktop is stored!&lt;/p&gt;&#xA;&lt;p&gt;For this, there is a simple but effective line of text you can pop into your terminal.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;defaults write com.apple.dock desktop-picture-show-debug-text -bool TRUE;killall Dock&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will render the image&amp;rsquo;s location pathname and image name over the desktop background image.&lt;/p&gt;&#xA;&lt;p&gt;When you&amp;rsquo;re complete and you want to disable that over render of the image name, then simply type:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Network Forensics Concerns around GDPR</title>
      <link>https://andrewodendaal.com/network-forensics-concerns-around-gdpr/</link>
      <pubDate>Sun, 23 Sep 2018 16:39:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/network-forensics-concerns-around-gdpr/</guid>
      <description>&lt;p&gt;In Cyber Forensic there are a vast array of tools that are used throughout most investigations, however, not all jurisdictions allow or even agree to the usage of some of them. This is mainly due to each specific geographical region&amp;rsquo;s view on their citizens right to privacy.&lt;/p&gt;&#xA;&lt;p&gt;Some of the tools and tactics to collecting evidence are therefore questionable and raise specific concerns in this matter.&lt;/p&gt;&#xA;&lt;p&gt;During the evidence collection process there are many things to consider when it comes to data being transferred over a network.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A look into Future Developments in Operating Systems from a Cyber Forensics Investigator</title>
      <link>https://andrewodendaal.com/a-look-into-future-developments-in-operating-systems-from-a-cyber-forensics-investigator/</link>
      <pubDate>Sun, 16 Sep 2018 11:51:55 +0000</pubDate>
      <guid>https://andrewodendaal.com/a-look-into-future-developments-in-operating-systems-from-a-cyber-forensics-investigator/</guid>
      <description>&lt;p&gt;Operating systems (OS) really have come a long way since the very first one was created by General Motors in 1956 (WIHT, 2017) to run on an IBM mainframe.&lt;/p&gt;&#xA;&lt;p&gt;Since then, there have been countless attempts at popularising OS?s and a few companies have truly stood the test of time.&lt;/p&gt;&#xA;&lt;p&gt;Among these the Windows OS, MacOS and Linux OS are the most notable with the highest market share and global penetration.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Comparing Interface Types in Cyber Forensics</title>
      <link>https://andrewodendaal.com/comparing-interface-types-in-cyber-forensics/</link>
      <pubDate>Sun, 02 Sep 2018 19:56:16 +0000</pubDate>
      <guid>https://andrewodendaal.com/comparing-interface-types-in-cyber-forensics/</guid>
      <description>&lt;p&gt;In digital and cyber forensics, there are three main types of categories when it comes to forensic tooling. They can be considered as:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Graphical User Interfaces (GUI?s)&lt;/li&gt;&#xA;&lt;li&gt;Interactive Text-based Consoles&lt;/li&gt;&#xA;&lt;li&gt;Command-line interfaces (CLI?s)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Of these, the main competitors are really just GUIs and CLIs as they certainly differentiate most from one another.&lt;/p&gt;&#xA;&lt;p&gt;They both have their strengths and reasons to be used, of which neither should be discounted.&lt;/p&gt;&#xA;&lt;p&gt;Many people like to use the GUI version of an application, as it allows them to focus on the task at hand that may extend between a range of activities and doesn?t require them to remember command line arguments and other such distractions. Essentially, getting straight to the point and focusing on retrieving the necessary evidence to place into a report in order to complete the investigation at hand.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cyber Forensic Investigative Reports</title>
      <link>https://andrewodendaal.com/cyber-forensic-investigative-reports/</link>
      <pubDate>Sun, 26 Aug 2018 11:24:54 +0000</pubDate>
      <guid>https://andrewodendaal.com/cyber-forensic-investigative-reports/</guid>
      <description>&lt;p&gt;Investigations are not proven in a jurisdiction until a detailed forensic report is created and presented to a judge or jury who can take it to the next level. Presenting digital evidence should be laid out that it is not overly technical in order for all parties to fully understand and interpret in its arrangement, yet still goes into absolute detail to express all the intricacies of an investigation and its extrication.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Altering Computer Evidence</title>
      <link>https://andrewodendaal.com/altering-computer-evidence/</link>
      <pubDate>Sun, 19 Aug 2018 16:28:38 +0000</pubDate>
      <guid>https://andrewodendaal.com/altering-computer-evidence/</guid>
      <description>&lt;p&gt;Ever since it has been possible for humans to operate computers, some have used it to perform criminal activities.&lt;/p&gt;&#xA;&lt;p&gt;Part of a cybercriminal&amp;rsquo;s gameplay is to cover up or otherwise alter digital evidence in one form or another.&lt;/p&gt;&#xA;&lt;p&gt;There are many reasons why cybercriminals may try to alter computer evidence; these could be any of the following:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Cover their traces&lt;!-- raw HTML omitted --&gt;&lt;br&gt;&#xA;The most obvious reason is to simply cover up that the fact that an attacker was around and where the attack came from.&lt;/li&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Shift the blame&lt;!-- raw HTML omitted --&gt;&lt;br&gt;&#xA;Covering evidence or planting alternative evidence could shift the blame and make it appear as though another attacker, group or country was to blame for the attack.&lt;/li&gt;&#xA;&lt;li&gt;&lt;!-- raw HTML omitted --&gt;Cover up a wider plan&lt;!-- raw HTML omitted --&gt;&lt;br&gt;&#xA;Sometimes an attack is simply part of a larger, more coordinated attack. Covering up evidence at this point would be crucial in order to complete the greater plan.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Every time a computer is used, logged into, or attacked locally or remotely, traces of evidence (often called &amp;ldquo;logs&amp;rdquo;) are stored which can lead back to identify the operative; potentially showing where they connected from and what group of exact activities they performed (Kassner, 2015).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Connection broken by ‘SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)’</title>
      <link>https://andrewodendaal.com/connection-broken-by-sslerrorsslerror1-ssl-certificate_verify_failed-certificate-verify-failed-_ssl-c777/</link>
      <pubDate>Thu, 26 Jul 2018 21:22:25 +0000</pubDate>
      <guid>https://andrewodendaal.com/connection-broken-by-sslerrorsslerror1-ssl-certificate_verify_failed-certificate-verify-failed-_ssl-c777/</guid>
      <description>&lt;p&gt;This happens when your machine does not have the correct certificate bundle to access the Pypi repository, or you are behind a corporate proxy that just loves to block everything!&lt;/p&gt;&#xA;&lt;p&gt;An easy way to get around this is to edit (or create) a local pip.conf file under your home directory:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;~/.pip/pip.conf&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Put the following in:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[global]&#xA;&#xA;index-url = http://mirrors.aliyun.com/pypi/simple/&#xA;trusted-host = mirrors.aliyun.com&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As you can see, we have changed the download location to a mirror that doesn&amp;rsquo;t use HTTPS, so there will be no certificate issues.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Can’t pull a Git branch because of merge conflicts?</title>
      <link>https://andrewodendaal.com/cant-pull-a-git-branch-because-of-merge-conflicts/</link>
      <pubDate>Wed, 27 Jun 2018 17:42:49 +0000</pubDate>
      <guid>https://andrewodendaal.com/cant-pull-a-git-branch-because-of-merge-conflicts/</guid>
      <description>&lt;p&gt;Sometimes you need to pull a remote branch and want to accept all their commits (and history) and override your own repository.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s quite simple if you do a pull, don&amp;rsquo;t care about unrelated histories and accept all their code when there&amp;rsquo;s a conflict.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git pull upstream master  --allow-unrelated-histories  -s recursive -X theirs&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then simply push to your own remote and you&amp;rsquo;re done!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Software development processes</title>
      <link>https://andrewodendaal.com/software-development-processes/</link>
      <pubDate>Sun, 13 May 2018 13:36:17 +0000</pubDate>
      <guid>https://andrewodendaal.com/software-development-processes/</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;strong&gt;Introduction to Software Development Processes&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Gabry defines the Software Development Methodology to be a set of related activities that lead to the production of the software (2017).&lt;/p&gt;&#xA;&lt;p&gt;While this is the simplest concept of the processes, there are many formalised industry best practises in operation today; some of these include Rational Unified Process (RUP), OPEN, eXtreme Programming, Scrum, RWSP, DSDM and more.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;strong&gt;A&lt;/strong&gt;&lt;/strong&gt;****?software development scenario****&lt;/p&gt;&#xA;&lt;p&gt;Though I have worked under a range of these processes, I have found the Scrum methodology to be the best performing in most workplaces.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Approaches to software reuse</title>
      <link>https://andrewodendaal.com/approaches-to-software-reuse/</link>
      <pubDate>Sun, 13 May 2018 13:31:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/approaches-to-software-reuse/</guid>
      <description>&lt;h2 id=&#34;introduction-to-software-reuse&#34;&gt;&lt;strong&gt;Introduction to Software Reuse&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Software reuse is the process of creating software from antecedent and extant components.&lt;/p&gt;&#xA;&lt;p&gt;There are a range of approaches that can be taken when following a reuse pattern, these can usually be grouped into one of the following abstractions:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Class Libraries&lt;/li&gt;&#xA;&lt;li&gt;Reusable Components&lt;/li&gt;&#xA;&lt;li&gt;Application Frameworks&lt;/li&gt;&#xA;&lt;li&gt;Patterns / Service Oriented Architecture (SOA)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;There are many benefits in taking up software reuse (SelectBS, n.d.). These include increased software productivity, shorter development times, improved interoperability, recuded costs and usually higher output quality to name a few.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Get the output of an application logged in the terminal</title>
      <link>https://andrewodendaal.com/get-the-output-of-an-application-logged-in-the-terminal/</link>
      <pubDate>Mon, 16 Apr 2018 14:51:26 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-the-output-of-an-application-logged-in-the-terminal/</guid>
      <description>&lt;p&gt;Just a quick note:&lt;/p&gt;&#xA;&lt;p&gt;You are probably looking for a Linux command called `dtrace`.&lt;/p&gt;&#xA;&lt;p&gt;If you&amp;rsquo;re on a mac then you are probably looking for `dtruss`.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Agile as a Software Development Process</title>
      <link>https://andrewodendaal.com/agile-as-a-software-development-process/</link>
      <pubDate>Sat, 24 Mar 2018 12:33:40 +0000</pubDate>
      <guid>https://andrewodendaal.com/agile-as-a-software-development-process/</guid>
      <description>&lt;p&gt;Waterfall and Agile are by far the most commonly used software development processes, however, within them, there are many different styles of software development used in the management of software development projects.&lt;/p&gt;&#xA;&lt;p&gt;While each has their own advantages and disadvantages, we will focus on Agile as it has rapidly grown in popularity over the past few years and is widely accepted throughout the software development discipline and across a wide range of industries of all sizes.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Big Data Security and Privacy Issues</title>
      <link>https://andrewodendaal.com/big-data-security-and-privacy-issues/</link>
      <pubDate>Fri, 02 Mar 2018 15:03:56 +0000</pubDate>
      <guid>https://andrewodendaal.com/big-data-security-and-privacy-issues/</guid>
      <description>&lt;p&gt;Big Data shares what is commonly termed the V properties or characteristics such as Velocity, Volume and Variety which are amongst the most typical or frequently repeated.&lt;/p&gt;&#xA;&lt;p&gt;Taking into account security issues and privacy implications with such large datasets is a challenging ordeal that needs a repeatable framework to cover all areas.&lt;/p&gt;&#xA;&lt;p&gt;Volume is with little to no doubt the most highly targeted characteristic as the expression Big Data fundamentally factors a voluminous amount of information or data that needs to be processed (McCafferty, 2013).&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to delete/revert a Git commit</title>
      <link>https://andrewodendaal.com/how-to-delete-revert-a-git-commit/</link>
      <pubDate>Fri, 02 Mar 2018 12:59:17 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-delete-revert-a-git-commit/</guid>
      <description>&lt;p&gt;You&amp;rsquo;ve just pushed something to a Git repository and you immediately regret it!&lt;/p&gt;&#xA;&lt;p&gt;Run &lt;code&gt;git log&lt;/code&gt; to see what the commit id was:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git log&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Take the first 7 characters of the commit SHA id and do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git revert &amp;lt;commit_id&amp;gt;&#xA;git push --force&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;But if you&amp;rsquo;re like me and your problem was because of a merge conflict that you tried to resolve and clearly failed at, but still had the balls to push to the repo before wishing you hadn&amp;rsquo;t; you can still recover this terrible moment in your life by undoing the merge request itself.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] Pip: There was a problem confirming the ssl certificate</title>
      <link>https://andrewodendaal.com/pip-there-was-a-problem-confirming-the-ssl-certificate/</link>
      <pubDate>Mon, 26 Feb 2018 12:52:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/pip-there-was-a-problem-confirming-the-ssl-certificate/</guid>
      <description>&lt;p&gt;If you ever get the following error when trying to install a Pip module under Python:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Could not fetch URL https://pypi.python.org/simple/****/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777) - skipping&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then an easy way to get around it is by adding the trusted-host flag to your commandline argument as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;--trusted-host pypi.python.org&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;So your final command may look something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;pip install some_module  --trusted-host pypi.python.org&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to Learn Python Programming Quickly</title>
      <link>https://andrewodendaal.com/how-to-learn-python-programming-quickly/</link>
      <pubDate>Thu, 22 Feb 2018 10:56:15 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-learn-python-programming-quickly/</guid>
      <description>&lt;p&gt;So you want to learn to program in Python and you don&amp;rsquo;t have a lot of time?&lt;/p&gt;&#xA;&lt;p&gt;That&amp;rsquo;s okay! Once you grasp some of the key concepts and ways of thinking, it will all come to you.&lt;/p&gt;&#xA;&lt;p&gt;So let&amp;rsquo;s get going now, shall we?&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-is-python&#34;&gt;What is Python?&lt;/h3&gt;&#xA;&lt;p&gt;Python is a high-level, interpreted, object-oriented programming language with dynamic semantics used for general-purpose programming. It was created by Guido van Rossum and first released in 1991.&lt;/p&gt;</description>
    </item>
    <item>
      <title>NoSQL Pandas Dataframes</title>
      <link>https://andrewodendaal.com/nosql-pandas-dataframes/</link>
      <pubDate>Fri, 16 Feb 2018 17:35:38 +0000</pubDate>
      <guid>https://andrewodendaal.com/nosql-pandas-dataframes/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;Pandas Dataframes are simply a table with some rows (McKinney, 2015) and many additional features built right in to make data scientists lives much easier.&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h3 id=&#34;what-are-nosql-pandas-dataframes&#34;&gt;What are NoSQL Pandas dataframes?&lt;/h3&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Pandas is an open source Python library that provides high performance yet easy to use data structures and data analysis tools (Pandas, 2018).&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Dataframes are two-dimensional size-mutable, potentially heterogeneous tabular data structure with labeled axes. They can be thought of as dictionary type containers for Series objects (PandasDocs, 2018); they are also the primary data structure used in Pandas.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Relational (SQL) vs NoSQL Database Models</title>
      <link>https://andrewodendaal.com/relational-sql-vs-nosql-database-models/</link>
      <pubDate>Sun, 04 Feb 2018 11:43:05 +0000</pubDate>
      <guid>https://andrewodendaal.com/relational-sql-vs-nosql-database-models/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;The Relational (SQL) database has been a central piece to businesses since the 1970s when they first had their claim to fame.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Experts say that the world?s data is doubling every two years (Gajani, 2017) and this is simply something that traditional relational databases cannot manage with their architectural inner workings and scalability concerns.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Netflix Hadoop Big Data Marketing Use Case</title>
      <link>https://andrewodendaal.com/netflix-hadoop-big-data-marketing-use-case/</link>
      <pubDate>Sun, 28 Jan 2018 13:33:49 +0000</pubDate>
      <guid>https://andrewodendaal.com/netflix-hadoop-big-data-marketing-use-case/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Netflix is a video streaming service that has a wealth of information about their user base likes, dislikes, general consumer habits, retention lengths and much more.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Netflix uses their big data to commission original programming content that it knows will succeed and be accepted in relevant published markets (O?Neill, 2016).&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;They perform various A/B tests to determine which variant of similar things perform higher, for example, when showing cover images for series or movies, they will at random show alternative images to determine which proves more reactive from their user base.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using Hadoop to manage Dark Data</title>
      <link>https://andrewodendaal.com/using-hadoop-to-manage-dark-data/</link>
      <pubDate>Fri, 19 Jan 2018 17:18:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/using-hadoop-to-manage-dark-data/</guid>
      <description>&lt;p&gt;Dark Data is the biggest piece of the pie (Datumize , n.d.) when it comes to Big Data and what lies beneath huge datasets of collected information.&lt;/p&gt;&#xA;&lt;p&gt;IBM has stated in a report that over 80 percent of all data is dark and unstructured, meaning that it is simply too much data to process, analyse or unlock valuable information from.&lt;/p&gt;&#xA;&lt;p&gt;This data is termed Dark Data and is mostly unstructured and oftentimes missing or incomplete, which leaves a lot of potential for solutions to be built around high volume analytics and processing.&lt;/p&gt;</description>
    </item>
    <item>
      <title>An Introduction to Client-Server Systems</title>
      <link>https://andrewodendaal.com/an-introducing-to-client-server-systems/</link>
      <pubDate>Sun, 10 Dec 2017 14:27:59 +0000</pubDate>
      <guid>https://andrewodendaal.com/an-introducing-to-client-server-systems/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;A client-server architecture/system is one where the server maintains all models of the backend datasets and business logic around taking and providing information to fulfill a service request from a client which in turn shows the representation thereof.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;The client/server model has quickly grown in popularity throughout the 1990s and today serves as a favoured choice for most organisations? (Subramanian, Lacity, 1997) operations.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>When to use FLUSH PRIVILEGES in MySQL</title>
      <link>https://andrewodendaal.com/when-to-use-flush-privileges-in-mysql/</link>
      <pubDate>Wed, 06 Dec 2017 21:09:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/when-to-use-flush-privileges-in-mysql/</guid>
      <description>&lt;p&gt;So if you&amp;rsquo;ve ever created users and given them specific permissions from with SQL or the commandline, you will be familiar with a statement called FLUSH PRIVILEGES.&lt;/p&gt;&#xA;&lt;p&gt;It is said that if you create a new user, or alter than user, you should run FLUSH PRIVILEGES in order for the MySQL Engine&amp;rsquo;s Session to take the change into immediate effect.&lt;/p&gt;&#xA;&lt;p&gt;But what about if you GRANTed or REVOKEd a permission? Do you still need to use it?&lt;/p&gt;</description>
    </item>
    <item>
      <title>MySQL Community Server MSI Installer Hangs on Windows 10</title>
      <link>https://andrewodendaal.com/mysql-community-server-msi-installer-hangs-on-windows-10/</link>
      <pubDate>Wed, 06 Dec 2017 00:30:57 +0000</pubDate>
      <guid>https://andrewodendaal.com/mysql-community-server-msi-installer-hangs-on-windows-10/</guid>
      <description>&lt;p&gt;I was trying to install MySQL Community Server for Windows 10 using the standard .MSI installer provded from the MySQL website and the installer just hung, saying that there was 3 seconds remaining.&lt;/p&gt;&#xA;&lt;p&gt;About half an hour later, it still said &amp;ldquo;3 seconds remaining&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;It turned out that you have to run cmd (commandline) as Administrator:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/6Qwxdf.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Press Windows Key (Super), type &amp;ldquo;cmd&amp;rdquo;, right click on &amp;ldquo;Command Prompt&amp;rdquo; and select &amp;ldquo;Run as administrator&amp;rdquo;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Android device supports x86, but APK only supports Arm</title>
      <link>https://andrewodendaal.com/android-device-supports-x86-but-apk-only-supports-arm/</link>
      <pubDate>Mon, 04 Dec 2017 10:26:50 +0000</pubDate>
      <guid>https://andrewodendaal.com/android-device-supports-x86-but-apk-only-supports-arm/</guid>
      <description>&lt;p&gt;I get this error quite a lot when trying to deploy an Android APK to an emulator.&lt;/p&gt;&#xA;&lt;p&gt;&amp;ldquo;&lt;!-- raw HTML omitted --&gt;Device supports x86_64, x86, but APK only support , all, armeabi-v7a&lt;!-- raw HTML omitted --&gt;&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2017/12/OnPaste.20171204-091726.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;The good thing is that it is actually a very easy thing to fix.&lt;/p&gt;&#xA;&lt;p&gt;While doing development you can simply change the Build Variant target.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;How do you do that?&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Click &amp;ldquo;&lt;em&gt;View&lt;/em&gt;&amp;rdquo; -&amp;gt; &amp;ldquo;&lt;em&gt;Tool Window&lt;/em&gt;&amp;rdquo; -&amp;gt; &amp;ldquo;&lt;em&gt;Build Variants&lt;/em&gt;&amp;rdquo;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Weird Dialog Boxes</title>
      <link>https://andrewodendaal.com/weird-dialog-boxes/</link>
      <pubDate>Thu, 30 Nov 2017 13:58:25 +0000</pubDate>
      <guid>https://andrewodendaal.com/weird-dialog-boxes/</guid>
      <description>&lt;p&gt;Adobe Setup setup?&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2012/04/initialsingadobesetupsetup.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Got this one while using Chrome, it complains about Safari?&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2012/04/chromesafa.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;What a load of bullshit!&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2012/04/walobs.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Really?&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2012/07/it-jokes-funny-computer-errors-weird-error-messages-dumb-dialogue-boxes-can-not-create-dialogue-box-prompt-funny-pinoy-photos1.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Very handy tips screen!&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2012/07/it-jokes-funny-computer-errors-weird-error-messages-dumb-dialogue-boxes-tips-file-funny-pinoy-jokes1.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;ERROR: NO ERROR!&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2012/07/funny-computer-errors-weird-error-messages-dumb-dialogue-boxes1.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>A bit on SQL Standards</title>
      <link>https://andrewodendaal.com/a-bit-on-sql-standards/</link>
      <pubDate>Sun, 12 Nov 2017 14:07:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/a-bit-on-sql-standards/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;SQL (Structured Query Language) for relational databases was maintained and standardised by the American National Standards Institute (ANSI) and the International Organisation for Standardisation (ISO) which is affiliated with the International Electrotechnical Commission (IEC).&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;When a new SQL standard is published by these organisations it is outlined on the ISO website and available for everyone to both reference and use as required.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Brief Talk on Databases</title>
      <link>https://andrewodendaal.com/a-bit-on-databases/</link>
      <pubDate>Sun, 29 Oct 2017 00:28:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/a-bit-on-databases/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Databases have been around since ancient times, when elaborate database systems were deployed by governments, hospitals and organisations to keep track of vast amounts of information; but only until around the 1960s did computerised databases start to take shape and become cost effective for private organisations to start using (Quickbase, n.d.).&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;I have used countless databases over my career to reliably store and retrieve many sizes of information, from a small collection of less than ten items of data to terabytes worth of hundred of billions of data points spread across clusters of machines around the world.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cloud Computing – The Refute</title>
      <link>https://andrewodendaal.com/cloud-computing-the-refute/</link>
      <pubDate>Sun, 24 Sep 2017 18:49:17 +0000</pubDate>
      <guid>https://andrewodendaal.com/cloud-computing-the-refute/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Cloud is great, but when you know what you are doing, think about alternatives (Blippex, 2013).&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;What is Cloud?&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&amp;ldquo;The cloud&amp;rdquo; is a term given to pay as you go – or pay monthly – off premises computing services that provide either hosting or storage to it?s user base. These services are created, maintained and wholly operated by a cloud computing provider.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Auditing Organisational Information Systems – Security</title>
      <link>https://andrewodendaal.com/auditing-organisational-information-systems-security/</link>
      <pubDate>Sun, 17 Sep 2017 01:10:28 +0000</pubDate>
      <guid>https://andrewodendaal.com/auditing-organisational-information-systems-security/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Auditing an organisation?s information systems is a vital part of operating a business at any decent scale. Particularly from a security standpoint (Mohamed ElBorno, n.d.).&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Information systems have many different facets and each organisation operates slightly differently, so while auditing can be handled the same on general shared traits, more bespoke business units and organisational structures should be taken into account when designing a well thought out auditing system that fully guarantees the security of an organisation?s systems.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Biometric Technology</title>
      <link>https://andrewodendaal.com/biometric-technology/</link>
      <pubDate>Sun, 17 Sep 2017 01:09:52 +0000</pubDate>
      <guid>https://andrewodendaal.com/biometric-technology/</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Biometric Technology?&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Biometric verification is any means by which a person can be uniquely identified by evaluating one or more distinguishing biological traits (Margaret Rouse, n.d.)&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Such recognition usually falls into one of the main categories such as:&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;The above are the verification patterns which various technologies are built around in order to create working application use cases for larger security concerns.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Copyright Compensation in the Internet Age</title>
      <link>https://andrewodendaal.com/copyright-compensation-in-the-internet-age/</link>
      <pubDate>Sat, 09 Sep 2017 17:08:09 +0000</pubDate>
      <guid>https://andrewodendaal.com/copyright-compensation-in-the-internet-age/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;The original conception of copyright in 1710 (Craig Joyce, n.d.) was that it usually covers only the expression of a particular idea and not the idea itself, but this was a very long time ago, before the challenges of a digital society.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Since then, copyright has had to encompass a wide variety of extended property far removed from it?s original case studies that were available at the time.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Controlling employee digital access</title>
      <link>https://andrewodendaal.com/controlling-employee-digital-access/</link>
      <pubDate>Sun, 03 Sep 2017 11:55:35 +0000</pubDate>
      <guid>https://andrewodendaal.com/controlling-employee-digital-access/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Organisations of all sizes have taken to controlling what their employees can access in order to conserve computing resources, keep their employees focused 100 percent on the work they were hired to do and to make sure employees performance is high and as productive as possible (Cyberoam, n.d.).&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;However, keeping employees motivated and productive is not as simple as simply restricting specific access to internet resources and computer controls.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Electronic monitoring in the workplace</title>
      <link>https://andrewodendaal.com/electronic-monitoring-in-the-workplace/</link>
      <pubDate>Sun, 03 Sep 2017 11:54:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/electronic-monitoring-in-the-workplace/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Electronic monitoring is not a new thing, nor one that only affects the workplace. From closed circuit television (CCTV) in stores and down many streets, to similar surveillance in offices everywhere, we are constantly being monitored in all aspects of our lives.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Why and how employers are monitoring employees&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Many employers and organisations tend to perform similar tactics when it comes to monitoring (Emma Anderson, 2014), but I would like to focus on my current and previous employer in order to draw a common ground and paint a picture as to where and how we as employees are being electronically monitored.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Therac-25 Case Study – What Actually Happened?</title>
      <link>https://andrewodendaal.com/the-therac-25-case-study-what-actually-happened/</link>
      <pubDate>Sun, 27 Aug 2017 11:37:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-therac-25-case-study-what-actually-happened/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;The Therac-25 was a computerised medical technology radiation therapy machine produced by Atomic Energy of Canada Limited (AECL) in 1982.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Between 1985 and 1987, it was involved in at least six patients deaths due to incorrect radiation doses because of computer software related failure.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;When the error was first seen, it was thought to be a hardware problem with the microswitches.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Your Responsibilities as an IT Professional</title>
      <link>https://andrewodendaal.com/your-responsibilities-as-an-it-professional/</link>
      <pubDate>Sun, 27 Aug 2017 11:35:05 +0000</pubDate>
      <guid>https://andrewodendaal.com/your-responsibilities-as-an-it-professional/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;As an IT professional it is extremely important to make sure that you do not take advantage of your position on being able to introduce certain skewed characteristics into a computing system in order to gain unfair advantage to your company or client?s business.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;This is seen as unethical and in many cases can also be illegal.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>New capabilities with technology</title>
      <link>https://andrewodendaal.com/new-capabilities-with-technology/</link>
      <pubDate>Wed, 23 Aug 2017 20:30:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/new-capabilities-with-technology/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Computing technology has undoubtedly had some very prominent impact on society at large. &lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Of the almost countless capabilities that it has brought us, the following five core capabilities are without a doubt at the top of any compiled list on the subject:&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Being able to store an unlimited amount of data is one of the main capabilities that we will expand upon and explore in a bit more detail as it provides innumerable offsprings into technological advancements and data insights generally for a wide range of applications and technologies in almost all sub-industries.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Printing Press – Technology’s impact on society</title>
      <link>https://andrewodendaal.com/the-printing-press-technologys-impact-on-society/</link>
      <pubDate>Wed, 23 Aug 2017 20:09:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/the-printing-press-technologys-impact-on-society/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;It&amp;rsquo;s important to first define what the term &amp;ldquo;technology&amp;rdquo; means.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Technology is &amp;ldquo;the application of scientific knowledge for practical purposes, especially in industry.&amp;rdquo; (Oxford Dictionary, n.d.)&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;The term is not reserved for computing systems, but for any field of engineering or applied sciences.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;The printing press has been one of the most important inventions in history and would definitely classify as being within the top few technological enhancements of all time.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Google Abuses Search Dominance in the European Union</title>
      <link>https://andrewodendaal.com/google-abuses-search-dominance-in-the-european-union/</link>
      <pubDate>Wed, 23 Aug 2017 20:08:26 +0000</pubDate>
      <guid>https://andrewodendaal.com/google-abuses-search-dominance-in-the-european-union/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;The EU Commission found that Google has been favouring their very own shopping service while demoting those of their rivals as well as the placement of how they are seen in search results online.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;This is favoritism or preferential treatment which makes it unethical, regardless of sustainability thereof.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;This is a negative thing as a world-wide monopoly of this magnitude should not be allowed to occur at all.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Understanding the Risks of Commercial off-the-shelf software (COTS)</title>
      <link>https://andrewodendaal.com/understanding-the-risks-of-commercial-off-the-shelf-software-cots/</link>
      <pubDate>Sat, 08 Jul 2017 22:18:48 +0000</pubDate>
      <guid>https://andrewodendaal.com/understanding-the-risks-of-commercial-off-the-shelf-software-cots/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Commercial off-the-shelf (COTS) software can be an attractive buy in for many companies when it comes to:&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;It can seem very attractive at first to jump into a COTS solution, but there are many things to take into account that can make it a less than ideal option. This is where analysing potential software reuse risks is highly recommended and will make the difference between an overall cost saving as initially expected, compared to a failed attempt where the result ends up costing significantly more and the project runs over all checkpoints as well as completion dates.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Identifying Risks in Software Engineering</title>
      <link>https://andrewodendaal.com/identifying-risks-in-software-engineering/</link>
      <pubDate>Wed, 28 Jun 2017 00:44:21 +0000</pubDate>
      <guid>https://andrewodendaal.com/identifying-risks-in-software-engineering/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;In Software Engineering it is absolutely paramount to identify all risks that may arise in a given project or grouping of tasks. Without doing the aforementioned, a project can quickly unravel and become disjointed and inherently fall apart.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;It is very important to be able to identify risks and act on them appropriately and in a timely manner (Pressman,1997).&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Software engineering challenges in the 21st century</title>
      <link>https://andrewodendaal.com/software-engineering-challenges-in-the-21st-century/</link>
      <pubDate>Sun, 04 Jun 2017 18:23:20 +0000</pubDate>
      <guid>https://andrewodendaal.com/software-engineering-challenges-in-the-21st-century/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Software Engineering covers not only the technical aspects of building software systems, but also management issues, such as directing programming teams, scheduling, and budgeting. (Webopedia, n.d.)&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;The world of software has exploded since it&amp;rsquo;s humble beginnings in the mid 1940&amp;rsquo;s.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Over the next 30 years the industry focused primarily on cost effective hardware manufacturing and software was undertaken as a second measure, but there were no real methodologies to creating robust, reusable software components. (Computer Hope, 2017)&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Computer Memory – The Breakdown</title>
      <link>https://andrewodendaal.com/computer-memory/</link>
      <pubDate>Mon, 26 Dec 2016 19:50:38 +0000</pubDate>
      <guid>https://andrewodendaal.com/computer-memory/</guid>
      <description>&lt;p&gt;Storage devices have come a long way in an extremely short amount of time; given how much they have changed from just my personal knowledge alone. I still remember using an IBM PC XT 286 with 640KB of RAM and a 64KB ROM to using services provided by companies over the past few years such as Backblaze who are building out 60 Drive 480TB Storage Servers accessible from anywhere.&lt;/p&gt;&#xA;&lt;p&gt;There are two primary types of storage topologies. Volatile Memory and Non-Volatile Memory.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Current Trends in Computing</title>
      <link>https://andrewodendaal.com/current-trends-in-computing/</link>
      <pubDate>Sun, 18 Dec 2016 07:32:36 +0000</pubDate>
      <guid>https://andrewodendaal.com/current-trends-in-computing/</guid>
      <description>&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;</description>
    </item>
    <item>
      <title>Academic integrity in a cultural context</title>
      <link>https://andrewodendaal.com/academic-integrity-in-a-cultural-context/</link>
      <pubDate>Sun, 11 Dec 2016 12:05:08 +0000</pubDate>
      <guid>https://andrewodendaal.com/academic-integrity-in-a-cultural-context/</guid>
      <description>&lt;p&gt;In academia it is vitally important to backup your own thoughts and ideas by using previously written authoritative papers and articles in reference.&lt;/p&gt;&#xA;&lt;p&gt;This helps provide you more credibility as well as proof of what you&amp;rsquo;re saying actually makes sense and falls in line with previous extensive research that has been done on the subject. It also helps to build upon others so as to not have to &amp;ldquo;reinvent the wheel&amp;rdquo; each and every time. &amp;ldquo;Standing on the shoulders of giants&amp;rdquo; could potentially be the greatest lesson learned in progressing an industry and the concept of intellectual property is often not widely known and dealt with correctly.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get more traffic to your blog</title>
      <link>https://andrewodendaal.com/how-to-get-more-traffic-to-your-blog/</link>
      <pubDate>Thu, 03 Sep 2015 16:44:26 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-more-traffic-to-your-blog/</guid>
      <description>&lt;p&gt;If there&amp;rsquo;s only one thing that keeps website owners up at night, it&amp;rsquo;s thinking about the next wave of traffic that they aren&amp;rsquo;t yet getting.&lt;/p&gt;&#xA;&lt;p&gt;Without decent amounts of traffic your website isn&amp;rsquo;t really doing all that much – regardless of what fantastic theme or design you may think you have.&lt;/p&gt;&#xA;&lt;p&gt;and gain a more popular website bustling with loads of daily visitors**&lt;br&gt;&#xA;**&lt;/p&gt;&#xA;&lt;h3 id=&#34;social-networks&#34;&gt;Social Networks&lt;/h3&gt;&#xA;&lt;p&gt;The obvious method to get more visitors is to go to where everyone else on the internet is most of the time. That would probably be one of the many social networks, such as Facebook, Twitter, Pinterest etc.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How big is Amazon S3 really?</title>
      <link>https://andrewodendaal.com/how-big-is-amazon-s3-really/</link>
      <pubDate>Tue, 01 Sep 2015 14:03:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-big-is-amazon-s3-really/</guid>
      <description>&lt;p&gt;Amazon&amp;rsquo;s &lt;!-- raw HTML omitted --&gt;Simple Storage Service&lt;!-- raw HTML omitted --&gt;, or simply S3 for short, is a product designed for storing objects (or files are most people know them) in their proprietary cloud hosting (AWS).&lt;/p&gt;&#xA;&lt;p&gt;Since S3 was first released on March 14th of 2006, it has gained amazing amounts of popularity online, particularly from web and software developers.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s quite interesting to know what S3 really is under the hood and how large it has become.&lt;/p&gt;</description>
    </item>
    <item>
      <title>3 Things you should be tracking with your analytics software</title>
      <link>https://andrewodendaal.com/3-things-you-should-be-tracking-with-your-analytics-software/</link>
      <pubDate>Fri, 28 Aug 2015 10:06:20 +0000</pubDate>
      <guid>https://andrewodendaal.com/3-things-you-should-be-tracking-with-your-analytics-software/</guid>
      <description>&lt;h3 id=&#34;what-should-we-be-tracking&#34;&gt;What should we be tracking?&lt;/h3&gt;&#xA;&lt;p&gt;This is a question we get asked quite a often – mainly by new customers as well as people who aren&amp;rsquo;t certain if what they&amp;rsquo;re looking at adds any value to their daily business time usage.&lt;/p&gt;&#xA;&lt;p&gt;If you&amp;rsquo;ve ever used an analytics tool, you will identify with how addictive it can be to watch the traffic coming in, see where everyone visitor is from and what they are looking at as it happens in realtime.&lt;/p&gt;</description>
    </item>
    <item>
      <title>11 of the Best Google Analytics Alternatives</title>
      <link>https://andrewodendaal.com/11-of-the-best-google-analytics-alternatives/</link>
      <pubDate>Wed, 29 Jul 2015 08:59:55 +0000</pubDate>
      <guid>https://andrewodendaal.com/11-of-the-best-google-analytics-alternatives/</guid>
      <description>&lt;p&gt;So most webmasters know about Google Analytics and have probably used it to some degree, but did you know that there are some pretty good alternatives out there, some even better than the all-famous Google Analytics.&lt;/p&gt;&#xA;&lt;p&gt;We have decided to do a roundup and show off some of our favourites – obviously, we favour Statvoo as we created it, so it&amp;rsquo;s clearly better ;).&lt;/p&gt;&#xA;&lt;h2 id=&#34;clicky&#34;&gt;&lt;!-- raw HTML omitted --&gt;Clicky&lt;!-- raw HTML omitted --&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Clicky focuses on keeping things simple and lets you see the stats that matter as they come in.&lt;br&gt;&#xA;Setup is simple and involves a snippet of custom code that you add to your website.&lt;/p&gt;</description>
    </item>
    <item>
      <title>503 Service Unavailable: Back-end server is at capacity</title>
      <link>https://andrewodendaal.com/503-service-unavailable-back-end-server-is-at-capacity/</link>
      <pubDate>Tue, 28 Jul 2015 08:58:42 +0000</pubDate>
      <guid>https://andrewodendaal.com/503-service-unavailable-back-end-server-is-at-capacity/</guid>
      <description>&lt;p&gt;The Web server (running the Web site) is currently unable to handle the HTTP request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. Some servers in this state may also simply refuse the socket connection, in which case a different error may be generated because the socket creation timed out.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Fixing 503 errors&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>User Testing and Feedback?</title>
      <link>https://andrewodendaal.com/user-testing-and-feedback/</link>
      <pubDate>Thu, 07 May 2015 14:52:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/user-testing-and-feedback/</guid>
      <description>&lt;p&gt;So now you have a website, you use it and love it, but does everybody else?&lt;/p&gt;&#xA;&lt;p&gt;There are many tools out there that allow you to do User Acceptance Testing and provide Feedback from real users, but what are the options?&lt;/p&gt;&#xA;&lt;p&gt;Here are some options we have found that may be of interest.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;UserTesting.com&lt;!-- raw HTML omitted --&gt;&#xA;UserTesting.com provides on-demand usability testing.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Uxeria.com&lt;!-- raw HTML omitted --&gt;&#xA;Your solution for rapid user testing. Users recording in 48 hours.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Date ranges are the key to a better index</title>
      <link>https://andrewodendaal.com/date-ranges-are-the-key-to-a-better-index/</link>
      <pubDate>Wed, 14 Jan 2015 16:09:15 +0000</pubDate>
      <guid>https://andrewodendaal.com/date-ranges-are-the-key-to-a-better-index/</guid>
      <description>&lt;p&gt;Since &lt;a href=&#34;http://www.statvoo.com&#34; title=&#34;Realtime Website Analytics&#34;&gt;AO Analytics&lt;/a&gt; originally went live in February 2013, we have been doing focused around individual time based reporting, it worked well and we were able to sort through indexes without doing full table scans.&lt;/p&gt;&#xA;&lt;p&gt;After much feedback from our users as well as data usage patterns we made the decision to move to date ranges.&lt;/p&gt;&#xA;&lt;p&gt;This replaced our entire retrieval algorithm and therefore copious amounts of work had to go into regression of backward compatibility while introducing the new way of moving forward with the overall system.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Track your Alexa Rank History</title>
      <link>https://andrewodendaal.com/track-your-alexa-rank-history/</link>
      <pubDate>Wed, 14 Jan 2015 16:03:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/track-your-alexa-rank-history/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/alexainline_ni6ckrhZjj1t6p4sd.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;The Alexa Rank is a way of determining a website’s popularity. ?Alexa.com are in the game of Internet popularity ranking and for quite a long time now have been doing a very good job of it.&lt;/p&gt;&#xA;&lt;p&gt;They have a system where the most visited website on the planet is rated as #1 and the second is #2 and so on.&lt;/p&gt;&#xA;&lt;p&gt;If your site is within the top 100,000 alexa rank it is watched more closely and general usage statistics are calculated about it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>SSL Encryption – Update</title>
      <link>https://andrewodendaal.com/ssl-encryption-update/</link>
      <pubDate>Wed, 14 Jan 2015 16:00:53 +0000</pubDate>
      <guid>https://andrewodendaal.com/ssl-encryption-update/</guid>
      <description>&lt;p&gt;We have just rolled out SSL encrytion on Statvoo which means:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Event data is saved over a secure channel&lt;/li&gt;&#xA;&lt;li&gt;Authentication is done automatically&lt;/li&gt;&#xA;&lt;li&gt;All our user’s login information can not be cached over proxies&lt;/li&gt;&#xA;&lt;li&gt;Https sites can now use the service as well&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>Why Website Analytics Is So Important These Days</title>
      <link>https://andrewodendaal.com/why-website-analytics-is-so-important-these-days/</link>
      <pubDate>Wed, 14 Jan 2015 15:59:12 +0000</pubDate>
      <guid>https://andrewodendaal.com/why-website-analytics-is-so-important-these-days/</guid>
      <description>&lt;p&gt;The web has come a long way since Tim Berners-Lee, a British scientist at CERN, &amp;ldquo;invented&amp;rdquo; the World Wide Web (WWW) in 1989.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/1_inline_ni6cd2edtl1t6p4sd.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Above is the very first Web Server with the classic label on the front “This machine is a server, DO NOT POWER DOWN!!”. Which has become an object of many nerds interests as with it being the very first web server, it is quite an interesting machine to study – not that it is available to play around with, but just because of the nerd value it adds.&lt;br&gt;&#xA;Since these days the web has become a lot more intricate and we have found ourselves using the internet for many things and on many types of devices.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Create daterange array of missing dates</title>
      <link>https://andrewodendaal.com/create-daterange-array-of-missing-dates/</link>
      <pubDate>Thu, 20 Feb 2014 09:33:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/create-daterange-array-of-missing-dates/</guid>
      <description>&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;?php&#xA;&#xA;//fromDate&#xA;2014 - 01 - 22&#xA;//toDate&#xA;2014 - 02 - 20&#xA;//$arr&#xA;Array(&#xA;    [0] = &amp;amp; gt;&#xA;    Array(&#xA;        [ISO_DATE] = &amp;amp; gt;&#xA;        2014 - 02 - 18[DAY_SUM_AMOUNT] = &amp;amp; gt;&#xA;        3000[DAY_SUM_VOLUME] = &amp;amp; gt;&#xA;        2[CONVERSION_PCT] = &amp;amp; gt;&#xA;        100&#xA;    )&#xA;&#xA;    [1] = &amp;amp; gt;&#xA;    Array(&#xA;        [ISO_DATE] = &amp;amp; gt;&#xA;        2014 - 02 - 19[DAY_SUM_AMOUNT] = &amp;amp; gt;&#xA;        4000[DAY_SUM_VOLUME] = &amp;amp; gt;&#xA;        1[CONVERSION_PCT] = &amp;amp; gt;&#xA;        100&#xA;    )&#xA;&#xA;)&#xA;&#xA;//codetime&#xA;function createDateRangeArray($strDateFrom, $strDateTo)&#xA;{&#xA;    $aryRange = array();&#xA;    $iDateFrom = mktime(1, 0, 0, substr($strDateFrom, 5, 2) , substr($strDateFrom, 8, 2) , substr($strDateFrom, 0, 4));&#xA;    $iDateTo = mktime(1, 0, 0, substr($strDateTo, 5, 2) , substr($strDateTo, 8, 2) , substr($strDateTo, 0, 4));&#xA;    if ($iDateTo &amp;amp; gt; = $iDateFrom)&#xA;    {&#xA;        array_push($aryRange, date(&amp;#39;Y-m-d&amp;#39;, $iDateFrom)); // first entry&#xA;        while ($iDateFrom &amp;amp; lt;&#xA;        $iDateTo)&#xA;        {&#xA;            $iDateFrom += 86400; // add 24 hours array_push($aryRange,date(&amp;#39;Y-m-d&amp;#39;,$iDateFrom)); } } return $aryRange; } function recursive_array_search($needle,$haystack) { foreach($haystack as $key=&amp;gt;$value) {&#xA;            $current_key = $key;&#xA;            if ($needle === $value or (is_array($value) &amp;amp; amp; &amp;amp; amp;&#xA;            recursive_array_search($needle, $value) !== false))&#xA;            {&#xA;                return $current_key;&#xA;            }&#xA;        }&#xA;        return false;&#xA;    }&#xA;&#xA;    $dates = createDateRangeArray($fromDate, $toDate);&#xA;    $arr2 = array();&#xA;    foreach ($dates as $date)&#xA;    {&#xA;        $inArr = recursive_array_search($date, $arr);&#xA;        if ($inArr !== false)&#xA;        {&#xA;            array_push($arr2, $arr[$inArr]);&#xA;        }&#xA;        else&#xA;        {&#xA;            array_push($arr2, array(&#xA;                &amp;#34;ISO_DATE&amp;#34; = &amp;amp; gt;&#xA;                $date,&#xA;                &amp;#34;DAY_SUM_AMOUNT&amp;#34; = &amp;amp; gt;&#xA;                0,&#xA;                &amp;#34;DAY_SUM_VOLUME&amp;#34; = &amp;amp; gt;&#xA;                0,&#xA;                &amp;#34;CONVERSION_PCT&amp;#34; = &amp;amp; gt;&#xA;                0&#xA;            ));&#xA;        }&#xA;    }&#xA;    $arr = $arr2;&#xA;    &#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Speedtest on Ubuntu Server (commandline)</title>
      <link>https://andrewodendaal.com/speedtest-on-ubuntu-server-commandline/</link>
      <pubDate>Wed, 19 Feb 2014 09:42:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/speedtest-on-ubuntu-server-commandline/</guid>
      <description>&lt;p&gt;Using the &lt;code&gt;speedtest-cli&lt;/code&gt; is easy and very useful. You run it as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;wget -O speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py&#xA;chmod +x speedtest-cli&#xA;./speedtest-cli&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>URL GET vars to PHP Array</title>
      <link>https://andrewodendaal.com/url-get-vars-to-php-array/</link>
      <pubDate>Tue, 14 May 2013 10:52:33 +0000</pubDate>
      <guid>https://andrewodendaal.com/url-get-vars-to-php-array/</guid>
      <description>&lt;p&gt;Sometimes you will need to retrieve the GET variables passed into the current page URI or you will have a URL string to work from which contains certain GET variables, the below method helps a lot to convert them into an array which you can easily manipulate later.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$url = $_SERVER[&amp;#34;REQUEST_URI&amp;#34;];&#xA;parse_str(parse_url($url, PHP_URL_QUERY), $array);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;$array&lt;/code&gt; is now an array of all the GET variables in the URL.&lt;/p&gt;&#xA;&lt;p&gt;Alternatively you can pass a URI string in place of the $_SERVER[&amp;ldquo;REQUEST_URI&amp;rdquo;] by replacing the &lt;code&gt;$url&lt;/code&gt; variable with something else.&lt;/p&gt;</description>
    </item>
    <item>
      <title>python &#34;AttributeError: ZipFile instance has no attribute ‘__exit__&#34;</title>
      <link>https://andrewodendaal.com/python-attributeerror-zipfile-instance-has-no-attribute-__exit__/</link>
      <pubDate>Wed, 08 May 2013 10:28:57 +0000</pubDate>
      <guid>https://andrewodendaal.com/python-attributeerror-zipfile-instance-has-no-attribute-__exit__/</guid>
      <description>&lt;p&gt;This is actually a very easy error to fix, eventhough off the bat it seems a lot more involved.&lt;/p&gt;&#xA;&lt;p&gt;You probably have syntax something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;with zipfile.ZipFile(wr_zip) as zipfd:&#xA;  extract(zipfd, wr_csv, wr_csv)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;So instead we will change it to this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;zipfd = zipfile.ZipFile(wr_zip)&#xA;extract(zipfd, wr_csv, wr_csv)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The reason this fixes it is because at the moment (Python 2.6/2.7 I believe) the zipfile.ZipFile class has no __exit__ attribute, so it does not work with a `with statement` as other file objects do.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Remove specific HTML tags using PHP</title>
      <link>https://andrewodendaal.com/remove-specific-html-tags-using-php/</link>
      <pubDate>Thu, 21 Mar 2013 16:28:44 +0000</pubDate>
      <guid>https://andrewodendaal.com/remove-specific-html-tags-using-php/</guid>
      <description>&lt;p&gt;There are times when you want to remove a specific HTML tag from an HTML block of text.&lt;/p&gt;&#xA;&lt;p&gt;This could be an anchor(&lt;code&gt;&amp;lt;a/&amp;gt;&lt;/code&gt;) or an image(&lt;code&gt;&amp;lt;img/&amp;gt;&lt;/code&gt;) perhaps.&lt;/p&gt;&#xA;&lt;p&gt;You can use &lt;!-- raw HTML omitted --&gt;preg_replace&lt;!-- raw HTML omitted --&gt; to do this quite quickly and efficiently.&lt;/p&gt;&#xA;&lt;p&gt;Remove an anchor:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$content = &amp;#34;Sample text &amp;lt;a href=&amp;#34;#&amp;#34;&amp;gt;Our anchor&amp;lt;/a&amp;gt;. Etc etc&amp;#34;;&#xA;$content = preg_replace(&amp;#39;/&amp;lt;\/?a[^&amp;gt;]*&amp;gt;/&amp;#39;,&amp;#39;&amp;#39;,$content);&#xA;//$content is now -&amp;gt; &amp;#34;Sample text. Etc etc&amp;#34;;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Remove an image:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Keep Google Map v3 centered when browser is resized</title>
      <link>https://andrewodendaal.com/keep-google-map-v3-centered-when-browser-is-resized/</link>
      <pubDate>Fri, 08 Mar 2013 00:05:21 +0000</pubDate>
      <guid>https://andrewodendaal.com/keep-google-map-v3-centered-when-browser-is-resized/</guid>
      <description>&lt;p&gt;Using Google Maps V3 Javascript API you can keep the map centered to the browser&amp;rsquo;s window by using the following trick when resizing the window.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var mapOptions = {&#xA;zoom: 2,&#xA;center: new google.maps.LatLng(0,0), mapTypeId: google.maps.MapTypeId.ROADMAP&#xA;};&#xA;&#xA;var map = new google.maps.Map(document.getElementById(&amp;#34;map_canvas&amp;#34;), mapOptions);&#xA;&#xA;// this is our gem&#xA;google.maps.event.addDomListener(window, &amp;#34;resize&amp;#34;, function() {&#xA;var center = map.getCenter();&#xA;google.maps.event.trigger(map, &amp;#34;resize&amp;#34;);&#xA;map.setCenter(center);&#xA;});&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Buy a Google Nexus 10 in the UK!</title>
      <link>https://andrewodendaal.com/buy-a-google-nexus-10-in-the-uk/</link>
      <pubDate>Sat, 29 Dec 2012 21:43:26 +0000</pubDate>
      <guid>https://andrewodendaal.com/buy-a-google-nexus-10-in-the-uk/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2012/12/440x330-nexus-angle1.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you are looking to get a Google Nexus 10 inch tablet and are based in the UK you are in for a shocker!&lt;/p&gt;&#xA;&lt;p&gt;The only place to buy it is at the &lt;!-- raw HTML omitted --&gt;Google Play&lt;!-- raw HTML omitted --&gt; store and since about the middle of November 2012 they have been sold out.&lt;br&gt;&#xA;Some people say it&amp;rsquo;s due to delayed deliveries and orders and some say it&amp;rsquo;s just bad management on Google&amp;rsquo;s behalf. I think the latter is probably the thing that actually happened as no other tablet providers seem to ever have this problem.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Let Joomla and MySQL interact!</title>
      <link>https://andrewodendaal.com/let-joomla-and-mysql-interact/</link>
      <pubDate>Fri, 21 Dec 2012 15:32:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/let-joomla-and-mysql-interact/</guid>
      <description>&lt;p&gt;I often need a quick and easy few lines to retrieve some data from MySQL using Joomla without all the MVC nonsense that usually goes about this topic.&lt;/p&gt;&#xA;&lt;p&gt;So here is how I do it!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$dbSEL = JFactory::getDbo();&#xA;$dbSEL-&amp;gt;setQuery(&amp;#34;SELECT MAX(`start_price`) FROM #__some_table&amp;#34;);&#xA;$dbSEL-&amp;gt;query();&#xA;echo $dbSEL-&amp;gt;fetchRow();&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As you can see above, we get the current database object and then run a query on it.&lt;br&gt;&#xA;You may notice the hash (#) in the SQL statement of this example, Joomla replaces that (as well as the underscores (__) with the database prefix which is configured, so on shared nodes you don&amp;rsquo;t have to type all that extra stuff that will need to be changed later.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Perform a Mysql Query using Joomla!</title>
      <link>https://andrewodendaal.com/perform-a-mysql-query-using-joomla/</link>
      <pubDate>Fri, 23 Nov 2012 00:41:58 +0000</pubDate>
      <guid>https://andrewodendaal.com/perform-a-mysql-query-using-joomla/</guid>
      <description>&lt;p&gt;This is really actually meant for future reference for myself as lately I&amp;rsquo;ve been doing quite a lot of Joomla! mysql coding and have used the following code just short of 3million times.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$db = JFactory::getDbo();&#xA;$querySelectId = &amp;#34;SELECT `id` FROM #__some_table WHERE `user_id`=&amp;#39;$user_id&amp;#39;&amp;#34;;&#xA;$db-&amp;gt;setQuery($querySelectId);&#xA;$db-&amp;gt;query();&#xA;$data = $db-&amp;gt;loadAssoc();&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;What we do in the above code snippet is select a user_id from some_table (#__) is short for whatever your database table&amp;rsquo;s prefix is (Joomla! replaces this itself) and then we perform the query and return the row&amp;rsquo;s `id` into the $data variable.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Refresh User Data in Joomla</title>
      <link>https://andrewodendaal.com/refresh-user-data-in-joomla/</link>
      <pubDate>Sun, 21 Oct 2012 15:51:15 +0000</pubDate>
      <guid>https://andrewodendaal.com/refresh-user-data-in-joomla/</guid>
      <description>&lt;p&gt;I was busy with a custom component in Joomla, and it stored it&amp;rsquo;s own user_details based off of the main users table, but if the details were changed then I needed the system to update the session to reflect the changes.&lt;/p&gt;&#xA;&lt;p&gt;This is what I did:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$user = JFactory::getUser();&#xA;$session = JFactory::getSession();&#xA;$session-&amp;gt;set(&amp;#34;user&amp;#34;, new JUser($user-&amp;gt;id));&#xA;$user = JFactory::getUser();&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Extract email addresses from a string – PHP</title>
      <link>https://andrewodendaal.com/extract-email-addresses-from-a-string-php/</link>
      <pubDate>Tue, 09 Oct 2012 09:17:56 +0000</pubDate>
      <guid>https://andrewodendaal.com/extract-email-addresses-from-a-string-php/</guid>
      <description>&lt;p&gt;Sometimes you need to extract multiple email addresses from a string and the following function will make all your dreams come true.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function extract_emails_from($string){&#xA;    preg_match_all(&amp;#34;/[\._a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+/i&amp;#34;, $string, $matches);&#xA;    return $matches[0];&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;..and this is how you use it:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$text = &amp;#34;this is some text and here is an email address xxx@example.com, here&amp;#39;s another xxx2@example.com, etc..&amp;#34;;&#xA;$emails = extract_emails_from($text);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now let&amp;rsquo;s use the data:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// as string&#xA;print(implode(&amp;#34;\n&amp;#34;, $emails));&#xA;&#xA;// loop as array&#xA;foreach($emails as $email) {&#xA;    echo $email .&amp;#34;,&amp;#34;;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to drive traffic to your website!</title>
      <link>https://andrewodendaal.com/how-to-drive-traffic-to-your-website/</link>
      <pubDate>Fri, 28 Sep 2012 13:44:25 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-drive-traffic-to-your-website/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2012/09/online_traffic1.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;This is a very &lt;strong&gt;hot topic&lt;/strong&gt; indeed.&lt;/p&gt;&#xA;&lt;p&gt;Definitely one that &lt;strong&gt;everyone with a website&lt;/strong&gt; should know all about.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;To begin our journey&lt;/strong&gt; we will look directly at the &lt;strong&gt;Traffic Generator Sites&lt;/strong&gt; out there who – to be honest – are complete scams because all they really do is one of two things…&lt;/p&gt;&#xA;&lt;p&gt;1.) Load your site into those annoying pop-under ad windows that users close immediately as they appear(not having opened them themselves)&lt;/p&gt;</description>
    </item>
    <item>
      <title>jQuery limit fields to alphanumeric characters only</title>
      <link>https://andrewodendaal.com/jquery-limit-fields-to-alphanumeric-characters-only/</link>
      <pubDate>Wed, 26 Sep 2012 17:23:46 +0000</pubDate>
      <guid>https://andrewodendaal.com/jquery-limit-fields-to-alphanumeric-characters-only/</guid>
      <description>&lt;p&gt;I was trying to restrict a form&amp;rsquo;s field from only allowing the user to enter alphanumeric characters into it. I looked all around and couldn&amp;rsquo;t find a nice way to do it without a plugin, so I wrote my own bind function that you can attach straight to an element.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$(&amp;#34;#yourFieldsElementId&amp;#34;).bind(&amp;#34;keypress&amp;#34;, function (event) {&#xA;&#x9;if (event.charCode!=0) {&#xA;&#x9;&#x9;var regex = new RegExp(&amp;#34;^[a-zA-Z0-9]+$&amp;#34;);&#xA;&#x9;&#x9;var key = String.fromCharCode(!event.charCode ? event.which : event.charCode);&#xA;&#x9;&#x9;if (!regex.test(key)) {&#xA;&#x9;&#x9;&#x9;event.preventDefault();&#xA;&#x9;&#x9;&#x9;return false;&#xA;&#x9;&#x9;}&#xA;&#x9;}&#xA;});&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you would like to restrict the input to only be numeric then do this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Make a dynamic year dropdown using PHP</title>
      <link>https://andrewodendaal.com/make-a-dynamic-year-dropdown-using-php/</link>
      <pubDate>Tue, 18 Sep 2012 22:06:29 +0000</pubDate>
      <guid>https://andrewodendaal.com/make-a-dynamic-year-dropdown-using-php/</guid>
      <description>&lt;p&gt;Ever wanted to have a dropdown that automatically showed the current year and the few years before it?&lt;/p&gt;&#xA;&lt;p&gt;This is a quick and easy way to do exactly that!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;select name=&amp;#34;year&amp;#34;&amp;gt;&#xA;    &amp;lt;?php&#xA;    for($i=date(&amp;#34;Y&amp;#34;)-5;$i&amp;lt;=date(&amp;#34;Y&amp;#34;);$i++) {&#xA;        $sel = ($i == date(&amp;#39;Y&amp;#39;)) ? &amp;#39;selected&amp;#39; : &amp;#39;&amp;#39;;&#xA;        echo &amp;#34;&amp;lt;option value=&amp;#34;.$i.&amp;#34; &amp;#34;.$sel.&amp;#34;--&amp;gt;&amp;#34;.date(&amp;#34;Y&amp;#34;, mktime(0,0,0,0,1,$i)).&amp;#34;&amp;#34;;&#xA;    }&#xA;    ?&amp;gt;&#xA;&amp;lt;/select&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Pad a string with zeros using PHP</title>
      <link>https://andrewodendaal.com/pad-a-string-with-zeros-using-php/</link>
      <pubDate>Mon, 17 Sep 2012 14:07:33 +0000</pubDate>
      <guid>https://andrewodendaal.com/pad-a-string-with-zeros-using-php/</guid>
      <description>&lt;p&gt;Recently I had to create a code/username maker to fit into a certain type of pattern so that all &amp;ldquo;broker codes&amp;rdquo; (as they were called) followed the same path.&lt;br&gt;&#xA;An example one looked like so:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;HJTH0001&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The number needed to increment and I wanted to use the auto-increment feature in the mysql database table that was driving this data to make it.&lt;/p&gt;&#xA;&lt;p&gt;This was easy but I ended up with a code that looked like this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>ImportError: No module named MySQLdb (Python)</title>
      <link>https://andrewodendaal.com/importerror-no-module-named-mysqldb-python/</link>
      <pubDate>Mon, 23 Jul 2012 11:47:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/importerror-no-module-named-mysqldb-python/</guid>
      <description>&lt;p&gt;Trying to use MySQL with Python and getting an ImportError?&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;This is likely because you have not installed it to the system. You can do this on Ubuntu Linux by running the following code:&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;Also, remember that there is no MySQLdb for python3.x and above. There is however, a fork of it on GitHub at: &lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;https://github.com/PyMySQL/mysqlclient-python&#34;&gt;https://github.com/PyMySQL/mysqlclient-python&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Search for “arabic” is url request and change codepage – ASP</title>
      <link>https://andrewodendaal.com/search-for-arabic-is-url-request-and-change-codepage-asp-2/</link>
      <pubDate>Thu, 12 Jul 2012 07:40:42 +0000</pubDate>
      <guid>https://andrewodendaal.com/search-for-arabic-is-url-request-and-change-codepage-asp-2/</guid>
      <description>&lt;p&gt;If you are using Classic ASP (yuck) to create an arabic section of a website you can search for the arabic string in your Request URI and then change the session&amp;rsquo;s codepage as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;if instr(1, request.ServerVariables(&amp;#34;PATH_INFO&amp;#34;), &amp;#34;arabic&amp;#34;) then&#xA;&#x9;session.codepage = 1252&#xA;end if&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Windows 7 is better than Ubuntu 12.04 on desktop!</title>
      <link>https://andrewodendaal.com/windows-7-is-better-than-ubuntu-12-04-on-desktop/</link>
      <pubDate>Thu, 28 Jun 2012 16:01:53 +0000</pubDate>
      <guid>https://andrewodendaal.com/windows-7-is-better-than-ubuntu-12-04-on-desktop/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2012/06/w7u12.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Today we have finalised for ourselves that Windows 7 is definitely a &amp;ldquo;better&amp;rdquo; operating system than Ubuntu 12.04 when it comes to desktop environments.&lt;/p&gt;&#xA;&lt;p&gt;Now, I say &amp;ldquo;better&amp;rdquo; in quotes because the word is quite hard to use as is and &amp;ldquo;convince&amp;rdquo; everybody while doing so.&lt;/p&gt;&#xA;&lt;p&gt;We started our journey on Windows 7 and after desperately needing a reinstall we decided to go for the latest version (at the time) of &lt;!-- raw HTML omitted --&gt;Ubuntu&lt;!-- raw HTML omitted --&gt;, which happened to be the brand spanking new Ubuntu 12.04.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Function split() is deprecated in PHP</title>
      <link>https://andrewodendaal.com/function-split-is-deprecated-in-php/</link>
      <pubDate>Tue, 12 Jun 2012 16:57:11 +0000</pubDate>
      <guid>https://andrewodendaal.com/function-split-is-deprecated-in-php/</guid>
      <description>&lt;p&gt;You heard it right! split() is officially a deprecated function. That means that you can still use it if you are really brave and it will work correctly, but don&amp;rsquo;t expect to see it in later versions of PHP when they come out. Somewhere along the line it WILL not work at all.&lt;/p&gt;&#xA;&lt;p&gt;It has been marked as &amp;ldquo;deprecated&amp;rdquo; due to the fact that the explode() function has the exact same output!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Disable Cache in jQuery</title>
      <link>https://andrewodendaal.com/disable-cache-in-jquery/</link>
      <pubDate>Thu, 24 May 2012 16:32:32 +0000</pubDate>
      <guid>https://andrewodendaal.com/disable-cache-in-jquery/</guid>
      <description>&lt;p&gt;I usually run into this problem when dealing with good ol&amp;rsquo; Internet Explorer (..any version of IE actually).&lt;/p&gt;&#xA;&lt;p&gt;The problem is that IE tries to be smart and not tell you the new output of a file it fetches more than one time with the same filename, instead it shows you what it saw the first time it loaded that file.&lt;/p&gt;&#xA;&lt;p&gt;You can imagine this would be insanely dumb if you were using a realtime application data source where a script output a different resultset each time, e.g. most database ajax requests.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Where is Technology heading, perhaps we should focus more on Software?</title>
      <link>https://andrewodendaal.com/where-is-technology-heading-perhaps-we-should-focus-more-on-software/</link>
      <pubDate>Mon, 21 May 2012 13:32:26 +0000</pubDate>
      <guid>https://andrewodendaal.com/where-is-technology-heading-perhaps-we-should-focus-more-on-software/</guid>
      <description>&lt;p&gt;I often wonder to myself where the technology industry is heading as I see new things come out almost daily.&lt;/p&gt;&#xA;&lt;p&gt;You look around and something you just bought is all of a sudden outdated. This can be quite irritating for the techno-geeks out there that always want the latest release of every gadget, as it makes it somewhat impossible to keep up with what&amp;rsquo;s in stores.&lt;/p&gt;&#xA;&lt;p&gt;The really nice thing about software over hardware is that one can just perform a localised update instead of having to purchase new hardware everytime something changes or is improved. This all lead me to believe that perhaps things would be better if we could somehow come up with a device that is so well thought out with such good hardware that one could just perform regular software updates every once in a while and you would essentially have the &amp;ldquo;latest gadget around&amp;rdquo;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to break out of an iframe</title>
      <link>https://andrewodendaal.com/how-to-break-out-of-an-iframe/</link>
      <pubDate>Wed, 09 May 2012 13:53:25 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-break-out-of-an-iframe/</guid>
      <description>&lt;p&gt;So someone&amp;rsquo;s trying to make their site better by opening a page on your site inside of their site using an iframe?&lt;/p&gt;&#xA;&lt;p&gt;They&amp;rsquo;re doing something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;iframe src=&amp;#34;http://www.example.com/your_page.html&amp;#34; width=&amp;#34;100%&amp;#34; height=&amp;#34;100%&amp;#34;&amp;gt;&amp;lt;/iframe&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Well how about you stop that from happening by pasting the following line in your website&amp;rsquo;s header!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;script type=&amp;#34;text/javascript&amp;#34;&amp;gt;&#xA;if (top.location != self.location) {&#xA;  top.location = self.location.href;&#xA;}&#xA;&amp;lt;/script&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The above code basically does a check to see if the site is the same as what is said in the address bar, if not then it sets the parent&amp;rsquo;s frame (the other site) to change to your site&amp;rsquo;s location!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Edit hosts file on Windows 7</title>
      <link>https://andrewodendaal.com/edit-hosts-file-on-windows-7/</link>
      <pubDate>Wed, 09 May 2012 11:34:53 +0000</pubDate>
      <guid>https://andrewodendaal.com/edit-hosts-file-on-windows-7/</guid>
      <description>&lt;p&gt;The hosts file is used to manually alter the hostname or IP address in place of it being served by a Nameserver, also known as via DNS.&lt;/p&gt;&#xA;&lt;p&gt;The hosts file is located here:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;C:\windows\system32\drivers\etc\&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Or an easiler way to get to it incase of whatever is like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;%systemroot%\system32\drivers\etc\&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This file cannot be editted by &amp;ldquo;normal users&amp;rdquo; and requires all changes to be done via an Administrator.&lt;/p&gt;&#xA;&lt;p&gt;This is really easy if you do it in the following way:&lt;/p&gt;</description>
    </item>
    <item>
      <title>(EAI 2)Name or service not known: Could not resolve host name *.80 — ignoring!</title>
      <link>https://andrewodendaal.com/eai-2name-or-service-not-known-could-not-resolve-host-name-80-ignoring/</link>
      <pubDate>Tue, 08 May 2012 15:14:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/eai-2name-or-service-not-known-could-not-resolve-host-name-80-ignoring/</guid>
      <description>&lt;p&gt;You are no doubt trying to add a vhost and you get the following error when attempting to affect changes by restarting the http daemon (httpd):&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;(EAI 2)Name or service not known: Could not resolve host name *.80 — ignoring!&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Not to worry!&lt;/p&gt;&#xA;&lt;p&gt;Add the following text to httpd.conf at the bottom (That&amp;rsquo;s at /etc/httpd/conf/httpd.conf):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NameVirtualHost 12.34.56.78:80&#xA;&#xA;ServerAdmin yourename@yourserver.com&#xA;DocumentRoot /var/www/html/the_path/&#xA;ServerName the_path.example.com&#xA;ErrorLog /logs/the_path.example.com-error_log&#xA;CustomLog /logs/the_path.example.com-access_log common&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now just restart the http daemon:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Virgin Media blocks torrent sites!</title>
      <link>https://andrewodendaal.com/virgin-media-blocks-torrent-sites/</link>
      <pubDate>Thu, 03 May 2012 12:08:42 +0000</pubDate>
      <guid>https://andrewodendaal.com/virgin-media-blocks-torrent-sites/</guid>
      <description>&lt;p&gt;Virgin Media have done it again! They have gone and started a &amp;ldquo;downloaders war&amp;rdquo;, I&amp;rsquo;m sure of it.&lt;/p&gt;&#xA;&lt;p&gt;Basically what happened is that Virgin Media are claiming that they have had an order from the Courts to prevent access to a whole bunch of sites which lead to illegal downloading or copyright infringement downloading.&lt;/p&gt;&#xA;&lt;p&gt;Not only is it Virgin Media but all 5 major ISP&amp;rsquo;s in the UK that have received this Court order, that&amp;rsquo;s Sky, Everything Everywhere, TalkTalk, O2 and Virgin Media. The initial case was against the Swedish file-sharing website The Piratebay. The Court order sets in as of the 1st of May 2012 and originated in July 2011 when The British Phonographic Industry asked The Piratebay to remove selected torrents and The Piratebay refused, so they took them to court in December. In February Justice Arnold ruled that the The Piratebay incite their users to commit copyright infringement.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Comment out a line in a Crontab on Linux</title>
      <link>https://andrewodendaal.com/how-to-comment-out-a-line-in-a-crontab-on-linux/</link>
      <pubDate>Thu, 03 May 2012 10:31:53 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-comment-out-a-line-in-a-crontab-on-linux/</guid>
      <description>&lt;p&gt;Firstly let&amp;rsquo;s just note that crontabs are read in the following way:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;* * * * * command to be executed&#xA;- - - - -&#xA;| | | | |&#xA;| | | | +----- day of week (0 - 6) (Sunday=0)&#xA;| | | +------- month (1 - 12)&#xA;| | +--------- day of month (1 - 31)&#xA;| +----------- hour (0 - 23)&#xA;+------------- min (0 - 59)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Your current crontabs can be viewed on your linux setup by typing in the following command:&lt;/p&gt;</description>
    </item>
    <item>
      <title>DateTime conversion function using PHP</title>
      <link>https://andrewodendaal.com/datetime-conversion-function-using-php/</link>
      <pubDate>Tue, 01 May 2012 16:10:26 +0000</pubDate>
      <guid>https://andrewodendaal.com/datetime-conversion-function-using-php/</guid>
      <description>&lt;p&gt;It&amp;rsquo;s really very simple to convert times in different timezones using the following function.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function dateTimeConversion($datetime, &#xA;$timezone=&amp;#34;Europe/London&amp;#34;) {&#xA;  $date = new DateTime($datetime, new DateTimeZone(&amp;#34;UTC&amp;#34;));&#xA;  $date-&amp;gt;setTimezone($timezone);&#xA;  return $date-&amp;gt;format(&amp;#34;Y-m-d H:i:s&amp;#34;);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As you can see, it takes 2 arguments, $datetime which is a time string and a $timezone which is a timezone to convert to.&lt;/p&gt;&#xA;&lt;p&gt;A usage example would be:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;echo dateTimeConversion(&amp;#34;2012-05-01 17:09:58&amp;#34;);&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Convert seconds to days, hours, minutes, seconds in PHP</title>
      <link>https://andrewodendaal.com/convert-seconds-to-days-hours-minutes-seconds-in-php/</link>
      <pubDate>Tue, 01 May 2012 12:54:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/convert-seconds-to-days-hours-minutes-seconds-in-php/</guid>
      <description>&lt;p&gt;With the following function you can easily convert an integer containing seconds to a nice days, hours, minutes, seconds string or array.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function secondsToTime($seconds, $return_type=&amp;#34;string&amp;#34;) {&#xA;// extract days&#xA;$days = floor($seconds / 3600 / 24);&#xA;&#xA;// extract hours&#xA;$hours = floor($seconds / 3600) - $days*24;&#xA;&#xA;// extract minutes&#xA;$divisor_for_minutes = $seconds % 3600;&#xA;$minutes = floor($divisor_for_minutes / 60);&#xA;&#xA;// extract the remaining seconds&#xA;$divisor_for_seconds = $divisor_for_minutes % 60;&#xA;$seconds = ceil($divisor_for_seconds);&#xA;&#xA;// return the final array&#xA;$obj = array(&#xA;&amp;#34;d&amp;#34; =&amp;gt; (int) $days,&#xA;&amp;#34;h&amp;#34; =&amp;gt; (int) $hours,&#xA;&amp;#34;m&amp;#34; =&amp;gt; (int) $minutes,&#xA;&amp;#34;s&amp;#34; =&amp;gt; (int) $seconds&#xA;);&#xA;&#xA;$str = &amp;#34;&amp;#34;;&#xA;if ($obj[&amp;#34;d&amp;#34;]!=0) $str .= $obj[&amp;#34;d&amp;#34;].&amp;#34;d &amp;#34;;&#xA;$str .= $obj[&amp;#34;h&amp;#34;].&amp;#34;h &amp;#34;;&#xA;$str .= $obj[&amp;#34;m&amp;#34;].&amp;#34;m &amp;#34;;&#xA;&#xA;if ($return_type==&amp;#34;string&amp;#34;) return $obj[&amp;#34;d&amp;#34;].&amp;#34; days, &amp;#34;.$obj[&amp;#34;m&amp;#34;].&amp;#34; minutes, &amp;#34;.$obj[&amp;#34;h&amp;#34;].&amp;#34; hours, &amp;#34;.$obj[&amp;#34;s&amp;#34;].&amp;#34; seconds&amp;#34;;&#xA;else return $obj;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To use the above function you can either use the default return type and call it like so:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Remove dotted outline around anchors</title>
      <link>https://andrewodendaal.com/remove-dotted-outline-around-anchors/</link>
      <pubDate>Mon, 30 Apr 2012 08:16:41 +0000</pubDate>
      <guid>https://andrewodendaal.com/remove-dotted-outline-around-anchors/</guid>
      <description>&lt;p&gt;This has become quite a common question asked by many website owners.&lt;/p&gt;&#xA;&lt;p&gt;&amp;ldquo;How do I remove that dotted outline around an anchor?&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;Lucky for you all, it&amp;rsquo;s a really easy one to resolve as well. You just have to take a look at CSS for a second and add one line as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;a { outline:0; }&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will disable the outlines around clicked links all around your site.&lt;/p&gt;&#xA;&lt;p&gt;Now that you know how to do it you may want to read about why you shouldn&amp;rsquo;t do this!&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;Click here to read the petition to not do this&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Get amount of hours between 2 hours</title>
      <link>https://andrewodendaal.com/get-amount-of-hours-between-2-hours/</link>
      <pubDate>Fri, 27 Apr 2012 14:02:21 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-amount-of-hours-between-2-hours/</guid>
      <description>&lt;p&gt;If you would like to get the amount of hours between 10:00 and 12:00 then use this!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function timeDiff($firstTime,$lastTime) {&#xA;  $firstTime=strtotime($firstTime);&#xA;  $lastTime=strtotime($lastTime);&#xA;  $timeDiff=$lastTime-$firstTime;&#xA;  return $timeDiff;&#xA;}&#xA;&#xA;echo (timeDiff(&amp;#34;10:00&amp;#34;,&amp;#34;12:00&amp;#34;)/60)/60;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to embed HTML5 video with fallback</title>
      <link>https://andrewodendaal.com/how-to-embed-html5-video-with-fallback/</link>
      <pubDate>Fri, 27 Apr 2012 10:33:28 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-embed-html5-video-with-fallback/</guid>
      <description>&lt;p&gt;A common question with the rise of HTML5 becoming more and more common and the whole iGeneration (iPhones/iPads/iEtc) is &amp;ldquo;&lt;!-- raw HTML omitted --&gt;how can I embed a video on my site without using a flash player?&lt;!-- raw HTML omitted --&gt;&amp;rdquo;. If you&amp;rsquo;re working with HTML, you might also be interested in &lt;a href=&#34;https://andrewodendaal.com/how-to-correctly-form-html&#34;&gt;how to correctly form HTML&lt;/a&gt; and &lt;a href=&#34;https://andrewodendaal.com/place-html-div-on-top-of-flash&#34;&gt;how to place HTML div on top of Flash&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;An option that really does work quite well is to use the JWPlayer and set it up to use HTML5.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to backup all mysql databases</title>
      <link>https://andrewodendaal.com/how-to-backup-all-mysql-databases/</link>
      <pubDate>Thu, 26 Apr 2012 11:08:59 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-backup-all-mysql-databases/</guid>
      <description>&lt;p&gt;In order to backup all mysql databases, you can run the following command in your linux command line:&lt;/p&gt;&#xA;&lt;p&gt;The example below is configured with username &amp;ldquo;theuser&amp;rdquo; and password &amp;ldquo;thepass&amp;rdquo;.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;mysqldump -utheuser -pthepass ?all-databases &amp;gt; all_dbs.sql&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Invalid command &#39;RewriteEngine&#39;</title>
      <link>https://andrewodendaal.com/invalid-command-rewriteengine/</link>
      <pubDate>Thu, 26 Apr 2012 11:06:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/invalid-command-rewriteengine/</guid>
      <description>&lt;p&gt;If you receive the following error message if means that mod_rewrite is not enabled in Apache:&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Invalid command ‘RewriteEngine&amp;rsquo;, perhaps misspelled or defined by a module not included in the server configuration.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;a2enmod rewrite&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Bear in mind this is done like this on Linux Ubuntu, not entirely sure if this works for other flavours too.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get the Hours Difference (in HH:MM format) in PHP</title>
      <link>https://andrewodendaal.com/how-to-get-the-hours-difference-in-hhmm-format-in-php/</link>
      <pubDate>Thu, 12 Apr 2012 12:08:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-the-hours-difference-in-hhmm-format-in-php/</guid>
      <description>&lt;p&gt;It&amp;rsquo;s very simple to get the difference in hours using PHP&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function timeDiff($firstTime,$lastTime) {&#xA;    $firstTime=strtotime($firstTime);&#xA;    $lastTime=strtotime($lastTime);&#xA;    $timeDiff=$lastTime-$firstTime;&#xA;    return $timeDiff;&#xA;}&#xA;&#xA;echo (timeDiff(&amp;#34;10:00&amp;#34;,&amp;#34;12:00&amp;#34;)/60)/60;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Warning: Invalid argument supplied for foreach()</title>
      <link>https://andrewodendaal.com/warning-invalid-argument-supplied-for-foreach/</link>
      <pubDate>Tue, 28 Feb 2012 11:04:22 +0000</pubDate>
      <guid>https://andrewodendaal.com/warning-invalid-argument-supplied-for-foreach/</guid>
      <description>&lt;p&gt;A common error which occurs with foreach loops is the standard &amp;ldquo;Invalid argument supplied for foreach()&amp;rdquo; whch gets thrown up as a warning.&lt;/p&gt;&#xA;&lt;p&gt;This can easily be overcome by wrapping the foreach loop in a conditional if statement which checks to see if the argument supplied to the loop is an array or not.&lt;/p&gt;&#xA;&lt;p&gt;Below is an example of how to correct the problem:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;if (in_array($arrItem)) {&#xA;  foreach($arrItem as $arrItemi) {&#xA;    // use $arrItemi;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Unable to connect to any of the specified MySQL hosts.</title>
      <link>https://andrewodendaal.com/unable-to-connect-to-any-of-the-specified-mysql-hosts/</link>
      <pubDate>Sun, 19 Feb 2012 14:59:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/unable-to-connect-to-any-of-the-specified-mysql-hosts/</guid>
      <description>&lt;p&gt;If you get the following error while trying to connect to a MySQL database using a third party client such as &lt;!-- raw HTML omitted --&gt;TOAD&lt;!-- raw HTML omitted --&gt; or &lt;!-- raw HTML omitted --&gt;SQL Workbench&lt;!-- raw HTML omitted --&gt;, then you need to edit your mysql server&amp;rsquo;s my.cnf file.&lt;/p&gt;&#xA;&lt;p&gt;Error Message: &lt;!-- raw HTML omitted --&gt;Unable to connect to any of the specified MySQL hosts.&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>PHP nl2br on one line</title>
      <link>https://andrewodendaal.com/php-nl2br-on-one-line/</link>
      <pubDate>Sat, 18 Feb 2012 15:35:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/php-nl2br-on-one-line/</guid>
      <description>&lt;p&gt;I usually store data from a textarea directly to the database as is, then once I retrieve it back into HTML I use that lovely PHP function nl2br() to convert it to HTML&lt;br&gt;&#xA;tags.&lt;/p&gt;&#xA;&lt;p&gt;This works well for most cases until you are passing this data back into javascript where everything has to be on one line!&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;nl2br()&lt;/code&gt; outputs as follows:&lt;/p&gt;&#xA;&lt;p&gt;Line one&lt;br&gt;&#xA;Line two&lt;/p&gt;&#xA;&lt;p&gt;And I want it to be as follows:&lt;/p&gt;</description>
    </item>
    <item>
      <title>LEN in MySQL</title>
      <link>https://andrewodendaal.com/len-in-mysql/</link>
      <pubDate>Wed, 01 Feb 2012 12:10:18 +0000</pubDate>
      <guid>https://andrewodendaal.com/len-in-mysql/</guid>
      <description>&lt;p&gt;In MySQL 5.1 LEN is called LENGTH, you use it exactly the same and pass in the link, so: LENGTH(link).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Remove all linebreaks in PHP</title>
      <link>https://andrewodendaal.com/remove-all-linebreaks-in-php/</link>
      <pubDate>Mon, 30 Jan 2012 09:22:57 +0000</pubDate>
      <guid>https://andrewodendaal.com/remove-all-linebreaks-in-php/</guid>
      <description>&lt;p&gt;If you are having problems with a string that keeps adding a line break when output from PHP to HTML then the following code will work wonders for you!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$string_with_line_break = &amp;#34;blabla\nbla\r&amp;#34;;&#xA;$string_without_line_break = trim(preg_replace( &amp;#34;/\s+/&amp;#34;,&amp;#34;&amp;#34;,$string_with_line_break));&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>IE9 adding empty table cells in large table</title>
      <link>https://andrewodendaal.com/ie9-adding-empty-table-cells-in-large-table/</link>
      <pubDate>Tue, 24 Jan 2012 11:37:14 +0000</pubDate>
      <guid>https://andrewodendaal.com/ie9-adding-empty-table-cells-in-large-table/</guid>
      <description>&lt;p&gt;Well as usual, we are once again fighting the woes of the beloved Internet Explorer, and it appears that Microsoft&amp;rsquo;s latest greatest new and improved browser rival to the market IE9 still has a whole bunch of irritations and retardation to worry about (saw that one coming).&lt;/p&gt;&#xA;&lt;p&gt;Today I was busy loading a massive amount of data into the body of a table using ajax and in Firefox and even Internet Explorer 8 it worked quite well, but Internet Explorer 9 decided that it would like to add some empty table cells randomly around my &amp;ldquo;massive table&amp;rdquo;, now of course I began by kicking something and cried a few times….. but then I thought about whitespacing and the usual problems I had found with it before while using &amp;ldquo;the best browser ever known to human-kind&amp;rdquo;(…not) and I thought of removing the whitespaces between the &lt;!-- raw HTML omitted --&gt;&amp;rsquo;s and &lt;!-- raw HTML omitted --&gt;&amp;rsquo;s.&lt;/p&gt;</description>
    </item>
    <item>
      <title>SELECT Duplicate Items Using SQL</title>
      <link>https://andrewodendaal.com/select-duplicate-items-using-sql/</link>
      <pubDate>Tue, 20 Dec 2011 15:52:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/select-duplicate-items-using-sql/</guid>
      <description>&lt;p&gt;If you have a table which has duplicate items in then you can use the below statement to select them.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SELECT * FROM tableName&#xA;GROUP BY columnName&#xA;HAVING ( COUNT( columnName) &amp;gt;1 )&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>MySQL Error: Can’t get hostname for your address</title>
      <link>https://andrewodendaal.com/mysql-error-cant-get-hostname-for-your-address/</link>
      <pubDate>Wed, 14 Dec 2011 15:15:41 +0000</pubDate>
      <guid>https://andrewodendaal.com/mysql-error-cant-get-hostname-for-your-address/</guid>
      <description>&lt;p&gt;This error is thrown by MySQL because it tries to do a DNS lookup on the address connecting to the server and it fails due to the IP not being able to be resolved back to a name or some-other deeper DNS bust problem.&lt;/p&gt;&#xA;&lt;p&gt;The easiest way to fix this is to edit your my.ini or my.cnf (/etc/my.cnf) and in the&lt;br&gt;&#xA;[mysqld] section add the &amp;ldquo;skip-name-resolve&amp;rdquo; option.&lt;/p&gt;&#xA;&lt;p&gt;Near the top of the file this will look similar to the below:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Adobe drops flash for mobiles!</title>
      <link>https://andrewodendaal.com/adobe-drops-flash-for-mobiles/</link>
      <pubDate>Wed, 09 Nov 2011 17:54:54 +0000</pubDate>
      <guid>https://andrewodendaal.com/adobe-drops-flash-for-mobiles/</guid>
      <description>&lt;p&gt;..and it&amp;rsquo;s official – so says Adobe&amp;rsquo;s blog (&lt;!-- raw HTML omitted --&gt;read it here&lt;!-- raw HTML omitted --&gt;). Adobe will be dropping support for Flash on future devices due to performance and a few other things, pushing the future more towards the HTML5 route, which isn&amp;rsquo;t neccessarily a bad thing, I just find it quite ironic and somewhat comical that they waited for Steve Jobs (Apple) to die before giving up their long time fight with Apple about Flash being or not being supported on mobile devices, namely the iPhone.&lt;/p&gt;</description>
    </item>
    <item>
      <title>jQuery Colorbox not showing but background shows</title>
      <link>https://andrewodendaal.com/jquery-colorbox-not-showing-but-background-shows/</link>
      <pubDate>Tue, 08 Nov 2011 11:30:06 +0000</pubDate>
      <guid>https://andrewodendaal.com/jquery-colorbox-not-showing-but-background-shows/</guid>
      <description>&lt;p&gt;I was using &lt;!-- raw HTML omitted --&gt;Colorbox&lt;!-- raw HTML omitted --&gt; for some lightbox type effects to show larger images when clicking on thumbnails, but for some reason the background was showing up but the pretty little box in the middle where the larger image is supposed to show never showed up, so this is how I made it finally appear after many failed attempts!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$(&amp;#34;document&amp;#34;).ready(function(){&#xA;$(&amp;#34;.theCssClass a[rel=&amp;#39;forGroupingRelCodeGoesHere&amp;#39;]&amp;#34;).colorbox({ onLoad: function () { $(&amp;#34;#colorbox&amp;#34;).show(); } });&#xA;});&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;So the &amp;ldquo;real&amp;rdquo; code that fixed it was the:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Get Value of Checkbox using jQuery</title>
      <link>https://andrewodendaal.com/get-value-of-checkbox-using-jquery/</link>
      <pubDate>Tue, 25 Oct 2011 08:49:11 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-value-of-checkbox-using-jquery/</guid>
      <description>&lt;p&gt;This one is quite an easy one, but a good one to mention non-the-less as it does definitely come in really handy.&lt;/p&gt;&#xA;&lt;p&gt;If you would like to get a checkbox&amp;rsquo;s value to send to the backend using jQuery you can always do the following:&lt;/p&gt;&#xA;&lt;p&gt;Firstly let&amp;rsquo;s draw some HTML to illustrate our example.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;input id=&amp;#34;chkOurCheckbox&amp;#34; type=&amp;#34;checkbox&amp;#34; /&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now we need some jQuery to do the real work.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var ourCheckboxValue = ($(&amp;#34;#chkOurCheckbox:checked&amp;#34;).val()==&amp;#34;undefined&amp;#34;) ? 0 : 1&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In our above example we draw an HTML checkbox to the screen and then use jQuery to return the value of it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Everybody’s a web host</title>
      <link>https://andrewodendaal.com/everybodys-a-web-host/</link>
      <pubDate>Wed, 28 Sep 2011 09:39:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/everybodys-a-web-host/</guid>
      <description>&lt;p&gt;To cut straight to the point, &amp;ldquo;we&amp;rsquo;re living in the age where everybody&amp;rsquo;s a web host&amp;rdquo;. Whether it be small and quite pathetic or just another reseller of a larger service trying to get their cut of things, everybody truly is spamming the world with more and more web hosting packages.&lt;/p&gt;&#xA;&lt;p&gt;Just a few short years ago this problem didn&amp;rsquo;t exist and getting web hosting was quite expensive, unless you went with free services such as the good ol&amp;rsquo; &amp;ldquo;geocities&amp;rdquo; and co, but then larger companies started up their shared hosting and reseller hosting packages which immediately led to everybody thinking all it took to become a web host was to get themselves a reseller account and start trading. For the most part that isn&amp;rsquo;t so far off, as 95% of the websites out there sit mostly idle while almost nobody visits them and therefore it&amp;rsquo;s perfectly fine to share a single machine between multiple clients and call it &amp;ldquo;excellent web hosting&amp;rdquo;, but these small guys also try and compete with the larger players in the industry and end up creating quite a mess of things, all while flooding search engines and web development and hosting forums with &amp;ldquo;hosting deals and specials&amp;rdquo;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>CSS Background Default</title>
      <link>https://andrewodendaal.com/css-background-default/</link>
      <pubDate>Thu, 15 Sep 2011 17:10:46 +0000</pubDate>
      <guid>https://andrewodendaal.com/css-background-default/</guid>
      <description>&lt;p&gt;If you would like to override an already attached class containing a background then you can use the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;background:transparent none 0 repeat !important;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Restrict PHPMyAdmin to IP Address</title>
      <link>https://andrewodendaal.com/restrict-phpmyadmin-to-ip-address/</link>
      <pubDate>Mon, 22 Aug 2011 18:27:21 +0000</pubDate>
      <guid>https://andrewodendaal.com/restrict-phpmyadmin-to-ip-address/</guid>
      <description>&lt;p&gt;Would you like to restrict PHPMyAdmin from being accessible to the whole world?&lt;/p&gt;&#xA;&lt;p&gt;Firstly you need to SSH into your box if you are not on the local machine where PHPMyAdmin is installed along with Apache.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;cd /etc/phpmyadmin/&#xA;vi apache.conf&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You will need to look for the following text &amp;ldquo;&amp;lt;Directory /usr/share/phpmyadmin&amp;gt;&amp;rdquo; and add in the below code:&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Remember that you need to press &amp;ldquo;i&amp;rdquo; in order to start editting text if using VI.&lt;/em&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>2014 – Commands out of sync; you can’t run this command now</title>
      <link>https://andrewodendaal.com/2014-commands-out-of-sync-you-cant-run-this-command-now/</link>
      <pubDate>Thu, 04 Aug 2011 14:06:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/2014-commands-out-of-sync-you-cant-run-this-command-now/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;#2014 – Commands out of sync; you can&amp;rsquo;t run this command now&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Now that can be a really annoying error!&lt;/p&gt;&#xA;&lt;p&gt;It happens when querying stored procedures in phpMyAdmin as mysqli seems to return 2 sets of results opposed to the usual 1 that mysql returns.&lt;/p&gt;&#xA;&lt;p&gt;You cannot call anything else until you have &amp;ldquo;flushed&amp;rdquo; or &amp;ldquo;cleared&amp;rdquo; the second result.&lt;/p&gt;&#xA;&lt;p&gt;You can try using COMMIT to resolve this.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Image corrupt or truncated: “unknown”</title>
      <link>https://andrewodendaal.com/image-corrupt-or-truncated-unknow/</link>
      <pubDate>Wed, 13 Jul 2011 15:09:27 +0000</pubDate>
      <guid>https://andrewodendaal.com/image-corrupt-or-truncated-unknow/</guid>
      <description>&lt;p&gt;What is &amp;ldquo;&lt;!-- raw HTML omitted --&gt;Image corrupt or truncated: &lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&amp;rdquo; and what does it mean?&lt;/p&gt;&#xA;&lt;p&gt;This can often be seen while using Firebug in Firefox, but it actually has nothing to do with either and is just the error being reprinted in in firebug in most cases.&lt;/p&gt;&#xA;&lt;p&gt;It comes from an image that has had it&amp;rsquo;s extension changed from say .gif to .png or .png to .ico. Eventhough .png and .ico file types are very similar, they are not the same, so an error occurs.&lt;/p&gt;</description>
    </item>
    <item>
      <title>WordPress wp-admin use different language for user</title>
      <link>https://andrewodendaal.com/wordpress-wp-admin-use-different-language-for-user/</link>
      <pubDate>Thu, 07 Jul 2011 11:59:55 +0000</pubDate>
      <guid>https://andrewodendaal.com/wordpress-wp-admin-use-different-language-for-user/</guid>
      <description>&lt;p&gt;I needed to do some work on a WordPress site a little while ago and all the admins were French – and I cannot speak French other than the popular swear words – so had no idea what was going on in the /wp-admin/ so needed some way of enabling my newly created user account to be in english while letting everybody else use french as they had been up til that point.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Replace all spaces in HTML with   except in HTML tags using PHP</title>
      <link>https://andrewodendaal.com/replace-all-spaces-in-html-with-except-in-html-tags-using-php/</link>
      <pubDate>Sun, 29 May 2011 17:56:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/replace-all-spaces-in-html-with-except-in-html-tags-using-php/</guid>
      <description>&lt;p&gt;If you would like to replace all the spaces in an HTML string with   so that you can render it out to the browser but you also want to retain current spaces in HTML tags you can use the below method:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$inputString = &amp;#39;&amp;lt;span class=&amp;#34;color:red&amp;#34;&amp;gt;1&amp;lt;/span&amp;gt; 2 3&amp;#39;;&#xA;$outputString = preg_replace_callback(&amp;#34;#&amp;gt;[^&amp;lt;]+&amp;lt;#&amp;#34;,&amp;#34;relSpaces&amp;#34;,$inputString);&#xA;&#xA;function relSpaces($match){return str_replace(&amp;#34; &amp;#34;,&amp;#34;&amp;#39;&amp;#34;,$match[0]);}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;This will replace:&lt;!-- raw HTML omitted --&gt;&lt;br&gt;&#xA;&lt;code&gt;&amp;lt;span&amp;gt;1&amp;lt;/span&amp;gt; 2&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; 3&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;..to look like this:&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using PHP to validate an IP address</title>
      <link>https://andrewodendaal.com/using-php-to-validate-an-ip-address/</link>
      <pubDate>Wed, 18 May 2011 09:47:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/using-php-to-validate-an-ip-address/</guid>
      <description>&lt;p&gt;You can use the PHP code below to check if an IP address is valid or not.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ip = &amp;#34;&amp;#34;; //enter a valid or invalid ip address here&#xA;if(filter_var($ip, FILTER_VALIDATE_IP)) {&#xA;  // The IP Address is valid&#xA;} else {&#xA;  // The IP Address is not valid&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Wasn&amp;rsquo;t that easy!?!&lt;/p&gt;</description>
    </item>
    <item>
      <title>What is the difference between is_home() and is_front_page()</title>
      <link>https://andrewodendaal.com/what-is-the-difference-between-is_home-and-is_front_page/</link>
      <pubDate>Fri, 13 May 2011 19:47:49 +0000</pubDate>
      <guid>https://andrewodendaal.com/what-is-the-difference-between-is_home-and-is_front_page/</guid>
      <description>&lt;p&gt;Call me ignorant, or call me an ignorant geek, but I used to think is_home() and is_front_page() was the same thing, until I experimented with them the other day and noticed they did quite different things. Let me break them down:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;is_home()&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;This actually is the page where all your recent posts are shown. Which means if your &amp;ldquo;home&amp;rdquo; page is set to &amp;ldquo;static&amp;rdquo; then it will be false, otherwise it will be true.&lt;/p&gt;</description>
    </item>
    <item>
      <title>..near &#39;option o ON (po.option_id = o.option_id) LEFT JOIN option_description od ON (o.o&#39; at line 1</title>
      <link>https://andrewodendaal.com/near-option-o-on-po-option_id-o-option_id-left-join-option_description-od-on-o-o-at-line-1/</link>
      <pubDate>Mon, 09 May 2011 15:59:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/near-option-o-on-po-option_id-o-option_id-left-join-option_description-od-on-o-o-at-line-1/</guid>
      <description>&lt;p&gt;So you&amp;rsquo;ve just installed Opencart 1.5.0 and when attempting to edit a product or category or etc you get the following error:&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘option o ON (po.option_id = o.option_id) LEFT JOIN option_description od ON (o.o&amp;rsquo; at line 1&lt;!-- raw HTML omitted --&gt;&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;Error No: 1064&lt;!-- raw HTML omitted --&gt;&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;SELECT * FROM product_option po LEFT JOIN option o ON (po.option_id = o.option_id) LEFT JOIN option_description od ON (o.option_id = od.option_id) WHERE po.product_id = &amp;lsquo;42&amp;rsquo; AND od.language_id = ‘1&amp;rsquo;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>What is 1e100.net?</title>
      <link>https://andrewodendaal.com/what-is-1e100-net/</link>
      <pubDate>Thu, 05 May 2011 14:33:20 +0000</pubDate>
      <guid>https://andrewodendaal.com/what-is-1e100-net/</guid>
      <description>&lt;p&gt;So you are probably reading this because you are not sure what 1e100.net is or why you are being redirected via it when performing Google searches or using products such as youtube etc.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Perform a SiteWhois lookup&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;1e100.net is owned by Google and has been in use since October 2009, if you perform a whois on the domain you can see it&amp;rsquo;s registration details linked back to Google.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Perform an SiteInfo lookup&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Hide all error messages PHP</title>
      <link>https://andrewodendaal.com/hide-all-error-messages-php/</link>
      <pubDate>Thu, 28 Apr 2011 10:03:20 +0000</pubDate>
      <guid>https://andrewodendaal.com/hide-all-error-messages-php/</guid>
      <description>&lt;p&gt;PHP Error messages showing up in your web applications are a dangerous thing. Not only does it look unprofessional, but it is also a serious security concern!&lt;/p&gt;&#xA;&lt;p&gt;Once you have completed debugging your website or web application you can place the following one liner at the beginning of your code, this will turn off error reporting and therefore make sure that no application details are spilled to your users.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;error_reporting(0);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If a single line of code is causing the problems it is safer to use the at symbol (@) to suppress any errors it may cause.&lt;br&gt;&#xA;You can also use &amp;ldquo;or die()&amp;rdquo; to stop the execution of your code after the suppressed error in case the remainder of your code relies on that function to return a value.&lt;br&gt;&#xA;In the example below we will use the &amp;ldquo;@&amp;rdquo; and &amp;ldquo;or die&amp;rdquo; to handle everything:&lt;/p&gt;</description>
    </item>
    <item>
      <title>What is xmlrpc.php?</title>
      <link>https://andrewodendaal.com/what-is-xmlrpc-php/</link>
      <pubDate>Tue, 22 Feb 2011 12:02:59 +0000</pubDate>
      <guid>https://andrewodendaal.com/what-is-xmlrpc-php/</guid>
      <description>&lt;p&gt;It is a script which allows clients to make procedural calls over the net.&lt;br&gt;&#xA;As it says in the name, the encoding is XML and because it is used on websites we can make the fair assessment that it uses the HTTP protocol.&lt;/p&gt;&#xA;&lt;p&gt;If we break the name down we get: XML transmition via Remote Procedure Calls.&lt;/p&gt;&#xA;&lt;p&gt;So you are still not sure what this is all about? Read on..&lt;/p&gt;</description>
    </item>
    <item>
      <title>Windows Genuine Advantage Notifications in a VM</title>
      <link>https://andrewodendaal.com/windows-genuine-advantage-notifications-in-a-vm/</link>
      <pubDate>Fri, 11 Feb 2011 14:14:51 +0000</pubDate>
      <guid>https://andrewodendaal.com/windows-genuine-advantage-notifications-in-a-vm/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2011/02/hgflhj76i6ttt.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Windows Genuine Advantage Notifications&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;I am running a Windows XP SP3 VM used for testing multiple versions of InternetExplorer through Virtualbox.&lt;/p&gt;&#xA;&lt;p&gt;Running this wizard should be avoided if Windows is in a VirtualMachine.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Force HTTP using htaccess</title>
      <link>https://andrewodendaal.com/force-http-using-htaccess/</link>
      <pubDate>Sat, 04 Dec 2010 23:23:33 +0000</pubDate>
      <guid>https://andrewodendaal.com/force-http-using-htaccess/</guid>
      <description>&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;RewriteEngine On&#xA;RewriteCond %{SERVER_PORT} 80&#xA;RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Stop That Referrer in PHP!</title>
      <link>https://andrewodendaal.com/stop-that-referrer-in-php/</link>
      <pubDate>Mon, 01 Nov 2010 13:34:50 +0000</pubDate>
      <guid>https://andrewodendaal.com/stop-that-referrer-in-php/</guid>
      <description>&lt;p&gt;Today I will show you a method to stop the traffic that a referrer site is sending your way, you may wonder why you would want to ignore traffic, after all, isn&amp;rsquo;t inbound traffic to your site fantastic no matter what?&lt;/p&gt;&#xA;&lt;p&gt;The simple answer is &amp;ldquo;NO!&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;Let me explain it in a real life situation so that you can better understand where to use this.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Understanding where to use it&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Viva la 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0!</title>
      <link>https://andrewodendaal.com/viva-la-09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0/</link>
      <pubDate>Tue, 26 Oct 2010 09:49:38 +0000</pubDate>
      <guid>https://andrewodendaal.com/viva-la-09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0/</guid>
      <description>&lt;p&gt;You may see this around and not have a clue what the heck it is, weirdly enough, I did..&lt;br&gt;&#xA;Why &amp;ldquo;weirdly&amp;rdquo; you ask, well, because, who would be looking for something like &amp;ldquo;09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0&amp;rdquo;.&lt;br&gt;&#xA;Let me elaborate..&lt;/p&gt;&#xA;&lt;p&gt;The Urban Dictionary says it like this:&lt;br&gt;&#xA;&amp;ldquo;An alphanumeric string denoting a hack and insecurites in the HD-DVD coding.&amp;rdquo;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ternary Operation</title>
      <link>https://andrewodendaal.com/ternary-operation/</link>
      <pubDate>Tue, 12 Oct 2010 11:46:56 +0000</pubDate>
      <guid>https://andrewodendaal.com/ternary-operation/</guid>
      <description>&lt;p&gt;If you do not know what the Ternary operator is, or do not use it while you are coding, let me be the first to tell you how much you are missing out!&lt;/p&gt;&#xA;&lt;p&gt;The Ternary operator looks like this: &amp;ldquo;&lt;!-- raw HTML omitted --&gt;?&lt;!-- raw HTML omitted --&gt;&amp;rdquo;, that&amp;rsquo;s right, it&amp;rsquo;s a question mark!&lt;/p&gt;&#xA;&lt;p&gt;My favourite way of using it is to shorten Conditional If Statements, so let me show you what I&amp;rsquo;m on about.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Oops the system encountered a problem (#104)</title>
      <link>https://andrewodendaal.com/oops-the-system-encountered-a-problem-104/</link>
      <pubDate>Mon, 11 Oct 2010 19:10:22 +0000</pubDate>
      <guid>https://andrewodendaal.com/oops-the-system-encountered-a-problem-104/</guid>
      <description>&lt;p&gt;If you get the following error while using Google&amp;rsquo;s Gmail Service (&lt;!-- raw HTML omitted --&gt;gmail.com&lt;!-- raw HTML omitted --&gt;):&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Oops? the system encountered a problem (#104)&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;..then you should try deleting your browser&amp;rsquo;s cache and everything will be resolved.&lt;/p&gt;&#xA;&lt;p&gt;This appears to be a local problem and not on the Google servers as data is pushed via cookies to the local machine using the web service.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Write Unmaintainable Code</title>
      <link>https://andrewodendaal.com/how-to-write-unmaintainable-code/</link>
      <pubDate>Wed, 22 Sep 2010 14:56:09 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-write-unmaintainable-code/</guid>
      <description>&lt;p&gt;I have come across the following article before and again came across it today, after a revised browse through, I thought I may as well add another link to it on the web for whoever ends up clicking on it!&lt;/p&gt;&#xA;&lt;p&gt;It really is a worthwhile (in a humor sort of way) read:&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://www.freevbcode.com/ShowCode.Asp?ID=2547&#34;&gt;http://www.freevbcode.com/ShowCode.Asp?ID=2547&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Captcha Fail!</title>
      <link>https://andrewodendaal.com/captcha-fail/</link>
      <pubDate>Thu, 16 Sep 2010 15:34:56 +0000</pubDate>
      <guid>https://andrewodendaal.com/captcha-fail/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2010/09/captrehs.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Hey, thought I&amp;rsquo;d just post this one incase anybody else sees it and thinks it&amp;rsquo;s funny.&lt;/p&gt;&#xA;&lt;p&gt;This is not really a very helpful post like most of the others on this site, but HEY! TOUGH!&lt;/p&gt;&#xA;&lt;p&gt;So feel free to smile if you like..&lt;/p&gt;&#xA;&lt;p&gt;What do you know, a snippet of helpful-ness is about to appear-&amp;gt; This issue is usually caused by an invalid referrer! HA!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Test IE versions on any machine!</title>
      <link>https://andrewodendaal.com/test-ie-versions-on-any-machine/</link>
      <pubDate>Thu, 16 Sep 2010 11:20:21 +0000</pubDate>
      <guid>https://andrewodendaal.com/test-ie-versions-on-any-machine/</guid>
      <description>&lt;p&gt;Do you do web development and are unable to test your software in old shitty versions of &lt;!-- raw HTML omitted --&gt;Internet Explorer&lt;!-- raw HTML omitted --&gt;?&lt;br&gt;&#xA;If so then you may want to read on a little bit.&lt;/p&gt;&#xA;&lt;p&gt;Microsoft has got a whole bunch of virtual images you can download for FREE(not a usual Microsoft word) over here:&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://www.microsoft.com/downloads/en/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&amp;amp;displaylang=en&#34;&gt;http://www.microsoft.com/downloads/en/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&amp;amp;displaylang=en&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;They contain an operating system and an install of your favourite IE version! Hooray!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Error 500 php_value .htaccess</title>
      <link>https://andrewodendaal.com/error-500-php_value-htaccess/</link>
      <pubDate>Tue, 14 Sep 2010 13:00:23 +0000</pubDate>
      <guid>https://andrewodendaal.com/error-500-php_value-htaccess/</guid>
      <description>&lt;p&gt;I noticed on some server setups I could not do the following inside a .htacess file:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;br&amp;gt; php_value upload_max_filesize 250M&amp;lt;br&amp;gt; php_value post_max_size 250M&amp;lt;br&amp;gt; &lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;I was getting an error 500 Internal Server Error with the above code in the .htaccess file.&lt;/p&gt;&#xA;&lt;p&gt;What to do to correct this is create a file called php.ini and save it in the same location as your .htaccess file and enter the following code instead:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;br&amp;gt; upload_max_filesize = &amp;quot;250M&amp;quot;&amp;lt;br&amp;gt; post_max_size = &amp;quot;250M&amp;quot;&amp;lt;br&amp;gt; &lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Windows Directory Tree Never Finishes Loading?</title>
      <link>https://andrewodendaal.com/windows-directory-tree-never-finishes-loading/</link>
      <pubDate>Tue, 14 Sep 2010 11:06:03 +0000</pubDate>
      <guid>https://andrewodendaal.com/windows-directory-tree-never-finishes-loading/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2010/09/fldrtreprblm.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;I am running Windows 7 64-bit and since yesterday whenever I open &amp;ldquo;My Computer&amp;rdquo;/&amp;ldquo;Windows Explorer&amp;rdquo; (-Windows+E) the initial &amp;ldquo;showing drives&amp;rdquo; screen is frozen, so I have to use the address bar to navigate to the path I need to go.&lt;/p&gt;&#xA;&lt;p&gt;As you can see in the picture to the left even after you have gotten to and are viewing the folder you want, the directory tree in the sidebar continues to &amp;ldquo;check&amp;rdquo; for &amp;ldquo;who knows what&amp;rdquo;!&lt;/p&gt;</description>
    </item>
    <item>
      <title>CSS background image data: base64?</title>
      <link>https://andrewodendaal.com/css-background-image-data-base64/</link>
      <pubDate>Thu, 09 Sep 2010 16:22:53 +0000</pubDate>
      <guid>https://andrewodendaal.com/css-background-image-data-base64/</guid>
      <description>&lt;p&gt;What the heck is all that &lt;!-- raw HTML omitted --&gt;Gobbledygook&lt;!-- raw HTML omitted --&gt; in the CSS?&lt;/p&gt;&#xA;&lt;p&gt;So you have noticed that bit of css that says something like this in the CSS source-code and you have no idea what it could be?&lt;br&gt;&#xA;&lt;em&gt;&lt;!-- raw HTML omitted --&gt;url(&amp;ldquo;data:image/gif;base64,R0lGODlfMAMEAIABAKysrObm5iH5BAEAAAEALAAAAAAwAwQAAAJOhI+py30Bo5y02ouz3rz7D4biSJbmiabqyrbuC8fyTKPOjedHzff+DwwKh8Si8YhMKku6pvOxjEqn1Kr1is1qt7ynV8cNi8fksvmMTiMLAD4=&amp;rdquo;) no-repeat scroll 50% 0 transparent&lt;!-- raw HTML omitted --&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;It is a technique called Data URLs and using PHP – or your favourite server-side script – you can generate these nifty little things.&lt;/p&gt;</description>
    </item>
    <item>
      <title>WordPress remove Subscribe to my RSS feed after posts</title>
      <link>https://andrewodendaal.com/wordpress-remove-subscribe-to-my-rss-feed-after-posts/</link>
      <pubDate>Wed, 08 Sep 2010 23:37:41 +0000</pubDate>
      <guid>https://andrewodendaal.com/wordpress-remove-subscribe-to-my-rss-feed-after-posts/</guid>
      <description>&lt;p&gt;If you are running WordPress and have noticed a line under all your posts that says:&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;!-- raw HTML omitted --&gt;If you enjoyed this post, make sure you subscribe to my RSS feed! &lt;!-- raw HTML omitted --&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;..and if this irritates you as much as it did me, you can remove it by deactivating a plugin called &lt;!-- raw HTML omitted --&gt;Subscribe Remind&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Done!&lt;/p&gt;&#xA;&lt;p&gt;P.S. Sorry Trevor, not trying to piss you off 😛&lt;/p&gt;</description>
    </item>
    <item>
      <title>And then there was Google Instant!</title>
      <link>https://andrewodendaal.com/and-then-there-was-google-instant/</link>
      <pubDate>Wed, 08 Sep 2010 23:00:14 +0000</pubDate>
      <guid>https://andrewodendaal.com/and-then-there-was-google-instant/</guid>
      <description>&lt;p&gt;If you have visited the Google.co.uk homepage (Yes, that&amp;rsquo;s Google UK) recently – since about the 8th of September 2010 then you would have noticed a new search feature Google is pushing called Google Instant.&lt;/p&gt;&#xA;&lt;p&gt;Now what is so nice about Google Instant?&lt;/p&gt;&#xA;&lt;p&gt;It is an ajax type search application that now searches using keyword ghosting and searches and returns results as you type to populate the normal search results page that has been used up until now.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Solved] PHP’s typeof – gettype()</title>
      <link>https://andrewodendaal.com/phps-typeof-gettype/</link>
      <pubDate>Mon, 06 Sep 2010 08:47:30 +0000</pubDate>
      <guid>https://andrewodendaal.com/phps-typeof-gettype/</guid>
      <description>&lt;p&gt;Quite often you may need the ability to check what type of data type a variable is.&lt;/p&gt;&#xA;&lt;p&gt;In most programming languages this is possible to do and is usually called something like &lt;strong&gt;typeof()&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;So what is &lt;strong&gt;typeof in php&lt;/strong&gt;, or &lt;strong&gt;typeof php&lt;/strong&gt; you ask? In PHP there is a simple function called &lt;strong&gt;gettype()&lt;/strong&gt; and it&amp;rsquo;s so easy to use.&lt;/p&gt;&#xA;&lt;p&gt;All you have to do is pass the variable in question to &lt;strong&gt;gettype()&lt;/strong&gt; as the first argument and the type will be returned.&lt;/p&gt;</description>
    </item>
    <item>
      <title>When to use SSL?</title>
      <link>https://andrewodendaal.com/when-to-use-ssl/</link>
      <pubDate>Fri, 03 Sep 2010 14:23:01 +0000</pubDate>
      <guid>https://andrewodendaal.com/when-to-use-ssl/</guid>
      <description>&lt;p&gt;There has always been quite a lot of heated discussion around the question of when to use SSL and when to avoid it while building websites.&lt;/p&gt;&#xA;&lt;p&gt;I have been asked this question a few times myself and finally thought that it would be good for everybody if I just wrote an article on it explaining what the big huff was all about.&lt;br&gt;&#xA;Obviously if anyone has anything to add or if you disagree with me for whatever reason, then feel free to do so below at the end of this article.&lt;/p&gt;</description>
    </item>
    <item>
      <title>IE6 PngFix in Javascript</title>
      <link>https://andrewodendaal.com/ie6-pngfix-in-javascript/</link>
      <pubDate>Thu, 02 Sep 2010 11:36:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/ie6-pngfix-in-javascript/</guid>
      <description>&lt;p&gt;As a web developer you will know just how much we all &lt;!-- raw HTML omitted --&gt;love&lt;!-- raw HTML omitted --&gt; hate &lt;!-- raw HTML omitted --&gt;Internet Explorer 6&lt;!-- raw HTML omitted --&gt; – one of the most dreaded browsers and browser versions that still exists in the deep dark corners of the interwebs – and you will probably have figured out that it doesn&amp;rsquo;t play well with PNG images.&lt;/p&gt;</description>
    </item>
    <item>
      <title>MSSQL Select Not Null</title>
      <link>https://andrewodendaal.com/mssql-select-not-null/</link>
      <pubDate>Thu, 02 Sep 2010 10:46:59 +0000</pubDate>
      <guid>https://andrewodendaal.com/mssql-select-not-null/</guid>
      <description>&lt;p&gt;I mainly use MySQL these days, so get screwed over for a few minutes when I have to do something in MSSQL that is slightly different when it comes to it&amp;rsquo;s custom syntax.&lt;/p&gt;&#xA;&lt;p&gt;If you want to show all entries in a specific column and where it is not Null then you can do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SELECT [columnNameHere]&#xA;FROM [databaseNameHere].[dbo].[databaseTableNameHere]&#xA;WHERE [columnNameHere] IS NOT NULL&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>What is __utma, __utmb, __utmc, __utmz ?</title>
      <link>https://andrewodendaal.com/what-is-__utma-__utmb-__utmc-__utmz/</link>
      <pubDate>Wed, 01 Sep 2010 17:29:58 +0000</pubDate>
      <guid>https://andrewodendaal.com/what-is-__utma-__utmb-__utmc-__utmz/</guid>
      <description>&lt;p&gt;__utm&lt;!-- raw HTML omitted --&gt;a&lt;!-- raw HTML omitted --&gt;, __utm&lt;!-- raw HTML omitted --&gt;b&lt;!-- raw HTML omitted --&gt;, __utm&lt;!-- raw HTML omitted --&gt;c&lt;!-- raw HTML omitted --&gt; and __utm&lt;!-- raw HTML omitted --&gt;z&lt;!-- raw HTML omitted --&gt; are 4 cookies created by &lt;!-- raw HTML omitted --&gt;Google Analytics&lt;!-- raw HTML omitted --&gt;, for a detailed and very informative read, go &lt;!-- raw HTML omitted --&gt;here&lt;!-- raw HTML omitted --&gt; and &lt;!-- raw HTML omitted --&gt;here&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Close Bandmix Account</title>
      <link>https://andrewodendaal.com/how-to-close-bandmix-account/</link>
      <pubDate>Tue, 31 Aug 2010 08:12:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-close-bandmix-account/</guid>
      <description>&lt;p&gt;If you want to close a Bandmix account, then:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Login to &lt;!-- raw HTML omitted --&gt;bandmix.co.uk&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;li&gt;Go to Options – &lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://www.bandmix.co.uk/account/options/&#34;&gt;http://www.bandmix.co.uk/account/options/&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;li&gt;Click &lt;!-- raw HTML omitted --&gt;Decline Service&lt;!-- raw HTML omitted --&gt;&lt;/li&gt;&#xA;&lt;li&gt;Then click the button called Decline Service at the bottom.&lt;/li&gt;&#xA;&lt;li&gt;Click &amp;ldquo;OK&amp;rdquo; to the verification popup.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Account closed!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Google Redirect Virus Fix!</title>
      <link>https://andrewodendaal.com/google-redirect-virus/</link>
      <pubDate>Fri, 27 Aug 2010 13:23:26 +0000</pubDate>
      <guid>https://andrewodendaal.com/google-redirect-virus/</guid>
      <description>&lt;p&gt;Now this is an annoying one.&lt;br&gt;&#xA;You go to any of google&amp;rsquo;s sites including any site that has &lt;!-- raw HTML omitted --&gt;google-analytics.com&lt;!-- raw HTML omitted --&gt; javascript included in it&amp;rsquo;s body and &lt;strong&gt;&lt;!-- raw HTML omitted --&gt;BOOM&lt;!-- raw HTML omitted --&gt;&lt;/strong&gt;! ..either you get redirected to a bullshit search page you didn&amp;rsquo;t ask to go to or the browser shows a blank white screen while apparently analytics loads..&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;It turns out this is actually a virus that infects routers!&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Chromium Operating System</title>
      <link>https://andrewodendaal.com/chromium-operating-system/</link>
      <pubDate>Mon, 23 Aug 2010 16:46:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/chromium-operating-system/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2012/04/chrgob.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;As many of you may know, &lt;!-- raw HTML omitted --&gt;Chromium&lt;!-- raw HTML omitted --&gt; is an opensource project that is basically an Operating System built on Linux and is just like working in &lt;!-- raw HTML omitted --&gt;Google&amp;rsquo;s Chrome web browser&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I decided to take a look at it today and went and downloaded the developer sneak release.&lt;/p&gt;&#xA;&lt;p&gt;It came all boxed up in a 764,994KB (764MB) VMDK Virtual Machine Harddisk file.&lt;br&gt;&#xA;When it finished downloading I was sadly quite excited as I love trying out new Operating Systems and goodies – being a geeky kind of guy like most guys out there – and after hardly any setup at all it started up.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Super Easy Email Validation AS2</title>
      <link>https://andrewodendaal.com/super-easy-email-validation-as2/</link>
      <pubDate>Fri, 20 Aug 2010 10:45:21 +0000</pubDate>
      <guid>https://andrewodendaal.com/super-easy-email-validation-as2/</guid>
      <description>&lt;p&gt;I needed a quick and easy way to check for the basics of an email address.&lt;/p&gt;&#xA;&lt;p&gt;Does it contain &amp;ldquo;@&amp;rdquo; and &amp;ldquo;.&amp;rdquo; symbols.&lt;/p&gt;&#xA;&lt;p&gt;This is by no meals a foolproof method, so don&amp;rsquo;t use it for anything big, but if you want to just do a quick test then here you go:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var email:String = &amp;#34;name@server.com&amp;#34;;&#xA;&#xA;if (email.indexOf(&amp;#34;@&amp;#34;)!=-1 &amp;amp;amp;&amp;amp;amp; email.indexOf(&amp;#34;.&amp;#34;)!=-1) trace(&amp;#34;false&amp;#34;);&#xA;else trace (&amp;#34;true&amp;#34;);&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>VLC Cache Rant</title>
      <link>https://andrewodendaal.com/vlc-cache-rant/</link>
      <pubDate>Tue, 17 Aug 2010 11:51:07 +0000</pubDate>
      <guid>https://andrewodendaal.com/vlc-cache-rant/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2010/08/vlcBuildingFontCache.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;The first time this ran it took for freakin&amp;rsquo; ages!&lt;/p&gt;&#xA;&lt;h5 id=&#34;this-should-take-less-than-a-few-minutes&#34;&gt;This should take less than a few minutes&lt;/h5&gt;&#xA;&lt;p&gt;What the hell is that supposed to mean? Less than a few? 73 minutes perhaps?&lt;/p&gt;&#xA;&lt;p&gt;Rant over..&lt;/p&gt;</description>
    </item>
    <item>
      <title>ODBC SQL Server Memory General Network Error</title>
      <link>https://andrewodendaal.com/odbc-sql-server-memory-general-network-error/</link>
      <pubDate>Mon, 09 Aug 2010 12:15:38 +0000</pubDate>
      <guid>https://andrewodendaal.com/odbc-sql-server-memory-general-network-error/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Microsoft OLE DB Provider for ODBC Drivers error ‘80004005&amp;rsquo;&lt;!-- raw HTML omitted --&gt;[Microsoft][ODBC SQL Server Driver][Shared Memory]General network error. Check your network documentation.&lt;!-- raw HTML omitted --&gt;/site/path/to/script/aspfile.asp, line # &lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;..and that&amp;rsquo;s what it throws you!&lt;/p&gt;&#xA;&lt;p&gt;At about this point you may want to scream, or just be a tad annoyed by that damn machine running your site.&lt;br&gt;&#xA;Basically your server is either one of two things, and those are:&lt;/p&gt;</description>
    </item>
    <item>
      <title>XML cannot be the whole program</title>
      <link>https://andrewodendaal.com/xml-cannot-be-the-whole-program/</link>
      <pubDate>Mon, 26 Jul 2010 10:09:03 +0000</pubDate>
      <guid>https://andrewodendaal.com/xml-cannot-be-the-whole-program/</guid>
      <description>&lt;p&gt;What the hell does that mean?&lt;/p&gt;&#xA;&lt;p&gt;You can get this &lt;strong&gt;error&lt;/strong&gt; thrown up in your good old trusty &lt;strong&gt;Firebug&lt;/strong&gt; console.&lt;br&gt;&#xA;It expects a script to be returned as an ajax type datatype.&lt;/p&gt;&#xA;&lt;p&gt;So all you have to do is change your datatype to output as XML.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Mocha Java Decompiler Download</title>
      <link>https://andrewodendaal.com/mocha-java-decompiler-download/</link>
      <pubDate>Fri, 25 Jun 2010 15:07:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/mocha-java-decompiler-download/</guid>
      <description>&lt;p&gt;Mocha is a Java Decompiler and is 100% FREE to use.&lt;/p&gt;&#xA;&lt;p&gt;The readme.txt file in the Mocha distribution offers the free usage license:&lt;br&gt;&#xA;The distribution archive (file &amp;ldquo;mocha-b1.zip&amp;rdquo;) may be distributed freely, provided its contents (&amp;ldquo;mocha.zip&amp;rdquo; and this file, &amp;ldquo;readme.txt&amp;rdquo;) are not tampered with in any way.&lt;/p&gt;&#xA;&lt;p&gt;I am pleased to be able to make the Mocha distribution available under those terms:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://dev.hsmoore.com/mocha/mocha-b1.zip&#34;&gt;mocha-b1.zip&lt;/a&gt; (121K)&lt;/p&gt;&#xA;&lt;p&gt;You can visit the alternative download location &lt;!-- raw HTML omitted --&gt;here&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>EAI_NODATA</title>
      <link>https://andrewodendaal.com/eai_nodata/</link>
      <pubDate>Thu, 24 Jun 2010 13:12:29 +0000</pubDate>
      <guid>https://andrewodendaal.com/eai_nodata/</guid>
      <description>&lt;p&gt;Error message: &lt;strong&gt;&lt;em&gt;&lt;!-- raw HTML omitted --&gt;Connection attempt failed with &amp;ldquo;EAI_NODATA – No address associated with nodename&amp;rdquo;&lt;!-- raw HTML omitted --&gt;&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The above error occured while using &lt;!-- raw HTML omitted --&gt;Filezilla&lt;!-- raw HTML omitted --&gt; (Ftp Client), it either means that you do not have an active internet connection, OR it means that you need to clear the private data because the connection to the server was lost while an active FTP connection was still present. Upon reconnection to the server (which is sometimes automatic) you will receive the &lt;!-- raw HTML omitted --&gt;EAI_NODATA&lt;!-- raw HTML omitted --&gt; error.&lt;/p&gt;</description>
    </item>
    <item>
      <title>1180 Call to a possibly undefined method navigateToURL</title>
      <link>https://andrewodendaal.com/1180-call-to-a-possibly-undefined-method-navigatetourl/</link>
      <pubDate>Fri, 18 Jun 2010 10:50:58 +0000</pubDate>
      <guid>https://andrewodendaal.com/1180-call-to-a-possibly-undefined-method-navigatetourl/</guid>
      <description>&lt;p&gt;&lt;code&gt;1180 Call to a possibly undefined method navigateToURL&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you get the above error when trying to run your flash actionscript 3 file, you are obviously trying to use the &lt;code&gt;navigateToURL()&lt;/code&gt; function but have not imported the flash.net library code.&lt;/p&gt;&#xA;&lt;p&gt;The following code before everything will correct the problem.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import flash.net.*;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;..or a more of a direct unbloated method is as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import flash.net.navigateToURL;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Test Your Password Strength</title>
      <link>https://andrewodendaal.com/test-your-password-strength/</link>
      <pubDate>Thu, 10 Jun 2010 13:46:59 +0000</pubDate>
      <guid>https://andrewodendaal.com/test-your-password-strength/</guid>
      <description>&lt;p&gt;I came across this site today and it&amp;rsquo;s quite an interesting one as it works out the approximate time it would take a desktop pc to crack the password.&lt;/p&gt;&#xA;&lt;p&gt;Check it out &lt;!-- raw HTML omitted --&gt;here&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to use a Timer in Actionscript 3</title>
      <link>https://andrewodendaal.com/how-to-use-a-timer-in-actionscript-3/</link>
      <pubDate>Thu, 10 Jun 2010 10:16:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-use-a-timer-in-actionscript-3/</guid>
      <description>&lt;p&gt;It is really easy to create a Timer in Actionscript 3.&lt;/p&gt;&#xA;&lt;p&gt;Instantiate the Timer Class and pass a time in millions of 1000 to it to work in seconds.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var myTimer:Timer = new Timer(1000);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Setup an event listener to call a function.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;myTimer.addEventListener(&amp;#34;timer&amp;#34;, myTimerEventHandler);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Start the Timer.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;myTimer.start();&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Start the Timer.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function myTimerEventHandler(event:TimerEvent):void {&#xA;  trace(myTimer.currentCount+&amp;#34; seconds have passed.&amp;#34;);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;So altogether we have this.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var myTimer:Timer = new Timer(1000);&#xA;myTimer.addEventListener(&amp;#34;timer&amp;#34;, myTimerEventHandler);&#xA;myTimer.start();&#xA;function myTimerEventHandler(event:TimerEvent):void {&#xA;  trace(myTimer.currentCount+&amp;#34; seconds have passed.&amp;#34;);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now you know how to use a Timer in Actionscript 3.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Google Background Image</title>
      <link>https://andrewodendaal.com/google-background-image/</link>
      <pubDate>Wed, 09 Jun 2010 17:37:57 +0000</pubDate>
      <guid>https://andrewodendaal.com/google-background-image/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Google&lt;!-- raw HTML omitted --&gt; now allows you to add a background image to the google homepage to apparently make it more, like, home.. hmmmm&lt;/p&gt;&#xA;&lt;p&gt;Just by clicking the button at the bottom left hand corner it allows you to either upload an image or select an image from google.&lt;/p&gt;&#xA;&lt;p&gt;For indepth instructions as per Google, check this page out: &lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://www.google.com/support/websearch/bin/answer.py?answer=180720&amp;amp;hl=en&#34;&gt;http://www.google.com/support/websearch/bin/answer.py?answer=180720&amp;amp;hl=en&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Hire a Hacker</title>
      <link>https://andrewodendaal.com/how-to-hire-a-hacker/</link>
      <pubDate>Wed, 09 Jun 2010 14:00:06 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-hire-a-hacker/</guid>
      <description>&lt;p&gt;I came across a very interesting and quite funny read, take a look here for &lt;!-- raw HTML omitted --&gt;How to Hire a Hacker: &lt;a href=&#34;http://www.setec.org/hirehacker.html&#34;&gt;http://www.setec.org/hirehacker.html&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>If the program is already running, close it before attempting to run.</title>
      <link>https://andrewodendaal.com/if-the-program-is-already-running-close-it-before-attempting-to-run/</link>
      <pubDate>Tue, 08 Jun 2010 11:03:41 +0000</pubDate>
      <guid>https://andrewodendaal.com/if-the-program-is-already-running-close-it-before-attempting-to-run/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2010/06/la7fa8ed.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Launch Failed!&lt;/p&gt;&#xA;&lt;p&gt;If the program is already running, close it before attempting to run.&lt;/p&gt;&#xA;&lt;p&gt;I don&amp;rsquo;t know how many times I have gotten this error message while trying to Run a project in Adobe Flash Builder.&lt;/p&gt;&#xA;&lt;p&gt;For all of you stuck with this message and unable to ever get your projects going, there is quite a simple fix to this.&lt;/p&gt;&#xA;&lt;p&gt;All you need to do is open up Task Manager (Ctrl+Shift+Esc) and click on Processes, then &amp;ldquo;End Process&amp;rdquo; on any instances of &amp;ldquo;adl.exe&amp;rdquo; you find. Only one adl.exe instance can run at any given time.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Random Number In ASP for no Flash Caching</title>
      <link>https://andrewodendaal.com/random-number-in-asp-for-no-flash-caching/</link>
      <pubDate>Fri, 04 Jun 2010 09:12:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/random-number-in-asp-for-no-flash-caching/</guid>
      <description>&lt;p&gt;This is an example of how to create a random number in Classic ASP in order to append to a swf file so that the browser does not cache the swf file.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;% Dim SwfRndNum Randomize SwfRndNum = Rnd %&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can then add it to your swf embed code as follow, bear in mind that I am only showing the snippet around the swf file name and not the entire embed code.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Why we don’t choose MSSQL!</title>
      <link>https://andrewodendaal.com/why-we-dont-choose-mssql/</link>
      <pubDate>Wed, 26 May 2010 12:45:36 +0000</pubDate>
      <guid>https://andrewodendaal.com/why-we-dont-choose-mssql/</guid>
      <description>&lt;p&gt;Everybody always raves how great Microsoft SQL Server is, and how much data it can hold, and how much bigger it&amp;rsquo;s &amp;ldquo;package&amp;rdquo; is than your own.&lt;/p&gt;&#xA;&lt;p&gt;But the truth is that I hate it with a passion!&lt;/p&gt;&#xA;&lt;p&gt;I use &lt;!-- raw HTML omitted --&gt;RDBMS&lt;!-- raw HTML omitted --&gt;‘ on a daily basis and never used to hate MSSQL so much until recently when I had to modify a very large site that was built in &lt;!-- raw HTML omitted --&gt;Classic ASP(yuck) and MSSQL&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How Do You Fire A Client?</title>
      <link>https://andrewodendaal.com/how-do-you-fire-a-client/</link>
      <pubDate>Thu, 20 May 2010 13:05:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-do-you-fire-a-client/</guid>
      <description>&lt;h2 id=&#34;how-do-you-fire-a-client&#34;&gt;How do you fire a client?&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s face it, some clients can be a &lt;strong&gt;real nightmare&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;There are a whole bunch of tell-tail signs that a client is going to be a major problem for you shortly after or sometimes during your first interaction with them. This can be a phone call, a few emails or worst of all, a face to face meeting.&lt;/p&gt;&#xA;&lt;p&gt;Remember that you need to be selective when it comes to work you take on, as a bad client can cause more trouble than they&amp;rsquo;re worth. They can even bankrupt you if you&amp;rsquo;re not careful.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to get ‘how many days in February’ using Javascript?</title>
      <link>https://andrewodendaal.com/how-to-get-how-many-days-in-february-using-javascript/</link>
      <pubDate>Wed, 19 May 2010 12:41:20 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-get-how-many-days-in-february-using-javascript/</guid>
      <description>&lt;p&gt;It is quite handy to have a function that can tell you how many days there are in February due to the leap year shift of either 28 or 29 days.&lt;br&gt;&#xA;Below is a function created in Javascript to return the exact amount of days according to the year given:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function daysInFebruary (year){&#xA;    return (((year%4==0)&amp;amp;&amp;amp;((!(year%100==0))||(year%400==0)))?29:28);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Weird Pagination on a Google Page</title>
      <link>https://andrewodendaal.com/weird-pagination-on-a-google-page/</link>
      <pubDate>Mon, 17 May 2010 13:32:55 +0000</pubDate>
      <guid>https://andrewodendaal.com/weird-pagination-on-a-google-page/</guid>
      <description>&lt;p&gt;Not sure how long this one will last, but for now:&lt;br&gt;&#xA;Go to: &lt;a href=&#34;http://www.google.co.za/search?q=MFI/06/ASA-778658&amp;amp;hl=en&amp;amp;start=0&amp;amp;sa=N&#34;&gt;http://www.google.co.za/search?q=MFI/06/ASA-778658&amp;amp;hl=en&amp;amp;start=0&amp;amp;sa=N&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you scroll to the bottom, there are 4 pages (pagination), press Next, now there are only 2, WEIRD HUH!&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2010/05/goog1.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Actionscript 2 – PHP Data Transfer</title>
      <link>https://andrewodendaal.com/actionscript-2-php-data-transfer/</link>
      <pubDate>Mon, 17 May 2010 12:09:32 +0000</pubDate>
      <guid>https://andrewodendaal.com/actionscript-2-php-data-transfer/</guid>
      <description>&lt;p&gt;In the below example we will use Actionscript 2 to call a remote PHP file that will return data to it.&lt;br&gt;&#xA;It is a simple way of transferring data between the server and client.&lt;/p&gt;&#xA;&lt;h3 id=&#34;actionscript-2-code&#34;&gt;Actionscript 2 Code:&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;callRemoteFile = function(ourVariable:String) {&#xA;var result_lv:LoadVars = new LoadVars();&#xA;result_lv.onLoad = function(success:Boolean) {&#xA;if (success) {&#xA;if (result_lv.message==&amp;#34;success&amp;#34;)&#xA;trace(&amp;#34;done! &amp;#34;+result_lv.returnValue);&#xA;else&#xA;trace(result_lv.message);&#xA;} else {&#xA;trace(&amp;#34;Error connecting to server&amp;#34;);&#xA;return false;&#xA;}&#xA;};&#xA;var send_lv:LoadVars = new LoadVars();&#xA;send_lv.ourVariable = ourVariable;&#xA;send_lv.sendAndLoad(&amp;#34;/example/file.php&amp;#34;, result_lv, &amp;#34;POST&amp;#34;);&#xA;}&#xA;callRemoteFile(&amp;#34;some text here&amp;#34;);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;php-code&#34;&gt;PHP Code:&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;?php&#xA;&#x9;if (isset($_POST)) echo &amp;#34;a=1&amp;amp;message=success&amp;amp;returnValue=&amp;#34;.$_POST[&amp;#34;ourVariable&amp;#34;].&amp;#34;&amp;amp;b=2&amp;#34;;&#xA;&#x9;else echo &amp;#34;a=0&amp;amp;message=failed&amp;amp;returnValue=nothing&amp;amp;b=1&amp;#34;;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Unique Random Numbers in PHP</title>
      <link>https://andrewodendaal.com/unique-random-numbers-in-php/</link>
      <pubDate>Thu, 13 May 2010 13:55:15 +0000</pubDate>
      <guid>https://andrewodendaal.com/unique-random-numbers-in-php/</guid>
      <description>&lt;p&gt;If you would like to show random numbers using PHP you can do this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;?php&#xA;&#x9;$min = 1;&#xA;&#x9;$max = 100;&#xA;&#x9;$total = 100;&#xA;&#x9;$arrItems = array();&#xA;&#x9;while ( count($arrItems) &amp;lt; $total ) {&#xA;&#x9;&#x9;$item = mt_rand($min,$max);&#xA;&#x9;&#x9;if (!in_array($item,$arrItems)) {&#xA;&#x9;&#x9;&#x9;$arrItems[] = $item;&#xA;&#x9;&#x9;&#x9;echo $item.&amp;#34;&amp;lt;br /&amp;gt;&amp;#34;;&#xA;&#x9;&#x9;}&#xA;&#x9;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>HTML mail() Sending as Plain Text</title>
      <link>https://andrewodendaal.com/html-mail-sending-as-plain-text/</link>
      <pubDate>Tue, 11 May 2010 14:25:14 +0000</pubDate>
      <guid>https://andrewodendaal.com/html-mail-sending-as-plain-text/</guid>
      <description>&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$to = &amp;#34;email@address.com&amp;#34;;&#xA;$subject = &amp;#34;SUBJECT&amp;#34;;&#xA;$message = &amp;#34;&amp;lt;b&amp;gt;MESSAGE&amp;lt;/b&amp;gt;&amp;#34;;&#xA;$headers = &amp;#39;MIME-Version: 1.0&amp;#39; . &amp;#34;\r\n&amp;#34;;&#xA;$headers .= &amp;#39;Content-type: text/html; charset=iso-8859-1&amp;#39; . &amp;#34;\r\n&amp;#34;;&#xA;$headers .= &amp;#39;From: Mailer &amp;#39; . &amp;#34;\r\n&amp;#34;;&#xA;mail($to, $subject, $message, $headers);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The above code does not always send emails in HTML as it should, it turns out there is a PHP Bug (&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://bugs.php.net/15841&#34;&gt;http://bugs.php.net/15841&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;) that comes into play with QMAIL and carriage returns.&lt;br&gt;&#xA;If this is the case you should replace &amp;ldquo;\r\n&amp;rdquo; with a &amp;ldquo;\n&amp;rdquo; only.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Turbo C&#43;&#43; in DosBox for Windows 64bit</title>
      <link>https://andrewodendaal.com/turbo-c-in-dosbox-for-windows-64bit/</link>
      <pubDate>Fri, 07 May 2010 17:31:35 +0000</pubDate>
      <guid>https://andrewodendaal.com/turbo-c-in-dosbox-for-windows-64bit/</guid>
      <description>&lt;p&gt;I had to compile a C++ application under a DOS environment and was running Windows 7 64bit.&lt;/p&gt;&#xA;&lt;p&gt;Firstly, Turbo C++ is a 32 bit x86 application and therefore will not run when initialised from an x64 environment.&lt;/p&gt;&#xA;&lt;p&gt;This can easily be solved by installing the DOS Emulator called DosBox. One can then mount the Turbo C++ folder as a drive and install it under a subdirectory.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;e.g. mount c c:\PathToMyTurboCppDirectory\&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Once in there it&amp;rsquo;s quite easy to open and compile the source code, but good luck to anyone that tries to write anything from scratch, it&amp;rsquo;s really painful and half the keys are not mapped in the DosBox, eventhough you can press Ctrl+F1 to open the Keymapper.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Case Insensitivity with .htaccess files</title>
      <link>https://andrewodendaal.com/case-insensitivity-with-htaccess-files/</link>
      <pubDate>Wed, 05 May 2010 17:28:06 +0000</pubDate>
      <guid>https://andrewodendaal.com/case-insensitivity-with-htaccess-files/</guid>
      <description>&lt;p&gt;If you have an &lt;code&gt;.htaccess&lt;/code&gt; file to control the flow of URI&amp;rsquo;s on your site you may want to look at adding a nice little &amp;ldquo;case insensitive&amp;rdquo; feature to each line/item.&lt;/p&gt;&#xA;&lt;p&gt;So an example of a line of .htaccess without any case insensitive bells and whistles looks like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;RewriteRule ^AndrewOdendaal$ index.php?go=2964&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We add our Case Insensitive feature by just adding a [NC] to the end of the line, like this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Actionscript2: Split string by line length with &amp; without word-wrap</title>
      <link>https://andrewodendaal.com/split-string-by-line-length-with-and-without-word-wrap-using-actionscript-2/</link>
      <pubDate>Wed, 05 May 2010 11:04:25 +0000</pubDate>
      <guid>https://andrewodendaal.com/split-string-by-line-length-with-and-without-word-wrap-using-actionscript-2/</guid>
      <description>&lt;p&gt;Split string into sentences by max line length.&lt;br&gt;&#xA;This uses a character array but doesn&amp;rsquo;t use word-wrapping.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var personalMessage: String = &amp;#34;You got this far so we reckon that you could be curious enough to learn a little more, we?ll contact you shortly to answer any questions you may have.&amp;#34;;&#xA;_root.myArray = new Array();&#xA;_root.myArray = personalMessage.split(&amp;#34;&amp;#34;);&#xA;_root.mySentences = new Array();&#xA;var currentCharCount: Number = 0;&#xA;var currentCharItem: Number = 0;&#xA;var currentCharString: String = &amp;#34;&amp;#34;;&#xA;var maxLength: Number = 65;&#xA;&#xA;for (var i = 0; i &amp;amp; lt; _root.myArray.length; i++) {&#xA;    if (currentCharCount &amp;amp; lt; maxlength) currentcharstring = &amp;#34;&amp;#34; += &amp;#34;_root.myArray[i];&amp;#34;&#xA;    if = &amp;#34;&amp;#34;(currentcharcount = &amp;#34;=maxLength&amp;#34; || = &amp;#34;&amp;#34;&#xA;        currentcharitem = &amp;#34;=(_root.myArray.length-1))&amp;#34; {&#xA;            = &amp;#34;&amp;#34;&#xA;            _root.mysentences.push(currentcharstring); = &amp;#34;&amp;#34;&#xA;            currentcharcount = &amp;#34;0;&amp;#34;; = &amp;#34;&amp;#34;&#xA;        } = &amp;#34;&amp;#34;&#xA;        currentcharcount++; = &amp;#34;&amp;#34;&#xA;        currentcharitem++; = &amp;#34;&amp;#34;&#xA;        trace(_root.mysentences.length); = &amp;#34;&amp;#34;&#xA;        trace(_root.mysentences[0]); = &amp;#34;&amp;#34;&#xA;        trace(_root.mysentences[1]); = &amp;#34;&amp;#34;&#xA;        trace(_root.mysentences[2]); = &amp;#34;&amp;#34; [ = &amp;#34;&amp;#34;&#xA;            code&#xA;        ] = &amp;#34;&amp;#34;&#xA;        this = &amp;#34;&amp;#34;&#xA;        outputs = &amp;#34;&amp;#34;&#xA;        the = &amp;#34;&amp;#34;&#xA;        following: = &amp;#34;&amp;#34; [code = &amp;#34;&amp;#34;&#xA;            lang = &amp;#34;c&amp;#34;&#xA;        ] = &amp;#34;&amp;#34;&#xA;        3 = &amp;#34;&amp;#34;&#xA;        you = &amp;#34;&amp;#34;&#xA;        got = &amp;#34;&amp;#34;&#xA;        far = &amp;#34;&amp;#34;&#xA;        so = &amp;#34;&amp;#34;&#xA;        we = &amp;#34;&amp;#34;&#xA;        reckon = &amp;#34;&amp;#34;&#xA;        that = &amp;#34;&amp;#34;&#xA;        could = &amp;#34;&amp;#34;&#xA;        be = &amp;#34;&amp;#34;&#xA;        curious = &amp;#34;&amp;#34;&#xA;        enough = &amp;#34;&amp;#34;&#xA;        to = &amp;#34;&amp;#34;&#xA;        learn = &amp;#34;&amp;#34;&#xA;        a = &amp;#34;&amp;#34;&#xA;        little = &amp;#34;&amp;#34;&#xA;        more, = &amp;#34;&amp;#34;&#xA;        we? ll = &amp;#34;&amp;#34;&#xA;        contact = &amp;#34;&amp;#34;&#xA;        shortly = &amp;#34;&amp;#34;&#xA;        answer = &amp;#34;&amp;#34;&#xA;        any = &amp;#34;&amp;#34;&#xA;        que = &amp;#34;&amp;#34;&#xA;        tions = &amp;#34;&amp;#34;&#xA;        may = &amp;#34;&amp;#34;&#xA;        have. = &amp;#34;&amp;#34;&#xA;        split = &amp;#34;&amp;#34;&#xA;        string = &amp;#34;&amp;#34;&#xA;        into = &amp;#34;&amp;#34;&#xA;        sentences = &amp;#34;&amp;#34;&#xA;        by = &amp;#34;&amp;#34;&#xA;        max = &amp;#34;&amp;#34;&#xA;        line = &amp;#34;&amp;#34;&#xA;        length = &amp;#34;&amp;#34;&#xA;        and = &amp;#34;&amp;#34;&#xA;        use = &amp;#34;&amp;#34;&#xA;        word - wrapping. = &amp;#34;&amp;#34;&#xA;        var = &amp;#34;&amp;#34;&#xA;        personalmessage: string = &amp;#34;You got this far so we reckon that you could be curious enough to learn a little more, we?ll contact you shortly to answer any questions you may have.&amp;#34;&#xA;        _root.myarray = &amp;#34;new&amp;#34;&#xA;        array(); = &amp;#34;&amp;#34;&#xA;        &amp;#34;);=&amp;#34;&#xA;        &amp;#34; _root.mysentences=&amp;#34;&#xA;        new &amp;#34; currentcharstring:string=&amp;#34;&#xA;        &amp;#34; maxlength:number=&amp;#34;&#xA;        60;&#xA;        &amp;#34; for=&amp;#34;&#xA;        &amp;#34; (var=&amp;#34;&#xA;        &amp;#34; i=&amp;#34;&#xA;        0;&#xA;        &amp;#34; i&amp;lt;_root.myarray.length;=&amp;#34;&#xA;        &amp;#34; i++=&amp;#34;&#xA;        &amp;#34; )=&amp;#34;&#xA;        &amp;#34; (currentcharstring.length&amp;lt;maxlength)=&amp;#34;&#xA;        &amp;#34; &amp;#34; = &amp;#34;&amp;#34;&#xA;        &amp;#34;;=&amp;#34;&#xA;        &amp;#34; ((currentcharstring.length=&amp;#34;&#xA;        &amp;#34;&amp;gt;= (maxLength-1)) || (i==(_root.myArray.length-1))) {&#xA;        _root.mySentences.push(currentCharString); currentCharString = &amp;#34;&amp;#34;;&#xA;    }&#xA;    else currentCharCount++;&#xA;} &amp;amp; lt;&#xA;/maxlength)&amp;gt;&#xA;&#xA;trace(_root.mySentences.length);&#xA;trace(_root.mySentences[0]);&#xA;trace(_root.mySentences[1]);&#xA;trace(_root.mySentences[2]);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This outputs the following:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Search and Replace Anchor Href using Javascript</title>
      <link>https://andrewodendaal.com/search-and-replace-anchor-href-using-javascript/</link>
      <pubDate>Thu, 29 Apr 2010 10:04:50 +0000</pubDate>
      <guid>https://andrewodendaal.com/search-and-replace-anchor-href-using-javascript/</guid>
      <description>&lt;p&gt;I have a site that is under development and it was made really badly so I needed a quick way to replace all anchors on page to the relevant path.&lt;/p&gt;&#xA;&lt;p&gt;The problem is because it was a testsite that lived away from the public facing domain, the anchors had to be changed because they were all coded in as absolute paths.&lt;/p&gt;&#xA;&lt;p&gt;I included a JavascriptDebug file and put the following in there:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Error 29506 while installing SQL Server Management Studio Express</title>
      <link>https://andrewodendaal.com/error-29506-while-installing-sql-server-management-studio-express/</link>
      <pubDate>Wed, 28 Apr 2010 16:39:03 +0000</pubDate>
      <guid>https://andrewodendaal.com/error-29506-while-installing-sql-server-management-studio-express/</guid>
      <description>&lt;p&gt;I was trying to install Microsoft SQL Server Management Studio Express (what a long name) on a machine and kept getting error 29506 right near the end with a Rollback action thereafter.&lt;/p&gt;&#xA;&lt;p&gt;To get this program installed you will need to run Command Prompt as Administrator and then run the MSI (installer) from there.&lt;/p&gt;&#xA;&lt;p&gt;Navigate to &lt;code&gt;C:\Windows\System32\&lt;/code&gt; then right click on cmd.exe and select Run as Administrator. Once the console has loaded, you can &amp;ldquo;cd&amp;rdquo; to the directory and then run the installer from there.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Swap HTML Elements Using Javascript</title>
      <link>https://andrewodendaal.com/swap-html-elements-using-javascript/</link>
      <pubDate>Mon, 26 Apr 2010 12:06:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/swap-html-elements-using-javascript/</guid>
      <description>&lt;p&gt;It is quite easy to use javascript to swap between divs or any other html dom elements.&lt;br&gt;&#xA;Using the function below you can pass the id of the element to show and to hide.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function swapDivs(show, hide){&#xA;    document.getElementById(show).style.display = &amp;#34;block&amp;#34;;&#xA;    document.getElementById(hide).style.display = &amp;#34;none&amp;#34;;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>A PHP Mail Class</title>
      <link>https://andrewodendaal.com/a-php-mail-class/</link>
      <pubDate>Mon, 26 Apr 2010 11:59:42 +0000</pubDate>
      <guid>https://andrewodendaal.com/a-php-mail-class/</guid>
      <description>&lt;p&gt;Below is a Mail class I created in PHP, it requires 4 arguments on initiation of the class via the constructor and uses the method -&amp;gt;send() to send the created mail once complete.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Mail {&#xA;var $to;&#xA;var $subject;&#xA;var $content;&#xA;var $headers;&#xA;&#xA;function Mail($to, $subject, $content, $from){&#xA;&#xA;$this-&amp;gt;to = $to;&#xA;$this-&amp;gt;subject = $subject;&#xA;$this-&amp;gt;content = $content;&#xA;$this-&amp;gt;headers = &amp;#34;Content-type: text/html; charset=iso-8859-1\r\nFrom: $from&amp;#34;;&#xA;&#xA;$this-&amp;gt;content = &amp;#34;&amp;#34;.$content.&amp;#34;&amp;#34;;&#xA;}&#xA;&#xA;function send(){&#xA;return mail($this-&amp;gt;to, $this-&amp;gt;subject, stripslashes($this-&amp;gt;content), $this-&amp;gt;headers);&#xA;}&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>iTunes keeps maximizing!</title>
      <link>https://andrewodendaal.com/itunes-keeps-maximizing/</link>
      <pubDate>Mon, 26 Apr 2010 10:58:48 +0000</pubDate>
      <guid>https://andrewodendaal.com/itunes-keeps-maximizing/</guid>
      <description>&lt;p&gt;Oh my goodness, this can be an annoying issue with iTunes.&lt;/p&gt;&#xA;&lt;p&gt;The problem is: iTunes will restore itself or maximize itself all the time every 20 or so seconds without being clicked on, it will also get main focus and whatever you were doing will have to wait!&lt;/p&gt;&#xA;&lt;p&gt;I solved this by right clicking on the iTunes program icon where I launch it from and selecting Properties, then selecting &amp;ldquo;Compatibility&amp;rdquo; then making sure &amp;ldquo;Run this program as an administrator&amp;rdquo; was checked.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Replace newline break in Excel</title>
      <link>https://andrewodendaal.com/replace-newline-break-in-excel/</link>
      <pubDate>Fri, 23 Apr 2010 17:32:31 +0000</pubDate>
      <guid>https://andrewodendaal.com/replace-newline-break-in-excel/</guid>
      <description>&lt;p&gt;Ever needed to find &amp;amp; replace the newline character in a large excel document?&lt;/p&gt;&#xA;&lt;p&gt;In the Replace Dialog (Ctrl+F)&lt;br&gt;&#xA;Find: Hold down [alt] and type 010 on the numeric keypad.&lt;br&gt;&#xA;Replace: Replace with a space &amp;quot; &amp;quot; (without quotes)&lt;/p&gt;</description>
    </item>
    <item>
      <title>PHPExcel Class Usage</title>
      <link>https://andrewodendaal.com/phpexcel-class-usage/</link>
      <pubDate>Fri, 23 Apr 2010 16:03:05 +0000</pubDate>
      <guid>https://andrewodendaal.com/phpexcel-class-usage/</guid>
      <description>&lt;p&gt;I just finished adding an export xls (excel) export feature to a web application.&lt;/p&gt;&#xA;&lt;p&gt;I used the PHPExcel Class from &lt;!-- raw HTML omitted --&gt;CodePlex&lt;!-- raw HTML omitted --&gt;, its really great to work with – as far as the world of exporters go that is.&lt;/p&gt;&#xA;&lt;p&gt;In the example below the &amp;ldquo;exportCheckpoints&amp;rdquo; function requires an imploded string seperated as &amp;ldquo;|||||&amp;rdquo;. Hopefully it gives an example of how easy it &amp;ldquo;could&amp;rdquo; be to export something from mysql to excel using php.&lt;/p&gt;</description>
    </item>
    <item>
      <title>unexpected T_IF</title>
      <link>https://andrewodendaal.com/unexpected-t_if/</link>
      <pubDate>Thu, 22 Apr 2010 14:48:41 +0000</pubDate>
      <guid>https://andrewodendaal.com/unexpected-t_if/</guid>
      <description>&lt;p&gt;Getting &amp;ldquo;Parse error: syntax error, unexpected T_IF&amp;rdquo; ?&lt;br&gt;&#xA;Check if the preceeding line ends with a ;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Worst Websites of All Time</title>
      <link>https://andrewodendaal.com/worst-websites-of-all-time/</link>
      <pubDate>Mon, 19 Apr 2010 10:03:29 +0000</pubDate>
      <guid>https://andrewodendaal.com/worst-websites-of-all-time/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://www.arngren.net/&#34;&gt;http://www.arngren.net/&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://www.lingscars.com/&#34;&gt;http://www.lingscars.com/&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://www.theworstwebsite.com/&#34;&gt;http://www.theworstwebsite.com/&lt;/a&gt;&lt;!-- raw HTML omitted --&gt; – beware, alert boxes coming!&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://havenworks.com/&#34;&gt;http://havenworks.com/&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://www.msy.com.au/&#34;&gt;http://www.msy.com.au/&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://www.5safepoints.com/&#34;&gt;http://www.5safepoints.com/&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://www.pixyland.org/peterpan/&#34;&gt;http://www.pixyland.org/peterpan/&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://www.aiseikai.or.jp/&#34;&gt;http://www.aiseikai.or.jp/&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Set line leading / line spacing in flash actionscript 2</title>
      <link>https://andrewodendaal.com/set-line-leading-line-spacing-in-flash-actionscript-2/</link>
      <pubDate>Fri, 16 Apr 2010 16:14:40 +0000</pubDate>
      <guid>https://andrewodendaal.com/set-line-leading-line-spacing-in-flash-actionscript-2/</guid>
      <description>&lt;p&gt;&lt;strong&gt;This is how to add text leading using Actionscript 2 for Flash.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var txtFormat:TextFormat = new TextFormat();&#xA;txtFormat.leading = 5; // change this to whatever you need it to be&#xA;ttt.setTextFormat(txtFormat);&#xA;ttt2.setTextFormat(txtFormat);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;There is also a GUI way of doing this:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Select your textfield and and under the paragraph section, set the top/right hand icon (Line Spacing) to whatever you like.&lt;/p&gt;</description>
    </item>
    <item>
      <title>MySQL Main Query Types used in PHP to select, insert, update and delete data</title>
      <link>https://andrewodendaal.com/mysql-main-query-types-used-in-php-to-select-insert-update-and-delete-data/</link>
      <pubDate>Fri, 16 Apr 2010 11:25:03 +0000</pubDate>
      <guid>https://andrewodendaal.com/mysql-main-query-types-used-in-php-to-select-insert-update-and-delete-data/</guid>
      <description>&lt;h2 id=&#34;mysql-main-query-types&#34;&gt;MySQL Main Query Types&lt;/h2&gt;&#xA;&lt;h3 id=&#34;select&#34;&gt;SELECT&lt;/h3&gt;&#xA;&lt;p&gt;&lt;code&gt;SELECT * FROM tablename&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;insert&#34;&gt;INSERT&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;INSERT INTO tablename (col1, col2, col3,..) VALUES (val1, val2, val3,...)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;update&#34;&gt;UPDATE&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;UPDATE tablename SET `col1`=`val1`, `col2`=`val2`, `col3`=`val3`,...&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;delete&#34;&gt;DELETE&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DELETE FROM tablename WHERE `col4`=`val6`&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;note&#34;&gt;Note&lt;/h3&gt;&#xA;&lt;p&gt;You will use a lot of WHERE clauses as well along with the above.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;e.g.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SELECT * FROM tablename WHERE `id`=&amp;#39;15&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;in-php&#34;&gt;In PHP&lt;/h3&gt;&#xA;&lt;p&gt;Calling to MySQL is really easy in PHP, just use the mysql_query() function.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;e.g.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;mysql_query(&amp;#34;SELECT * FROM tablename&amp;#34;)&#xA;$query = mysql_query(&amp;#34;SELECT * FROM tablename&amp;#34;);&#xA;while ($result = mysql_fetch_object($query)) {&#xA;  echo $result-&amp;gt;aColumnNameInMysql;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Connect to mysql database from php</title>
      <link>https://andrewodendaal.com/connect-to-mysql-database-from-php/</link>
      <pubDate>Fri, 16 Apr 2010 11:05:03 +0000</pubDate>
      <guid>https://andrewodendaal.com/connect-to-mysql-database-from-php/</guid>
      <description>&lt;p&gt;If you need to connect to a mysql database from php you can do it like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;?php&#xA;&#xA;$DBH = &amp;#39;localhost&amp;#39;;&#xA;$DBU = &amp;#39;root&amp;#39;;&#xA;$DBPWD = &amp;#39;password&amp;#39;;&#xA;$DBN = &amp;#39;petstore&amp;#39;;&#xA;$conn = mysql_connect($DBH, $DBU, $DBPWD) or die (&amp;#34;Error: Could not connect to database.&amp;#34;);&#xA;mysql_select_db($dbname);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This allows you to make a connection to the mysql database and gets it ready for you to make queries and manipulate the data.&lt;/p&gt;</description>
    </item>
    <item>
      <title>htaccess file and error 500 internal server error</title>
      <link>https://andrewodendaal.com/htaccess-file-and-error-500-internal-server-error/</link>
      <pubDate>Wed, 14 Apr 2010 13:17:50 +0000</pubDate>
      <guid>https://andrewodendaal.com/htaccess-file-and-error-500-internal-server-error/</guid>
      <description>&lt;p&gt;I have a question for anyone that can answer it:&lt;/p&gt;&#xA;&lt;p&gt;I create an .htaccess file in the root of a subdomain, but if I enter either of these two lines I get an erro 500 Internal Server Error:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;php_flag magic_quotes_gpc off&#xA;php_flag register_globals off&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Any suggestions anyone?&lt;/p&gt;</description>
    </item>
    <item>
      <title>Quake 4 – Fatal Error: could not create destination file</title>
      <link>https://andrewodendaal.com/quake-4-fatal-error-could-not-create-destination-file/</link>
      <pubDate>Fri, 09 Apr 2010 14:33:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/quake-4-fatal-error-could-not-create-destination-file/</guid>
      <description>&lt;p&gt;If you get an error message similar to this one when trying to run Quake 4…&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;Fatal Error: could not create destination file C:/Program Files (x86)/id Software/Quake 4 Multiplayer Demo/q4mp/gamex86.dll&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;…then you should run the exe as Administrator.&lt;/p&gt;&#xA;&lt;p&gt;So Right-click, &amp;ldquo;Run as Administrator&amp;rdquo; and all will be sorted.&lt;/p&gt;</description>
    </item>
    <item>
      <title>phpMyAdmin – Invalid field count in csv input on line 1</title>
      <link>https://andrewodendaal.com/phpmyadmin-invalid-field-count-in-csv-input-on-line-1/</link>
      <pubDate>Fri, 09 Apr 2010 10:59:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/phpmyadmin-invalid-field-count-in-csv-input-on-line-1/</guid>
      <description>&lt;p&gt;I was trying to import a massive csv dataset into phpMyAdmin and it kept throwing error:&lt;br&gt;&#xA;&lt;code&gt;Invalid field count in csv input on line 1&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;This is quite annoying as I followed all the usual steps as per normal.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;!-- raw HTML omitted --&gt;To solve this I had to do the following:&lt;!-- raw HTML omitted --&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Import&lt;/li&gt;&#xA;&lt;li&gt;Browse for your CSV file.&lt;/li&gt;&#xA;&lt;li&gt;Select CSV using LOAD DATA (rather than just CSV)&lt;/li&gt;&#xA;&lt;li&gt;Change &amp;ldquo;Fields terminated by&amp;rdquo; from &amp;ldquo;;&amp;rdquo; to &amp;ldquo;,&amp;rdquo;&lt;/li&gt;&#xA;&lt;li&gt;Make sure &amp;ldquo;Use LOCAL keyword&amp;rdquo; is selected.&lt;/li&gt;&#xA;&lt;li&gt;Click &amp;ldquo;Go&amp;rdquo;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Done!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Choosing a programming IDE</title>
      <link>https://andrewodendaal.com/choosing-a-programming-ide/</link>
      <pubDate>Wed, 07 Apr 2010 11:40:57 +0000</pubDate>
      <guid>https://andrewodendaal.com/choosing-a-programming-ide/</guid>
      <description>&lt;p&gt;This is somewhat of a debatable topic, but it has come up a lot of times without any real final clarity, so I will try and cover it all.&lt;/p&gt;&#xA;&lt;p&gt;Lets begin by explaining exactly what an IDE is and then we can move onto the more debated areas of choosing the right one for you.&lt;/p&gt;&#xA;&lt;p&gt;An IDE stands for &amp;ldquo;Integrated Development Environment&amp;rdquo; and is often used by programmers when creating their applications. It can be quite a different thing according to lots of factors including language, preference and perhaps a biased opinion.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Double border in CSS</title>
      <link>https://andrewodendaal.com/double-border-in-css/</link>
      <pubDate>Tue, 30 Mar 2010 09:27:51 +0000</pubDate>
      <guid>https://andrewodendaal.com/double-border-in-css/</guid>
      <description>&lt;p&gt;CSS allows you to add a border to almost all html elements. This is one of many CSS techniques you can use to enhance your web pages, along with &lt;a href=&#34;https://andrewodendaal.com/css-background-image-data-base64&#34;&gt;using CSS background image data&lt;/a&gt; for more advanced styling.&lt;/p&gt;&#xA;&lt;p&gt;If you would like a double border you can use CSS like this:&#xA;&lt;code&gt;style=&amp;quot;border:double&amp;quot;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;For more CSS styling options and techniques, you might also be interested in exploring how &lt;a href=&#34;https://andrewodendaal.com/google-background-image&#34;&gt;Google uses background images&lt;/a&gt; on their pages.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Exception… “Could not convert JavaScript” nsresult: “0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)”</title>
      <link>https://andrewodendaal.com/exception-could-not-convert-javascript-nsresult-0x80570009-ns_error_xpc_bad_convert_js/</link>
      <pubDate>Tue, 30 Mar 2010 08:38:14 +0000</pubDate>
      <guid>https://andrewodendaal.com/exception-could-not-convert-javascript-nsresult-0x80570009-ns_error_xpc_bad_convert_js/</guid>
      <description>&lt;p&gt;What the heck is..&lt;/p&gt;&#xA;&lt;p&gt;uncaught exception: [Exception… &amp;ldquo;Could not convert JavaScript argument arg 0 [nsIDOMHTMLDivElement.appendChild]&amp;rdquo; nsresult: &amp;ldquo;0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)&amp;rdquo; location: &amp;ldquo;JS frame :: PATH_TO_MY_JAVASCRIPT_FILE :: THE_METHOD_NAME :: line #&amp;rdquo; data: no]&lt;/p&gt;&#xA;&lt;p&gt;For me it was just an appendChild() that was causing the problems. You can always try the innerHTML+= way if all else fails 😉&lt;/p&gt;</description>
    </item>
    <item>
      <title>Error 1046: Type was not found or was not a compile-time constant: Event.</title>
      <link>https://andrewodendaal.com/error-1046-type-was-not-found-or-was-not-a-compile-time-constant-event/</link>
      <pubDate>Mon, 29 Mar 2010 20:10:48 +0000</pubDate>
      <guid>https://andrewodendaal.com/error-1046-type-was-not-found-or-was-not-a-compile-time-constant-event/</guid>
      <description>&lt;p&gt;&lt;code&gt;Error 1046: Type was not found or was not a compile-time constant: Event.&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;You need to import the Event class!&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;import flash.events.Event&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Add a date to a date in Actionscript 2</title>
      <link>https://andrewodendaal.com/add-a-date-to-a-date-in-actionscript2/</link>
      <pubDate>Fri, 26 Mar 2010 20:19:42 +0000</pubDate>
      <guid>https://andrewodendaal.com/add-a-date-to-a-date-in-actionscript2/</guid>
      <description>&lt;p&gt;I needed to work out a date range according to the date 3weeks away from the current date.&lt;br&gt;&#xA;After a bit of thinking, I found that it&amp;rsquo;s actually quite easy to achieve.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var theDate:Date = new Date();&#xA;dateDay = theDate.getDate();&#xA;dateMonth = theDate.getMonth();&#xA;dateYear = theDate.getFullYear();&#xA;&#xA;var theDate2:Date = new Date(dateYear,dateMonth,dateDay);&#xA;theDate2.setDate(theDate2.getDate() + 21);&#xA;dateDay2 = theDate2.getDate();&#xA;dateMonth2 = theDate2.getMonth();&#xA;dateYear2 = theDate2.getFullYear();&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The above code gets the current date and adds 21days/3weeks to it.&lt;br&gt;&#xA;Remember that if you use getMonth to output the final month number, you will want to add 1 to it as it starts at 0;&lt;br&gt;&#xA;Example:&lt;br&gt;&#xA;&lt;code&gt;dateMonth2 = theDate2.getMonth()+1;&lt;/code&gt;&lt;br&gt;&#xA;So you would do it like this:&lt;br&gt;&#xA;&lt;code&gt;theDate2.getDate() +&amp;quot;/&amp;quot;+ (theDate2.getMonth()+1) +&amp;quot;/&amp;quot;+ theDate2.getFullYear();&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Add a month to selectable date range – Date Chooser – Actionscript 2</title>
      <link>https://andrewodendaal.com/add-a-month-to-selectable-date-range-date-chooser-actionscript-2/</link>
      <pubDate>Mon, 22 Mar 2010 12:40:20 +0000</pubDate>
      <guid>https://andrewodendaal.com/add-a-month-to-selectable-date-range-date-chooser-actionscript-2/</guid>
      <description>&lt;p&gt;I have been working on a project where I need to select a date range starting today and ending a month from now, so the user cannot select anything in the past or over a month from now.&lt;/p&gt;&#xA;&lt;p&gt;This is how I did it:&lt;/p&gt;&#xA;&lt;p&gt;There is an instance of DateChooser on the stage with Instance Name &amp;ldquo;calDate&amp;rdquo;.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var todayDate:Date = new Date();&#xA;dateBeginDay = todayDate.getDate();&#xA;dateBeginMonth = todayDate.getMonth();&#xA;dateBeginYear = todayDate.getFullYear();&#xA;&#xA;if ((todayDate.getMonth()+1)==12) {&#xA;  dateEndDay = todayDate.getDate();&#xA;  dateEndMonth = 1;&#xA;  dateEndYear = todayDate.getFullYear()+1;&#xA;} else {&#xA;  dateEndDay = todayDate.getDate();&#xA;  dateEndMonth = todayDate.getMonth()+1;&#xA;  dateEndYear = todayDate.getFullYear();&#xA;}&#xA;calDate.selectableRange = {rangeStart: new Date(dateBeginYear, dateBeginMonth, dateBeginDay), rangeEnd: new Date(dateEndYear, dateEndMonth, dateEndDay)}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>hitTest and Actionscript2</title>
      <link>https://andrewodendaal.com/hittest-and-actionscript2/</link>
      <pubDate>Fri, 19 Mar 2010 11:42:31 +0000</pubDate>
      <guid>https://andrewodendaal.com/hittest-and-actionscript2/</guid>
      <description>&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;if (mc.hitTest(_root._xmouse, _root._ymouse, true))) {&#xA;  trace(&amp;#34;hitTest Run&amp;#34;);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>127.0.0.1:4664 and Google Desktop Search</title>
      <link>https://andrewodendaal.com/127-0-0-14664-and-google-desktop-search/</link>
      <pubDate>Wed, 17 Mar 2010 15:09:08 +0000</pubDate>
      <guid>https://andrewodendaal.com/127-0-0-14664-and-google-desktop-search/</guid>
      <description>&lt;p&gt;Recently I checked my website stats and saw I had a few hits from &amp;ldquo;127.0.0.1:4664&amp;rdquo; and wondered to myself, what the heck is that? Am I looking at my own site from a localhost? Why am I getting backlinks from my local computer to my site.&lt;/p&gt;&#xA;&lt;p&gt;After searching around a bit I found out that port 4664 is used by Google Desktop Search and when I typed in certain queries into Google it also returned items from my desktop search.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Limited numeric input in flash actionscript 2 textfield</title>
      <link>https://andrewodendaal.com/limited-numeric-input-in-flash-actionscript-2-textfield/</link>
      <pubDate>Tue, 16 Mar 2010 12:42:46 +0000</pubDate>
      <guid>https://andrewodendaal.com/limited-numeric-input-in-flash-actionscript-2-textfield/</guid>
      <description>&lt;p&gt;If you want to only show numeric characters in a textfield in flash actionscript you can use the following code:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;myTextField.restrict = &amp;#34;0-9&amp;#34;;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Embed pound symbol (£) in flash textfield</title>
      <link>https://andrewodendaal.com/embed-pound-symbol-in-flash-textfield/</link>
      <pubDate>Wed, 10 Mar 2010 13:55:36 +0000</pubDate>
      <guid>https://andrewodendaal.com/embed-pound-symbol-in-flash-textfield/</guid>
      <description>&lt;p&gt;If you use a dynamic textbox in Flash and you want to embed the British Pound symbol (£) then you will want to also embed the &amp;ldquo;Latin I&amp;rdquo; glyphs with your textfield.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Enable / Disable Cursor Hand in Actionscript 2</title>
      <link>https://andrewodendaal.com/enable-disable-cursor-hand-in-actionscript-2/</link>
      <pubDate>Mon, 01 Mar 2010 14:40:40 +0000</pubDate>
      <guid>https://andrewodendaal.com/enable-disable-cursor-hand-in-actionscript-2/</guid>
      <description>&lt;p&gt;If you have a movieclip that by default has the hand cursor showing on RollOver and you don&amp;rsquo;t really want this, you can disable it by doing the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;myMC.onRollOver = function() {&#xA;    this.useHandCursor=false;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;So the main code here is: &lt;code&gt;this.useHandCursor=false;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;False&lt;/code&gt; disables it and &lt;code&gt;true&lt;/code&gt; shows it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>USB Device Not Recognized! in Windows</title>
      <link>https://andrewodendaal.com/usb-device-not-recognized-in-windows/</link>
      <pubDate>Thu, 25 Feb 2010 09:23:59 +0000</pubDate>
      <guid>https://andrewodendaal.com/usb-device-not-recognized-in-windows/</guid>
      <description>&lt;p&gt;Believe it or not, this one is super easy to fix!&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s actually a temporary problem with your motherboard, all you need to do is:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;turn off your computer&lt;/li&gt;&#xA;&lt;li&gt;if it&amp;rsquo;s a desktop then unplug it from the wall/powersupply&lt;/li&gt;&#xA;&lt;li&gt;if it&amp;rsquo;s a laptop then remove the battery&lt;/li&gt;&#xA;&lt;li&gt;let it sit for a minute&lt;/li&gt;&#xA;&lt;li&gt;plug it all in again&lt;/li&gt;&#xA;&lt;li&gt;reboot&lt;/li&gt;&#xA;&lt;li&gt;VOILA!&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;No need to uninstall/reinstall drivers or anything!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calling event functions from movieclips in actionscript 2</title>
      <link>https://andrewodendaal.com/calling-event-functions-from-movieclips-in-actionscript-2/</link>
      <pubDate>Wed, 24 Feb 2010 17:41:03 +0000</pubDate>
      <guid>https://andrewodendaal.com/calling-event-functions-from-movieclips-in-actionscript-2/</guid>
      <description>&lt;p&gt;In a flash movie I usually have a frame of actionscript that controls all elements in the file to keep everything in one place.&lt;/p&gt;&#xA;&lt;p&gt;Sometimes I have an onPress(etc) function that refers to something happening in the scene when something is pressed, but what happens if we want another element to refer to that event for some reason?&lt;/p&gt;&#xA;&lt;p&gt;Here&amp;rsquo;s an example of that code without anything &amp;ldquo;flashy&amp;rdquo;:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;_root.myMC.onPress = function() {&#xA;  //code goes here&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;..and here&amp;rsquo;s our slightly more intersting flashy version:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sudo install OpenGL &amp; SDL on Ubuntu</title>
      <link>https://andrewodendaal.com/sudo-install-opengl-sdl-on-ubuntu/</link>
      <pubDate>Mon, 22 Feb 2010 11:57:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/sudo-install-opengl-sdl-on-ubuntu/</guid>
      <description>&lt;p&gt;A quick and easy way would be to type the following in one line with single spaces in the Terminal.&lt;br&gt;&#xA;This way of installing OpenGL and SDL libraries only applies to Ubuntu.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo apt-get install&#xA;nvidia-glx-new-dev&#xA;libglew1.4-dev&#xA;libsdl1.2-dev&#xA;libsdl-ttf2.0-dev&#xA;libsdl-image1.2-dev&#xA;libsdl-mixer1.2-dev&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How To Modify Hosts File On Windows</title>
      <link>https://andrewodendaal.com/how-to-modify-hosts-file-on-windows/</link>
      <pubDate>Fri, 19 Feb 2010 09:15:41 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-modify-hosts-file-on-windows/</guid>
      <description>&lt;p&gt;The hosts file is located at the following address:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;!-- raw HTML omitted --&gt;C:\windows\system32\drivers\etc&amp;lt;/span&amp;gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;!-- raw HTML omitted --&gt;%systemroot%\system32\drivers\etc&amp;lt;/span&amp;gt;&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;&#xA;But you will need to open Notepad with &amp;ldquo;Run as Administrator&amp;rdquo; first and then open it through there otherwise it will give a permissions problem&lt;/p&gt;</description>
    </item>
    <item>
      <title>Get all directories in PHP</title>
      <link>https://andrewodendaal.com/get-all-directories-in-php/</link>
      <pubDate>Wed, 17 Feb 2010 13:54:23 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-all-directories-in-php/</guid>
      <description>&lt;p&gt;I think this may be the fastest way to get a list of all the directories in a given folder/directory using PHP.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$directories = array_filter(glob(&amp;#39;*&amp;#39;), &amp;#39;is_dir&amp;#39;);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;..and of course, you can also add a path to it if you need to:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$directories = array_filter(glob($myPath.&amp;#39;*&amp;#39;), &amp;#39;is_dir&amp;#39;);&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Security error: securitySandboxError with Flash</title>
      <link>https://andrewodendaal.com/security-error-securitysandboxerror-with-flash/</link>
      <pubDate>Wed, 17 Feb 2010 13:12:21 +0000</pubDate>
      <guid>https://andrewodendaal.com/security-error-securitysandboxerror-with-flash/</guid>
      <description>&lt;p&gt;You have a flash uploader and you get this error:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;!-- raw HTML omitted --&gt;security error: securitySandboxError&lt;!-- raw HTML omitted --&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;This means that the flash is not trusted by the domain and you have to place an xml file in the root of the domain.&lt;/p&gt;&#xA;&lt;p&gt;The file is called &amp;ldquo;&lt;strong&gt;&lt;em&gt;&lt;!-- raw HTML omitted --&gt;crossdomain.xml&lt;!-- raw HTML omitted --&gt;&lt;/em&gt;&lt;/strong&gt;&amp;rdquo; and this is what should be inside it:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Component Inspector in Flash has ISSUES!</title>
      <link>https://andrewodendaal.com/component-inspector-in-flash-has-issues/</link>
      <pubDate>Thu, 11 Feb 2010 13:14:32 +0000</pubDate>
      <guid>https://andrewodendaal.com/component-inspector-in-flash-has-issues/</guid>
      <description>&lt;p&gt;I discovered a very annoying bug in the Flash IDE a little while ago, and it has happened to me quite a few times.&lt;/p&gt;&#xA;&lt;p&gt;Today it happened again and so I write this post..&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;While in the Flash IDE you select a component on the stage, then you click &amp;ldquo;Component Inspector&amp;rdquo;.&lt;!-- raw HTML omitted --&gt;This opens up into a modal window which is nice and everything BUT….&lt;!-- raw HTML omitted --&gt;&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;…..if you then give focus to another program and then try click back into flash, it hides the &amp;ldquo;Component Inspector&amp;rdquo; modal window but still keeps focus on it, so basically, you can&amp;rsquo;t use the program(Flash IDE) / save your file / or even close the program!&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Close/Delete Google Checkout Account</title>
      <link>https://andrewodendaal.com/closedelete-google-checkout-account/</link>
      <pubDate>Mon, 08 Feb 2010 12:46:20 +0000</pubDate>
      <guid>https://andrewodendaal.com/closedelete-google-checkout-account/</guid>
      <description>&lt;p&gt;I have used &lt;!-- raw HTML omitted --&gt;Google Checkout&lt;!-- raw HTML omitted --&gt; to receive payments in the past and have had problems with some clients not paying and blaming it on &lt;!-- raw HTML omitted --&gt;Google Checkout&lt;!-- raw HTML omitted --&gt; that the money did not go through (like the guys over at &lt;!-- raw HTML omitted --&gt;Peartree DMS&lt;!-- raw HTML omitted --&gt;).&lt;/p&gt;&#xA;&lt;p&gt;I decided that this account was not worth the trouble anymore and wanted to close my account.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Warning: mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource</title>
      <link>https://andrewodendaal.com/warning-mysql_affected_rows-supplied-argument-is-not-a-valid-mysql-link-resource/</link>
      <pubDate>Tue, 02 Feb 2010 10:54:35 +0000</pubDate>
      <guid>https://andrewodendaal.com/warning-mysql_affected_rows-supplied-argument-is-not-a-valid-mysql-link-resource/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;Warning: mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;You have just gotten a warning when trying to check if an inserted row was successful but when calling mysql_affected_rows(mysql_query(&amp;ldquo;INSERT INTO……&amp;rdquo;)) you get a warning telling you that the supplied argument is not a valid MySQL-Link resource.&lt;/p&gt;&#xA;&lt;p&gt;This is because mysql_query INSERT actually returns true or false and not a resource id.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Capitalize First Letter in Word – Actionscript 2</title>
      <link>https://andrewodendaal.com/capitalize-first-letter-in-word-actionscript-2/</link>
      <pubDate>Mon, 01 Feb 2010 15:06:09 +0000</pubDate>
      <guid>https://andrewodendaal.com/capitalize-first-letter-in-word-actionscript-2/</guid>
      <description>&lt;p&gt;You have a string and you want to capitalize the first character but have the rest of the word in lowercase.&lt;/p&gt;&#xA;&lt;p&gt;DO THIS!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;myStringVar = myStringVar.substring(0, 1).toUpperCase()+myStringVar.substring(1);&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>HP Pavilion Laptop Madness</title>
      <link>https://andrewodendaal.com/hp-pavilion-laptop-madness/</link>
      <pubDate>Thu, 28 Jan 2010 17:12:48 +0000</pubDate>
      <guid>https://andrewodendaal.com/hp-pavilion-laptop-madness/</guid>
      <description>&lt;p&gt;I have got an HP laptop and have started experiencing problems with it starting up for the past few months, it is only about 1.5years old and is supposed to be a decent one.&lt;/p&gt;&#xA;&lt;p&gt;It is an HP Pavilion dv9700 by the way..&lt;/p&gt;&#xA;&lt;p&gt;Today the damn thing just didnt want to startup and eventually after trying every trick in the book I got it to boot into Degugging Mode in Windows Vista.. What a nightmare!!!!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Why you should use OpenGL and not DirectX</title>
      <link>https://andrewodendaal.com/why-you-should-use-opengl-and-not-directx/</link>
      <pubDate>Wed, 27 Jan 2010 12:58:10 +0000</pubDate>
      <guid>https://andrewodendaal.com/why-you-should-use-opengl-and-not-directx/</guid>
      <description>&lt;p&gt;Below is a very interesting article I found that proves all the myths about DirectX being better than OpenGL, a very well written paper describing it best.&lt;/p&gt;&#xA;&lt;p&gt;Thanks for that guys at Wolfire.com!&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://blog.wolfire.com/2010/01/Why-you-should-use-OpenGL-and-not-DirectX&#34;&gt;http://blog.wolfire.com/2010/01/Why-you-should-use-OpenGL-and-not-DirectX&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>What does __FILE__ in php mean?</title>
      <link>https://andrewodendaal.com/what-does-__file__-in-php-mean/</link>
      <pubDate>Tue, 26 Jan 2010 17:04:06 +0000</pubDate>
      <guid>https://andrewodendaal.com/what-does-__file__-in-php-mean/</guid>
      <description>&lt;p&gt;In php there are a few magic constants and I find &lt;strong&gt;&lt;em&gt;&lt;!-- raw HTML omitted --&gt;&lt;strong&gt;FILE&lt;/strong&gt;&lt;!-- raw HTML omitted --&gt;&lt;/em&gt;&lt;/strong&gt; to be a very useful one.&lt;/p&gt;&#xA;&lt;p&gt;It returns the full path and filename of the file in question.&lt;/p&gt;&#xA;&lt;p&gt;Take a look at the &lt;!-- raw HTML omitted --&gt;PHP Manual – Magic Constants&lt;!-- raw HTML omitted --&gt; for more information on the others.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Woopra Failed to Connect?</title>
      <link>https://andrewodendaal.com/woopra-failed-to-connect/</link>
      <pubDate>Tue, 26 Jan 2010 13:33:22 +0000</pubDate>
      <guid>https://andrewodendaal.com/woopra-failed-to-connect/</guid>
      <description>&lt;p&gt;I have used Woopra for a few months now and have started seeing this warning/error almost everyday now:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;!-- raw HTML omitted --&gt;Could not enable live functionality at this time. Click to reconnect.&lt;!-- raw HTML omitted --&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you click the text/warning/error it seems to go away… Anybody konw what&amp;rsquo;s really going on under the cover?&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;What happened:&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Change PHP Session Time</title>
      <link>https://andrewodendaal.com/change-php-session-time/</link>
      <pubDate>Mon, 25 Jan 2010 14:28:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/change-php-session-time/</guid>
      <description>&lt;p&gt;The default time for a php session is 1440 seconds.&lt;/p&gt;&#xA;&lt;p&gt;You can change it by doing the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ini_set(&amp;#34;session.gc_maxlifetime&amp;#34;,1440);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can obviously adjust the second parameter (1440) to anything you like to change the timeout limit.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Stop mouse click in browsers</title>
      <link>https://andrewodendaal.com/stop-mouse-click-in-browsers/</link>
      <pubDate>Fri, 08 Jan 2010 17:22:01 +0000</pubDate>
      <guid>https://andrewodendaal.com/stop-mouse-click-in-browsers/</guid>
      <description>&lt;p&gt;There have been multiple ways to stop your user/s from right clicking on your site, but many of them now fail due to the way firefox&amp;rsquo;s contextual menu loads.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Below is an example of how to do it:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function _c(e) {if (document.all) {if (event.button==2||event.button==3) {return false;}} else {if (e.button==2||e.button==3) {e.preventDefault();e.stopPropagation();return false;}}if (e.which) {}}if (document.all){document.onmousedown=_c;}else{document.onclick=_c;document.ondblclick=_c;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;..and here is the full working example in a webpage:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;script&amp;gt;&amp;lt;br /&amp;gt;&#xA;function _c(e) {if (document.all) {if (event.button==2||event.button==3) {return false;}} else {if (e.button==2||e.button==3) {e.preventDefault();e.stopPropagation();return false;}}if (e.which) {}}if (document.all){document.onmousedown=_c;}else{document.onclick=_c;document.ondblclick=_c;}&amp;lt;br /&amp;gt;&#xA;&amp;lt;/script&amp;gt;&#xA;&#xA;tester&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Microsoft apps never care!</title>
      <link>https://andrewodendaal.com/microsoft-apps-never-care/</link>
      <pubDate>Fri, 08 Jan 2010 15:57:22 +0000</pubDate>
      <guid>https://andrewodendaal.com/microsoft-apps-never-care/</guid>
      <description>&lt;p&gt;I often seem to have this issue when dealing with Microsoft software.&lt;br&gt;&#xA;You click &amp;ldquo;Cancel&amp;rdquo; and it just carrys on going, so you click it again a few more times and instead of it just stopping in it&amp;rsquo;s tracks, decides to rather tell you it&amp;rsquo;s cancelling and then shows a cancelling dialog box for the next 10 minutes!&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2010/01/c_ca-vdsf.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Cummon guys, that&amp;rsquo;s not very professional!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Place HTML Div on top of Flash</title>
      <link>https://andrewodendaal.com/place-html-div-on-top-of-flash/</link>
      <pubDate>Fri, 08 Jan 2010 14:23:23 +0000</pubDate>
      <guid>https://andrewodendaal.com/place-html-div-on-top-of-flash/</guid>
      <description>&lt;p&gt;If you have ever tried to place a div or similar HTML element on top of a swf flash object you will know that it always tries to take precedence.&lt;/p&gt;&#xA;&lt;p&gt;You will need to do the following:&lt;/p&gt;&#xA;&lt;p&gt;In the code for the flash in the embed area add:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;wmode=&amp;#34;transparent&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you are using SWFObject to insert swf files you can do the following:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;script type=&amp;#34;text/javascript&amp;#34;&amp;gt;&#xA;  var so = new SWFObject(&amp;#34;movie.swf&amp;#34;, &amp;#34;mymovie&amp;#34;, &amp;#34;400&amp;#34;, &amp;#34;100%&amp;#34;, &amp;#34;8&amp;#34;, &amp;#34;#336699&amp;#34;);&#xA;  so.addParam(&amp;#34;wmode&amp;#34;, &amp;#34;transparent&amp;#34;);&#xA;  so.write(&amp;#34;flashcontent&amp;#34;);&#xA;&amp;lt;/script&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Get current working directory of php script/application</title>
      <link>https://andrewodendaal.com/get-current-working-directory-of-php-scriptapplication/</link>
      <pubDate>Fri, 08 Jan 2010 14:13:59 +0000</pubDate>
      <guid>https://andrewodendaal.com/get-current-working-directory-of-php-scriptapplication/</guid>
      <description>&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$myPath = realpath(dirname(__FILE__));&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;or&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$myPath = getcwd();&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Stage align and Stage scale in actionscript 3</title>
      <link>https://andrewodendaal.com/stage-align-and-stage-scale-in-actionscript-3/</link>
      <pubDate>Fri, 08 Jan 2010 12:09:18 +0000</pubDate>
      <guid>https://andrewodendaal.com/stage-align-and-stage-scale-in-actionscript-3/</guid>
      <description>&lt;p&gt;If you want to position the flash top/left and not have it scale when you resize it&amp;rsquo;s bounding box window, you can set the following code.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;stage.align = StageAlign.TOP_LEFT;&#xA;stage.scaleMode = StageScaleMode.NO_SCALE;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For full documentation from Adobe &lt;!-- raw HTML omitted --&gt;take a look here&lt;!-- raw HTML omitted --&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Error 406?</title>
      <link>https://andrewodendaal.com/error-406/</link>
      <pubDate>Wed, 06 Jan 2010 17:53:41 +0000</pubDate>
      <guid>https://andrewodendaal.com/error-406/</guid>
      <description>&lt;p&gt;So you received an error 406 while trying to upload a file and you have no idea to fix it!&lt;/p&gt;&#xA;&lt;p&gt;Create an &lt;em&gt;&lt;code&gt;.htaccess&lt;/code&gt;&lt;/em&gt; file in the root of your local website and add the following into it:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;IfModule mod_security.c&amp;gt;&#xA;SecFilterEngine Off&#xA;SecFilterScanPOST Off&#xA;&amp;lt;/IfModule&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Firefox error in FeedProcessor.js</title>
      <link>https://andrewodendaal.com/firefox-error-in-feedprocessor-js/</link>
      <pubDate>Wed, 06 Jan 2010 12:30:18 +0000</pubDate>
      <guid>https://andrewodendaal.com/firefox-error-in-feedprocessor-js/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;[Exception… &amp;ldquo;Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIChannel.contentType]&amp;rdquo; nsresult: &amp;ldquo;0x80040111 (NS_ERROR_NOT_AVAILABLE)&amp;rdquo; location: &amp;ldquo;JS frame :: file:///C:/Program%20Files/Mozilla%20Firefox/components/FeedProcessor.js :: FP_onStartRequest :: line 1440&amp;rdquo; data: no]&lt;!-- raw HTML omitted --&gt;file:///C:/Program%20Files/Mozilla%20Firefox/components/FeedProcessor.js&lt;!-- raw HTML omitted --&gt;Line 1440&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;So what the heck does that all mean?&lt;/strong&gt;&lt;br&gt;&#xA;Basically, there is an exception error on like 1440 of the local Firefox javascript file &amp;ldquo;FeedProcessor.js&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The line in question is as follows:&lt;/strong&gt;&lt;br&gt;&#xA;channel.contentType = &amp;ldquo;application/vnd.mozilla.maybe.feed&amp;rdquo;;&lt;br&gt;&#xA;&lt;strong&gt;The whole section of code reads as follows:&lt;/strong&gt;&lt;br&gt;&#xA;// nsIStreamListener&lt;/p&gt;</description>
    </item>
    <item>
      <title>mySQL select multiple ids</title>
      <link>https://andrewodendaal.com/mysql-select-multiple-ids/</link>
      <pubDate>Fri, 18 Dec 2009 12:44:51 +0000</pubDate>
      <guid>https://andrewodendaal.com/mysql-select-multiple-ids/</guid>
      <description>&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SELECT * FROM tablename WHERE `active`=&amp;#39;1&amp;#39; AND `id` IN (&amp;#39;107&amp;#39; , &amp;#39;125&amp;#39; ) ORDER BY `id` DESC LIMIT 12`&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Force Download in PHP</title>
      <link>https://andrewodendaal.com/force-download-in-php/</link>
      <pubDate>Wed, 16 Dec 2009 18:00:30 +0000</pubDate>
      <guid>https://andrewodendaal.com/force-download-in-php/</guid>
      <description>&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;This script works in all browsers, including Internet Explorer! 🙂&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;if (strstr($_SERVER[&amp;#39;HTTP_USER_AGENT&amp;#39;],&amp;#34;MSIE&amp;#34;)) {&#xA;  header(&amp;#34;Pragma: public&amp;#34;);&#xA;  header(&amp;#34;Expires: 0&amp;#34;);&#xA;  header(&amp;#34;Cache-Control: must-revalidate, post-check=0, pre-check=0&amp;#34;);&#xA;  header(&amp;#34;Cache-Control: private&amp;#34;,false);&#xA;  header(&amp;#34;Content-Type: application-download&amp;#34;);&#xA;  header(&amp;#34;Content-Disposition: attachment; filename=\&amp;#34;&amp;#34;.basename($filename).&amp;#34;\&amp;#34;;&amp;#34;);&#xA;  header(&amp;#34;Content-Transfer-Encoding: binary&amp;#34;);&#xA;  header(&amp;#34;Content-Length: &amp;#34;.@filesize($ab_file));&#xA;  set_time_limit(0);&#xA;} else {&#xA;  header(&amp;#34;Content-type: application-download&amp;#34;);&#xA;  header(&amp;#34;Content-Length: &amp;#34;.filesize($ab_file));&#xA;  header(&amp;#34;Content-Disposition attachment; filename=&amp;#34;.$filename);&#xA;}&#xA;readfile($ab_file);&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Remove an onRelease Handler</title>
      <link>https://andrewodendaal.com/remove-an-onrelease-handler/</link>
      <pubDate>Wed, 16 Dec 2009 13:07:05 +0000</pubDate>
      <guid>https://andrewodendaal.com/remove-an-onrelease-handler/</guid>
      <description>&lt;p&gt;After creating a onRelease handler in Actionscript 2 as follows:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;myMovieClip.onRelease = function() { doWhatever(); }&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;..you then want to remove the handler for whatever reason, you can remove it like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;delete myMovieClip.onRelease;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>shortText function toggler in php</title>
      <link>https://andrewodendaal.com/shorttext-function-toggler-in-php/</link>
      <pubDate>Tue, 15 Dec 2009 13:49:33 +0000</pubDate>
      <guid>https://andrewodendaal.com/shorttext-function-toggler-in-php/</guid>
      <description>&lt;p&gt;I often have to show a shortened version of a news item and then a link to show the entire news article or whatever.&lt;/p&gt;&#xA;&lt;p&gt;Here&amp;rsquo;s a way to get that short text!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function shortText($text, $length) {&#xA;  if( strlen($text) &amp;gt; $length ) return substr(preg_replace(&amp;#34;/(&amp;lt;\/?)(\w+)([^&amp;gt;]*&amp;gt;)/&amp;#34;, &amp;#34;&amp;#34;, $text), 0, $length).&amp;#34;?&amp;#34;;&#xA;  return preg_replace(&amp;#34;/(&amp;lt;\/?)(\w+)([^&amp;gt;]*&amp;gt;)/&amp;#34;, &amp;#34;&amp;#34;, $text);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>PHP – file() lines</title>
      <link>https://andrewodendaal.com/php-file-lines/</link>
      <pubDate>Tue, 15 Dec 2009 11:22:24 +0000</pubDate>
      <guid>https://andrewodendaal.com/php-file-lines/</guid>
      <description>&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$lines = file(&amp;#39;all-words.txt&amp;#39;);&#xA;foreach ($lines as $line_num =&amp;gt; $line) {&#xA;  echo &amp;#34;Line number &amp;#34;.$line_num;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Windows Live Writer – Beta2</title>
      <link>https://andrewodendaal.com/windows-live-writer-beta2/</link>
      <pubDate>Mon, 14 Dec 2009 12:56:17 +0000</pubDate>
      <guid>https://andrewodendaal.com/windows-live-writer-beta2/</guid>
      <description>&lt;p&gt;Start writing content to your blogs from your Windows Desktop now.&lt;/p&gt;&#xA;&lt;p&gt;No need to login to your wordpress backend to post items anymore, there is now a decent desktop application that allows you to do exactly that!&lt;/p&gt;&#xA;&lt;p&gt;I have looked at it before but not until recently when Beta2 came out did I gain more interest for it.&lt;/p&gt;&#xA;&lt;p&gt;The WordPress functionality added is what got me going and now I am able to post directly! Excellent 🙂&lt;/p&gt;</description>
    </item>
    <item>
      <title>Reported Attack Site!</title>
      <link>https://andrewodendaal.com/reported-attack-site/</link>
      <pubDate>Fri, 11 Dec 2009 10:35:28 +0000</pubDate>
      <guid>https://andrewodendaal.com/reported-attack-site/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2009/12/r3p0r733d.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;What the heck is that?&lt;/p&gt;&#xA;&lt;p&gt;So you&amp;rsquo;ve just visited a website using Mozilla Firefox and this message has popped up telling you that the site looks suspicious.&lt;/p&gt;&#xA;&lt;p&gt;Usually the site has been marked as a possible virus containing website and Firefox will show you this message attempting to protect itself against Malware, Spyware or other forms of Viruses.&lt;/p&gt;&#xA;&lt;p&gt;There are occasions when this is mearly a warning and not to be taken as concrete evidence of viruses or impending browser/computer doom!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Simple HEX Colour Values</title>
      <link>https://andrewodendaal.com/simple-hex-colour-values/</link>
      <pubDate>Thu, 10 Dec 2009 17:25:54 +0000</pubDate>
      <guid>https://andrewodendaal.com/simple-hex-colour-values/</guid>
      <description>&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;Actual Display Colour&lt;/th&gt;&#xA;          &lt;th&gt;HEX Colour&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;#000000&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;#FF0000&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;#00FF00&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;#0000FF&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;#FFFF00&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;#00FFFF&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;#FF00FF&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;#C0C0C0&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;&#xA;          &lt;td&gt;#FFFFFF&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;</description>
    </item>
    <item>
      <title>Send Email PHP Function</title>
      <link>https://andrewodendaal.com/send-email-php-function/</link>
      <pubDate>Thu, 10 Dec 2009 17:07:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/send-email-php-function/</guid>
      <description>&lt;p&gt;Ever find yourself typing the headers into the &lt;code&gt;php&lt;/code&gt; &lt;code&gt;mail()&lt;/code&gt; function over and over again?&lt;/p&gt;&#xA;&lt;p&gt;Try using a standard function and calling it when you need to send mail.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function sendEmail($subject,$content,$from,$to){&#xA;  $header = &amp;#34;Content-Type: text/html; charset=iso-8859-1\nFrom:$from&amp;#34;;&#xA;  if( mail($to, $subject, $content, $header) );&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>mySQL Development Tools</title>
      <link>https://andrewodendaal.com/mysql-development-tools/</link>
      <pubDate>Wed, 09 Dec 2009 11:40:55 +0000</pubDate>
      <guid>https://andrewodendaal.com/mysql-development-tools/</guid>
      <description>&lt;p&gt;I came across a very interesting article about mySQL Development Tools.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.smashingmagazine.com/2009/03/25/mysql-admin-and-development-tools-round-up/&#34; title=&#34;Opens in New Tab/Window&#34;&gt;http://www.smashingmagazine.com/2009/03/25/mysql-admin-and-development-tools-round-up/&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>1180: Call to a possibly undefined method getURL. Actionscript 3</title>
      <link>https://andrewodendaal.com/1180-call-to-a-possibly-undefined-method-geturl-actionscript-3/</link>
      <pubDate>Mon, 07 Dec 2009 12:05:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/1180-call-to-a-possibly-undefined-method-geturl-actionscript-3/</guid>
      <description>&lt;p&gt;Hello all actionscripters, you can&amp;rsquo;t use getURL anymore in Actionscript 3.&lt;/p&gt;&#xA;&lt;p&gt;Below is how you should now start doing it:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var request:URLRequest = new URLRequest(&amp;#34;/&amp;#34;);&#xA;try { navigateToURL(request, &amp;#39;_blank&amp;#39;);}&#xA;catch (e:Error) { trace(&amp;#34;Error occurred!&amp;#34;);}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Online Flash IDE Anybody?</title>
      <link>https://andrewodendaal.com/online-flash-ide-anybody/</link>
      <pubDate>Thu, 03 Dec 2009 17:44:38 +0000</pubDate>
      <guid>https://andrewodendaal.com/online-flash-ide-anybody/</guid>
      <description>&lt;p&gt;Anyone up for an online Flash IDE?&lt;/p&gt;&#xA;&lt;p&gt;Take a look at this:&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://antimatter15.com/ajaxanimator/build/&#34;&gt;http://antimatter15.com/ajaxanimator/build/&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;Nice work!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Papervision Event Listener Idea</title>
      <link>https://andrewodendaal.com/papervision-event-listener-idea/</link>
      <pubDate>Thu, 03 Dec 2009 10:12:11 +0000</pubDate>
      <guid>https://andrewodendaal.com/papervision-event-listener-idea/</guid>
      <description>&lt;p&gt;&lt;strong&gt;The problem:&lt;/strong&gt;&lt;br&gt;&#xA;While working on a &lt;!-- raw HTML omitted --&gt;Papervision3D&lt;!-- raw HTML omitted --&gt; Flash Project I had a problem where a back button that sits above the 3d canvas and acts as a main navigational item was required to change Events according to where the site was in 3d space at the time.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The solution:&lt;/strong&gt;&lt;br&gt;&#xA;Everytime I&amp;rsquo;m about to add a new EventListener to the back button movieclip I call the function &amp;ldquo;delBB()&amp;rdquo; and then add my event listener using addBB(with the event here).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Don’t cache my swf files!</title>
      <link>https://andrewodendaal.com/dont-cache-my-swf-files/</link>
      <pubDate>Wed, 02 Dec 2009 16:38:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/dont-cache-my-swf-files/</guid>
      <description>&lt;p&gt;I often have issues where ‘dumb browsers&amp;rsquo; cache my published swf files and when they dynamically populate they don&amp;rsquo;t always update.&lt;/p&gt;&#xA;&lt;p&gt;This is SUPER annoying and I have found a solution.&lt;/p&gt;&#xA;&lt;p&gt;I will demonstrate the technique with a LoadsVars example&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var nc = Math.floor(random(1000000) / random(1000));&#xA;var send_lv:LoadVars = new LoadVars();&#xA;send_lv.sendAndLoad(_root.siteURL+&amp;#34;profile.php?action=showallimages&amp;amp;amp;nc=&amp;#34;+nc, result_lv, &amp;#34;POST&amp;#34;);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;So let me describe what is happening here.&lt;/p&gt;&#xA;&lt;p&gt;The really ‘dumb browsers&amp;rsquo; like IE7 in this case decide that seeing as the URL in question has the exact same name, it will be clever and just use the last version it saw and be totally lazy and not attempt to get the data again. But the really stupid part about this is that most of the time the results are DYNAMIC and will always return a different result.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Clear an array in Actionscript 3</title>
      <link>https://andrewodendaal.com/clear-an-array-in-actionscript-3/</link>
      <pubDate>Wed, 02 Dec 2009 11:12:07 +0000</pubDate>
      <guid>https://andrewodendaal.com/clear-an-array-in-actionscript-3/</guid>
      <description>&lt;p&gt;I personally really like this way of clearing an array&amp;rsquo;s elements:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Declare your array to use:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var myArray:Array=new Array();&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Add elements:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;for (var i:Number;i&amp;lt;10;i++) {&#xA;  myArray[i] = &amp;#34;an item&amp;#34;;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Clear the array:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Change combobox font size in Flash Actionscript</title>
      <link>https://andrewodendaal.com/change-combobox-font-size-in-flash-actionscript/</link>
      <pubDate>Mon, 30 Nov 2009 11:05:54 +0000</pubDate>
      <guid>https://andrewodendaal.com/change-combobox-font-size-in-flash-actionscript/</guid>
      <description>&lt;p&gt;Ever needed to change the font size of a standard flash combobox component?&lt;/p&gt;&#xA;&lt;p&gt;You will need to give it an instance name e.g. &amp;ldquo;myCombobox&amp;rdquo; and then add the following code:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;myCombobox.setStyle(&amp;#34;fontSize&amp;#34;, 10);&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Wordwrap that PRE!</title>
      <link>https://andrewodendaal.com/wordwrap-that-pre/</link>
      <pubDate>Mon, 23 Nov 2009 16:00:00 +0000</pubDate>
      <guid>https://andrewodendaal.com/wordwrap-that-pre/</guid>
      <description>&lt;p&gt;Ever used a &lt;code&gt;&amp;lt;PRE&amp;gt;&lt;/code&gt; in a limited width div container? You will notice that the line gets cut off almost as if word-wrap was not enabled.&lt;/p&gt;&#xA;&lt;p&gt;To correct this you can add the following code into your CSS file.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;pre{&#xA;  white-space: pre-wrap; /* CSS2.1 compliant */&#xA;  white-space: -moz-pre-wrap; /* Mozilla-based browsers */&#xA;  white-space: o-pre-wrap; /* Opera 7+ */&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This code was originally found somewhere else online but I found it really useful so reposted it!&lt;br&gt;&#xA;If you&amp;rsquo;re the original author then comment and let us know 🙂&lt;/p&gt;</description>
    </item>
    <item>
      <title>Barclays ePDQ Payment Gateway</title>
      <link>https://andrewodendaal.com/barclays-epdq-payment-gateway/</link>
      <pubDate>Mon, 23 Nov 2009 15:32:25 +0000</pubDate>
      <guid>https://andrewodendaal.com/barclays-epdq-payment-gateway/</guid>
      <description>&lt;p&gt;Hello all!&lt;/p&gt;&#xA;&lt;p&gt;Today we will be talking about Barclays online payment gateway valled ePDQ.&lt;br&gt;&#xA;You can take a look at what they have got to say by &lt;!-- raw HTML omitted --&gt;clicking here to view Barclays&amp;rsquo; site&lt;!-- raw HTML omitted --&gt; or you could keep reading 🙂&lt;br&gt;&#xA;Well, for all you php guys out there, this post if for you!&lt;/p&gt;&#xA;&lt;p&gt;Barclays ePDQ encrypts your data string of products in your basket and returns a result that is sent with your HTML form on your site.&lt;/p&gt;</description>
    </item>
    <item>
      <title>BrainWHAT? programming language</title>
      <link>https://andrewodendaal.com/brainwhat-programming-language/</link>
      <pubDate>Mon, 23 Nov 2009 15:05:45 +0000</pubDate>
      <guid>https://andrewodendaal.com/brainwhat-programming-language/</guid>
      <description>&lt;p&gt;I came across a programming language today that I have never heard of. Go take a look over here:&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://en.wikipedia.org/wiki/Brainfuck&#34;&gt;http://en.wikipedia.org/wiki/Brainfuck&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Transparent swf in html</title>
      <link>https://andrewodendaal.com/transparent-swf-in-html/</link>
      <pubDate>Mon, 23 Nov 2009 14:10:59 +0000</pubDate>
      <guid>https://andrewodendaal.com/transparent-swf-in-html/</guid>
      <description>&lt;p&gt;So you have now placed a swf file into your html page and you want to be able to see through it.&lt;/p&gt;&#xA;&lt;p&gt;Lucky for you, this is a very easy thing to do!&lt;/p&gt;&#xA;&lt;p&gt;The following code does the trick:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;object data=&amp;#34;flash/home_side_left.swf&amp;#34; type=&amp;#34;application/x-shockwave-flash&amp;#34; width=&amp;#34;40px&amp;#34; height=&amp;#34;550px&amp;#34;&amp;gt;&amp;lt;param name=&amp;#34;movie&amp;#34; value=&amp;#34;flash/home_side_left.swf&amp;#34; /&amp;gt;&amp;lt;param name=&amp;#34;bgcolor&amp;#34; value=&amp;#34;#ffffff&amp;#34; /&amp;gt;&amp;lt;param name=&amp;#34;wmode&amp;#34; value=&amp;#34;transparent&amp;#34; /&amp;gt;&amp;lt;param name=&amp;#34;allowScriptAccess&amp;#34; value=&amp;#34;always&amp;#34; /&amp;gt;&amp;lt;/object&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Notice that by just adding the &lt;code&gt;wmode&lt;/code&gt; and setting it as ‘transparent&amp;rsquo; does everything for you!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Constant updates?</title>
      <link>https://andrewodendaal.com/constant-updates/</link>
      <pubDate>Fri, 13 Nov 2009 10:29:19 +0000</pubDate>
      <guid>https://andrewodendaal.com/constant-updates/</guid>
      <description>&lt;p&gt;I just hate it how everything always wants to update… and then restart all the damn time!&lt;/p&gt;&#xA;&lt;p&gt;First things first:&lt;/p&gt;&#xA;&lt;p&gt;This pops up telling me it&amp;rsquo;s doing a 309.6MB Adobe Reader Update! Which to me is just crazy… Surely the constant updates shouldn&amp;rsquo;t be a million times larger than the actual initial install file for the application?&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2009/11/adobeupdater1.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;I just click Cancel and then do this..&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2009/11/adobeupdater2.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Not a minute later and this little guy pops up!&lt;br&gt;&#xA;Will it ever end????&lt;/p&gt;</description>
    </item>
    <item>
      <title>Share the mouse and keyboard!</title>
      <link>https://andrewodendaal.com/share-the-mouse-and-keyboard/</link>
      <pubDate>Fri, 13 Nov 2009 10:23:42 +0000</pubDate>
      <guid>https://andrewodendaal.com/share-the-mouse-and-keyboard/</guid>
      <description>&lt;p&gt;A very interesting project I found this morning, take a look at this one!&lt;br&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://synergy2.sourceforge.net/&#34;&gt;http://synergy2.sourceforge.net/&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>What is CWS&gt;&#43;?</title>
      <link>https://andrewodendaal.com/what-is-cws/</link>
      <pubDate>Thu, 12 Nov 2009 17:25:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/what-is-cws/</guid>
      <description>&lt;p&gt;So what the heck kind of file starts with the characters &amp;ldquo;CWS&amp;gt;+&amp;rdquo; ?&lt;/p&gt;&#xA;&lt;p&gt;That would be a flash swf file!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Papervision error 1046</title>
      <link>https://andrewodendaal.com/papervision-error-1046/</link>
      <pubDate>Thu, 05 Nov 2009 10:51:32 +0000</pubDate>
      <guid>https://andrewodendaal.com/papervision-error-1046/</guid>
      <description>&lt;p&gt;Error: &amp;ldquo;1046: Type was not found or was not a compile-time constant: InteractiveScene3DEvent.&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;I got this this morning when I opened up a project I have been working on. I was using the Flash IDE to compile and FlashDevelop to code in as I am not the biggest fan of the Flash IDE for coding in….. Who is? Right?&lt;/p&gt;&#xA;&lt;p&gt;Anyways… I tried to publish my swf and I got loads of errors like the one above. So after looking into what was going on I discovered that half of my papervision classes were missing! How the heck that happened I have no idea, as I store them per project basis and not as one standard import.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Save a Dreamweaver document as UTF8!</title>
      <link>https://andrewodendaal.com/how-to-save-a-dreamweaver-document-as-utf8/</link>
      <pubDate>Wed, 04 Nov 2009 10:48:12 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-save-a-dreamweaver-document-as-utf8/</guid>
      <description>&lt;p&gt;Today I tried to save arabic text inside a javascript file and on saving encountered a dialog box asking me to first convert the document to UTF8.&lt;/p&gt;&#xA;&lt;p&gt;Why it didnt just do it for me I&amp;rsquo;ll never know, so I had to do it myself.&lt;/p&gt;&#xA;&lt;p&gt;If you encounter this then do the following to convert the document:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Click on the Modify main menu item and select Page Properties.&lt;/li&gt;&#xA;&lt;li&gt;Change the Encoding/Document Encoding dropdown to say &amp;ldquo;Unicode (UTF-8)&amp;rdquo; or &amp;ldquo;Unicode 4.0 (UTF-8)&amp;rdquo;&lt;/li&gt;&#xA;&lt;li&gt;Click OK&lt;/li&gt;&#xA;&lt;li&gt;Save the document&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>16000 Limit!</title>
      <link>https://andrewodendaal.com/16000-limit/</link>
      <pubDate>Tue, 03 Nov 2009 12:20:15 +0000</pubDate>
      <guid>https://andrewodendaal.com/16000-limit/</guid>
      <description>&lt;p&gt;Today I discovered that Flash truly has a limit!&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;Take a look at the adobe knowledge base for more information…&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://kb2.adobe.com/cps/144/tn_14437.html&#34;&gt;http://kb2.adobe.com/cps/144/tn_14437.html&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>htaccess ErrorDocument</title>
      <link>https://andrewodendaal.com/htaccess-errordocument/</link>
      <pubDate>Mon, 02 Nov 2009 16:53:37 +0000</pubDate>
      <guid>https://andrewodendaal.com/htaccess-errordocument/</guid>
      <description>&lt;p&gt;Create a file called .htaccess in the root of your &lt;code&gt;public_html/htdocs&lt;/code&gt; of your domain.&lt;/p&gt;&#xA;&lt;p&gt;Inside add the following text:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Options +FollowSymLinks&#xA;AddDefaultCharset UTF-8&#xA;RewriteEngine on&#xA;Options +FollowSymLinks&#xA;AddDefaultCharset UTF-8&#xA;RewriteEngine on&#xA;&#xA;ErrorDocument 404 /index.php&#xA;ErrorDocument 301 /index.php&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;With the &lt;code&gt;index.php&lt;/code&gt; files being the pages that get redirected to.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to correctly form HTML</title>
      <link>https://andrewodendaal.com/how-to-correctly-form-html/</link>
      <pubDate>Mon, 02 Nov 2009 16:49:57 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-correctly-form-html/</guid>
      <description>&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;!DOCTYPE html PUBLIC ?-//W3C//DTD XHTML 1.0 Strict//EN? ?http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd?&amp;gt;&#xA;&amp;lt;html xmlns=?http://www.w3.org/1999/xhtml?&amp;gt;&#xA; &amp;lt;head&amp;gt;&#xA; &amp;lt;meta http-equiv=?Content-Type? content=?text/html; charset=UTF-8? /&amp;gt;&#xA; &amp;lt;script type=?text/javascript? src=?javascript/javascriptfilename.js?&amp;gt;&amp;lt;/script&amp;gt;&#xA; &amp;lt;title&amp;gt;Title goes here&amp;lt;/title&amp;gt;&#xA; &amp;lt;link href=?stylesheetname.css? rel=?stylesheet? type=?text/css? /&amp;gt;&#xA; &amp;lt;/head&amp;gt;&#xA; &amp;lt;body&amp;gt;&#xA; Page content goes here&#xA; &amp;lt;/body&amp;gt;&#xA;&amp;lt;/html&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Trying to get variables into flash from the browser!</title>
      <link>https://andrewodendaal.com/trying-to-get-variables-into-flash-from-the-browser/</link>
      <pubDate>Mon, 02 Nov 2009 16:40:21 +0000</pubDate>
      <guid>https://andrewodendaal.com/trying-to-get-variables-into-flash-from-the-browser/</guid>
      <description>&lt;p&gt;Ever wondered how to get variables from an html page to a flash element?&lt;/p&gt;&#xA;&lt;p&gt;Well, it&amp;rsquo;s quite easy using the following actionscript 2 example:&lt;/p&gt;&#xA;&lt;p&gt;I use javascript to embed my flash elements:&lt;br&gt;&#xA;_&lt;br&gt;&#xA;&lt;code&gt;&amp;lt;embed src=&amp;quot;somefilename.swf?varname=varvalue&amp;amp;vartwo=var2value&amp;quot; width=&amp;quot;550&amp;quot; height=&amp;quot;400&amp;quot;&amp;gt;&amp;lt;/embed&amp;gt;&lt;/code&gt;_&lt;/p&gt;&#xA;&lt;p&gt;Now in Flash I can just call:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;_root.varname and it will give us `varvalue`&#xA;_root.vartwo will give us `var2value`&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Wasn&amp;rsquo;t that easy?&lt;/p&gt;</description>
    </item>
    <item>
      <title>Flash Tweening</title>
      <link>https://andrewodendaal.com/flash-tweening/</link>
      <pubDate>Tue, 20 Oct 2009 21:37:58 +0000</pubDate>
      <guid>https://andrewodendaal.com/flash-tweening/</guid>
      <description>&lt;p&gt;tween is an actionscript class and can be used after importing the core files.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import mx.transitions.Tween;&#xA;import mx.transitions.easing.*;&#xA;//Tween( obj:Object, prop:String, func:Function, begin:Number, finish:Number, duration:Number, useSeconds:Boolean);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;e.g.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var myRot:Tween = new Tween(myText, &amp;#34;_rotation&amp;#34;, Elastic.easeOut, 0, 360, 3, true);&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Cube Desktop on Ubuntu</title>
      <link>https://andrewodendaal.com/cube-desktop-on-ubuntu/</link>
      <pubDate>Tue, 20 Oct 2009 21:37:33 +0000</pubDate>
      <guid>https://andrewodendaal.com/cube-desktop-on-ubuntu/</guid>
      <description>&lt;p&gt;Alright, so I run Ubuntu 7.10 and use the Desktop Effects via compviz, anyhow, I could get the 2d workspace but really wanted the 3d cube, even if I set up 4 desktops, it would still only show 2 sides of the cube(aka not a cube).&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The solution is:&lt;/strong&gt; In Terminal do: &lt;code&gt;gconftool-2 --type int --set /apps/compiz/general/screen0/options/hsize 4&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;😉&lt;/p&gt;</description>
    </item>
    <item>
      <title>Animate with Actionscript [part1]</title>
      <link>https://andrewodendaal.com/animate-with-actionscript-part1/</link>
      <pubDate>Tue, 20 Oct 2009 21:37:03 +0000</pubDate>
      <guid>https://andrewodendaal.com/animate-with-actionscript-part1/</guid>
      <description>&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;// Created by Andrew Odendaal&#xA;//&#xA;// :: DESCRIPTION ::&#xA;// Animate a ball moving to the top&#xA;// of the screen/stage and back again&#xA;//&#xA;// :: HOW TO USE ::&#xA;// create a circle shape, convert to a movieclip(mc) and&#xA;// place the registration point at the bottom center.&#xA;// give the circle mc an stage instance name of &amp;#39;ball&amp;#39;.&#xA;&#xA;var ball:MovieClip;&#xA;var initBallY:Number = _root.ball._y;&#xA;&#xA;onEnterFrame = function() {&#xA;  if (_root.ball._y &amp;lt; 2.31) {&#xA;    _root.ball._y = initBallY;&#xA;  } else {&#xA;    _root.ball._y=_root.ball._y-10;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Kill Adobe Updater</title>
      <link>https://andrewodendaal.com/kill-adobe-updater/</link>
      <pubDate>Tue, 20 Oct 2009 21:35:42 +0000</pubDate>
      <guid>https://andrewodendaal.com/kill-adobe-updater/</guid>
      <description>&lt;p&gt;So adobe updater keeps doing updates eventhough you&amp;rsquo;ve said ‘NEVER DO IT AGAIN!!!&amp;rsquo;.&lt;br&gt;&#xA;The fix is to physically remove the dir with the info in.&lt;br&gt;&#xA;On a windows system go to ‘c:\program files\common files\adobe&#39;, there is a nasty little folder called UPDATER5 in there that you can DELETE!&lt;br&gt;&#xA;PROBLEM SOLVED 😉&lt;/p&gt;</description>
    </item>
    <item>
      <title>Apache Cannot be Run. Another web server is using the web port or port is blocked by firewall.</title>
      <link>https://andrewodendaal.com/apache-cannot-be-run-another-web-server-is-using-the-web-port-or-port-is-blocked-by-firewall/</link>
      <pubDate>Tue, 20 Oct 2009 21:35:04 +0000</pubDate>
      <guid>https://andrewodendaal.com/apache-cannot-be-run-another-web-server-is-using-the-web-port-or-port-is-blocked-by-firewall/</guid>
      <description>&lt;p&gt;Tried to start EasyPHP: &amp;ldquo;Apache Cannot be Run. Another web server is using the web port or port is blocked by firewall.&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;I was running Skype! And it was blocking the using the port.&lt;br&gt;&#xA;Check in options-&amp;gt;advanced-&amp;gt;connection for the setting on port 80.&lt;/p&gt;&#xA;&lt;p&gt;Another way to stop this from happening and solve the problem quicker is to go into the &amp;ldquo;Configuration-&amp;gt;EasyPHP&amp;rdquo; [Ctrl+E] and make sure that the &amp;ldquo;Check server&amp;rsquo;s TCP port before starting&amp;rdquo; checkbox is not checked. This forces apache to just start and seems to work just as well!&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to load xml into flash using actionscript 2</title>
      <link>https://andrewodendaal.com/how-to-load-xml-into-flash-using-actionscript-2/</link>
      <pubDate>Tue, 20 Oct 2009 21:33:38 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-load-xml-into-flash-using-actionscript-2/</guid>
      <description>&lt;p&gt;Create an xml object:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var myXmlObject = new XML();&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Perform action when xml file has been loaded:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;myXmlObject.onLoad = function(success) {&#xA;  if (success) trace(&amp;#34;XML File has been read.&amp;#34;);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Load the xml file into the object:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;myXmlObject.load(&amp;#34;myXmlFile.xml&amp;#34;);&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>TypeError: node is null message=node is null</title>
      <link>https://andrewodendaal.com/typeerror-node-is-null-messagenode-is-null/</link>
      <pubDate>Tue, 20 Oct 2009 21:33:01 +0000</pubDate>
      <guid>https://andrewodendaal.com/typeerror-node-is-null-messagenode-is-null/</guid>
      <description>&lt;p&gt;The following error message occurs in Firefox 3 when using Firebug.&lt;br&gt;&#xA;&lt;strong&gt;TypeError: node is null message=node is null&lt;/strong&gt;&lt;br&gt;&#xA;The error can be tracked back to script tags being in the head of the document instead of where they&amp;rsquo;re needed, an example would be with the ShareThis control/component that is often added to blogs and etc.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cant start your browser?</title>
      <link>https://andrewodendaal.com/cant-start-your-browser/</link>
      <pubDate>Tue, 20 Oct 2009 21:32:24 +0000</pubDate>
      <guid>https://andrewodendaal.com/cant-start-your-browser/</guid>
      <description>&lt;p&gt;Cant start your browser?&lt;br&gt;&#xA;Try checking if any torrent apps are running.. Close them and retry.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Temporarily Edit the Text of Any Website</title>
      <link>https://andrewodendaal.com/how-to-temporarily-edit-the-text-of-any-website/</link>
      <pubDate>Tue, 20 Oct 2009 21:31:38 +0000</pubDate>
      <guid>https://andrewodendaal.com/how-to-temporarily-edit-the-text-of-any-website/</guid>
      <description>&lt;p&gt;Have you ever wanted to temporarily edit a webpage displayed in Chrome or another browser?&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-it-works&#34;&gt;How it works&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s take a look at the Google homepage quickly.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2020/01/image.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Now, after we apply our little &amp;ldquo;page hack&amp;rdquo;, let&amp;rsquo;s look at it again!&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://andrewodendaal.com/images/postimages/2020/01/image-1.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-to-temporarily-edit-a-webpage&#34;&gt;How to temporarily edit a webpage&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Go to a website of your choice that you would like to edit.&lt;/li&gt;&#xA;&lt;li&gt;Enter the following javascript into the address bar:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;em&gt;&lt;code&gt;javascript:document.body.contentEditable=&amp;quot;true&amp;quot;; document.designMode=&amp;quot;on&amp;quot;; void 0&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>PHP __autoload function</title>
      <link>https://andrewodendaal.com/php-__autoload-function/</link>
      <pubDate>Tue, 20 Oct 2009 21:30:51 +0000</pubDate>
      <guid>https://andrewodendaal.com/php-__autoload-function/</guid>
      <description>&lt;p&gt;When PHP encounters a class that hasn&amp;rsquo;t been defined yet, you can use __autoload to automatically add them instead of including masses of included at the top of your files.&lt;/p&gt;&#xA;&lt;p&gt;e.g.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function __autoload($class_name) {&#xA;  require_once $class_name . &amp;#39;.php&amp;#39;;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>IE6 on Vista?</title>
      <link>https://andrewodendaal.com/ie6-on-vista/</link>
      <pubDate>Tue, 20 Oct 2009 21:30:02 +0000</pubDate>
      <guid>https://andrewodendaal.com/ie6-on-vista/</guid>
      <description>&lt;p&gt;I find myself constantly fighting the microsoft battle of making things work in their browsers (thanks guys).&lt;/p&gt;&#xA;&lt;p&gt;On one of my machines I have Vista installed and needed to test a newly created site that apparently had some issues under Internet Explorer 6.&lt;/p&gt;&#xA;&lt;p&gt;HOWEVER, to my horror IE6 was unable to run on Vista. Once again, thanks Microsoft for making life difficult for everyone out there!&lt;/p&gt;&#xA;&lt;p&gt;After much grief, pain and agony with a million attempts to get it to run I stumbled upon a really great tool called IETester made by DebugBar.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Guillotine-Bug? Bug</title>
      <link>https://andrewodendaal.com/guillotine-bug-bug/</link>
      <pubDate>Tue, 20 Oct 2009 21:28:59 +0000</pubDate>
      <guid>https://andrewodendaal.com/guillotine-bug-bug/</guid>
      <description>&lt;p&gt;Yes, it&amp;rsquo;s called a Guillotine-Bug and it&amp;rsquo;s yet another bug IE users get to look forward too 😛&lt;/p&gt;&#xA;&lt;p&gt;So how does it work?&lt;br&gt;&#xA;Basically, the hasLayout messes around and elements become invisible and visible according to random things. Rather silly, but a bit of a bitch to initially figure out.&lt;/p&gt;&#xA;&lt;p&gt;So how do you fix it?&lt;/p&gt;&#xA;&lt;p&gt;Try this:&lt;/p&gt;&#xA;&lt;p&gt;in your css file add:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;* html .container {height: 1%;}&#xA;.container:after {&#xA;  content: &amp;#39;.&amp;#39;;&#xA;  display: block;&#xA;  height: 0;&#xA;  clear: both;&#xA;  visibility: hidden;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;then apply to all elements that have nested floats.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sending data from javascript to php</title>
      <link>https://andrewodendaal.com/sending-data-from-javascript-to-php/</link>
      <pubDate>Tue, 20 Oct 2009 21:27:47 +0000</pubDate>
      <guid>https://andrewodendaal.com/sending-data-from-javascript-to-php/</guid>
      <description>&lt;p&gt;If you ever find yourself needing to do some ajax and in turn sending strings of characters via javascript then you should really try encodeURIComponent() to wrap your strings in. The function escape() can also be used, but I would not recommend it as encodeURIComponent() is better, it also escapes your usual ampersand ajax limiters which solved me quite a bit of pain.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What is Eb in firebug?</title>
      <link>https://andrewodendaal.com/what-is-eb-in-firebug/</link>
      <pubDate>Tue, 20 Oct 2009 21:25:55 +0000</pubDate>
      <guid>https://andrewodendaal.com/what-is-eb-in-firebug/</guid>
      <description>&lt;p&gt;Gmail produces the following error/warning in firebug.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Eb is not defined&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;function Bb(a){if(a[sb]&amp;amp;&amp;amp;a[sb](daa)){var&amp;#39;ents)};f.x2b=c;f.B2b=b;f.y2b=a;return f}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I initially started seeing this while while on clients&amp;rsquo; websites, but can now say it&amp;rsquo;s a gmail thing. So don&amp;rsquo;t stress.. 😉&lt;/p&gt;</description>
    </item>
    <item>
      <title>Add TinyMCE code button</title>
      <link>https://andrewodendaal.com/add-tinymce-code-button/</link>
      <pubDate>Tue, 20 Oct 2009 21:24:27 +0000</pubDate>
      <guid>https://andrewodendaal.com/add-tinymce-code-button/</guid>
      <description>&lt;p&gt;I had quite a few problems adding the htmlCode button to a fairly old copy of TinyMCE (I think around version 2.x).&lt;/p&gt;&#xA;&lt;p&gt;All is resolved now and this is what I had to change:&lt;/p&gt;&#xA;&lt;p&gt;Both changes are made in &amp;ldquo;editor_template.js&amp;rdquo; file, I also swopped the 2 files so that I could include and edit editor_template.js instead of the compressed &amp;ldquo;editor_template_src.js.&lt;/p&gt;&#xA;&lt;p&gt;Using the advanced theme I added the following line near the top of the file:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Runtime Error! (abnormal program termination) maya.exe</title>
      <link>https://andrewodendaal.com/runtime-error-abnormal-program-termination-maya-exe/</link>
      <pubDate>Tue, 20 Oct 2009 21:21:22 +0000</pubDate>
      <guid>https://andrewodendaal.com/runtime-error-abnormal-program-termination-maya-exe/</guid>
      <description>&lt;h2 id=&#34;the-problem&#34;&gt;The Problem&lt;/h2&gt;&#xA;&lt;p&gt;When starting Maya 8.5 an immediate error message and program termination.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Runtime Error!&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Program C:\Program Filesz\Autodesk\Maya8.5\bin\maya.exe&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;abnormal program termination&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;solution&#34;&gt;Solution&lt;/h2&gt;&#xA;&lt;p&gt;…&lt;/p&gt;</description>
    </item>
    <item>
      <title>Need more than hover?</title>
      <link>https://andrewodendaal.com/need-more-than-hover/</link>
      <pubDate>Tue, 20 Oct 2009 21:20:48 +0000</pubDate>
      <guid>https://andrewodendaal.com/need-more-than-hover/</guid>
      <description>&lt;p&gt;I had a hover effect on an html input element but also needed to have an active state.&lt;br&gt;&#xA;The css was like this for the inputs in mention:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;.contactformdiv input:hover, .contactformdiv textarea:hover {&#xA;  background-color:#fff;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It was simple, I just added a &lt;em&gt;focus&lt;/em&gt;…&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;.contactformdiv input:hover, .contactformdiv textarea:hover, .contactformdiv input:focus, .contactformdiv textarea:focus {&#xA;  background-color:#fff;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Getting an internet connection under VirtualPC running Windows XP and Internet Explorer 7</title>
      <link>https://andrewodendaal.com/getting-an-internet-connection-under-virtualpc-running-windows-xp-and-internet-explorer-7/</link>
      <pubDate>Tue, 20 Oct 2009 21:20:21 +0000</pubDate>
      <guid>https://andrewodendaal.com/getting-an-internet-connection-under-virtualpc-running-windows-xp-and-internet-explorer-7/</guid>
      <description>&lt;p&gt;&lt;strong&gt;Getting an internet connection under VirtualPC running Windows XP and Internet Explorer 7&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Open the ‘settings&amp;rsquo; of the virtual machine and select Networking -&amp;gt; then change Adapter1 to &amp;ldquo;Shared networking (NAT)&amp;rdquo; and it will use your local machine&amp;rsquo;s network settings.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Uppercase text in Actionscript</title>
      <link>https://andrewodendaal.com/uppercase-text-in-actionscript/</link>
      <pubDate>Tue, 20 Oct 2009 21:19:09 +0000</pubDate>
      <guid>https://andrewodendaal.com/uppercase-text-in-actionscript/</guid>
      <description>&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;var lowerCase:String = &amp;#34;sample text&amp;#34;;&#xA;var upperCase:String = lowerCase.toUpperCase();&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Firefox too slow?</title>
      <link>https://andrewodendaal.com/firefox-too-slow/</link>
      <pubDate>Tue, 20 Oct 2009 21:18:28 +0000</pubDate>
      <guid>https://andrewodendaal.com/firefox-too-slow/</guid>
      <description>&lt;p&gt;Is your Firefox starting to get realllllllly slow?&lt;/p&gt;&#xA;&lt;p&gt;Every few months my Firefox starts dragging, so all I do is create a new profile and reimport all my bookmarks and reinstall needed addons.&lt;/p&gt;&#xA;&lt;p&gt;For a rundown on how to create a new profile, click the following link..&lt;br&gt;&#xA;&lt;a href=&#34;http://kb.mozillazine.org/Profile_Manager&#34;&gt;http://kb.mozillazine.org/Profile_Manager&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Uppercase the first character of each word in a string using PHP</title>
      <link>https://andrewodendaal.com/uppercase-the-first-character-of-each-word-in-a-string-using-php/</link>
      <pubDate>Tue, 20 Oct 2009 21:13:40 +0000</pubDate>
      <guid>https://andrewodendaal.com/uppercase-the-first-character-of-each-word-in-a-string-using-php/</guid>
      <description>&lt;p&gt;You can use &amp;ldquo;ucwords()&amp;rdquo; to uppercase the first character of each word in a string.&lt;/p&gt;&#xA;&lt;p&gt;e.g.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$myVar = &amp;#39;this is a test!&amp;#39;;&#xA;$myVar = ucwords($myVar);&#xA;// This Is A Test!&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Actionscript 3 equivalent of PHP’s print_r</title>
      <link>https://andrewodendaal.com/actionscript-3-equivalent-of-phps-print_r/</link>
      <pubDate>Tue, 20 Oct 2009 21:12:55 +0000</pubDate>
      <guid>https://andrewodendaal.com/actionscript-3-equivalent-of-phps-print_r/</guid>
      <description>&lt;p&gt;A brilliant version of print_r for actionscript:&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;&lt;a href=&#34;http://dev.base86.com/solo/47/actionscript_3_equivalent_of_phps_printr.html&#34;&gt;http://dev.base86.com/solo/47/actionscript_3_equivalent_of_phps_printr.html&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Global variables and functions in Actionscript 2</title>
      <link>https://andrewodendaal.com/global-variables-and-functions-in-actionscript-2/</link>
      <pubDate>Tue, 20 Oct 2009 21:12:22 +0000</pubDate>
      <guid>https://andrewodendaal.com/global-variables-and-functions-in-actionscript-2/</guid>
      <description>&lt;p&gt;In order to reuse a variable from a different timeline within the same fla file you will need to register the inital variable or function as a _global.&lt;/p&gt;&#xA;&lt;p&gt;Todo this as a variable:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;_global.myString:String = &amp;#34;My String&amp;#34;;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Todo this as a function:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;_global.myFunction = function() {}&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Actionscript conflicting class name</title>
      <link>https://andrewodendaal.com/actionscript-conflicting-class-name/</link>
      <pubDate>Tue, 20 Oct 2009 21:11:13 +0000</pubDate>
      <guid>https://andrewodendaal.com/actionscript-conflicting-class-name/</guid>
      <description>&lt;p&gt;I had a problem today where I got a flash source file from one of my developers&amp;rsquo; and I couldnt compile it because it said that there was a conflicting class name, however, it turned out to just be a timestamp issue.&lt;/p&gt;&#xA;&lt;p&gt;Read here for more information&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.epresenterplus.com/blog/archives/000030.html&#34;&gt;http://www.epresenterplus.com/blog/archives/000030.html&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>expecting T_PAAMAYIM_NEKUDOTAYIM</title>
      <link>https://andrewodendaal.com/expecting-t_paamayim_nekudotayim/</link>
      <pubDate>Tue, 20 Oct 2009 21:08:39 +0000</pubDate>
      <guid>https://andrewodendaal.com/expecting-t_paamayim_nekudotayim/</guid>
      <description>&lt;p&gt;What the hey? What does this mean?&lt;/p&gt;&#xA;&lt;p&gt;You may one day end up seeing the following error message produced by PHP and wonder to yourself:&lt;/p&gt;&#xA;&lt;p&gt;&lt;!-- raw HTML omitted --&gt;PHP Parse error: syntax error, unexpected ‘)&amp;rsquo;, expecting T_PAAMAYIM_NEKUDOTAYIM in /&lt;em&gt;/&lt;/em&gt;/File.php on line 160&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;&#xA;&lt;p&gt;You guessed it, &amp;ldquo;&lt;strong&gt;T_PAAMAYIM_NEKUDOTAYIM&lt;/strong&gt;&amp;rdquo; is not english.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s actually a Hebrew word meaning &amp;ldquo;&lt;strong&gt;unexpected&lt;/strong&gt;&amp;rdquo; or &amp;ldquo;&lt;strong&gt;Twice Colon&lt;/strong&gt;&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;It happens when PHP tries to call the &amp;ldquo;::&amp;rdquo; (double colon) which is used when identifying an uninstantiated class&amp;rsquo; method.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
