<?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"><channel><title><![CDATA[austn.net]]></title><description><![CDATA[Software engineer working at an enterprise HealthTech firm helping patients get access to medicine they need.

Sharing Ruby on Rails tips & tricks and career in]]></description><link>https://blog.austn.net</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1683576209244/hkSUDodH0.png</url><title>austn.net</title><link>https://blog.austn.net</link></image><generator>RSS for Node</generator><lastBuildDate>Mon, 09 Nov 2026 08:46:47 GMT</lastBuildDate><atom:link href="https://blog.austn.net/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[The State of Software and the Internet]]></title><description><![CDATA[Examine internet usability decline, SEO-driven search results, and complexity's effect on user experience and online communities]]></description><link>https://blog.austn.net/the-state-of-software-and-the-internet</link><guid isPermaLink="true">https://blog.austn.net/the-state-of-software-and-the-internet</guid><category><![CDATA[software development]]></category><category><![CDATA[Software Engineering]]></category><category><![CDATA[performance]]></category><dc:creator><![CDATA[Austin]]></dc:creator><pubDate>Sun, 09 Jul 2023 19:44:40 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/I79ckC7tOX4/upload/e05469accdffdb8423632889719b67e3.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The state of software and the internet is insane.</p>
<p>Most websites are unfindable.</p>
<p>Every Google search is dominated by SEO marketers.</p>
<p>The internet has lost its beauty in the fiasco of widespread adoption and has been immensely over-capitalized.</p>
<p>Apps can hang for seconds or minutes before we think "something's got to change".</p>
<p>People will spend 30 seconds on a loading screen without a thought.</p>
<p>People will scroll through mindless ads for hours.</p>
<p>People don't need what software is capable of.</p>
<p>People need stimulation.</p>
<p>And software is good at that.</p>
<p>But software could do so much more.</p>
<p>As time goes on, we see how fragile the situation is, and when a small event like a Reddit protest occurs, its impacts are catastrophic to the catalog of the internet.</p>
<p>When I was young, the internet was a place that sparked joy inside me. Now, browsing the internet is a chore. I'm older sure, but the entire experience is completely different.</p>
<p>Before, we had reasons to use Google past the first page. There were useful insights to be found where other people weren't looking. Now, it's complete garbage beyond the 3rd result. Quotes don't work in Google search now. You will never find a good website made by a real human.</p>
<p>Before, using 4chan and Reddit meant that someone was actively engaged and interested in the internet; usually through technology, politics, science, and also at least a little bit deranged. Now, using 4chan means that you are probably some subset of obnoxious, racist, extreme, or otherwise untenable for society. Now, using Reddit means you are probably a nerd. Not a nerd in the interesting way, a nerd in the normie way.</p>
<p>The people were more interesting. The content was more interesting. The world was more interesting.</p>
<p>When someone wanted to learn how to play League of Legends, they have to learn:</p>
<ul>
<li><p>All the roles</p>
</li>
<li><p>All the champions</p>
</li>
<li><p>All the abilities</p>
</li>
<li><p>All the runes</p>
</li>
<li><p>All the matchups</p>
</li>
</ul>
<p>This absurd amount of required upfront reading leads to people not being interested in picking up the game as a new player. Its underlying systems are too complex. Nobody wants to do that. And when the game has a problem with toxicity in its matches, nobody is willing to put up with BOTH an intense community and an ever-increasingly difficult game.</p>
<p>This seems to be what is happening to the internet.</p>
<p>People are not learning anything about the underlying technology, they are merely adopting it. People are increasingly divided. People are increasingly intolerant of opposition.</p>
<p>What happens when the internet becomes this complicated, overdone mess of systems?</p>
<p>Has it already happened?</p>
<p>Are our people becoming more toxic? Is our "Internet community" becoming more intense? I think the answer is certainly yes.</p>
<p>How more unusable can our internet get before it causes damage to society, or loses its utility?</p>
<p>Let me know what you think in the comments. As always, thanks for reading.</p>
]]></content:encoded></item><item><title><![CDATA[Switching Lanes: Transitioning to a Ruby Career after a JavaScript Bootcamp]]></title><description><![CDATA[Learn how a programmer switched from JavaScript bootcamp to a thriving Ruby career, tackling challenges and seizing tech industry opportunities]]></description><link>https://blog.austn.net/career-transition</link><guid isPermaLink="true">https://blog.austn.net/career-transition</guid><category><![CDATA[bootcamp]]></category><category><![CDATA[learn coding]]></category><category><![CDATA[learning]]></category><category><![CDATA[Ruby]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Austin]]></dc:creator><pubDate>Wed, 14 Jun 2023 18:16:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/p8w7krXVY1k/upload/ab3a3061778f2873c77456dedaae6f9d.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-getting-started">Getting Started</h2>
<p>I started programming when I was young, sometime around 2008. I worked with my uncle on simple C++ terminal games. We used Bloodshed.net's <a target="_blank" href="https://www.bloodshed.net/">Dev-C++</a> on his mom's Windows XP computer. The coolest feature I ever built was a hardcoded ASCII map that would update as you moved through rooms. He would write dialogue and story content, I figured out the logic to get us through the game.</p>
<p>It was never anything worthy of releasing, and hardly worth saving, but it initiated my love for programming. That love would live dormant inside me for a long while, as somehow I never bothered practicing again until around 2016, at the end of high school.</p>
<p>Little did I know, this interest would fuel the first decade of my working life like nothing else. In this article, we'll dive into my attempt at getting an education and building a career in the field of software engineering, and the lessons I learned along the way.</p>
<h2 id="heading-education-attempt">Education (attempt)</h2>
<p>I tried college for a while and it wasn't for me.</p>
<p>A semester in, I discovered, to my dismay, that only one of my five classes counted towards my general education credits. Given that I had rent to pay, wasting time wasn't an option. Even though I had an advisor-guided schedule, college seemed more like a roadblock than a path forward.</p>
<p>Back to square one.</p>
<h2 id="heading-so-back-to-coding">So, back to coding!</h2>
<p>Around this time, the Learn To Code movement was gaining traction online.</p>
<p>Countless advertisements painted a promising picture of a career in software engineering, and I was intrigued.</p>
<p>I needed exactly three things: a quick education, a reasonably paying job, and something engaging to do – the latter wasn't hard, considering my ample screen time as an avid League of Legends player.</p>
<p>In 2017, I dove headfirst into coding. With FreeCodeCamp, YouTube tutorials, and tips from seasoned friends, I immersed myself in my learning.</p>
<p>As the year progressed, I sought structured learning to expedite my progress.</p>
<p>I found Colt Steele's Web Developer Bootcamp on Udemy, purchased it immediately, and I absolutely loved it. His teaching style clicked for me, his lessons were engaging and snappy, and at $14 it couldn't be beat.</p>
<p>Over the course of the next few weeks, I completed all of the projects and absorbed everything I could, but I eagerly wanted more.</p>
<h2 id="heading-enter-lambda-school">Enter: Lambda School</h2>
<p>After completing Colt Steele's Udemy course toward the end of 2017 and experiencing an unsuccessful stint in contracting, I stumbled upon BloomTech, an education platform then known as Lambda School.</p>
<h3 id="heading-what-was-the-point-of-lambda-school">What was the point of Lambda School?</h3>
<p>They were a hip new Computer Science Academy (misnomer for 'bootcamp') with a unique gimmick - the tuition is free until you get a software engineering job making upwards of $50,000/yr. At that point, you pay 17% of your income every month, up to a total possible $30,000, or for 24 months, whichever comes first. This is called an Income Share Agreement, and they've risen in popularity since then.</p>
<p>I would be a member of the 4th ever cohort of the Computer Science Web Development course. I was young and I had a fire in my eyes. They could teach me to code and become the best version of myself that I could be.</p>
<p>I couldn't help myself from enrolling. After all, it was <strong>completely</strong> <strong>free</strong> until I got a job!</p>
<h3 id="heading-the-downside-of-income-share-agreements">The Downside of Income Share Agreements</h3>
<p>I would later grow to dread that 17%. Math wasn't my strong suit in school, but with California's tax rate, I was paying something like 45% of my income before I ever saw it.</p>
<p>Almost half of my earnings were taken from my check, every single month. This led to some rough times. I appreciate my family dearly for housing, feeding, and enabling me to start my career, despite me having absolutely no clue what I was doing.</p>
<p>I try to pay that back as much as I can now that I'm in a better position. Trust me, I am relieved to be out of there: I'm a few years deep into my career now and happily self-sufficient. But I digress.</p>
<h3 id="heading-lambda-curriculum">Lambda Curriculum</h3>
<p>In Lambda School, we built some great computer science foundations. Well-experienced teachers, one algorithm problem with an explanation per day, walked through HTML/CSS and then onto JavaScript and React.</p>
<p>We also spent some time working on Computer Science fundamentals as well, we learned some C and Python. Data Structures and Algorithms were the hardest part by far, but building an 8-bit CPU in C was a close second. The rest of the curriculum was reasonable and easy to follow for me at the time, and the instructors and TAs were a great help for the students.</p>
<h3 id="heading-lessons-learned">Lessons Learned</h3>
<p>Working remotely helped promote consistent writing habits, and required more advanced and clear communication skills, especially through text. It also taught me that I need to be able to manage my own work and sleep schedules. Having a hybrid of self-paced and live classes enforced a work ethic in me that remains strong today.</p>
<p>I made a lot of great connections through that program, and they got me started in a way that would not have been possible on my own; certainly not as quickly.</p>
<h2 id="heading-the-job-hunt">The Job Hunt</h2>
<p>Once I graduated and started looking for jobs, I realized that the JavaScript job market was fiercely competitive. That's still the case now, but jobs have grown approximately proportionally with JavaScript's popularity.</p>
<h3 id="heading-lambdas-alumni-network">Lambda's Alumni Network</h3>
<p>Lambda School fostered a strong community of alumni folks looking for jobs, and Lambda worked directly with tech companies to hire talent, earning themselves a sweet recruiting fee in the process.</p>
<p>One day, a job opportunity from BloomTech landed in my lap. The company was hiring urgently, with the sole stipulation that the position was exclusively for Ruby on Rails development.</p>
<p>With that single wrench in the process, almost nobody was interested. I couldn't believe it. A job falls into these people's laps, and they aren't even willing to consider it just because they'll <em>have</em> to learn a different language? Ludicrous.</p>
<h3 id="heading-lean-on-your-network">Lean on your network!</h3>
<p>I went to one of my favorite instructors for help, knowing that he had spent most of his career working in Ruby on Rails and Elixir before he worked at Lambda.</p>
<p>I was curious:</p>
<ul>
<li><p>is Ruby a dead language?</p>
</li>
<li><p>is it hard to learn?</p>
</li>
<li><p>is it worth spending 1 weekend to try to apply for this job?</p>
</li>
</ul>
<p>The answers were a resounding "no", "absolutely not", and "absolutely yes".</p>
<p>Only after reflecting while writing this post have I realized how important my network has been to me in my career. This particular contact helped get me into Ruby, and also secured my second job once my first one came to an end due to unforeseen circumstances.</p>
<p>More now than ever I recommend building a strong network of successful individuals who have done or are doing things that you would like to do as well. Meet these people, foster good connections, and don't be afraid to lean on them when the time comes.</p>
<p>Everyone wants to help when they can. It feels good.</p>
<p>After receiving all the reassurance I needed, it was time to dive into a project to learn the fundamentals of the language. I would focus on application structure, fundamental rubyisms, and figure out how to deploy a rails application.</p>
<h2 id="heading-twitter-over-a-weekend">Twitter over a weekend</h2>
<p>I spent the weekend building the weakest of Twitter clones, but I did get it deployed.</p>
<p>It was a dead simple CRUD application with some styling on top:</p>
<ul>
<li><p>You can log in.</p>
</li>
<li><p>You have a profile page where you can see all of your posts.</p>
</li>
<li><p>You can go to the home page and see everyone else's posts.</p>
</li>
<li><p>You can like a post.</p>
</li>
</ul>
<p>No non-scaffolded error handling. No separations of concerns. Fat controller, Fat model, repetitious code.</p>
<p>I didn't bother making a "follow" feature, or the ability to see your "liked" posts, or animations, or a splash page, or write any unit tests.</p>
<p>When I say it was simple, it was simple.</p>
<p>I took that project back and showed the instructor, and he immediately forwarded my information to the founder.</p>
<h2 id="heading-the-interview">The Interview</h2>
<p>I interviewed for the role, competing against only 3 other candidates, all from Lambda. It was a 30-minute Q&amp;A session where the founder had sent us all the questions ahead of time so we weren't blindsided.</p>
<p>The questions were mostly focused on experience and which tech stacks and packages/gems we've tried. We talked about my past experience with drama and TV events, previous projects that I've worked on, what I've learned at Lambda School, and this Twitter clone.</p>
<p>I was excited to have been given the opportunity to learn something new, and I showed that throughout the interview. I was bright-eyed and excited to grow.</p>
<h3 id="heading-take-home-questions">Take Home Questions</h3>
<p>After the initial questionnaire, he gave us 3 take-home questions to respond to when we saw fit.</p>
<p>The questions were something along the lines of:</p>
<p>"How would you set up a new application today and make sure you can send emails to 100 people without the emails landing in their spam box?"</p>
<p>"An index page is loading slowly when we hit it. How would you increase the page load speed?"</p>
<p>"What gems do you have experience using? How would you handle background jobs?"</p>
<p>He wanted a paragraph response to each consideration, so I immediately went into research mode. I scoured the internet for hours upon hours that night, took notes, then spent the next afternoon drafting up at least 500 words on each response. I wanted to make sure I was thoughtful and considered each of these problems as well as I could.</p>
<h3 id="heading-nothing-to-lose">Nothing to Lose</h3>
<p>At this rate, I had sent out over 120 applications, was rejected by about 40 of them, and interviewed by about 3. The rest had ghosted me.</p>
<p>I felt desperate to knock this out of the park, even if I wasn't convinced that Ruby was the language for me.</p>
<p>The walls were closing in, and there was no harm in me giving this my best shot. I poured my heart and soul into this interview process. I remember being horrified that I was going to make a fool of myself, that I wasn't meant to be a <em>real</em> developer.</p>
<p>But that passion and angst drove me to put myself out in the world and perform.</p>
<p>Remember that even when it feels like the odds are stacked against you, there is a huge amount of normalcy in having a tough time landing your first job. It's hard to put yourself out into the universe and be told "no", but it is only a "no". You will be okay. The sooner you get comfortable with rejection, the better off your mental state will be.</p>
<h2 id="heading-job-offer">Job Offer</h2>
<p>The next day he responded to me and was so pleased that we discussed an offer and I received a written contract one day later.</p>
<p>It didn't matter whether my answers were 'correct' or not, he was completely enthralled with my interest and passion. We had a lightning-rod of a discussion about all of my different answers, diving back and forth between different ideas. I'd love to go find those answers as a relic of my past thinking.</p>
<p>Any amount of money for me at that time was a life-changing amount of money. I was down to the wire, depressed, anxious. This was the first time that the world ever showed me that I had a <em>real</em> skill worth paying <em>real</em> money for. In a serious way, this was a brand new 'beginning' for me.</p>
<p>I signed it immediately and the rest is history.</p>
<p>That founder and I have a solid relationship now and he's doing amazing things with his company, years later. Last I checked, he had just secured some investment funding, and his Superbowl Half-Time Show still runs smoothly every single year.</p>
<h2 id="heading-final-thoughts">Final Thoughts</h2>
<p>My career, just like all others, has had its ups and downs. I've handled a great deal of rejection and I am not a fit for more jobs than I am a fit for. But that's okay.</p>
<p>As you continue to persist, things have a way of working themselves out. Every time I've put myself "out there" into the universe I have been rewarded handsomely. I would love to encourage others to do the same.</p>
<p>Forge your own path ahead. Build a strong support system, and lean on them heavily. And don't sweat the little stuff.</p>
<p>This career has taught me that if you're a hard worker, and you show up every day, 80% of the work is already done.</p>
<p>Now, I want to hear from you! What's your coding journey been like? What hurdles have you faced, and how have you overcome them?</p>
<p>And if you're new to the game, what's the biggest challenge you're currently facing?</p>
<p>Share your thoughts in the comments, and let's grow together. As I've learned, no programmer is an island.</p>
<p>As always, thanks for reading!</p>
<p>Austin</p>
]]></content:encoded></item><item><title><![CDATA[Overhaul your Work: Three Overlooked Productivity Tips]]></title><description><![CDATA[Enhance Developer Productivity: prioritize sleep, engage in physical activity, and create a tailored note-taking system for improved focus]]></description><link>https://blog.austn.net/overhaul-your-work-three-overlooked-productivity-tips</link><guid isPermaLink="true">https://blog.austn.net/overhaul-your-work-three-overlooked-productivity-tips</guid><category><![CDATA[Productivity]]></category><category><![CDATA[life-hack]]></category><category><![CDATA[Career]]></category><dc:creator><![CDATA[Austin]]></dc:creator><pubDate>Wed, 07 Jun 2023 16:31:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1686154383905/6f0d2bd2-20a7-4c26-b27b-f93029336c3b.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Ever feel like you're juggling too many tasks, and constantly dropping the ball? I've been there. Let me share these secret weapons I wish I'd had in my arsenal sooner.</p>
<p>Over the past few months, I've had a lot of different work to do. Juggling my job, outside consultations, writing, and studying, has been super difficult. That doesn't even begin to account for things like relationships, family time, and my own personal recreation.</p>
<p>Many times I feel like I simply do not have enough hours in the day to get everything I need done.</p>
<p>To help keep my head above water, I've come to appreciate these three ideas very dearly. It feels embarrassing to note that I've only started consistently doing them all recently, despite having been working for quite some years now.</p>
<p>For some reason, I felt like I could "catch up" on these sorts of habits later down the line. If only I'd known earlier how critical each one of them was. I was incorrect for thinking that way, and it is much better to get a grip on these habits sooner rather than later.</p>
<p>Let's explore them in detail!</p>
<h2 id="heading-they-werent-kidding-when-they-said-to-make-sure-youre-getting-7-8-hours-of-sleep-every-night">They weren't kidding when they said to make sure you're getting 7-8 hours of sleep every night.</h2>
<p>By far, the most crucial part of my career's development has been the practice of protecting my sleep. There was a point in time where I was not ever defensive of my own sleep schedule, and would frequently stay up until 2 AM, 3 AM, or later, regardless of when I had to be up in the morning.</p>
<p>Of course, I got my work done so there were "no issues", but I was always a groggy mess to attend early work meetings or calls, and I frequently found myself taking afternoon naps since I'd get tired during the day. I was making myself miserable without even realizing it.</p>
<p>Unfortunately, this is just not a sustainable way to continue your career. I believe with just a little bit of discipline, building a sleep schedule is an easy way to get a huge ROI.</p>
<p>Make sure you're getting 7-8 hours of sleep every night.</p>
<p>Obtain a comfortable bed.</p>
<p>Experiment with pillows that support your neck and sleeping position.</p>
<p>It'll make a world of difference</p>
<h2 id="heading-get-active">Get active.</h2>
<p>When I was in high school, then in college, I believed that physical fitness was a myth. I thought I was unironically doomed to be fat for my entire life.</p>
<p>I come from an overweight family with poor diet and exercise habits, and I thought it was genetic. I believed that my inability to run the mile or do pushups was a permanent debuff that I'd have to live with forever.</p>
<p>This is the wrong way to look at it.</p>
<p>Yes, you may not have a great mile time. Yes too, you may not have won the <a target="_blank" href="https://gilmore.gvsd.us/documents/Info/Forms/Teacher%20Forms/Presidentialchallengetest.pdf">President's Challenge for Physical Fitness</a> during your grade school years, but who cares.</p>
<p>You do not need to be The Rock to take control of your physical fitness and live a better life. You also do not need to be able to run a mile in 6 minutes.</p>
<p>Take some walks, stretch daily, and use your muscles a few times per week. Whether that's with weights like dumbbells or kettlebells, or body-weight exercises like pushups and pullups.</p>
<p>If there are exercises that you're interested in learning that you can't quite do yet, start with assisted forms of those exercises and build up your strength.</p>
<p>Your fitness will improve, and it will empower you to take on new challenges as you grow into it. The sooner you get on top of the small things, the easier it is to handle the big things.</p>
<h2 id="heading-take-notes">Take notes.</h2>
<p>This one is fundamentally a bit different than the others on this list.</p>
<p>I found one day that a senior developer on my team was writing physical notes, in every single meeting, into a little notebook.</p>
<p>He was able to keep track of each topic and divergence, original asks and callouts, all completely seamlessly. His note-taking system made it seem like he was carrying around a little bit of external brain space in his notepad.</p>
<p>I've never read his notes, I don't even know if they're written in English, or any language for that matter, but I know that his note system works. For him.</p>
<p>And that is an important caveat. There are a million different formats to take notes, all with varying usefulness and specializations. But the important concept is to build a system that allows you to regularly add thoughts and ideas, then be able to retrieve those later.</p>
<p>The format of your notes doesn't matter. It could be Notion, EverNote, Obsidian, OneNote, a physical notebook, or anything else you prefer. I personally use SublimeText and Bear.</p>
<p>You may prefer to draw diagrams or use shorthand symbols. The crucial point is to create a system that aids in compiling thoughts and retrieving them later.</p>
<p>Transcribing conversations and ideas forces you to process information actively, fostering a deeper understanding. It's not just about writing things down but about summarizing and critically thinking about what's worth noting.</p>
<h2 id="heading-final-thoughts">Final Thoughts</h2>
<p>I'm just some guy on the Internet.</p>
<p>I've been writing code for a while and having a good time doing it, but recently stumbled into an awareness of these concepts and they've completely overhauled the way I work. I think they could prove valuable for you too.</p>
<p>What are some other underrated productivity tips? Let me know what you think.</p>
<p>As always, thanks for reading!</p>
]]></content:encoded></item><item><title><![CDATA[IP Validation Algorithm in Ruby]]></title><description><![CDATA[Master Ruby IP validation using this Medium LeetCode guide, covering IP addresses, string manipulation, and efficient IPv4/IPv6 validation]]></description><link>https://blog.austn.net/ip-validation-algorithm-in-ruby</link><guid isPermaLink="true">https://blog.austn.net/ip-validation-algorithm-in-ruby</guid><category><![CDATA[Ruby]]></category><category><![CDATA[algorithms]]></category><category><![CDATA[data structures]]></category><dc:creator><![CDATA[Austin]]></dc:creator><pubDate>Tue, 06 Jun 2023 17:33:32 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1686068371524/59fdd949-980b-4441-83fd-633c514cd3ca.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Today we're gonna take a stab at a Medium LeetCode problem. For a long time I never even attempted these because I was worried that they'd be "too hard", but this example will demonstrate that this is not the case.</p>
<p>Join me as we dive into the problem, the solution written out in English, then break down my algorithm to solve this algorithm. We will learn a little bit about IP addresses, and Ruby's nifty string manipulation methods.</p>
<p>Let's dive in!</p>
<p><strong>The Problem</strong></p>
<p>Given a string queryIP, return <code>"IPv4"</code> if IP is a valid IPv4 address, <code>"IPv6"</code> if IP is a valid IPv6 address or <code>"Neither"</code> if IP is not a correct IP of any type.</p>
<p>A valid IPv4 address is an IP in the form <code>"x[1].x[2].x[3].x[4]"</code> where <code>0 &lt;= x[i] &lt;= 255</code> and <code>x[i]</code> cannot contain leading zeros. For example, <code>"192.168.1.1"</code> and <code>"192.168.1.0"</code> are valid IPv4 addresses while <code>"192.168.01.1"</code>, <code>"192.168.1.00"</code>, and <code>"192.168@1.1"</code> are invalid IPv4 addresses.</p>
<p>A valid IPv6 address is an IP in the form <code>"x[1]:x[2]:x[3]:x[4]:x[5]:x[6]:x[7]:x[8]"</code> where: <code>1 &lt;= x[i].length &lt;= 4</code></p>
<p><code>x[i]</code> is a hexadecimal string that may contain digits, lowercase English letters ('a' to 'f') and upper-case English letters ('A' to 'F'). Leading zeros are allowed in <code>x[i]</code>. For example, <code>"2001:0db8:85a3:0000:0000:8a2e:0370:7334"</code> and <code>"2001:db8:85a3:0:0:8A2E:0370:7334"</code> are valid IPv6 addresses, while <code>"2001:0db8:85a3::8A2E:037j:7334"</code> and <code>"02001:0db8:85a3:0000:0000:8a2e:0370:7334"</code> are invalid IPv6 addresses.</p>
<p><strong>Understanding IP Addresses</strong></p>
<p>An Internet Protocol address (IP address) is a unique identifier for devices on a network. There are two types of IP addresses in common use:</p>
<ol>
<li><p><strong>IPv4:</strong> The IPv4 (Internet Protocol version 4) is a numerical label assigned to each device in a computer network that uses the Internet Protocol. An IPv4 address consists of four numbers separated by periods. Each number can be between 0 and 255.</p>
</li>
<li><p><strong>IPv6</strong>: The IPv6 (Internet Protocol version 6) is the most recent version of the Internet Protocol. An IPv6 address consists of eight groups of one to four hexadecimal digits, separated by colons. Each hexadecimal digit is a number from 0-9 or a letter from A-F.</p>
</li>
</ol>
<p><strong>Solution in English</strong></p>
<p>In our solution, we distinguish between IPv4 and IPv6 addresses by their delimiters: periods for IPv4, and colons for IPv6. We split the input string accordingly.</p>
<p>For each segment resulting from the split, we validate its contents and length based on the respective IPv4 and IPv6 standards.</p>
<p>For IPv6 addresses, we additionally check that each segment only contains valid hexadecimal characters.</p>
<p>If the input string matches the criteria for either IPv4 or IPv6, we return the corresponding string. If it matches neither, we return "Neither".</p>
<p>This approach efficiently checks the validity of the IP address by inspecting each segment individually and verifying its conformance to the standards of either IP version.</p>
<p>Worth noting: you can totally use RegEx to solve this problem. I'm not going to, for clarity.</p>
<p><strong>Code Solution</strong></p>
<pre><code class="lang-ruby"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">valid_ip_address</span><span class="hljs-params">(query_ip)</span></span>
    ipv4 = query_ip.split(<span class="hljs-string">'.'</span>)
    ipv6 = query_ip.split(<span class="hljs-string">':'</span>)

    <span class="hljs-keyword">return</span> <span class="hljs-string">"IPv4"</span> <span class="hljs-keyword">if</span> ipv4.length == <span class="hljs-number">4</span> &amp;&amp; is_ipv4(ipv4)
    <span class="hljs-keyword">return</span> <span class="hljs-string">"IPv6"</span> <span class="hljs-keyword">if</span> ipv6.length == <span class="hljs-number">8</span> &amp;&amp; is_ipv6(ipv6)

    <span class="hljs-string">"Neither"</span>
