{"id":4102,"date":"2012-12-14T10:35:11","date_gmt":"2012-12-14T15:35:11","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=4102"},"modified":"2012-12-14T13:52:49","modified_gmt":"2012-12-14T18:52:49","slug":"a-conversation-about-managing-file-exchange-downloads","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2012\/12\/14\/a-conversation-about-managing-file-exchange-downloads\/","title":{"rendered":"A conversation about managing File Exchange downloads"},"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:\/\/blogs.mathworks.com\/pick\/2012\/12\/07\/tell-us-what-you-want-to-read-about\/\">Jiro's post last week<\/a> prompted a lot of very interesting comments. Today, Jiro and I would like to share publicly a discussion we had about one\r\n         of them. (We'll be considering some of the others in future posts.)\r\n      <\/p>\r\n   <\/introduction>\r\n   <p><b>Brett:<\/b>   Jiro, last week you wrote an open letter, asking people for their input on topics they'd like to see in the POTW blog.\r\n      We've been getting some really interesting (and <i>legitimate<\/i> --I think we owe some people some swag!) ideas.  I was particularly intrigued by <a href=\"https:\/\/blogs.mathworks.com\/pick\/2012\/12\/07\/tell-us-what-you-want-to-read-about\/#comments\">Sven's comment<\/a>. Sven asked if every serious MATLABber has a &#8220;File Exchange&#8221; folder on his or her path. I hadn't thought about the ways people\r\n      manage their downloads, but now I'm really curious.\r\n   <\/p>\r\n   <p>Personally, I have a directory called &#8220;MFILES&#8221; that I <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/addpath.html\">add to my path<\/a>, <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/genpath.html\">recursively<\/a>, on <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/startup.html\">startup<\/a>. Within that directory, I have many sub-directories, including one I call &#8220;DOWNLOADS.&#8221; Submissions I get from the File Exchange\r\n      typically go there, each in its own folder that I label with some descriptive name that helps me know at a glance what it\r\n      contains.\r\n   <\/p>\r\n   <p>Is that similar to your file-management approach?<\/p>\r\n   <p><b>Jiro:<\/b> That's sort of similar to my approach. I also have a folder where I put all the files I downloaded from the File Exchange.\r\n      I call it &#8220;FEXDownloads.&#8221; Inside that folder, I have a folder for each entry. However, I don't have any of them on my MATLAB\r\n      path. I use that as a place to keep track of everything I downloaded and tested. If I find any of the entries useful for my\r\n      daily use, I move that content to a different folder called &#8220;MyReceivedFiles,&#8221; which is on my MATLAB path.\r\n   <\/p>\r\n   <p>I'm not very consistent on how I organize the files in &#8220;MyReceivedFiles,&#8221; though. Initially, I put all the functions directly\r\n      under this folder. But that quickly started to make the function list large, and occasionally some of the function names would\r\n      clash with my own functions. Then, I started to put some of them into <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/matlab_oop\/scoping-classes-with-packages.html\">packages<\/a>. This way, I can create additional namespaces. For example, I have a folder called &#8220;+WordPress&#8221; inside &#8220;MyReceivedFiles&#8221;\r\n      (which is a utility I got from a colleague to publish my blog posts), and I call it like this:\r\n   <\/p>\r\n   <p>WordPress.wordpress_publish('my_blogpost');<\/p>\r\n   <p>Sven had another great question about * <i>versioning<\/i> * . The File Exchange does have a &#8220;Watch this File&#8221; option to be alerted when a file gets updated. But aside from that, you\r\n      have to manually download and manage the versioning, right? Do you have any other tips?\r\n   <\/p>\r\n   <p><b>Brett:<\/b> I've been known to move downloaded files off my path&#8212;particularly if I find they create namespace issues, or if they are\r\n      buggy or poorly executed. (There are some great files on the File Exchange, but there are some that aren't great, too.) But\r\n      my default is that they start out on my path. The packaging idea is a good one; I might have to try that.\r\n   <\/p>\r\n   <p>I wish I had some great tips to share regarding downloading updated files, beyond simply &#8220;watching&#8221; the ones you're interested\r\n      in, reading the update notes, and manually downloading when a bug is fixed or something interesting is added. Automatic updating\r\n      is an intriguing idea, but one that frightens me a bit. If we ever got to that point, I would absolutely move all of my direct\r\n      downloads off-path by default, and only move them onto my path after I've had time to validate them.\r\n   <\/p>\r\n   <p><b>Jiro:<\/b> Right. Because the File Exchange is very open (very little moderating), you do have to be careful about the quality and test\r\n      them before you are comfortable to add them to your path.\r\n   <\/p>\r\n   <p>Well, I wonder how other community people manage File Exchange downloads.<\/p>\r\n   <p><b>Brett:<\/b> <i>How about it, readers?<\/i> Does anyone have a different approach to managing File Exchange downloads (or for keeping abreast of changes to their favorites)\r\n      that they'd like to share? Tell us about them <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=4102#respond\">here<\/a>!\r\n   <\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_58eb7a3856594ed3b25ca6b781ba4eb4() {\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='58eb7a3856594ed3b25ca6b781ba4eb4 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 58eb7a3856594ed3b25ca6b781ba4eb4';\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 = 'Brett Shoelson';\r\n        copyright = 'Copyright 2012 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_58eb7a3856594ed3b25ca6b781ba4eb4()\"><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; R2012b<br><\/p>\r\n<\/div>\r\n<!--\r\n58eb7a3856594ed3b25ca6b781ba4eb4 ##### SOURCE BEGIN #####\r\n%% A conversation about managing File Exchange downloads\r\n%\r\n% <https:\/\/blogs.mathworks.com\/pick\/2012\/12\/07\/tell-us-what-you-want-to-read-about\/\r\n% Jiro's post last week> prompted a lot of very interesting comments.\r\n% Today, Jiro and I would like to share publicly a discussion we had about\r\n% one of them. (We'll be considering some of the others in future posts.)\r\n% \r\n%%\r\n% *Brett:*   Jiro, last week you wrote an open letter, asking people for\r\n% their input on topics they'd like to see in the POTW blog. We've been\r\n% getting some really interesting (and _legitimate_ REPLACE_WITH_DASH_DASHI think we owe\r\n% some people some swag!) ideas.  I was particularly intrigued by \r\n% <https:\/\/blogs.mathworks.com\/pick\/2012\/12\/07\/tell-us-what-you-want-to-read-about\/#comments Sven's comment>.\r\n% Sven asked if every serious MATLABber has a \u00e2\u20ac\u0153File Exchange\u00e2\u20ac\ufffd folder on his\r\n% or her path. I hadn't thought about the ways people manage their\r\n% downloads, but now I'm really curious.\r\n% \r\n%%\r\n% Personally, I have a directory called \u00e2\u20ac\u0153MFILES\u00e2\u20ac\ufffd that I <https:\/\/www.mathworks.com\/help\/matlab\/ref\/addpath.html add to my path>,\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/genpath.html recursively>, on \r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/startup.html startup>.\r\n% Within that directory, I have many sub-directories, including one I\r\n% call \u00e2\u20ac\u0153DOWNLOADS.\u00e2\u20ac\ufffd Submissions I get from the File Exchange typically go\r\n% there, each in its own folder that I label with some descriptive name\r\n% that helps me know at a glance what it contains.\r\n\r\n%%\r\n% Is that similar to your file-management approach?\r\n% \r\n%%\r\n% *Jiro:* That's sort of similar to my approach. I also have a folder where I\r\n% put all the files I downloaded from the File Exchange. I call it\r\n% \u00e2\u20ac\u0153FEXDownloads.\u00e2\u20ac\ufffd Inside that folder, I have a folder for each entry.\r\n% However, I don't have any of them on my MATLAB path. I use that as a\r\n% place to keep track of everything I downloaded and tested. If I find any\r\n% of the entries useful for my daily use, I move that content to a\r\n% different folder called \u00e2\u20ac\u0153MyReceivedFiles,\u00e2\u20ac\ufffd which is on my MATLAB path.\r\n% \r\n% I'm not very consistent on how I organize the files in \u00e2\u20ac\u0153MyReceivedFiles,\u00e2\u20ac\ufffd\r\n% though. Initially, I put all the functions directly under this folder.\r\n% But that quickly started to make the function list large, and\r\n% occasionally some of the function names would clash with my own\r\n% functions. Then, I started to put some of them into <https:\/\/www.mathworks.com\/help\/matlab\/matlab_oop\/scoping-classes-with-packages.html packages>. This way, I\r\n% can create additional namespaces. For example, I have a folder called\r\n% \u00e2\u20ac\u0153+WordPress\u00e2\u20ac\ufffd inside \u00e2\u20ac\u0153MyReceivedFiles\u00e2\u20ac\ufffd (which is a utility I got from a\r\n% colleague to publish my blog posts), and I call it like this:\r\n% \r\n% WordPress.wordpress_publish('my_blogpost');\r\n% \r\n% Sven had another great question about * _versioning_ * . The File Exchange does\r\n% have a \u00e2\u20ac\u0153Watch this File\u00e2\u20ac\ufffd option to be alerted when a file gets updated.\r\n% But aside from that, you have to manually download and manage the\r\n% versioning, right? Do you have any other tips?\r\n% \r\n%%\r\n% *Brett:* I've been known to move downloaded files off my path\u00e2\u20ac\u201dparticularly\r\n% if I find they create namespace issues, or if they are buggy or poorly\r\n% executed. (There are some great files on the File Exchange, but there are\r\n% some that aren't great, too.) But my default is that they start out on\r\n% my path. The packaging idea is a good one; I might have to try that.\r\n% \r\n% I wish I had some great tips to share regarding downloading updated\r\n% files, beyond simply \u00e2\u20ac\u0153watching\u00e2\u20ac\ufffd the ones you're interested in, reading\r\n% the update notes, and manually downloading when a bug is fixed or\r\n% something interesting is added. Automatic updating is an intriguing idea,\r\n% but one that frightens me a bit. If we ever got to that point, I would\r\n% absolutely move all of my direct downloads off-path by default, and only\r\n% move them onto my path after I've had time to validate them.\r\n% \r\n%%\r\n% *Jiro:* Right. Because the File Exchange is very open (very little\r\n% moderating), you do have to be careful about the quality and test them\r\n% before you are comfortable to add them to your path.\r\n% \r\n% Well, I wonder how other community people manage File Exchange downloads.\r\n% \r\n%%\r\n% *Brett:* _How about it, readers?_ Does anyone have a different approach to\r\n% managing File Exchange downloads (or for keeping abreast of changes to\r\n% their favorites) that they'd like to share? Tell us about them\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=4102#respond here>!\r\n\r\n##### SOURCE END ##### 58eb7a3856594ed3b25ca6b781ba4eb4\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   \r\n      Jiro's post last week prompted a lot of very interesting comments. Today, Jiro and I would like to share publicly a discussion we had about one\r\n         of them. (We'll be considering... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2012\/12\/14\/a-conversation-about-managing-file-exchange-downloads\/\">read more >><\/a><\/p>","protected":false},"author":34,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[26,16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/4102"}],"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\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=4102"}],"version-history":[{"count":9,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/4102\/revisions"}],"predecessor-version":[{"id":4111,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/4102\/revisions\/4111"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=4102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=4102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=4102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}