{"id":2820,"date":"2014-07-17T07:53:01","date_gmt":"2014-07-17T11:53:01","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=2820"},"modified":"2014-07-17T07:53:03","modified_gmt":"2014-07-17T11:53:03","slug":"programming-silliness","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=2820","title":{"rendered":"Programming Silliness"},"content":{"rendered":"<p> The other day I saw <a href=\"http:\/\/blog.lse.epita.fr\/articles\/69-0xcafebabe-java-class-file-format-an-overview.html\">this post<\/a>. Although I&#8217;m not interested in Java, I was struck by the magic number <code>CAFEBABE<\/code> that marked the beginning of the structure. That got me wondering how many words can be made with the hexadecimal digits <code>A-F<\/code>. Before you read further, ask yourself how you&#8217;d go about solving this problem. <\/p>\n<p> Being a developer, my first thought was, \u201cWell I&#8217;ll just write a quick Lisp program.\u201d The only aspect I wasn&#8217;t sure of was whether I should use Common Lisp or Emacs Lisp. It was pretty easy to layout the general structure in either language. <\/p>\n<p> Then I had that \u201cDUH\u201d moment when I realized I was working way too hard. The easy way to solve this problem is <\/p>\n<div class=\"org-src-container\">\n<pre class=\"src src-sh\">grep -v [^a-fA-F] \/usr\/share\/dict\/words\n<\/pre>\n<\/p><\/div>\n<p> which gave me the results <\/p>\n<table border=\"2\" cellspacing=\"0\" cellpadding=\"6\" rules=\"groups\" frame=\"hsides\">\n<colgroup>\n<col  class=\"left\" \/>\n<col  class=\"left\" \/>\n<col  class=\"left\" \/>\n<col  class=\"left\" \/> <\/colgroup>\n<tbody>\n<tr>\n<td class=\"left\">A<\/td>\n<td class=\"left\">a<\/td>\n<td class=\"left\">aa<\/td>\n<td class=\"left\">Ab<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">aba<\/td>\n<td class=\"left\">abac<\/td>\n<td class=\"left\">abaca<\/td>\n<td class=\"left\">abaff<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">abb<\/td>\n<td class=\"left\">Abba<\/td>\n<td class=\"left\">Abe<\/td>\n<td class=\"left\">abed<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">acca<\/td>\n<td class=\"left\">accede<\/td>\n<td class=\"left\">ace<\/td>\n<td class=\"left\">ad<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">Ada<\/td>\n<td class=\"left\">Adad<\/td>\n<td class=\"left\">adad<\/td>\n<td class=\"left\">add<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">Adda<\/td>\n<td class=\"left\">adda<\/td>\n<td class=\"left\">added<\/td>\n<td class=\"left\">Ade<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">ade<\/td>\n<td class=\"left\">adead<\/td>\n<td class=\"left\">ae<\/td>\n<td class=\"left\">aface<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">affa<\/td>\n<td class=\"left\">B<\/td>\n<td class=\"left\">b<\/td>\n<td class=\"left\">ba<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">baa<\/td>\n<td class=\"left\">Bab<\/td>\n<td class=\"left\">baba<\/td>\n<td class=\"left\">babe<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">bac<\/td>\n<td class=\"left\">bacaba<\/td>\n<td class=\"left\">bacca<\/td>\n<td class=\"left\">baccae<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">bad<\/td>\n<td class=\"left\">bade<\/td>\n<td class=\"left\">bae<\/td>\n<td class=\"left\">baff<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">be<\/td>\n<td class=\"left\">Bea<\/td>\n<td class=\"left\">bead<\/td>\n<td class=\"left\">beaded<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">bebed<\/td>\n<td class=\"left\">bed<\/td>\n<td class=\"left\">bedad<\/td>\n<td class=\"left\">bedded<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">bedead<\/td>\n<td class=\"left\">bedeaf<\/td>\n<td class=\"left\">Bee<\/td>\n<td class=\"left\">bee<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">beef<\/td>\n<td class=\"left\">C<\/td>\n<td class=\"left\">c<\/td>\n<td class=\"left\">ca<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">cab<\/td>\n<td class=\"left\">caba<\/td>\n<td class=\"left\">cabda<\/td>\n<td class=\"left\">Caca<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">cad<\/td>\n<td class=\"left\">cade<\/td>\n<td class=\"left\">caeca<\/td>\n<td class=\"left\">caffa<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">ce<\/td>\n<td class=\"left\">cede<\/td>\n<td class=\"left\">cee<\/td>\n<td class=\"left\">D<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">d<\/td>\n<td class=\"left\">da<\/td>\n<td class=\"left\">dab<\/td>\n<td class=\"left\">dabb<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">dabba<\/td>\n<td class=\"left\">dace<\/td>\n<td class=\"left\">dad<\/td>\n<td class=\"left\">Dada<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">dada<\/td>\n<td class=\"left\">dade<\/td>\n<td class=\"left\">dae<\/td>\n<td class=\"left\">daff<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">de<\/td>\n<td class=\"left\">dead<\/td>\n<td class=\"left\">deaf<\/td>\n<td class=\"left\">Deb<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">deb<\/td>\n<td class=\"left\">decad<\/td>\n<td class=\"left\">decade<\/td>\n<td class=\"left\">dee<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">deed<\/td>\n<td class=\"left\">deedeed<\/td>\n<td class=\"left\">deface<\/td>\n<td class=\"left\">E<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">e<\/td>\n<td class=\"left\">ea<\/td>\n<td class=\"left\">ebb<\/td>\n<td class=\"left\">ecad<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">Ecca<\/td>\n<td class=\"left\">Ed<\/td>\n<td class=\"left\">Edda<\/td>\n<td class=\"left\">edea<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">efface<\/td>\n<td class=\"left\">F<\/td>\n<td class=\"left\">f<\/td>\n<td class=\"left\">fa<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">Faba<\/td>\n<td class=\"left\">Fabaceae<\/td>\n<td class=\"left\">facade<\/td>\n<td class=\"left\">face<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">faced<\/td>\n<td class=\"left\">fad<\/td>\n<td class=\"left\">fade<\/td>\n<td class=\"left\">faded<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">fae<\/td>\n<td class=\"left\">faff<\/td>\n<td class=\"left\">fe<\/td>\n<td class=\"left\">fed<\/td>\n<\/tr>\n<tr>\n<td class=\"left\">fee<\/td>\n<td class=\"left\">feed<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> Sadly, <code>cafe<\/code> isn&#8217;t in the system dictionary on my MacBook but the method stands. <\/p>\n<p> The moral here is that we developers should remember that not every problem is a nail. Now that I think about it, this is the exact same point that I made <a href=\"http:\/\/irreal.org\/blog\/?p=982\">two years ago<\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>The other day I saw this post. Although I&#8217;m not interested in Java, I was struck by the magic number CAFEBABE that marked the beginning of the structure. That got me wondering how many words can be made with the &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=2820\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[76],"class_list":["post-2820","post","type-post","status-publish","format-standard","hentry","category-programming","tag-tools"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2820","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2820"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2820\/revisions"}],"predecessor-version":[{"id":2821,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2820\/revisions\/2821"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2820"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}