<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: David J. Davis</title>
    <description>The latest articles on DEV Community by David J. Davis (@ddavisgraphics).</description>
    <link>https://dev.to/ddavisgraphics</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F181860%2F9ca255f5-2498-41e8-8bc6-bfd85b0d89e6.jpeg</url>
      <title>DEV Community: David J. Davis</title>
      <link>https://dev.to/ddavisgraphics</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ddavisgraphics"/>
    <language>en</language>
    <item>
      <title>Random Code Prompts and Traumatic Brain Injury</title>
      <dc:creator>David J. Davis</dc:creator>
      <pubDate>Mon, 11 Oct 2021 02:48:30 +0000</pubDate>
      <link>https://dev.to/ddavisgraphics/random-code-prompts-and-traumatic-brain-injury-1356</link>
      <guid>https://dev.to/ddavisgraphics/random-code-prompts-and-traumatic-brain-injury-1356</guid>
      <description>&lt;h2&gt;
  
  
  TLDR;
&lt;/h2&gt;

&lt;p&gt;I used ruby and pointless programming challenges from all over the internet to work on recovering from a Traumatic Brain Injury. &lt;/p&gt;

&lt;h2&gt;
  
  
  What Happened?
&lt;/h2&gt;

&lt;p&gt;On the &lt;em&gt;9/15/2021&lt;/em&gt; I was in a major car accident that my daughter and I will struggle with for the rest of our lives, but I don't want to go into many details about that accident.  While this post has tangential information I'm going to try to focus on keeping it in the technical realm.  That being said I do need to talk about a few injuries.  My injuries are quite severe and I'm currently recovering in a nursing home probably for the next couple months. Over simplifying, I have 2 broken legs, a broken shoulder, and a mild traumatic brain injury.    &lt;/p&gt;

&lt;p&gt;The good thing is I will get over my brain injury, but I have to rehab it just like I would any other limb or muscle. I am over simplifying a lot here, but brain injuries are no joke they can cause you to have a variety of symptoms that could take weeks, months, or years to fix.  For me mental slowness in my cognitive reaction times, dizzy spells, short term memory loss, and frustration at my slowed cognitive reaction times are the symptoms I'm working to rehabilitate.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Am I doing?
&lt;/h2&gt;

&lt;p&gt;I am not a complacent person, I do not take the easy way out of things and I often like to think ahead.  As a software engineer I need to get my problem solving skills back up to snuff.  I began doing what I find comfortable and distractive enough from other pains, solving stupid code problems. Writing solutions to stupid code problems makes me happy, puts my brain to use, and gives me an escape from the physical and emotional traumas that I'm not ready to face yet.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Code Problems
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;These problems are small simplistic things on the internet that most likely have no real world implications.  Most of them I will treat that way and not refactor, the solution you see is many times to first solution I'm writing.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Day 1 (Fake Binary String Problem)
&lt;/h3&gt;

&lt;p&gt;This problem was taken from a prompt sent out by &lt;a href="https://www.codewars.com/"&gt;codewars&lt;/a&gt;.  The goal was to take any numerical string and turn it into a fake binary string by converting numbers to 1's and 0's.  If the number is a 5 or less it is a 0, otherwise it is a 1. &lt;/p&gt;

&lt;p&gt;Let me say that this is no where near any real binary strings and I think we could go further with it to fake it better and make a converter and parser, but I stuck to the original params.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;fake_binary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
  &lt;span class="n"&gt;arry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;new_arry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
  &lt;span class="n"&gt;arry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;int&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; 
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;int&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
      &lt;span class="n"&gt;new_arry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; 
      &lt;span class="n"&gt;new_arry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt; 
  &lt;span class="k"&gt;end&lt;/span&gt; 
  &lt;span class="n"&gt;new_arry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt; 

&lt;span class="n"&gt;bin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fake_binary&lt;/span&gt; &lt;span class="s1"&gt;'113843948'&lt;/span&gt; 
&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;bin&lt;/span&gt; &lt;span class="c1"&gt;# '000100101' &lt;/span&gt;
&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"Solution Correct"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;bin&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"000100101"&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Post Mortem:&lt;/strong&gt; This was a good day 1 project for me, at the time my cognition was much lower and I was still able to put together a quick solution that worked.  At the end of this I had maybe an hour or half hour into it including the time it took to setup a dev environment on the computer I was using.  By the end I was getting dizzy, blurred vision, and my right shoulder (broken) was hurting, but I had a viable solution that worked without any major changes and I had some fun.&lt;/p&gt;