<span class="hljs-keyword">end</span>

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">is_ipv4</span><span class="hljs-params">(ipv4)</span></span>
    ipv4.all? <span class="hljs-keyword">do</span> <span class="hljs-params">|part|</span>
        part == part.to_i.to_s &amp;&amp; part.to_i.between?(<span class="hljs-number">0</span>, <span class="hljs-number">255</span>)
    <span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span>

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">is_ipv6</span><span class="hljs-params">(ipv6)</span></span>
    ipv6.all? <span class="hljs-keyword">do</span> <span class="hljs-params">|part|</span>
        part.length.between?(<span class="hljs-number">1</span>, <span class="hljs-number">4</span>) &amp;&amp; is_hex(part)
    <span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span>

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">is_hex</span><span class="hljs-params">(s)</span></span>
    s.each_char.all? { <span class="hljs-params">|char|</span> <span class="hljs-string">'0123456789abcdefABCDEF'</span>.<span class="hljs-keyword">include</span>?(char) }
<span class="hljs-keyword">end</span>
</code></pre>
<p><strong>Code Breakdown</strong></p>
<p>First, we split the arrays up. To visualize how this shakes out, I've included a couple smaller diagrams below</p>
<p><strong>IPv4</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686072605237/4ac20df1-cc65-470b-8c16-44b422204b3f.png" alt class="image--center mx-auto" /></p>
<p><strong>IPv6</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686072610851/3981f02d-764e-405e-8cd9-953f119eebb0.png" alt class="image--center mx-auto" /></p>
<p>Once we've split up the IP addresses into arrays, we can then iterate through each part and validate that the data aligns with how we expect it to. Diving further into each of the methods below:</p>
<ul>
<li><p><strong>valid_ip_address</strong>: This is the main function that splits the IP address by '.' and ':' to separate its components, and check whether it can be a valid IPv4 or IPv6 address based on the length of each part.</p>
</li>
<li><p><strong>is_ipv4</strong>: Checks if all parts of the potential IPv4 address are integers without leading zeroes and are within the range 0-255.</p>
</li>
<li><p><strong>is_ipv6</strong>: Checks if all parts of the potential IPv6 address contain 1 to 4 characters and these characters are hexadecimal digits.</p>
</li>
<li><p><strong>is_hex</strong>: Checks whether every character in the given string is a valid hexadecimal character, which includes the digits <code>0-9</code> and the letters <code>a-f</code> or <code>A-F</code>.</p>
</li>
</ul>
<p><strong>Final Thoughts</strong></p>
<p>Usually, Medium LeetCode problems will add one or two extra layers of complexity that make problems more difficult. This does not make them unsolvable!</p>
<p>Break each one down in English first, and take your time. Once you've got it solved in English and you understand the problem, only then write code.</p>
<p>As you solve more and more of these problems, they become less daunting and more like challenges you're prepared to tackle.</p>
<p>Thanks for reading!</p>
]]></content:encoded></item><item><title><![CDATA[Javascript: Use a Hash Map to solve "First Non-Repeating Character" in O(n) time]]></title><description><![CDATA[Solve "First Non Repeating Character" in JavaScript with hash maps; optimize LeetCode algorithms for O(n) complexity]]></description><link>https://blog.austn.net/javascript-use-a-hash-map-to-solve-first-non-repeating-character-in-on-time</link><guid isPermaLink="true">https://blog.austn.net/javascript-use-a-hash-map-to-solve-first-non-repeating-character-in-on-time</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[algorithms]]></category><category><![CDATA[leetcode-solution]]></category><category><![CDATA[Technical interview]]></category><category><![CDATA[data structures]]></category><dc:creator><![CDATA[Austin]]></dc:creator><pubDate>Thu, 01 Jun 2023 18:45:34 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1685644845777/6d9e5270-68fb-48a3-bb0d-e18e165dc562.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you're struggling with LeetCode problems, algorithms and data structures, or job interview prep, hash maps are a great tool to have in your tool belt. They're fast, flexible, and easy to implement. Other languages like Ruby utilize hashes specifically, but JavaScript has Objects for a similar effect.</p>
<p>Today we're going to solve the "First Non-Repeating Character" problem in O(n) time and space complexity, then dig into the details of how it all works.</p>
<p>Let's dive right in!</p>
<h2 id="heading-first-non-repeating-character">First Non-Repeating Character</h2>
<h3 id="heading-problem">Problem</h3>
<p>Write a function that takes in a string of lowercase English-alphabet characters and returns the index of the string's first non-repeating character.</p>
<p>The first non-repeating character is the first character in a string that occurs only once.</p>
<p>If the input string doesn't have any non-repeating characters, your function should return -1.</p>
<p><strong>Sample Input</strong></p>
<p><code>string = "abcdcaf"</code></p>
<p><strong>Sample Output</strong></p>
<p><code>1</code></p>
<p>The first non-repeating character is "b", and it is found at index 1.</p>
<h3 id="heading-solution">Solution</h3>
<p>We're going to want to iterate through the string and create a hashmap containing the character and its frequency.</p>
<p>This will look something like below, for our sample input:</p>
<p><code>{ "a": 2, "b": 1, "c": 2, "d": 1, "f": 1}</code></p>
<p>Now we have a hash containing our <code>character:frequency</code> pairs. If a character has a frequency greater than or equal to <code>2</code>, we know that there are duplicates of that character in the string, so this entry should be deleted.</p>
<p><code>{ "b": 1, "d": 1, "f": 1 }</code></p>
<p>Now, using JavaScript's inbuilt Object methods, we should:</p>
<ul>
<li><p>find the first character of the hash</p>
</li>
<li><p>find the index at which that character appears in the array</p>
</li>
<li><p>return the index</p>
</li>
</ul>
<p>In this case, that would be <code>1</code> since "b" appears as the second character in the initial array.</p>
<p>This problem can be solved with a time and space complexity of O(n). Code and explanations below!</p>
<h3 id="heading-code">Code</h3>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">firstNonRepeatingCharacter</span>(<span class="hljs-params">string</span>) </span>{
  <span class="hljs-keyword">let</span> obj = {}
  <span class="hljs-keyword">let</span> split_str_arr = string.split(<span class="hljs-string">""</span>)

  <span class="hljs-keyword">let</span> makeKeys = <span class="hljs-function">(<span class="hljs-params">obj, str_arr</span>) =&gt;</span> {
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> i = <span class="hljs-number">0</span>; i &lt; str_arr.length; i++) {
      char = str_arr[i]

      <span class="hljs-keyword">if</span> (obj[char]) {
        obj[char] += <span class="hljs-number">1</span>
      } <span class="hljs-keyword">else</span> {
        obj[char] = <span class="hljs-number">1</span>
      }      
    }
  }

  <span class="hljs-keyword">let</span> deleteDuplicateKeys = <span class="hljs-function">(<span class="hljs-params">obj</span>) =&gt;</span> {
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> key <span class="hljs-keyword">in</span> obj) {
      <span class="hljs-keyword">if</span> (obj.hasOwnProperty(key)) {
        <span class="hljs-keyword">if</span>(obj[key] &gt;= <span class="hljs-number">2</span>) {
          <span class="hljs-keyword">delete</span> obj[key]
        }
      }
    }
  }

  <span class="hljs-keyword">let</span> first;
  <span class="hljs-keyword">let</span> answer;
  <span class="hljs-keyword">let</span> checkAnswer = <span class="hljs-function">(<span class="hljs-params">obj, str_arr</span>) =&gt;</span> {
    <span class="hljs-keyword">if</span> (<span class="hljs-built_in">Object</span>.keys(obj).length &gt; <span class="hljs-number">0</span>) {
      first = <span class="hljs-built_in">Object</span>.keys(obj)[<span class="hljs-number">0</span>]
      answer = str_arr.indexOf(first)
    } <span class="hljs-keyword">else</span> {
      answer = <span class="hljs-number">-1</span>
    }
  }

  makeKeys(obj, split_str_arr)
  deleteDuplicateKeys(obj)
  checkAnswer(obj, split_str_arr)
  <span class="hljs-keyword">return</span> answer
}
</code></pre>
<p>Let's split this down, method-by-method.</p>
<p><strong>makeKeys()</strong></p>
<p>Iterate through the initial split string array and populates our <code>obj</code> hash with the string's character and its frequency of appearances within the string.</p>
<p>This will accomplish a state like:</p>
<pre><code class="lang-javascript">{ <span class="hljs-string">"a"</span>: <span class="hljs-number">2</span>, <span class="hljs-string">"b"</span>: <span class="hljs-number">1</span>, <span class="hljs-string">"c"</span>: <span class="hljs-number">2</span>, <span class="hljs-string">"d"</span>: <span class="hljs-number">1</span>, <span class="hljs-string">"f"</span>: <span class="hljs-number">1</span>}
</code></pre>
<p><strong>deleteDuplicateKeys()</strong></p>
<p>Iterate through our hash map, checking first if the element exists within the hash using the <code>hasOwnProperty</code> method, then deleting any occurrences that have a frequency of 2 or higher.</p>
<pre><code class="lang-javascript">{ <span class="hljs-string">"b"</span>: <span class="hljs-number">1</span>, <span class="hljs-string">"d"</span>: <span class="hljs-number">1</span>, <span class="hljs-string">"f"</span>: <span class="hljs-number">1</span> }
</code></pre>
<p><strong>checkAnswer()</strong></p>
<p>Check if we have any remaining elements after deduplication, and if we have any, we use the first element in the hash map and find its original index. This gets populated into the <code>answer</code> variable, which will either be the index of that character's first appearance in the string, or <code>-1</code>.</p>
<p>In the case of our sample input, we know that the first character in the hash is <code>b</code>, so we use <code>str_arr.indexOf("b")</code> to find the character's index in the array and return that.</p>
<p>If no objects were left after the deduplication step, we'll return <code>-1</code>.</p>
<h2 id="heading-final-thoughts">Final thoughts</h2>
<p>Through this post, we've dug into the basics of implementing a Hash map in O(n) time and using it to solve a simple algorithm.</p>
<p>These problems can get complex and quite difficult, so always remember to take breaks and be gentle with yourself on your journey through algorithms and data structures.</p>
<p>Let me know if you have any other fun solutions to this problem or other fun problems to solve!</p>
]]></content:encoded></item><item><title><![CDATA[Hiatus]]></title><description><![CDATA[Apologies for hiatus; busy with projects, consulting, and Zelda game. Excited to share upcoming posts, technical tutorials, and learnings. Stay tuned!]]></description><link>https://blog.austn.net/hiatus</link><guid isPermaLink="true">https://blog.austn.net/hiatus</guid><dc:creator><![CDATA[Austin]]></dc:creator><pubDate>Wed, 31 May 2023 18:01:10 GMT</pubDate><content:encoded><![CDATA[<p>I've always thought it's silly for content creators to write that they're sorry that they took some time away from the internet. I'm hardly a content creator, but my point remained: It's okay to take some time away, and nobody is going to suffer without your presence.</p>
<p>Then I started writing. Makes a lot more sense now, that nagging dread of productivity. The unending ring of "I should be writing", "I should be posting", etc., etc.</p>
<p>With that being said, sorry for the brief hiatus!</p>
<p>I've recently been working on a project that's taken a huge portion of my time, and I took on another consulting client completely separately, so my days have been quite busy.</p>
<p>We completed that first project with some success and some failure, and the latter is ongoing. I'll be able to share more of my learnings regarding those later, especially from where I fell short.</p>
<p>I'd be lying if I didn't mention that the latest Zelda game, Tears of the Kingdom, didn't have something to do with my break as well. I've found it to be a beautiful gem that melts away all of my real-life responsibilities. That's a great thing and a bad thing, but more on that in another article.</p>
<p>I have a lot of written posts I'm excited to share with y'all, and more in the works. Especially interested in sharing technical tutorials that I've been working on! One small tidbit coming this Friday.</p>
<p>Until then,</p>
<p>Austin</p>
]]></content:encoded></item><item><title><![CDATA[What's the deal with Webrings?]]></title><description><![CDATA[Explore Webrings: Revive online communities, boost SEO, discover unique coding languages like Rockstar, and embrace internet curiosity]]></description><link>https://blog.austn.net/whats-the-deal-with-webrings</link><guid isPermaLink="true">https://blog.austn.net/whats-the-deal-with-webrings</guid><category><![CDATA[internet]]></category><category><![CDATA[Developer]]></category><category><![CDATA[history]]></category><dc:creator><![CDATA[Austin]]></dc:creator><pubDate>Tue, 09 May 2023 14:38:07 GMT</pubDate><content:encoded><![CDATA[<p>Earlier this morning I was looking for inspiration to work on my personal website. I stumbled upon another web developer's blog and scrolled through until I saw something that struck me as.. strange. I was hooked immediately.</p>
<p>At the bottom of their About page, there was a small component that held a list of names that linked to other blogs, with "PREVIOUS" and "NEXT" buttons at the top.</p>
<p>It was titled "The Claw Webring".</p>
<blockquote>
<p>Webrings were online communities designed to amplify a blog's SEO and shout out the author's friends and colleagues. Read more <a target="_blank" href="https://en.wikipedia.org/wiki/Webring">here</a></p>
</blockquote>
<p>I clicked "JOIN". It led me <a target="_blank" href="https://github.com/whitep4nth3r/the-claw-webring">here</a>.</p>
<p>Mostly empty GitHub repo. Not a lot of detail. Okay, now I'm curious.</p>
<p>I went back and scrolled through the list and clicked a random name off the list, curious to see what was on the other side.</p>
<p>It led me to the personal website belonging to the author and developer that created <a target="_blank" href="https://codewithrockstar.com/">https://codewithrockstar.com/</a>, which I had no idea existed until now.</p>
<p>It's a coding language that also functions as a heavy metal song. Designed specifically to confuse recruiters who aren't familiar with the term "rockstar-dev".</p>
<h2 id="heading-from-their-website-fizzbuzz-written-in-rockstar">From their website, FizzBuzz written in Rockstar:</h2>
<blockquote>
<pre><code class="lang-bash">Midnight takes your heart and your soul
While your heart is as high as your soul
Put your heart without your soul into your heart

Give back your heart


Desire is a lovestruck ladykiller
My world is nothing 
Fire is ice
Hate is water
Until my world is Desire,
Build my world up
If Midnight taking my world, Fire is nothing and Midnight taking my world, Hate is nothing
Shout <span class="hljs-string">"FizzBuzz!"</span>
Take it to the top

If Midnight taking my world, Fire is nothing
Shout <span class="hljs-string">"Fizz!"</span>
Take it to the top

If Midnight taking my world, Hate is nothing
Say <span class="hljs-string">"Buzz!"</span>
Take it to the top

Whisper my world
</code></pre>
</blockquote>
<p>Esoteric <a target="_blank" href="https://hackernoon.com/tagged/programming-languages?ref=hackernoon.com">programming languages</a> are very interesting. Someone had to sit down and create these tools, out of labors of love. Everyone knows about <a target="_blank" href="https://esolangs.org/wiki/Brainfuck?ref=hackernoon.com">Brainf**k</a>, a language designed to be almost completely human-unreadable, but it's cool to see new examples pop up.</p>
<p>As interesting as Rockstar is, the point of this story, as is the case with most journeys, is not where I ended up or what I found, but rather the journey itself.</p>
<p>I saw an interesting component. It had a list of links. I clicked a link. I was curious to see what existed out there. I found something cool.</p>
<p>This curiosity-&gt;exploration-&gt;discovery-&gt;share feedback loop doesn't seem to happen often on the internet anymore. But I stumbled across it today and I was very pleased to have found it. I felt like I got a glimpse into the lives of some interesting people. It was certainly more satisfying than clicking through people's Twitter or LinkedIn profiles.</p>
<p>Internet communities and fandoms were one of the most beautiful aspects of early Internet culture. They may have dated roots in SEO and closed-off internet communities, but I think we should bring webrings back. Let me know what you think!</p>
<p>Thanks for reading</p>
<p>Austin</p>
<blockquote>
<p>Originally posted on HackerNoon, original article here: <a target="_blank" href="https://hackernoon.com/whats-the-deal-with-webrings">https://hackernoon.com/whats-the-deal-with-webrings</a></p>
</blockquote>
]]></content:encoded></item><item><title><![CDATA[Sliding Window Algorithm]]></title><description><![CDATA[Optimize Sliding Window Algorithm for arrays, strings; solve max sum, longest, min window substrings. Master LeetCode challenges]]></description><link>https://blog.austn.net/sliding-window-algorithm</link><guid isPermaLink="true">https://blog.austn.net/sliding-window-algorithm</guid><category><![CDATA[algorithms]]></category><category><![CDATA[Ruby]]></category><dc:creator><![CDATA[Austin]]></dc:creator><pubDate>Mon, 08 May 2023 04:25:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1683519768310/50497ee1-8c7a-4887-9c74-552f7ee66852.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The sliding window algorithm is an efficient tool for providing solutions to problems involving the selection and comparison of subsets within arrays and strings.</p>
<p>Examples of such problems include finding the maximum sum subarray of a given size, finding the length of the longest substring without repeating characters, and finding the minimum window substring containing all characters of a given string. After understanding how the window sliding algorithm works, one could feasibly complete this Medium LeetCode problem: <a target="_blank" href="https://leetcode.com/problems/maximum-sum-of-distinct-subarrays-with-length-k/">https://leetcode.com/problems/maximum-sum-of-distinct-subarrays-with-length-k/</a></p>
<p>In this post, we will be tackling a simpler modification of the above problem. We'll detail how you can find the maximum sum subarray of a given array, with a subarray size of <code>K</code>.</p>
<h2 id="heading-maximum-sum-subarray-of-size-k">Maximum Sum Subarray of size K</h2>
<p><strong>Problem statement:</strong></p>
<p>Given an array of integers and an integer <code>k</code>, find the maximum sum of any contiguous subarray of size <code>k</code>.</p>
<p><strong>Input:</strong></p>
<ul>
<li><p>An array <code>nums</code> containing <code>n</code> integers, where <code>1 &lt;= n &lt;= 10^5</code></p>
</li>
<li><p>An integer <code>k</code>, where <code>1 &lt;= k &lt;= n</code></p>
</li>
</ul>
<p><strong>Output:</strong></p>
<ul>
<li>Return the maximum sum of any contiguous subarray of size <code>k</code></li>
</ul>
<pre><code class="lang-ruby"><span class="hljs-symbol">Input:</span> nums = [<span class="hljs-number">2</span>, <span class="hljs-number">1</span>, <span class="hljs-number">5</span>, <span class="hljs-number">1</span>, <span class="hljs-number">3</span>, <span class="hljs-number">2</span>], k = <span class="hljs-number">3</span>
<span class="hljs-symbol">Output:</span> <span class="hljs-number">9</span>
</code></pre>
<p>And a potential solution in ruby:</p>
<pre><code class="lang-ruby"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">max_sum_subarray</span><span class="hljs-params">(nums, k)</span></span>
  max_sum = <span class="hljs-number">0</span>
  window_sum = <span class="hljs-number">0</span>
  window_start = <span class="hljs-number">0</span>

  nums.each_with_index <span class="hljs-keyword">do</span> <span class="hljs-params">|num, window_end|</span>
    window_sum += num <span class="hljs-comment"># Add the next element to the window sum</span>

    <span class="hljs-keyword">if</span> window_end &gt;= k - <span class="hljs-number">1</span> <span class="hljs-comment"># If the window size is &gt;= k</span>
      max_sum = [max_sum, window_sum].max <span class="hljs-comment"># Update the max_sum if needed</span>
      window_sum -= nums[window_start] <span class="hljs-comment"># Remove the element going out of the window</span>
      window_start += <span class="hljs-number">1</span> <span class="hljs-comment"># Slide the window</span>
    <span class="hljs-keyword">end</span>
  <span class="hljs-keyword">end</span>

  max_sum
