<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Focss</title>
    <description>The latest articles on Forem by Focss (@focss).</description>
    <link>https://forem.com/focss</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3752556%2F4475335a-07f0-4195-9d20-2a55bbabbd2e.png</url>
      <title>Forem: Focss</title>
      <link>https://forem.com/focss</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/focss"/>
    <language>en</language>
    <item>
      <title>Finding Pixel Flow levels with a 768-bit RGB pHash visual search</title>
      <dc:creator>Focss</dc:creator>
      <pubDate>Thu, 02 Apr 2026 06:47:36 +0000</pubDate>
      <link>https://forem.com/focss/finding-pixel-flow-levels-with-a-768-bit-rgb-phash-visual-search-2ji8</link>
      <guid>https://forem.com/focss/finding-pixel-flow-levels-with-a-768-bit-rgb-phash-visual-search-2ji8</guid>
      <description>&lt;p&gt;I’m a big fan of the game Pixel Flow, but I often find myself getting completely stuck on specific levels. Because it is a purely visual grid game, you cannot simply search for a solution using text. To solve this, I built a reverse image search engine specifically designed to find level solutions based on a screenshot.&lt;/p&gt;

&lt;p&gt;The challenge was figuring out how to do image matching quickly, accurately, and without heavy infrastructure. Here is how I approached the technical side:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Multi-Channel pHash (Per-Channel RGB)&lt;br&gt;
Most perceptual hashing (pHash) implementations convert an image to grayscale before processing. However, in a game like Pixel Flow, color is the primary piece of information. Discarding color would mean losing the ability to distinguish between levels with similar layouts but different color palettes.&lt;br&gt;
To fix this, I split the image into its Red, Green, and Blue channels and computed a 256-bit pHash for each channel independently.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Combining into a 768-Bit Fingerprint&lt;br&gt;
After generating a 256-bit hash for all 3 channels, I concatenated them. This creates a combined fingerprint of 768 bits (256 * 3). This captures both the structural layout and the color distribution of the game level perfectly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hexadecimal Compression&lt;br&gt;
Storing and querying a raw 768-bit binary string isn't the most efficient approach for database queries. To reduce the data footprint, I convert the binary string into a hexadecimal string. This brings the size down to just 192 characters while retaining all the precision.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fast Hamming Distance Matching&lt;br&gt;
When a user uploads a screenshot, the system generates its 768-bit hash on the fly. It then compares this hash against the saved database of known level hashes. By calculating the Hamming distance (the number of positions at which the corresponding bits are different), it can rapidly find the closest match.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Displaying the Top 6 Matches&lt;br&gt;
Finally, the system pulls the 6 records with the smallest Hamming distance and displays them to the user. Showing a small cluster of top matches instead of just one gives the user fallback options in case there are minor discrepancies due to image cropping, phone UI overlays, or screen dimming.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I'd love to hear your feedback on this! Are there more efficient ways to handle color-sensitive image hashing for grid-based games?&lt;/p&gt;

&lt;p&gt;Link to the site: &lt;a href="https://pixelflowonline.net/" rel="noopener noreferrer"&gt;https://pixelflowonline.net/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>programming</category>
      <category>showdev</category>
      <category>sideprojects</category>
    </item>
    <item>
      <title>From Zero to Ranked: Building a High-Performance NBA Player Randomizer with Next.js 14 &amp; Cloudflare</title>
      <dc:creator>Focss</dc:creator>
      <pubDate>Sun, 15 Feb 2026 02:47:35 +0000</pubDate>
      <link>https://forem.com/focss/from-zero-to-ranked-building-a-high-performance-nba-player-randomizer-with-nextjs-14-cloudflare-5f1i</link>
      <guid>https://forem.com/focss/from-zero-to-ranked-building-a-high-performance-nba-player-randomizer-with-nextjs-14-cloudflare-5f1i</guid>
      <description>&lt;p&gt;As a developer and an NBA fan, I noticed a recurring problem in communities like r/NBA2K: players often get "choice paralysis" when starting a new MyLeague rebuild or a Blacktop 1v1 session. Static lists are boring, and existing randomizers are often cluttered with ads or lack specific filters.&lt;br&gt;
I decided to build a high-performance solution: . Here’s how I leveraged Next.js 14 and Cloudflare to create a tool that is not only fast but also highly optimized for SEO.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Stack: Why Next.js and Cloudflare?
&lt;/h2&gt;

&lt;p&gt;For a tool-based website, performance is the primary SEO signal. I chose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next.js 14 (App Router): For its superior handling of Server Components and built-in Image Optimization.&lt;/li&gt;
&lt;li&gt;Cloudflare Pages: To deploy at the edge, ensuring the generator loads instantly regardless of the user's location.&lt;/li&gt;
&lt;li&gt;Tailwind CSS: For a "dark mode" aesthetic that resonates with the gaming community.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Data Strategy: JSON vs. CSV
&lt;/h2&gt;

