<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Charlie Barajas</title>
    <description>The latest articles on DEV Community by Charlie Barajas (@charlie_barajas_353e28103).</description>
    <link>https://dev.to/charlie_barajas_353e28103</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%2F3073057%2F8eb7319e-374d-4bdb-8c0f-f79d72380d66.png</url>
      <title>DEV Community: Charlie Barajas</title>
      <link>https://dev.to/charlie_barajas_353e28103</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/charlie_barajas_353e28103"/>
    <language>en</language>
    <item>
      <title>UNION in SQL Postgre</title>
      <dc:creator>Charlie Barajas</dc:creator>
      <pubDate>Thu, 01 Jan 2026 00:32:42 +0000</pubDate>
      <link>https://dev.to/charlie_barajas_353e28103/union-in-sql-postgre-j1o</link>
      <guid>https://dev.to/charlie_barajas_353e28103/union-in-sql-postgre-j1o</guid>
      <description>&lt;p&gt;When using UNION, I came to Udacity's course on Intro to SQL to learn what it takes to be a data anaylst.&lt;/p&gt;

&lt;p&gt;When appending data using UNION, UNION ALL against two instances and selected columns will bring columns from differing tables. The requests from two SELECT statements are brought together.&lt;br&gt;
UNION is great when dealing with multiple tables and you don't want to use five subquery SELECT statement. Here's an example;&lt;/p&gt;

&lt;p&gt;SELECT *&lt;br&gt;
    FROM accounts&lt;/p&gt;

&lt;p&gt;UNION ALL&lt;/p&gt;

&lt;p&gt;SELECT *&lt;br&gt;
  FROM accounts&lt;/p&gt;

</description>
      <category>sql</category>
      <category>postgres</category>
      <category>database</category>
      <category>union</category>
    </item>
    <item>
      <title>Why Precedence Matters 🤓</title>
      <dc:creator>Charlie Barajas</dc:creator>
      <pubDate>Sun, 14 Sep 2025 00:03:55 +0000</pubDate>
      <link>https://dev.to/charlie_barajas_353e28103/why-precedence-matters-4f3</link>
      <guid>https://dev.to/charlie_barajas_353e28103/why-precedence-matters-4f3</guid>
      <description>&lt;p&gt;Let's look at a simple example. What do you think the value of result would be here?&lt;/p&gt;

&lt;p&gt;C++&lt;/p&gt;

&lt;p&gt;int x = 5;&lt;br&gt;
int y = 10;&lt;br&gt;
int z = 2;&lt;br&gt;
int result = x + y * z;&lt;br&gt;
If you just go from left to right, you might think the calculation is 5 + 10 = 15, and then 15 * 2 = 30. But the correct answer is 25. Why? Because the multiplication operator (*) has higher precedence than the addition operator (+). So, the expression is evaluated as y * z first, which is 10 * 2 = 20, and then x + 20 is calculated, giving you 5 + 20 = 25.&lt;/p&gt;

&lt;p&gt;A Simple Breakdown 📋&lt;br&gt;
C++ has many operators, but some of the most common ones you'll encounter, from highest precedence to lowest, include:&lt;/p&gt;

&lt;p&gt;Postfix operators (), [], -&amp;gt;, . (e.g., function calls, array access)&lt;/p&gt;

&lt;p&gt;Unary operators ++, --, !, ~, * (dereference), &amp;amp; (address of)&lt;/p&gt;

&lt;p&gt;Multiplicative operators *, /, %&lt;/p&gt;

&lt;p&gt;Additive operators +, -&lt;/p&gt;

&lt;p&gt;Shift operators &amp;lt;&amp;lt;, &amp;gt;&amp;gt;&lt;/p&gt;

&lt;p&gt;Relational operators &amp;lt;, &amp;lt;=, &amp;gt;, &amp;gt;=&lt;/p&gt;

&lt;p&gt;Equality operators ==, !=&lt;/p&gt;

&lt;p&gt;Logical AND &amp;amp;&amp;amp;&lt;/p&gt;

