{"id":90,"date":"2020-04-15T14:56:30","date_gmt":"2020-04-15T13:56:30","guid":{"rendered":"http:\/\/aprendo.co.uk\/interestingthings\/?page_id=90"},"modified":"2020-04-15T15:33:18","modified_gmt":"2020-04-15T14:33:18","slug":"rails","status":"publish","type":"page","link":"https:\/\/aprendo.co.uk\/interestingthings\/index.php\/rails\/","title":{"rendered":"Rails"},"content":{"rendered":"\n<p>I just put this page here so that I could have menu items &#8220;Posts&#8221; and &#8220;Rails&#8221;,  because of the double pun afforded by (blog) Posts \/ (rants and) Rails versus (fence) Posts \/ (fence) Rails.<\/p>\n\n\n\n<p>Post and Rail problems are a class of potential out-by-one issues that occur in software.  The basic idea is that for a straight fence, the number of posts required is one more than the number of rails (really, gaps between the posts),<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"329\" height=\"200\" src=\"https:\/\/aprendo.co.uk\/interestingthings\/wp-content\/uploads\/2020\/04\/straight_fence-1.jpeg\" alt=\"\" class=\"wp-image-99\" srcset=\"https:\/\/aprendo.co.uk\/interestingthings\/wp-content\/uploads\/2020\/04\/straight_fence-1.jpeg 329w, https:\/\/aprendo.co.uk\/interestingthings\/wp-content\/uploads\/2020\/04\/straight_fence-1-300x182.jpeg 300w\" sizes=\"(max-width: 329px) 100vw, 329px\" \/><figcaption>Straight fence:<br>P = 2<br>R = 1  <br>P = R + 1<\/figcaption><\/figure>\n\n\n\n<p> but on a circular track, the number of posts is equal to the number of rails.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"603\" src=\"https:\/\/aprendo.co.uk\/interestingthings\/wp-content\/uploads\/2020\/04\/circular_fence-1024x603.jpeg\" alt=\"\" class=\"wp-image-96\" srcset=\"https:\/\/aprendo.co.uk\/interestingthings\/wp-content\/uploads\/2020\/04\/circular_fence-1024x603.jpeg 1024w, https:\/\/aprendo.co.uk\/interestingthings\/wp-content\/uploads\/2020\/04\/circular_fence-300x177.jpeg 300w, https:\/\/aprendo.co.uk\/interestingthings\/wp-content\/uploads\/2020\/04\/circular_fence-768x452.jpeg 768w, https:\/\/aprendo.co.uk\/interestingthings\/wp-content\/uploads\/2020\/04\/circular_fence.jpeg 1358w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>Circular fence:<br>P = 18<br>R = 18<br>P = R<\/figcaption><\/figure>\n\n\n\n<p>It&#8217;s not complicated &#8211; but then out-by-one issues are rarely complicated, they&#8217;re just surprisingly common.<\/p>\n\n\n\n<p>Nothing whatsoever to do with these rails; although now that we&#8217;re here&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"474\" height=\"232\" src=\"https:\/\/aprendo.co.uk\/interestingthings\/wp-content\/uploads\/2020\/04\/rails.jpeg\" alt=\"railway lines\" class=\"wp-image-94\" srcset=\"https:\/\/aprendo.co.uk\/interestingthings\/wp-content\/uploads\/2020\/04\/rails.jpeg 474w, https:\/\/aprendo.co.uk\/interestingthings\/wp-content\/uploads\/2020\/04\/rails-300x147.jpeg 300w\" sizes=\"(max-width: 474px) 100vw, 474px\" \/><figcaption>Railway lines:<br>P \u2248 \u221e<br><em>R \u2248 \u221e<\/em><br><em>P \u2248 <\/em>R<\/figcaption><\/figure>\n\n\n\n<p>&#8230;meaning that an infinitely long straight line is pretty much the same as an infinitely big circle.<\/p>\n\n\n\n<p>End of post!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I just put this page here so that I could have menu items &#8220;Posts&#8221; and &#8220;Rails&#8221;, because of the double pun afforded by (blog) Posts \/ (rants and) Rails versus (fence) Posts \/ (fence) Rails. Post and Rail problems are a class of potential out-by-one issues that occur in software. The basic idea is that &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/aprendo.co.uk\/interestingthings\/index.php\/rails\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Rails&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"spay_email":""},"jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/aprendo.co.uk\/interestingthings\/index.php\/wp-json\/wp\/v2\/pages\/90"}],"collection":[{"href":"https:\/\/aprendo.co.uk\/interestingthings\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/aprendo.co.uk\/interestingthings\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/aprendo.co.uk\/interestingthings\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aprendo.co.uk\/interestingthings\/index.php\/wp-json\/wp\/v2\/comments?post=90"}],"version-history":[{"count":5,"href":"https:\/\/aprendo.co.uk\/interestingthings\/index.php\/wp-json\/wp\/v2\/pages\/90\/revisions"}],"predecessor-version":[{"id":106,"href":"https:\/\/aprendo.co.uk\/interestingthings\/index.php\/wp-json\/wp\/v2\/pages\/90\/revisions\/106"}],"wp:attachment":[{"href":"https:\/\/aprendo.co.uk\/interestingthings\/index.php\/wp-json\/wp\/v2\/media?parent=90"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}