&lt;h3&gt;
  
  
  Day 2 (Longest Word)
&lt;/h3&gt;

&lt;p&gt;This problem was taken from a prompt on &lt;a href="https://edabit.com/challenge/mywAnTMFyvNvD78qT"&gt;eadabit&lt;/a&gt;.  &lt;/p&gt;

&lt;p&gt;The goal is to write a function that finds the longest word in a sentence. If two or more words are found, return the first longest word. I found this task too easy, and know that if it was a realistic task would be to return all the longest words.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;sentences&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s2"&gt;"When we are children we seldom think of the future; This innocence leaves us free to enjoy ourselves as few adults can."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"Finding a needle in a haystack isn't hard when every straw is computerized."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"I decline the title of Iron Cook and accept the lesser title of Zinc Saucier, which I just made up."&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;longest_word_singular&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sentence&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;words&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sentence&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;scan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/[\w']+/&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;words&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max_by&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="ss"&gt;:length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt; 

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;longest_word_multiple&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sentence&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;words&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sentence&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;scan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/[\w']+/&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;sort_by!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="ss"&gt;:length&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;reverse!&lt;/span&gt;
    &lt;span class="n"&gt;max&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;words&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="ss"&gt;:length&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;
    &lt;span class="n"&gt;words&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;select&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;max&lt;/span&gt;&lt;span class="p"&gt;}.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;', '&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt; 

&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;longest_word_multiple&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sentences&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;# innocence, ourselves&lt;/span&gt;
&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;longest_word_multiple&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sentences&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;# computerized&lt;/span&gt;
&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;longest_word_multiple&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sentences&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;# decline, Saucier&lt;/span&gt;

&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;longest_word_singular&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sentences&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;# innocence&lt;/span&gt;
&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;longest_word_singular&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sentences&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;# computerized&lt;/span&gt;
&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;longest_word_singular&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sentences&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;# decline&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Post Mortem:&lt;/strong&gt; I felt a little stronger mentally when dealing with this problem.  I even felt strong enough to look at the at a top level and add to the criteria to push myself a little bit. I don't see any obvious refactors with either function and they seem like viable solutions.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Day 3 (COVID Hand Washing Prompt)
&lt;/h3&gt;

&lt;p&gt;I'm not sure where I pulled this one from, but the prompt is as follows.  The goal write a program that calculates time spent washing hands during the global pandemic.  It takes 21 seconds to wash your hands and help prevent the spread of COVID-19.  In one function calculate the number of times a person washes their hands in a day and number of days they follow this routine.  Use this function to calculate duration in minutes and seconds.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;WASH_TIME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;hand_washing_time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;days&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;washes_per_day&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;seconds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;days&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;washes_per_day&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;WASH_TIME&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;minutes_seconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seconds&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt; 

&lt;span class="c1"&gt;# humanizes the time to something good looking&lt;/span&gt;
&lt;span class="c1"&gt;# i like this result, but when I thought about it I &lt;/span&gt;
&lt;span class="c1"&gt;# was not keeping with the scope&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;humanize_time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seconds&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="no"&gt;Time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;at&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seconds&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;utc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strftime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"%H:%M:%S"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt; 

&lt;span class="c1"&gt;# this is not something I would really want to do&lt;/span&gt;
&lt;span class="c1"&gt;# however this is the scope of the challenge.&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;minutes_seconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seconds&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;mins&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;seconds&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;
  &lt;span class="n"&gt;remainder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;seconds&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;
  &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;mins&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; Mins &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;remainder&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; Seconds spent washing your hands."&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt; 

&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;hand_washing_time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# 11 Mins 12 Seconds spent washing your hands.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Post Mortem:&lt;/strong&gt; This problem was pretty easy, but I have to be honest with myself I kept veering off the path to complete the goals as defined.  I had trouble keeping my mind focused on the task instead of being off coding in tangential sub-tasks.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Day 4 (Matching case but changing string)
&lt;/h3&gt;

