<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
  <title>Web Enclave — dispatches</title>
  <link>https://webenclave.com/</link>
  <atom:link href="https://webenclave.com/feed.xml" rel="self" type="application/rss+xml"/>
  <description>AI, web and application development consulting</description>
  <language>en-us</language>
  <copyright>© 2026 Web Enclave</copyright>
  <managingEditor>hello@webenclave.com (Web Enclave)</managingEditor>
  <webMaster>hello@webenclave.com (Web Enclave)</webMaster>
  <generator>build.py</generator>
  <ttl>1440</ttl>
  <pubDate>Thu, 20 Aug 2026 14:30:00 +0000</pubDate>
  <lastBuildDate>Thu, 20 Aug 2026 05:00:22 +0000</lastBuildDate>
  <image>
    <url>https://webenclave.com/icon-512.png</url>
    <title>Web Enclave — dispatches</title>
    <link>https://webenclave.com/</link>
  </image>
  <item>
    <title>Bringing a Microsoft Band 2 Back From the Dead</title>
    <link>https://webenclave.com/posts/bringing-a-microsoft-band-2-back-from-the-dead/</link>
    <guid isPermaLink="true">https://webenclave.com/posts/bringing-a-microsoft-band-2-back-from-the-dead/</guid>
    <pubDate>Thu, 20 Aug 2026 14:30:00 +0000</pubDate>
    <dc:creator>Web Enclave</dc:creator>
    <category>Microsoft Band 2</category>
    <category>msband-py</category>
    <category>OOBE</category>
    <category>USB protocol</category>
    <category>Claude Code</category>
    <description>My Band 2 was stuck asking for an app Microsoft deleted in 2019. Getting it out of setup over USB from a MacBook, with Claude Opus 5 reading the protocol.</description>
    <content:encoded><![CDATA[<p>My Microsoft Band 2 was stuck on <em>Continue setup from the Microsoft Health app on your phone</em>. That app has not existed since Microsoft <a href="https://support.microsoft.com/en-US/Office/end-of-support-for-the-microsoft-health-dashboard-applications-and-services-faq" rel="noopener">shut the Health Dashboard down on 5/31/2019</a>, and the FAQ is blunt about it: a Band reset after that date can never be set up again. Mine had been reset.</p>

<figure class="plate"><img src="https://webenclave.com/img/posts/msband-2.webp" alt="A Microsoft Band 2 on a wrist, its blue watch face showing 12:46 and a heart rate of 69" width="1200" height="900" loading="lazy" decoding="async"><figcaption>Out of setup, on the wrist, reading 69 bpm.</figcaption></figure>

<p>I plugged it into my M1 MacBook Air, opened Claude Code on Opus 5, and described the screen. An hour later the Band was out of setup and telling the right time.</p>

<p>The library is <a href="https://github.com/hire-marat/msband-py" rel="noopener">msband-py</a>, which speaks the Band's USB protocol with no phone involved. It wants Python 3.10, because its construct-typing pin will not import on 3.11. <code>OobeFinalize</code> refuses without a paired phone, so the way through is demo mode: enable it, unplug the Band, disable it. It comes back reporting <code>NotInOobe</code>.</p>

<p>Steps, heart rate, sleep, workouts and alarms work. Notifications, Cortana and anything else that needed the cloud are gone for good. It is back on my wrist.</p>]]></content:encoded>
  </item>
  <item>
    <title>OpenFret: The All-in-One Platform I Built for Guitarists</title>
    <link>https://webenclave.com/posts/openfret-the-all-in-one-platform-i-built-for-guitarists/</link>
    <guid isPermaLink="true">https://webenclave.com/posts/openfret-the-all-in-one-platform-i-built-for-guitarists/</guid>
    <pubDate>Thu, 29 Jan 2026 04:00:37 +0000</pubDate>
    <dc:creator>Web Enclave</dc:creator>
    <category>OpenFret</category>
    <category>guitar software</category>
    <category>practice tracking</category>
    <category>AI lessons</category>
    <description>OpenFret puts gear tracking, practice analytics, AI lessons and real-time collaboration for guitarists in one platform. Why I built it.</description>
    <content:encoded><![CDATA[<p>As a guitarist and software developer, I&#8217;ve always been frustrated by the fragmented tools we use. One app for tracking your gear, another for practice logs, something else for learning scales—it&#8217;s messy. So I built OpenFret, and today I want to share what it does and why I think it fills a real gap for musicians.</p>
<h2 id="what-is-openfret">What is OpenFret?</h2>
<p>OpenFret is an all-in-one platform designed specifically for solo musicians, particularly guitarists. It combines gear tracking, practice analytics, AI-powered lessons, real-time collaboration, and community features into a single, cohesive experience. Think of it as your personal guitar command center.</p>
<h2 id="smart-guitar-inventory">Smart Guitar Inventory</h2>
<p>One of the features I&#8217;m most proud of is the smart inventory system. You can track every guitar you own—from 6-strings to 8-strings—with auto-filled details from thousands of brands. The system monitors everything: woods, pickups, fingerboard radius, tunings, and even when you last changed your strings. No more forgetting which guitar has which setup.</p>
<h2 id="practice-analytics-that-actually-help">Practice Analytics That Actually Help</h2>
<p>Practice is where growth happens, but most of us don&#8217;t track it well. OpenFret includes persistent timers, a built-in metronome, scale visualization tools, and fretboard maps. There&#8217;s also Last.fm integration for detailed song tracking, so you can see patterns in what you&#8217;re learning and playing.</p>
<h2 id="session-mode-git-for-musicians">Session Mode: Git for Musicians</h2>
<p>This is where things get interesting. I&#8217;ve basically built version control for music. Like GitHub for code, Session Mode lets you fork sessions, layer tracks, see version history, and collaborate with musicians worldwide. You can download stems, merge contributions, and actually see the evolution of a piece. It&#8217;s collaboration done right.</p>
<h2 id="musical-helpers-to-break-the-rut">Musical Helpers to Break the Rut</h2>
<p>We&#8217;ve all been stuck in the E minor pentatonic box. The musical helpers feature includes scale references, chord progressions, fretboard visualization, key selection, and tempo control. It&#8217;s designed to push you out of your comfort zone and into new musical territory.</p>
<h2 id="a-community-that-gets-it">A Community That Gets It</h2>
<p>OpenFret isn&#8217;t just a tool—it&#8217;s a community. You can search for other musicians, discover gear combinations, leave comments, get notifications, and connect your Discord. The hearts and comments system lets you discover what setups other players are using and get inspired by their rigs.</p>
<h2 id="built-in-guitar-tuner">Built-in Guitar Tuner</h2>
<p>Yeah, there are a thousand tuner apps. But having one built into your all-in-one platform means one less thing to switch between. The tuner includes frequency control (Hz adjustment), sharp/flat detection, and beginner-friendly instructions. Perfect for when you&#8217;re stretching new strings.</p>
<h2 id="the-rpg-experience-level-up-your-playing">The RPG Experience: Level Up Your Playing</h2>
<p>Here&#8217;s something I&#8217;m really excited about—OpenFret includes a full RPG-style progression system to make practicing feel like a game. Earn XP for every practice session, song learned, and technique mastered. Level up your character, unlock achievements, and track your journey from Beginner Bard to Guitar God.</p>
<p>The skill tree system lets you specialize in different areas: fingerpicking, shredding, jazz improvisation, or rhythm playing. Complete daily quests and weekly challenges to earn rewards and keep your practice streak alive. There&#8217;s even a leaderboard if you&#8217;re feeling competitive.</p>
<p>It&#8217;s gamification done right—not gimmicky, but genuinely motivating. I built this because I know how hard it is to stay consistent with practice. When you can see your progress visually and unlock new abilities, it changes how you approach the guitar.</p>
<h2 id="try-it-out">Try It Out</h2>
<p>OpenFret is free to start—no credit card required. If you&#8217;re a guitarist looking to level up your organization, practice routine, and connection with other musicians, I&#8217;d love for you to give it a shot.</p>
<p>Check it out at <a href="https://openfret.com" rel="noopener">openfret.com</a> and let me know what you think in the comments.</p>]]></content:encoded>
  </item>
  <item>
    <title>Debugging Python Code Like a Professional: My Journey and Tips</title>
    <link>https://webenclave.com/posts/debugging-python-code-like-a-professional-my-journey-and-tips/</link>
    <guid isPermaLink="true">https://webenclave.com/posts/debugging-python-code-like-a-professional-my-journey-and-tips/</guid>
    <pubDate>Fri, 14 Feb 2025 03:45:40 +0000</pubDate>
    <dc:creator>Web Enclave</dc:creator>
    <category>Python</category>
    <category>debugging</category>
    <category>pdb</category>
    <category>logging</category>
    <category>profiling</category>
    <description>Battle-tested Python debugging: reading stack traces, working pdb and breakpoints, logging that earns its keep, and chasing performance in production.</description>
    <content:encoded><![CDATA[<p>Debugging can feel like navigating a maze blindfolded. I mean, Python&#8217;s ecosystem is a blessing and a curse—on one hand, it’s insanely powerful, and on the other, tracking down those pesky bugs can sometimes drive you up the wall. Over the years, I’ve been through every possible debugging scenario, from staring at cryptic stack traces to trying to tame performance issues in a production environment. Today, I’m excited to share my personal journey and some battle-tested techniques for debugging Python code like a pro—whether you’re a grad student, a DevOps guru, or a seasoned software engineer.</p>

<h2 id="the-basics-of-debugging-python">The Basics of Debugging Python</h2>

<p>Let’s kick things off with the fundamentals. I’ve spent countless hours wrestling with bugs that seemed to come out of nowhere. Here are some basics that have saved me more times than I can count:</p>

<ul>
<li><strong>Breakpoints:</strong> These are your best friends. They let you pause execution and take a good, hard look at what’s happening inside your program.</li>

<li><strong>Stepping Through Code:</strong> Whether you’re stepping over, into, or out of functions, this technique helps you follow the program’s flow and understand exactly where things go awry.</li>

<li><strong>Variable Inspection:</strong> Ever wished you could just see what your variables are up to at any given moment? Hover over them or use your IDE’s variables panel to get the scoop.</li>

<li><strong>Stack Traces:</strong> When your program throws an exception, the stack trace is like a breadcrumb trail leading back to the source of the problem.</li>
</ul>

<p>These basics are where every debugging journey starts. Now, let’s talk about one of my favorite tools—Visual Studio Code.</p>

<h2 id="getting-down-with-vs-code">Getting Down with VS Code</h2>

<p>If you’re not using VS Code for Python development yet, you’re in for a treat. This editor has been my go-to for years, and its debugging features are nothing short of stellar.</p>

<h3 id="setting-up-your-debug-environment">Setting Up Your Debug Environment</h3>

<p>First things first: make sure you have the <a href="https://marketplace.visualstudio.com/items?itemName=ms-python.python" rel="noopener">Python extension</a> installed. Then, you’ll need a launch.json file in your .vscode folder to define your debug configurations. Here’s a simple setup I’ve used countless times:</p>

<pre><code>{
  &quot;version&quot;: &quot;0.2.0&quot;,
  &quot;configurations&quot;: [
    {
      &quot;name&quot;: &quot;Python: Current File&quot;,
      &quot;type&quot;: &quot;python&quot;,
      &quot;request&quot;: &quot;launch&quot;,
      &quot;program&quot;: &quot;${file}&quot;,
      &quot;console&quot;: &quot;integratedTerminal&quot;
    }
  ]
}</code></pre>

<p>Also, don’t forget to pick the right Python interpreter for your project. Trust me—nothing ruins your debugging vibe faster than running the wrong version of Python.</p>

<h3 id="breakpoints-stepping-and-variable-inspections">Breakpoints, Stepping, and Variable Inspections</h3>

<ul>
<li><strong>Setting Breakpoints:</strong> Just click next to the line numbers in your editor. It’s as simple as that, and VS Code will highlight the line for you.</li>

<li><strong>Stepping Through:</strong> Use <strong>F10</strong> to step over, <strong>F11</strong> to step into functions, and <strong>Shift+F11</strong> to step out. It’s like having a remote control for your code.</li>

<li><strong>Variable Inspection:</strong> When you hit a breakpoint, hover over any variable to see its current value, or check out the Variables panel to get a broader view.</li>
</ul>

<h3 id="conditional-breakpoints-and-log-points">Conditional Breakpoints and Log Points</h3>

<p>Sometimes, you only want to stop the execution when something specific happens. That’s where conditional breakpoints come in. Right-click on a breakpoint, select “Edit Breakpoint,” and set a condition. For instance:</p>

<pre><code>if user.id == target_id:
    # Breakpoint triggers only when this condition is true.</code></pre>

<p>And if you prefer not to halt your execution but still want to monitor what’s happening, use <strong>Log Points</strong>. They print out messages to the debug console without pausing your code—a lifesaver when you’re chasing a tricky bug in a tight loop.</p>

<h2 id="advanced-debugging-tricks">Advanced Debugging Tricks</h2>

<p>Once you’ve mastered the basics, it’s time to dive into some advanced techniques that have personally helped me tackle the nastiest of bugs.</p>

<h3 id="stack-traces-and-exception-handling">Stack Traces and Exception Handling</h3>

<p>Stack traces are like the crime scene photos of your code’s errors—they tell you exactly where things went wrong. Here’s an example:</p>

<pre><code>Traceback (most recent call last):
  File &quot;app.py&quot;, line 42, in &lt;module&gt;
    main()
  File &quot;app.py&quot;, line 35, in main
    process_data(data)
  File &quot;processor.py&quot;, line 15, in process_data
    result = data[undefined_key]
KeyError: &#039;undefined_key&#039;</code></pre>

<p>By carefully following the stack trace, you can pinpoint that missing key error. And of course, wrapping code in try-except blocks allows you to gracefully handle these errors and log them for later analysis:</p>

<pre><code>try:
    result = data[undefined_key]
except KeyError as e:
    logging.error(&quot;Encountered a KeyError: %s&quot;, e)
    # Additional handling here</code></pre>

<h3 id="profiling-for-performance-bottlenecks">Profiling for Performance Bottlenecks</h3>

<p>Sometimes the problem isn’t a crash—it’s that your code is just too slow. Profiling lets you see where your program is spending its time. I’ve found tools like <strong>cProfile</strong> and <strong>Py-Spy</strong> to be indispensable:</p>

<ul>
<li><strong>cProfile:</strong> A built-in Python profiler that’s great for getting a quick snapshot.</li>
</ul>

<pre><code>  import cProfile
  cProfile.run(&#039;my_function()&#039;)</code></pre>

<ul>
<li><strong>Py-Spy:</strong> This tool attaches to a running process and samples what your code is doing without significant overhead.</li>
</ul>

<p>Integrating these profilers into your debugging routine can help you spot and fix performance issues before they become a headache in production.</p>

<h2 id="logging-like-a-boss">Logging Like a Boss</h2>

<p>Effective logging is like leaving breadcrumbs behind—you can trace back your steps when things go wrong. I used to underestimate logging until I found myself sifting through endless error reports. Here’s what I do:</p>

<ul>
<li><strong>Use Python’s Logging Module:</strong> Set up logging with different severity levels. A quick setup looks like this:</li>
</ul>

<pre><code>  import logging

  logging.basicConfig(
      level=logging.DEBUG,
      format=&#039;%(asctime)s - %(levelname)s - %(message)s&#039;
  )
  logging.debug(&quot;Debugging message: Here&rsquo;s what&rsquo;s happening...&quot;)</code></pre>

<ul>
<li><strong>Structured Logging:</strong> In an enterprise setting, structured logging (think JSON) makes it much easier to filter and analyze logs using centralized systems like ELK Stack.</li>

<li><strong>Context is King:</strong> Always include as much contextual information as possible. Whether it’s user IDs, request IDs, or even just timestamps, these details can make all the difference when you’re trying to follow a trail of breadcrumbs.</li>
</ul>

<h2 id="debugging-in-production">Debugging in Production</h2>

<p>Debugging in production is a whole different ballgame. Unlike local development, you’re working in an environment where you can’t just restart the whole system every time something goes wrong.</p>

<h3 id="tracing-and-observability-in-enterprise-settings">Tracing and Observability in Enterprise Settings</h3>

<ul>
<li><strong>Distributed Tracing:</strong> In a microservices architecture, I rely on tools like Jaeger or Zipkin to track requests as they bounce from one service to another. It’s like having a GPS for your data.</li>

<li><strong>Centralized Logging:</strong> Aggregating logs from multiple sources into one place (using services like Splunk, ELK, or even cloud-native solutions) is crucial. This way, you can correlate events across services.</li>

<li><strong>Monitoring and Alerting:</strong> Tools like Prometheus and Grafana help me keep an eye on system health. If something goes off the rails, alerts notify me before it turns into a full-blown crisis.</li>

<li><strong>Remote Debugging:</strong> When the situation gets critical, and I need to get inside a live process, remote debugging (done cautiously, of course) can be a game changer. It’s a delicate operation, but sometimes it’s the only way to see what’s really going on.</li>
</ul>

<h2 id="real-world-scenarios">Real-World Scenarios</h2>

<p>Over the years, I’ve encountered a few scenarios that really tested my debugging skills. Here are some quick stories and how I tackled them:</p>

<h3 id="runtime-exceptions-and-errors">Runtime Exceptions and Errors</h3>

<ul>
<li><strong>The Mystery KeyError:</strong> I once had a bug that only happened in production. By reproducing the issue locally, adding strategic breakpoints, and inspecting the variable states, I discovered that a particular API call was returning an unexpected format. A simple fix later, and the bug was history.</li>
</ul>

<h3 id="memory-leaks">Memory Leaks</h3>

<ul>
<li><strong>The Disappearing Memory:</strong> Debugging memory leaks can be maddening. I used tools like memory_profiler and tracemalloc to monitor memory consumption, eventually identifying a subtle bug in a caching mechanism that was hoarding memory. Fixing that leak made a world of difference.</li>
</ul>

<h3 id="performance-bottlenecks">Performance Bottlenecks</h3>

<ul>
<li><strong>Slow as Molasses:</strong> Sometimes, code just doesn’t run fast enough. In one project, I used <strong>cProfile</strong> and later switched to <strong>Py-Spy</strong> to pinpoint a function that was eating up CPU time. Once I optimized that section, performance improved dramatically.</li>
</ul>

<h3 id="distributed-systems">Distributed Systems</h3>

<ul>
<li><strong>Lost in the Maze of Microservices:</strong> In a recent project, correlation IDs became my secret weapon. By passing unique IDs through each service, I could piece together the full journey of a request—even when it spanned multiple systems.</li>
</ul>

<h2 id="final-thoughts">Final Thoughts</h2>

<p>Debugging might not always be glamorous, but it’s one of the most rewarding parts of being a developer. From those early days of staring blankly at stack traces to mastering remote debugging in production, I’ve learned that a bit of patience and the right tools can turn even the most cryptic bug into a solvable puzzle.</p>

<p>I hope these tips and stories help you tackle your own debugging adventures with more confidence and a smile on your face. Remember: every bug is an opportunity to learn something new (even if it sometimes feels like the universe is trying to drive you crazy).</p>]]></content:encoded>
  </item>
  <item>
    <title>A No-Nonsense Guide to Python Environments with uv</title>
    <link>https://webenclave.com/posts/a-no-nonsense-guide-to-python-environments-with-uv/</link>
    <guid isPermaLink="true">https://webenclave.com/posts/a-no-nonsense-guide-to-python-environments-with-uv/</guid>
    <pubDate>Fri, 31 Jan 2025 04:28:23 +0000</pubDate>
    <dc:creator>Web Enclave</dc:creator>
    <category>Python</category>
    <category>uv</category>
    <category>virtual environments</category>
    <category>dependency management</category>
    <category>packaging</category>
    <description>uv replaces venv, pipenv, Poetry and pyenv with one fast tool. A practical guide to managing Python environments and dependencies with it.</description>
    <content:encoded><![CDATA[<p>Python&#8217;s ecosystem is a blessing and a curse. On one hand, it&#8217;s ridiculously powerful, but on the other, managing environments and dependencies can be a pain. I&#8217;ve gone through just about every possible way to set up a Python environment—venv, pipenv, Poetry, pyenv, conda, even rolling my own Dockerized setups.</p>

<p>But recently, I came across <strong>uv</strong>, a new tool from the folks who built ruff (one of the fastest Python linters out there), and it immediately caught my interest.</p>

<p>After playing around with it, I have to say: <strong>I&#8217;m impressed.</strong> uv is blazing fast, well thought out, and combines features from several other tools I was using separately. If you&#8217;re someone who gets annoyed at how long Python dependency installation takes, you might want to give uv a try.</p>

<h2 id="what-is-uv">What is uv?</h2>

<p>At its core, uv is an <strong>extremely fast</strong> package manager, project manager, and Python version manager. It&#8217;s written in Rust, which explains why it&#8217;s absurdly quick compared to pip and Poetry.</p>

<p>But it’s not just a package installer— uv aims to <strong>replace</strong> a bunch of tools in the Python ecosystem:</p>

<ul>
<li><strong>pip &amp; pip-tools</strong> → Installs and syncs dependencies</li>

<li><strong>pipx</strong> → Runs Python CLI tools in isolated environments</li>

<li><strong>Poetry</strong> → Manages dependencies and lockfiles</li>

<li><strong>pyenv</strong> → Installs and manages Python versions</li>

<li><strong>virtualenv</strong> → Handles virtual environments</li>

<li><strong>twine</strong> → Publishes packages</li>
</ul>

<p>So instead of juggling 4+ tools, uv tries to do it all in one go. And so far, it does a good job of it.</p>

<h2 id="why-you-might-want-to-use-uv">Why You Might Want to Use uv</h2>

<p>Before I jump into installation and usage, let’s quickly go over why you might even care about switching to uv.</p>

<ol>
<li><strong>It’s ridiculously fast.</strong> Installing dependencies with uv is <strong>10x-100x faster</strong> than pip. Yes, seriously. If you&#8217;re tired of staring at &#8220;Collecting dependencies&#8230;&#8221; for minutes, uv is your new best friend.</li>

<li><strong>It replaces multiple tools.</strong> If you’re using pyenv, Poetry, and pipx separately, you can cut down your toolchain complexity.</li>

<li><strong>Python version management built-in.</strong> No need to rely on pyenv to manage different versions of Python—uv does it natively.</li>

<li><strong>Reproducible environments.</strong> Thanks to lockfiles (uv.lock), you get fully deterministic installs, similar to Poetry.</li>

<li><strong>It just works.</strong> No messing with shell scripts, PATH issues, or activation quirks. It’s smooth.</li>
</ol>

<h2 id="installing-uv">Installing uv</h2>

<p>The folks at Astral (the creators) made u<code>v</code> super easy to install. Here’s how you do it:</p>

<h3 id="install-uv-the-recommended-way">📦 Install uv (the recommended way)</h3>

<h4 id="on-macos-linux"><strong>On macOS/Linux</strong></h4>

<figure class="codeblock"><pre><code>curl -LsSf https://astral.sh/uv/install.sh | sh</code></pre></figure>

<h4 id="on-windows-powershell"><strong>On Windows (PowerShell)</strong></h4>

<figure class="codeblock"><pre><code>powershell -ExecutionPolicy ByPass -c &quot;irm https://astral.sh/uv/install.ps1 | iex&quot;</code></pre></figure>

<h4 id="alternatively-via-pip-or-pipx-my-favorite-way"><strong>Alternatively, via pip or pipx (my favorite way)</strong></h4>

<figure class="codeblock"><pre><code>pip install uv</code></pre></figure>

<p>Once installed, you can check if it&#8217;s working:</p>

<figure class="codeblock"><pre><code>uv --version</code></pre></figure>

<h2 id="setting-up-a-new-python-project-with-uv">Setting Up a New Python Project with uv</h2>

<p>Alright, let’s say you’re starting a new Python project. Normally, you’d go through the whole:</p>

<figure class="codeblock"><pre><code>python -m venv .venv
source .venv/bin/activate
pip install ...
pip freeze &amp; requirements.txt</code></pre></figure>

<p>With uv, it&#8217;s way simpler:</p>

<figure class="codeblock"><pre><code>uv init my_project
cd my_project</code></pre></figure>

<p>This automatically creates a <strong>virtual environment</strong> inside the project and sets up a pyproject.toml file (like Poetry).</p>

<p>Adding dependencies? Just run:</p>

<figure class="codeblock"><pre><code>uv add requests</code></pre></figure>

<p>This:<br>✅ Installs requests in a snap<br>✅ Updates your pyproject.toml<br>✅ Updates uv.lock (so you get reproducible installs)</p>

<p>Want to remove it?</p>

<figure class="codeblock"><pre><code>uv remove requests</code></pre></figure>

<h2 id="running-python-code-with-uv">Running Python Code with uv</h2>

<p>uv has an easy way to run scripts inside its environment without manually activating anything.</p>

<figure class="codeblock"><pre><code>uv run python script.py</code></pre></figure>

<p>This ensures your script runs <strong>inside</strong> your project’s virtual environment, even if you’re not inside an activated shell session.</p>

<h2 id="uv-vs-other-python-environment-tools">uv vs. Other Python Environment Tools</h2>

<p>Let’s compare uv against some of the big players:</p>

<figure class="table-wrap"><table class="has-fixed-layout"><thead><tr><th>Feature</th>
<th><code>uv</code></th>
<th><code>venv</code></th>
<th><code>pip</code></th>
<th><code>Poetry</code></th>
<th><code>pyenv</code></th></tr></thead>
<tbody><tr><td>Installs Packages</td>
<td>✅</td>
<td>❌</td>
<td>✅</td>
<td>✅</td>
<td>❌</td></tr>
<tr><td>Lockfile Support</td>
<td>✅</td>
<td>❌</td>
<td>❌</td>
<td>✅</td>
<td>❌</td></tr>
<tr><td>Python Version Management</td>
<td>✅</td>
<td>❌</td>
<td>❌</td>
<td>❌</td>
<td>✅</td></tr>
<tr><td>Runs CLI Tools (pipx alternative)</td>
<td>✅</td>
<td>❌</td>
<td>❌</td>
<td>❌</td>
<td>❌</td></tr>
<tr><td>Reproducible Installs</td>
<td>✅</td>
<td>❌</td>
<td>❌</td>
<td>✅</td>
<td>❌</td></tr>
<tr><td>Speed</td>
<td>🚀🚀🚀</td>
<td>🚶</td>
<td>🐢</td>
<td>🐇</td>
<td>🚶</td></tr></tbody></table></figure>

<p>If you’re currently using venv + pip, uv is a <strong>massive</strong> upgrade. If you’re using Poetry, it’s more of a lateral move, but the speed boost alone might make you switch.</p>

<h2 id="using-uv-in-docker">Using uv in Docker</h2>

<p>I always try to set up my projects so they work well in both local and containerized environments. uv makes that easier too.</p>

<p>Here’s how I set up a <strong>Dockerfile</strong> with uv:</p>

<figure class="codeblock"><pre><code>FROM python:3.13-alpine

# Install uv
RUN pip install uv

# Set up the application
WORKDIR /app
COPY . /app

# Create the virtual environment
RUN uv venv .venv

# Ensure the environment is activated for `uv sync`
ENV VIRTUAL_ENV=/app/.venv
ENV PATH=&quot;$VIRTUAL_ENV/bin:$PATH&quot;

# Install dependencies
RUN uv sync

# Run the application
CMD [&quot;uv&quot;, &quot;run&quot;, &quot;python&quot;, &quot;script.py&quot;]</code></pre></figure>

<h2 id="final-thoughts-should-you-use-uv">Final Thoughts: Should You Use uv?</h2>

<p>After testing uv, I’m pretty convinced that <strong>this is the future</strong> of Python package management. The speed, simplicity, and feature set make it a no-brainer for anyone tired of sluggish pip installs or juggling multiple tools.</p>

<p>If you’re still using venv + pip, I highly recommend giving uv a shot. If you’re using Poetry, it’s at least worth testing—especially if you’re frustrated with Poetry’s occasional slowness.</p>

<p>At the very least, it’s <strong>another great tool</strong> to have in your Python toolbox. And who knows? You might just end up replacing your entire workflow with it.</p>]]></content:encoded>
  </item>
  <item>
    <title>Setting Up a Secure Local Network with Caddy, Cloudflare DNS, and Let’s Encrypt</title>
    <link>https://webenclave.com/posts/setting-up-a-secure-local-network-with-caddy-cloudflare-dns-and-lets-encrypt/</link>
    <guid isPermaLink="true">https://webenclave.com/posts/setting-up-a-secure-local-network-with-caddy-cloudflare-dns-and-lets-encrypt/</guid>
    <pubDate>Thu, 07 Nov 2024 05:52:27 +0000</pubDate>
    <dc:creator>Web Enclave</dc:creator>
    <category>Caddy</category>
    <category>Cloudflare DNS</category>
    <category>Let&#x27;s Encrypt</category>
    <category>HTTPS</category>
    <category>homelab</category>
    <category>Docker</category>
    <description>Serve local network services over HTTPS using Caddy, Cloudflare DNS and Let&#x27;s Encrypt — real certificates for internal hosts, with no local CA to run.</description>
    <content:encoded><![CDATA[<p><strong>As of 11/7/2024</strong> — This is my home network software development setup. I have much more running than just Ollama, ChromaDb, etc. I also have several Postgres, Mongo, and other databases running in this setup.</p>

<p><strong>Assumptions</strong>: You have a machine running Docker and have a local static IP set on that machine.</p>

<p>In this post, I’ll walk you through a setup for serving local network services securely over HTTPS, using Caddy, Cloudflare DNS, and Let’s Encrypt. This configuration allows you to have SSL certificates from Let’s Encrypt for your internal services, even though they’re only accessible within your local network. This setup is ideal if you want to <strong>avoid setting up a local certificate authority while still using HTTPS.</strong></p>

<h2 id="overview-of-the-infrastructure">Overview of the Infrastructure</h2>

<p>The core components of this setup include:</p>

<ul>
<li><strong>Caddy</strong>: A powerful web server with automatic HTTPS capabilities, configured with Cloudflare for DNS-01 challenge-based SSL certificates.</li>

<li><strong>Cloudflare DNS</strong>: Handles DNS for our domain and provides an API that Caddy uses to validate certificates without exposing services publicly.</li>

<li><strong>Let’s Encrypt</strong>: Provides SSL certificates via DNS-01 challenge, verified through Cloudflare.</li>
</ul>

<p>The setup uses Docker to containerize Caddy and other services (e.g., Ollama, ChromaDb, TTS, Pihole, and anything else you desire).</p>

<h2 id="how-it-works">How It Works</h2>

<h3 id="1-user-device-requests-a-local-service">1. User Device Requests a Local Service</h3>

<p>When a local device, like a laptop or phone, tries to access a service (e.g., https://ollama.webenclave.com), the request goes to <strong>Cloudflare DNS</strong>. Cloudflare manages the DNS for webenclave.com, pointing the subdomains (e.g., ollama.webenclave.com) to an internal IP address (e.g., 192.168.x.x). Cloudflare is set to “DNS only” mode to allow direct access.</p>

<h3 id="2-caddy-as-the-reverse-proxy">2. Caddy as the Reverse Proxy</h3>

<p>On the Docker host machine, <strong>Caddy</strong> listens for HTTPS requests. Caddy is configured with a <strong>Cloudflare DNS plugin</strong> that enables it to automatically obtain SSL certificates using Let’s Encrypt, without requiring external exposure. Caddy does the following:</p>

<ul>
<li><strong>Reverse Proxy</strong>: Caddy forwards requests to the appropriate Docker container based on the subdomain.</li>

<li><strong>TLS with DNS-01 Challenge</strong>: Caddy handles HTTPS certificates for each service using a DNS-01 challenge. When a certificate is needed (for example, for ollama.webenclave.com), Caddy triggers the DNS-01 challenge with Cloudflare.</li>
</ul>

<h3 id="3-lets-encrypt-and-cloudflare-api-for-certificate-management">3. Let’s Encrypt and Cloudflare API for Certificate Management</h3>

<p>Caddy communicates with <strong>Cloudflare’s DNS API</strong> to complete the DNS-01 challenge for Let’s Encrypt. Here’s how it works:</p>

<ul>
<li><strong>DNS-01 Challenge</strong>: Caddy requests a certificate from Let’s Encrypt for ollama.webenclave.com. Let’s Encrypt requires proof that we control this domain, so Caddy uses the Cloudflare API to create a temporary DNS TXT record for validation.</li>

<li><strong>Certificate Issuance</strong>: Let’s Encrypt validates this TXT record, verifying our control over the domain, and issues a certificate. Caddy then stores and manages this certificate, automatically renewing it before it expires.</li>
</ul>

<p>With this setup, Caddy provides valid HTTPS certificates from Let’s Encrypt for each local service, so connections are secure and trusted by default.</p>

<h3 id="4-reverse-proxy-to-local-services">4. Reverse Proxy to Local Services</h3>

<p>Once the certificate is obtained, Caddy acts as a <strong>reverse proxy</strong> to route requests to the appropriate Docker container for each service:</p>

<ul>
<li><strong>Ollama</strong> (ollama.webenclave.com)</li>

<li><strong>ChromaDb</strong> (chroma.webenclave.com)</li>

<li><strong>TTS</strong> (tts.webenclave.com)</li>

<li><strong>Pihole</strong> (pihole.webenclave.com)</li>
</ul>

<p>Each service is accessible over HTTPS, with traffic staying entirely within the local network.</p>

<h2 id="key-benefits-of-this-setup">Key Benefits of This Setup</h2>

<ul>
<li><strong>Secure HTTPS for Local Services</strong>: Using Let’s Encrypt with Cloudflare’s DNS-01 challenge, you get trusted SSL certificates for local services without exposing them to the internet.</li>

<li><strong>Automatic Certificate Management</strong>: Caddy handles obtaining and renewing certificates automatically, so you don’t need to manually manage SSL certificates.</li>

<li><strong>Simple and Scalable</strong>: With Docker, it’s easy to add more services. You can configure additional subdomains and services in the Caddy configuration as needed.</li>
</ul>

<h2 id="setting-up-your-own-environment">Setting Up Your Own Environment</h2>

<p>To set up this infrastructure on your own network, follow these steps:</p>

<ol>
<li><strong>Register a Domain on Cloudflare</strong> (if you don’t already have one).</li>

<li><strong>Create DNS Records</strong>: In Cloudflare, create subdomain DNS records for each service, marked as “DNS Only” (gray). Set each subdomain to your local network IP (e.g., 192.168.x.x).</li>

<li><strong>Generate a Cloudflare API Token</strong>: This token needs DNS editing permissions to allow Caddy to use the DNS-01 challenge.</li>

<li><strong>Set Up Caddy with the Cloudflare Plugin</strong>: Use a Docker image for Caddy that includes the Cloudflare DNS plugin. Configure Caddy to use the Cloudflare API token for automatic HTTPS.</li>

<li><strong>Deploy Services</strong>: Deploy your services in Docker, configure them with Caddy as the reverse proxy, and access them securely over HTTPS within your network.</li>
</ol>

<h3 id="code">Code</h3>

<p>Here’s an example <strong>Caddyfile </strong>that shows how Caddy is configured for DNS-01 challenges with Cloudflare:</p>

<figure class="codeblock"><pre><code>{
    acme_dns cloudflare &lt;YOUR_CLOUDFLARE_API_TOKEN&gt;
}

ollama.webenclave.com {
    reverse_proxy http://x.x.x.x:11434
    tls {
        dns cloudflare &lt;YOUR_CLOUDFLARE_API_TOKEN&gt;
    }
}

chroma.webenclave.com {
    reverse_proxy http://x.x.x.x:8000
    tls {
        dns cloudflare &lt;YOUR_CLOUDFLARE_API_TOKEN&gt;
    }
}

tts.webenclave.com {
    reverse_proxy http://x.x.x.x:8020
    tls {
        dns cloudflare &lt;YOUR_CLOUDFLARE_API_TOKEN&gt;
    }
}

pihole.webenclave.com {
    reverse_proxy http://x.x.x.x
    tls {
        dns cloudflare &lt;YOUR_CLOUDFLARE_API_TOKEN&gt;
    }
}
</code></pre></figure>

<p><strong>Dockerfile </strong>(create docker image with Caddy + Cloudflare Plugin)</p>

<figure class="codeblock"><pre><code># syntax=docker/dockerfile:1
FROM caddy:2.8.4-builder AS builder
RUN xcaddy build \
  --with github.com/caddy-dns/cloudflare

FROM caddy:2.8.4 AS caddy
COPY --from=builder /usr/bin/caddy /usr/bin/caddy</code></pre></figure>

<p><strong>docker-compose.yml</strong></p>

<figure class="codeblock"><pre><code>version: &quot;3.8&quot;
services:
  caddy:
    build:
      context: .  # Build context where the Dockerfile is located
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
    ports:
      - &quot;443:443&quot;
    networks:
      - mynetwork

networks:
  mynetwork:
    driver: bridge</code></pre></figure>]]></content:encoded>
  </item>
  <item>
    <title>My Journey Through Gamedev.js Jam 2024: Building “Neon Velocity”</title>
    <link>https://webenclave.com/posts/my-journey-through-gamedev-js-jam-2024-building-neon-velocity/</link>
    <guid isPermaLink="true">https://webenclave.com/posts/my-journey-through-gamedev-js-jam-2024-building-neon-velocity/</guid>
    <pubDate>Thu, 16 May 2024 03:07:47 +0000</pubDate>
    <dc:creator>Web Enclave</dc:creator>
    <category>game jam</category>
    <category>Gamedev.js Jam</category>
    <category>multiplayer</category>
    <category>WebGL</category>
    <category>indie games</category>
    <description>Building Neon Velocity for Gamedev.js Jam 2024 — multiplayer vehicular combat in morphing neon arenas, and what a third game jam taught me about scope.</description>
    <content:encoded><![CDATA[<p>Participating in the Gamedev.js Jam 2024 was a thrilling and enlightening experience. As a relatively new indie game developer, this was my third game jam, and it offered a unique opportunity to push my skills and creativity to new heights. My game, &#8220;Neon Velocity,&#8221; aimed to deliver a high-octane, multiplayer vehicular combat experience in a futuristic, neon-lit arena. Here&#8217;s a look at my journey, the challenges I faced, and the lessons I learned.</p>

<h3 id="game-concept-and-features"><strong>Game Concept and Features</strong></h3>

<p>&#8220;Neon Velocity&#8221; is designed to provide adrenaline-pumping vehicular combat in dynamic, morphing multiplayer arenas. Each match requires players to adapt their strategies to the ever-changing terrain. Key features include:</p>

<ul>
<li><strong>Dynamic Arenas</strong>: Shape-shifting platforms keep the gameplay fresh and challenging.</li>

<li><strong>Diverse Vehicles and Power-Ups</strong>: Players can choose from various vehicles and use strategic power-ups to gain an edge.</li>

<li><strong>16-Player Battles</strong>: Intense multiplayer matches with up to 16 players.</li>

<li><strong>Customization</strong>: Extensive options for personalizing vehicles and tracks.</li>

<li><strong>Inclusivity</strong>: A focus on creating a non-toxic, inclusive environment for all gamers.</li>
</ul>

<h3 id="development-tools-and-techniques"><strong>Development Tools and Techniques</strong></h3>

<p>The game was built using Phaser for the front-end and Colyseus for the server-side logic. I also integrated AI-generated music and art to enhance the game&#8217;s atmosphere. Here’s a brief overview of the development process:</p>

<ul>
<li><strong>Phaser</strong>: Chosen for its robust capabilities and ease of use for creating HTML5 games.</li>

<li><strong>Colyseus</strong>: Utilized for managing multiplayer sessions and real-time game state synchronization.</li>

<li><strong>AI-Generated Assets</strong>: Leveraged AI tools to create unique music and visuals, saving time and adding a unique flair to the game.</li>
</ul>

<h3 id="challenges-and-solutions"><strong>Challenges and Solutions</strong></h3>

<ol>
<li><strong>Dynamic Arenas</strong>: One of the most challenging aspects was implementing the shape-shifting platforms. I had to ensure that the platforms changed in a way that was both strategic and fair, requiring careful consideration of game balance and mechanics.</li>

<li><strong>Multiplayer Integration</strong>: Ensuring smooth gameplay for up to 16 players was another significant challenge. I had to optimize the netcode and server performance to handle the real-time interactions and physics calculations efficiently.</li>

<li><strong>AI Players</strong>: Creating intelligent AI players that could provide a challenging and realistic practice mode required developing algorithms for pathfinding, decision-making, and adapting to the dynamic arenas.</li>
</ol>

<h3 id="results-and-reflection"><strong>Results and Reflection</strong></h3>

<p>Here&#8217;s how &#8220;Neon Velocity&#8221; ranked in various categories:</p>

<ul>
<li><strong>Innovation</strong>: #101 (2.828)</li>

<li><strong>Audio</strong>: #123 (2.734)</li>

<li><strong>Gameplay</strong>: #138 (2.640)</li>

<li><strong>Overall</strong>: #148 (2.555)</li>

<li><strong>Theme</strong>: #180 (2.216)</li>

<li><strong>Graphics</strong>: #186 (2.357)</li>
</ul>

<p>Considering there were 232 submissions, I am quite pleased with these results. The rankings reflect the game&#8217;s strengths in innovation and audio, and they highlight areas for improvement, such as theme alignment and graphical polish.</p>

<h3 id="lessons-learned"><strong>Lessons Learned</strong></h3>

<ol>
<li><strong>Time Management</strong>: Balancing the various aspects of game development within the limited timeframe of a game jam is crucial. Prioritizing core features and iterative testing helped ensure a functional and enjoyable game.</li>

<li><strong>Community Feedback</strong>: Leveraging the #gamedevjs hashtag on Twitter and engaging with the Discord community provided valuable feedback that helped refine the gameplay and address issues early.</li>

<li><strong>Inclusivity Matters</strong>: Creating a game that appeals to a diverse audience requires intentional design choices. Ensuring a non-toxic, welcoming environment and offering gameplay modes that cater to different preferences significantly enhanced the game&#8217;s appeal.</li>
</ol>

<h3 id="future-plans"><strong>Future Plans</strong></h3>

<p>The journey doesn&#8217;t end here. Based on the feedback and experiences from the jam, I plan to:</p>

<ul>
<li><strong>Enhance Graphics</strong>: Improve the visual quality to make the game more immersive.</li>

<li><strong>Optimize Performance</strong>: Further refine the netcode and game performance to ensure smooth multiplayer experiences.</li>

<li><strong>Expand Features</strong>: Introduce new vehicles, power-ups, and customization options.</li>

<li><strong>Community Engagement</strong>: Foster a vibrant community through events, tournaments, and continued interaction on Discord and social media.</li>
</ul>

<h2 id="conclusion">Conclusion</h2>

<p>Participating in the Gamedev.js Jam 2024 was a rewarding experience that pushed my boundaries and significantly enhanced my game development skills. &#8220;Neon Velocity&#8221; is a testament to what can be achieved with creativity, hard work, and a passion for inclusive gaming. I&#8217;m excited to continue developing this game and look forward to the next challenge on my journey as an indie game developer.</p>

<p>Thank you for reading, and I hope you&#8217;ll check out &#8220;Neon Velocity&#8221; and join our growing community of players. If you have any feedback or questions, feel free to reach out!</p>

<p>Play the game: <a href="https://bchip1.itch.io/neon-velocity" target="_blank" rel="noreferrer noopener">https://bchip1.itch.io/neon-velocity</a></p>

<button class="reel" type="button" data-video="lyeB9wycI_E" data-video-title="Embedded video" aria-label="Play video: Embedded video"><img src="https://i.ytimg.com/vi/lyeB9wycI_E/hqdefault.jpg" alt="" loading="lazy" decoding="async" width="480" height="360"><span class="reel__play"><span><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M4.5 2.4 13 8l-8.5 5.6z"/></svg></span></span></button>]]></content:encoded>
  </item>
  <item>
    <title>Bridging Words and Pictures: How AI Understands and Generates Images from Text</title>
    <link>https://webenclave.com/posts/bridging-words-and-pictures-how-ai-understands-and-generates-images-from-text/</link>
    <guid isPermaLink="true">https://webenclave.com/posts/bridging-words-and-pictures-how-ai-understands-and-generates-images-from-text/</guid>
    <pubDate>Fri, 26 Apr 2024 03:41:19 +0000</pubDate>
    <dc:creator>Web Enclave</dc:creator>
    <category>text-to-image</category>
    <category>generative AI</category>
    <category>diffusion models</category>
    <category>machine learning</category>
    <description>How text-to-image models learn the relationship between words and pictures — training on image-text pairs, what they infer, and where they still fail.</description>
    <content:encoded><![CDATA[<h2 id="introduction-to-text-to-image-modeling-in-the-digital-age"><strong>Introduction to Text-to-Image Modeling in the Digital Age</strong></h2>

<p>In the digital world today, the blend of text and images is becoming more distinct, driven by advancements in artificial intelligence. This technology, called text-to-image modeling, is transforming how we approach creativity and communication.</p>

<h2 id="the-mechanics-of-text-to-image-ai-and-its-training-process"><strong>The Mechanics of Text-to-Image AI and Its Training Process</strong></h2>

<p>Text-to-image modeling harnesses AI&#8217;s capacity to interpret both written words and visual content. Trained on extensive datasets comprising countless image-text pairs, these models grasp the nuanced relationships between descriptions and their corresponding visuals. Through this training, AI systems develop a profound comprehension of how specific terms align with visual characteristics.</p>

<h2 id="understanding-embeddings-the-core-of-text-to-image-technolog"><strong>Understanding Embeddings: The Core of Text-to-Image Technology</strong></h2>

<p>A pivotal element of this technology is the concept of embeddings—numerical representations of text and images within a mutual, multi-dimensional space. This allows AI to juxtapose and align text with images effectively. A notable technique in this field is CLIP (Contrastive Language-Image Pre-training), which equips the AI to navigate the &#8220;language&#8221; of images related to text descriptions.</p>

<h2 id="measuring-congruence-in-ai-with-cosine-similarity"><strong>Measuring Congruence in AI with Cosine Similarity</strong></h2>

<p>The AI evaluates the congruence between text and images using cosine similarity. This metric, measuring the cosine of the angle between text and image embeddings, identifies their similarity, with values nearing 1 indicating a close match. This capability enables the AI to produce images that are true to the provided text descriptions.</p>

<h2 id="expanding-horizons-applications-of-text-to-image-technology-"><strong>Expanding Horizons: Applications of Text-to-Image Technology in Creative and Marketing Industries</strong></h2>

<p>Text-to-image technology&#8217;s potential extends across various sectors. In creative fields, artists and designers collaborate with AI to create innovative visuals that challenge conventional boundaries. Marketing professionals utilize these models to craft tailored visual content that resonates with specific audiences and enhances campaign effectiveness.</p>

<h2 id="educational-and-communicative-benefits-of-text-to-image-mode"><strong>Educational and Communicative Benefits of Text-to-Image Modeling</strong></h2>

<p>Moreover, educational and communicative applications are profound. Educators incorporate this technology to devise illustrative aids that simplify complex subjects, while content creators generate impactful visuals that bolster their narratives.</p>

<h2 id="the-future-of-visual-representation-advancements-and-potenti"><strong>The Future of Visual Representation: Advancements and Potential of AI Models</strong></h2>

<p>As these models advance, their applications expand, promising even more sophisticated and nuanced visual representations. This evolution marks a significant shift towards a more visually-oriented and AI-integrated future in communication and creative expression.</p>

<figure class="codeblock"><pre><code># This is a highly simplified example and does not reflect the actual complexity
# and data requirements of training models like CLIP, nor does it accurately simulate
# the embedding process, which in real applications involves deep learning techniques
# and a vast amount of training data.

import numpy as np

# Predefined embeddings for a small set of categories
category_embeddings = {
    &quot;cat&quot;: np.array([1, 0, 0], dtype=np.float64),
    &quot;dog&quot;: np.array([0, 1, 0], dtype=np.float64),
    &quot;pet&quot;: np.array([0.5, 0.5, 0], dtype=np.float64),
    &quot;rug&quot;: np.array([0, 0, 1], dtype=np.float64),
    &quot;mat&quot;: np.array([0, 0, 0.5], dtype=np.float64)
}

def generate_embedding(description):
    &quot;&quot;&quot;
    Generate a normalized embedding vector for a given description.

    Args:
        description (str): A textual description containing one or more keywords that map to predefined embeddings.

    Returns:
        numpy.ndarray: A normalized vector representing the aggregate embedding of the input description.
    &quot;&quot;&quot;
    words = description.split()
    embedding = np.zeros_like(next(iter(category_embeddings.values())), dtype=np.float64)
    for word in words:
        if word in category_embeddings:
            embedding += category_embeddings[word]
    if np.linalg.norm(embedding) &gt; 0:
        embedding /= np.linalg.norm(embedding)
    return embedding

class MockCLIPModel:
    &quot;&quot;&quot;
    A mock model simulating the functionality of the CLIP model which maps images and text to a shared embedding space.
    &quot;&quot;&quot;
    def __init__(self):
        &quot;&quot;&quot;
        Initializes the MockCLIPModel with empty dictionaries to store text and image embeddings.
        &quot;&quot;&quot;
        self.text_to_embedding = {}
        self.image_to_embedding = {}

    def embed_text(self, text):
        &quot;&quot;&quot;
        Retrieve or create a normalized embedding for a given text.

        Args:
            text (str): The text to embed.

        Returns:
            numpy.ndarray: The embedding vector for the given text.
        &quot;&quot;&quot;
        if text not in self.text_to_embedding:
            self.text_to_embedding[text] = generate_embedding(text)
        return self.text_to_embedding[text]

    def embed_image(self, image_description):
        &quot;&quot;&quot;
        Retrieve or create a normalized embedding for a given image description.

        Args:
            image_description (str): The description of the image.

        Returns:
            numpy.ndarray: The embedding vector for the given image description.
        &quot;&quot;&quot;
        if image_description not in self.image_to_embedding:
            self.image_to_embedding[image_description] = generate_embedding(image_description)
        return self.image_to_embedding[image_description]

    def find_similarities(self, text, image_description):
        &quot;&quot;&quot;
        Calculate the cosine similarity between embeddings of text and image description.

        Args:
            text (str): The text to compare.
            image_description (str): The image description to compare.

        Returns:
            float: The cosine similarity score between the text and image description embeddings.
        &quot;&quot;&quot;
        text_embedding = self.embed_text(text)
        image_embedding = self.embed_image(image_description)
        if np.linalg.norm(text_embedding) == 0 or np.linalg.norm(image_embedding) == 0:
            return 0  # Return 0 similarity if either embedding is a zero vector
        similarity = np.dot(text_embedding, image_embedding) / (
            np.linalg.norm(text_embedding) * np.linalg.norm(image_embedding)
        )
        return similarity

# Example usage
clip_model = MockCLIPModel()

# Embedding text and an image descriptions
text = &quot;A cat sitting on a mat&quot;
an_image_of_a_pet_on_a_rug = &quot;A pet on a rug&quot;
an_image_of_a_person_driving_a_car = &quot;A person driving a car&quot;

# Finding similarity between the text and the image descriptions
similarity_for_pet_on_rug = clip_model.find_similarities(
    text, an_image_of_a_pet_on_a_rug
)
similarity_for_person_driving_car = clip_model.find_similarities(
    text, an_image_of_a_person_driving_a_car
)
print(
    f&quot;Similarity for pet on rug: {similarity_for_pet_on_rug:.2f} and for person driving car: {similarity_for_person_driving_car:.2f}&quot;
)

# Output:
# Similarity for pet on rug: 0.73 and for person driving car: 0.00</code></pre></figure>]]></content:encoded>
  </item>
  <item>
    <title>Building a Simple Blockchain in Python</title>
    <link>https://webenclave.com/posts/building-a-simple-blockchain-in-python/</link>
    <guid isPermaLink="true">https://webenclave.com/posts/building-a-simple-blockchain-in-python/</guid>
    <pubDate>Fri, 12 Apr 2024 23:35:19 +0000</pubDate>
    <dc:creator>Web Enclave</dc:creator>
    <category>blockchain</category>
    <category>Python</category>
    <category>proof of work</category>
    <category>hashing</category>
    <description>Building a blockchain from scratch in Python — hashing, blocks and proof of work — from a talk given at the Michigan Python Group Meetup.</description>
    <content:encoded><![CDATA[<p>I&#8217;m excited to share my recent presentation at the Michigan Python Group Meetup, where I demonstrated how to build a simple blockchain using Python. This session was designed to demystify the concepts of blockchain and hashing algorithms, making them accessible to both coding novices and seasoned developers.</p>

<h2 id="introduction-to-blockchain-and-proof-of-work">Introduction to Blockchain and Proof of Work</h2>

<p>I started the session by introducing the basic concept of a blockchain and the cryptographic proof known as &#8220;proof of work.&#8221; This system is fundamental to understanding how technologies like Bitcoin operate. Proof of work is a mechanism that requires a participant to do a certain amount of computational work which is easy to verify but challenging to produce, thus ensuring the security and integrity of the blockchain network.</p>

<h2 id="using-sha-256-hashing-algorithm">Using SHA-256 Hashing Algorithm</h2>

<p>The focus of our build was the SHA-256 hashing algorithm, also used by Bitcoin. A hashing algorithm helps convert an input of any size into a fixed-size string or a hash, which acts like a fingerprint for data. I emphasized that SHA-256 is deterministic, meaning the same input will always produce the same output, but it&#8217;s designed to be unpredictable so the output hash doesn&#8217;t reveal anything about the input.</p>

<h2 id="building-the-blockchain-a-step-by-step-guide">Building the Blockchain: A Step-by-Step Guide</h2>

<p>During the presentation, I walked through the coding process, starting with defining a blockchain class and explaining each line of code that handles the creation of new blocks and the chain itself. Here are the key concepts we covered:</p>

<p><strong>Creating a Block</strong>: Each block contains data, the hash of the previous block (linking it), and its own hash calculated from its contents.</p>

<p><strong>Initializing the Blockchain</strong>: The genesis block starts the blockchain, with subsequent blocks added containing transactional data.</p>

<p><strong>Implementing Proof of Work</strong>: This involves adjusting a nonce value in the block until the hash of the block meets a network difficulty target, like starting with a certain number of zeros.</p>

<h2 id="practical-demonstration">Practical Demonstration</h2>

<p>I also provided a practical demonstration, where I live-coded to show how to implement these concepts in Python. I showcased the dynamic addition of blocks to the blockchain and how the network verifies the integrity of the blockchain through re-mining and validation processes when changes occur.</p>

<h2 id="security-aspects-of-blockchain">Security Aspects of Blockchain</h2>

<p>We discussed potential security vulnerabilities, such as the 51% attack, where an entity gains majority control of the network&#8217;s mining power and can alter the blockchain. I stressed the importance of decentralization in preventing such attacks.</p>

<h2 id="broader-applications-of-blockchain-technology">Broader Applications of Blockchain Technology</h2>

<p>To conclude, I explored how blockchain technology transcends cryptocurrencies. I discussed its applications in providing transparent, immutable records for supply chain management, digital identities, and more, highlighting its potential to revolutionize various industries by ensuring data integrity and security.</p>

<h2 id="conclusion">Conclusion</h2>

<p>My presentation to the Michigan Python Group provided a comprehensive introduction to building a simple blockchain in Python. By breaking down the technical jargon and simplifying the coding process, I aimed to make blockchain technology accessible to all attendees. This session not only enlightened participants on the inner workings of blockchains but also inspired them to consider its broader implications and applications in their fields.</p>

<p>For those interested in exploring more, I encourage you to follow my GitHub for updates and further resources. Whether you&#8217;re a developer looking to implement blockchain solutions or simply curious about the technology, there&#8217;s no doubt that blockchain is a fascinating field worth exploring further.</p>

<p><strong>Github</strong>: <a href="https://github.com/BChip/SimpleBlockchain-SVSUBitcoinGroup" target="_blank" rel="noreferrer noopener">https://github.com/BChip/SimpleBlockchain-SVSUBitcoinGroup</a></p>

<button class="reel" type="button" data-video="E315HrNGArw" data-video-title="Embedded video" aria-label="Play video: Embedded video"><img src="https://i.ytimg.com/vi/E315HrNGArw/hqdefault.jpg" alt="" loading="lazy" decoding="async" width="480" height="360"><span class="reel__play"><span><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M4.5 2.4 13 8l-8.5 5.6z"/></svg></span></span></button>]]></content:encoded>
  </item>
  <item>
    <title>Enhanced Satellite Orbit Visualization and Pass Prediction</title>
    <link>https://webenclave.com/posts/enhanced-satellite-orbit-visualization-and-pass-prediction/</link>
    <guid isPermaLink="true">https://webenclave.com/posts/enhanced-satellite-orbit-visualization-and-pass-prediction/</guid>
    <pubDate>Wed, 03 Apr 2024 05:30:57 +0000</pubDate>
    <dc:creator>Web Enclave</dc:creator>
    <category>satellite tracking</category>
    <category>orbit visualization</category>
    <category>TLE</category>
    <category>Docker</category>
    <category>serverless</category>
    <description>A faster fork of Satvis.Space: satellite orbit visualization and pass prediction from TLE data, with a far shorter Docker build and serverless hosting.</description>
    <content:encoded><![CDATA[<p><strong>Introduction</strong>: Satvis.Space, the powerful web application for satellite orbit visualization and pass prediction, has undergone a series of optimizations in a recent fork. This enhanced version not only improves the application&#8217;s performance but also significantly reduces the Docker build time, making it even more efficient and user-friendly.</p>

<p><strong>Features</strong>: The forked version of Satvis.Space retains all the impressive features of the original application. It accurately calculates satellite positions and orbits using TLE data, allows users to select their groundstation through geolocation or map interaction, and provides local browser notifications for upcoming satellite passes. The serverless architecture and offline functionality as a Progressive Web App (PWA) remain intact, ensuring seamless access to satellite data in any environment.</p>

<p><strong>Optimized Docker Build</strong>: One of the most notable improvements in this fork is the optimization of the Docker build process. By leveraging a multi-stage build approach and carefully selecting the appropriate base images, the build time has been reduced from approximately 900 seconds to an impressive 150 seconds on an Oracle Ampere instance.</p>

<p>The optimized Dockerfile starts with the official Node.js 18 image for installing dependencies. It then switches to the Oven Bun image, a lightweight and fast JavaScript runtime, for building the application. The installed dependencies are copied from the previous stage, ensuring a clean and efficient build process.</p>

<p>To further optimize the build, the TLE data is updated during the build process itself using the <code>bun run update-tle</code> command. This eliminates the need for a separate step and reduces the overall build time.</p>

<p>Finally, the built application files are copied to the Nginx image for serving the application. Nginx, known for its high performance and stability, ensures efficient delivery of the Satvis.Space application to users&#8217; browsers.</p>

<p><strong>Performance Optimization</strong>: In addition to the Docker build optimization, the forked version of Satvis.Space focuses on enhancing the application&#8217;s performance. Efforts have been made to optimize the code and improve the overall speed and responsiveness of the application across various browsers.</p>

<p>These performance optimizations may include techniques such as code minification, efficient asset loading, and browser-specific optimizations. The goal is to provide users with a smooth and seamless experience while interacting with the satellite visualization and pass prediction features, regardless of their browser choice.</p>

<p><strong>Automatic TLE Updates</strong>: To ensure the accuracy of satellite position calculations and pass predictions, the forked version of Satvis.Space includes an automated process for updating the TLE data. The TLE data is fetched and updated during the Docker build process itself, eliminating the need for manual intervention.</p>

<p>This automated update process guarantees that users always have access to the most recent satellite data, enhancing the reliability and precision of the orbit visualizations and pass predictions.</p>

<p><strong>Conclusion</strong>: The optimized fork of Satvis.Space takes the already impressive satellite orbit visualization and pass prediction application to new heights. With significant improvements in the Docker build process, the build time has been reduced from ~900 seconds to a mere ~150 seconds on an Oracle Ampere instance. This optimization streamlines the deployment process and makes it more efficient.</p>

<p>Moreover, the performance optimizations ensure a smooth and responsive user experience across different browsers, making the application accessible to a wider audience. The automated TLE data updates during the build process further enhance the accuracy and reliability of the satellite information.</p>

<p>Whether you&#8217;re a satellite enthusiast, researcher, or professional, this optimized version of Satvis.Space is a valuable tool that combines powerful features with improved performance and efficient deployment capabilities. Its user-friendly interface, accurate calculations, and seamless user experience make it an indispensable resource for anyone interested in exploring the fascinating world of satellites and their orbits.</p>

<p>View: <a href="https://space.webenclave.com/" target="_blank" rel="noreferrer noopener">https://space.webenclave.com/</a></p>

<p>Fork: <a href="https://github.com/BChip/space" target="_blank" rel="noreferrer noopener">https://github.com/BChip/space</a></p>]]></content:encoded>
  </item>
  <item>
    <title>Second Game Jam – itch.io Mini Jam 154: Travel</title>
    <link>https://webenclave.com/posts/second-game-jam-itch-io-mini-jam-154-travel/</link>
    <guid isPermaLink="true">https://webenclave.com/posts/second-game-jam-itch-io-mini-jam-154-travel/</guid>
    <pubDate>Mon, 18 Mar 2024 02:41:33 +0000</pubDate>
    <dc:creator>Web Enclave</dc:creator>
    <category>game jam</category>
    <category>Phaser</category>
    <category>React</category>
    <category>Vite</category>
    <category>NX</category>
    <description>Mini Jam 154: seven of us built an interstellar cargo delivery game in 72 hours with Phaser, React, Vite and NX. What worked and what we would cut.</description>
    <content:encoded><![CDATA[<p>What an incredible journey this game jam has been! Working with my team of 7 has been an absolute blast. From conceptualizing the idea to the final submission, every step has been a learning curve and a chance to push our creative and technical skills to the limit.</p>

<p>We dove headfirst into the world of game development with Phaser, weaving together dynamic gameplay with React for the UI, and using Vite and NX for an efficient development workflow. The challenge of incorporating the game jam&#8217;s limitation inspired us – what if Jeff Bezos extended Amazon Prime delivery to space? Thus, our game was born, focusing on the high-stakes world of interstellar cargo delivery.</p>

<p>Creating the main game was an exhilarating experience. We spent hours fine-tuning the mechanics to ensure that navigating through asteroid fields felt dangerous yet rewarding, and that the space battles were as intense as they were fun. The strategic gameplay elements, requiring players to make split-second decisions, were designed to immerse players in the role of a cadet of the Galactic Retrieval Unit.</p>

<p>Finding the perfect sound assets was like digging for treasure. Each sound effect and piece of background music had to enhance the ambiance, pulling players deeper into the cosmic setting of our game. When we finally saw (and heard) it all come together, the feeling was indescribable.</p>

<p>Creating the YouTube gameplay video/ad was another highlight. It allowed us to step back and see our game through the eyes of potential players. Crafting this video, we aimed to capture the essence of our game&#8217;s adventure and the sheer fun of playing it. Watching the final cut, we felt a mix of pride and excitement – we couldn&#8217;t wait for the world to see it.</p>

<p>And let&#8217;s not forget the cookies! Six cookies fueled our late-night coding sessions, with one special cookie that will forever remain a cherished team meme.</p>

<p>In conclusion, this game jam has been an unforgettable experience. Not only did we create a game we&#8217;re proud of, but we also forged stronger bonds as a team and expanded our horizons as developers. To everyone who embarks on the journey, we hope you find it as thrilling to play as it was for us to create. Here&#8217;s to many more adventures in game development!</p>

<p>Play the game: <a href="https://kbve.itch.io/travelbox" target="_blank" rel="noreferrer noopener">https://kbve.itch.io/travelbox</a></p>

<button class="reel" type="button" data-video="zdcx2VpYStQ" data-video-title="Embedded video" aria-label="Play video: Embedded video"><img src="https://i.ytimg.com/vi/zdcx2VpYStQ/hqdefault.jpg" alt="" loading="lazy" decoding="async" width="480" height="360"><span class="reel__play"><span><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M4.5 2.4 13 8l-8.5 5.6z"/></svg></span></span></button>]]></content:encoded>
  </item>
  <item>
    <title>First Game Jam – itch.io Mini Jam 153: Fishing</title>
    <link>https://webenclave.com/posts/first-game-jam-itch-io-mini-jam-153-fishing/</link>
    <guid isPermaLink="true">https://webenclave.com/posts/first-game-jam-itch-io-mini-jam-153-fishing/</guid>
    <pubDate>Sat, 09 Mar 2024 05:51:49 +0000</pubDate>
    <dc:creator>Web Enclave</dc:creator>
    <category>game jam</category>
    <category>Phaser</category>
    <category>indie games</category>
    <category>itch.io</category>
    <description>My first game jam: a 72-hour fishing game built under one brutal limitation — no water. How the team designed around it and shipped on time.</description>
    <content:encoded><![CDATA[<p>As a software developer, I&#8217;ve always been passionate about the potential of code to create immersive experiences. So, when I decided to participate in my first game jam, the excitement was palpable. The Mini Jam, a 72-hour-long video game development marathon hosted on Itch.io, was my chosen battlefield. Every two weeks, this jam challenges developers with a theme and a unique limitation, pushing the boundaries of creativity and innovation.</p>

<p>This jam&#8217;s theme was &#8220;Fishing,&#8221; a concept ripe with potential. However, the real twist came with the announcement of the limitation at the start of the jam: No water. Initially, this threw our plans into disarray. How could we create a fishing game without water? But as we chewed over this curveball, it sparked an unexpected burst of creativity. Our solution? &#8220;Fish &amp; Chip&#8221; &#8211; a mystical journey set in a world where the oceans have turned to sand, and magic replaces water.</p>

<h2 id="the-genesis-of-fish-chip">The Genesis of &#8220;Fish &amp; Chip&#8221;</h2>

<p>&#8220;Fish &amp; Chip&#8221; invites players into a realm transformed, where they assume the role of a legendary Desert Fisher. Using their typing skills, players cast their lines into the dunes to catch mystical fish hidden beneath the sands. This innovative gameplay mechanic blends typing games with fishing, creating a unique challenge that tests both speed and accuracy.</p>

<p>Our game was brought to life by a diverse team: myself, Chip, David, Holy, Nezt50, Retornodomal, Archandroid, and KBVE. We utilized the Phaser engine, integrated with Astro, React, TailwindCSS, and several other libraries to build our game. Credit also goes to FinalBossBlues and Annoraaq for the base tilemap data and placeholder assets, which we extensively redesigned to fit our sandy theme. The protagonist, Chip, was meticulously hand-drawn before being pixelated, showcasing the incredible talent within our team.</p>

<h2 id="overcoming-the-limitation">Overcoming the Limitation</h2>

<p>The limitation of no water initially seemed like a setback but ultimately served as the bedrock of our game&#8217;s identity. Transforming the limitation into the cornerstone of our creative direction, we developed a desert-themed mini RPG that incorporated fishing in a way no one expected. This not only allowed us to meet the challenge head-on but also to innovate within the confines of the jam&#8217;s criteria.</p>

<h2 id="the-jam-results">The Jam Results</h2>

<p>After an intense 72 hours, &#8220;Fish &amp; Chip&#8221; was born, and the results were more than encouraging. We ranked in several categories among dozens of entries, a testament to the hard work and creativity of our team:</p>

<ul>
<li>Presentation: #76</li>

<li>Concept: #91</li>

<li>Overall: #96</li>

<li>Use of the Limitation: #99</li>

<li>Enjoyment: #110</li>
</ul>

<p>These results, derived from 34 ratings, reflect the game&#8217;s reception and the potential for future development. The feedback has been invaluable, highlighting both our game&#8217;s strengths and areas for improvement.</p>

<h2 id="looking-forward">Looking Forward</h2>

<p>While &#8220;Fish &amp; Chip&#8221; was born out of a game jam, the journey doesn&#8217;t end here. Encouraged by the feedback and the enjoyment we had in creating this game, we&#8217;re considering further development. The dream? To evolve &#8220;Fish &amp; Chip&#8221; from a game jam project into a full-fledged game.</p>

<h2 id="final-thoughts">Final Thoughts</h2>

<p>Participating in the Mini Jam was an incredible learning experience. It challenged us to think outside the box, work under pressure, and collaborate effectively. The limitation, initially daunting, proved to be a source of inspiration, reminding us that creativity truly does thrive within constraints.</p>

<p>As for the cookies, let&#8217;s just say that both the physical and the browser variety played a significant role in fueling our creativity throughout this adventure.</p>

<p>Stay tuned for more updates on &#8220;Fish &amp; Chip,&#8221; and thank you to everyone who supported us on this journey. This game jam might have been my first, but it certainly won&#8217;t be my last.</p>

<p>Play the game on itch.io: <a href="https://kbve.itch.io/fishchip" target="_blank" rel="noreferrer noopener">https://kbve.itch.io/fishchip</a></p>

<button class="reel" type="button" data-video="uQ27cLXEj8k" data-video-title="Embedded video" aria-label="Play video: Embedded video"><img src="https://i.ytimg.com/vi/uQ27cLXEj8k/hqdefault.jpg" alt="" loading="lazy" decoding="async" width="480" height="360"><span class="reel__play"><span><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M4.5 2.4 13 8l-8.5 5.6z"/></svg></span></span></button>]]></content:encoded>
  </item>
  <item>
    <title>Training a Custom MusicGen Model and Serving it with Flask and AudioCraft</title>
    <link>https://webenclave.com/posts/training-a-custom-musicgen-model-and-serving-it-with-flask-and-audiocraft/</link>
    <guid isPermaLink="true">https://webenclave.com/posts/training-a-custom-musicgen-model-and-serving-it-with-flask-and-audiocraft/</guid>
    <pubDate>Mon, 18 Sep 2023 23:01:44 +0000</pubDate>
    <dc:creator>Web Enclave</dc:creator>
    <category>MusicGen</category>
    <category>AudioCraft</category>
    <category>Flask</category>
    <category>fine-tuning</category>
    <category>generative audio</category>
    <description>How we trained a custom MusicGen model on lofi hip hop and served it from a Flask API with AudioCraft — the dataset, the fine-tune and the endpoint.</description>
    <content:encoded><![CDATA[<p>I&#8217;m excited to share how my team recently won <strong>1st place</strong> at the AudioCraft 24-hour hackathon! Our winning project involved training a custom MusicGen model for generating lofi hip hop music. In this post, I&#8217;ll walk through how we created the training data, fine-tuned the model, and built a Flask API to serve our custom lofi MusicGen model using AudioCraft.</p>

<p><strong>Our hackathon project</strong>: <a href="https://webenclave.com/2023/09/11/claiming-victory-at-the-audiocraft-24-hour-hackathon/" target="_blank" rel="noreferrer noopener">https://webenclave.com/2023/09/11/claiming-victory-at-the-audiocraft-24-hour-hackathon/</a></p>

<h2 id="creating-the-training-data">Creating the Training Data</h2>

<p>The first step was gathering a dataset of high-quality lofi .wav files and matching text prompts. I built a helper/utility repo <a rel="noreferrer noopener" href="https://github.com/BChip/Audiocraft-MusicGen-DataModelPrep" target="_blank">https://github.com/BChip/Audiocraft-MusicGen-DataModelPrep</a> to simplify this process. Look at the <strong>README.md</strong> on how to use the scripts.</p>

<p>We sourced creative commons lofi tracks ourselves and split them into 30-second audio clips using the <strong>split_audio.py</strong> script.</p>

<p>The helper script will help creating the descriptions. Here are some descriptions we used as an example.</p>

<p><em>&#8220;slow chill hip hop beat with mellow piano&#8221;</em></p>

<p>or</p>

<p><em>&#8220;upbeat lofi with energetic drums&#8221;</em></p>

<p>Capturing the mood and essence of each clip is key for teaching MusicGen the nuances of lofi hip hop.</p>

<h2 id="fine-tuning-the-model">Fine-Tuning the Model</h2>

<p>With our dataset ready, it was time to fine-tune the MusicGen model. The <a href="https://github.com/chavinlo/musicgen_trainer" data-type="link" data-id="https://github.com/chavinlo/musicgen_trainer" target="_blank" rel="noreferrer noopener">https://github.com/chavinlo/musicgen_trainer</a> script made this easy.</p>

<p>The result was a MusicGen model specialized in generating lofi tunes based on text prompts!</p>

<h2 id="serving-the-custom-model-with-flask">Serving the Custom Model with Flask</h2>

<p>To showcase our custom lofi MusicGen model, we built a HTTP API using AudioCraft and Flask.</p>

<p>The code handles:</p>

<ul>
<li>Validating the API parameters</li>

<li>Loading the custom model</li>

<li>Generating lofi music conditioned on the text prompt</li>

<li>Returning the generated .wav file</li>
</ul>

<p>This allows us to generate adaptive lofi tracks dynamically based on the user&#8217;s current web browsing.</p>

<p>Here is the code for the Flask + AudioCraft API:</p>

<p><a href="https://github.com/KBVE/lofifocus-docker/blob/main/musicgen/app.py" target="_blank" rel="noreferrer noopener">https://github.com/KBVE/lofifocus-docker/blob/main/musicgen/app.py</a></p>

<h2 id="results">Results</h2>

<p>Our specialized model creates original lofi hip hop music that captures the essence of human-provided text prompts. The REST API integration with AudioCraft enabled seamless deployment.</p>

<p><strong>Check out the project</strong> <a rel="noreferrer noopener" href="https://lablab.ai/event/audiocraft-24-hours-hackathon/kbve/lofi-focus" target="_blank">https://lablab.ai/event/audiocraft-24-hours-hackathon/kbve/lofi-focus</a> to see the original project!</p>

<p>Fine-tuning AI models like MusicGen for specific audio domains unlocks exciting new possibilities. I had a blast working on this project and look forward to more audio AI innovations ahead.</p>

<p>Let me know if you have any other questions! I&#8217;m happy to provide more details on our hackathon winning strategy and code.</p>]]></content:encoded>
  </item>
  <item>
    <title>Claiming Victory at the AudioCraft 24-hour Hackathon!</title>
    <link>https://webenclave.com/posts/claiming-victory-at-the-audiocraft-24-hour-hackathon/</link>
    <guid isPermaLink="true">https://webenclave.com/posts/claiming-victory-at-the-audiocraft-24-hour-hackathon/</guid>
    <pubDate>Mon, 11 Sep 2023 04:28:14 +0000</pubDate>
    <dc:creator>Web Enclave</dc:creator>
    <category>AudioCraft</category>
    <category>MusicGen</category>
    <category>hackathon</category>
    <category>Chrome extension</category>
    <category>generative audio</category>
    <description>First place at the AudioCraft 24-hour hackathon with Lofi Focus, a Chrome extension that generates lofi on the fly using the MusicGen model.</description>
    <content:encoded><![CDATA[<p>Hello everyone!</p>

<p>Fresh off the heels of my recent hackathon success, I&#8217;m elated to announce another victory: 1st place at the AudioCraft 24-hour Hackathon! This event was all about pushing the boundaries of audio processing and generation using deep learning. And boy, did we dive deep!</p>

<h2 id="introducing-our-project-lofi-focus">Introducing Our Project: Lofi Focus</h2>

<p>Our project, aptly named &#8220;Lofi Focus&#8221;, is a Chrome browser extension designed to enhance your reading and browsing experience with the soothing sounds of lofi music. But it&#8217;s not just any lofi music; it&#8217;s generated on-the-fly using the cutting-edge MusicGen AI model from AudioCraft.</p>

<p><strong>Implementation Highlights:</strong></p>

<ul>
<li><strong>Ease of Use</strong>: Built as a Chrome extension, it&#8217;s just a click away.</li>

<li><strong>Dynamic Audio</strong>: Uses JavaScript to analyze webpages and play the perfect lofi track for your reading mood.</li>

<li><strong>Powered by AudioCraft</strong>: We harnessed AudioCraft&#8217;s MusicGen AI model to generate these lofi tracks.</li>

<li><strong>User-Friendly UI</strong>: A polished interface ensures you have complete control over your musical backdrop.</li>
</ul>

<p><strong>Our Custom Model&#8217;s Journey:</strong> We took a unique approach by curating a dataset of original, non-copyright lofi music. This treasure trove of high-quality audio was then split into 30-second clips, each paired with a descriptive text prompt capturing the mood and essence of the segment. Think &#8220;slow chill hip hop beat with mellow piano&#8221; or &#8220;upbeat lofi with energetic drums&#8221;. This dataset was then fed into the musicgen_trainer, fine-tuning the MusicGen model to master the art of lofi hip hop. The result? A specialized MusicGen variant that crafts original lofi tunes based on textual descriptions.</p>

<p><strong>Why You Should Try Lofi Focus:</strong></p>

<ul>
<li><strong>Enhanced Focus</strong>: The lofi tracks help improve concentration.</li>

<li><strong>Reading Pleasure</strong>: Make your reading sessions more enjoyable and relaxing.</li>

<li><strong>Boost Productivity</strong>: The right background music can elevate your work rate.</li>

<li><strong>Customized Experience</strong>: Avoid listening fatigue with ever-changing tracks.</li>

<li><strong>Portability &amp; Ease</strong>: Being a browser extension, it&#8217;s always with you.</li>

<li><strong>Mood Enhancer</strong>: Reduce anxiety and relive nostalgic moments.</li>
</ul>

<p>For those eager to experience this blend of technology and music, check out our project <a href="https://lablab.ai/event/audiocraft-24-hours-hackathon/kbve/lofi-focus" rel="noopener">here</a>.</p>

<p>In conclusion, the AudioCraft Hackathon was a whirlwind of innovation, learning, and music. I&#8217;m incredibly proud of what we achieved in just 24 hours and am excited to see where this journey with audio and AI takes us next. Cheers to more victories and innovations ahead! 🎉🎶🥇</p>

<button class="reel" type="button" data-video="eyds8nJDiQc" data-video-title="Embedded video" aria-label="Play video: Embedded video"><img src="https://i.ytimg.com/vi/eyds8nJDiQc/hqdefault.jpg" alt="" loading="lazy" decoding="async" width="480" height="360"><span class="reel__play"><span><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M4.5 2.4 13 8l-8.5 5.6z"/></svg></span></span></button>]]></content:encoded>
  </item>
  <item>
    <title>Securing 3rd Place at the Autonomous Agents AI Hackathon!</title>
    <link>https://webenclave.com/posts/securing-3rd-place-at-the-autonomous-agents-ai-hackathon/</link>
    <guid isPermaLink="true">https://webenclave.com/posts/securing-3rd-place-at-the-autonomous-agents-ai-hackathon/</guid>
    <pubDate>Sat, 09 Sep 2023 20:44:24 +0000</pubDate>
    <dc:creator>Web Enclave</dc:creator>
    <category>AI agents</category>
    <category>SuperAGI</category>
    <category>AutoGPT</category>
    <category>BabyAGI</category>
    <category>LangChain</category>
    <category>hackathon</category>
    <description>Third place in a 48-hour autonomous agents hackathon, building with SuperAGI, AutoGPT, BabyAGI and LangChain. What the agent frameworks could actually do.</description>
    <content:encoded><![CDATA[<p>Hey everyone!</p>

<p>I&#8217;m thrilled to share that I&#8217;ve secured 3rd place in the 48-hour AI hackathon centered around Autonomous Agents! Using cutting-edge frameworks like SuperAGI, AutoGPT, BabyAGI, Langchain, and more, it was a whirlwind of innovation and coding.</p>

<p>For my efforts, I&#8217;ve been awarded:</p>

<ul>
<li>$1,000 in cash 💸</li>

<li>$300 in Weaviate credits</li>

<li>Some fantastic Merch &amp; Goodies</li>

<li>An Amazon Alexa/Firestick 🎉</li>
</ul>

<p>The competition was fierce, and I&#8217;m genuinely proud of this achievement. If you&#8217;re curious to see what my team built in those intense 48 hours, check it out at <a href="https://lablab.ai/event/autonomous-agents-hackathon/kbve/atlas" rel="noopener">Atlas Project on LabLab</a>.</p>

<p>A big thank you to all participants and the organizers for this exhilarating experience. Here&#8217;s to more challenges and breakthroughs in AI!</p>

<p>Cheers and onward! 🥉🤖🎊</p>

<button class="reel" type="button" data-video="R92-zQ4Ly4Y" data-video-title="Embedded video" aria-label="Play video: Embedded video"><img src="https://i.ytimg.com/vi/R92-zQ4Ly4Y/hqdefault.jpg" alt="" loading="lazy" decoding="async" width="480" height="360"><span class="reel__play"><span><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M4.5 2.4 13 8l-8.5 5.6z"/></svg></span></span></button>]]></content:encoded>
  </item>
  <item>
    <title>My Move to Oracle Cloud’s Free Ampere Instance and Coolify v3</title>
    <link>https://webenclave.com/posts/my-move-to-oracle-clouds-free-ampere-instance-and-coolify-v3/</link>
    <guid isPermaLink="true">https://webenclave.com/posts/my-move-to-oracle-clouds-free-ampere-instance-and-coolify-v3/</guid>
    <pubDate>Wed, 06 Sep 2023 20:39:53 +0000</pubDate>
    <dc:creator>Web Enclave</dc:creator>
    <category>Oracle Cloud</category>
    <category>Ampere</category>
    <category>Coolify</category>
    <category>self-hosting</category>
    <category>free tier</category>
    <description>Moving from DigitalOcean, Azure and GCP to Oracle Cloud&#x27;s free Ampere instance with Coolify v3 — 4 OCPUs, 24 GB of memory and 200 GB of storage, at no cost.</description>
    <content:encoded><![CDATA[<p>I&#8217;ve hopped between various cloud services over the years. From Digital Ocean to Azure, then to Google Cloud Platform. Now, I&#8217;ve landed on Oracle Cloud&#8217;s free Ampere instance, paired with Coolify v3. The best part? It&#8217;s all free.</p>

<h2 id="why-i-chose-oracles-free-ampere-instance">Why I Chose Oracle&#8217;s Free Ampere Instance</h2>

<p>After my journey with other cloud platforms, I decided to give Oracle&#8217;s free Ampere instance a shot. It boasts solid features: 4 OCPUs, 24 GB of memory, and 200 GB of storage, all without a price tag. Setting it up was straightforward, and its performance didn&#8217;t disappoint.</p>

<h2 id="the-magic-of-coolify-v3">The Magic of Coolify v3</h2>

<p>Coolify v3 has been a game-changer for me. It&#8217;s not just a tool; it&#8217;s a productivity booster. With Coolify, spinning up my next.js apps became a breeze. But that&#8217;s not all. In just a few clicks, I was able to deploy n8n, meilisearch, kuma uptime, postgres, redis, and MinIO. These services are crucial to my main dev stack, and Coolify made the setup process incredibly simple and fast.</p>

<h2 id="integrating-my-web-projects">Integrating My Web Projects</h2>

<p>With the power of Oracle&#8217;s Ampere and the simplicity of Coolify v3, I&#8217;ve streamlined my web projects. Everything runs smoothly, and I can focus more on development and less on setup and management. Plus, the absence of costs means I can experiment and scale without financial worries.</p>

<h2 id="final-thoughts">Final Thoughts</h2>

<p>Having used multiple cloud services, I can confidently say that the combination of Oracle&#8217;s free Ampere instance and Coolify v3 is hard to beat. It&#8217;s simple, efficient, and cost-effective. For anyone in the dev world looking for a seamless cloud solution, I&#8217;d highly recommend giving this combo a try.</p>]]></content:encoded>
  </item>
</channel>
</rss>