<span class="hljs-keyword">end</span>

nums = [<span class="hljs-number">2</span>, <span class="hljs-number">1</span>, <span class="hljs-number">5</span>, <span class="hljs-number">1</span>, <span class="hljs-number">3</span>, <span class="hljs-number">2</span>]
k = <span class="hljs-number">3</span>
puts max_sum_subarray(nums, k) <span class="hljs-comment"># Output: 9</span>
</code></pre>
<p>In this implementation, we initialize a <code>window_sum</code>. This represents the sum of elements within the sliding window.</p>
<p>We iterate through the array, adding elements to the <code>window_sum</code>.</p>
<p>When the window size is greater than or equal to <code>k</code>, we update the <code>max_sum</code> and remove the element that is no longer in the window.</p>
<p>I've included a diagram below, to help demonstrate how this works:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1683519502863/12c0b819-c9d8-4cb9-b1ec-e7e381dca5f6.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-final-thoughts">Final thoughts</h2>
<p>Hopefully, the sliding window algorithm is a bit clearer now. Like most, these problems start simple but then require additional considerations as the problems get more complicated.</p>
<p>If you're interested in advancing your algorithm skills with the sliding window, here are two Medium LeetCode problems that can be solved using a similar technique:</p>
<ul>
<li><p><a target="_blank" href="https://leetcode.com/problems/maximum-sum-of-distinct-subarrays-with-length-k/">https://leetcode.com/problems/maximum-sum-of-distinct-subarrays-with-length-k/</a></p>
</li>
<li><p><a target="_blank" href="https://leetcode.com/problems/maximum-subarray-sum-with-one-deletion/">https://leetcode.com/problems/maximum-subarray-sum-with-one-deletion/</a></p>
</li>
</ul>
<p>Thanks for reading!</p>
]]></content:encoded></item><item><title><![CDATA[Stand out by understanding RSpec]]></title><description><![CDATA[RSpec is a Rails gem designed to make it easy to write unit and feature tests. If you run into any trouble, you can read the docs here Throughout my career…]]></description><link>https://blog.austn.net/stand-out-by-understanding-rspec</link><guid isPermaLink="true">https://blog.austn.net/stand-out-by-understanding-rspec</guid><category><![CDATA[Testing]]></category><category><![CDATA[Ruby]]></category><category><![CDATA[Ruby on Rails]]></category><dc:creator><![CDATA[Austin]]></dc:creator><pubDate>Fri, 05 May 2023 18:00:40 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1683301809269/470845d1-aee9-400e-9182-9fd1916df836.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>RSpec is a Rails gem designed to make it easy to write unit and feature tests. If you run into any trouble, you can read the docs <a target="_blank" href="https://rspec.info/documentation/">here</a></p>
<p>Throughout my career and especially while job-hunting, the number one piece of advice I was given was to write unit tests.</p>
<p>In any given situation, be it a take-home exam or a portfolio piece, if you write tests it will show that you're a thoughtful engineer who takes time to think through problems.</p>
<p>And your code will be better for it.</p>
<p>In this article we'll talk through how you can get RSpec running, the basics of writing your first unit tests, and some nifty features in RSpec to help keep your tests clean and organized.</p>
<p>Let's dive in:</p>
<h2 id="heading-installing-rspec">Installing RSpec</h2>
<p>Before you can start writing tests with RSpec, you'll need to install the gem and set up your Rails application. To get started, follow these steps:</p>
<ol>
<li>Open your <code>Gemfile</code> and add the <code>rspec-rails</code> gem to the development and test group:</li>
</ol>
<pre><code class="lang-ruby">group <span class="hljs-symbol">:development</span>, <span class="hljs-symbol">:test</span> <span class="hljs-keyword">do</span>
  gem <span class="hljs-string">'rspec-rails'</span>, <span class="hljs-string">'~&gt; 5.0'</span>