&lt;p&gt;While many data-heavy sites rely on databases, I opted for a JSON-driven architecture.&lt;br&gt;
Performance: Next.js can import JSON files directly, allowing the JS engine to parse data with zero runtime overhead compared to CSV.&lt;br&gt;
Filtering Logic: Storing player data in a structured JSON format allowed for instant client-side filtering by Team, Position, and Country without a single API call.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The Core Logic: Ensuring True Randomness
&lt;/h2&gt;

&lt;p&gt;A common complaint with randomizers is "repetitive results." To ensure every player in the NBA database has an equal chance, I implemented the Fisher-Yates Shuffle algorithm.&lt;br&gt;
This algorithm ensures an unbiased permutation of the player array.&lt;br&gt;
When a user applies a filter—like "Center from France"—the tool first creates a filtered subset and then applies the shuffle to provide a fresh result every click.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. SEO for Tools: Beyond the Meta Tag
&lt;/h2&gt;

&lt;p&gt;Tools often suffer from "Thin Content" issues in the eyes of Google. To break into the first page of search results, I focused on:&lt;br&gt;
Topical Authority: Instead of just a button, I added a comprehensive FAQ section explaining the tool's use cases for NBA 2K Challenges and Fantasy Basketball.&lt;br&gt;
Dynamic Metadata: Each page uses Next.js 14’s generateMetadata to ensure that keywords like "Random NBA Team" and "2K26 Randomizer" are indexed correctly.&lt;br&gt;
Internal Linking: I built a "Topic Cluster" by linking the main player generator to specialized tools like the NBA Team Generator.&lt;br&gt;
Check out the live project here: &lt;a href="https://randomnbaplayergenerator.net/" rel="noopener noreferrer"&gt;https://randomnbaplayergenerator.net/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
    <item>
      <title>Random Nba Player Generator - A Free Tool</title>
      <dc:creator>Focss</dc:creator>
      <pubDate>Wed, 04 Feb 2026 10:00:16 +0000</pubDate>
      <link>https://forem.com/focss/random-nba-player-generator-a-free-tool-37g4</link>
      <guid>https://forem.com/focss/random-nba-player-generator-a-free-tool-37g4</guid>
      <description>&lt;h2&gt;
  
  
  NBA Random Player Generator – What It Is
&lt;/h2&gt;

&lt;p&gt;This free online tool instantly generates a NBA random player from both current and all-time rosters. Whether you're settling debates, playing fantasy games, or creating fun challenges, this generator gives you new players with every click.&lt;/p&gt;

&lt;h2&gt;
  
  
  How To Generate Random Nba Player
&lt;/h2&gt;

&lt;p&gt;The Random NBA Player Generator works by leveraging a comprehensive database that includes detailed information on both current and historical NBA players. This database is meticulously compiled and regularly updated to ensure it encompasses a broad spectrum of players from different eras of the NBA. When a user interacts with the Random NBA Player Generator, the tool executes a randomized selection process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently Asked Questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Is the Random NBA Players Generator free?
&lt;/h3&gt;

&lt;p&gt;Yes, the Random NBA Player Generator is 100% free to use. Our mission is to provide a high-quality, accessible tool for the global basketball community. There are no hidden subscription fees, no "premium" tiers for specific teams, and no mandatory registration or login required. You can generate an unlimited number of players, experiment with all filtering combinations, and use the tool for your personal projects or gaming sessions without ever reaching for your wallet. We believe that the love for the game should be accessible to everyone, and this tool is our contribution to that vision.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does it include current NBA players?
&lt;/h3&gt;

&lt;p&gt;Yes, the generator includes active NBA players from recent seasons.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use this tool for games or challenges?
&lt;/h3&gt;

&lt;p&gt;Absolutely. Many users use it for NBA trivia, fantasy challenges, or social media content.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is each result truly random?
&lt;/h3&gt;

&lt;p&gt;Yes. Each click generates a new, random NBA player from the database.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I filter players by team or position?
&lt;/h3&gt;

&lt;p&gt;Currently, the generator provides fully random results. Filters such as team, position, or era may be added in future updates.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why would someone use a random NBA player generator?
&lt;/h3&gt;

&lt;p&gt;People use random NBA player generators to discover new players, make unbiased selections, settle debates, or simply have fun with basketball-related challenges.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you want to experience it, you can click on the link
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://randomnbaplayergenerator.net/" rel="noopener noreferrer"&gt;https://randomnbaplayergenerator.net/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
  </channel>
</rss>