&lt;p&gt;This prompt I do not remember where it came from, but the goal was to take a given string and match the input style while changing the output to a different string.  So if the string coming in is lowercase the string coming out would be lower case.  The same would be true for upper or alternating case styles.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;change_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;new_str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"holler"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
  &lt;span class="n"&gt;new_str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;upcase!&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;uppercase?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;new_str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;downcase!&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;lowercase?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;new_str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;alternating_case&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;alternating_even?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;new_str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;alternating_case&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;alternating_odd?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;new_str&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt; 

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;uppercase?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;str&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;upcase&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt; 

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;lowercase?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;str&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;downcase&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt; 

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;alternating_even?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;str&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;alternating_case&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt; 

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;alternating_odd?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;str&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;alternating_case&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt; 

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;alternating_case&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; 
    &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;gsub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/[A-Za-z]/&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;with_index&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;letter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;odd?&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;letter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;upcase&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;letter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;downcase&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;else&lt;/span&gt; 
    &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;gsub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/[A-Za-z]/&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;with_index&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;letter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;even?&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;letter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;upcase&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;letter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;downcase&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt; 
&lt;span class="k"&gt;end&lt;/span&gt; 

&lt;span class="n"&gt;sample&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"somestring"&lt;/span&gt;
&lt;span class="n"&gt;sample2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"SoMe ReAlLy CoOl StRiNg ThAt DoEs SoMeThInG"&lt;/span&gt;
&lt;span class="n"&gt;sample3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"FUNKY MAGIC MAN"&lt;/span&gt;

&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;change_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sample&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# holler&lt;/span&gt;
&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;change_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sample2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# hOlLeR&lt;/span&gt;
&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;change_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sample3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# holler&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Post Mortem:&lt;/strong&gt; A little bit stronger of a problem and more fun of a task, but still pretty easy and pretty pointless.  However the goal is to slowly get my brain working and wrapping around programming tasks so that I can rehabilitate myself.  I will say each day has been a little more progressive and this day was much faster than the days before.  My typing is better, my memory and focus is a little better.  So I would say not only is this a viable solution it shows that I'm getting a little more normal.   &lt;/p&gt;

&lt;h3&gt;
  
  
  DAY 5 and 6 (Developer Productivity Tasks)
&lt;/h3&gt;

&lt;p&gt;I didn't give up on these days, but I was having some pain and there was some definite concentration loss.  I am using a laptop of mine that was setup for different uses, but now that I'm the main user I figure it is okay to setup a development environment.  That being said we had some work todo. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Homebrew&lt;/li&gt;
&lt;li&gt;Use Brewfile to install dependencies&lt;/li&gt;
&lt;li&gt;Check dependencies are working properly&lt;/li&gt;
&lt;li&gt;Install and setup rbenv

&lt;ul&gt;
&lt;li&gt;This includes installing the version of ruby and some gems such as rubocop, rails, and other ones that I use often. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Get text editor up to snuff

&lt;ul&gt;
&lt;li&gt;Installing plugins&lt;/li&gt;
&lt;li&gt;Modifying Settings&lt;/li&gt;
&lt;li&gt;Automatic corrections&lt;/li&gt;
&lt;li&gt;Snippets&lt;/li&gt;
&lt;li&gt;Code Smells Detection&lt;/li&gt;
&lt;li&gt;Rubocop&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Day 6: (Palindromic Primes)
&lt;/h3&gt;

&lt;p&gt;This problem came from hacker rank I believe, but I'm not 100% on that because I had it written down on day 5.  The problem was to define a function that used &lt;code&gt;.lazy&lt;/code&gt; method and returned only numbers that were both prime numbers and palindromes. I took this time to make something that felt more like usable ruby.  Even though the problem ended up being super pointless from a code standpoint and would probably never be seen in a "production code base".&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;PalindromicPrimes&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="vi"&gt;@size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;palindrome_primes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;upto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;Float&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;INFINITY&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;lazy&lt;/span&gt;
     &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;prime?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;palindrome?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
     &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;select&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;is_a?&lt;/span&gt; &lt;span class="no"&gt;Integer&lt;/span&gt;&lt;span class="p"&gt;}.&lt;/span&gt;&lt;span class="nf"&gt;first&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;prime?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;multiple&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;multiple&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;zero?&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
    &lt;span class="kp"&gt;true&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;palindrome?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_s&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reverse&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="nb"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;PalindromicPrimes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="nb"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;palindrome_primes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;inspect&lt;/span&gt; &lt;span class="c1"&gt;# [1, 2, 3, 5, 7, 11, 101]&lt;/span&gt;