<span class="hljs-keyword">end</span>
</code></pre>
<ol>
<li><p>Install the gem by running <code>bundle install</code></p>
</li>
<li><p>Run the RSpec generator with <code>rails generate rspec:install</code>. This command creates a <code>.rspec</code> file, a <code>spec</code> folder, and a <code>spec_helper.rb</code> file in your project directory.</p>
</li>
</ol>
<p>After this is configured, you're ready to write your first unit test!</p>
<h2 id="heading-writing-our-first-tests">Writing our first tests</h2>
<p>With RSpec installed, let's create a simple model and write a unit test to ensure it's working correctly.</p>
<ol>
<li><p>For this example, we'll create a <code>User</code> model with a <code>name</code> attribute. Run <code>rails generate model User name:string</code> to generate the necessary files. You'll have to run a migration for this change to be added to your database.</p>
</li>
<li><p>Add the following code to our model to validate the presence of a <code>name</code> field:</p>
<pre><code class="lang-ruby"> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">User</span> &lt; ApplicationRecord</span>
   validates <span class="hljs-symbol">:name</span>, <span class="hljs-symbol">presence:</span> <span class="hljs-literal">true</span>
 <span class="hljs-keyword">end</span>
</code></pre>
</li>
<li><p>Note that in the <code>spec</code> folder, a new folder called <code>models</code>, and inside it, a file named <code>user_spec.rb</code> has been generated. This is where we'll write our tests for the User model.</p>
</li>
<li><p>Open <code>user_spec.rb</code> and start by creating a new <code>describe</code> block for the User model and write a simple test to check if a user with a valid name can be created</p>
<pre><code class="lang-ruby"> RSpec.describe User <span class="hljs-keyword">do</span>
   it <span class="hljs-string">'is valid with a name'</span> <span class="hljs-keyword">do</span>
     user = User.new(<span class="hljs-symbol">name:</span> <span class="hljs-string">'John Doe'</span>)
     expect(user).to be_valid
   <span class="hljs-keyword">end</span>

   it <span class="hljs-string">'is not valid without a name'</span> <span class="hljs-keyword">do</span>
     user = User.new
     expect(user).to_not be_valid
   <span class="hljs-keyword">end</span>
 <span class="hljs-keyword">end</span>
