<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Lindsey Maddox on Medium]]></title>
        <description><![CDATA[Stories by Lindsey Maddox on Medium]]></description>
        <link>https://medium.com/@llmaddox?source=rss-b359be066bd7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*J0tnbtCm2oaMGz5ur6J9Iw.jpeg</url>
            <title>Stories by Lindsey Maddox on Medium</title>
            <link>https://medium.com/@llmaddox?source=rss-b359be066bd7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 02:26:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@llmaddox/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Postgres Query Techniques every Backend Developer should have in their Toolkit]]></title>
            <link>https://medium.com/@llmaddox/postgres-query-techniques-every-backend-developer-should-have-in-their-toolkit-269bf808552a?source=rss-b359be066bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/269bf808552a</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[backend-development]]></category>
            <dc:creator><![CDATA[Lindsey Maddox]]></dc:creator>
            <pubDate>Fri, 26 Oct 2018 15:31:16 GMT</pubDate>
            <atom:updated>2018-10-26T15:31:16.591Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever tried to assemble a thorny data calculation for a data migration and couldn’t figure out how to fit the pieces together? It’s incredibly common; multi-line SQL can be quite difficult to keep in one’s head. Fortunately, most database management systems have functions that can simplify your SQL and make it easier for other developers to follow.</p><p>Today, we’ll talk about advanced querying in Postgresql, starting with the relatively well known <em>subquery</em> then delving deeper into <strong>window functions </strong><em>filtered_aggregation</em> and <em>array_agg</em>.</p><p>Let’s start by looking at a real world problem.</p><h3>Writing Easy to Follow Queries</h3><p>The other day, a coworker needed to filter to a set of users based on their bonus history. He needed to grab a group of users that had only one bonus with a certain code who also did not have any bonuses with a different code. For most database management systems, this problem is a great fit for a subquery.</p><p><strong>Subqueries</strong></p><p>Subqueries provide a way of chaining queries together in one execution rather than having to save one result to use in a subsequent query. Here’s a simplified representation of his original query:</p><pre><em>SELECT<br>  bonuses.user_id<br>FROM (<br>  SELECT<br>    bonuses.user_id as user_id<br>  FROM<br>    users<br>  LEFT JOIN <br>    bonuses <br>  ON <br>     bonuses.user_id = users.id<br>  WHERE<br>    bonuses.code = ‘code_we_want_to_be_zero’ AND<br>    bonuses.id IS NULL<br>  ) zero_bonus_group<br>  INNER JOIN<br>    bonuses on <br>      bonuses.user_id = zero_bonus_group.user_id<br>  WHERE<br>    bonuses.code = ‘code_we_want_to_be_one’<br>  GROUP BY<br>    bonuses.user_id<br>  HAVING<br>    count(bonuses.user_id) = 1</em></pre><p>The query first executes the inner, ‘subquery’. It grabs the users who do not have a bonus with the code we don’t want (i.e. <em>‘code_we_want_to_be_zero’)</em>. Then, the outer query selects the users identified in the subquery, joins them to the bonuses with the code we want (i.e. <em>‘code_we_want_to_be_one)</em>, and makes sure we have only one bonus with that code.</p><p><strong>Filtered Aggregation</strong></p><p>If you look at the code above, you might still have trouble figuring out what’s going on — even if you’re the one who wrote it! Thankfully, postgres has a more intuitive way to handle this kind of problem — filtered aggregation. A filtered aggregation is a type of <strong>window function</strong>. Window functions allow you to perform calculations across multiple rows related to a current row without requiring them to be grouped together like in a typical aggregate function.</p><p>Confused? It’s easier to understand with an example. Here’s how my coworker did the query above with filtered aggregations:</p><pre>SELECT<br>  users.*<br>FROM<br>  users<br>INNER JOIN<br>  bonuses <br>ON<br>  bonuses.user_id = users.id<br>GROUP BY<br>   users.id<br>HAVING<br>  COUNT(*)<br>   FILTER (WHERE bonuses.code = ‘<em>code_we_want_to_be_one</em>’) = 1<br>AND <br>  COUNT(*) <br>    FILTER (WHERE bonuses.code = ‘<em>code_we_want_to_be_zero’)</em> = 0</pre><p>Above, you can clearly see that we’re counting two conditions — bonuses with a code of ‘<em>code_we_want_to_be_one</em>’ &amp; with code of ‘<em>code_we_want_to_be_zero</em> . The filter is in the having clause, so it’s checking that a user only has one of the code we want to be one and none of the code we want to be zero. Also, since we’re using filtered aggregation, we don’t have to do a left join.</p><p>For cases when you’re mapping multiple values across a collection — especially when you don’t want to require both of them — , <em>filtered_aggregation </em>is a great alternative to <em>subqueries</em>.</p><h3>Window Functions — To Infinity and Beyond!</h3><p>Without <em>filtered_aggregation, </em>it was a little hard to articulate what our <em>bonuses</em> query was doing. However, you don’t have to start from a complicated problem to reap the benefit of window functions. A more simple example might be checking the count of past due bills and final bills respectively for a given user:</p><pre>SELECT<br>  users.id,<br>  COUNT(*) FILTER (<br>    WHERE statements.past_due = true<br>  ) AS past_due_count,<br>  COUNT(*) FILTER (<br>    WHERE statements.final_bill = true<br>  ) AS final_bill_count<br>FROM<br>  users<br>INNER JOIN <br>  statements<br>ON <br>  statements.user_id = users.id<br>GROUP BY<br>  users.id</pre><p>It should be clear from the above query that we’re counting different attributes for a given user. One nice bonus is the attributes don’t have to both be present on a given statement for an individual field to get counted.</p><p><strong>Array_Agg</strong></p><p>Counts are great, but sometimes you’re more concerned with just getting the set of values for a given attribute. <em>ARRAY_AGG </em>is another window function you can use for this purpose. One example could be checking the account statuses for any user with multiple accounts:</p><pre><em>SELECT<br>  users.first_name,<br>  ARRAY_AGG(accounts.status) as account_statuses,<br>  COUNT(accounts.id)<br>FROM<br>  accounts<br>INNER JOIN<br>  users <br>ON<br>  users.id = accounts.user_id<br>WHERE<br>  users.created_at &gt; cast(&#39;2018-07-01&#39; as TIMESTAMP)<br>GROUP BY<br>  users.id<br>HAVING <br>  count(accounts.id) &gt; 1</em></pre><p>The above function will output a single row for each user with all their account statuses in an array. In this case, we need to do the separate grouping to ensure the user has multiple accounts, but you could use this on tables which have multiple records of data for the same user.</p><p>You can also use <em>array_agg </em>in the aggregation itself. For example, here we’re looking at usage for any residential accounts that have a statement with kWh above a certain threshold:</p><pre><em>SELECT<br>  accounts.account_number,<br>  ARRAY_AGG(utility_statements.kwh) as usage<br>FROM<br>  accounts<br>INNER JOIN<br>  utility_statements <br>ON<br>  utility_statements.account_id = accounts.id<br>WHERE<br>  accounts.account_type = ‘residential’<br>GROUP BY<br>  accounts.id<br>HAVING<br>  1500 &lt;= ANY(ARRAY_AGG(utility_statements.kwh))</em></pre><p><em>HAVING </em>The above query gives us the collection of usage for residential accounts that have had high kWh usage (i.d. any utility statement with higher than 1500 kWh).</p><h3>Conclusion</h3><p>Chaining together the right SQL can be difficult, and some familiarity with advanced SQL querying is critical. Hopefully these functions — <em>subqueries</em>, <em>filtered_aggregation</em>, and <em>array_agg</em> can help you extend your SQL repertoire and make for more intuitive queries.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=269bf808552a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Introvert attends her First Programming Conference]]></title>
            <link>https://medium.com/@llmaddox/an-introvert-attends-her-first-programming-conference-f9911d373a64?source=rss-b359be066bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9911d373a64</guid>
            <category><![CDATA[conference]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[tech-events]]></category>
            <dc:creator><![CDATA[Lindsey Maddox]]></dc:creator>
            <pubDate>Fri, 29 Jun 2018 09:54:59 GMT</pubDate>
            <atom:updated>2018-06-29T09:54:59.852Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s the morning of my first programming conference, and things are not at all going to plan. I was supposed to finish my Python data science class. Maybe even go to the gym. I am very close to solving the last problem on my final assignment, but I can’t seem to figure out how to return the right data type. As I test different methods, I keep having to restart my kernel and backtrack to the last successful item returned. I force myself to put up my computer and get ready, sighing as I abandon my hopes for an uber-productive morning.</p><p>Earlier that morning, I had tried to download an app for my ticket but stopped because it required an account to be created. I figured it would be easier to just print my ticket from the apartment complex’s business center (our home printer is forever out of ink). Five minutes before my planned departure time, I head to print my ticket out. Google cloud print isn’t working. After about 5 minutes doing printer diagnostics, I give up and create an account for the ticket app. The ticket appears, and I head out the door.</p><p>I am leaving 15 minutes later than I had planned. This makes me slightly panicky.</p><p>Ruby Nation is a local event and only one day, but I am still nervous. I hate dealing with unknowns.</p><p>How does this work? Where do I sit? Do they feed us? What if I have to go to the bathroom? Can I leave early to get home at a normal hour? There are so many breaks, and I HATE MINGLING.</p><p>Once out the door, I only have 45 minutes to get to the metro station, find the event location, register, and find a seat. I try to leave early when going to new places. I often get lost, and I need time to get my bearings once I reach my destination. The thought of showing up late fills me with dread. My company agreed to pay for my ticket and a day off work. I had to GET IN. Will they let me in if I’m late?</p><p>I text my husband sobbing emojis and various catastrophic thoughts. I sigh with relief when I see my train is arriving in two minutes.</p><p>Then I realize:</p><ul><li>I don’t have any books (why are my library books still on hold?).</li><li>I didn’t pack headphones because I thought they’d make my bag too heavy.</li><li>I also didn’t pack my notebook.</li></ul><p>I consider that Casey Watts just talked to my company about maladaptive thought patterns, and I take a deep breath. I realize I can distract myself by typing notes on my phone. Downward spiral pseudo-thwarted. I find the place ok and check in right as registration is ending. I even have time to hit the bathroom and pick up a bagel.</p><p>I scan the room for empty seats and see a couple ambiguous ones. Right as I’m about to sit in the back, I spot a coworker closer to the front. I maneuver my way there and sit down right as the first speaker is introduced.</p><p>Now that I’m settled without disaster, I can focus on the conference presentations themselves. Ruby Nation has a pretty wide range of speakers. They have a good mix of women and men. Topics span the gamut from <em>how to </em>advice<em> </em>on<em> </em>databases, APIs, and logging to talks about pairing, teaching, and management. There are also a couple more high-level talks on functional programming and architecture paradigms. And there’s a delightfully weird demo of Ruby’s Sonic Pi library.</p><p>I generally prefer the personal talks to the more technical ones. As Betsy Haibel speaks about set design as architecture, I’m immediately transfixed. I’m reminded of the power of storytelling and why metaphors get overused — the right ones are incredibly evocative. Sam Phibben also tells his story of becoming a manager and his team’s culture and values. It’s nice to get a fresh perspective — even if it’s not the perfect fit for your team.</p><p>I’m struck by how much time is needed to set context in the technical presentation. The speakers have 25 minutes, and little of it remains after they finish their intros. The <em>meat </em>of the technical talks tends to be dry bullet points. These points are often salient, but I wonder if they would be more engaging in a more interactive format — like a workshop.</p><p>I leave before the keynote and have some time alone to reflect on the experience. I’m still not completely sure what I’m supposed to get out of the conference. I guess the romanticized take is to leave the event brimming with ideas and energized to bring them to fruition. But my experience attending rock shows tells me that transformative experiences of any kind are pretty rare. Shows offer a way for people to connect over shared interests, and they’re more fun than hanging out over dinner or drinks. There’s probably something similar happening at tech events.</p><p>Most of the senior devs I’ve talked to see conferences as more valuable for making connections than building technical skills. I didn’t get much of a shot at recruiting for work, but our name got out there and there may be some familiar faces at the next event I attend. And now I have something I can talk to them about instead of stumbling over my winding path toward becoming a developer.</p><p>I definitely feel like Ruby Nation was a worthwhile first conference. I’m not sure if I’ll go next year. Nevertheless, I’m eager for my next conference where I’ll be flailing less and maybe even seeing people I’ve met before.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9911d373a64" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Starting over again: A developer’s (first) year in review]]></title>
            <link>https://medium.com/@llmaddox/starting-over-again-a-developers-first-year-in-review-c711a762804?source=rss-b359be066bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/c711a762804</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[career-change]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[junior-developer]]></category>
            <dc:creator><![CDATA[Lindsey Maddox]]></dc:creator>
            <pubDate>Thu, 24 May 2018 10:01:18 GMT</pubDate>
            <atom:updated>2018-05-24T10:01:18.822Z</atom:updated>
            <content:encoded><![CDATA[<p>As I hit my one year anniversary as a developer, it seems appropriate to reflect on how far I’ve come. My last year has been alternatingly hectic, slow, confusing, intimidating, tumultuous, and incredibly fulfilling. I went from being unsure where I wanted to focus my efforts — or even if software development was the right field for me — to feeling confident and happy as a backend developer.</p><p>Despite how I feel now, things didn’t start out so easy. I spent the first two months feeling largely underwater and extremely tired. I don’t think well when sleep deprived, and I was really nervous about making it as a developer. This was my first job in DC, my first job after having a child, and my first job as a programmer. Trying to get up to speed in a new environment, a new codebase, a new career, and frankly, the workforce in general, was extremely difficult.</p><p>After months working at home — working on learning projects while my daughter spent the day in day care — I was surprised at how much harder it was to manage professional work and family. Now, when my daughter was teething or woke up early, I couldn’t “give myself a break” and rest the next day. To combat waking up at 4AM, I drank coffee in the afternoon for the first time in years. It gave me insomnia — making me even more tired. So, instead of more coffee, every afternoon for the first few months, I made bathroom trips for the sole purpose of splashing water on my face and sitting down with my eyes closed for a few minutes.</p><p>Getting acclimated as a new developer was also challenging. From what I hear, it’s hard for every junior dev to find their way in their first professional job. I had a little more experience under my belt than a lot of bootcampers, but it was still intimidating.</p><p>Here’s where I stood when I started:</p><p><em>Things I knew</em></p><ul><li>SQL</li><li>Basic Ruby</li><li>Basic Rails (i’d made a few applications)</li><li>d3</li><li>Vanilla JavaScript, jQuery, and React</li></ul><p><em>Things I didn’t know</em></p><ul><li>Bash / console anything</li><li>Most git features beyond just branching and pushing</li><li>TDD, beyond the most basic of tests</li><li>Ruby class design or anything about rails beyond active record, controllers, and ERB</li><li>What a rake task was</li></ul><p>As one can imagine, those “things I didn’t know” included many skills integral to everyday work as a professional developer.</p><p>During my first few weeks, I had to quickly confront my inadequacies at the command line. I got stuck frequently and repeatedly asked for help. I wrote everything down, which kept from asking the same question again. I also heard words and saw methods I’d never seen before. I alternated between mentally noting them or asking questions which revealed how little familiarity I had with Rails conventions.</p><p>Our scrum process had devs picking out tickets they’re interested in — not being specifically assigned. I struggled to figure what assignments would work for me and help me get up to speed on the codebase. I picked up many tickets that I eventually abandoned after days of getting nowhere. I spent weekend naptime trying to catch up on reviewing open PRs.</p><p>Over time, I started to find my footing. I worked on projects that played to my strengths — like auditing and analysis. These projects increased my confidence by showing I offered something unique to the team. They also forced me to get really deep in the codebase and better understand how everything fit together. I realized it was impractical to review every PR and focused on ones that seemed relevant or I’d been specifically asked to review.</p><p>Later, an insightful senior dev — who became my team lead — started trusting me with stretch assignments. My learning and capacity took off. Instead of biting off small, isolated tickets, I was given the space to just do the work. I learned to write tests and service classes and break things down into understandable chunks. All those things I knew nothing about 8 months before started to feel natural.</p><p>Around the same time I was leveling up, we had some senior devs leave and some get promoted (i.e less time to code). Shortly thereafter, we also began development on two products. Space really opened up for junior devs to take on more complex work. I started coming up with proposals, organizing discussions, and advocating for my ideas. It felt very empowering.</p><p>Designing the data models and discussing the flow of information for these new products was really fun. I always liked manipulating data on the frontend, but I never really connected to my on-the-job adventures in frontend. As I grew more confident in my backend skills, I felt more secure about leaving conventional data analysis and frontend behind (I still use it in teaching others to code).</p><p>One year in, I’m now a mid-level backend engineer and feel really good about my trajectory. Of course, loving my job doesn’t mean things are always rosy. Sometimes I get overwhelmed or stymied by delayed code reviews. Sometimes I’m tired or distracted and have trouble focusing (open office plans don’t help). I’m still woefully lacking at the command line. My daughter stopped napping at home about 4 months ago, leaving me with 20 minutes a day for learning new technologies.</p><p>I feel constantly awkward about making decisions in the absence of well developed technical skills. Even when putting up PR’s that are 20 files long, there are often suggestions from those with deeper knowledge of Ruby or OOP about more efficient methods or more appropriate ways to structure my code. I’ve learned to mostly get over it and accept constructive feedback. I only know what I’ve already learned; there’s no reason to feel ashamed about a lack of knowledge.</p><p>Outside of the work day to day, I also feel left behind by former classmates who are already in leadership roles by this age. Nevertheless, I know I’m happier doing what I’m doing than being a VP of some administrative capacity. After a year under my belt, I know I won’t be a mid-level developer forever.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c711a762804" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stumbling Toward Programming: A Chronic Career Switcher’s Tale]]></title>
            <link>https://medium.com/@llmaddox/stumbling-toward-programming-a-chronic-career-switchers-tale-30e3e9844c31?source=rss-b359be066bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/30e3e9844c31</guid>
            <category><![CDATA[career-change]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[academia]]></category>
            <category><![CDATA[analytics]]></category>
            <dc:creator><![CDATA[Lindsey Maddox]]></dc:creator>
            <pubDate>Sat, 14 Apr 2018 10:29:43 GMT</pubDate>
            <atom:updated>2018-04-14T10:29:43.643Z</atom:updated>
            <content:encoded><![CDATA[<p>I didn’t start programming because of some dramatic turning point in my 40s or 50s. I more or less stumbled into it after years of hopping back and forth between stable, administrative jobs and trying out various creative and academic fantasies.</p><p>I’d always thought of myself as creative — I loved to read and play music and my friend Lauren and I lived at the movie theater on weekends. And, for some unknown and irrational reason, I dreamed of being an actress for as long as I can remember. So, enrolling as a theater major upon starting college — despite limited training and few actual acting performances — seemed natural.</p><p>Freshman year of college was the first of many times I would discover that my visions of myself weren’t always grounded in reality or even based on how I actually felt. I quickly realized I wasn’t any good, didn’t really like formal acting that much, and didn’t fit in. I quit after one semester.</p><p>My next choice of major and most of my electives I selected purely on intellectual interest. I was fascinated by my major, psychology, and the many social science classes I took. Nevertheless, as I progressed in my degree, I realized I wasn’t really drawn to working in experimental (research/academics) psychology. I also never had any interest in being a therapist.</p><p>There was nothing really keeping me in school and I had plenty of credits, so I graduated early. I planned to take the GRE over the summer, apply to grad school in the fall, and find some kind of job in the interim.</p><p>After the summer, I moved to a bigger town and took the first job I was offered. Human Resources. I found interviewing and hiring fascinating, but I hated most of the work.</p><p>So when I was admitted to an unconventional masters program at NYU, I jumped at attending without entirely thinking it through. Despite the challenge and enjoying some of the reading and discussion in my classes, something was missing. I didn’t connect to the degree at all and was unhappy in New York. Five classes and one year in, I left the program and the city.</p><p>I made the decision to leave right before my lease expired and didn’t have next steps planned at all. I moved in with my parents. It took me nearly five months to decide where I wanted to move next. During that time I visited friends, vetted cities, and did some freelance writing.</p><p>My brother was living in Austin at the time, and it seemed like the perfect environment to flex my creative muscles. I’d shifted toward pursuing a pseudo-practical creative career. If I wasn’t cut out to be an actress and felt academia was out of touch with reality, maybe I’d flourish as a culture writer.</p><p>Well, turns out the selection process for music writers is pretty cutthroat too. I knew a lot about music and could sometimes turn a phrase, but my writing never pulled in much more than beer money. I’m just not as talented or hungry as many of the awesome writers out there.</p><p>I needed money, so I applied for an array of administrative jobs at UT Austin. I ended up at an awesome department, ICES. I had a fantastic boss and great coworkers. I got to meet international and domestic scholars while running our visitors and postdoc programs. It was pretty great for an admin job, and I had no reason to leave during my remaining 2.5 years in Austin.</p><p>I moved to Mississippi when my husband — then boyfriend — quit the Army. We ended up in Oxford because, well, in state tuition there is really cheap.</p><p>Oxford has its charms, but very few jobs. All I could get was part-time work tutoring for the athletics department.</p><p>With no clear alternatives, I still felt drawn to getting a graduate degree. I conveniently wrote off my unhappiness at NYU to being in the wrong program. English felt more practical and relatable than other specializations. I enrolled in three undergrad classes to improve my application and test drive my interest.</p><p>You’re probably not surprised to hear that I didn’t like it much. Despite enjoying reading and discussing books, I found coming up with topics for papers tedious and not very meaningful. To me, academic scholarship often felt contrived and cut off from the real world. Once I recognized my true feelings, I finally was able to shut the door on a career that wasn’t right for me.</p><p>There I was just married and 27 trying to figure out what the hell I wanted to do with my life. I read lots of quixotic posts on figuring out your true calling, but nothing ever stuck out. I picked up some more writing — this time more marketing oriented — and postponed figuring things out for a while.</p><p>Soon after, the startup I was working for started to gain some momentum, and someone needed to do QA. I was tapped for the task. Gradually, I spent more time doing QA and new analytics tasks and less time writing (we hired better writers).</p><p>I really liked working with data. I enjoyed finding patterns in spare and nebulous input. I learned SQL early on and realized there was nothing mystical about coding languages. I also liked figuring out how to manipulate the language to get data in the format I wanted.</p><p>As startups go, my responsibilities were forced to shift again, and I decided I’d rather pursue something else than continue on that track. I had a choice between veering more toward conventional analytics or learning programming. For whatever reason, I felt more drawn to the latter.</p><p>So, at 30, after countless other career switches, I quit my job and started teaching myself how to code (more about that journey <a href="https://medium.com/@llmaddox/the-real-story-about-learning-to-code-in-your-30s-a7c05e33ecd9">here</a>).</p><p>Analytics and programming gave me the challenge and satisfaction that I never completely felt in all my other careers. In my career to date, I’d never really had flow moments until I started this work. So, why did it take me so many missteps to discover what I truly enjoyed?</p><p>Being stubborn definitely played a role. My visions of myself as a creative, intellectual type kept pulling me back toward trying out different sub-fields within those domains. These fantasies consistently prevented me from considering career option outside of these realms. It didn’t matter that every foray I made along those lines left me feeling uncomfortable and unfulfilled. I had to stumble into satisfying work to finally realize I didn’t want what I thought I did.</p><p>Yet, other factors were at play besides my own intransigence. I honestly had no idea that work like this existed. I didn’t know that business wasn’t just for the social and entrepreneurial; I wasn’t aware that analytics was a domain at all really. I also knew nothing about being a software developer. All I knew was that my brother grew up taking apart computers and making calculator games, and I never was interested in those pursuits. When I started learning the language, I actually asked my brother for indispensable sci-fi and fantasy works because I assumed I wouldn’t fit in if I hadn’t read them.</p><p>I now know that I can still be creative and cerebral and a programmer at the same time. There are plenty of people who will talk to me about The Decemberists and playing music or help me expand my now unwieldy list of books to read. My creative and academic bent will always be a part of me, it just doesn’t guide my career path anymore.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30e3e9844c31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kibana in the Headlights — Getting Familiar with the Elastic Stack’s Visualization Layer]]></title>
            <link>https://medium.com/@llmaddox/kibana-in-the-headlights-getting-familiar-with-elks-visualization-layer-87a9af496678?source=rss-b359be066bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/87a9af496678</guid>
            <category><![CDATA[kibana]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[elastic]]></category>
            <category><![CDATA[logging]]></category>
            <dc:creator><![CDATA[Lindsey Maddox]]></dc:creator>
            <pubDate>Mon, 25 Sep 2017 09:46:52 GMT</pubDate>
            <atom:updated>2017-09-26T12:26:43.291Z</atom:updated>
            <content:encoded><![CDATA[<p>My team at <a href="https://www.arcadiapower.com/">Arcadia Power</a> just started using the Elastic Stack(5.6) for some of our logs. As part of this adventure, I’ve been thrown into the world of Kibana — the visualization layer for Elasticsearch.</p><p>In my experience, it was pretty easy to get up and running on Kibana quickly. Aside from some quirks about how they label things (e.g. <em>buckets </em>and <em>aggregation</em> everywhere), Kibana has an intuitive interface and extensive documentation.</p><p>If you’re just dipping your toes into the Elastic Stack or still evaluating it, you may find all the information overwhelming. Here, we’ll try to simplify things by focusing on a few of the most useful features of Kibana and some of the differences between Kibana and other visualization products.</p><h4><strong>Visualizations</strong></h4><p><strong>Getting Started</strong></p><p>If you have an index already configured*, you can simply select which index you want to use when initially creating your visualization. You can also create custom searches in the discover tab and create a chart filtered to that search. It’s easy to filter from within a visualization, so unless you have a really complex search query, you’re probably better off just using one of your indices.</p><p>Once you’ve selected your chart, you’ll be put into an interface specific to that chart type. Regardless of the chart you choose, your menu bar should always give you the ability to alter the date range and add filters.</p><p><strong>Line Chart</strong></p><p>Line charts work pretty similarly to area and bar charts from a configuration standpoint, so learning them will give you substantial mileage in Kibana.</p><p>Once you land in the line chart interface, the default <em>bucket</em> selection will be the <strong>Y axis</strong>. You can select your <em>aggregation</em> field, which you can use for simple count on categorical fields or things like average or sum for numeric fields.</p><p>Kibana refers to the <strong>X axis</strong> and <strong>multi-series</strong> splitting as <strong><em>buckets</em></strong>. If this seems confusing, just think about it as grouping your data into buckets.</p><p>In the 3 main chart types, you can add <strong>X axis</strong>, <strong>Split Series</strong>, or <strong>Split Chart</strong>. <em>Split series</em> gives you the ability to add data series (like columns). With <em>split chart</em>, you can split a chart in rows or make columns for each item in your series.</p><p><em>X axis</em></p><p>Since this is the X-axis, in this context, <strong><em>aggregation</em></strong> means what value you’re aggregating on (what is the unit you’re measuring). So, for count, you’re looking at <em>count per X unit.</em></p><p>For time series data, you’re going to want to just use a date histogram as your aggregation. You can set custom time intervals or use their default settings.</p><p><em>Split series</em></p><p>Split series just fractures global data into multiple data sets. For line and area charts, you’ll probably be using this grouping frequently. Since you’re usually showing some value over time, you probably want to group your data by some kind of term — otherwise you’d just be looking at a global baseline. Split series would enable you to take a global visits over time count and split it into a term in your index — say broken out by region.</p><p>For keyword data (i.e. these fields expect exact matches), you can do this by selecting <em>term </em>from the dropdown, then finding the term that you want to group by.</p><p><em>Split Chart</em></p><p>Split chart enables you to create a bunch of individual charts with the same X (rows) or Y axis(columns). Separating into rows could be useful if you have overlapping data series — isolating them would enable you to see the trend better. I haven’t really dug into the use case for columns, but theoretically this approach could make sense for spotting outliers.</p><p><strong>Heat Map</strong></p><p>Heatmaps make it a little easier to visually aggregate data that would be hard to process in a standard line/area/bar chart.</p><p>Since heatmaps are a bit more complex than the other charts, I’m going to walk through making one using the Shakespeare data set that Elasticsearch uses in its documentation.</p><p>For this example, we’re going to chart the frequency of lines by speaker and play. Our value metric is the number of lines — and is represented here by the saturation of color(as opposed to standard Y axis). The default aggregation is set to count, and you’ll have the options to add Y and X axis once you get to the base visualization.</p><p>We’re going to put the speaker on the Y axis and the play on the X axis. It doesn’t really matter which you put where as long as it’s easy to follow the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2oBAelv7nba0ci53U-L_vA.png" /><figcaption>Heatmap of Highest Line Count by Shakespeare Character and Play</figcaption></figure><p>You can click on the options tab to change the color schema (monochromatic color hues or yellow to red), change the number of colors in your scale, or change the scale itself(you cannot do custom ranges). You can also select custom colors by clicking on the range in the legend, but it’s much easier to follow a standard color schema than a random pool of colors.</p><p>You can also split the chart into multiple rows and columns. Since Kibana doesn’t allow for separate color scales, adding even more information might make your visualization hard to interpret.</p><h4><strong>Dashboards</strong></h4><p>Kibana dashboards can easily be constructed from existing visualizations, and you can add new charts on the fly from the dashboard page. You can drill in to a specific segment to repopulate the chart with only that information. And, of course, the dashboard comes with customary resizing/shuffling behavior.</p><p>Here’s a simple dashboard constructed from different Shakespeare charts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jG6g-RF5tDiBhCGDK9FD5Q.png" /><figcaption>Shakespeare Dashboard in Kibana</figcaption></figure><p>After working with it and talking to coworkers, Kibana definitely seems more useful for monitoring and creating dashboards than analysis. In the next section, we’ll discuss some of these limitations and possible workarounds.</p><h4><strong>Analysis in Kibana</strong></h4><p>If you’re used to Excel or D3, using Kibana can require a bit of adjustment. Kibana sacrifices customization and functionality for speed and ease of use. You can easily change chart types in settings, time range, and filter out irrelevant data. However, I’ve found that many things I want to do simply aren’t available (I’m not alone — copious forum participants and feature requests show similar problems). For instance, you cannot directly compare ratios, scale data, or use the cardinality aggregation in a visualization — you’d have to specifically configure Elasticsearch values or searches first. You also cannot do overlay charts in the main visualization program.</p><p>If you have the means, Elastic Stack’s own X-Pack is an easy-to-use machine learning package with several integration options. It trains on your data to detect anomalies (and suggest their most likely cause), population outliers, and other behavior. Unfortunately, the full functionality comes with a hefty price tag.</p><p>Timelion is also a great way to extend your time series visualizations — and it’s available right in Kibana. It allows you to overlay charts, do math operations, and offers more customization than the standard Kibana visualizations. The tool requires some knowledge of Elasticsearch and has a few domain specific methods.</p><p>Finally, Kibana does offer the ability to export csvs using the same data in your visualization. If it makes sense, you can transfer your data to Excel or other programs and do your analysis there.</p><h4><strong>Conclusion</strong></h4><p>In this post, we looked at some basic uses of Kibana. We walked through creating line charts, heatmaps, and dashboards.</p><p>In my experience, the product is great for quickly spinning up dashboards and filtering different segments of your data. However, its core visualization options are not a great fit for analysis. If you want to really dig into your data or customize your charts, I suggest exploring other extensions like X-Pack, Timelion, or Excel.</p><p><em>*Creating Elasticsearch indices is outside the scope of this tutorial, but you can find great tutorials on this on Elastic’s site: </em><a href="https://www.elastic.co/guide/en/kibana/current/tutorial-load-dataset.html"><em>https://www.elastic.co/guide/en/kibana/current/tutorial-load-dataset.html</em></a></p><p><em>For a full overview of Kibana, check out the official documentation here: </em><a href="https://www.elastic.co/guide/en/kibana/current/getting-started.html"><em>https://www.elastic.co/guide/en/kibana/current/getting-started.html</em></a><em>. X-Pack also has a great video series demoing their product; view the first video here: </em><a href="https://www.elastic.co/videos/machine-learning-tutorial-creating-a-single-metric-job"><em>https://www.elastic.co/videos/machine-learning-tutorial-creating-a-single-metric-job</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87a9af496678" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Active Record Querying: Part III]]></title>
            <link>https://medium.com/@llmaddox/getting-started-with-active-record-querying-part-iii-189b97446982?source=rss-b359be066bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/189b97446982</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[activerecord]]></category>
            <dc:creator><![CDATA[Lindsey Maddox]]></dc:creator>
            <pubDate>Wed, 23 Aug 2017 20:46:38 GMT</pubDate>
            <atom:updated>2017-09-25T09:52:20.126Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi again. In this final post, we’re going to review a more advanced use of Active Record — subqueries.</p><h4>Subqueries</h4><p><em>Getting Started</em></p><p>Coming from an analyst background, I’m tempted to just write raw sql when things get complicated. But it’s actually not too hard to write subqueries with active record. You just set your subquery to a variable and filter against it in a new query.</p><p><em>From</em></p><p>Our first example uses a subquery in the from clause. If you only use active record, you may not have seen from. This is actually what your first model reference calls in sql. For instance, Recipe.all is equivalent to Select * from Recipes.</p><p>Let’s say I want to identify complaints that need attention. In this case, we’re querying for an average number of complaint occurrences by complaint type and by account.</p><p>First, we’ll look for the number of complaints per account and complaint type</p><p>a = Account.select(“accounts.id, complaints.id, count(complaints.id) as ct”).joins(:complaints).group(&quot;accounts.id,complaints.id&quot;)</p><p>We set the result of the subquery to a variable and reference it in the appropriate place in your parent query (in this case, <em>from</em>).</p><p>In this particular case, I want to know the average of the complaint counts for each account. Here’s how we’d write the query, while referencing the subquery:</p><p>Account.select(&quot;accounts.name, avg(ct) as complaint_count&quot;).from(a)</p><p>Here, we’re treating the subquery as a superficial table — as if count was its own column. Since we’re grouping by name, we’re aggregating each complaint type and averaging it.</p><p><em>Where</em></p><p>My <em>where</em> example is a little more complicated — bear with me. I find <em>where</em> nested queries useful for obtaining aggregated information on counts.</p><p>Let’s say you wanted to fill your pantry with ingredients used in your favorite recipes. You want to find the recipes first, then aggregate on the amount of each ingredient needed.</p><p>We’ll start with the interior query (subquery):</p><p>r = Recipe.select(&quot;recipes.id, count(meals.id) as ct&quot;).joins(:meals).group(&quot;recipes.id&quot;).having(&quot;count(meals.id) &gt; ?&quot;, 3)</p><p>Here’s how we’d write the main query, while referencing the subquery:</p><p>Ingredient.select(&quot;ingredients.name, sum(ingredients.amount)&quot;).joins(:recipes).where(recipes: { id: r })&quot;.group(&quot;ingredients.name&quot;)</p><p>This simply means that the recipe’s id is in the subquery results. If you were referencing explicit results, you’d do something like where(recipes: { id: [2,3,4] }).</p><p>Raw SQL</p><p>So you <em>really</em> need to use raw SQL? Below are a few(not all) approaches you can use.</p><p>Set the sql commands as a string variable and run:</p><pre>MyModel.find_by_sql(sql)</pre><p>to get model relations.</p><p>If you are doing aggregations, you can call this on your query:</p><p>result = MyModel.connection.execute(sql)</p><p>which will return a database specific result object. From the object, you can simply query result(0,0) to get the value.</p><p><em>Note: be careful where you use these approaches, as they are subject to </em><strong><em>SQL injection</em></strong><em>.</em></p><h4>Conclusion</h4><p>Today, we looked at some more advanced uses of active record — with a particular focus on how to write subqueries. In <a href="https://medium.com/@llmaddox/getting-started-with-activerecord-querying-part-i-9dcd8fea8b06">Part I,</a> we explored joins and in <a href="https://medium.com/@llmaddox/getting-started-with-active-record-querying-part-ii-23dcf09f43b7">Part II</a>, we looked at grouping and filtering results.</p><p>There are many other situations we didn’t cover — such as extracting portions of dates and substrings — which you may encounter if you’re querying the database regularly. You can consult your database documentation to learn more about these techniques.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=189b97446982" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Active Record Querying: Part II]]></title>
            <link>https://medium.com/@llmaddox/getting-started-with-active-record-querying-part-ii-23dcf09f43b7?source=rss-b359be066bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/23dcf09f43b7</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Lindsey Maddox]]></dc:creator>
            <pubDate>Mon, 14 Aug 2017 12:09:44 GMT</pubDate>
            <atom:updated>2017-08-14T12:09:44.431Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi again. Welcome back to our discussion of querying in Active Record. In <a href="https://medium.com/@llmaddox/getting-started-with-activerecord-querying-part-i-9dcd8fea8b06">Part I</a>, we talked about joining tables together. <em>Joins</em> are the primary way to get quick access to large swaths of information, but you’ll often need to slice up or filter your data too. Today, we’ll go over techniques of narrowing and aggregating your results.</p><p>Depending on your needs, you can either select or pluck the fields you want to access. If you’re interested in looking at patterns in your data or want to filter by those patterns, you’ll want to group your results and possibly qualify further with having.</p><p><strong>Select</strong></p><p>When you join tables, Active Record automatically returns all the fields of the first joined table. A call to Musician.join(:songs) makes this sql call:</p><p>Select Musicians.* from musicians inner join songs on songs.musician_id = musicians.id</p><p>If you want fields from other tables, you need to select or pluck them. Selectreturns a relation; pluck returns an array.</p><p>Since joins work with multiple tables, you need to make explicit where the fields you want live. For example, if you have tables authors and books — both with a field “name” — to indicate you want the name of books, you’d use:</p><p>Author.select(&quot;books.name&quot;).joins(:books)</p><p>If you want to return multiple fields with the same name, you’ll need to alias them:</p><p>Author.select(&quot;authors.name as author_name, books.name as book_name&quot;)</p><p>You can call them whatever you want, Active Record just needs to be able to disambiguate the fields.</p><h4>Pluck</h4><p>The syntax for pluck is the same as you use for select. However, because pluck executes immediately and returns an array, it needs to be at the end of your query (you can still call first or last though #becausearray). Here’s an example:</p><p>Author.joins(:books).pluck(&quot;authors.name, books.genre&quot;)</p><p>This query will return a multi-dimensional array with author name and books genre for each author with a book on file.</p><h4>Group</h4><p>Grouping your query allows you to slice up, or <em>aggregate</em>, your data in various ways. You can aggregate on sum, average, minimum, maximum, and count. Count just tells you how many records exist for the field(s) you’ve grouped on.</p><p>Let’s say you want to know how many (count) of each type of item was purchased and the sum of orders by day.</p><p>Here’s how you could write out the former:</p><p>Order.group(:category).count*</p><p>and the latter:</p><p>Order.select(&quot;created_at, sum(amount) as amount&quot;).group(:created_at)</p><p>Keep in mind, you can group by multiple fields (e.g. by category and day).</p><p><em>*Since count is just adding up rows, you generally don’t need to specify a field to count. This syntax performs a count(*) based on your grouping.</em></p><h4>Having</h4><p>So, great, you can aggregate your data and make charts and tables ad nauseam. In everyday use, grouping is often more powerful when a having clause is added to it. Having is kind of like a where clause focused specifically on aggregated results. It provides a great way to filter results — such as highlighting popular items in a collection or creating a threshold condition for logs / alerts.</p><p>Let’s look at some examples of highlighting popular items. Say you have a book reading site and you want to highlight books with the highest ratings. This query:</p><p>Book.select(&quot;books.name as book, avg(ratings.amount) as rating&quot;).joins(:ratings).group(:name).having(&quot;avg(ratings.amount) &gt; ?, 4&quot;)</p><p>would return a list of books having an average rating of more than 4 along with that rating.</p><p>Or, perhaps you want to know books that have a high number of readers:</p><p>Book.select(:name).joins(:readers).group(&quot;books.name&quot;).having(&quot;count(readers.id) &gt; ?, 10000)</p><p>The query above will give you a list of all books who have more than 10,000 readers.</p><p><em>Note: It is usually helpful to alias your column names when working with group/having for more readable results (and more usable ones if you’re performing subsequent operations).</em></p><p><strong><em>Having — Zero Count Items</em></strong></p><p>Because joins performs an inner join, you cannot use these queries to look for results with a count of 0. You must instead use a left join. When using a left join this way, it’s important to make sure you’re looking at the correct side of the join.</p><p>Let’s say I have a meal planning app, and I want to look for recipes that have never been made. Below, I’m grouping by the recipe name, but checking for the count of meal id. Since we’re joining from the left side, <em>recipe name</em> would always have a count of one (assuming unique names). Here’s what a query might look like:</p><p>Recipe.select(&quot;recipes.name&quot;).left_joins(:meal).group(&quot;recipes.name&quot;).having(&quot;count(meals.id) = ?&quot;, 0)</p><p>This query will return all recipe names which have a meals.id count of 0. The lack of an entry in our meals table indicates the recipe has never been made.</p><p><em>Note: the </em><em>left_joins method is only available in Rails 5 and is actually an alias for the more explicit </em><em>left_outer_joins method.</em></p><h4>Conclusion</h4><p>We covered a fair amount of territory in this post, and all the methods we discussed are useful ways of simplifying your data. We looked at isolating your result to particular columns with select and pluck. We also dug into how to aggregate results with group and having and even when you’d need to switch to a left join.</p><p>In the next and final post of the series, we’ll look at more advanced concepts like subqueries and how to use raw sql.</p><p><em>Join references threw you for a loop? Check out </em><a href="https://medium.com/@llmaddox/getting-started-with-activerecord-querying-part-i-9dcd8fea8b06"><em>Part I</em></a><em> for more on how to use them in Active Record.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23dcf09f43b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with ActiveRecord Querying: Part I]]></title>
            <link>https://medium.com/@llmaddox/getting-started-with-activerecord-querying-part-i-9dcd8fea8b06?source=rss-b359be066bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/9dcd8fea8b06</guid>
            <category><![CDATA[activerecord]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Lindsey Maddox]]></dc:creator>
            <pubDate>Thu, 10 Aug 2017 12:05:43 GMT</pubDate>
            <atom:updated>2017-08-10T12:05:43.231Z</atom:updated>
            <content:encoded><![CDATA[<p>I was an analyst before I became a programmer, so I have a pretty good handle on SQL. Nevertheless, during my first few weeks as a developer, I was constantly thwarted by Postgres errors every time I tried to use the console. The Rails guides cover some basics, but I had to hunt down a lot of answers and ask my teammates to clarify.</p><p>In this series on querying with Active Record, I’ll talk about a few tricks I picked up along the way. To keep it short, this post will just talk about <em>Joins.</em></p><h4><strong>Inner Joins</strong></h4><p>Weirdly, when you want to do a join in Active Record, you call <em>.joins (</em>in SQL, you say the singular <em>join</em>). The <em>joins</em> call by itself performs an <em>inner join</em> on the associated model you reference:</p><pre>Author.joins(:books)</pre><p>Performs the following SQL:</p><pre><em>Select Authors.* from authors inner join books on books.author_id = authors.id</em></pre><p>You save a lot of code with ActiveRecord, but as always with Rails, you have to keep in mind singular vs plural. If you’re joining from the belongs to side, you’d use:</p><pre>Book.joins(:author)</pre><p>since a book belongs to one author.</p><p><em>Nesting</em></p><p>If you need to chain more than one table together through Active Record, you will need to learn a somewhat difficult to remember (it was for me, anyway) syntax. Fortunately, the AR way will save you a tremendous amount of time once you learn it.</p><p>If you only need to add on one nested association, you can do:</p><pre>Genre.joins(books: :author)</pre><p>If you have more than one nested association, you can chain it with a hash:</p><pre>Festival.joins(musicians: { albums: :songs } )</pre><p>If you have more nested associations than listed above, simply follow the same pattern of adding hashes after the first table.</p><p><em>Nested Join with other Associations not part of Nested Group</em></p><p>If you have another table you need to join that isn’t part of this nested thread, you either need to separate it with a comma — or if already a part of a nested hash, use an array.</p><pre>Festival.joins(:locations, musicians: { albums: :songs })</pre><h4><em>Left Joins</em></h4><p>Rails 5 has a built-in <em>left_outer_joins </em>method. If you are not on Rails 5, you can simply do a regular join and write out the raw sql inside the parentheses of the join.</p><p>For anyone unfamiliar with left joins, here’s a pretty easy use case from my last company. We stored messages in one table and full link strings in another(we used short hashes in the messages themselves). If you wanted a list of all messages and the links that were used regardless of whether the message contained a url, you’d need to do a left (outer) join. Here’s how you could write it in Active Record:</p><p>Message.joins(&quot;left join links on messages.link_id = links.id&quot;)</p><p>A left join allows you to join rows even if the values or null. So, you get both messages with links and those without (just simply have a null value for the link columns). If you do a standard inner join, it will only return items in your first table that have non null values in the join table (e.g messages with links).</p><h3><em>Conclusion</em></h3><p>It can be tricky to convert raw SQL into Active Record. Because of the succinct way AR calls clauses, it’s easy to assume that it’s more intuitive than it actually is. With extended joins, you need to make a clear line about how the tables you’re referencing are joined together.</p><p>While you can always write raw sql inside a joins call, in practice, you’ll be much more efficient with Active Record syntax.</p><p>Keep in mind that these joins are returning a select * on the first table, so you may need to <em>.select </em>or <em>.pluck </em>specific columns to get the information you want(more on that in a future post).</p><p><em>If all this talk of different joins has you going ‘huh?’, be sure to check out Jeff Atwood’s excellent post on SQL joins: </em><a href="https://blog.codinghorror.com/a-visual-explanation-of-sql-joins/">https://blog.codinghorror.com/a-visual-explanation-of-sql-joins/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9dcd8fea8b06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Real Story about Learning to Code in your 30s]]></title>
            <link>https://medium.com/@llmaddox/the-real-story-about-learning-to-code-in-your-30s-a7c05e33ecd9?source=rss-b359be066bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7c05e33ecd9</guid>
            <category><![CDATA[freecodecamp]]></category>
            <category><![CDATA[working-moms]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Lindsey Maddox]]></dc:creator>
            <pubDate>Fri, 21 Jul 2017 10:57:18 GMT</pubDate>
            <atom:updated>2017-07-21T10:57:18.439Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re looking for a shiny, happy story about becoming a software developer, this isn’t it.</p><p>I quit my job as an analytics manager at a start-up in the fall of 2014. I didn’t start my next full-time job — and first dev role — until May 2017. This story is about that journey — and all the interruptions and stumbling blocks I experienced over those years.</p><p>When I started out, I only vaguely knew of bootcamps and figured I could learn programming on my own without too much difficulty. I thought I’d take 6M learning to code and then find another job. I was way off.</p><p>Things started off well. I solved some Ruby challenges my brother and others had ‘assigned’ me, learned Rails, and wrote a few Rails programs end-to-end. The designs were terrible — both on the site and in my application — but I was able to build out the projects a little with things like (data-powered) summaries and recommendations.</p><p>By that point, I was in the 5–6M range of unemployment and a little lost on what to do. I could have maybe looked for my first dev job, but my husband and I were moving in a few months. It seemed strange to just keep building more of the same projects. I picked up a little freelance work and planned to revisit programming after a short break.</p><p>Then I got pregnant. I did not have much nausea, but I was exhausted. With doctor’s appointments, apartment research, and moving prep, I did not have the energy to dedicate to programming. I took several months off and honestly didn’t think about coding much during that time.</p><p>Then, one day after a freelance project had wrapped, I took a look at a program my brother had told me about, <a href="https://www.freecodecamp.com/">freeCodeCamp</a>. After flying through the introductory concepts, I was hooked. The program was broken up into stages — each stage including algorithm challenges and projects. They were the perfect size for the time I had available — offering enough resistance to make finishing them feel rewarding but not so difficult that they added stress to an already nerve-racking time.</p><p>With a pretty consistent effort of a few hours a day, I completed almost all of the Front End Development program in about 2.5M. I finished my next-to-last project, Tic Tac Toe, two weeks before my due date and only had one project and algorithm left to get my certificate. As much as I wanted to hit that milestone before the baby was born, the exigencies of late pregnancy just wouldn’t allow it.</p><p>Then, five days late, the baby came. My delusions of working on programming during quiet time (ha!) or nap time were quickly squashed. I spent the first 6 weeks or so of my daughter’s life in a complete fog. Sleep deprivation wasn’t the only thing plaguing me–I was also trying to keep up with the cycle of feeding, changing, and 3–5 hours of near constant crying in the late afternoon and evening. I felt like a completely different person — and not in a good way. I felt like I was living someone else’s life.</p><p>My daughter started sleeping through the night around 3 months, and we got into a manageable rhythm. I started going out on my own and doing things I enjoy more. By regaining some semblance of my identity, I felt a little more in control of my situation. And I knew I needed to make strides toward changing it.</p><p>Early one Saturday morning when my daughter was about 4 months old, I decided to forego my coffee run and take a crack at the last FCC algorithm again. I was sitting in the community room of my apartment building just staring at my computer as I flailed with different approaches to the problem. I couldn’t hold the whole thread of the problem in my mind; every time I tried to regroup, it felt like I was missing a different piece of the puzzle. I realized I was still extremely tired, and my brain simply wasn’t equipped to attempt a problem of that complexity.</p><p>I was so focused on my goal of getting back to work that I didn’t give myself permission to have any down time. I was honestly a little terrified that if I didn’t get out soon, I never would. But after this experience, I knew I wasn’t at a place where my efforts would really be effective. So, I cut myself some slack. I didn’t loop back around to programming until August — when my daughter was 5.5 months and taking naps longer than 40 minutes at a time.</p><p>Every day, I’d wake up around 6 — and she’d wake up at 7. We’d play until about 9 or so, at which point she’d go down for a long nap. After doing some chores, I’d sit down at my computer. I usually had about an hour — maybe an hour and fifteen minutes — before she’d wake up. Once I started this regimen, I quickly cranked out the Simon game and cleaned up my old projects before officially completing the Front End program.</p><p>After dabbling in JavaScript background technologies, I had a great idea for jumping back into Rails — a meal planning application. This was my biggest project to date. Because it was something I actually used myself, I had a constant supply of extensions and features to add. I inevitably ran into snags integrating my ideas into the app. But hour-by-hour and hacking meetup at a time, I built out MealPlanner enough that I was proud to include it in my portfolio.</p><p>Around the same time, I’d started exploring different day care options and setting up appointments to visit them. We assumed it would take at least another 6 months (after my daughter’s first birthday) to get a spot. My husband happened to call his corporate day care at the right time, though, because they had a rare infant spot open up that had to be claimed the next day. Despite not having done any job searching yet, we took the spot.</p><p>I was very nervous about the transition and looking for work, but still excited at the possibility. Unfortunately, the transition was pretty stilted.</p><p>Right before she began day care, I came down with the flu. Soon after, my husband got sick too. After a few days in day care, my daughter spent the entire Thanksgiving break sick. And Kept.Getting.Sick. I’m not sure she attended more than 50% of scheduled days until January. Needless to say, I didn’t get a whole lot done during this time period.</p><p>I came back from the holidays, committed to my job search and exploring more options. I finally got responses from companies. I went on some interviews, did some take home exercises, worked on my resumes, and wrote a lot of intro emails. When I got rejected after interviews and take-homes, it was confusing and demoralizing. It was unclear why I was rejected, so I didn’t know how to improve or target my search better. I had my first in-person interview, which was positive, but didn’t pan out.</p><p>Then it was fairly quiet for nearly two months. I continued to plug through the freecodecamp react/data visualization program I’d been working on. Hopefully, the more I learned, the wider my options would be.</p><p>Despite my commitment to keep working, I was getting pretty worried. I had already been applying to analyst jobs — which I was more than qualified for and hadn’t heard anything. Our savings were dwindling. Also, it felt really weird having my daughter in day care for months when I wasn’t actually ‘working’. As much as I thought I’d never feel guilty for being a mom that did something for herself, I kind of did.</p><p>Then, all of the sudden, something clicked. I told my brother “I knew I was going to land somewhere”. I started acknowledging my long journey and foregrounding my absence from the workforce — along with the big, red “baby” flag. I built a website where I showed off my work. And I pushed through an end-to-end Javascript application that integrated react, d3, front-end routing, a Mongo database, and authentication.</p><p>As things go, this is when I started getting more in-person interviews. One of them resulted in my first programming job, which I started after an almost 6 month search and 2.5 years after I began learning Ruby.</p><p>I’ve had so many interruptions in my coding journey that I find it impossible to answer the “how long have you been programming” question. Despite seeming like an innocuous question, it dredges up a lot of shame and frustration surrounding the length of my journey. Maybe if I had done things differently, things would have been easier. Maybe. Who knows. I do know it’s important to be kind to myself. And I try to remember that when I start doubting my decisions or feeling behind.</p><p>Nevertheless, there is one good reason to look back and that’s to give thanks to those that helped me make it here. I could have never gotten to this point without my husband who was incredibly supportive about my taking up weekends and nights to go to meetups or work on programming and who saved me from drowning as a stay-at-home-mom. And my brother who initially encouraged me to pursue programming and never doubted that I would eventually find a job as a software developer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7c05e33ecd9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>