&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="nb"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;palindrome_primes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;inspect&lt;/span&gt; &lt;span class="c1"&gt;# [1, 2, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Post Mortem:&lt;/strong&gt; Primes are a bitch to figure out, possibly because the years I've been away from math.  To be honest I googled to figure out how to deal with the primes, but I tried to figure it out only from the Math point of view.  That being said one of the resources I looked at was a JavaScript solution for doing the same thing. I was really disappointed in the fact that I couldn't &lt;code&gt;map&lt;/code&gt; without getting &lt;code&gt;nils&lt;/code&gt; in the array and struggled to find another solution. That is why I had to add the &lt;code&gt;select&lt;/code&gt; so that we weren't getting all the &lt;code&gt;nils&lt;/code&gt; in the final &lt;code&gt;array&lt;/code&gt;.  Overall a much tougher project, but I feel more confident that I did day 1 and I felt like my brain activity was much better.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Closing Thoughts
&lt;/h2&gt;

&lt;p&gt;I don't know if I'm the first person to try to battle  the effects of a Traumatic Brain Injury with programming skills, but I think there is some validity to doing it for those who had the skills prior to having the accident or injury.  I feel like it has given me some confidence in my skills and is working my brain for my eventual return to work. &lt;/p&gt;

&lt;p&gt;I'm going to keep working on some problems, maybe even try to do some work on some open source repositories.  I may even try to do some more writing  to really work my brain and snap myself out of this fog.  &lt;/p&gt;

&lt;p&gt;I think time will be the best way to heal myself, but at least this makes time go by much faster.  Thanks for reading. &lt;/p&gt;

</description>
      <category>ruby</category>
      <category>tbi</category>
      <category>programming</category>
      <category>code</category>
    </item>
    <item>
      <title>Plain Ole Ruby Objects</title>
      <dc:creator>David J. Davis</dc:creator>
      <pubDate>Fri, 30 Apr 2021 12:43:32 +0000</pubDate>
      <link>https://dev.to/ddavisgraphics/plain-ole-ruby-objects-2ek8</link>
      <guid>https://dev.to/ddavisgraphics/plain-ole-ruby-objects-2ek8</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpllzud0c2p1fehxwh6v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpllzud0c2p1fehxwh6v.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TRIGGER WARNING&lt;/strong&gt; &amp;amp;&amp;amp; &lt;strong&gt;TL;DR&lt;/strong&gt; &lt;br&gt;
I think that service objects are sometimes over engineered in Rails, when in fact a plain old ruby object would potentially be better.  If you are using a gem to manage services, presenters, library modules, etc, then maybe you should reconsider and weight what benefits it provides.&lt;/p&gt;

&lt;p&gt;During the Digital Rails Conf this year I watched a video called the &lt;em&gt;&lt;em&gt;The Missing guide to Service Objects&lt;/em&gt;&lt;/em&gt;; &lt;br&gt;
To me this was an opinionated guide to service objects, but he did discuss multiple ways of handling those service objects and some ways to accomplish it for newcomers to Rails.  While it was a great talk I think that my thought process would be refactoring that talk into a "Lets talk about POROs". &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To me the best rails setups do the following:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rails is best used when all things in the Models folder are strictly for setting up and modeling your data, meaning that it directly deals with database data. &lt;/li&gt;
&lt;li&gt;The controllers are simple and reference business logic or models directly.
&lt;/li&gt;
&lt;li&gt;Business Logic is stored in the appropriate name format and is away from the controller logic. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In order to do this you may think, "I need need: #{insert_one}". Service objects, presenters, components, monkey-patches, flying-monkeys, pokémon, modular objects, and widgets.&lt;/p&gt;

&lt;p&gt;You might, but most likely they are going to be plain old ruby objects anyway, so call them whatever the hell you want, just focus on a design pattern that works for you and your team. &lt;/p&gt;
&lt;h1&gt;
  
  
  Why PORO?
&lt;/h1&gt;