</code></pre>
<ol>
<li>To execute your test, run <code>bundle exec rspec</code> in your terminal. If everything is set up correctly, you should see an output indicating that the test passed.</li>
</ol>
</li>
</ol>
<p>You can now write additional tests for your User model or any other part of your application by following the same pattern within the <code>spec</code> folder.</p>
<h2 id="heading-extra-features">Extra features</h2>
<p>While none of these are necessary to function, RSpec does have a whole host of cool features that help promote clean and organized unit tests.</p>
<p>It's easy for these files to get long and unwieldy, so keeping your codebase clean and DRY will demonstrate expertise.</p>
<p>Below, I'll detail each of RSpec's interesting features that we use regularly in our day-to-day development work, as well as a code example to demonstrate what I mean.</p>
<h3 id="heading-context-blocks">Context blocks</h3>
<p>The <code>context</code> method helps create logical groups for your tests based on specific conditions or scenarios.</p>
<p>This can make your tests more readable and better organized.</p>
<pre><code class="lang-ruby">RSpec.describe User <span class="hljs-keyword">do</span>
  context <span class="hljs-string">'when name is present'</span> <span class="hljs-keyword">do</span>
    let(<span class="hljs-symbol">:user</span>) { User.new(<span class="hljs-symbol">name:</span> <span class="hljs-string">'John Doe'</span>) }

    it <span class="hljs-string">'is valid'</span> <span class="hljs-keyword">do</span>
      expect(user).to be_valid
    <span class="hljs-keyword">end</span>
  <span class="hljs-keyword">end</span>

  context <span class="hljs-string">'when name is not present'</span> <span class="hljs-keyword">do</span>
    let(<span class="hljs-symbol">:user</span>) { User.new }

    it <span class="hljs-string">'is not valid'</span> <span class="hljs-keyword">do</span>
      expect(user).to_not be_valid
    <span class="hljs-keyword">end</span>
  <span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span>
</code></pre>
<h3 id="heading-shared-examples">Shared examples</h3>
<p>RSpec allows you to define reusable examples that can be included in multiple test groups, helping you keep your tests DRY.</p>
<pre><code class="lang-ruby">shared_examples <span class="hljs-string">'a valid user'</span> <span class="hljs-keyword">do</span>
  it <span class="hljs-string">'is valid'</span> <span class="hljs-keyword">do</span>
    expect(user).to be_valid
  <span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span>

describe AdminUser <span class="hljs-keyword">do</span>
  let(<span class="hljs-symbol">:user</span>) { AdminUser.new(<span class="hljs-symbol">name:</span> <span class="hljs-string">'John Doe'</span>) }

  it_behaves_like <span class="hljs-string">'a valid user'</span>
<span class="hljs-keyword">end</span>

describe RegularUser <span class="hljs-keyword">do</span>
  let(<span class="hljs-symbol">:user</span>) { RegularUser.new(<span class="hljs-symbol">name:</span> <span class="hljs-string">'Jane Doe'</span>) }

  it_behaves_like <span class="hljs-string">'a valid user'</span>
<span class="hljs-keyword">end</span>
</code></pre>
<h3 id="heading-custom-matchers">Custom matchers</h3>
<p>RSpec allows you to create custom matchers that make your tests more expressive and readable.</p>
<pre><code class="lang-ruby">RSpec::Matchers.define <span class="hljs-symbol">:be_a_valid_user</span> <span class="hljs-keyword">do</span>
  match <span class="hljs-keyword">do</span> <span class="hljs-params">|user|</span>
    user.valid?
  <span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span>

describe User <span class="hljs-keyword">do</span>
  let(<span class="hljs-symbol">:user</span>) { User.new(<span class="hljs-symbol">name:</span> <span class="hljs-string">'John Doe'</span>) }

  it <span class="hljs-string">'is valid with a name'</span> <span class="hljs-keyword">do</span>
    expect(user).to be_a_valid_user
  <span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span>