&lt;p&gt;Logical OR ||&lt;/p&gt;

&lt;p&gt;Assignment operators =, +=, -=, *=, etc.&lt;/p&gt;

&lt;p&gt;The Role of Associativity 🔄&lt;br&gt;
What happens when you have two operators with the same precedence? This is where associativity comes in. It determines the direction of evaluation. For most binary operators, like addition and subtraction, the associativity is left-to-right. For example, in a - b + c, the expression is evaluated as (a - b) + c. However, some operators, like the assignment operators, have right-to-left associativity, so a = b = 5 is evaluated as a = (b = 5).&lt;/p&gt;

&lt;p&gt;The Best Practice: Use Parentheses () 📝&lt;br&gt;
While it's good to know the rules, relying on operator precedence can make your code harder to read and prone to subtle bugs. The simplest and most effective solution is to use parentheses () to explicitly control the order of evaluation.&lt;/p&gt;

&lt;p&gt;Instead of x + y * z, write x + (y * z). This makes your intention crystal clear to anyone reading the code, including your future self! Parentheses can make your code more robust and much easier to maintain. They are your best friend when it comes to controlling operator precedence. Happy coding!&lt;/p&gt;

&lt;p&gt;Provide an example of complex operator precedence.&lt;/p&gt;

&lt;p&gt;Explain operator associativity in more detail.&lt;/p&gt;

&lt;p&gt;What are some common pitfalls with operator precedence?&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>programming</category>
      <category>b</category>
    </item>
    <item>
      <title>Azure NSG Routes</title>
      <dc:creator>Charlie Barajas</dc:creator>
      <pubDate>Thu, 04 Sep 2025 23:26:30 +0000</pubDate>
      <link>https://dev.to/charlie_barajas_353e28103/azure-nsg-routes-3k7a</link>
      <guid>https://dev.to/charlie_barajas_353e28103/azure-nsg-routes-3k7a</guid>
      <description>&lt;p&gt;Azure Network Security Groups: Your Cloud's First Line of Defense 🛡️&lt;br&gt;
Azure Network Security Groups (NSGs) are essential building blocks for securing your cloud infrastructure. Think of them as virtual firewalls that control network traffic to and from your Azure resources! 🔒&lt;br&gt;
What Are Network Security Groups? 🤔&lt;br&gt;
NSGs contain security rules that allow or deny inbound and outbound network traffic based on:&lt;/p&gt;

&lt;p&gt;📍 Source and destination IP addresses&lt;br&gt;
🚪 Port numbers&lt;br&gt;
🌐 Protocol (TCP, UDP, ICMP)&lt;br&gt;
⬆️ Direction (inbound/outbound)&lt;/p&gt;

&lt;p&gt;Key Features ✨&lt;br&gt;
🎯 Granular Control&lt;/p&gt;

&lt;p&gt;Filter traffic at the subnet or network interface level&lt;br&gt;
Apply different rules to different resources&lt;br&gt;
Create custom security policies&lt;/p&gt;

&lt;p&gt;📊 Default Rules&lt;br&gt;
Every NSG comes with built-in rules:&lt;/p&gt;

&lt;p&gt;✅ Allow inbound traffic within VNet&lt;br&gt;
✅ Allow inbound traffic from Azure Load Balancer&lt;br&gt;
❌ Deny all other inbound traffic&lt;br&gt;
✅ Allow all outbound traffic to internet&lt;/p&gt;

&lt;p&gt;🔄 Stateful Filtering&lt;/p&gt;

&lt;p&gt;Automatically allows return traffic for established connections&lt;br&gt;
No need to create separate rules for response traffic&lt;/p&gt;

&lt;p&gt;Best Practices 💡&lt;br&gt;
🚫 Principle of Least Privilege&lt;/p&gt;

&lt;p&gt;Start with deny-all and only allow what's necessary&lt;br&gt;
Regularly audit and remove unused rules&lt;br&gt;
Use service tags instead of IP ranges when possible&lt;/p&gt;

