{"id":1102,"date":"2016-08-11T18:25:31","date_gmt":"2016-08-12T01:25:31","guid":{"rendered":"http:\/\/technofovea.com\/blog\/?p=1102"},"modified":"2016-08-11T18:25:31","modified_gmt":"2016-08-12T01:25:31","slug":"spaceballs-the-python-script","status":"publish","type":"post","link":"http:\/\/technofovea.com\/blog\/archives\/1102","title":{"rendered":"Spaceballs: The Python Script"},"content":{"rendered":"<p>&#8220;Before you die, <a href=\"https:\/\/www.youtube.com\/watch?v=pPkWZdluoUg&#038;t=0m15s\">there is something you should know about us<\/a>, Lone-Star&#8230;&#8221;<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\ndef unfoldFilter(unfoldFunction, filterFunction, iterable):\r\n    for item in iterable:           \r\n        for result in unfoldFunction(item):            \r\n            if filterFunction is None or apply(filterFunction, [result]):\r\n                yield result\r\n\r\nassert darkHelmet in unfoldFilter(lambda p: p.roommates, lambda p: p.isFormer(), \r\n    unfoldFilter(lambda p: p.children, None, \r\n        unfoldFilter(lambda p: p.siblings, None, \r\n            unfoldFilter(lambda p: p.parents, None, \r\n                unfoldFilter(lambda p: p.children, lambda p: p.isMale(), \r\n                    unfoldFilter(lambda p: p.siblings, None, \r\n                        unfoldFilter(lambda p: p.siblings, lambda p: p.isMale(), \r\n                            unfoldFilter(lambda p: p.parents, lambda p: p.isMale(), list(loneStar))\r\n                        )\r\n                    )\r\n                )\r\n            )\r\n        )\r\n    )\r\n\r\nassert makesThem(darkHelmet, loneStar) is None\r\n<\/pre>\n<p>For those who don&#8217;t get the joke, the movie &#8220;Spaceballs&#8221; self-parodied itself with a series of <a href=\"https:\/\/www.youtube.com\/watch?v=fgRFQJCHcPw&#038;t=0m55s\">whimsical merchandising options<\/a> and contained a gag referencing Star Wars&#8217; iconic &#8220;I am your father&#8221;, except&#8230; well, a little more complex.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;Before you die, there is something you should know about us, Lone-Star&#8230;&#8221; For those who don&#8217;t get the joke, the movie &#8220;Spaceballs&#8221; self-parodied itself with a series of whimsical merchandising options and contained a gag referencing Star Wars&#8217; iconic &#8220;I am your father&#8221;, except&#8230; well, a little more complex.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[26],"_links":{"self":[{"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/posts\/1102"}],"collection":[{"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/comments?post=1102"}],"version-history":[{"count":13,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/posts\/1102\/revisions"}],"predecessor-version":[{"id":1117,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/posts\/1102\/revisions\/1117"}],"wp:attachment":[{"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/media?parent=1102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/categories?post=1102"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/tags?post=1102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}