</code></pre>
<h2 id="heading-final-thoughts">Final thoughts</h2>
<p>As someone who's been involved both in interviewing and in hiring, I've seen that one of the top ways a candidate can stay out is by writing a suite of thoughtful unit tests.</p>
<p>It's an immediate signal to the hiring team that you're a professional and you know what you're doing.</p>
<p>Use this post as a reference and write some tests!</p>
<p>Thanks for reading</p>
<p>Austin</p>
]]></content:encoded></item><item><title><![CDATA[Crucial Books to level up your Ruby on Rails skills]]></title><description><![CDATA[Learning a new programming language can be very intimidating. There's infinite unknowns, and it can be difficult to chart your own path forward. Something…]]></description><link>https://blog.austn.net/crucial-books-to-level-up-your-ruby-on-rails-skills</link><guid isPermaLink="true">https://blog.austn.net/crucial-books-to-level-up-your-ruby-on-rails-skills</guid><category><![CDATA[books]]></category><category><![CDATA[technology]]></category><category><![CDATA[Technical writing ]]></category><category><![CDATA[learning]]></category><category><![CDATA[Learning Journey]]></category><dc:creator><![CDATA[Austin]]></dc:creator><pubDate>Wed, 03 May 2023 19:21:23 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1683141476090/f22ea5ce-edcd-44ed-9cf3-579729524987.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Learning a new programming language can be very intimidating. There's infinite unknowns, and it can be difficult to chart your own path forward. Something about reading words on a page activates neurons for me in a way that other exercises don't quite fulfill. I recommend checking out these books for anyone looking to level up their abilities, regardless of current skill level.</p>
<p>Here's 3 that have impacted my career drastically, along with a link and note about each:</p>
<h2 id="heading-learn-ruby-the-hard-way">Learn Ruby the Hard Way</h2>
<p>Author: Zed Shaw</p>
<p><a target="_blank" href="https://www.amazon.com/Learn-Ruby-Hard-Way-Computational/dp/032188499X">Amazon Link</a></p>
<p>Learn Ruby the Hard way was chalk-full of great exercises and projects to work on. If you stick it through, finish the exercises, and run all the provided code, this book is very insightful into how Ruby works. Great for beginners to deep-dive into the language, but also a solid recommendation to anyone who isn't 100% confident in their Ruby chops at the mid or senior levels.</p>
<h2 id="heading-poodr">POODR</h2>
<p>Author: Sandi Metz</p>
<p><a target="_blank" href="https://www.amazon.com/Practical-Object-Oriented-Design-Ruby-Addison-Wesley/dp/0321721330">Amazon link</a></p>
<p>Funny name, amazing book. Initially Principles of Object Oriented Design in Ruby was gifted to me by a coworker. It completely changed the way I think about designing software, and especially organizing my thinking in regards to Ruby. This is my favorite book on the list.</p>
<h2 id="heading-pragmatic-programmer">Pragmatic Programmer</h2>
<p>Author: David Thomas</p>
<p><a target="_blank" href="https://www.amazon.com/Pragmatic-Programmer-Anniversary-Journey-Mastery/dp/B0833FBNHV/ref=sr_1_4?crid=23QBXD3IL0YUJ&amp;keywords=pragmatic+programmer&amp;qid=1683140198&amp;sprefix=pragmatic+programm%2Caps%2C206&amp;sr=8-4">Amazon link</a></p>
<p>Pragmatic programmer is another staple classic that I found earlier in my career. I'm in the camp that it should be required reading for anyone interested in a career in software engineering. Not very code intensive, it covers more of the "why" behind software engineering principles instead of the "how". Good for reading while you don't have a code editor handy, like during travel, or if you enjoy audiobooks.</p>
<p>If you're a ten-year-veteran in the industry, you may find less value with Pragmatic Programmer than the other options on the list; nonetheless a great read.</p>
<h2 id="heading-final-thoughts">Final thoughts</h2>
<p>Initially in my career I swore by only needing video lessons and projects. As I've grown, I feel that books have played a pivotal role in my career trajectory. Check these out and let me know what you think!</p>
<p>Have any other tech book recommendations?</p>
<p>Thanks for reading!</p>
<p>Austin</p>
]]></content:encoded></item><item><title><![CDATA[Step-by-Step Guide to Developing a Story Generator with OpenAI's GPT and Ruby on Rails]]></title><description><![CDATA[Build a story generator in 10 minutes]]></description><link>https://blog.austn.net/step-by-step-guide-to-developing-a-story-generator-with-openais-gpt-and-ruby-on-rails</link><guid isPermaLink="true">https://blog.austn.net/step-by-step-guide-to-developing-a-story-generator-with-openais-gpt-and-ruby-on-rails</guid><category><![CDATA[Ruby]]></category><category><![CDATA[Ruby on Rails]]></category><category><![CDATA[chatgpt]]></category><category><![CDATA[AI]]></category><category><![CDATA[Artificial Intelligence]]></category><dc:creator><![CDATA[Austin]]></dc:creator><pubDate>Tue, 02 May 2023 23:39:46 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1683070496025/fb6bfb81-f52b-473d-b7b4-7dfa4c1f9c45.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Last night I was working on a new tool that I'll share more about later. Fans of text based games are going love it when it's ready. :)</p>
<p>In the meantime, I've written this tutorial to discuss how we can set up an OpenAI client in Rails, send it a test prompt, and get a response.</p>
<blockquote>
<p>If you have an OpenAI account, you can find your API keys here:</p>
<p><a target="_blank" href="https://platform.openai.com/account/api-keys">https://platform.openai.com/account/api-keys</a></p>
<p>If you don't have an OpenAI account yet, make one! I spent a grand total of $0.11 learning this for the first time and setting up this tutorial using text-davinci-003.</p>
<p>If you are interested in testing out the API, I highly recommend it.</p>
</blockquote>
<p>We're going to keep our app super simple for this example's sake, but this can be expanded to be useful in any part of your Rails app.</p>
<p>Let's dive in:</p>
<h2 id="heading-step-1-initialize-a-new-rails-app">Step 1: Initialize a new rails app</h2>
<pre><code class="lang-bash">rails new new-app
<span class="hljs-built_in">cd</span> new-app
</code></pre>
<h2 id="heading-step-2-installing-the-openai-gem">Step 2: Installing the OpenAI gem</h2>
<p>Add <code>ruby-openai</code> to your gemfile. That was easy. Next.</p>
<h2 id="heading-step-3-set-up-environment-variable">Step 3: Set up environment variable</h2>
<p>Add <code>dotenv-rails</code> to your gemfile and run <code>bundle install</code></p>
<p>Create a new file in your root directory named <code>.env</code> and include your OpenAI token. The format is as such, with no quotation marks surrounding the value.</p>
<pre><code class="lang-bash">OPENAI_TOKEN=abcd1234zxcv
</code></pre>
<h2 id="heading-step-4-add-a-character-with-fields-to-populate">Step 4: Add a Character with fields to populate</h2>
<p>We're going to make a character model with a name and two traits. We'll ask GPT to write us a backstory for it to easily demonstrate connecting to openAI, prompting it, and updating our record with the response.</p>
<p>Add the character using a scaffold, then run the migration:</p>
<pre><code class="lang-ruby">rails generate scaffold Character name trait_1 trait_2 backstory
rails <span class="hljs-symbol">db:</span>migrate
</code></pre>
<p>To be clear, in these generators when we describe attributes without describing their type, they're automatically strings.</p>
<p>For simplicity's sake, let's also navigate to <code>app/views/characters/_form.html.erb</code>.</p>
<p>Delete the following form labels and text fields since we don't want users to input a backstory or traits, we want the AI to generate them for us.</p>
<pre><code class="lang-xml">  <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.label</span> <span class="hljs-attr">:trait_1</span>, <span class="hljs-attr">style:</span> "<span class="hljs-attr">display:</span> <span class="hljs-attr">block</span>" %&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.text_field</span> <span class="hljs-attr">:trait_1</span> %&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.label</span> <span class="hljs-attr">:trait_2</span>, <span class="hljs-attr">style:</span> "<span class="hljs-attr">display:</span> <span class="hljs-attr">block</span>" %&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.text_field</span> <span class="hljs-attr">:trait_2</span> %&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.label</span> <span class="hljs-attr">:backstory</span>, <span class="hljs-attr">style:</span> "<span class="hljs-attr">display:</span> <span class="hljs-attr">block</span>" %&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">%=</span> <span class="hljs-attr">form.text_field</span> <span class="hljs-attr">:backstory</span> %&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<h2 id="heading-step-5-set-up-an-example-request-see-the-response">Step 5: Set up an example request, see the response</h2>
<p>For now lets just throw all this into the character model. If we wanted to extend this out further, we could build a GPT client model with fields for the necessary setup, but we can worry about that in a blog post about best practices or refactoring.</p>
<h3 id="heading-5a-gpt-client-setup">5a. GPT client setup</h3>
<pre><code class="lang-ruby"><span class="hljs-comment"># app/models/character.rb</span>
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Character</span> &lt; ApplicationRecord</span>
  <span class="hljs-keyword">require</span> <span class="hljs-string">'openai'</span>
  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">gpt_client</span></span>
    OpenAI::Client.new(<span class="hljs-symbol">access_token:</span> ENV[<span class="hljs-string">"OPENAI_TOKEN"</span>])
  <span class="hljs-keyword">end</span>

  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">gpt_model</span></span>
    <span class="hljs-string">"text-davinci-003"</span>
  <span class="hljs-keyword">end</span>

  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">run_prompt</span><span class="hljs-params">(attribute, prompt, max_tokens)</span></span>
    response = gpt_client.completions(
      <span class="hljs-symbol">parameters:</span> {
        <span class="hljs-symbol">model:</span> gpt_model,
        <span class="hljs-symbol">prompt:</span> prompt,
        <span class="hljs-symbol">max_tokens:</span> max_tokens
      }
    )
    <span class="hljs-keyword">self</span>.update(attribute =&gt; response[<span class="hljs-string">"choices"</span>][<span class="hljs-number">0</span>][<span class="hljs-string">"text"</span>])
  <span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span>
</code></pre>
<p>Lets break this down piece by piece.</p>
<p>First off, we're requiring <code>openai</code> so that we have access to the gem's library. That's how we're able to utilize it in the <code>gpt_client</code> method.</p>
<p>Next is our <code>gpt_client</code> method, which establishes a connection with OpenAI. <code>ENV['OPENAI_TOKEN']</code> is how we access environment variables, stored by dotenv in our <code>.env</code> file we made earlier.</p>
<p>Self-explanatorily, <code>gpt_model</code> is the name of the model we want to use. You can use GPT-4 if you want, but it's more expensive. Check out API pricing <a target="_blank" href="https://openai.com/api/pricing">here</a>.</p>
<p>Now we get to the magic. The <code>run_prompt</code> method is designed in such a way that we can update <code>self</code>, in this case our Character, by invoking <code>run_prompt</code> with an attribute, prompt, and the maximum amount of tokens we'd be willing to spend on the query. Token pricing calculator, separate from API pricing, is available <a target="_blank" href="https://platform.openai.com/tokenizer">here</a>.</p>
<p>An example of invoking this might be as such:</p>
<p><code>Character.first.run_prompt(:trait_1, "Give me a number from 20-100", 100)</code></p>
<p>After running this in your terminal you would see the SQL as your Character model is updated with a new 'age' value. If you refreshed your character's page, you'd see that reflected in the UI.</p>
<h3 id="heading-5b-adding-prompts">5b. Adding prompts</h3>
<p>Now that we've got a connection to OpenAI working, it's time to start chaining methods together to build out a backstory for our character. Lets add some prompts into the model:</p>
<pre><code class="lang-ruby">
  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">generate_all</span></span>
    <span class="hljs-keyword">self</span>.generate_traits
    <span class="hljs-keyword">self</span>.generate_backstory
  <span class="hljs-keyword">end</span>

  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">generate_traits</span></span>
    run_prompt(<span class="hljs-symbol">:trait_1</span>, trait_1_prompt, <span class="hljs-number">60</span>)
    run_prompt(<span class="hljs-symbol">:trait_2</span>, trait_2_prompt, <span class="hljs-number">60</span>)
  <span class="hljs-keyword">end</span>

  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">generate_backstory</span></span>
    run_prompt(<span class="hljs-symbol">:backstory</span>, backstory_prompt, <span class="hljs-number">500</span>)
  <span class="hljs-keyword">end</span>

  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">trait_1_prompt</span></span>
    <span class="hljs-string">"Describe a positive trait about <span class="hljs-subst">#{<span class="hljs-keyword">self</span>.input_name}</span>. Only use one word"</span>
  <span class="hljs-keyword">end</span>

  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">trait_2_prompt</span></span>
    <span class="hljs-string">"Describe a negative trait about <span class="hljs-subst">#{<span class="hljs-keyword">self</span>.input_name}</span>. Only use one word"</span>
  <span class="hljs-keyword">end</span>

  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">backstory_prompt</span></span>
    <span class="hljs-string">"You're a legendary storycrafter. Build a backstory about a fantasy character named <span class="hljs-subst">#{<span class="hljs-keyword">self</span>.name}</span>. They have <span class="hljs-subst">#{<span class="hljs-keyword">self</span>.trait_1}</span> and <span class="hljs-subst">#{<span class="hljs-keyword">self</span>.trait_2}</span> traits."</span>
  <span class="hljs-keyword">end</span>
</code></pre>
<p>In this code we're setting up prompts to send to GPT. If you've ever typed into the chat interface for ChatGPT, these prompts are exactly the same as a prompt you might type there.</p>
<blockquote>
<p>Protip: you can tell GPT to take the role of an experienced author from history if you're interested in adding creative flair.</p>
</blockquote>
<p>As you can see with the way we utilize <code>#{self.name}</code> in <code>backstory_prompt</code>, you can combine user entered terms with your own prompts in order to allow users to write inputs for the command. In this case, we're using AI generated traits, but a user could provide them as well.</p>
<p>Also noteworthy, in each instance of us running <code>run_prompt</code>, we are changing the amount of <code>max_tokens</code> we use. This is to prevent costs from being ridiculously high. Since we only want one word for these traits, 60 tokens is more than enough. But if the <code>max_tokens</code> was still set to <code>500</code>, we may end up using more than we expect.</p>
<h3 id="heading-5c-call-our-models-method">5c. Call our model's method</h3>
<p>Lets call <code>generate_all</code> to generate AI characteristics when we save a character in the <code>characters_controller.rb</code>:</p>
<pre><code class="lang-ruby"><span class="hljs-comment">#app/controllers/characters_controller.rb</span>
  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">create</span></span>
    @character = Character.new(character_params)

    respond_to <span class="hljs-keyword">do</span> <span class="hljs-params">|format|</span>
      <span class="hljs-keyword">if</span> @character.save
        @character.generate_all
        format.html { redirect_to @character, <span class="hljs-symbol">notice:</span> <span class="hljs-string">"Character was successfully created."</span> }
      <span class="hljs-keyword">end</span>
    <span class="hljs-keyword">end</span>
  <span class="hljs-keyword">end</span>
</code></pre>
<p>Now, when you create a new character at the <code>/characters/new</code> route, after the page loads you will get an AI generated backstory!</p>
<h2 id="heading-step-6-expanding">Step 6: Expanding</h2>
<p>There's a lot of flaws in this implementation. I just wanted to build a quick example of how easy it was to get set up with OpenAI and start implementing results from LLMs into your own applications!</p>
<p>If you were to build this out, I would recommend building out a new model for the GPT connection and for prompts to separate concerns out of the Character model and keep logic clean.</p>
<p>You could also move the AI queries to a background worker like <a target="_blank" href="https://github.com/collectiveidea/delayed_job">Delayed Job</a> or <a target="_blank" href="https://github.com/sidekiq/sidekiq">Sidekiq</a> in order to create a smoother experience for the user. Alternatively, a loading screen with a progress bar would be nice.</p>
<p>Of course, projects like these always look better styled in a UI.</p>
<h2 id="heading-final-thoughts-useful-links">Final thoughts, useful links</h2>
<p>Thanks so much for reading this all the way through!</p>
<p>If you run into any issues implementing this, feel free to leave a comment and I'd be happy to connect and help you troubleshoot.</p>
<p><strong>Links</strong></p>
<p>Check out this repo on github: <a target="_blank" href="https://github.com/frogr/ruby-AI-blog-post/tree/main">https://github.com/frogr/ruby-AI-blog-post</a></p>
<p>Follow me on twitter: <a target="_blank" href="https://twitter.com/ex_austin">https://twitter.com/ex_austin</a></p>
<p>Subscribe to receive more posts like this straight into your inbox: <a target="_blank" href="https://austn.net/newsletter">https://austn.net/newsletter</a></p>
]]></content:encoded></item><item><title><![CDATA[A note on the detriment of Jargon]]></title><description><![CDATA[I work on decreasing patients' Time to Therapy in the HealthTech space. As such, I have to communicate with many external stakeholders about highly…]]></description><link>https://blog.austn.net/a-note-on-the-detriment-of-jargon</link><guid isPermaLink="true">https://blog.austn.net/a-note-on-the-detriment-of-jargon</guid><category><![CDATA[Programming Blogs]]></category><category><![CDATA[communication]]></category><category><![CDATA[Learning Journey]]></category><category><![CDATA[learning]]></category><category><![CDATA[healthcare]]></category><dc:creator><![CDATA[Austin]]></dc:creator><pubDate>Mon, 01 May 2023 19:48:36 GMT</pubDate><content:encoded><![CDATA[<p>I work on decreasing patients' Time to Therapy in the HealthTech space. As such, I have to communicate with many external stakeholders about highly technical decisions. There are ridiculous amounts of jargon that have to be plowed through before any human understands what's being discussed.</p>
<p>From FRMs, PSCs, to FIAs, DTRs, ATRs, to RMTs, NPIs and NCPDPs, it's easy to get lost. This increases ramp-up time and I reckon it's the leading cause of why developers at our company struggle so much in their first 1-3 months. I know this because here I am, two years later, and I still have trouble keeping my eyes open during some of these meetings. It's hard to build context and understanding when vocabulary poses such a large issue.</p>
<p>I had a conversation earlier today that was so inundated with jargon, it struck me that it would be completely unintelligible to an outside audience.</p>
<p>I had a question about my work and I asked for help. Instead of getting an answer to what was a relatively easy question, I had to work back and forth with someone to make sure we had our terms defined and understood what each other was talking about.</p>
<p>It's not just that these conversations are painful and horrible and bad.</p>
<p>It's that they're fat, and we'd do well to trim it.</p>
<p>Most conversations that we have at meetings have questions on such a fundamental level, e.g. "What does ABC mean?", and we have a lot of groundwork to cover before we can begin talking about any given topic.</p>
<p>We would do better to eliminate as much jargon as possible to enhance our ability to communicate and understand these topics.</p>
<p>Consider this a plea; Stop jargon.</p>
<p>Simplify your speech.</p>
<p>Watch others' eyes stop glossing over in the middle of your meetings.</p>
<p>What do you think? Is this a problem in other fields, or a unique one to Health?</p>
<p>Thanks for reading</p>
<p>Austin</p>
]]></content:encoded></item><item><title><![CDATA[Learn to use Git in 15 minutes or your money back]]></title><description><![CDATA[Down to the Nitty Gitty]]></description><link>https://blog.austn.net/learn-to-use-git-in-15-minutes-or-your-money-back</link><guid isPermaLink="true">https://blog.austn.net/learn-to-use-git-in-15-minutes-or-your-money-back</guid><category><![CDATA[GitHub]]></category><category><![CDATA[Git]]></category><category><![CDATA[Programming Tips]]></category><category><![CDATA[Career]]></category><category><![CDATA[Gitcommands]]></category><dc:creator><![CDATA[Austin]]></dc:creator><pubDate>Mon, 01 May 2023 12:00:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1682798474862/8c45eea4-7a52-4dcd-9e74-c3ab7df06e35.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you're learning software development, Git is one of the first tools you should build a working knowledge in. It's necessary for any job in today's market.</p>
<p>You can go from zero to working knowledge very quickly, however. We'll start there, then dive into some more advanced commands that took me way too long to understand.</p>
<p>Let's dive in!</p>
<h2 id="heading-whats-git">What's Git?</h2>
<p>Git is a tool designed to make collaboration across multiple machines easier. Typically, developers use GitHub to store their code in repositories. It's also frequently used for documentation, blogging, etc.</p>
<h2 id="heading-zero-to-a-working-knowledge">Zero to a working knowledge</h2>
<p>Throughout development, I only use a handful of commands daily. Everything else can be googled as long as you remember the concepts exist. Don't worry about memorizing specific syntax.</p>
<p>These are the commands I use regularly, with a short explanation of each:</p>
<p><code>git branch &lt;branch_name&gt;</code> - Create a new local branch with the supplied branch_name.</p>
<p><code>git checkout &lt;branch_name&gt;</code> - Change your current branch to the local branch at the supplied branch_name.</p>
<p><code>git switch &lt;branch_name&gt;</code> - Similar to checkout, but works for remote branches as well as local branches.</p>
<p><code>git add &lt;directory&gt;</code> - Add the changes in the path supplied to the index from the working tree.</p>
<p><code>git commit -m "message"</code> - Commit all staged changes into your branch</p>
<p><code>git push</code> - Push your code up to the remote branch</p>
<p><code>git pull</code> - Pull down changes from the remote branch that aren't on your machine yet</p>
<p><code>git merge &lt;branch_name&gt;</code> - Merge supplied branch_name into current branch</p>
<p>That's really about it. You can make a GitHub account for free and practice these by making a repository and using branches, commits, and pull requests. Of course, each of these commands has loads of intricacies and options, and if you run into any issues the <a target="_blank" href="https://git-scm.com/docs">Git docs</a> are a great resource</p>
<p>There are more complicated topics like rebasing when you need to squash your commits and using aliases, but that doesn't come up every day. If you <em>do</em> run into issues like these, keep reading below!</p>
<h2 id="heading-interested-in-leveling-up">Interested in leveling up?</h2>
<p>These are all tips and tricks I wish someone would've told me when I very first started learning git. I've found them handy in my career, but they don't necessarily come up every single day. Again, memorizing syntax isn't necessary. Knowing the concepts exist is more than enough to google for specific syntax later.</p>
<p>Without further adieu, let's begin!</p>
<h2 id="heading-ii0i">"-"</h2>
<p>In Git we can use "-" as shorthand for "revert to the previous branch".</p>
<p>For example:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Starting from branch 'main'</span>
git branch new-awesome-branch
git checkout new-awesome-branch
<span class="hljs-comment"># Switched to branch 'new-awesome-branch'</span>
git checkout -
<span class="hljs-comment"># Switched to branch 'main'</span>
</code></pre>
<p>It is technically shorthand for <code>@{-1}</code>, which does the same thing. For the curious reader, <strong>yes</strong>, you can change that <code>-1</code> value to any integer and move up or down the tree of checkouts.</p>
<p>This works to a degree in Unix as well, with commands like <code>cd -</code>.</p>
<h2 id="heading-aliases">Aliases</h2>
<p>Aliases are a way to shorthand your frequently used git commands. Think of it like setting up variables.</p>
<p>This is going to be a short tutorial in itself, but the effects will permanently increase the speed of your ability to maneuver through your workflow.</p>
<p>First, open up your Git config file. There's a local file for keeping config a per-project basis, and there's a global file on a per-user basis. We're sticking with global config for now.</p>
<p>Run the following:</p>
<p><code>git config --global -e</code></p>
<p>This will open the Git config file in your default text editor</p>
<p>Now add an alias section like below:</p>
<pre><code class="lang-bash">[<span class="hljs-built_in">alias</span>]
  alias-name = git <span class="hljs-built_in">command</span> <span class="hljs-string">"123"</span>