&lt;p&gt;🏷️ Use Service Tags&lt;br&gt;
Popular service tags include:&lt;/p&gt;

&lt;p&gt;Internet 🌍&lt;br&gt;
VirtualNetwork 🏠&lt;br&gt;
Storage 💾&lt;br&gt;
SQL 🗃️&lt;br&gt;
AzureLoadBalancer ⚖️&lt;/p&gt;

&lt;p&gt;📋 Naming Conventions&lt;br&gt;
Use descriptive names like:&lt;/p&gt;

&lt;p&gt;Allow-HTTP-Inbound&lt;br&gt;
Deny-SSH-Internet&lt;br&gt;
Allow-DB-Subnet&lt;/p&gt;

&lt;p&gt;Common Use Cases 🎪&lt;br&gt;
🌐 Web Applications&lt;br&gt;
Priority 100: Allow HTTP (80) from Internet&lt;br&gt;
Priority 110: Allow HTTPS (443) from Internet&lt;br&gt;&lt;br&gt;
Priority 120: Allow SSH (22) from Admin subnet only&lt;br&gt;
Priority 130: Deny all other inbound traffic&lt;br&gt;
🗄️ Database Tier&lt;br&gt;
Priority 100: Allow SQL (1433) from App subnet only&lt;br&gt;
Priority 110: Allow management from Admin subnet&lt;br&gt;
Priority 120: Deny all internet access&lt;br&gt;
🔧 Management Access&lt;br&gt;
Priority 100: Allow RDP (3389) from corporate IP ranges&lt;br&gt;
Priority 110: Allow SSH (22) from jump box subnet&lt;br&gt;
Priority 120: Block all other management protocols&lt;br&gt;
Advanced Features 🚀&lt;br&gt;
🔍 Application Security Groups (ASGs)&lt;/p&gt;

&lt;p&gt;Group VMs by application role&lt;br&gt;
Simplify rule management&lt;br&gt;
Make policies more readable&lt;/p&gt;

&lt;p&gt;📈 Flow Logs&lt;/p&gt;

&lt;p&gt;Monitor and analyze network traffic&lt;br&gt;
Troubleshoot connectivity issues&lt;br&gt;
Detect security threats&lt;/p&gt;

&lt;p&gt;🎯 Augmented Security Rules&lt;/p&gt;

&lt;p&gt;Use multiple IP ranges in single rule&lt;br&gt;
Combine service tags with IP addresses&lt;br&gt;
More flexible rule definitions&lt;/p&gt;

&lt;p&gt;Monitoring &amp;amp; Troubleshooting 🔧&lt;br&gt;
📊 Key Metrics to Watch&lt;/p&gt;

&lt;p&gt;Packets blocked/allowed&lt;br&gt;
Security rule hit counts&lt;br&gt;
Flow log analysis&lt;/p&gt;

&lt;p&gt;🐛 Common Issues&lt;/p&gt;

&lt;p&gt;❌ Conflicting rule priorities&lt;br&gt;
❌ Overly broad allow rules&lt;br&gt;
❌ Missing return traffic rules for stateless protocols&lt;/p&gt;

&lt;p&gt;Security Tips 🔐&lt;/p&gt;

&lt;p&gt;Regular Audits 📅&lt;/p&gt;

&lt;p&gt;Review rules quarterly&lt;br&gt;
Remove unused/outdated rules&lt;br&gt;
Check for overly permissive access&lt;/p&gt;

&lt;p&gt;Documentation 📝&lt;/p&gt;

&lt;p&gt;Document rule purposes&lt;br&gt;
Maintain change logs&lt;br&gt;
Create architecture diagrams&lt;/p&gt;

&lt;p&gt;Testing 🧪&lt;/p&gt;

&lt;p&gt;Test rules in development first&lt;br&gt;
Use Network Watcher for validation&lt;br&gt;
Monitor after changes&lt;/p&gt;