&lt;p&gt;To establish why, examine the following code.  A simple class that takes a parameter and runs a perform method.  Putting it simply this is a service object, but it is also a plain old ruby object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Num::SquaredService&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="vi"&gt;@num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt; 

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;call&lt;/span&gt;
    &lt;span class="vi"&gt;@num&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="vi"&gt;@num&lt;/span&gt;  
  &lt;span class="k"&gt;end&lt;/span&gt; 
  &lt;span class="kp"&gt;alias_method&lt;/span&gt; &lt;span class="ss"&gt;:peform&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:call&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Looking at this file inspector.  This assumes that you have access to multiple classes, it determines a type based on a matcher method inside each class.  This file inspector can be a factory, it could be in the lib folder, or references as any other name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;FileInspector::Type&lt;/span&gt;
  &lt;span class="nc"&gt;TYPES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="no"&gt;FileInspector&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="no"&gt;FileInspector&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Audio&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="no"&gt;FileInspector&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Video&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="no"&gt;FileInspector&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="no"&gt;FileInspector&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Pdf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
    &lt;span class="no"&gt;FileInspector&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Other&lt;/span&gt;
  &lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;freeze&lt;/span&gt;

  &lt;span class="c1"&gt;# Sets up mime type instance&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="vi"&gt;@mime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sb"&gt;`file --b --mime-type &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="c1"&gt;# Determines the Type to be used in another object.&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;inspect&lt;/span&gt;
   &lt;span class="no"&gt;TYPES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;matches?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vi"&gt;@mime&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}.&lt;/span&gt;&lt;span class="nf"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;demodulize&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With a few keystrokes this PORO can look a lot like a service object, lets do that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;FileInspector::TypeService&lt;/span&gt;
  &lt;span class="nc"&gt;TYPES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="no"&gt;FileInspector&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="no"&gt;FileInspector&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Audio&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="no"&gt;FileInspector&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Video&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="no"&gt;FileInspector&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="no"&gt;FileInspector&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Pdf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
    &lt;span class="no"&gt;FileInspector&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Other&lt;/span&gt;
  &lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;freeze&lt;/span&gt;

  &lt;span class="c1"&gt;# Sets up mime type instance&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="vi"&gt;@mime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sb"&gt;`file --b --mime-type &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="c1"&gt;# Determines the Type to be used in another object.&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;call&lt;/span&gt;
   &lt;span class="no"&gt;TYPES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;matches?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vi"&gt;@mime&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}.&lt;/span&gt;&lt;span class="nf"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;demodulize&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="kp"&gt;alias_method&lt;/span&gt; &lt;span class="ss"&gt;:peform&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:call&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With that, we now have a service object.  With a few more changes and some HTML we could turn this into a presenter.  My point is that we should be thinking more about the functionality of the object; not the name, or the location of the object in a directory structure.  &lt;/p&gt;

&lt;p&gt;The reason I lean towards keeping them as POROs is to keep everything simple and keep all classes focusing on a single responsibility.  Breaking down big problems to small problems that are easily testable. &lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>objects</category>
      <category>poro</category>
    </item>
    <item>
      <title>Adventures in Ruby</title>
      <dc:creator>David J. Davis</dc:creator>
      <pubDate>Wed, 29 Apr 2020 16:49:36 +0000</pubDate>
      <link>https://dev.to/ddavisgraphics/adventures-in-ruby-5422</link>
      <guid>https://dev.to/ddavisgraphics/adventures-in-ruby-5422</guid>
      <description>&lt;h2&gt;
  
  
  TLDR;
&lt;/h2&gt;

&lt;p&gt;If you have used include? on an array while evaluating comparisons then you may want to look at sets instead!  &lt;/p&gt;

&lt;h2&gt;
  
  
  INTERLUDE
&lt;/h2&gt;

&lt;p&gt;Before we set off on our quest for knowledge we have to know why this quest is so important.  We are not going to be saving a princess from a burning building, but instead 17 million princesses from a select 500 thousand burning buildings. (Truth be told there is no fire in this, but I wanted to add a bit of excitement to the story) &lt;/p&gt;

&lt;p&gt;I was recently tasked with parsing a CSV file that had over 17 million records in the file and was roughly 8GB.  When given the params I initially said "no problem, that would be a welcomed 2-hour break from my other project".  I would soon regret those words when I downloaded the files to see that I needed to combine fields from file A which contained roughly 17.9 million records and file B which contained the IDs for 500 thousand records along with some other data that had already been manually by someone.  &lt;/p&gt;

&lt;h2&gt;
  
  
  THE BATTLES
&lt;/h2&gt;