</code></pre>
<p>Save and close your configuration file, and your alias will exist.</p>
<p>In this example, you can input <code>git alias-name</code> to your terminal and it will run <code>git command "123"</code>. As you can imagine, this extends out to other commands as well.</p>
<p>Here are some common git aliases:</p>
<pre><code class="lang-bash">[<span class="hljs-built_in">alias</span>]
  st = status
  co = checkout
  br = branch
  cm = commit
  df = diff
  lg = <span class="hljs-built_in">log</span> --oneline --graph --all --decorate
</code></pre>
<p>Just to be clear, this would make running <code>git st</code> always run <code>git status</code>. As you can imagine, these will save you some time in the long run. Plus you'll look cooler while you're screen sharing during pair programming.</p>
<h2 id="heading-interactive-rebase">Interactive rebase</h2>
<p>Earlier in the article I mentioned squashing down your commits. This is frequently done before every merge back into the main branch from your pull requests on large teams.</p>
<p>There are many ways to handle rebasing, I use a .zsh script for it instead of manually rebasing every merge, but knowing how to rebase is super useful! Here are the basics</p>
<pre><code class="lang-bash">git rebase -i HEAD~4
</code></pre>
<p>This will interactively rebase the last 4 commits.</p>
<p><code>-i</code> stands for interactive, and <code>HEAD~4</code> means "rebase the last 4 commits from the HEAD commit".</p>
<p>Running the above will open up an editor with something like this displaying:</p>
<pre><code class="lang-bash">pick 1fc6c95 start the thing
pick 6b2481b fix the bug
pick dd1475d write the tests
pick ai9j31f rubocop
</code></pre>
<p>Each line represents a commit, and <code>pick</code> means that we're choosing to keep the commit. You can replace <code>pick</code> with the following commands:</p>
<ul>
<li><p><code>reword</code> - Keep the commit, but change the commit message.</p>
</li>
<li><p><code>edit</code> - Keep the commit, but make additional changes.</p>
</li>
<li><p><code>squash</code> - Combine this commit with the one before it.</p>
</li>
<li><p><code>fixup</code> - Like squash, but discard this commit's log message.</p>
</li>
<li><p><code>drop</code> - Delete the commit.</p>
</li>
</ul>
<p>Save and close the file, and Git will begin making the changes you specified.</p>
<p>If you chose commands <code>reword</code>, <code>edit</code>, or <code>squash</code>, Git will pause on these steps to allow you to make changes.</p>
<p>In case of conflict, Git will make you aware. Then you can change your files to fix the conflict, run <code>git add &lt;file_path&gt;</code> and continue the rebase.</p>
<p>If anything goes awry, you can always use <code>git rebase --abort</code> to cancel the abort like none of this ever happened. Been there, done that.</p>
<h2 id="heading-final-notes">Final notes</h2>
<p>I've been using Git for years now and these are the most popular commands I use, plus a few extras that come up from time to time. Hopefully, you find it to be a handy reference guide.</p>
<p>Did I miss any? Leave a comment and let me know!</p>
<p>Thanks for reading!</p>
]]></content:encoded></item><item><title><![CDATA[I'm sorry, but JavaScript is ugly.]]></title><description><![CDATA[Someone had to say it. I've written JavaScript since 2017. It was the first real programming language I learned to the extent of being able to find a job…]]></description><link>https://blog.austn.net/im-sorry-but-javascript-is-ugly</link><guid isPermaLink="true">https://blog.austn.net/im-sorry-but-javascript-is-ugly</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[Ruby]]></category><category><![CDATA[Ruby on Rails]]></category><category><![CDATA[javascript framework]]></category><category><![CDATA[iwritecode]]></category><dc:creator><![CDATA[Austin]]></dc:creator><pubDate>Sat, 29 Apr 2023 14:55:14 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1682779761653/c1d7e400-2a82-4d38-a256-9ba84580aea0.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Someone had to say it. I've written JavaScript since 2017. It was the first real programming language I learned to the extent of being able to find a job and work using it.</p>
<p>Around 2019, I decided that I don't ever want to go back to JavaScript. I found Ruby and I love it. I will write JavaScript when I have to, just like I write SQL when I have to, and I use any other tool when I have to.</p>
<p>But I'm not happy to use JavaScript. It doesn't please me.</p>
<p>It turns out that Ruby is just... more enjoyable to write code in. I don't mean it as a dig at JavaScript or its developers; it works, but it's ugly.</p>
<p>Ruby is concise. Beautiful. Elegant.</p>
<p>JavaScript: ugly, ferocious, annoying.</p>
<p>Configuration everywhere. Every app is structured slightly differently. Dependencies are a nightmare to manage.</p>
<p>The best part of JavaScript is TypeScript, though TypeScript is uglier and requires even more configuration and more tooling. I never thought I'd prefer a statically typed language, but JavaScript is easy to beat.</p>
<p>I've taken the liberty of writing some code snippets detailing what I mean. Naturally, production examples would be better</p>
<p>Let's say we want to print out "Hello world" five times in JavaScript:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">5</span>; i++) {
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Hello, World!"</span>);
}
</code></pre>
<p>Not too bad. We have to set up a for loop, create a variable, create a constraint, and an iterator function. Then we can call <code>.log</code> on <code>console</code> and pass in the string. It's fine.</p>
<p>But look how much nicer it is in Ruby:</p>
<pre><code class="lang-ruby"><span class="hljs-number">5</span>.times { puts <span class="hljs-string">"Hello, World!"</span> }
</code></pre>
<p>Alright. You're not convinced. I get it. We can use a more complicated example.</p>
<p>Let's see how Node and Express might approach something like making an HTTP request and parsing it with JSON, with an error catch:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> express = <span class="hljs-built_in">require</span>(<span class="hljs-string">'express'</span>);
<span class="hljs-keyword">const</span> fetch = <span class="hljs-built_in">require</span>(<span class="hljs-string">'node-fetch'</span>);

<span class="hljs-keyword">const</span> app = express();

app.get(<span class="hljs-string">'/'</span>, <span class="hljs-keyword">async</span> (req, res) =&gt; {
    <span class="hljs-keyword">try</span> {
        <span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> fetch(<span class="hljs-string">'https://api.example.com/data'</span>);
        <span class="hljs-keyword">const</span> data = <span class="hljs-keyword">await</span> response.json();
        res.send(data);
    } <span class="hljs-keyword">catch</span> (error) {
        res.status(<span class="hljs-number">500</span>).send({ <span class="hljs-attr">error</span>: <span class="hljs-string">'An error occurred'</span> });
    }
});

app.listen(<span class="hljs-number">3000</span>, <span class="hljs-function">() =&gt;</span> <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'Server running on port 3000'</span>));
</code></pre>
<p>Again. It's fine. It works, even! But for something as simple as making a basic HTTP request, we're writing a significant chunk of code.</p>
<p>Note all the line breaks and <code>{}</code> usage. It becomes difficult for the eyes to track.</p>
<p>And Ruby:</p>
<pre><code class="lang-ruby"><span class="hljs-keyword">require</span> <span class="hljs-string">'open-uri'</span>

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyController</span> &lt; ApplicationController</span>
  <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">index</span></span>
    <span class="hljs-keyword">begin</span>
      data = JSON.parse(open(<span class="hljs-string">'https://api.example.com/data'</span>).read)
      render <span class="hljs-symbol">json:</span> data
    <span class="hljs-keyword">rescue</span>
      render <span class="hljs-symbol">status:</span> <span class="hljs-number">500</span>, <span class="hljs-symbol">json:</span> { <span class="hljs-symbol">error:</span> <span class="hljs-string">'An error occurred'</span> }
    <span class="hljs-keyword">end</span>
  <span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span>
