<?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 Dwayne Cox on Medium]]></title>
        <description><![CDATA[Stories by Dwayne Cox on Medium]]></description>
        <link>https://medium.com/@dwayneedwardcox?source=rss-3e8a93f00f1a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*6SVIw3GY-SdR4wS1.</url>
            <title>Stories by Dwayne Cox on Medium</title>
            <link>https://medium.com/@dwayneedwardcox?source=rss-3e8a93f00f1a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 05:45:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dwayneedwardcox/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[Send in the Clowns’… hats!]]></title>
            <link>https://medium.com/@dwayneedwardcox/send-in-the-clowns-hats-43a57bdf9aba?source=rss-3e8a93f00f1a------2</link>
            <guid isPermaLink="false">https://medium.com/p/43a57bdf9aba</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Dwayne Cox]]></dc:creator>
            <pubDate>Sun, 24 Jun 2018 23:19:39 GMT</pubDate>
            <atom:updated>2018-06-28T23:28:00.489Z</atom:updated>
            <content:encoded><![CDATA[<p>Where are the clowns’… hats?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*SSv4LuHtqacHo1_uhTrWhA.jpeg" /></figure><p>Recently we learned about embedding ruby code in HTML, a file name to show all items available for sale in an eCommerce site likely to be called index.html.erb for example…</p><p>Let’s play, find the clown hats!</p><pre>&lt;div&gt;</pre><pre>  &lt;%= form_tag “/client/products”, method: :get do %&gt;</pre><pre>    &lt;input type=”text” name=”search”&gt;</pre><pre>    &lt;input type=”submit” value=”Name Search”&gt;</pre><pre>  &lt;% end %&gt;</pre><pre>  &lt;a href=”/client/products/?price_sort=true”&gt;Sort by price&lt;/a&gt;</pre><pre>&lt;/div&gt;</pre><p>&lt;% tags = clown hats!; or skull tags or… whatever depending on who you ask or where you look…</p><p>Ultimately they allow one to code into HTML useful Ruby logic as seen above, for example the ability to use a form and search or sort, or a litany of other useful features in say an Amazonian online shopping experience etc…</p><p>In the world of Public Relations, score one for the clowns, who have been getting abused in the public forum in recent years… A Penny(wise) for your thoughts?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43a57bdf9aba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Truthy or Dare!]]></title>
            <link>https://medium.com/@dwayneedwardcox/truethy-or-dare-abdf0bbbd19d?source=rss-3e8a93f00f1a------2</link>
            <guid isPermaLink="false">https://medium.com/p/abdf0bbbd19d</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[boolean]]></category>
            <dc:creator><![CDATA[Dwayne Cox]]></dc:creator>
            <pubDate>Sat, 09 Jun 2018 05:31:31 GMT</pubDate>
            <atom:updated>2018-06-09T05:50:56.285Z</atom:updated>
            <content:encoded><![CDATA[<p>There are only 26,000 polar bears remaining, how’s that for an icebreaker? <a href="https://polarbearsinternational.org/"><em>https://polarbearsinternational.org</em></a></p><p><em>&amp;&amp; </em>for a very cold segue way into coding…</p><p>In the Procedural coding world of yesteryear, I don’t recall ever seeing syntax like “ If 5 then” because it would have been a compile time error… Yes we compiled everything then… Fast forward to “today’s” Ruby lesson regarding Booleans, when queried by the Instructor on what “ If 5 then” would equate to, I was thinking where’s the variable...</p><p>Ladies and gentlemen, welcome in the two too cute words of “truthy” and “falsey”. The ramifications of their use in Ruby I find fun and will share an example!</p><p>The summary from class was everything is “true or truthy” except the values of false and nil, as demonstrated by: <a href="https://gist.github.com/jfarmer/2647362">https://gist.github.com/jfarmer/2647362</a></p><p><em>Truthy and Falsey in Ruby by CodeUnion, Inc is licensed under a Creative Commons Attribution 4.0 International License.</em></p><pre>def truthy_or_falsey value<br> if value<br>   puts “#{value.inspect} is truthy”<br> else<br>   puts “#{value.inspect} is falsey” <br> end<br>end</pre><pre>[false, nil, true, Object, 0, 1, “”, [], {}].each do |value|<br> truthy_or_falsey(value) end</pre><p>So the code below in the udpate method, (erb and code dry lessons came later), shows the fun use of falsey logic to write useful code. The update which reads, if you pass me a specific parameter I will update the database as such, if not then keep the value(s) we already had in the database as stored in our instance variables from the get record retrieval.</p><p>e.g. in the Controller for a database update</p><pre>def update<br> <a href="http://twitter.com/product">@product</a> = Product.find_by(id: params[:id])<br> <a href="http://twitter.com/product">@product</a>.name = params[:name] || <a href="http://twitter.com/product">@product</a>.name<br> <a href="http://twitter.com/product">@product</a>.price = params[:price] || <a href="http://twitter.com/product">@product</a>.price <br> <a href="http://twitter.com/product">@product</a>.description = params[:description || <a href="http://twitter.com/product">@product</a>.description]<br> <a href="http://twitter.com/product">@product</a>.save<br> render “show.json.jbuilder”<br>end</pre><p>So in the old wild west of coding, the above would have needed a different approach with multiple nested if’s, in today’s Ruby it’s fairly elegantly handled as shown. Why? Because where the update params are nil because they’re not being passed, the code bounces to the right of the “or || ” since nil equates to false. Then the code keeps the values already stored in the database instead of the record getting overwritten with nils. Truethy or Falsey?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SXyp39pmoiygbh8eG3Feag.jpeg" /></figure><p><a href="https://unsplash.com/@loklok"><em>https://unsplash.com/@loklok</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abdf0bbbd19d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[*Asterisk]]></title>
            <link>https://medium.com/@dwayneedwardcox/asterisk-d2b0d440842c?source=rss-3e8a93f00f1a------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2b0d440842c</guid>
            <category><![CDATA[autonomy]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Dwayne Cox]]></dc:creator>
            <pubDate>Sat, 26 May 2018 18:03:20 GMT</pubDate>
            <atom:updated>2018-05-26T18:03:20.322Z</atom:updated>
            <content:encoded><![CDATA[<p>Well Nancy, he said, sounding like Clint Eastwood trying to do a Ronald Reagan impression, I’m waaaaaay outside of my comfort zone in blogging. I’m choosing to comply in my own way with my coding camp’s request to blog, realizing a few things… I am prone to run ons and Squirrel, and will choose to leave most as such, despite being an Editor at one point. (This just in this coding camp began April of 2018-Squirrel!)</p><p>In my head, blogging means just share, be vulnerable, and I’ve said it before and I’m sure it’s in the ethos, that the best part of life is lived outside one’s comfort zone.</p><p>I’ve learned to try and not outthink motives knowing from experience, often times there are unknown benefits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fw3nZec06q_C3SJLGJcH8w.jpeg" /><figcaption><a href="http://simonmigaj.com/">http://simonmigaj.com</a></figcaption></figure><p>This is a true beginning, and as such I’m just going with mostly, a ubiquitous life lesson rather than an attempt to dazzle with tricks to use in blogging via Medium.</p><h3><strong>*Lesson: be autonomous until it proves (highly) inefficient</strong></h3><p>Recently, I wrote a “Today I learned” post, (unpublished), that I titled “Today I remembered” on Github, regarding how great it is when you don’t ask for help and you have that wicked relieving smack of confidence when one gets a program running for the first time. Rocky (yes he’s Bullwinkle’s squirrel friend) wanted me to share that autonomy is a theme the Coding Camp imparts as well ;) And we’re back… This was the first project where we were asked to break one Ruby file with 3 classes, one module and operational commands into separate files. After trying several things including much research on stackoverflow and ruby-doc.org, I wanted to ask for help, but said no, I’m not on the clock and this is a potential watershed moment in my second iteration of being a coder again. So, I started over with the original file, I surprisingly discovered it had a bug, so I fixed it, got it running, then followed the coding camps tutorials on how to break out and run the files, and fairly quickly, had my Charlie Sheen moment… Winning! Pardon, I might as well roll around in that again… ahhhhhhhhh!!!</p><p>What’s with the *asterisk, it’s coming I assure you ;)</p><p>This leads me to how I got the courage to start a career in coding in the late 90’s. No, not the 1890s… I was an Editor as mentioned above, but the thrust of the position was being a technical set up person between Marketing and Programming. While working with the Programmers actually setting up and seeing the code, I realized I can run and even run past some of these folks. I did just that after going to an Oracle Coding Camp. The firm, who was eventually bought by GE, offered me a position as a Programmer/Analyst for shop.com. Somewhere in the early days, one of the kindest, most generous, intelligent Programming colleagues I’ve ever know, had what seemed like a meltdown where he raised his voice significantly and said, when I asked him a question, “YOU CAN FIGURE IT OUT ON YOUR OWN!”. It stung, but it’s never left, and it changed me for the better that very day.* This was the beginning, but as my career evolved there was still room for improvement on autonomy, let’s be honest it is typically veiled laziness and/or seeking quicker intellectual pain relief.</p><p>A mentor, echoed these *be autonomous words continuously over the years. I evolved to as far as any employee I knew for figuring things out on my own, feeling alone in that regard quite frankly most of the time.</p><p>Back to our *asterisk mystery… I spent some years after Coding, in Technical Support and several facets of Data, including my most recent Data position which was outsourced to India officially Jan 2, 2018. (blessing in a squirrel disguise?) During some exit conversations with my most recent Boss, a pretty solid guy, he said Dwayne…</p><p>you really need to learn to be less *autonomous.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2b0d440842c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Today I became an extra large Medium user!]]></title>
            <link>https://medium.com/@dwayneedwardcox/today-i-became-an-extra-large-medium-user-8707beac382a?source=rss-3e8a93f00f1a------2</link>
            <guid isPermaLink="false">https://medium.com/p/8707beac382a</guid>
            <dc:creator><![CDATA[Dwayne Cox]]></dc:creator>
            <pubDate>Sun, 13 May 2018 21:36:00 GMT</pubDate>
            <atom:updated>2018-05-13T21:36:00.290Z</atom:updated>
            <content:encoded><![CDATA[<p>Today I became an extra large Medium user!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8707beac382a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>