&lt;p&gt;My first attempt, was not pretty because of my prior experience with modifying CSVs.  I had not had to modify anything larger thank 50k items at most, which is 1/10 of the smallest dataset in this task.  &lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;My second attempt was feeling around how to parse the data properly and then trying to parse the biggest files.  Again it proved to be a failure, but lead me to the correct way of parsing files, just not the correct way of dealing with that much data.  &lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;My third attempt was a step in a positive direction, giving me the appearance that I was doing things in a better way, however, looking back at it I added un-needed complexities that hurt the performance rather than boosted it.  The concept was simple, create a list of item ID's then be sure there are no duplicates, and finally iterate through the largest file only performing modifications on data that was needed in the final iteration.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;My fourth attempt was another positive step because it de-dupped the number of records in the largest file, only processing the ones that need to be processed, but does that inherently add performance.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Looking at both the third and fourth attempts I did fall into a Ruby trap here, instead of thinking in terms of data I was thinking in terms of ruby weaponry.  Knowing what I could accomplish easily with Arrays and not looking at that as a potential downfall.&lt;/p&gt;

&lt;p&gt;My fifth attempt, well there were many more than 5 attempts, but let us assume for this article that I was smart enough to only do it in 5 attempts with the help of StackOverflow. Basically I got smarter in handling my hashes, writing CSV, and switching to sets for comparisons as recommended from StackOverflow. &lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;This attempt is the attempt that saved all the princesses and put out the fires without even blinking.  Before attempt 5 the maximum amount of time I let the script run was about 5 days because of a long weekend. That is an enormous amount of time, but after attempt 5 reprocessing took 7-10 minutes.  It made me feel ill, but also very happy.  &lt;/p&gt;

&lt;h2&gt;
  
  
  WEAPON ANALYSIS
&lt;/h2&gt;

&lt;p&gt;My first mistake was unfamiliarity with large datasets leading me down the road to being decapitated by the big O notation dragon who guarded the princesses.  Moreover, it reveals that when programming I need to be more cognizant of more performant processes and not just default to things I've done in the past.&lt;/p&gt;

&lt;p&gt;Ruby is like having a locker of ready to go weapons that can accomplish tasks quickly, but instead of saving the princesses with my awesome sword of justice, I cut my arm off. It wasn't me who realized this though, it was a user(Casper) on StackOverflow who pointed out my mistake.  &lt;/p&gt;

&lt;p&gt;My approach was to use an array of items to check for inclusion which in my given subset of objects was going to be a minimum of 500,000 each time I went over a single record in the 17 million records, but in fact I was doing this twice with processed items, so that was growing the number of checks which at its smallest amount was 500,000 and largest was 1 million. This means that 17 million records made a million checks on objects before it ever did any actual processing. Benchmark testing on these items showed me the error of my ways and showed me that the script as I had it in iteration 4 would have finished in 156 days. &lt;/p&gt;

&lt;p&gt;I can't blame Ruby, it was doing exactly what I told it to do. Instead I need to blame myself for not thinking of performance in such a simple little script.  I can blame in-experience, but I think the biggest thing to look at is the ruts of everyday programming.  As a junior developer, you get things working and just try to get by figuring things out, as a senior level developer you need to look more at performance, maintainability, and reliability. In that same retrospect you need to get out of the ruts you may have developed through your working life.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing Numbers Arrays VS Sets
&lt;/h2&gt;

&lt;p&gt;I wanted to see what this comparison of sets vs arrays in comparing simple numbers such as an ID.  I wrote a simple benchmark test and ran it similarly to running the other script just to see the output or performance of set vs array.  In comparisons sets are 14 times faster than arrays and I find that quite amazing!  &lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


</description>
      <category>ruby</category>
      <category>csv</category>
      <category>bigdata</category>
      <category>arrays</category>
    </item>
    <item>
      <title>My Ruby Conf 2019</title>
      <dc:creator>David J. Davis</dc:creator>
      <pubDate>Sun, 24 Nov 2019 15:59:12 +0000</pubDate>
      <link>https://dev.to/ddavisgraphics/my-ruby-conf-2019-40lf</link>
      <guid>https://dev.to/ddavisgraphics/my-ruby-conf-2019-40lf</guid>
      <description>&lt;h1&gt;
  
  
  Nashville Ruby Conf 2019
&lt;/h1&gt;

&lt;p&gt;Conferences are a great time to reflect on past, future, and present work. This year’s Ruby conference was a great time that included lots of learning, reflection, and auspicious gratitude for my employment and my employer. I really enjoyed the diversity of people that I met at Ruby Conf this year. From the young ladies that had just finished a coding boot camp, to the people who worked at Shopify, a couple of people who work for Pixar, the young man from Sentry who was really interested in what the Libraries does, the excellent speakers, attendees that I merely talked to as we waiting for the keynotes to start, and even community members who worked in other University Libraries.  &lt;/p&gt;