&lt;p&gt;Conclusion 🎯&lt;br&gt;
Network Security Groups are fundamental to Azure security architecture. When properly configured with the principle of least privilege, they provide robust protection for your cloud resources while maintaining operational flexibility.&lt;br&gt;
Remember: Security is not a one-time setup—it's an ongoing process! 🔄&lt;/p&gt;

&lt;p&gt;Ready to secure your Azure environment? Start with NSGs and build a strong foundation for your cloud security! 💪&lt;/p&gt;

</description>
      <category>json</category>
      <category>webdev</category>
      <category>css</category>
      <category>html</category>
    </item>
    <item>
      <title>Regex Checker</title>
      <dc:creator>Charlie Barajas</dc:creator>
      <pubDate>Sun, 24 Aug 2025 16:07:25 +0000</pubDate>
      <link>https://dev.to/charlie_barajas_353e28103/regex-checker-4gnl</link>
      <guid>https://dev.to/charlie_barajas_353e28103/regex-checker-4gnl</guid>
      <description>&lt;p&gt;I decided to develop a regular expression checker that allows users to input text to determine if the characters match a regular expression and their associated Unicode values. Here's a link to my Codepen account, where you can also find flags for i and g regex.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/VoXelo/pen/raOvrLO" rel="noopener noreferrer"&gt;https://codepen.io/VoXelo/pen/raOvrLO&lt;/a&gt;&lt;/p&gt;

</description>
      <category>json</category>
      <category>webdev</category>
      <category>css</category>
      <category>html</category>
    </item>
    <item>
      <title>The softmax() function in Machine Learning</title>
      <dc:creator>Charlie Barajas</dc:creator>
      <pubDate>Thu, 21 Aug 2025 22:25:20 +0000</pubDate>
      <link>https://dev.to/charlie_barajas_353e28103/the-softmax-function-in-machine-learning-3mn4</link>
      <guid>https://dev.to/charlie_barajas_353e28103/the-softmax-function-in-machine-learning-3mn4</guid>
      <description>&lt;p&gt;Hello there! If you've ever trained a neural network for classification, you've likely come across the log_softmax() function. While it may seem like a simple operation, it's actually a crucial mathematical tool that prevents your model from breaking down. &lt;/p&gt;

&lt;p&gt;Let's explore its construction and why it's so powerful.The Problem: When Softmax BreaksThe standard Softmax function takes a vector of raw model outputs, known as logits, and converts them into a probability distribution. For a vector of logits z = [z_1, z_2, ..., z_K], the probability of the i-th class is given by the formula:sigma(z)_i = e^z_i / (e^z_1 + e^z_2 + ... + e^z_K)This formula is beautiful in theory, but it can be unstable in practice. If a logit z_i is a large positive number (e.g., 1000), the term e^z_i can become so massive that it exceeds a computer's floating-point capacity, causing an overflow. Conversely, if a logit is a very small negative number (e.g., -1000), e^z_i becomes so tiny it's rounded to zero, causing numerical underflow. &lt;/p&gt;

&lt;p&gt;In both cases, your probabilities are corrupted.The Solution: Logarithms to the RescueTo solve this, we don't compute the probability and then take its logarithm. Instead, we use a numerically stable identity to compute the logarithm of the softmax result directly. This is the Log-Sum-Exp Trick, and it's the core of how log_softmax() works.The log_softmax operation is defined as the natural logarithm of the softmax function. We can break down the math using a simple property of logarithms: log(a/b) = log(a) - log(b).log_softmax(z)_i = log( sigma(z)_i )= log( e^z_i / (e^z_1 + ... + e^z_K) )= log(e^z_i) - log( e^z_1 + ... + e^z_K )Using another property that log(e^x) = x, we can simplify the first term. The second term, log(sum(e^z_j)), is computed using a special function that handles the large and small numbers without causing overflow or underflow.So, the final numerically stable formula for log_softmax() is:log_softmax(z)_i = z_i - log( e^z_1 + ... + e^z_K )&lt;/p&gt;

