<?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 Frank DelPidio on Medium]]></title>
        <description><![CDATA[Stories by Frank DelPidio on Medium]]></description>
        <link>https://medium.com/@Fdel15?source=rss-49adfba12d55------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*T_xKb4-oIwiNRBwS6XJEjg.jpeg</url>
            <title>Stories by Frank DelPidio on Medium</title>
            <link>https://medium.com/@Fdel15?source=rss-49adfba12d55------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 15:11:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Fdel15/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[TIL ActiveRecord::Persistence#destroyed?]]></title>
            <link>https://medium.com/@Fdel15/til-activerecord-persistence-destroyed-d286f8630959?source=rss-49adfba12d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/d286f8630959</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[ruby-on-rails-development]]></category>
            <dc:creator><![CDATA[Frank DelPidio]]></dc:creator>
            <pubDate>Fri, 28 Dec 2018 03:35:41 GMT</pubDate>
            <atom:updated>2018-12-28T03:35:41.403Z</atom:updated>
            <content:encoded><![CDATA[<p>Today my <a href="https://www.codetriage.com/">CodeTriage</a> email sent me on a journey into <a href="https://github.com/rails/rails/blob/4ae8d6182fd9351b9451003f9380d8855f3f5a94/activerecord/lib/active_record/persistence.rb">ActiveRecord’s Persistence module</a>. I learned that this module is responsible contains the code for methods I frequently use when creating Models in my Rails app including `create`, `update`, `delete`, and `destroy`.</p><p>Pop Quiz:</p><p>When you want to remove data from your database should you use `delete` or `destroy`?</p><p>Answer:</p><p>It depends.</p><p>If you need callbacks to run then you should use `destroy`. If you do not care about callbacks then you should use `delete` because it is often much faster. `destroy` instantiates an object before it deletes it which allows cleanup methods and other actions to be run. `delete` is the equivalent of using a SQL delete statement and returns the number of rows delated.</p><p>The `<a href="https://github.com/rails/rails/blob/4ae8d6182fd9351b9451003f9380d8855f3f5a94/activerecord/lib/active_record/persistence.rb/#L241">destroyed?</a>` method isn’t terribly interesting. It calls a method and then returns the instance variable `<a href="http://twitter.com/destroyed">@destroyed</a>`. The method that it calls is `sync_with_transaction_state` which sounded interesting so I decided to learn more about what this method does.</p><p>`<a href="https://github.com/rails/rails/blob/master/activerecord/lib/active_record/transactions.rb#L471">sync_with_transaction_state</a>` is defined in the `<a href="https://github.com/rails/rails/blob/master/activerecord/lib/active_record/transactions.rb">transactions.rb</a>` file. I was pleased to find documentation for this method which states</p><blockquote>This method checks to see if the ActiveRecord object’s state reflects<br>the TransactionState, and rolls back or commits the Active Record object<br>as appropriate.</blockquote><p>I got a bit lost exploring `<a href="https://github.com/rails/rails/blob/master/activerecord/lib/active_record/transactions.rb">transactions.rb</a>` and `<a href="https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb">transaction.rb</a>` trying to follow how ActiveRecord manages the record object’s state and decides whether or not to commit or rollback a transaction. Sometime in the future I will open rails console and step through the code with an example to help connect the missing dots.</p><p>Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d286f8630959" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Coding Resources]]></title>
            <link>https://medium.com/@Fdel15/coding-resources-e9fc7d068879?source=rss-49adfba12d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9fc7d068879</guid>
            <category><![CDATA[podcast]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Frank DelPidio]]></dc:creator>
            <pubDate>Wed, 22 Feb 2017 12:53:28 GMT</pubDate>
            <atom:updated>2017-02-22T12:53:28.053Z</atom:updated>
            <content:encoded><![CDATA[<p>The internet is full of information about computer science and programming. This post is my curated list of resources. I plan on keeping this post up to date with the resources I am currently using so if you have any recommendations I would love to hear from you.</p><h3>Podcasts</h3><p><a href="https://devchat.tv/ruby-rogues"><strong>Ruby Rogues</strong></a><strong> — </strong>An interview style podcast that covers a broad range of topics but is usually focused on Ruby/Ruby on Rails. They consistently put out a new 1 hour episode each week that is well edited.</p><p><a href="https://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;ved=0ahUKEwi5wYrT45zSAhWGQiYKHWfXCy0QFggcMAA&amp;url=http%3A%2F%2Fwww.codenewbie.org%2F&amp;usg=AFQjCNGRqpgT9WKqiOVOXJCjCfvkwzmHYA&amp;sig2=7MobiY3E0qjuqK07v0Mvpw"><strong>Code Newbie</strong></a><strong> — </strong>An interview style podcast hosted by a coding bootcamp graduate. The guests cover a wide range of topics but are all aimed toward people who are just learning how to code. There is an entire Code Newbie community built around the podcast and learning how to code.</p><p><a href="https://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;sqi=2&amp;ved=0ahUKEwir6f3c45zSAhXPaCYKHfChCx8QFggaMAA&amp;url=http%3A%2F%2Fretrobits.libsyn.com%2F&amp;usg=AFQjCNEiKQ_JW4KV9HzwPMcOCtckk7TJLA&amp;sig2=pF4LvqPEPiLakk5IMdxYBg&amp;bvm=bv.147448319,d.eWE"><strong>The Retrobits Podcast </strong></a><strong>— </strong>A story telling style podcast that stopped releasing new episodes in 2015. The host is a well seasoned technology professional and he deep dives into topics mainly related to hardware. I recently listened to his two episodes about the C programming language and the Unix operating system. I enjoyed the depth of his research and little anecdotes he could add when talking about the history of these technologies.</p><p><a href="http://5by5.tv/rubyonrails"><strong>Ruby on Rails Podcast</strong></a><strong> — </strong>An interview style podcast about Ruby on Rails, open source, and the programming profession. There is over 200 episodes that have been full of great content. New episodes are still being created but not on any type of regular schedule.</p><p><a href="http://www.se-radio.net/"><strong>Software Engineering Radio</strong></a><strong> — </strong>An interview style podcast that has a variety of hosts. The hosts all have strong foundations in computer science and software engineering. I’ve only listened to a few episodes so far, but they tend to take a deep dive on a narrow technical topic.</p><p><strong>On My Radar</strong></p><p>I have not listened to these podcasts yet but I am listing them here for future reference.</p><p>1. <a href="https://changelog.com/podcast">The Changelog</a><br>2. <a href="https://softwareengineeringdaily.com/">Software Engineering Daily</a><br>3. <a href="http://giantrobots.fm/">Giant Robots Smashing Into Other Giant Robots</a></p><h4>Technical Blogs</h4><p><a href="https://overflow.buffer.com/"><strong>Buffer</strong></a><strong> — </strong>I love Buffer because they are completely transparent about everything. <a href="https://open.buffer.com/transparency-movement/">And I mean everything</a>. Their technical blog has a lot of interesting posts about the different technologies they are using and design decisions they make.</p><p><a href="https://codeascraft.com/"><strong>Etsy</strong></a><strong> — </strong>I started reading their “Code as Craft” blog after a co-worker linked me to a post about <a href="https://medium.com/@Fdel15/blameless-post-mortem-af021f71c1d0#.fjxbjj9oe">Blameless Post Mortem</a>. The posts are very detailed, easy to follow, and cover a broad range of topics.</p><h4>Screencasts</h4><p><a href="https://twit.tv/shows/coding-101"><strong>Coding 101</strong></a><strong> — </strong>A weekly instructional, project oriented programming show for beginner to intermediate programmers. The show was hosted on Twit by a priest! They currently are not making any new episodes, but they have over 100 episodes covering a wide range of topics.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9fc7d068879" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Midlevel Programmer]]></title>
            <link>https://medium.com/@Fdel15/the-midlevel-programmer-3f400d736cbb?source=rss-49adfba12d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f400d736cbb</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Frank DelPidio]]></dc:creator>
            <pubDate>Thu, 16 Feb 2017 11:21:31 GMT</pubDate>
            <atom:updated>2017-02-16T11:21:31.835Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MqPW9uT_ezW6g5WgWehqmg.png" /></figure><p>I like to think my coding journey officially began September 15th, 2014. I had built a few websites on Word Press before then but I was at the mercy of their GUI and had absolutely no idea how anything worked. That really bothered me. I was using the internet every day, and yet how it worked was a black box to me. On this day, all of that began to change because it was my first day at Dev Bootcamp.</p><p>This is one of the best decisions I have ever made in my life. I moved from my Mom’s basement to New York City, met some of my closest friends, and developed a core set of skills to transition from an unfulfilling just-grind-it-out-because-nobody-likes-their-job to an exciting-always-evolving-creative-problem-solving-some-people-think-it’s-magic-career as a Programmer.</p><p>It wasn’t a smooth transition. Getting my first programming job was tough. After graduating from the bootcamp I got rejected by 12 different companies in the New York/Philadelphia area. I was able to make ends meet by landing a few freelancing jobs while I continued to learn and hone my craft. In my last freelancing gig, I created the <a href="https://www.codecademy.com/learn/learn-sql">Learn SQL course at Codecademy</a>. This led me to my current job as a Programmer in Boston where I work with SQL Server and Ruby on Rails applications.</p><p>I’ve been at my current company for over a year and I’m beginning to wonder if it’s time for a change. My current company is a nice place to work, and I have learned a lot over the past year, but I feel stuck. How do you make the transition from a Junior Programmer to a Midlevel Programmer?</p><p>Maybe a better question is, how do you define the difference between a Midlevel Programmer and a Junior Programmer? My current company seems to think years of experience is the most important (or maybe the only) metric that matters, but I reject this idea. The metric that should matter most is how much value do you add to the company?</p><p>In baseball, they have a statistic called <a href="https://en.wikipedia.org/wiki/Wins_Above_Replacement">Wins Above Replacement Player (WARP)</a>. This statistic measures a players value to the team relative to the value the average replacement player would provide. If your team’s starting shortstop were to get injured, the team wouldn’t play without a shortstop. A bench player would come in and take his place. This statistic allows you to quantify exactly how much production is lost between the starter and the bench player.</p><p>I wonder what a similar statistic would look like for Programmers. I know I’m not nearly as valuable as the Senior Engineers in our company who built most of our applications and understand every detail and design decision (especially the ones that are not documented). At the same time, I believe my skill set is more valuable than co-workers who have been at the company longer and/or in Tech longer than I have.</p><p>Experience is one factor to use when measuring a Programmer’s WARP, but what I lack in experience I more than make up for in my tenacity to never give up on a problem, the ability to learn quickly, communication skills, and an unquestionable work ethic. How do you quantify these skills? I am the model employee my boss tells new hires to replicate. In my yearly review, I was told how valuable I was because they can’t just go out and hire someone else like me. But the company still views (and pays) me like every other Junior Programmer.</p><p>The dilemma I find myself in is that there does not seem to be a path from where I currently am to a Senior Engineer position. When positions open up, the company hires externally because they are the only people with the experience they feel is necessary to fill these positions. It’s a frustrating situation to be in.</p><p>I feel like I have three options moving forward:</p><ol><li>Cut back from working 50hrs/week to 40hrs/week at my current job and use the 10hrs (as well as weekends) to work on side projects, participate in open source contributions, and take online classes to gain the experience I am not getting from my day job.</li><li>Double down at work and increase from 50hrs/week to 60hrs/week. I have begun taking on more responsibility and creating small projects for myself to work on. The problem is that these projects can’t interfere with my other daily work so I would need to add more time to get everything done.</li><li>Be the cliche Junior Programmer who leaves their first company after 1 year.</li></ol><p>What choice would you make if you were in my situation? Is there a 4th option I’m not even thinking of right now? Have you made the transition from Junior to Midlevel or Senior Engineer? If so, how did you get there?</p><p>I would love to hear from you. Please contact me on Twitter or Email or in the comments below if you have any comments or suggestions.</p><p>Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f400d736cbb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blameless Post Mortem]]></title>
            <link>https://medium.com/@Fdel15/blameless-post-mortem-af021f71c1d0?source=rss-49adfba12d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/af021f71c1d0</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[blameless-post-mortem]]></category>
            <dc:creator><![CDATA[Frank DelPidio]]></dc:creator>
            <pubDate>Wed, 15 Feb 2017 11:31:55 GMT</pubDate>
            <atom:updated>2017-02-15T11:31:55.609Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*wD7sYTq-XSybGOWkRVOaqA.jpeg" /></figure><p>Most of the Senior Engineer’s at my company have never had any other job. They joined the company fresh out of college when it was just a startup and built the product that we currently have today. They did an amazing job. We are a leader in our industry and currently growing extremely fast.</p><p>A few months ago we hired a Senior Engineer who has worked for a couple of different companies in the Boston area. He introduced me to the concept of a <a href="https://codeascraft.com/2012/05/22/blameless-postmortems/">Blameless Post Mortem</a> after I deployed a change in our Rails app that had a bug in it and caused the app to go down for a couple of minutes. I fell in love with the concept right away, but the other senior engineers argued that people’s time is too valuable to have any additional meetings.</p><p>I understand the argument about not wanting any more meetings, but as our company grows we need some way to communicate systematic vulnerabilities. The bug that caused the error was created by a custom Rails engine that we use at my company. When a Senior Engineer called me into his office to discuss what happened the conversation was something like this:</p><blockquote>SE: So it was your commit that caused the app to go down, but don’t worry you didn’t do anything wrong.</blockquote><p>Me: Oh, I’m sorry. Everything was working fine for me when I was running the code locally. I didn’t even do anything out of the ordinary. I’m surprised what I did could crash the whole app. What was wrong with the code?</p><blockquote>SE: Yeah it looks like you used our whatchyamacallit engine to generate the scaffold for the feature you were building.</blockquote><p>Me: Yeah I thought that’s how we were suppose to do it according to our internal documentation.</p><blockquote>SE: Right. The problem is that sometimes it creates an extra file that we don’t need which causes the app to crash when we run it in production. It’s a known bug with the generator. It will run fine locally, but when we compile the changes for production it throws an error that prevents the entire app from booting up. It won’t be a problem once we update the app to Rails 5. When this happens the most important thing to do is to rollback your commit as soon as possible and then we can debug the code locally.</blockquote><p>The solution was as simple as deleting a couple of extra files that did not need to be created. When I talked to other engineers about how I accidentally crashed our app there were two different responses I would get.</p><p>For engineers who have been with the company for 2+ years the response was always something along the lines of <em>“Oh yeah I’ve done that before. You used the whatchyamacallit engine didn’t you?”</em></p><p>Newer engineers would respond<em> </em>with<em> “Wow that’s how it happened? I had no idea. What is the protocol for when the app crashes?”</em></p><p>It sucks being the engineer who crashed the application. Even when you work with nice senior engineers who tell you it’s not your fault, you feel like it’s your fault. The only thing that made me feel better was being able to explain to other engineers what happened to prevent them from making the same mistake in the future, and what the protocol is when you do crash the app.</p><p>This will not be the last time a piece of code crashes one of our apps. When the team was small information could be quickly communicated among the engineers in person. As our company continues to grow, it becomes harder to communicate individually to each person the what, how, and why each time an app crashes.</p><p>I would prefer to learn lessons together as a team and benefit from each other’s mistakes. <a href="https://medium.com/@Fdel15/how-gitlab-taught-me-about-cdns-b7f55ba8fed5#.hj62vnfl9">My post about GitLab</a> is a good example of the unintended benefits being transparent about bugs can have. Is it possible to convince other engineers in my company that doing something like a Blameless Post Mortem is worth the time investment? If so how?</p><p>I would love to hear feedback if you have ever found yourself in a similar situation at a company. Even if you haven’t, any comments or suggestions would be greatly appreciated. My twitter handle and email are available at the bottom of this post.</p><p>Thanks for reading.</p><h4>Resources</h4><p><a href="https://codeascraft.com/2012/05/22/blameless-postmortems/">Blameless PostMortems and a Just Culture</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af021f71c1d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ruby: .each_with_object or .inject?]]></title>
            <link>https://medium.com/@Fdel15/ruby-each-with-object-or-inject-a737bb90cdd8?source=rss-49adfba12d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/a737bb90cdd8</guid>
            <category><![CDATA[ruby-rogues]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Frank DelPidio]]></dc:creator>
            <pubDate>Tue, 14 Feb 2017 09:58:48 GMT</pubDate>
            <atom:updated>2018-10-30T10:40:54.710Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*ZZk1lt3E4MQFmccGWJUAMQ.jpeg" /></figure><p><a href="https://devchat.tv/ruby-rogues">Ruby Rouges</a> is one of my favorite programming podcasts. I recently <a href="https://www.youtube.com/watch?v=lKmY_0uY86s">stumbled upon a code review video</a> that they recorded about two years ago. The video is a code review of the <a href="https://github.com/bkeepers/dotenv">dotenv gem</a> and gave me an inside peak of the process that a couple of experienced and knowledgeable Ruby programmers use to step through an unknown codebase.</p><p>I highly recommend this video to all Ruby programmers because I think it is full of interesting discussions and information. The one discussion that sparked the topic for this article is about using the <em>inject method</em> instead of the <em>each_with_object method</em>. The discussion begins about <a href="https://youtu.be/lKmY_0uY86s?t=21m21s">21 minutes into the recording</a>. Before this video, I had never given any thought about the differences between the two methods. In order to form my own opinion I decided to compare the two methods myself.</p><h4>The Inject Method</h4><p>The official <a href="https://ruby-doc.org/core-2.2.3/Enumerable.html#method-i-inject">Ruby documentation defines inject as</a>:</p><blockquote>Combines all elements of <em>enum</em> by applying a binary operation, specified by a block or a symbol that names a method or operator.</blockquote><p>The most important thing to understand about inject is that as you loop through each element of your enumerable object, a second accumulator value is passed in as well. The accumulator value is updated on each iteration and eventually returned.</p><p>I have pretty much only used the inject method to perform a mathematical operation on an array of numbers. For example:</p><pre>(1..5).inject(0){ |sum, num| sum + num } ==&gt; returns 15</pre><p>This example simply keeps track of a sum variable and adds each number in the array to it and then returns the sum at the end.</p><p>You can also use inject to convert an array into a hash. The following is a code example I borrowed from <a href="http://technology.customink.com/blog/2014/10/14/better-hash-injection-using-each-with-object/">Chris Mar’s blog post</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2gW8Q2lq0wBfFVFSoqss9g.png" /></figure><p>In this second example, there are a couple of key things to notice:</p><ol><li>We are passing in an empty hash as the initial value for our accumulator.</li><li>We are calling the <em>merge</em> method on our accumulator hash each iteration. This method returns an updated hash as our new accumulator.</li></ol><h4>The Each_With_Object Method</h4><p>The official <a href="https://ruby-doc.org/core-2.2.3/Enumerable.html#method-i-each_with_object">Ruby documentation defines each_with_object as</a>:</p><blockquote>Iterates the given block for each element with an arbitrary object given, and returns the initially given object</blockquote><p>Using the same code example above, we can use each_with_object to convert an array into a hash:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zd8ZStBeH5qBavooafCLkw.png" /></figure><p>There are a couple of important differences to notice about the code above and the inject example:</p><ol><li>The arguments are reversed. In inject, the order of the arguments are |<em>accumulator, element| </em>but in each_with_object the order of the arguments are |<em>element, accumulator|.</em></li><li>The each_with_object method ignores the return value of the block and only passes the initial accumulator object along to the next iteration. This is why we don’t need to use the merge method here.</li></ol><h4>Conclusion</h4><p>Listening to the discussion in the video, and reading blog posts on the subject, it becomes apparent that using <em>inject</em> to convert an array to a hash was common practice before the <em>each_with_object</em> method existed.</p><p>The decision about which method you should use comes down to how well you know your Ruby toolbox. The <em>inject</em> method is really good at reducing a list to a value. The <em>each_with_object</em> method was created to solve problems like converting an array into a hash.</p><p>When converting an array to a hash I can’t come up with a single example of why I would want to use <em>inject </em>instead of <em>each_with_object</em>. The code is more readable, and I’m assuming more efficient (I can’t find any evidence to support this but if you know of any please let me know!) using <em>each_with_object</em>. If I ever need to convert an array into a hash, I know exactly what method I am going to use.</p><p>Thanks for Reading.</p><h4>Resources</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FlKmY_0uY86s%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DlKmY_0uY86s&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FlKmY_0uY86s%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b4dcbe27394aeeaee1574bd236753fc/href">https://medium.com/media/2b4dcbe27394aeeaee1574bd236753fc/href</a></iframe><ul><li><a href="http://technology.customink.com/blog/2014/10/14/better-hash-injection-using-each-with-object/">Better Hash Injection using each_with_object - CustomInk Technology Blog</a></li><li><a href="https://ruby-doc.org/core-2.2.3/Enumerable.html#method-i-each_with_object">Module: Enumerable (Ruby 2.2.3)</a></li></ul><p><a href="https://gist.github.com/cupakromer/3371003">Random code gist on the topic</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a737bb90cdd8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How GitLab taught me about CDNs]]></title>
            <link>https://medium.com/@Fdel15/how-gitlab-taught-me-about-cdns-b7f55ba8fed5?source=rss-49adfba12d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7f55ba8fed5</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[cdn]]></category>
            <dc:creator><![CDATA[Frank DelPidio]]></dc:creator>
            <pubDate>Mon, 13 Feb 2017 11:44:12 GMT</pubDate>
            <atom:updated>2017-02-13T11:44:12.740Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*-5rSJvyragcw-lmW5XCMLQ.png" /></figure><p>If you weren’t aware, <a href="https://www.theregister.co.uk/2017/02/01/gitlab_data_loss/">GitLab had an incident</a> about two weeks ago where a directory got deleted and their backups failed them. Not a good situation for a company to be in. The most incredible thing wasn’t that it happened, but how open and transparent they were about fixing it.</p><p>They were <a href="https://docs.google.com/document/d/1GCK53YDcBWQveod9kfzW-VCxIABGiryG7_z_6jHdVik/pub">publicly updating a Google Document</a> while also live streaming a YouTube channel as they worked on resolving the issue. They transformed one mistake into a teachable moment, not just for their company, but for anyone who is curious. I want to personally thank GitLab for the resulting conversation I had with a Senior Engineer when discussing a comment he made about CDN’s in regards to this part of the document:</p><blockquote>Removed a user for using a repository as some form of CDN, resulting in 47 000 IPs signing in using the same account (causing high DB load). This was communicated with the infrastructure and support team.</blockquote><p>Here is the conversation we had over HipChat:</p><blockquote>[10:50 AM] Me: A lot of these things are over my head. How would you use a repository as a CDN?</blockquote><p>[10:51 AM] SE: Say you have a website that serves static files</p><p>[10:52 AM] SE: I make a GET request and expect the server to give me back a zip or a png or something.</p><p>[10:52 AM] SE: That file has to be stored somewhere.</p><p>[10:52 AM] SE: Usually, you’d pay for a CDN (like cloudwatch, for example) <br>where you upload those files, and then your web server knows about the URLs</p><p>[10:53 AM] SE: So that GET request the server looks up whatever record, and knows “this is the URL for that record! I will forward the user to that URL”</p><p>[10:53 AM] SE: The CDN is totally abstracted behind the URL</p><p>[10:54 AM] SE: In this case, it seems like (I don’t know the details), instead of the web server saying “what’s the url for this thing in cloudwatch?”, they are saying “let me log in to this git repository, and checkout the latest version, and serve that”</p><p>[10:54 AM] SE: So now gitlab is responsible for hosting and distributing all that content, which is not what git is good at</p><blockquote>[10:55 AM] Me: Gotchya. So CDN’s are servers that are optimized for handling many requests?</blockquote><p>[10:55 AM] SE: CDN = content delivery network, they handle global distribution and caching</p><p>[10:56 AM] SE: so instead of having to pull the file from one server in texas, that file gets replicated to datacenters all around the world, and the CDN knows which data center to pull it from</p><p>[10:56 AM] SE: so that way your web server doesn’t have to deal with those requests at all</p><p>[10:56 AM] SE: the most common use case is images, since those change infrequently (don’t need to bust the cache)</p><p>[10:57 AM] SE: so if i’m in london and you’re in california, we could both hit <a href="http://cdn.cloudwatch.com/veracross/some/url/thing/image123-52432.png">http://cdn.cloudwatch.com/veracross/some/url/thing/image123-52432.png</a></p><p>[10:57 AM] SE: that cloudwatch.com URL would know “Frank is in CA… let me pull that image from the nearest data center”</p><p>[10:58 AM] SE: “Josh is in london, but i don’t have that file anywhere nearby… let me first copy it from CA to LON and then next time someone from london requests it, it’ll be way faster”</p><blockquote>[10:58 AM] Me: ohh ok. I’m starting to get it. So question: If you do need to update an image hosted on a CDN, how long does it take to update each data center?</blockquote><p>[10:58 AM] SE: that’s called cache invalidation</p><p>[10:58 AM] SE: you can do it a few ways</p><p>[10:58 AM] SE: it really depends on the CDN how long it takes</p><p>[10:59 AM] SE: the first way is to tell the CDN “This file is updated” and then it rolls that out across its data centers, usually takes minutes</p><p>[10:59 AM] SE: more commonly, you use a technique called fingerprinting</p><p>[10:59 AM] SE: when you deploy your web application, you upload any changed files to a location that’s like “<a href="http://blah/file/path/image-237849032890fd8s90fds.png">http://blah/file/path/image-237849032890fd8s90fds.png</a>&quot;</p><p>[11:00 AM] SE: where that bit at the end is a hash based on git commit or something easy to resolve</p><p>[11:00 AM] SE: then your web app updates the file paths to point to the new fingerprint</p><p>[11:00 AM] SE: so you never invalidate the old image, the web app just stops pointing to it</p><blockquote>[11:01 AM] Me: Ah ok. I think I get that. I remember I did the Hartl tutorial about a year or two ago and we used timestamps to do fingerprinting. I just didn’t understand why we were dong that at the time.</blockquote><p>[11:02 AM] SE: yep, just a way to tell the application the file is changed</p><blockquote>[11:04 AM] Me: Ok. so I’m going to try and sum up what you said, and correct me if I’m wrong. CDN’s (Content Delivery Networks) are services that have data centers located around the world. The benefit of CDN’s are they cache infrequently updated files on servers that are located as close as possible to the client. This reduces the number of requests your web server receives.</blockquote><p>[11:04 AM] SE: (thumbs up)</p><p>I had been familiar with the term CDN before this conversation, and even knew the acronym. This simple 15 minute allowed me to build a mental model in my head about what CDNs are and why they are used. The conversation was a side effect of one company’s decision to be transparent about troubleshooting a mistake.</p><p>I hope by sharing this conversation another person will benefit from GitLab’s openness and my co-workers skill at explaining things in simplistic terms.</p><p>Thanks for reading.</p><h4>Resources</h4><p><a href="https://www.theregister.co.uk/2017/02/01/gitlab_data_loss/">GitLab.com melts down after wrong directory deleted, backups fail</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdocs.google.com%2Fdocument%2Fd%2F1GCK53YDcBWQveod9kfzW-VCxIABGiryG7_z_6jHdVik%2Fpub&amp;url=https%3A%2F%2Fdocs.google.com%2Fdocument%2Fd%2F1GCK53YDcBWQveod9kfzW-VCxIABGiryG7_z_6jHdVik%2Fpub&amp;image=https%3A%2F%2Flh3.googleusercontent.com%2F-akWRRqzOF_bCsm7QwodRUtkzg3D1locqbmy1lbfhF5-1uvMunUcHKSMWnMjIaPmqmkMmZdG7yuC-d-6Mi7aYP9Oheaj8_hjR_ijnLXzQvlal3GMqC2p3zPGBnNs0_hZRw&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=google" width="500" height="300" frameborder="0" scrolling="no"><a href="https://medium.com/media/706dab3daf4b35fcfc3305e47cac5c7e/href">https://medium.com/media/706dab3daf4b35fcfc3305e47cac5c7e/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7f55ba8fed5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Evolution of a Geek 2017 — Part 2]]></title>
            <link>https://medium.com/@Fdel15/the-evolution-of-a-geek-2017-week-3-3fe45175314b?source=rss-49adfba12d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fe45175314b</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Frank DelPidio]]></dc:creator>
            <pubDate>Sun, 22 Jan 2017 21:57:02 GMT</pubDate>
            <atom:updated>2017-02-13T11:54:39.333Z</atom:updated>
            <content:encoded><![CDATA[<p>In an effort to measure progress and hold myself accountable to the goals I have set for the 2017, I will periodically be doing self reflection posts.</p><p><strong>Google Interview University Weeks 2–3</strong></p><p>I am disappointed to report that I have not made any progress since my last post. I am still waiting to begin Chapter 2 of <a href="https://www.amazon.com/Programming-Language-Brian-W-Kernighan/dp/0131103628">C Programming Language, Vol 2</a>. I have been spending my limited free time building a <a href="https://github.com/fdel15/flash-cards">Flash Card application</a> that will make it easier to review my notes as I continue my way through the course.</p><p><strong>Flash Card Application</strong></p><p>It is taking me longer than I originally anticipated to create the MVP of the Flash Card application. There are two primary reasons for this. The first reason is because it has been a long time since I built a Rails app from scratch, and I need to look up documentation and reference projects I previously built to remember how to set things up.</p><p>The bigger slow down is because I have not done a good job of planning before sitting down to write code. There have been several days of work that I have thrown out because after taking the time to build out a feature I realized that I didn’t like the way I did it at all. This problem became obvious to me when I was working with my manager to design a new Knowledge Base application for our company.</p><p>The Knowledge Base application is just one of many projects I am currently working on at my day job. I estimate that over the last two weeks, my manager and I have spent about 1 full day of work on the project. We have written exactly 0 lines of code. Instead, we have spent the time clearly defining the problems we want to solve, the current work flow that exists, the ideal future work flow, and the specs of a possible solution to these problems.</p><p>My manager called this process <em>Design Thinking</em>. The purpose is to have a clear set of problems that we are trying to solve so we can measure future progress against what we initially set out to build. In the past, our company has not been very good at doing this and it has resulted in a few poorly designed applications that now need to be completely replaced.</p><p>My company’s Wiki application is an example of one of these apps. The application was built because the thought at the time was “we need a wiki.” This was not a clearly defined problem, and the application tries to do too much without any specific purpose. One of the results is that we are now having to build a new Knowledge Base application and trying to figure out if there are parts of the Wiki we can salvage and port over.</p><p>I need to start approaching everything I code in a similar fashion. The MVP for the Flash Cards app is about 85% complete at the moment. I used good old fashioned pen and paper to outline the next steps I need to take to get the app functional. In broad strokes, the next three steps I need to take are</p><ol><li>Make “Test Me” button functional. This button should begin a Review Session. A Review Session will show you the front of an index card with a “Flip Me” button beneath it. When you click the “Flip Me” button, the back of the card is displayed, with a “Correct” or “Incorrect” button beneath it. You move on to the next card by recording if you got that card right or wrong.</li><li>Use Bootstrap to style the app. The app is functioning well, and Bootstrap has been configured. I just need to go through the forms and add the proper classes to make it less hideous. It will never be the prettiest application in the world, but I have the skills to make it look presentable.</li><li>Deploy to Heroku. At this point the app will be live and ready to use and I can continue my education in C.</li></ol><p>I plan on completing all three of these steps this week. This basic MVP will serve my purposes for right now. In the future I can add features such as the ability to review cards by category, adding user accounts, and write tests for my code.</p><p><strong>Sabermetrics</strong></p><p>I have not read any of <a href="https://www.amazon.com/Hidden-Game-Baseball-Revolutionary-Statistics-ebook/dp/B00U7C501A/ref=sr_1_1?s=digital-text&amp;ie=UTF8&amp;qid=1483897188&amp;sr=1-1&amp;keywords=The+hidden+game+of+baseball">The Hidden Game of Baseball</a> in the last two weeks. I need to do a better job of making time to read a little bit each night. I did register for <a href="http://www.baseballhackday.com/">Baseball Hack Day</a> in Boston this March. This is a one day hackathon to build a baseball application. They provide a great collection of APIs to use, and it will be a great day to meet other developers who are most likely interested in Sabermetrics right before the season starts. My challenge is to come to the hackathon with a clearly defined idea for an application, recruit a small team that day to help me build it, and then ship a functional app that we can add features too throughout the 2017 season.</p><p><strong>Future Ruby Development</strong></p><p>I have been listening to the <a href="https://devchat.tv/ruby-rogues">Ruby Rogues</a> podcast at work this week and I have discovered two new resources to improve my Ruby skills.</p><p>The first resource is <a href="https://code.gov/#/">Code.gov</a>. This is a collection of open source projects on GitHub that are managed by the Federal Government. It is a great opportunity to add open source contributions and demonstrate my abilities to add to an existing code base.</p><p>The second resource is the book <a href="http://brandonhilkert.com/books/build-a-ruby-gem/"><em>Build A Ruby Gem by Brandon Hilkert</em></a>. I have built a couple of Ruby gems in the past, but this book takes a deeper dive into how to design a Ruby gem and Rails Integrations. I want to go through the gems my company built for our Rails Applications and submit pull requests to make them better. Even if I can’t find anything that can be improved (doubtful), the process of going through the codebase will lead to a deeper understanding of how our applications function under the hood.</p><p>Thank you for taking the time to read this! If you are currently working through Google Interview University, are in the Boston area and want to meet up, or are interested in Sabermetrics I would love to hear from you! Even if you aren’t and just want to say hi I would love to hear from you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fe45175314b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Evolution Of A Geek 2017 — Part 1]]></title>
            <link>https://medium.com/@Fdel15/the-evolution-of-a-geek-2017-ec2d3eda816f?source=rss-49adfba12d55------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec2d3eda816f</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[sabermetics]]></category>
            <dc:creator><![CDATA[Frank DelPidio]]></dc:creator>
            <pubDate>Sun, 08 Jan 2017 17:58:56 GMT</pubDate>
            <atom:updated>2017-02-13T11:55:16.801Z</atom:updated>
            <content:encoded><![CDATA[<p>In an effort to measure progress and hold myself accountable to the goals I have set for the 2017, I will periodically be doing self reflection posts.</p><p><strong>Google Interview University Week 1</strong></p><p>This week I began my journey through <a href="https://github.com/jwasham/google-interview-university#get-in-a-googley-mood">Google Interview University</a>. I will write about the reasons behind why I am working through this curriculum in a later post. If you haven’t heard of it, I recommend you checking it out.</p><p>I spent the week in the <a href="https://github.com/jwasham/google-interview-university#prerequisite-knowledge">Prerequisite Knowledge</a> section. As I work through the curriculum I will be keeping my daily notes in a <a href="https://docs.google.com/document/d/17otnjzvkTaE24Bn1qoXYDWraZggQ1OEpJV93_SJfiQc/edit?usp=sharing">Google document</a>. I will then convert these notes into a weekly article.</p><p><strong>Videos</strong></p><p>There were two videos in this section, and I began by watching them first. Both videos were short, but they covered material about how computers work at a very low level. My notes are not very detailed on either video, but they both covered gaps in my knowledge as I continue my journey as a programmer without a CS degree.</p><p><a href="https://www.youtube.com/watch?v=42KTvGYQYnA">How does CPU execute program (video)</a></p><p>This video steps through a simple example of how a CPU executes a program. There are four main operations that a computer uses to execute a program:</p><ul><li>Fetch — CPU fetches the instruction that has been loaded from the RAM into an Instruction Register (address defined in RAM).</li><li>Decode — CPU loads the content of the memory location specified in the Instruction Register into Registers .</li><li>Execute — CPU performs operation specified in the Instruction.</li><li>Writeback — Results of the instruction are stored in a Register.</li></ul><p><a href="https://www.youtube.com/watch?v=Mv2XQgpbTNE">Machine Code Instructions (video)</a></p><p>This video simplifies machine code into two parts. The <em>operand </em>and <em>operation code. </em>Both parts are stored in the computer’s memory (RAM). The most interesting part of the video to me was when the instructor commented that machine code gets stored as binary but is often represented as a hexadecimal because it is a better way for humans to memorize and display long strings of binary.</p><p>My immediate question after hearing this was how do you convert binary to hexadecimal and vice versa? <a href="https://www.khanacademy.org/math/algebra-home/alg-intro-to-algebra/algebra-alternate-number-bases/v/binary-to-hexadecimal">Khan Academy has a great video </a>teaching you how to do this. The example from the video:</p><pre>Base10:      366 <br>Binary:      101101110 = 1 0110 1110<br>Hexadecimal: 16E       = 1 6    E</pre><p><strong>C Programming Language</strong></p><p>The majority of the week was spent working my way through the textbook <a href="https://www.amazon.com/Programming-Language-Brian-W-Kernighan/dp/0131103628">C Programming Language, Vol 2</a>. I am excited to learn a new programming language, and in particular, a lower level language that will require me to think about and understand memory allocation.</p><p>I was able to cover the Introduction and Chapter 1 this week. I worked my way through each code example, and some of the exercises. This <a href="https://github.com/fdel15/C-Programming-Language-Vol-2">code can be viewed</a> on my GitHub page.</p><p>One of the most interesting things I learned from the Introduction is that C is a relatively small language. For some reason I was under the impression that C was a massive language with complicated syntax that would take me forever to wrap my head around. I am excited that I should be able to learn the language quickly, and a I find a lot of the syntax similar to Ruby.</p><p>Looking back at the notes I took on the Chapter 1 this week, I realize it is much easier to turn them into flash cards than a blog post. They are predominately a list of facts and definitions in C that I want to cement in my brain. Before beginning Chapter 2 next week, I want to create a flash card app that I will later link to here (<a href="https://github.com/jwasham/google-interview-university#2-use-flashcards">this is recommended</a> by the author of Google Interview University). For future weeks, I will make this part of my blog post a detailed exploration in a specific topic covered in the text book.</p><p><strong>Reading</strong></p><p>My goal for the year is to read 52 books. This is means I need to complete one book a week. This week’s book was <a href="https://www.amazon.com/Trading-Bases-Fortune-Betting-Baseball/dp/0451415175/ref=sr_1_1?ie=UTF8&amp;qid=1483585833&amp;sr=8-1&amp;keywords=trading+bases">Trading Bases by Joe Peta</a>.</p><p>This book documents the journey of a former Wall Street trader developing a statistical model using <a href="http://sabr.org/sabermetrics">Sabermetrics</a> to give himself an edge in sports betting. Overall, I give the book 7 out of 10 stars.</p><p>The parts of the book I really enjoyed were when the author would walk you through his thought process on how he developed the model. He would explain why he valued certain statistics over others, gave a brief introduction to the field of Sabermetrics, and then showed his results from month to month.</p><p>Learning how to develop statistical models from historical data is the primary skill I want to learn this year, and seeing an example of someone applying this to a field I already know is very exciting. This book has inspired me to try and develop my own statistical model for betting on baseball for two reasons:</p><ol><li>The best way to learn anything is to practice what you are learning. I have a list of resources I plan on working through this year to develop this skill and this will give me a project to simultaneously work on.</li><li>While the trader was successful and turned a profit, I think there were some flaws in his model. I believe that if I spend time studying Sabermetrics and borrow the parts of his model that I believe worked really well that I can develop a better model. I also feel like the trader was too aggressive betting on games that the model only gave him a small edge, and instead should have given his model a small margin of error. This margin of error, and using a different betting strategy (the author never really explained why he didn’t want to use the <a href="https://en.wikipedia.org/wiki/Kelly_criterion">Kelly Criterion</a>) I believe would make me more profitable even if I used the same model.</li></ol><p>Opening day in baseball is the first week in April. This means I have a couple of weeks to study Sabermetrics and develop a model. I am currently reading <a href="https://www.amazon.com/Hidden-Game-Baseball-Revolutionary-Statistics-ebook/dp/B00U7C501A/ref=sr_1_1?s=digital-text&amp;ie=UTF8&amp;qid=1483897188&amp;sr=1-1&amp;keywords=The+hidden+game+of+baseball">The Hidden Game of Baseball</a> and will be working my way through more articles and resources found <a href="http://sabr.org/sabermetrics">here</a>.</p><p>Ideally, I would like to test my model by placing real bets on baseball games for the 2017 season. I currently have some money set aside to invest in my baseball model, but it depends on the legality of online sports betting in Massachusetts (which I have not researched yet). At the very least, I will start with a fantasy bankroll of $1000 and track my progress throughout the year.</p><p>Thank you for taking the time to read this! If you are currently working through Google Interview University, or are interested in Sabermetrics I would love to hear from you! Even if you aren’t and just want to say hi I would love to hear from you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec2d3eda816f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>