&lt;h2&gt;
  
  
  The Keynotes
&lt;/h2&gt;

&lt;p&gt;Matz gave the opening keynote and started us off with some good insight into the future of Ruby including the features that will be added/removed from Ruby 2.7 and Ruby 3.0.  This discussion was even enhanced further by the third day’s Q/A session with Matz.  No matter how much Aaron Patterson wants an emoji-based pipeline operator, it will not go into the next release of Ruby (a joke probably better suited for those who attended the Q/A session).  The goal for Ruby in the future is to continue to grow as a community and add features that still make the language fun to work with, but also provide the functionality of the other popular languages (Haskell, Elixir, Python, JavaScript).&lt;/p&gt;

&lt;p&gt;The other keynotes tended to be a bit political/socially driven, and less technical which seemed off-putting to me, except for the one delivered by Sandi Metz. While I was expecting a technical talk that hinged on object-oriented programming in Ruby; instead I was left floored by a talk about economic dispersity, government intervention in free market that lead to socio-economic inequality, student loan debt, housing loan debts, and an apology by a boomer who was sorry for not recognizing what needed to change.  This talk was very brave, passionate, and not a maligning to any one person’s political opinions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Metaprogramming
&lt;/h2&gt;

&lt;p&gt;Metaprogramming was a very interesting topic that was included in a few topics.  Some suggesting metaprogramming for good some, others referencing the more sinister side of metaprogramming. One of the more interesting thoughts and practices with metaprogramming including creating monkey patches to trace bugs. I found this an interesting thought as you can write something that essentially tells you what the problem is in great detail and allows you to fix it in a much faster way than traditional debugging.  Another facet was in the ability to make gems for older and newer versions of Ruby by using it to create a “polyfills” for lack of a better term for newer Ruby functionality.  Another talk even referenced creating functionality achieved by functional programming languages in Ruby to do very terrible things (those naughty lemurs see functional programming for more).  &lt;/p&gt;

&lt;h2&gt;
  
  
  Functional Programming
&lt;/h2&gt;

&lt;p&gt;There are some interesting things that can be done with functional programming in Ruby.  Ruby is an object-oriented programming language, but that is not to say you can use functional programming inside of Ruby.  One speaker demonstrated how well written functional programming and well written object-oriented programming tend to look similar because of the single responsibility principle which states that a function or method should only have one responsibility.  If you find that your functions do not look as they would in a functional language then you are probably breaking that rule.  There are even functions currently in Ruby (lazy, curry, recursive!) that lend a hand to functional programming.  Another speaker was very entertaining about his approach to functional programming issues telling a story of a curious lemur who uses concepts from other functional programming languages to do very bad and dangerous things within Ruby.  This was more hypothetical things you probably would not do in a serious project but could have merit in trying to find ways to speed up your program in some ways.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Memory Management
&lt;/h2&gt;

&lt;p&gt;A few talks spoke to memory management and parallel programming in Ruby.  It looks like things will only get better and better with Ruby moving forward and I’m really excited about performance boosts in Ruby 3. I was happy to get some good tips about setting an environmental variable to set the maximum number of GCC arenas in ruby that helps to speed up all Ruby/Rails applications.  &lt;code&gt;MALLOC_ARENA_MAX=2&lt;/code&gt; Another talk leads me to believe that it would be better to use jemalloc to handle the garbage collection and RAM management, but that would require a little more work to get working properly.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Computer Science Concept
&lt;/h2&gt;

&lt;p&gt;Without getting too technical here there were some common computer science problems that were discussed with Ruby examples.  Sorting algorithms, Big O notation, and other things that are known as “computer science common knowledge essential to programming”.  At the end of it there was a consensus of many of the speakers to say this is good to know, but not required for programming, however, you still get asked these questions in interviews.  Not really lumped in with computer science concepts but something really cool and nerdy in the computer science realm was a talk where a person worked to create Ruby on an Apple 2 computer using byte code or assembly language.  It was a really awesome interactive presentation that had a ton of work involved in creating it which really goes to show you how versatile programmers can be but also showcasing the passion Ruby developers have for wanting to use Ruby in a variety of platforms.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This was a great conference and this writeup has gone way over my short succinct thought process of “giving the highlights”, but I still feel I have barely scratched the surface.  Hearing others having similar problems and struggles that you face with tools you commonly use is a really empowering thing to have to happen.  It helps to validate the inner thoughts most developers have at one point in a project such as “I’m not a total idiot” and “I’m on the right track”. &lt;/p&gt;

