{"id":2346,"date":"2008-11-07T08:01:19","date_gmt":"2008-11-07T13:01:19","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/2008\/11\/07\/atomic-challenge-part-2\/"},"modified":"2008-11-07T08:01:19","modified_gmt":"2008-11-07T13:01:19","slug":"atomic-challenge-part-2","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2008\/11\/07\/atomic-challenge-part-2\/","title":{"rendered":"Atomic challenge &#8211; part 2"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <introduction>\r\n      <p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/5021\">Bob<\/a>'s pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/20693-atomic-reminder\">Atomic reminder<\/a> by Daniel Armyr.\r\n      <\/p>\r\n      <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/reminder.png\"> <\/p>\r\n   <\/introduction>\r\n   <h3>Contents<\/h3>\r\n   <div>\r\n      <ul>\r\n         <li><a href=\"#1\">Round 1<\/a><\/li>\r\n         <li><a href=\"#2\">Round 2<\/a><\/li>\r\n         <li><a href=\"#3\">Discussion<\/a><\/li>\r\n      <\/ul>\r\n   <\/div>\r\n   <h3>Round 1<a name=\"1\"><\/a><\/h3>\r\n   <p>A few months ago I posted <a href=\"https:\/\/blogs.mathworks.com\/pick\/2008\/06\/27\/atomic-clock-alarm-challenge\/\">Atomic clock + alarm challenge<\/a>. Daniel took the challenge and submitted a solution. I like it! His approach uses a timer object. (Great minds think alike.)\r\n      The command line use of <tt>remindme_atom<\/tt> is simple, and the modal pop-up dialog is effective. I also got a kick out of his sound stream when my alarm went off. Nice\r\n      touch!\r\n   <\/p>\r\n   <h3>Round 2<a name=\"2\"><\/a><\/h3>\r\n   <p>Did you really think I'd stop there? Now that we have a solution to the previous challenge, the new challenge is to brainstorm\r\n      a test plan for it. You might start by understanding different ways <tt>remindme_atom<\/tt> was intended to be used. How do you make sure it does exactly what it is supposed to do? How many test cases can you think\r\n      up? How could you accidentally misuse it. Which cases are not worth testing? What steps would you take? Do any other considerations\r\n      come to mind?\r\n   <\/p>\r\n   <h3>Discussion<a name=\"3\"><\/a><\/h3>\r\n   <p>Don't jump in head first. Rather, let's talk about <b>how<\/b> you test code that you write, or M-files from others that you rely on. You do test your own code, somehow, right? Please\r\n      share your thoughts <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=2346#respond\">here<\/a>.\r\n   <\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_613ac434a890481a8a94f43a5f5d2f24() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='613ac434a890481a8a94f43a5f5d2f24 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 613ac434a890481a8a94f43a5f5d2f24';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = 'Robert Bemis';\r\n        copyright = 'Copyright 2008 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }   \r\n      \r\n-->\r\n<\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_613ac434a890481a8a94f43a5f5d2f24()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.7<br><\/p>\r\n<\/div>\r\n<!--\r\n613ac434a890481a8a94f43a5f5d2f24 ##### SOURCE BEGIN #####\r\n%%\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/5021 Bob>'s \r\n% pick this week is \r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/20693-atomic-reminder Atomic reminder>\r\n% by Daniel Armyr.\r\n%\r\n% <<..\/images\/pick\/reminder.png>>\r\n%% Round 1\r\n% A few months ago I posted \r\n% <https:\/\/blogs.mathworks.com\/pick\/2008\/06\/27\/atomic-clock-alarm-challenge\/ Atomic clock + alarm challenge>. \r\n% Daniel took the challenge and submitted a solution. I like it! His approach\r\n% uses a timer object. (Great minds think alike.) The command line use of \r\n% |remindme_atom| is simple, and the modal pop-up dialog is effective. I also\r\n% got a kick out of his sound stream when my alarm went off. Nice touch!\r\n%% Round 2\r\n% Did you really think I'd stop there? Now that we have a solution to the\r\n% previous challenge, the new challenge is to brainstorm a test plan for it.\r\n% You might start by understanding different ways |remindme_atom| was\r\n% intended to be used. How do you make sure it does exactly what it is\r\n% supposed to do? How many test cases can you think up? How could you\r\n% accidentally misuse it. Which cases are not worth testing? What steps would\r\n% you take? Do any other considerations come to mind? \r\n%% Discussion\r\n% Don't jump in head first. Rather, let's talk about *how* you test code that\r\n% you write, or M-files from others that you rely on. You do test your own\r\n% code, somehow, right? Please share your thoughts \r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=2346#respond here>.\r\n\r\n##### SOURCE END ##### 613ac434a890481a8a94f43a5f5d2f24\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   \r\n      Bob's pick this week is Atomic reminder by Daniel Armyr.\r\n      \r\n       \r\n   \r\n   Contents\r\n   \r\n      \r\n  ... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2008\/11\/07\/atomic-challenge-part-2\/\">read more >><\/a><\/p>","protected":false},"author":46,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2346"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/46"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=2346"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2346\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=2346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=2346"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=2346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}