<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nat Liu on Medium]]></title>
        <description><![CDATA[Stories by Nat Liu on Medium]]></description>
        <link>https://medium.com/@n8wyliu?source=rss-6158d2d8b8be------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*GMx7ghwh8EyNraB_.jpg</url>
            <title>Stories by Nat Liu on Medium</title>
            <link>https://medium.com/@n8wyliu?source=rss-6158d2d8b8be------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 01:41:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@n8wyliu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Rise and Fall of Vibe Coding]]></title>
            <link>https://medium.com/@n8wyliu/the-rise-and-fall-of-vibe-coding-2610b84ce520?source=rss-6158d2d8b8be------2</link>
            <guid isPermaLink="false">https://medium.com/p/2610b84ce520</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Nat Liu]]></dc:creator>
            <pubDate>Wed, 24 Jun 2026 14:01:04 GMT</pubDate>
            <atom:updated>2026-06-24T14:01:04.259Z</atom:updated>
            <content:encoded><![CDATA[<p><em>I was working on a project for a PhD candidate. I spent an hour with a team member debugging their code. When I asked them what the code did, they had no idea.</em></p><p>The fix was to ask ChatGPT what the code did and to find the bug. Which was brilliant, and now it’s something I do almost everyday. Gone are the days of spending 30 hours on a bug.</p><h4>Thank God. Knowing what I can do with AI now, I’m never going back.</h4><p>Before, I’d copy past my error into Google, and the first link was always <strong>Stack Overflow.</strong> I’d get two types of insightful the answers:</p><ol><li>“Sure! let me Google that for you” — Way ahead of you…</li><li>“Here’s how you can deal with this” — The resulting code was an ingenious but convoluted way to weasel past an error. I’m just dealing with seg fault, mannnn );</li><li>20% of the time — the perfect fix.</li></ol><p>When AI couldn’t code in your repo, I’d copy-paste code into ChatGPT. I’d generate code from a UI akin to a search tool, copy-paste the code into VSCode, run it, get an error, and then copy paste the error into ChatGPT, and get a new codebase to run, and repeat!</p><h3>Code used to be hard to create</h3><p>Startups would go through <em>stealth mode</em> to get a head start against other companies. <strong>Now I can get a 30,000 lines of code in less than a month</strong> and barely use up half my tokens for Codex or Claude Code.</p><p>Github is now flooded with code. Software literally ate the world. Common startup ideas are literally a dime a dozen.</p><blockquote>Code was hard to make, but growing and managing massive codebases was even harder.</blockquote><p>It never got easier. But coding is easy now.</p><blockquote><strong><em>People are getting to the hardest parts of engineering faster significantly faster.</em></strong></blockquote><h3>Just another productivity tool.</h3><p>As AI becomes more and more adopted, the one man band is starting to lose the edge of having AI.</p><p>Now everyone has it, and the competitive edge of AI is losing its sharpness.</p><p>Nothing shows this more than <strong>Software Engineering</strong>, which is likely the place with the <em>strongest adoption in AI and the best productivity tools.</em></p><p>The growth of an engineer used to look like this:</p><ol><li>Follow tutorials (tutorial hell.)</li><li>Try building on your own small projects, referencing Google and tutorials.</li><li>Realize the effectiveness of technical documentation and books.</li><li>Grow the project past 2,000 lines and face the consequences of your architectural decisions.</li><li>Repeat steps 2–4 and grow into a great engineer.</li></ol><p>Most people building with AI are just now coming to step 4 in their growth as AI Engineers. But there’s a new issue:</p><h3>The Fall</h3><p>Instead of 30 hours on a bug, it’s 30 million tokens on a bug. The monetary cost is basically the same.</p><h4>5 Conversations deep and a passive aggressive AI.</h4><p>The 30 hours errors of the past are being replaced.</p><h3>Software Engineering of the 90&#39;s is Making a Come-back</h3><p>Not too long ago, software was sold on discs. There were one-time payments. This meant bugs in the program were there forever. At least until users bought the next version of software.</p><p>Then the infrastructure for the internet was built and everything changed. <strong>Everything had an internet connection</strong>. That means anything could download — even software.</p><p>So companies started doing one-time payments with retainers to continue supporting the software.</p><p>As the internet grew, the new thing was accessing the code online, and now software was sold as a service.</p><blockquote>Writing software became a race, and now that race is coming to end.</blockquote><p>Craftsmanship means that code can continue to grow bigger, and every engineer is now an architect. The coding monkey is no more.</p><p>Software is instant, its costs direct.</p><blockquote>The new challenge is to write and grow code that requires as little thought to change as possible.</blockquote><p>Because thought and reasoning are two peas in a pod.</p><blockquote><strong>reasoning = token = costs</strong></blockquote><p>The ability of great architects to get their team members up and running quickly by..</p><blockquote>Using and documenting design patterns.</blockquote><blockquote>Understanding why the code is the way it is.</blockquote><blockquote>Deciding what direction the codebase is growing.</blockquote><blockquote>Understanding how to extend it.</blockquote><p>These are the most paramount skills in Software Engineering, and it may stay that way for years to come.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2610b84ce520" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built 5 Different RAG Architectures and Compared Them]]></title>
            <link>https://medium.com/@n8wyliu/i-built-5-different-rag-architectures-and-compared-them-ae27dc4070a2?source=rss-6158d2d8b8be------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae27dc4070a2</guid>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Nat Liu]]></dc:creator>
            <pubDate>Wed, 24 Jun 2026 14:01:04 GMT</pubDate>
            <atom:updated>2026-06-24T14:01:04.092Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zVrw6KFEc8Oa1z9bpXKrNA.png" /><figcaption>Comparison of RAG Architecture by Correctness, Groundedness, and Retrieval. Image by Author.</figcaption></figure><p>RAG comes in all kinds of flavors, and I was curious about how well they performed against each other.</p><p>To start, I needed a way of comparing each architecture, so I created an important interface for all RAG.</p><pre>class RAGInterface():<br>    def search(self, query: str) -&gt; dict:<br>        &quot;&quot;&quot;Return retrieved items for a query.&quot;&quot;&quot;<br><br>    def answer(self, query: str) -&gt; dict:<br>        &quot;&quot;&quot;Return an answer and the associated retrieval output.&quot;&quot;&quot;</pre><p>I also created a file-based Vector Store for embeddings and documents.</p><pre>from pathlib import Path<br>from rag import NaiveRAG, VectorStore<br><br>amphibian_dir = Path(&quot;Libraries/Smoke Test&quot;) # Get the path<br>vectors = VectorStore(library=amphibian_dir) # Create a Embeddings<br><br>nr = NaiveRAG(vector_store=vectors) # Initialize the RAG architecture for the<br>                                    # library in question.</pre><p>And the final important part: I created a LLM-as-a-judge to run RAG architecture against different evals.</p><pre>from evals import LLMAsAJudge<br>from pathlib import Path<br><br>smoke = Path(&quot;Eval Data/Smoke Test.json&quot;)<br>simple_eval = Path(&quot;Eval Data/Amphibians Of Yosemite.json&quot;)<br><br>judge = LLMAsAJudge(eval=smoke, rag_system=nr)<br><br>judge.run()</pre><p>Now that I had a way to build and compare architectures, all I had to do was implement each specific one. So, here’s the 5 architectures I built how how they did in more detail, by question types:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J9QsHaoJEZNfCpy_IsHS2g.png" /></figure><p>Retrieval Stayed pretty high no matter what was used:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kD02FKPVFpCqF-AAocU2Aw.png" /></figure><p>Groundedness was the same</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uOLDuRCObfY0wHFFrCrjcg.png" /></figure><h3>Some Limitations</h3><p>The biggest limitation is the type and size of the dataset.</p><p>This eval is small. It’s 50 questions. Which means there’s far fewer questions for each sub type.</p><p>The eval is also mostly AI generated, which means there’s a good chance some of these documents are not antagonistic but easier to find in the documents because the queries may be phrased (included embedding) in a similar way to how the documents were embedded. This would artificially inflate the numbers.</p><p>This particular eval is a very particular type of information that lends itself well to a particular architecture — multi query (ALL).</p><p>It’s possible to fit the whole dataset into the context and always answer correctly because of a few things:</p><ol><li>Wikipedia pages tend to not have overlapping facts nor conflicting information, meaning each page is an authoritative source of information.</li><li>The context window of GPT is high enough to fit A LOT of retrieved info</li></ol><p>The architecture that benefits from this, and was by far the best performing, was Multi-Query (ALL) because it allowed for the most facts— 3 retrieved chunks for 5 rephrased questions meant that Multi-Query (ALL) Had 15 chunks in context, and the others only had 3. That’s a big information gap.</p><p>Here’s how the datasets and evals would look in order to favor the other architectures:</p><p><strong>Decomposition: </strong>If the model was strong in reasoning and the dataset was hierarchical like a textbook or manual, and the eval questions weren’t for facts but problems that required following a procedure found in different parts of the library.</p><p><strong>Fusion:</strong> If the documents contain jargon or synonyms and EXACT wording is necessary (codebases are a DIRECT application of Fusion) or the documents are all separate accounts of the same thing like power rankings, top restaurants from different publications.</p><p><strong>HyDE:</strong> If the model creating the HyDE was an subject matter expert and all the eval questions were ambiguous or contained very little differentiating jargon to match the dataset, like a new hobbyist trying to find niche information without knowing the language or jargon.</p><p>Anyways, here’s how each was implemented:</p><h3>1. Naive RAG</h3><p>The most basic way to build RAG.</p><ol><li>Take the query.</li><li>Embed the query.</li><li>Search the vector store for similar embeddings to the embedded query.</li><li>Use the found info to answer the query.</li></ol><h3>2. Multi-Query (Top 3 and All)</h3><p>An issue is that the way a user phrases a question can impact its accuracy.</p><p>What if there was a way of uncovering the intent of the question so that the way the question is asked matters less? That’s multiquery.</p><ol><li>Take the query.</li><li>Rephrase the query X number of times.</li><li>Embed all these queries.</li><li>For each query, search the vector store for similar embeddings.</li><li>Look at all the embeddings, and pick the highest matches and use these as the found info.</li><li>Use the found info to answer the query.</li></ol><p>So the question is rephrased several times and each rephrased question has it’s own search. Then these documents are reranked to pick the highest overall from ALL the questions.</p><p>The outcome is that the intent of the question is what is being searched over.</p><pre>def answer(self, query: str) -&gt; dict:<br>        template = f&quot;&quot;&quot;You are an AI language model assistant. Your task is to generate five <br>different versions of the given user question to retrieve relevant documents from a vector <br>database. By generating multiple perspectives on the user question, your goal is to help<br>the user overcome some of the limitations of the distance-based similarity search. <br>Provide these alternative questions separated by newlines.&quot;&quot;&quot;<br><br>        client = OpenAI()<br>        response = client.responses.parse(<br>            model=&quot;gpt-5.4-mini&quot;,<br>            input=[<br>                {<br>                    &quot;role&quot;: &quot;system&quot;,<br>                    &quot;content&quot;: template,<br>                }, {<br>                    &quot;role&quot;: &quot;user&quot;,<br>                    &quot;content&quot;: query,<br>                },<br>            ],<br>            text_format=MultiQuery<br>        )<br><br>        multiquery = response.output_parsed<br><br>        search_results = []<br>        for q in multiquery.response:<br>            search_results.append(self.search(q))<br><br>        print(search_results)<br>        context = self.flatten_results(search_results)<br><br>        response = client.responses.create(<br>            model=&quot;gpt-5.4-mini&quot;,<br>            # Pass query through exactly as provided, with no formatting changes.<br>            input=f&quot;&quot;&quot;Answer the following question based on this context:<br>            {context}<br><br>            Question: {query}<br>            &quot;&quot;&quot;,<br>        )<br>        answer_text = response.output_text<br><br>        return {<br>            &quot;question&quot;: query,<br>            &quot;answer&quot;: answer_text,<br>            &quot;search_result&quot;: context,<br>        }</pre><h3>3. Decomposition</h3><p>An issue is some questions can be complex or loaded (i.e “Why doesn’t he/she love me?” or “How do I build an app?”)</p><p>What if there was a way of breaking a loaded or complex question down into simpler questions?</p><ol><li>Take the query.</li><li>Break the query into smaller sub-questions.</li><li>Embed each sub-question.</li><li>For each sub-question, search the vector store for similar embeddings.</li><li>Use the subquestions and the found info for each subquestion to answer the main question.</li></ol><p>The outcome is that complex questions become easier to answer because each part of the question gets its own retrieval step.</p><pre>ef answer(self, query: str) -&gt; dict:<br>        template = &quot;&quot;&quot;<br>You are a multi-query generator for NaiveRAG.<br><br>Given one user query, produce a list of simpler retrieval-oriented questions that maximize recall while staying relevant to the original query.<br><br>Return output in this exact shape:<br><br>{<br>  &quot;response&quot;: [&quot;...&quot;, &quot;...&quot;]<br>}<br><br>Requirements:<br>- Output only the `response` field.<br>- Each string must be a complete standalone question.<br>- Do not answer the user&#39;s question.<br>- Do not include commentary or reasoning.<br>- Do not repeat the same idea with minor wording changes.<br>- Decompose by:<br>  - splitting multi-hop questions into intermediate factual questions<br>  - separating comparisons into one question per compared item plus one direct comparison question if useful<br>  - separating constraint bundles into individual constraint-checking questions<br>  - isolating definitions, causes, mechanisms, timelines, and consequences when present<br>- Keep the list concise and useful for retrieval.<br>- Use 1 to 6 questions total.<br>- If decomposition is unnecessary, return the original query as a single-item list.<br>- Favor wording that is likely to match relevant documents.<br><br>The goal is not brainstorming. The goal is retrieval-effective decomposition.<br>                   &quot;&quot;&quot;<br><br>        client = OpenAI()<br>        response = client.responses.parse(<br>            model=&quot;gpt-5.4-mini&quot;,<br>            input=[<br>                {<br>                    &quot;role&quot;: &quot;system&quot;,<br>                    &quot;content&quot;: template,<br>                }, {<br>                    &quot;role&quot;: &quot;user&quot;,<br>                    &quot;content&quot;: query,<br>                },<br>            ],<br>            text_format=MultiQuery<br>        )<br><br>        multiquery = response.output_parsed<br><br>        search_results = []<br>        for q in multiquery.response:<br>            search_results.append(self.search(q))<br><br>        print(search_results)<br>        context = self.flatten_results(search_results)<br><br>        response = client.responses.create(<br>            model=&quot;gpt-5.4-mini&quot;,<br>            # Pass query through exactly as provided, with no formatting changes.<br>            input=f&quot;&quot;&quot;Answer the following question based on this context:<br>            {context}<br><br>            Question: {query}<br>            &quot;&quot;&quot;,<br>        )<br>        answer_text = response.output_text<br><br>        return {<br>            &quot;question&quot;: query,<br>            &quot;answer&quot;: answer_text,<br>            &quot;search_result&quot;: context,<br>        }</pre><h3>4. Fusion</h3><p>An issue is if I do multiple searches, the top document is the one with the highest match. This means that the search with the strongest feelings towards its found info will win out — there’s no agreements between searches.</p><p>Here’s the steps I’ve used:</p><ol><li>Take the query.</li><li>Rephrase the query X number of times.</li><li>Embed all these queries.</li><li>For each query, search the vector store for similar embeddings.</li><li>Look at all the embeddings and use Reciprocal Rank Fusion to rerank the found info.</li><li>Use the reranked found info to answer the query.</li></ol><p>The outcome is that not only are queries forced to agree on the found info, but this method is abstract enough that different types of searches like BM25 and key word search can also be added!</p><pre>def rrf(ranked: list, k: int = 60) -&gt; dict:<br>    scores = {}<br>    for ls in range(len(ranked)):<br>        for rank in range(len(ranked[ls])):<br>            doc = ranked[ls][rank]<br>            if doc in scores:<br>                scores[doc] += 1 / (k + rank + 1)<br>            else:<br>                scores[doc] = 1 / (k + rank + 1)<br>    return scores</pre><h3>5. Hypothetical Document Embeddings (HyDE)</h3><p>Sometimes user questions don’t have the detail to match documents in the vector store.</p><p>What if there was a way of thinking up answers to the question, and then using RAG to verify correctness?</p><ol><li>Take the query.</li><li>Use an LLM to generate a hypothetical document that answers the query.</li><li>Search the vector store for similar embeddings to the HyDE.</li><li>Use the found info to answer the original query.</li></ol><p>So instead of embedding the user’s short question directly, HyDE embeds a generated answer-like document.</p><p>The outcome is the added details from the hypothetical answer can act as context that improves retrieval. It’s only used to search better — the final answer still comes from the real documents found in the vector store.</p><pre>def answer(self, query: str) -&gt; dict:<br>        template = f&quot;Write a concise, factual passage that would answer this question:\n{query}&quot;<br><br>        client = OpenAI()<br>        response = client.responses.parse(<br>            model=&quot;gpt-5.4-mini&quot;,<br>            input=[{<br>                &quot;role&quot;: &quot;user&quot;,<br>                &quot;content&quot;: query,<br>                },<br>            ],<br>            text_format=MultiQuery<br>        )<br><br>        multiquery = response.output_parsed<br><br>        search_results = []<br>        for q in multiquery.response:<br>            search_results.append(self.search(q))<br><br>        print(search_results)<br>        context = self.flatten_results(search_results)<br><br>        response = client.responses.create(<br>            model=&quot;gpt-5.4-mini&quot;,<br>            # Pass query through exactly as provided, with no formatting changes.<br>            input=f&quot;&quot;&quot;Answer the following question based on this context:<br>            {context}<br><br>            Question: {query}<br>            &quot;&quot;&quot;,<br>        )<br>        answer_text = response.output_text<br><br>        return {<br>            &quot;question&quot;: query,<br>            &quot;answer&quot;: answer_text,<br>            &quot;search_result&quot;: context,<br>        }</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae27dc4070a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning How RAG is Measured Changed How I Design Evals]]></title>
            <link>https://medium.com/@n8wyliu/learning-how-rag-is-measured-changed-how-i-design-evals-7b13f1fbcf24?source=rss-6158d2d8b8be------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b13f1fbcf24</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[llm-evaluation]]></category>
            <dc:creator><![CDATA[Nat Liu]]></dc:creator>
            <pubDate>Fri, 19 Jun 2026 14:01:05 GMT</pubDate>
            <atom:updated>2026-06-22T01:53:14.680Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>I built a simple eval. But the more I learned about how RAG is built and measured, the more my evals changed.</blockquote><p>There are plenty of benchmarks out there, but I decided I wanted to build my own.</p><h3>How it ended</h3><p>Here’s what I ended up with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YTS82U2ceoAma6UzyJSVIA.png" /><figcaption>50 Questions. Image By Author.</figcaption></figure><h3>And here’s how it started.</h3><p><strong>I like wildlife, so I picked that as my niche</strong></p><h3>I grabbed a bunch of Wikipedia pages on different amphibians in Yosemite.</h3><p>I knew I needed questions and answers.</p><p><em>I’d read through the first page on Bullfrogs, and I formed questions by finding nice pieces of information from the Wikipedia article. Those were my answers. Then I’d make a question for that answer.</em></p><h4>I made 6 to start:</h4><pre>{<br>  &quot;id&quot;: &quot;amphibians_001&quot;,<br>  &quot;question&quot;: &quot;What do Bullfrogs eat?&quot;,<br>  &quot;answer&quot;: &quot;They are generalist carnivores, consuming a wide variety of prey. In turn, they are eaten by predators such as alligators, snakes, and birds.&quot;,<br>  &quot;source&quot;: &quot;American bullfrog - Wikipedia.html&quot;<br>}</pre><h4>So I had correctness — the first eval metric.</h4><p>My eval could check if I had the correct answer, and I had a naive way of checking how accurate I was at <em>finding</em> the source material</p><h3>Then I Started Measuring Accuracy AND Precision.</h3><p>My RAG architectures were getting more complicated — they could reference more than one document to find the correct answer.</p><h4>Retrieval — second of three metrics for an eval.</h4><p>It measures if I found the right document. But I could <strong><em>cite all the documents and always retrieve the correct document</em></strong>. I could game the system.</p><h3><strong>I wasn’t measuring how many shots it took for a hit.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MIGFSR5zLKkRmKlQCGLWPg.png" /><figcaption>Accuracy without precision can mislead. AI Generated.</figcaption></figure><h4>Now I can measure retrieval better — hit rate!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Od1_vrptf72F1xdJJKxaRw.png" /><figcaption>Equation to measure Recall@K. Text Generated by ChatGPT.</figcaption></figure><h3>I was missing an entire set of question types</h3><p>Here’s an example:</p><p><em>“Which amphibian species in Yosemite toxic or poisonous?”</em></p><h4>I’d have to reference multiple documents.</h4><pre>// I needed this:<br>&quot;source_docs&quot;: [<br>    &quot;American bullfrog - Wikipedia.html&quot;,<br>    &quot;Arboreal salamander - Wikipedia.html&quot;,<br>    &quot;California toad - Wikipedia.html&quot;,<br>    &quot;Ensatina - Wikipedia.html&quot;,<br>    &quot;Gregarious slender salamander - Wikipedia.html&quot;,<br>    &quot;Hell Hollow slender salamander - Wikipedia.html&quot;,<br>    &quot;Mount Lyell salamander - Wikipedia.html&quot;,<br>    &quot;Pacific tree frog - Wikipedia.html&quot;,<br>    &quot;Sierra Nevada yellow-legged frog - Wikipedia.html&quot;,<br>    &quot;Sierra newt - Wikipedia.html&quot;,<br>    &quot;Yosemite toad - Wikipedia.html&quot;<br>  ]<br>// Not this:<br>&quot;source&quot;: &quot;American bullfrog - Wikipedia.html&quot;</pre><h3>Then I Started Measuring Guesswork.</h3><p>My reference didn’t matter if I disregarded the evidence.</p><h4>Groundedness — the final criteria for an eval.</h4><p>Groundedness checks whether the LLM is using the docs to figure out the answer. I’d need questions that can’t really be answered.</p><h3>I wasn’t asking ambiguous or unanswerable questions to catch these errors.</h3><p>It’s a way to catch when I cite the right source and say the wrong thing, which has a different fix than if I’m just plain incorrect.</p><p>Like answers to questions that aren’t gonna be in any document:</p><pre>// Add ambiguous and unanswerable questions to stress test Groundedness<br>// No document says anything about Mars.<br>{<br>  &quot;id&quot;: &quot;amphibians_021&quot;,<br>  &quot;question&quot;: &quot;Which amphibian species in this corpus lives on Mars?&quot;,<br>  &quot;reference_answer&quot;: &quot;&quot;,<br>  &quot;source_docs&quot;: []<br>}</pre><p>Or ambiguous one that needs a guess:</p><pre>// The LLM would have to decide who &quot;they&quot; is.<br>{<br>  &quot;id&quot;: &quot;amphibians_050&quot;,<br>  &quot;question&quot;: &quot;What kind of habitat do they like?&quot;,<br>  &quot;reference_answer&quot;: &quot;&quot;,<br>  &quot;source_docs&quot;: []<br>}</pre><h3>Then I ran my Eval</h3><p>It was against a bunch of different architectures I was building while making these evals.</p><h4>Looks mostly even…</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zVrw6KFEc8Oa1z9bpXKrNA.png" /><figcaption>The common way to check how well RAG is doing is to measure it on correctness, groundedness, and recall. Naive, Decomposition, Fusion, Multi-Query, and HyDE are all different RAG architectures. Image by Author</figcaption></figure><h3>I didn’t know where I was struggling</h3><p>The last thing: adding categories meant I can see how well each RAG performs on different types of questions:</p><h3>Then I added Categories</h3><p>Using questions that showed whether I was answering a fact, synthesis, ranking, etc. Meant I could see exactly where these architectures were failing.</p><pre>{<br>  &quot;id&quot;: &quot;amphibians_001&quot;,<br>  // Added categories means I can check how well RAG does on different<br>  // workloads.<br>  &quot;question_type&quot;: &quot;single-document fact&quot;, <br>  &quot;question&quot;: &quot;What do Bullfrogs eat?&quot;,<br>  &quot;reference_answer&quot;: &quot;They are generalist carnivores, consuming a wide variety of prey. In turn, they are eaten by predators such as alligators, snakes, and birds.&quot;,<br>  &quot;source_docs&quot;: [<br>    &quot;American bullfrog - Wikipedia.html&quot;<br>  ]<br>}</pre><h3>Then I checked against task types</h3><p>For example, all these implementation did pretty terribly on certain types of questions, something I wouldn’t have seen from the overall plot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V4F2xi8srpTJUwwYb4QDQg.png" /><figcaption>The overall plot shows some of these systems are neck and neck, but a more nuanced take tells a different story. One I wouldn’t have known if I didn’t have different question types. Image by Author</figcaption></figure><p>Now I have a stronger viewpoint on which RAG systems are better depending on the types of questions I need to ask.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b13f1fbcf24" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built Auth From Scratch. Now I Understand Why Everyone Pays for Firebase.]]></title>
            <link>https://medium.com/@n8wyliu/i-built-auth-from-scratch-now-i-understand-why-everyone-pays-for-firebase-4c9c090fe53a?source=rss-6158d2d8b8be------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c9c090fe53a</guid>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Nat Liu]]></dc:creator>
            <pubDate>Mon, 08 Jun 2026 16:01:02 GMT</pubDate>
            <atom:updated>2026-06-08T16:01:02.036Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>It took a day to build an auth server. Every hour was another reason to stop.</blockquote><p><em>Authentication</em> is how I know you’re you. <strong>Authorization</strong> is how I know you’re allowed to do that. Authentication is very tricky.</p><p>The architecture was easy enough.</p><ul><li>There’s two authentication databases: Users and Sessions.</li><li>There’s a lot of hashing and tokens</li></ul><p>Well, the devil’s in the details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uDX5Qo_m6ZdQ0IH3PVD8pA.png" /><figcaption>Photo by Author</figcaption></figure><h3>Signing Up and In</h3><p>I’m familiar with signups, I’ve done it. We’ve all signed up for <em>something</em>. On the backend, I had a database with these columns:</p><pre>CREATE TABLE users (<br>  id UUID PRIMARY KEY,<br>  email TEXT UNIQUE NOT NULL,<br>  password_hash TEXT NOT NULL,<br>);</pre><p>Then there’s the signup form. Sign up? create a row in the table, store the password, call it a day, right?</p><p>Maybe… But what about sign ins? Compare the passwords and call it day?</p><pre># Bad<br>@app.post(&quot;/login&quot;)<br>def login(username: str, password: str, db: Database):<br>    user, password = db.getUserAndPassword()<br><br>    # Where&#39;s the hashing????<br>    if password != db_password:<br>        raise HTTPException(status_code=401, detail=&quot;Trust me, you&#39;re not that guy.&quot;)<br>    <br>    # Suspicious depending on how authenticated=True is used.<br>    return {<br>        &quot;authenticated&quot;: True,<br>    }</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*-uFCZ1-KQmEQ8Ym9Qa-Vbg.jpeg" /><figcaption>Side Eyeing Chloe, <a href="https://en.wikipedia.org/wiki/Side_Eyeing_Chloe">Wikipedia</a></figcaption></figure><h4>What about hashing? That’s what passwords crave!</h4><pre># Bad but good intentions<br>@app.post(&quot;/login&quot;)<br>def login(username: str, password: str, db: Database):<br>    db_user, db_password = db.getUserAndPassword()<br>    <br>    # SHA256 and MD5 are fast hashes! Fast==Bad. Plus, where&#39;s the salt <br>    # and pepper?<br>    hashed_password = hashlib.sha256(password.encode(&quot;utf-8&quot;)).hexdigest()<br><br>    # Now there&#39;s hashing, but it&#39;s the wrong kind <br>    if hashed_password != db_password:<br>        raise HTTPException(status_code=401, detail=&quot;Trust me, you&#39;re not that guy.&quot;)<br>    <br>    # Suspicious depending on how authenticated=True is used.<br>    return {<br>        &quot;authenticated&quot;: True,<br>    }</pre><p><strong>Don’t use SHA-256 or MD5. Passwords don’t crave SHA-256.</strong></p><p>These work if my user’s got a great password like:</p><blockquote>67lizardlizardlizardlizardlizardlizardlizardlizardlizardlizardlizardlizardlizardlizardlizardlizardlizardlizardliz67ardlizardlizardlizardlizardlizardlizardlizardlizardlizardlizardlizardlizardlizardlizard67</blockquote><p>But I’m screwing over everyone with:</p><blockquote>p@55word</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*yI9WKgBVGA5mqJaMMqZENw.png" /><figcaption><a href="https://analogist.net/post/a-non-technical-history-of-password-storage/">A password hash table, similar to a rainbow table</a> that hackers can use to brute force passwords.</figcaption></figure><p>A GPU from can crack that in 4 hours. <a href="https://blog.codinghorror.com/speed-hashing/">Here’s the evidence</a>. <strong>Wait</strong>. <em>Scratch that — </em><strong><em>It’s 2026 and a GPU from 2012 (almost 15 years ago) can crack that in 4 hours.</em></strong></p><pre># Better<br>@app.post(&quot;/login&quot;)<br>def login(username: str, password: str, db: Database):<br>    db_user, db_password = db.getUserAndPassword()<br>    <br>    # Bcrypt is a slow hash! Slow==Good. <br>    hashed_password = bcrypt.hashpw(password.encode(&quot;utf-8&quot;), bcrypt.gensalt())<br><br>    # Now there&#39;s slow hashing :)<br>    if hashed_password != db_password:<br>        raise HTTPException(status_code=401, detail=&quot;Trust me, you&#39;re not that guy.&quot;)<br>    <br>    # Suspicious depending on how authenticated=True is used.<br>    return {<br>        &quot;authenticated&quot;: True,<br>    }</pre><p>Is that it? If only.</p><p>Take a look at this:</p><pre>return {<br>    &quot;authenticated&quot;: True,<br>}</pre><p>There’s gotta be a better way.</p><blockquote>I thought all I needed was to know how to hash good.</blockquote><h3>Sessions</h3><p>I don’t want to sign in every time I need to use a service. I’m using a slow hash. Emphasis on <strong><em>slow.</em></strong></p><blockquote>Slow and Production are like toxic exes. They shouldn’t even be in the same room.</blockquote><p>If I want performance, I need sessions. This is like the “just add caching” from system design 101.</p><p>A successful sign in can generate a token.</p><pre>@app.post(&quot;/login&quot;)<br>def login(username: str, password: str, token: str, db: Database):<br>    # Proceed with the standard login<br>    db_user, db_password = db.users.getUserAndPassword()<br><br>    # Hash the password and check it in one line!<br>    if not bcrypt.checkpw(password.encode(&quot;utf-8&quot;), db_password):<br>        raise HTTPException(status_code=401, detail=&quot;Trust me, you&#39;re not that guy.&quot;)<br>    <br>    # Create the Session Token when a login is successful.<br>    session_token = secrets.token_urlsafe(32)<br>    db.createSessionForUser(session_token, db_user)    <br>  <br>    # authenticated: True can now be a token instead!<br>    return {<br>        &quot;token&quot;: session_token,<br>    }</pre><p>But I’m not checking a session, I’m just creating one? Auth0 uses /userinfo. There’s more to that particular endpoint, but for now:</p><pre>@app.post(&quot;/userinfo&quot;) # or maybe @app.post(&quot;/me&quot;)<br>def verify_session(request: Request, db: Database):<br>    session_token = request.cookies.get(&quot;session_id&quot;)<br>    current_session = db.getUserSession(session_token)<br>   <br>    # Get valid session<br>    if current_session and (session_token == current_session):<br>        return {<br>            &quot;authenticated&quot;: True,<br>            &quot;user_id&quot;: session.user_id,<br>        }<br>    else:<br>        raise HTTPException(status_code=401, detail=&quot;Log in, pls.&quot;)</pre><p>The mechanism can be Session Cookies:</p><pre>@app.post(&quot;/login&quot;)<br>def login(username: str, password: str, db: Database, response: Response)<br>    # Proceed with the standard login<br>    db_user, db_password = db.users.getUserAndPassword()<br><br>    # Hash the password and check it in one line!<br>    if not bcrypt.checkpw(password.encode(&quot;utf-8&quot;), db_password):<br>        raise HTTPException(status_code=401, detail=&quot;Trust me, you&#39;re not that guy.&quot;)<br>    <br>    # Create the Session Token when a login is successful.<br>    session_token = secrets.token_urlsafe(32)<br>    db.createSessionForUser(session_token, db_user)    <br>    <br>    # Create a session cookie <br>    response.set_cookie(<br>        key=&quot;session_id&quot;,    # Cookie Key<br>        value=session_token, # Cookie Value<br>        httponly=True,       # Mitigate XXS <br>        secure=True,         # Use HTTPS<br>        samesite=&quot;strict&quot;,   # Mitigate CSRF with strict<br>        path=&quot;/&quot;,<br>        max_age=604800,      # Always make cookies expire<br>    )<br><br>    # Go back to authenticated=True to avoid leaking the cookie.<br>    return {<br>        &quot;authenticated&quot;: True<br>    }</pre><pre># Server Response to a log in that sets session cookies<br>HTTP/1.1 200 OK<br>Set-Cookie: session_id=sess_abc123xyz789; HttpOnly; Secure; SameSite=Strict; Path=/; Max-Age=604800<br>Content-Type: application/json<br><br>{<br>  &quot;authenticated&quot;: True<br>}</pre><p>Later, the user sends a request that hits the endpoint:</p><pre># Client requests now look like<br>POST /userinfo HTTP/1.1<br>Host: app.example.com<br>credentials: &quot;include&quot;</pre><pre>@app.post(&quot;/userinfo&quot;) # or maybe @app.post(&quot;/me&quot;)<br>def verify_session(request: Request, db: Database):<br>    # Get them cookies<br>    session_token = request.cookies.get(&quot;session_id&quot;)<br>    current_session = db.getUserSession(session_token)<br>   <br>    # Get valid session<br>    if current_session and (session_token == current_session):<br>        return {<br>            &quot;authenticated&quot;: True,<br>            &quot;user_id&quot;: session.user_id,<br>        }<br>    else:<br>        raise HTTPException(status_code=401, detail=&quot;Log in, pls.&quot;)</pre><p>The mechanism can be JWTs or API Keys:</p><pre>@app.post(&quot;/login&quot;)<br>def login(username: str, password: str, db: Database, response: Response):<br>    # Proceed with the standard login<br>    db_user, db_password = db.users.getUserAndPassword()<br><br>    # Hash the password and check it in one line!<br>    if not bcrypt.checkpw(password.encode(&quot;utf-8&quot;), db_password):<br>        raise HTTPException(status_code=401, detail=&quot;Trust me, you&#39;re not that guy.&quot;)<br>    <br>    # Create the Session Token when a login is successful.<br>    session_token = secrets.token_urlsafe(32)<br>    db.createSessionForUser(session_token, db_user)    <br><br>    # Go back to authenticated=True to avoid leaking the cookie.<br>    return {<br>        &quot;authenticated&quot;: True,<br>        &quot;key&quot;: session_token <br>    }</pre><pre># Server Response to Sign in<br>HTTP/1.1 200 OK<br>Content-Type: application/json<br><br>{<br>  &quot;authenticated&quot;: True,<br>  &quot;key&quot;: &quot;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.fake.payload.signature&quot;<br>}</pre><p>Later, the user sends a request that hits the endpoint:</p><pre># Client requests now look like<br>POST /userinfo HTTP/1.1<br>Host: api.example.com<br>Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.fake.payload.signature</pre><pre>@app.post(&quot;/userinfo&quot;) # or maybe @app.post(&quot;/me&quot;)<br>def verify_session(request: Request, db: Database):<br>    # Get the JWTs <br>    session_token = request.headers.get(&quot;Authorization&quot;).split(&quot; &quot;)<br>    current_session = db.getUserToken(session_token)<br>   <br>    # Get valid session<br>    if current_session and (session_token == current_session):<br>        return {<br>            &quot;authenticated&quot;: True,<br>            &quot;user_id&quot;: session.user_id,<br>        }<br>    else:<br>        raise HTTPException(status_code=401, detail=&quot;Log in, pls.&quot;)</pre><blockquote>AND NOW WE’RE STORING PLAIN TOKENS!</blockquote><p>Now I gotta secure tokens. It’s never ending. Session tokens should be hashed, like the passwords, but <strong><em>it’s ok to use a fast hash.</em></strong> In this case, it’s just to stop the tokens from being stored plain. That’s because the main reason to use tokens is to speed up subsequent logins.</p><pre># Bad<br><br># Get valid session<br>current_session = db.getUserToken(session_token)<br>if current_session and (session_token == current_session):<br>    return {<br>        &quot;authenticated&quot;: True,<br>        &quot;user_id&quot;: session.user_id,<br>    }</pre><pre># Better<br><br># Fast Hash the token<br>session_token = hashlib.sha256(token.encode(&quot;utf-8&quot;)).hexdigest()<br><br># Get valid, hashed session<br>current_session = db.getUserToken(session_token)<br>if current_session and (session_token == current_session):<br>    return {<br>        &quot;authenticated&quot;: True,<br>        &quot;user_id&quot;: session.user_id,<br>    }</pre><blockquote>And I haven’t even gotten to validation and rate limiting.</blockquote><p>I haven’t even touched a single product differentiating feature. If I’m building the next big thing, I gotta make sure I’m not spending too much time on stuff that isn’t business logic.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c9c090fe53a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Principal Component Analysis in ML]]></title>
            <link>https://medium.com/@n8wyliu/principle-component-analysis-in-ml-8731c7ebe386?source=rss-6158d2d8b8be------2</link>
            <guid isPermaLink="false">https://medium.com/p/8731c7ebe386</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[statistics]]></category>
            <dc:creator><![CDATA[Nat Liu]]></dc:creator>
            <pubDate>Wed, 10 Dec 2025 23:02:24 GMT</pubDate>
            <atom:updated>2026-10-05T12:59:30.142Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M_V3N-SNTdtg8FPjU0kKOw.png" /><figcaption><em>First Summary of Genetic Code by Marshall W. Nirenberg. 18 January 1965. </em><a href="https://profiles.nlm.nih.gov/spotlight/jj/catalog/nlm:nlmuid-101584910X475-img*"><em>https://profiles.nlm.nih.gov/spotlight/jj/catalog/nlm:nlmuid-101584910X475-img</em></a></figcaption></figure><p>Biology and Social Sciences dominated the turn of the 20th Century. Researchers were collecting a great deal of measurements like height, weight, limb lengths, etc. In an attempt to understand and link variables.</p><p>Handling and identifying correlations in these different measurements involved brute force and intuition. There were just too many measurements for each subject.</p><p>Working with these datasets — summarizing, visualizing, and drawing meaningful conclusions is cumbersome and difficult.</p><h3>There was a Statistics Golden Age happening, too.</h3><p>Karl Pearson, Ronald Fisher, and others were building on past works. Leading to new tools like PCA and FDA/LDA.</p><p>Not only were biologists recording any measurement they could get, there was a deep interest in how all this data correlated with one another, and whether or not measured variables could be explained by a combination of variables.</p><p><strong>A systematic way of identifying the important bits in the data was becoming a huge deal.</strong></p><h3>Well, that’s what PCA does.</h3><p>Suppose I’ve got some data points:</p><pre>&quot;&quot;&quot;<br>Measurements of the Species Gizmus Widgetmus<br><br>Leg Length: [1, 2, 3]<br>Hair Color (Scale 1-10 from black to white): [2, 3, 5]<br>Hair Length: [3, 5, 4]<br>Age: [4, 4, 6]<br>&quot;&quot;&quot;<br><br>import numpy as np <br><br>data = np.array([<br>    [1,2,3], # leg length<br>    [2,3,5], # hair color<br>    [3,5,4], # hair length<br>    [4,4,6]  # age<br>])</pre><p>I want to know which variables are responsible for the most change in the data — which measurements are most responsible for change. Here are the steps:</p><h3>Step 1. Center the Data / Normalization</h3><p>Under the hood, PCA is trying to identify which combinations of the variables are responsible for the most variance. Variance is how far data points can be from the mean.</p><pre># PCA needs it&#39;s data centered around the mean.<br>avg = np.mean(data, axis=0)<br>centered_data = data - avg</pre><pre>[[-1.5 -1.5 -1.5]<br> [-0.5 -0.5  0.5]<br> [ 0.5  1.5 -0.5]<br> [ 1.5  0.5  1.5]]</pre><h3>Step 2. Compute Covariance</h3><p>The next step is to compute covariance. Covariance is one of the most important tools in all of Machine Learning. Covariance is sometime called the feature matrix. Solving it is one of the primary steps not just in Principle Component Analysis, but also in all of Regression.</p><pre># Once I&#39;ve got variance, I can get covariance.<br>covariance = np.cov(centered_data)</pre><pre>[[ 0.          0.          0.          0.        ]<br> [ 0.          0.33333333 -0.5         0.16666667]<br> [ 0.         -0.5         1.         -0.5       ]<br> [ 0.          0.16666667 -0.5         0.33333333]]</pre><h3>Step 3. Compute the Determinant</h3><p>Now we solve the covariance matrix.</p><pre># Eigenvalues and eigenvectors are how I&#39;m going to interpret my PCA results.<br>eigenvalues, eigenvectors = np.linalg.eig(covariance)</pre><pre>Eigenvalues: [1.50000000e+00 1.66666667e-01 3.00888040e-17 0.00000000e+00]<br>Eigenvectors: [[ 0.00000000e+00  0.00000000e+00  0.00000000e+00  1.00000000e+00]<br> [-4.08248290e-01  7.07106781e-01  5.77350269e-01  0.00000000e+00]<br> [ 8.16496581e-01  2.67247170e-16  5.77350269e-01  0.00000000e+00]<br> [-4.08248290e-01 -7.07106781e-01  5.77350269e-01  0.00000000e+00]]</pre><h3>Step 4. Interpreting Results</h3><p>The two most important things:</p><h4><strong><em>Component Importance == Eigenvalue</em></strong></h4><p>But, there’s some extra work in getting the results into an interpretable form.</p><pre># this makes sure that the eigenvalues and vectors line up with eachother.<br>idx = np.argsort(eigenvalues)[::-1] <br>eigenvalues = eigenvalues[idx]<br>eigenvectors = eigenvectors[:, idx]</pre><p>I need the Eigenvalues to add up to 1 so I can give a percentage of the variance each one takes up.</p><pre># Here&#39;s how much each Principle Component Explains the variance in the data<br>total_variance = sum(eigenvalues)<br>console_out = &quot;Here&#39;s how much each principle component explains the variance in the data:\n&quot;<br>for i, eigenval in enumerate(eigenvalues):<br>    console_out += f&quot;Componenet {i+1}: {int((eigenval / total_variance)*100)} %\n&quot;<br>console.print(console_out)</pre><pre># Here&#39;s how much each principle component explains the variance in the data:<br>Componenet 1: 89 %<br>Componenet 2: 10 %<br>Componenet 3: 0 %<br>Componenet 4: 0 %</pre><p>Now I know that Component #1 explains most of the difference in individuals, with a little bit of Component #2. The other two don’t matter — they’re zero.</p><h4>Features that make up the Component == Eigenvector</h4><p>Now that I know the important Components, I can then figure out what the components are made up of.</p><pre># We know the components, but they&#39;re combinations of the features/columns.<br>console_out = &quot;&quot; # reusing string variable<br>console_out += &quot;But what do the principle components represent? The vectors point in the direction of most variance.\n&quot;<br>console_out += f&quot;Eigenvalues: [{&#39;, &#39;.join(f&#39;{eig:.2f}&#39; for eig in eigenvalues)}]\n&quot;<br>for i, eigenvect in enumerate(eigenvectors):<br>    console_out += f&quot;Component {i+1}: {eigenvect}\n&quot;<br>console.print(console_out)</pre><pre># But what do the principle components represent? <br># The vectors point in the direction of most variance.<br>         <br>Eigenvalues: [1.50, 0.17, 0.00, 0.00]<br>Component 1: [0. 0. 0. 1.]<br>Component 2: [-0.40824829  0.70710678  0.57735027  0.]<br># These ones don&#39;t matter because they do not explain any of the variance:<br>Component 3: [8.16496581e-01 2.67247170e-16 5.77350269e-01 0.00000000e+00]<br>Component 4: [-0.40824829 -0.70710678  0.57735027  0.]</pre><h3>Putting It All Together</h3><p>After performing PCA, I’ve got these two components that explain 99% of the variance in my dataset. Now all that’s left is to interpret the eigenvalues and eigenvectors I’ve calculated. The eigenvectors can also be written in another way. I’m going to rewrite the eigenvectors as equations. The only difference here is that each measurement is next to it’s importance (value from the eigenvector)</p><h4>Component #1</h4><p><strong>Principle Component #1 = 1.00 * Age</strong></p><p>This component explained 89% of the variance in the data. It’s all the last feature: [0, 0, 0, 1]. That feature in our data was age.</p><h4>Component #2</h4><p>This component explained 10% of the variance in the data.</p><p>It includes everything but last feature, age: [-0.41 -0.71, 0.57, 0.00]. This is a mix of features. But how do I interpret the negatives?</p><p><strong>Principle Component #2 = -0.4 * Leg Length + 0.7 Hair Color + 0.5 Hair Length</strong></p><p>This means a small amount of variance is from this: shorter legs is associated with lighter hair color and longer hair, and longer-legged individuals tend to have darker, shorter hair.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8731c7ebe386" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Backtracking]]></title>
            <link>https://medium.com/@n8wyliu/backtracking-b560ff123c90?source=rss-6158d2d8b8be------2</link>
            <guid isPermaLink="false">https://medium.com/p/b560ff123c90</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[Nat Liu]]></dc:creator>
            <pubDate>Wed, 03 Dec 2025 22:01:48 GMT</pubDate>
            <atom:updated>2025-12-03T22:01:48.299Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Generate every possible online shopping cart for the goods in my Shopify store. Create every possible outfit given my wardrobe.</blockquote><p>A class of algorithms used to find combinations, permutations, and subsets — for me they were a tip-of-the-tongue type of interview question that stumped me. I can best describe it as not studying for a test, but every question is doable — I just wasn’t sure how.</p><p>It’s loops like:</p><pre>shirts = [&quot;white t-shirt&quot;, &quot;blue button down&quot;]<br>pants = [&quot;blue jeans&quot;, &quot;black slacks&quot;]<br>shoes = [&quot;sneakers&quot;, &quot;chelsea boots&quot;]<br><br>for shirt in shirts:<br>  for pant in pants:<br>    for pair in shoes:<br>        combo = &quot; &quot;.join([shirt, pant, pair])<br>        print(combo)</pre><pre>white t-shirt, blue jeans, sneakers<br>white t-shirt, blue jeans, chelsea boots<br>white t-shirt, black slacks, sneakers<br>white t-shirt, black slacks, chelsea boots<br>blue button down, blue jeans, sneakers<br>blue button down, blue jeans, chelsea boots<br>blue button down, black slacks, sneakers<br>blue button down, black slacks, chelsea boots</pre><p>But! Let’s change it up.</p><p>Add hats, bags, socks, jewelry, watches, sweater, and coats.</p><p>Someone else picks all or some of these categories.</p><p><strong>This problem becomes much more difficult because now I can’t just hardcode the number of nested loops I need. <em>I have to find some other way to iterate through exponentials</em></strong></p><h3>Recursion → Depth First Search → Backtracking</h3><p>How I figured it out was by starting with recursion, the most basic way to get something that’s exponential.</p><p>It’s super basic, you need 2 things: the <strong>base case</strong> to stop the function, and the <strong>recursive call</strong> that assumes the function works.</p><pre>def binary(bin: str = None, n: int = 3) -&gt; None:<br>    &quot;&quot;&quot;<br>    Generate all binary strings until length n.<br>    &quot;&quot;&quot;<br>    if bin is None:<br>        bin = &quot;&quot;<br><br>    if len(bin) == n:<br>        print(bin, &quot;is one!&quot;)<br>        return<br>    else:<br>        print(bin)<br><br>    binary(bin+&quot;0&quot;, n)<br>    binary(bin+&quot;1&quot;, n)<br><br>binary()</pre><pre>0<br>00<br>000 is one!<br>001 is one!<br>01<br>010 is one!<br>011 is one!<br>1<br>10<br>100 is one!<br>101 is one!<br>11<br>110 is one!<br>111 is one!</pre><p>This looks like Depth First Search! Now I’m going to add a save state:</p><pre># add a new function. Put the save state and recursive call in the function<br># to have a localized state with methods.<br>def dfs_binary_strings(n: int = 3) -&gt; List[str]:<br>    results = []<br><br>    def dfs(pos: int, prefix: str):<br>        if pos == n:<br>            results.append(prefix)<br>            return<br>        dfs(pos + 1, prefix + &quot;0&quot;)<br>        dfs(pos + 1, prefix + &quot;1&quot;)<br><br>    dfs(0, &quot;&quot;)<br>    return results</pre><pre>0<br>00<br>000<br>001<br>01<br>010<br>011<br>1<br>10<br>100<br>101<br>11<br>110<br>111<br>[&#39;000&#39;, &#39;001&#39;, &#39;010&#39;, &#39;011&#39;, &#39;100&#39;, &#39;101&#39;, &#39;110&#39;, &#39;111&#39;]</pre><p>This looks like backtracking! All I want to add is an undo and a way to keep track of where I’m at:</p><pre>def binary_strings_no_consecutive_ones(n: int) -&gt; List[str]:<br>    results = []<br>    path = [] # add a path so that we can redo/undo<br>          <br><br>    def backtrack():<br>        if len(path) == n:<br>            results.append(&quot;&quot;.join(path))<br>            return<br>        for digit in [&quot;0&quot;, &quot;1&quot;]:<br>            if digit == &quot;1&quot; and path and path[-1] == &quot;1&quot;:<br>                continue<br>            <br>            # the backtracking magic<br>            path.append(digit)<br>            backtrack()<br>            path.pop()<br><br>    backtrack()<br>    return results</pre><pre>0<br>00<br>000<br>001<br>01<br>010<br>1<br>10<br>100<br>101<br>[&#39;000&#39;, &#39;001&#39;, &#39;010&#39;, &#39;100&#39;, &#39;101&#39;]</pre><p>And now I’ve got a general backtracking template.</p><h3>But that’s just the same thing three different times?</h3><p>Between Depth First Search and Backtracking, it’s a mindset thing. But, there’s more.</p><p>Word Search and N Queens are two problems where Depth First Search fails and Backtracking succeeds. It’s about reuse. Depth First Search will list out visited nodes/decisions and never go back to stop it from going into infinitely loops when cycles are present. But what if the problem requires you to undo? to <em>backtrack?</em> That’s where the inherent state of backtracking — namely the current save state and undo, allows it to find solutions that may get cut off (pruned) by Depth First Search.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b560ff123c90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Searching The Solution Space]]></title>
            <link>https://medium.com/@n8wyliu/searching-the-solution-space-41dd5e1415eb?source=rss-6158d2d8b8be------2</link>
            <guid isPermaLink="false">https://medium.com/p/41dd5e1415eb</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[Nat Liu]]></dc:creator>
            <pubDate>Fri, 19 Sep 2025 16:03:04 GMT</pubDate>
            <atom:updated>2025-09-19T16:03:04.931Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Think of the Painter’s Partition as Part 1, and this is Part 2.</blockquote><p>Searching the solution space is a programming technique to get the optimal value of something. Common problems are Split Sum Array, Aggressive Cows, Koko Eating Bananas, and the Painter’s Partition.</p><p>More practical solutions exist, too.</p><h4>Finger Commits with git bisect</h4><p>git bisect finds the first bad commit in the repo given a test. It’s mentioned in the <a href="https://docs.kernel.org/admin-guide/bug-bisect.html">Linux Kernel Docs</a> as a good way of eliminating pesky bugs, roughly summed up as “finding the change that caused an issue.” AND it’s got a workflow that closely matches the binary-search-solutions paradigm of define the bounds and feasibility/predicate then search.</p><pre>git bisect start # command<br>git bisect bad v6.1 # lower bound<br>git bisect good v6.0 # upper bound<br>git bisect run ./run_tests.sh   # your predicate</pre><h4>Performance Regressions on BIG Projects</h4><p>Chromium also uses similar tooling to find <a href="https://chromium.googlesource.com/chromium/src/tools/perf/">performance regressions.</a> See the actual code <a href="https://chromium.googlesource.com/chromium/chromium/%2B/refs/heads/trunk/tools/prepare-bisect-perf-regression.py">here</a>. The thing to look out for is the section at the bottom of the file:</p><pre><br># chromium/chromium/chromium/refs/heads/trunk/./tools/prepare-bisect-perf-regression.py<br>...<br># Here&#39;s the arguments we&#39;ve added via cmdline<br>(opts, args) = parser.parse_args() <br>...<br># Binary search on solution is this first line!<br>if not bisect_utils.CheckIfBisectDepotExists(opts):<br>  try:<br>    bisect_utils.CreateBisectDirectoryAndSetupDepot(opts,<br>        bisect_utils.DEFAULT_GCLIENT_CUSTOM_DEPS)<br>  except RuntimeError:<br>    return 1<br>return 0<br></pre><h4>Finding the balance on CSS Alignment with Blink</h4><blockquote>The browser effectively performs a binary search for the smallest width which doesn’t cause any additional lines — <a href="https://github.com/argyleink">Adam Argyle</a></blockquote><p>Chromium’s layout engine Blink has support for a very cool CSS style: text-wrap: balance. This basically tells the browser to find the best wrapping solution for the text without needing to fiddle around with handling many screen sizes. <a href="https://developer.chrome.com/docs/css-ui/css-text-wrap-balance?utm_source=chatgpt.com">View the docs here</a>.</p><h4>Solution Searches can be found Anywhere</h4><p>Searching the Solution Space is a go-to tool for problems with the following 3 characteristics: the answer can be <strong>guessed</strong> and checked, the guess can be <strong>checked relatively quickly</strong>, and the answer is always increasing OR decreasing, but never both.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41dd5e1415eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Painter’s Partition]]></title>
            <link>https://medium.com/@n8wyliu/painters-partition-4bfd6f51ff0a?source=rss-6158d2d8b8be------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bfd6f51ff0a</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[Nat Liu]]></dc:creator>
            <pubDate>Wed, 17 Sep 2025 21:05:49 GMT</pubDate>
            <atom:updated>2025-09-17T21:05:49.405Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>TLDR </strong>If I’m looking for the minimum maximum subarray:</blockquote><blockquote>1. I’m gonna create a helper function for finding the maximum subarray.</blockquote><blockquote>2. I’m gonna bound it by the smallest and largest values I’m expecting.</blockquote><blockquote>3. Then I’m gonna binary search the [smallest, largest] from step 2. If my max subarray says the answer is possible, I can go smaller. If I break out of my constraint to get the answer, I’m gonna try bigger.</blockquote><blockquote>4. I’m replacing low and hi with the midpoint each time. I know my lowest is always possible and when I end, I pick that low — the smallest maximum subarray.</blockquote><p>In a recent assessment I had a similar problem, and I bombed it.</p><h3>The Problem</h3><p>Given <strong>N </strong>boards of varying length, and <strong>k </strong>painters, the goal is to divide the boards between the painters. But there’s a catch — it’s to minimize the time that all the painters have to wait for one painter to finish, since they all leave at the same time.</p><pre>def painter_partition(lengths: List[int], k: int) -&gt; int:<br>  # Your Code Here :p <br>  return</pre><p>How about an example first:</p><p>Lengths: [10, 20, 30, 40] and K=2</p><pre>[10, 20, 30, 40][] # 100 and 0<br><br>[10,20,30][40] # 60 and 40 - this is the best choice<br><br>[10,20][30,40] # 30 and 70<br><br>[10][20, 30, 40] # 10 and 90<br><br>[][10,20,30,40] # 0 and 100</pre><p>We want to find the minimum maximum we can have by splitting the array into K subarrays.</p><h3>The Solution</h3><blockquote>O(n log n) Time and O(1) Space</blockquote><p>Since we’re searching for a minimum/best option, thinking of dynamic programming where to check every possible solution is on the right track. There’s an excellent way of solving these problems called a binary search on answers. <em>If you didn’t get it that’s ok this is a new problem space and introduction to a technique of modifying the binary search algorithm.</em></p><p>So what I gotta do is perform binary search. But instead of checking if value == target , I check value == feasible(value, k). That’s it. That’s the trick.</p><pre>from typing import List # for type list -&gt; List[int]<br><br>def painters_partition(lengths: List[int], k: int) -&gt; int:<br>    &quot;&quot;&quot;<br>    Time complexity: O(n log sum(lengths))<br>    Space: O(1)<br><br>    Painter&#39;s Partition (contiguous assignment).<br>    Returns the minimal total time to finish painting when all <br>    painters have equal speed.<br>    <br>    ARGUMENTS:<br>    lengths: non-negative lengths of contiguous sections (must <br>             be painted in order.)<br>    k:       number of painters (k &gt;= 1)<br>    <br>    RETURNS<br>    An integer representing the minimum possible time to finish <br>    painting. NOT the index! <br><br>    &quot;&quot;&quot;<br>    # Catch any unexpected inputs<br>    if not lengths:<br>        return 0<br>    if k &lt;= 0:<br>        raise ValueError(&quot;k must be &gt;= 1&quot;)<br>    <br>    # The algorithm<br>    # Define the bounds<br>    lo = max(lengths)<br>    hi = sum(lengths)<br>    <br>    # Define success<br>    def can(lengths: list, k: int, cap: int) -&gt; bool:<br>        painters = 1<br>        curr = 0<br>        for x in lengths:<br>            if curr + x &lt;= cap:<br>                curr += x<br>            else:<br>                painters += 1<br>                curr = x<br>                if painters &gt; k:<br>                    return False<br>        return True<br>    <br>    # Perform the search<br>    while lo &lt; hi:<br>        mid = (lo + hi) // 2<br>        if can(lengths, k, mid):<br>            hi = mid<br>        else:<br>            lo = mid + 1<br><br>    return lo</pre><h4>Define the bounds</h4><p>What are we searching for? We’re doing a binary search on the answer space. <em>Our answer is in units of largest sums of subarrays.</em></p><p>THIS IS NOT THE SPACE WE’RE SEARCHING:</p><pre>[10, 20, 30, 40][] # 100 and 0<br><br>[10,20,30][40] # 60 and 40 - this is the best choice<br><br>[10,20][30,40] # 30 and 70<br><br>[10][20, 30, 40] # 10 and 90<br><br>[][10,20,30,40] # 0 and 100</pre><p>The space we’re searching is EVERY POSSIBLE PARTITION OF THE ARRAY. I’m not writing the whole thing in there, but it’s n(n+1)/2 which is 10 options.</p><p>The smallest sum of a subarray is when every subarray has one value. <strong>The largest of these smallest sums is the biggest element in the array.</strong> lowest = max(lengths)</p><p>The largest sum of a subarray is when one subarray has every value. <strong>The largest of these largest sums is the only subarray there.</strong> highest = sum(lengths)</p><p>I can pick a more inclusive space and be slower, or I can pick a less inclusive space for speed, but I’d be in danger of not including the best answer. The answer space for permutations is O(n^2), so it’s a good idea to make the answer space as small as possible.</p><h4>Define Success and Search!</h4><p>The second part that changes depending on the problem is the function that checks if the answer is possible. This replaces the if value == target: line in a tradition binary search.</p><p>This is probably the more difficult part, because this is another algorithm that’s stuffed inside. It’s a <strong>maximum subarray less than or equal to K, via sliding window*.</strong></p><p>*Only possible if the sums are monotonic increasing (aka no negatives)</p><pre>def can(lengths: list, k: int, cap: int) -&gt; bool:<br>    painters = 1<br>    curr = 0<br>    for x in lengths:<br>        if curr + x &lt;= cap:<br>            curr += x<br>        else:<br>            painters += 1<br>            curr = x<br>            if painters &gt; k:<br>                return False<br>    return True</pre><p>In search, this checks if the answer is possible.</p><pre>while low &lt; high:<br>    mid = (low + high) // 2<br>    if can(lengths, k, mid):<br>        hi = mid<br>    else:<br>        lo = mid + 1</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bfd6f51ff0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Structures and Algorithms: Merge Interval]]></title>
            <link>https://medium.com/@n8wyliu/data-structures-and-algorithms-merge-interval-22d9669776a0?source=rss-6158d2d8b8be------2</link>
            <guid isPermaLink="false">https://medium.com/p/22d9669776a0</guid>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Nat Liu]]></dc:creator>
            <pubDate>Mon, 15 Sep 2025 20:22:10 GMT</pubDate>
            <atom:updated>2025-09-15T20:22:10.390Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Merge interval has a sort O(n log n) and sweep O(n). But, if your intervals list is presorted, you only need to sweep. The output is O(n) at worst.</blockquote><pre>def merge_intervals(intervals: list) -&gt; list:<br>    &quot;&quot;&quot;<br>    Merge overlapping (and touching) intervals.<br>    Touching means [1,2] and [2,3] =&gt; [1,3].<br>    &quot;&quot;&quot;<br>    if not intervals:<br>        return []<br><br>    # 1) sort by start<br>    intervals.sort(key=lambda x: x[0])<br><br>    merged = []<br>    cur_start, cur_end = intervals[0]<br><br>    # 2) sweep<br>    for s, e in intervals[1:]:<br>        if s &lt; cur_end: # overlap<br>            cur_end = max(cur_end, e) # merge<br>        else:<br>            merged.append([cur_start, cur_end])<br>            cur_start, cur_end = s, e<br><br>    merged.append([cur_start, cur_end])<br>    return merged</pre><p>The merge interval problem is a classic algorithm pattern that shows up in coding interviews. I’ve never had one in any coding interview.</p><p>But! It’s an interesting way to solve problems where you’re given a set of tuples resembling the start and end of something.</p><h3>What can I do with it?</h3><p>So what? It’s not just something to memorize. There’s some real world applications to this, like figuring out the minimum arrows needed to pop all balloons!</p><h4>Peak Concurrent Users and Times</h4><p><em>If I have a service I need to scale, and I want to see when the most concurrent users are on at a time</em>, <em>I can count the highest amount of overlap, and the times in which this overlap occurs.</em></p><p>This is precisely the meeting rooms problem:</p><pre># Meeting Rooms II — minimum number of rooms required<br>def min_meeting_rooms(intervals: List[Tuple[int,int]]) -&gt; int:<br>    if not intervals:<br>        return 0<br><br>    starts = sorted(s for s, _ in intervals)<br>    ends   = sorted(e for _, e in intervals)<br><br>    rooms = 0<br>    i = j = 0<br>    # Walk both lists. If a meeting starts before the earliest current end,<br>    # we need a new room; otherwise free a room.<br>    while i &lt; len(starts):<br>        if starts[i] &lt; ends[j]:   # strict &lt; so end==start reuses room<br>            rooms += 1<br>            i += 1<br>        else:<br>            j += 1  # a meeting ended → free one room<br>    return rooms</pre><p>In situations of heavy spikes in user activity followed by significant drops, like having a country-specific service, being able to scale up and down can result in significant cost savings.</p><p>And if my user sessions are already sorted by or keyed by start time, I can scale decently.</p><p><em>In Compilers…</em></p><p><em>In memory management…</em></p><p><em>In databases and search engines…</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22d9669776a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Network Data Looks]]></title>
            <link>https://medium.com/@n8wyliu/how-network-data-looks-37f8c5593aec?source=rss-6158d2d8b8be------2</link>
            <guid isPermaLink="false">https://medium.com/p/37f8c5593aec</guid>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Nat Liu]]></dc:creator>
            <pubDate>Thu, 21 Aug 2025 19:58:22 GMT</pubDate>
            <atom:updated>2025-08-21T19:58:22.276Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>PCAP or it didn’t happen.</blockquote><p>Networks drive everything we do. When connected to a network, like the internet, I’m able to listen to music, watch movies, browse, shop, etc. I can do anything I want with the internet.</p><p>But how is my data transferred? I’m going to take a look at the humble packet as it goes from my device (the client!) to some server in Oregon (yes we’re talking water guzzling data centers here.)</p><h3>Application Layer: HTTP Requests and Responses</h3><p>Buy Now, Apply, Send, Sign In…</p><p>Or Hypertext Transfer Protocol; When I click a button or send a form that does something useful, that useful thing is usually some kind of request for data or to store something. This is the start.</p><pre>GET /v1/widgets?limit=50 HTTP/1.1<br>  Host: api.example.com<br>  User-Agent: curl/8.5.0<br>  Accept: application/json<br>  Accept-Language: en-US,en;q=0.9<br>  Accept-Encoding: gzip, deflate, br<br>  Authorization: Bearer sdk-erbaerw-ergeqrfewgqe-reghrere-0000<br>  If-None-Match: &quot;abc123etag&quot;<br>  Cache-Control: no-cache<br>  Connection: keep-alive</pre><p>There are a TON of different HTTP headers. Host: api.example.com and every line below it is a header in the above example.</p><h3>How to capture</h3><p>From a security standpoint, this kind of data is very sensitive. And having it could be disastrous.</p><p>There’s no legal way to sniff this data without explicit permission to do so as an ethical hacker running a pentest.</p><pre>Authorization: Bearer sdk-122fn3qoffbash-qfubqteui3rbfjf-06001<br>Cookie: SESSIONID=abcd1234; authToken=secrettoken; rememberMe=true<br>Referer: https://other.example.com/dashboard?token=abcdef123456</pre><blockquote>Above are some sensitive headers. But there’s loads more.</blockquote><p><strong>If you see this data, that means I’ve done/are one of the following:</strong></p><h3>1. The client (quite possibly you) is running HTTP</h3><p>A common way to expose HTTP requests is being on 0.0.0.0 instead of 127.0.0.1, where the latter KEEPS the network on YOUR device using the loopback address. The latter is no particular address AKA EVERY ADDRESS. (It does let you use another device, though.)</p><pre># For fastapi<br>uvicorn main:app - host 0.0.0.0 - port 8000 - reload<br># For react<br>npm run dev -- --host 0.0.0.0 --port 3000</pre><blockquote>If you’re using 0.0.0.0 as your dev server and you’re connected to WIFI at like a coffee shop or library, be very careful. Switch to using a hotspot or VPN, especially if the location uses a weaker WIFI version like WEP, WPA ,WPA2 (Ordered left to right by easiest to most difficult to crack.)</blockquote><p>I can use <a href="http://wireshark filter by port">Wireshark</a> to see the traffic coming in and out of my device.</p><h3>2. I Ran a Successful Man In the Middle Attack</h3><p>Congrats! As an ethical hacker, you should document how you managed to do so in your pentest report. You probably don’t need to be reading this!</p><h3>3. I’m the Requested Server</h3><p>I can gather and log the information in a server log to check out my server’s performance, which URLs are seeing the most traffic, where my server is facing errors, etc. Again, be very careful not to store sensitive information in plaintext (like security headers — if those leak you’re screwed.)</p><p>So there’s only a few ways to see this kind of data. Let’s go down a level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_42BnB5kasGOQn8YwPvf0w.png" /><figcaption>An Example PCAP I generated with ChatGPT</figcaption></figure><h3>Transport Layer: TCP, UDP, ICMP, TLS Packets</h3><p>If you’re a pentester on a network, odds are you’ll see a lot of these. TCP and UDP make up.</p><p>Check out my Github to see an example of parsing a PCAP file wire shark style!</p><h3>How to Capture</h3><p>As a pentester, this may be the more typical layer, as sniffing an network, I’ll typically see more TCP/UDP/ICMP than anything else, which make sense because this is the <em>transport layer. </em>As in, the stuff I transport.</p><p>This is the most viewable layer. This is where network sniffing operates, but it’s also where network monitoring operates. If you’re on the network, you’ll see this!</p><p><strong>If you see this data, that means I’ve done/are one of the following:</strong></p><h3>1. I’m on the network</h3><p>If I’m logging performance of the network, I can probably use PCAPs to identify</p><h3>2. I am the Network</h3><p>I might be for example a CCNA using Cisco Meraki, or some other network admin. At this point, I’m monitoring my network. I can use PCAPs to perform security audits, monitor traffic, and check performance.</p><p>What If I can stream PCAP info?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37f8c5593aec" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>