&lt;h2&gt;
  
  
  Side Note &lt;em&gt;(maybe ranting)&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;Many people think that ruby is “dead”, “dying”, and “Just limping along”.  I say that is not that case, there are many new startups kicking off each year.  Rails continues to grow and gain traction among startups and people who need to create things quickly.  I'm noticing substantial activity around the integration with Webpack, React, Stimulus, and other frontend tooling and JS libraries. To illustrate how not dead ruby continues to be, here is a list of people who were looking to hire Ruby developers at Ruby Conf 2019.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ActBlue&lt;/li&gt;
&lt;li&gt;AdHawk&lt;/li&gt;
&lt;li&gt;Airbnb&lt;/li&gt;
&lt;li&gt;Anvyl&lt;/li&gt;
&lt;li&gt;Appriss&lt;/li&gt;
&lt;li&gt;BackerKit&lt;/li&gt;
&lt;li&gt;Bendyworks&lt;/li&gt;
&lt;li&gt;Braintree&lt;/li&gt;
&lt;li&gt;Cookpad&lt;/li&gt;
&lt;li&gt;CoverMyMeds&lt;/li&gt;
&lt;li&gt;def method&lt;/li&gt;
&lt;li&gt;Doximity&lt;/li&gt;
&lt;li&gt;E&amp;amp;E NEWS&lt;/li&gt;
&lt;li&gt;Envoy&lt;/li&gt;
&lt;li&gt;ezCater&lt;/li&gt;
&lt;li&gt;Finalsite&lt;/li&gt;
&lt;li&gt;Fleetio&lt;/li&gt;
&lt;li&gt;Flexport&lt;/li&gt;
&lt;li&gt;Fullscript&lt;/li&gt;
&lt;li&gt;General Dynamics&lt;/li&gt;
&lt;li&gt;Global Impact&lt;/li&gt;
&lt;li&gt;Gravitational&lt;/li&gt;
&lt;li&gt;Guild Education&lt;/li&gt;
&lt;li&gt;Hover&lt;/li&gt;
&lt;li&gt;Invoca&lt;/li&gt;
&lt;li&gt;Justworks&lt;/li&gt;
&lt;li&gt;Kenna Security&lt;/li&gt;
&lt;li&gt;Mastery Logistics Systems&lt;/li&gt;
&lt;li&gt;Movable Ink&lt;/li&gt;
&lt;li&gt;Nava PBC&lt;/li&gt;
&lt;li&gt;Nexmo&lt;/li&gt;
&lt;li&gt;Nikola&lt;/li&gt;
&lt;li&gt;OMBULABS&lt;/li&gt;
&lt;li&gt;OneMain Financial&lt;/li&gt;
&lt;li&gt;One Medical&lt;/li&gt;
&lt;li&gt;Optoro&lt;/li&gt;
&lt;li&gt;Planet Argon&lt;/li&gt;
&lt;li&gt;Privia Health&lt;/li&gt;
&lt;li&gt;RAMSEY Solutions&lt;/li&gt;
&lt;li&gt;ReviewTrackers&lt;/li&gt;
&lt;li&gt;Runtastic&lt;/li&gt;
&lt;li&gt;Shopify&lt;/li&gt;
&lt;li&gt;Simply Business&lt;/li&gt;
&lt;li&gt;Snapdocs&lt;/li&gt;
&lt;li&gt;SportsEngine&lt;/li&gt;
&lt;li&gt;Springbuk&lt;/li&gt;
&lt;li&gt;Street Easy&lt;/li&gt;
&lt;li&gt;Stripe&lt;/li&gt;
&lt;li&gt;Square&lt;/li&gt;
&lt;li&gt;Test Double&lt;/li&gt;
&lt;li&gt;thoughtbot&lt;/li&gt;
&lt;li&gt;Tidelift&lt;/li&gt;
&lt;li&gt;TrueCar&lt;/li&gt;
&lt;li&gt;Upstart&lt;/li&gt;
&lt;li&gt;Vimeo&lt;/li&gt;
&lt;li&gt;VisuWell&lt;/li&gt;
&lt;li&gt;Vynyl&lt;/li&gt;
&lt;li&gt;Zillow&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ruby</category>
      <category>rubyconf</category>
      <category>gratitude</category>
      <category>techtalks</category>
    </item>
  </channel>
</rss>