</code></pre>
<p>That's clean, what can I say? The indentations and line breaks are easy to follow and it doesn't require as much non-text formatting.</p>
<p>I use JavaScript regularly, but Ruby will always take the cake for me. Another piece to come soon highlights those beautiful elements I find.</p>
<p>What do you think? What language speaks to you?</p>
<p>As always, thanks for reading!</p>
]]></content:encoded></item><item><title><![CDATA[Embracing Code Review as an Opportunity, not Opposition]]></title><description><![CDATA[When I first started my career, one of the scariest procedures for me was submitting my pull requests for Code Review. What are code reviews? Code reviews…]]></description><link>https://blog.austn.net/embracing-code-review-as-an-opportunity-not-opposition</link><guid isPermaLink="true">https://blog.austn.net/embracing-code-review-as-an-opportunity-not-opposition</guid><category><![CDATA[coding]]></category><category><![CDATA[#codenewbies]]></category><category><![CDATA[code review]]></category><category><![CDATA[General Programming]]></category><dc:creator><![CDATA[Austin]]></dc:creator><pubDate>Fri, 28 Apr 2023 18:30:29 GMT</pubDate><content:encoded><![CDATA[<p>When I first started my career, one of the scariest procedures for me was submitting my pull requests for Code Review.</p>
<blockquote>
<p><strong>What are code reviews?</strong></p>
<p>Code reviews typically happen once your code is feature-complete and tested. You will make a new branch with your changes, then make a pull request against your application repo. After the PR is made, you submit it to others on your team for review.</p>
<p>My team in particular had a 3 review system at this time, focused on: Code quality, Security, and a final manager green light.</p>
</blockquote>
<p>I don't think this is always such a scary process for everyone, but it was for me.</p>
<p>This was to no fault of the other devs on my team, they're lovely folks and super skilled to bat. We have a great culture.</p>
<p>Everyone is friendly, and they are willing to help any time you ask. I appreciate it more than they'll know!</p>
<p>Yet, on the day my pull request's functionality was complete, tests were passing, and the risk level was determined, I still found it difficult to submit it for review.</p>
<p>This ended up dragging into the next day while I shrunk in fear. I reached out to my manager. It was my first-ever PR as a developer at this big new company, and while I felt like it was ready,</p>
<h3 id="heading-i-was-worried">I was worried.</h3>
<p>I was worried that my reviewer could've found my PR after a long day,</p>
<p>I was worried that they'd provide feedback to my manager that my code sucked,</p>
<p>I was worried that the company would realize I was a fraud and chase me out with torches and pitchforks,</p>
<p>I was worried that everything could collapse.</p>
<p>But my manager recognized my concerns, and instead of making me feel silly for being anxious, encouraged me to push through that feeling.</p>
<p>To use Code Review as an <strong>Opportunity</strong>, not <strong>Opposition</strong>.</p>
<p>And I did.</p>
<p>After I requested a review, I closed my laptop and waited. Eventually, I got a notification on my phone from Outlook.</p>
<p>It was my review.</p>
<p>Uh oh.</p>
<p>For a moment, my worst fears came true. I saw that a Senior Developer had requested changes and I was petrified.</p>
<p>He's been at the company for years now, what will he think?</p>
<p>I continued to persist. I read through his comments.</p>
<p>He provided <strong>TONS</strong> of valuable feedback.</p>
<p>Things I hadn't considered. Test cases I had entirely missed. Variables and functions I wasn't using anymore. More declarative names.</p>
<p>He had spent about 15 minutes reviewing the code, then found more glaring holes than I could've ever imagined at the time.</p>
<p>The PR I thought was complete, which I had been staring at for a week, was flawed.</p>
<p>So I adopted his changes. And the code was better, cleaner, and easier to understand for it. I learned. He taught.</p>
<p>It was an opportunity to grow. Not opposition.</p>
<p>He didn't want to make anyone feel bad. He wasn't prideful. He wasn't interested in playing ego games. He didn't pull his seniority card.</p>
<p>He just wanted better code in the system. So he showed me how to do that.</p>
<p>He probably does not know how nervous I was, and he never needs to, so don't tell him! Nonetheless, I recognize it as a transformative moment for me, and finally, a chance to break out of my feedback-aversive shell.</p>
<hr />
<p>It's hard to be a developer. I understand all too well that feeling of insecurity and the drain of comparison.</p>
<p>This story occurred a couple of years ago now, and while I still get nervous submitting code reviews from time to time, it helps me to remember that there's a lot more going on than what we're worried about.</p>
<p>Don't shrink.</p>
<p>Remember that this is an Opportunity, <em>not</em> Opposition.</p>
<p>Feedback will not destroy you. Only better you.</p>
<p>Thanks for reading!</p>
]]></content:encoded></item><item><title><![CDATA[The 3 best ways to learn Ruby on Rails and become a Web Developer in 2023]]></title><description><![CDATA[After googling, I found that there is a daunting amount of different courses to get started learning Web Development: tutorials, blogs, books, and boot…]]></description><link>https://blog.austn.net/the-3-best-ways-to-learn-ruby-on-rails-and-become-a-web-developer-in-2023</link><guid isPermaLink="true">https://blog.austn.net/the-3-best-ways-to-learn-ruby-on-rails-and-become-a-web-developer-in-2023</guid><category><![CDATA[Programming Blogs]]></category><category><![CDATA[learning]]></category><category><![CDATA[learn coding]]></category><category><![CDATA[Ruby]]></category><category><![CDATA[Ruby on Rails]]></category><dc:creator><![CDATA[Austin]]></dc:creator><pubDate>Fri, 28 Apr 2023 15:37:22 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/OPFaMyBJjY4/upload/7d20fc33fae2e10ebf27070856202d6a.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>After googling, I found that there is a daunting amount of different courses to get started learning Web Development: tutorials, blogs, books, and boot camps.</p>
<p>I've been in that situation before. It's daunting and needlessly complex. There are so many different choices that it becomes easier to do nothing than untangle it all.</p>
<p>The reality of the situation is simple:</p>
<p>If you want to <em>learn</em>, then <strong>build</strong>.</p>
<p>This is how I'd go about starting that today, starting with my favorite <strong>free</strong> resource for learning Ruby:</p>
<h2 id="heading-the-odin-project">The Odin Project</h2>
<p><a target="_blank" href="https://www.theodinproject.com/">https://www.theodinproject.com/</a></p>
<p>The Odin Project is a free online platform where users mostly read through blog posts, articles, and tutorials on their way to learning Ruby. I feel comfortable recommending it to beginners because it is completely free, plus they have a foundations course to get you acquainted with basic web development topics.</p>
<p>TOP's Foundations track includes HTML, CSS, Basic JavaScript syntax, and 3 projects to cement your learning.</p>
<p>After Foundations, you have the opportunity to continue learning Fullstack Javascript or switch to Fullstack Ruby on Rails. I of course recommend Rails, but they are both free, so have at it.</p>
<p>Fullstack Ruby on Rails covers Ruby, Rails, JavaScript, Database connections, and even has a path for getting your first job as a developer. There are many projects: A blog, a Reddit clone, and a capstone social media platform project where you'll build Facebook.</p>
<p>I recommend TOP to everyone interested in programming. If you're able to stick it through with a course like this, you'll make it.</p>
<p>It can, however, be a bit daunting to have to read through every single lesson. People prefer to learn in different ways. As such, I've included a Udemy tutorial for people who prefer video.</p>
<h2 id="heading-the-ruby-on-rails-masterclass">The Ruby on Rails Masterclass</h2>
<p><a target="_blank" href="https://www.udemy.com/course/the-complete-ruby-on-rails-developer-course/">https://www.udemy.com/course/the-complete-ruby-on-rails-developer-course/</a></p>
<p>This Udemy course will take you from initial setup to building your own Ruby apps.</p>
<p>For the most part, Percival's course covers things that are covered on The Odin Project, but it does come with its own unique sets of projects for learners to build out: A real-time chat app, a stock tracking app, and a more feature-complete SaaS application.</p>
<p>If you're more comfortable with video over text, I would recommend the Udemy platform due to its strong knowledge base and great courses. It's also affordable, and you can always find courses on sale.</p>
<p>One fair note, however, is that frequently the tutorials can be out of date, so it may be easier to learn something like Rails 5 than Rails 7. This is not to any detriment, since you can always upgrade and figure out the syntax for new features later.</p>
<p>For myself and for people I've mentored, we've found that a combination of this Udemy course and The Odin Project has been more than enough to build your Rails chops and to get a portfolio together for your first role as a developer.</p>
<p>If you are already a bit more advanced, or chomping at the bit for harder tasks, keep reading. This next tip was only given to me years into my career and it's so simple I wish I did it sooner.</p>
<h2 id="heading-read-rails-code-on-github">Read Rails code on GitHub</h2>
<p>Rails is an open-source framework written in Ruby. You can see all of the code that is used, for free, on GitHub.</p>
<p><a target="_blank" href="https://github.com/rails/rails/">https://github.com/rails/rails/</a></p>
<p>This is the most daunting of the above options, but a recommendation to anyone familiar with Ruby syntax.</p>
<p>Going through and understanding line-by-line how each of the most popular classes work can be an incredibly insightful experience.</p>
<blockquote>
<p>I was initially given this task by one of my first Rails mentors. I thought he was ridiculous. He was right. I was wrong. And I should've done it sooner.</p>
<p>Some functionality I'd check out if I did this exercise again:</p>
<ul>
<li><p>How do models work?</p>
</li>
<li><p>How does Rails store files and serve them to people?</p>
</li>
<li><p>How does ActiveStorage work? What does .find do?</p>
</li>
</ul>
</blockquote>
<p>Especially now that we can use AI to read through the documentation and help explain the code that we see, I recommend this step much more firmly.</p>
<p>Read Rails and take notes.</p>
<p>Every developer should see how the magic is made.</p>
<h2 id="heading-final-notes">Final Notes</h2>
<p>Learning is hard. Building is hard. Sharing is hard. That's why we need to do it. If you pick up any of these resources and slowly dig at them over time, you will succeed in becoming a developer.</p>
<p>If you're on the fence, let me know what concerns you have!</p>
<p>If you've forged your way through this path, what did I get wrong?</p>
<p>Thanks for reading!</p>
]]></content:encoded></item><item><title><![CDATA[Hello, Hashnode]]></title><description><![CDATA[Thanks for having me!]]></description><link>https://blog.austn.net/hello-hashnode</link><guid isPermaLink="true">https://blog.austn.net/hello-hashnode</guid><category><![CDATA[introduction]]></category><category><![CDATA[Hashnode]]></category><category><![CDATA[newbie]]></category><category><![CDATA[learning]]></category><category><![CDATA[learn coding]]></category><dc:creator><![CDATA[Austin]]></dc:creator><pubDate>Fri, 28 Apr 2023 00:27:25 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/3SIXZisims4/upload/4bc06facdc6f08ec43d612eceea9bd3a.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I've been looking for excuses to start blogging recently. I love writing and it helps me work through my thoughts with further precision. I've always struggled to share my written thoughts with the world though, so I want to break through that barrier.</p>
<p>Great thread and conference by DHH on the value of writing:</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://twitter.com/dhh/status/1291124916708769792">https://twitter.com/dhh/status/1291124916708769792</a></div>
<p> </p>
<hr />
<h2 id="heading-introductions-and-experience">Introductions and Experience</h2>
<p>A little about me: I'm a software engineer working for CoverMyMeds, a McKesson company. CoverMyMeds is a recently-ish-acquired startup based out of Columbus, Ohio. Their primary focus is making sure patients can access and afford the medications that they need to live healthier lives.</p>
<p>Fun fact: CoverMyMeds handles approximately 80% of the USA's Prior Authorizations and is utilized in 95% of the country's prescriber offices. That's a lot of medication!</p>
<p>Before joining CoverMyMeds, I worked in the automotive data sector, primarily focusing on feature enhancements and data transactions for car dealerships.</p>
<p>I also spent time working on a platform designed to manage large TV event casts. We had the opportunity of working with amazing clients there: the NFL's Super Bowl, the Canada Games, the Oscars, and the Boys and Girls Club of America. I'll have to write more about that in a future post.</p>
<p>Throughout my career, I've had the privilege of working with Ruby on Rails, alongside gaining lots of experience in TypeScript and JavaScript. I've worked as a solo developer and on huge, cross-functional teams with many external stakeholders. Thanks to this wide set of experiences I've also fumbled my way into learning valuable skills in collaboration, communication, leadership, and coaching.</p>
<p>With that being said, I'm an enthusiast of crafting elegant software and systems, and I believe that writing code can be as beautiful as writing novels or any other creative endeavor. I think that now that AI has arrived in meaningful and helpful ways, humans will be more capable than ever.</p>
<p>I'm eager to share these learnings as I document my experiences working as a developer and I hope they can be valuable to others!</p>
]]></content:encoded></item></channel></rss>