{"id":551,"date":"2010-01-14T10:56:59","date_gmt":"2010-01-14T15:56:59","guid":{"rendered":"http:\/\/blog.codedread.com\/archives\/2010\/01\/14\/mix-10k-code-challenge-svg\/"},"modified":"2010-01-15T14:41:43","modified_gmt":"2010-01-15T14:41:43","slug":"mix-10k-code-challenge-svg","status":"publish","type":"post","link":"https:\/\/www.codedread.com\/blog\/archives\/2010\/01\/14\/mix-10k-code-challenge-svg\/","title":{"rendered":"MIX 10k Code Challenge += SVG"},"content":{"rendered":"<p><object type=\"image\/svg+xml\" width=\"100\" height=\"100\" style=\"float:right\" data=\"http:\/\/codedread.com\/clipart\/villain.svgz\">[clipart]<\/object>I came across the <a href=\"http:\/\/mix10k.visitmix.com\/\">MIX 10k Coding Challenge<\/a> on the weekend, and on a whim I decided to submit one of my old SVG demos to the contest.  The 10k challenge's tagline is \"What could you create for the Web if you had only 10 kilobytes of code?\".  The rules didn't explicitly say I could use pure SVG, they mention SVG\/Canvas in the context of HTML5 only, but I thought I'd give it a shot.  It's in the spirit of the contest, after all.  At the very least it would encourage Microsoft to clarify the rules and at the very best it would be accepted and the rules updated to allow pure SVG applications.  Looks like it was my lucky day.<!--more--><\/p>\n<p>I decided to go with my <a href=\"http:\/\/codedread.com\/solitaire.php\">Solitaire<\/a> demo because it was the most complete, didn't infringe on any copyrights (looking at you Tetris), and most visually recognizable.  It's not the most innovative, but then again the point of this is not necessarily to win any prizes.  It's really about increasing awareness.<\/p>\n<p>Unfortunately, the SVG (26kb) and JavaScript (16kb + 21kb) totaled 63kb.  I did some cleanup of the SVG, minified the JS and then put the script inline with the SVG and then gzipped it.  The result was a .svgz file that was 9kb.  Perfect!<\/p>\n<p>I then got an email from a friendly marketing\/evangelism person at Microsoft who said that the engineers did not know how to open the svgz file to review the code to ensure it was under 10k.  Woops!  I explained to her that I thought it would be ok for the SVG to be gzipped, much as PNG\/GIF files use compression and sent her the uncompressed SVG file for them to review.  After all, SVG is just an image format, right? \ud83d\ude09<\/p>\n<p>Was I following the rules?  Did Microsoft give me a fair shake?  <a href=\"http:\/\/mix10k.visitmix.com\/Entry\/Details\/160\">See for yourself<\/a>.  Who knows, maybe this is the first time a Microsoft admin had to figure out how to serve SVG on a Microsoft web server.<\/p>\n<p>Out of curiosity, I later tried to see how far I was able to get down the Solitaire game: <a href=\"http:\/\/codedread.com\/solitaire.svgz\">5811 bytes<\/a>.  Not bad for a complete game that has scalable graphics.  I'd be curios to see the equivalent SWF file.<\/p>\n<p>I don't expect you to vote for my entry, but what I do expect you to do is now go out and submit .SVGZ entries to the MIX 10k challenge.  That one SVG entry is looking pretty lonely.  If I can get Solitaire down to 5811 bytes, surely you can do better?<\/p>\n<p>Thanks a lot to Amy, the evangelist\/marketing person who really was quite patient with me.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[clipart]I came across the MIX 10k Coding Challenge on the weekend, and on a whim I decided to submit one of my old SVG demos to the contest. The 10k challenge&#8217;s tagline is &#8220;What could you create for the Web if you had only 10 kilobytes of code?&#8221;. The rules didn&#8217;t explicitly say I could [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38,24,25,46,11,14,28],"tags":[179,99,192,184,198],"class_list":["post-551","post","type-post","status-publish","format-standard","hentry","category-javascript","category-microsoft","category-software","category-svg","category-technology","category-tips","category-web","tag-games","tag-html5","tag-javascript","tag-microsoft","tag-svg"],"_links":{"self":[{"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/posts\/551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/comments?post=551"}],"version-history":[{"count":2,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/posts\/551\/revisions"}],"predecessor-version":[{"id":557,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/posts\/551\/revisions\/557"}],"wp:attachment":[{"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/media?parent=551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/categories?post=551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/tags?post=551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}