&lt;p&gt;This method operates on the original logit values, preventing any intermediate steps that could result in computational errors. It allows you to work with a much more stable range of values.Why It's Paired with NLL LossThis is where the magic happens. The output of log_softmax() is perfectly suited for use with the Negative Log Likelihood (NLL) Loss. This loss function is defined as the negative logarithm of the predicted probability for the correct class.For a true class label y, the NLL Loss is a single, simple operation:L_NLL(z, y) = - log_softmax(z)_y&lt;/p&gt;

&lt;p&gt;Because the output of log_softmax() is always a negative number (since it's the log of a probability between 0 and 1), taking the negative makes the loss a positive value. Minimizing this loss is equivalent to maximizing the log probability of the correct class. This pairing ensures that your model's predictions are not only accurate but also numerically stable throughout the entire training process.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>algorithms</category>
      <category>softmax</category>
      <category>logarithm</category>
    </item>
    <item>
      <title>MNIST Data Set (OpenCV</title>
      <dc:creator>Charlie Barajas</dc:creator>
      <pubDate>Thu, 21 Aug 2025 20:46:57 +0000</pubDate>
      <link>https://dev.to/charlie_barajas_353e28103/mnist-data-set-opencv-1o74</link>
      <guid>https://dev.to/charlie_barajas_353e28103/mnist-data-set-opencv-1o74</guid>
      <description>&lt;h2&gt;
  
  
  Why Your PyTorch Model Needs to Get to Know Its Data
&lt;/h2&gt;

&lt;p&gt;Ever wonder what goes on behind the scenes before a neural network can start learning from images? One of the most critical—and often overlooked—steps is understanding the data's pixel values. This little snippet of PyTorch code does just that, calculating the average and standard deviation of every single pixel across an entire dataset. It's a key part of a process called &lt;strong&gt;normalization&lt;/strong&gt;, and it's essential for training better, faster models.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Setup: Loading the Raw Data 💾
&lt;/h3&gt;

&lt;p&gt;First, let's look at the beginning of the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;torchvision&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datasets&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;transforms&lt;/span&gt;

&lt;span class="c1"&gt;# Load the Fashion MNIST dataset (without normalization)
&lt;/span&gt;&lt;span class="n"&gt;dataset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datasets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;FashionMNIST&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;./data&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;train&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;download&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;transform&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;transforms&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ToTensor&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This part is all about getting our hands on the Fashion-MNIST dataset. We use &lt;code&gt;datasets.FashionMNIST&lt;/code&gt; to download the data, and crucially, we apply a single transformation: &lt;code&gt;transforms.ToTensor()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Why is this important? It takes the raw images—which have pixel values from 0 to 255—and converts them into a PyTorch &lt;strong&gt;tensor&lt;/strong&gt;. At the same time, it scales those values down to the more manageable floating-point range of &lt;strong&gt;0.0 to 1.0&lt;/strong&gt;. This initial scaling is important, but it’s just the first step.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Aggregation: Gathering Every Single Pixel 🧺
&lt;/h3&gt;

&lt;p&gt;Next, we have the most fascinating part of the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;all_pixels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cat&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;view&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;dataset&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we are literally grabbing every single pixel from all 60,000 images in the training set and putting them into one massive tensor.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;for img, _ in dataset&lt;/code&gt;: This loop iterates through every image-label pair in the dataset. We only need the image (&lt;code&gt;img&lt;/code&gt;) and can ignore the label (&lt;code&gt;_&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;img.view(-1)&lt;/code&gt;: This is the magic. Each image is a 28x28 grid of pixels. The &lt;code&gt;.view(-1)&lt;/code&gt; method "flattens" this grid, unrolling it into a long, single-row tensor with 784 elements.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;torch.cat([...])&lt;/code&gt;: Finally, &lt;code&gt;torch.cat()&lt;/code&gt; (short for concatenate) takes the list of 60,000 flattened tensors and joins them all together into one colossal tensor. The result is a single tensor with over 47 million pixel values!&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  The Payoff: Calculating Mean and Standard Deviation 📈
&lt;/h3&gt;

&lt;p&gt;With all our pixel data in one place, the final two lines are simple but powerful:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;mean&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;all_pixels&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;std&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;all_pixels&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;std&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Mean: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;, Std: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We call the &lt;code&gt;.mean()&lt;/code&gt; method to get the average of all those millions of pixels and &lt;code&gt;.std()&lt;/code&gt; to get their standard deviation. The &lt;code&gt;.item()&lt;/code&gt; function simply extracts the single numerical value from the resulting tensor.&lt;/p&gt;

&lt;p&gt;The output will look something like this:&lt;br&gt;
&lt;strong&gt;&lt;code&gt;Mean: 0.2860, Std: 0.3529&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These numbers might seem small, but they hold the key to the next step.&lt;/p&gt;




&lt;h3&gt;
  
  
  Why It Matters: The Power of Normalization 💪
&lt;/h3&gt;

&lt;p&gt;The mean and standard deviation we just calculated are used to &lt;strong&gt;normalize&lt;/strong&gt; the dataset. The idea is to transform the data so it has a mean of 0 and a standard deviation of 1.&lt;/p&gt;

&lt;p&gt;You can do this using a &lt;code&gt;transforms.Normalize&lt;/code&gt; function, which applies the following formula to every pixel:&lt;/p&gt;

&lt;p&gt;$x_{normalized} = (x - \text{mean}) / \text{std}$&lt;/p&gt;

&lt;p&gt;This normalization process helps neural networks in two key ways:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Faster Convergence:&lt;/strong&gt; When your data is centered and scaled, the optimization process (training) becomes much more stable and can converge on a solution much more quickly.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Improved Performance:&lt;/strong&gt; Normalization helps prevent certain layers in the network from getting stuck and allows the model to learn more efficiently, leading to better final accuracy.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So, while it may seem like a small detail, this kind of data preparation is a fundamental practice that can make the difference between a sluggish, underperforming model and a lean, powerful one.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>pytorch</category>
    </item>
    <item>
      <title>Call Stack in Java</title>
      <dc:creator>Charlie Barajas</dc:creator>
      <pubDate>Wed, 06 Aug 2025 04:31:13 +0000</pubDate>
      <link>https://dev.to/charlie_barajas_353e28103/call-stack-in-java-36nm</link>
      <guid>https://dev.to/charlie_barajas_353e28103/call-stack-in-java-36nm</guid>
      <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;So I want to be brief and explain that I never knew what "call stack" was supposed to mean. I assumed some fancy, high-class programming jargon that would take years to learn. However, Java uses the call stack as merely a data structure that keeps readily accessible methods/classes for use by the IDE/JVM. The JVM or java virtual machine uses this stack for availability and convenience instead of using RAM memory for every function and var. Although string types have a memory address, objects will always be stored in the call stack.&lt;/p&gt;

&lt;p&gt;CodeCademy provides a short, free course just on recursion algorithms. &lt;a href="https://www.codecademy.com/courses/java-algorithms" rel="noopener noreferrer"&gt;https://www.codecademy.com/courses/java-algorithms&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>The while loop in Java</title>
      <dc:creator>Charlie Barajas</dc:creator>
      <pubDate>Wed, 30 Jul 2025 20:26:18 +0000</pubDate>
      <link>https://dev.to/charlie_barajas_353e28103/the-while-loop-in-java-16a5</link>
      <guid>https://dev.to/charlie_barajas_353e28103/the-while-loop-in-java-16a5</guid>
      <description>&lt;p&gt;I've been taking Codecademy's Introduction to Java course and so far I've really loved the straigtforward and hands-on approach they have to coding. Here's a snippet i wrote using main method. &lt;/p&gt;

&lt;p&gt;class Coffee {&lt;/p&gt;

&lt;p&gt;public static void main(String[] args) {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// initialize cupsOfCoffee
int cupsOfCoffee = 1;
// add while loop with counter


while (cupsOfCoffee &amp;lt;= 100) {
  cupsOfCoffee++;
  System.out.println("Fry drinks cup of coffee #" + cupsOfCoffee);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Although basic, it builds a strong foundation for their course material, which also includes career paths with ISC2 partnerships and more.&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>logicapps</category>
    </item>
    <item>
      <title>The compare() method in Java</title>
      <dc:creator>Charlie Barajas</dc:creator>
      <pubDate>Tue, 29 Jul 2025 16:59:21 +0000</pubDate>
      <link>https://dev.to/charlie_barajas_353e28103/the-compare-method-in-java-2080</link>
      <guid>https://dev.to/charlie_barajas_353e28103/the-compare-method-in-java-2080</guid>
      <description>&lt;p&gt;When we use the compare() or equal() methods, we primarily use them to define the equality of two or more objects that are instances of a class such that Class class_1 = new Class(); would be compared to another instance like class_2. The equality operator (==) cannot be used for objects because of both instance fields and multiple primitive data types being inside each method.&lt;/p&gt;

</description>
      <category>java</category>
      <category>methods</category>
    </item>
    <item>
      <title>JAVA UML and Why Its Important</title>
      <dc:creator>Charlie Barajas</dc:creator>
      <pubDate>Sat, 26 Jul 2025 17:35:17 +0000</pubDate>
      <link>https://dev.to/charlie_barajas_353e28103/java-uml-and-why-its-important-37n7</link>
      <guid>https://dev.to/charlie_barajas_353e28103/java-uml-and-why-its-important-37n7</guid>
      <description>&lt;p&gt;The Java UML or Unified Modeling Language allows us to visualize class structure and field data types. Examples of common formatting are (+) for public and (-) for private vars.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;setAge(newAge: int): void ---&amp;gt; public void setAge(int newAge)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;calculatorTax(): double ---&amp;gt; private double calculatorTax()&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;getName(): String ---&amp;gt; public String getName()&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;count: int ---&amp;gt; public static int&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;getCount(): int ---&amp;gt; public static int getCount()&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are more examples but this is the essential JAVA UML notation.&lt;/p&gt;

</description>
      <category>diagram</category>
      <category>java</category>
      <category>uml</category>
    </item>
    <item>
      <title>RAG Systems Model (MongoDB)</title>
      <dc:creator>Charlie Barajas</dc:creator>
      <pubDate>Tue, 22 Jul 2025 03:38:16 +0000</pubDate>
      <link>https://dev.to/charlie_barajas_353e28103/rag-systems-model-mongodb-3hl0</link>
      <guid>https://dev.to/charlie_barajas_353e28103/rag-systems-model-mongodb-3hl0</guid>
      <description>&lt;p&gt;RAG systems Utilize a vector search algorithm that searches a mathematical space in a database where chunks store vectors. &lt;/p&gt;

&lt;p&gt;These vectors have many dimensions, with each representing a parameter such as V(Param_k) represents k number of params. High dimensionality is good for accuracy but increases latency. Atlas Search Query uses an embedding model that needs a path that can be configured using PyMuPDF or similar Py packages.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>rag</category>
      <category>diagram</category>
      <category>llm</category>
    </item>
    <item>
      <title>Cliques / Independent Sets</title>
      <dc:creator>Charlie Barajas</dc:creator>
      <pubDate>Sun, 15 Jun 2025 21:34:24 +0000</pubDate>
      <link>https://dev.to/charlie_barajas_353e28103/cliques-independent-sets-56ff</link>
      <guid>https://dev.to/charlie_barajas_353e28103/cliques-independent-sets-56ff</guid>
      <description>&lt;p&gt;Today, I took a module on Udacity's "Theoretical Computer Science" course and would recommend it to programmers, DevOps, data scientists, and network technicians alike, as it provides challenging concepts. These concepts include advanced runtime concepts, traceability, basic graph theory, and runtime equations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.udacity.com/dashboard" rel="noopener noreferrer"&gt;https://www.udacity.com/dashboard&lt;/a&gt;&lt;/p&gt;

</description>
      <category>telecommunication</category>
      <category>devjournal</category>
    </item>
  </channel>
</rss>
