{"id":5317,"date":"2014-07-10T12:11:33","date_gmt":"2014-07-10T11:11:33","guid":{"rendered":"http:\/\/www.walkingrandomly.com\/?p=5317"},"modified":"2014-07-10T12:11:33","modified_gmt":"2014-07-10T11:11:33","slug":"a-random-walk-through-mathematica-10","status":"publish","type":"post","link":"https:\/\/walkingrandomly.com\/?p=5317","title":{"rendered":"A random walk through Mathematica 10"},"content":{"rendered":"<p><strong>Introduction<\/strong><\/p>\n<p>Mathematica 10 was released yesterday amid the usual marketing storm we&#8217;ve come to expect for a new product release from Wolfram Research. Some of the highlights of this marketing information include<\/p>\n<ul>\n<li><a href=\"http:\/\/blog.wolfram.com\/2014\/07\/09\/launching-mathematica-10-with-700-new-functions-and-a-crazy-amount-of-rd\/\">Mathematica 10 blog post by Stephen Wolfram<\/a><\/li>\n<li><a href=\"http:\/\/www.wolfram.com\/mathematica\/new-in-10\/\">What&#8217;s new in 10? From Wolfram Research<\/a><\/li>\n<li><a href=\"http:\/\/reference.wolfram.com\/language\/guide\/NewIn100AlphabeticalListing.html\">Alphabetical list of new functions<\/a><\/li>\n<\/ul>\n<p>Without a doubt, there is a lot of great new functionality in this release and I&#8217;ve been fortunate enough to have access to some pre-releases for a while now. \u00a0There is no chance that I can compete with the in-depth treatments given by Wolfram Research of the <a href=\"http:\/\/reference.wolfram.com\/language\/guide\/NewIn100AlphabeticalListing.html\">700+ new functions<\/a> in Mathematica 10 so I won&#8217;t try. \u00a0Instead, I&#8217;ll hop around some of the new features, settling on those that take my fancy.<\/p>\n<p><strong>Multiple Undo<\/strong><\/p>\n<p>I&#8217;ve been a Mathematica user since version 4 of the product which was released way back in 1999. \u00a0For the intervening 15 years, one aspect of Mathematica that always frustrated me was the fact that the undo feature could only undo the most recent action. I, along with many other users, repeatedly asked for multiple undo to be implemented but were bitterly disappointed for release after release.<\/p>\n<p>Few things have united Mathematica users more than the need for multiple undo:<\/p>\n<ul>\n<li><a href=\"http:\/\/undo-for-mathematica.alaifari.com\/\">A website with petition calling for multiple undo<\/a><\/li>\n<li><a href=\"https:\/\/www.facebook.com\/undoformathematica\">A Facebook page calling for multiple undo<\/a><\/li>\n<li><a href=\"http:\/\/mathematica.stackexchange.com\/questions\/1953\/implementing-efficient-multiple-undo\">A very popular Mathematica StackExchange question about multiple undo<\/a><\/li>\n<\/ul>\n<p>Finally, with version 10, our hopes and dreams have been answered and multiple undo is finally here. To be perfectly honest, THIS is the biggest reason to upgrade to version 10. Everything else is just tasty gravy.<\/p>\n<p><object width=\"560\" height=\"315\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,40,0\"><param name=\"allowFullScreen\" value=\"true\" \/><param name=\"allowscriptaccess\" value=\"always\" \/><param name=\"src\" value=\"\/\/www.youtube.com\/v\/r3DiJoUfC7s?hl=en_US&amp;version=3\" \/><param name=\"allowfullscreen\" value=\"true\" \/><\/object><\/p>\n<p><strong>Key new areas of functionality<\/strong><\/p>\n<p>Most of the things considered in this article are whimsical and only scratch the surface of what&#8217;s new in Mathematica 10. \u00a0I support Mathematica (and several other products) at the University of Manchester in the UK and so I tend to be interested in things that my users are interested in. Here&#8217;s a brief list of new functionality areas that I&#8217;ll be shouting about<\/p>\n<ul>\n<li><span style=\"line-height: 13px;\"><a href=\"http:\/\/reference.wolfram.com\/language\/guide\/MachineLearning.html\">Machine Learning<\/a>\u00a0I know several people who are seriously into machine learning but few of them are Mathematica users. \u00a0I&#8217;d love to know what they make of the things on offer here.<\/span><\/li>\n<li><a href=\"http:\/\/reference.wolfram.com\/language\/guide\/ImageProcessing.html\">New image processing functions<\/a>\u00a0The Image Processing Toolbox is one of the most popular MATLAB toolboxes on my site. I wonder if this will help turn MATLAB-heads. I also know people in a visualisation group who may be interested in the new 3D functions on offer.<\/li>\n<li><a href=\"http:\/\/reference.wolfram.com\/language\/guide\/NonlinearControlSystems.html\">Nonlinear control theory<\/a>Various people in our electrical engineering department are looking at alternatives to MATLAB for control theory. Maple\/Maplesim and Scilab\/Xcos are the key contenders. SystemModeler is too expensive for us to consider but the amount of control functionality built into Mathematica is useful.<\/li>\n<\/ul>\n<p><strong>Entities &#8211; a new data type for things that Mathematica knows stuff about<\/strong><\/p>\n<p>One of the new functions I&#8217;m excited about is <a href=\"http:\/\/reference.wolfram.com\/language\/ref\/GeoGraphics.html\">GeoGraphics<\/a> that pulls down map data from Wolfram&#8217;s servers and displays them in the notebook. \u00a0Obviously, I did not read the manual and so my first attempt at getting a map of the United Kingdom was<\/p>\n<pre>GeoGraphics[\"United Kingdom\"]<\/pre>\n<p>What I got was a map of my home town, Sheffield, surrounded by a red cell border indicating an error message<\/p>\n<p><a href=\"https:\/\/www.walkingrandomly.com\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-10-at-00.52.53.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5510\" alt=\"Screen Shot 2014-07-10 at 00.52.53\" src=\"https:\/\/www.walkingrandomly.com\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-10-at-00.52.53.png\" width=\"696\" height=\"626\" srcset=\"https:\/\/walkingrandomly.com\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-10-at-00.52.53.png 696w, https:\/\/walkingrandomly.com\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-10-at-00.52.53-300x269.png 300w\" sizes=\"auto, (max-width: 696px) 100vw, 696px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>The error message is &#8220;<em>United Kingdom is not a Graphics primitive or directive.&#8221;<\/em> \u00a0The practical upshot of this is that GeoGraphics is not built to take strings as arguments. \u00a0Fair enough, but why the map of Sheffield? \u00a0Well, if you call GeoGraphics[] on its own, the default action is to return a map centred on the GeoLocation found by considering your current IP address and it seems that it also does this if you send something bizarre to GeoGraphics. \u00a0In all honesty, I&#8217;d have preferred no map and a simple error message.<\/p>\n<p>In order to get what I want, I have to pass an <a href=\"http:\/\/reference.wolfram.com\/language\/ref\/Entity.html\">Entity<\/a>\u00a0that represents the UK to the GeoGraphics function. \u00a0Entities are a new data type in Mathematica 10 and, as far as I can tell, they formally represent &#8216;things&#8217; that Mathematica knows about. There are several ways to create entities but here I use the new <a href=\"http:\/\/reference.wolfram.com\/language\/ref\/Interpreter.html\">Interpreter<\/a> function<\/p>\n<p><a href=\"https:\/\/www.walkingrandomly.com\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-10-at-01.20.15.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5512\" alt=\"Screen Shot 2014-07-10 at 01.20.15\" src=\"https:\/\/www.walkingrandomly.com\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-10-at-01.20.15.png\" width=\"506\" height=\"770\" srcset=\"https:\/\/walkingrandomly.com\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-10-at-01.20.15.png 506w, https:\/\/walkingrandomly.com\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-10-at-01.20.15-197x300.png 197w\" sizes=\"auto, (max-width: 506px) 100vw, 506px\" \/><\/a><\/p>\n<p>From the above, you can see that Entities have a special new <a href=\"http:\/\/reference.wolfram.com\/language\/ref\/StandardForm.html\">StandardForm<\/a>\u00a0but their <a href=\"http:\/\/reference.wolfram.com\/language\/ref\/InputForm.html\">InputForm<\/a> looks straightforward enough. One thing to bear in mind here is <strong>that all of the above functions require a live internet connection in order to work<\/strong>. \u00a0For example, on thinking that I had gotten the hang of the Entity syntax, I switched off my internet connection and did<\/p>\n<pre>mycity = Entity[\"City\", \"Manchester\"]\r\n\r\nDuring evaluation of In[92]:= URLFetch::invhttp: Couldn't resolve host name. &gt;&gt;\r\n\r\nDuring evaluation of In[92]:= WolframAlpha::conopen: Using WolframAlpha requires internet connectivity. Please check your network connection. You may need to configure your firewall program or set a proxy in the Internet Connectivity tab of the Preferences dialog. &gt;&gt;\r\n\r\nOut[92]= Entity[\"City\", \"Manchester\"]<\/pre>\n<p>So, you need an internet connection even to create entities at this most fundamental level. \u00a0Perhaps it&#8217;s for validation? \u00a0Turning the internet connection back on and re-running the above command removes the error message but the thing that&#8217;s returned isn&#8217;t in the new StandardForm:<\/p>\n<p><a href=\"https:\/\/www.walkingrandomly.com\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-10-at-01.35.08.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5514\" alt=\"Screen Shot 2014-07-10 at 01.35.08\" src=\"https:\/\/www.walkingrandomly.com\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-10-at-01.35.08.png\" width=\"343\" height=\"42\" srcset=\"https:\/\/walkingrandomly.com\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-10-at-01.35.08.png 343w, https:\/\/walkingrandomly.com\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-10-at-01.35.08-300x36.png 300w\" sizes=\"auto, (max-width: 343px) 100vw, 343px\" \/><\/a><\/p>\n<p>If I attempt to display a map using the mycity variable, I get the map of Sheffield that I currently associate with something having gone wrong (If I&#8217;d tried this out at work,in Manchester, on the other hand, I would think it had worked perfectly!). \u00a0So, there is something very wrong with the entity I am using here &#8211; It doesn&#8217;t look right and it doesn&#8217;t work right &#8211; clearly that connection to WolframAlpha during its creation was not to do with validation (or if it was, it hasn&#8217;t helped). \u00a0I turn back to the Interpreter function:<\/p>\n<pre>In[102]:= mycity2 = Interpreter[\"City\"][\"Manchester\"] \/\/ InputForm\r\n\r\nOut[102]\/\/InputForm:= Entity[\"City\", {\"Manchester\", \"Manchester\", \"UnitedKingdom\"}]<\/pre>\n<p>So, clearly my guess at how a City entity should look was completely incorrect. \u00a0For now, I think I&#8217;m going to avoid creating Entities directly and rely on the various helper functions such as Interpreter.<\/p>\n<p><strong>What are the limitations of knowledge based computation in Mathematica?<\/strong><\/p>\n<p>All of the computable data resides in the <a href=\"http:\/\/www.wolfram.com\/knowledgebase\/\">Wolfram Knowledgebase<\/a>\u00a0which is a new name for the data store used by Wolfram Alpha, Mathematica and many other Wolfram products. In his recent blog post, Stephen Wolfram says that they&#8217;ll soon release the <a href=\"http:\/\/www.wolfram.com\/discovery-platform\/\">Wolfram Discovery Platform<\/a>\u00a0 which will allow large scale access to the Knowledgebase and indicated that <em><strong>&#8216;basic versions of\u00a0Mathematica\u00a010 are just set up for small-scale data access.&#8217;<\/strong><\/em> \u00a0I have no idea what this means and what limitations are in place and can&#8217;t find anything in the documentation.<\/p>\n<p>Until I understand what limitations there might be, I find myself unwilling to use these data-centric functions for anything important.<\/p>\n<p><strong>IntervalSlider &#8211; a new control for Manipulate<\/strong><\/p>\n<p>I&#8217;ll never forget the first time I saw a Mathematica <a href=\"http:\/\/reference.wolfram.com\/language\/ref\/Manipulate.html\">Manipulate<\/a> &#8211; it was at the <a href=\"http:\/\/internationalmathematicasymposium.org\/IMS2006\/\">2006 International Mathematica Symposium in Avignon<\/a>\u00a0when version 6 was still in beta. A Wolfram employee created a fully functional, interactive graphical user interface with just a few lines of code in about 2 minutes &#8211;I&#8217;d never seen anything like it and was seriously excited about the possibilities it represented.<\/p>\n<p>8 years and 4 Mathematica versions later and we can see just how amazing this interactive functionality turned out to be. It forms the basis of the <a href=\"http:\/\/demonstrations.wolfram.com\">Wolfram Demonstrations project<\/a> which currently has 9677 interactive demonstrations covering dozens of fields in engineering, mathematics and science.<\/p>\n<p>Not long after Mathematica introduced Manipulate, the <a href=\"http:\/\/www.sagemath.org\">sage team<\/a> introduced a similar function called interact. The interact function had something that Manipulate did not &#8211; an interval slider (see the interaction called <em>&#8216;Numerical integrals with various rules&#8217;<\/em> at <a href=\"http:\/\/wiki.sagemath.org\/interact\/calculus\">http:\/\/wiki.sagemath.org\/interact\/calculus<\/a> for an example of it in use). This control allows the user to specify intervals on a single slider and is very useful in certain circumstances.<\/p>\n<p>As of version 10, Mathematica has a similar control called an IntervalSlider. \u00a0Here&#8217;s some example code of it in use<\/p>\n<pre>Manipulate[\r\n pl1 = Plot[Sin[x], {x, -Pi, Pi}];\r\n pl2 = Plot[Sin[x], {x, range[[1]], range[[2]]}, Filling -&gt; Axis, \r\n   PlotRange -&gt; {-Pi, Pi}]; \r\n inset = Inset[\"The Integral is approx \" &lt;&gt; ToString[\r\n     NumberForm[\r\n      Integrate[Sin[x], {x, range[[1]], range[[2]]}]\r\n      , {3, 3}, ExponentFunction -&gt; (Null &amp;)]], {2, -0.5}];\r\n Show[{pl1, pl2}, Epilog -&gt; inset], {{range, {-1.57, 1.57}}, -3.14, \r\n  3.14, ControlType -&gt; IntervalSlider, Appearance -&gt; \"Labeled\"}]<\/pre>\n<p>and here&#8217;s the result:<\/p>\n<p><a href=\"https:\/\/www.walkingrandomly.com\/wp-content\/uploads\/2014\/07\/intervalslider1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5498\" alt=\"intervalslider\" src=\"https:\/\/www.walkingrandomly.com\/wp-content\/uploads\/2014\/07\/intervalslider1.png\" width=\"405\" height=\"321\" srcset=\"https:\/\/walkingrandomly.com\/wp-content\/uploads\/2014\/07\/intervalslider1.png 405w, https:\/\/walkingrandomly.com\/wp-content\/uploads\/2014\/07\/intervalslider1-300x237.png 300w\" sizes=\"auto, (max-width: 405px) 100vw, 405px\" \/><\/a><\/p>\n<p><strong>Associations &#8211; A new kind of brackets<\/strong><\/p>\n<p>Mathematica 10 brings a new fundamental data type to the language, associations. As far as I can tell, these are analogous to <a href=\"https:\/\/docs.python.org\/3\/tutorial\/datastructures.html#dictionaries\">dictionaries in Python<\/a>\u00a0or <a href=\"http:\/\/julia.readthedocs.org\/en\/latest\/stdlib\/base\/\">Julia<\/a>\u00a0since they consist of key,value pairs. \u00a0Since Mathematica has already used every bracket type there is, Wolfram Research have had to invent a new one for associations.<\/p>\n<p>Let&#8217;s create an association called scores that links 3 people to their test results<\/p>\n<pre>In[1]:= scores = &lt;|\"Mike\" -&gt; 50.2, \"Chris\" -&gt; 100.00, \"Johnathan\" -&gt; 62.3|&gt;\r\n\r\nOut[1]= &lt;|\"Mike\" -&gt; 50.2, \"Chris\" -&gt; 100., \"Johnathan\" -&gt; 62.3|&gt;<\/pre>\n<p>We can see that the Head of the scores object is Association<\/p>\n<pre>In[2]:= Head[scores]\r\n\r\nOut[2]= Association<\/pre>\n<p>We can pull out a value by supplying a key. For example, let&#8217;s see what value is associated with &#8220;Mike&#8221;<\/p>\n<pre>In[3]:= scores[\"Mike\"]\r\n\r\nOut[3]= 50.2<\/pre>\n<p>All of the usual functions you expect to see for dictionary-type objects are there:-<\/p>\n<pre>In[4]:= Keys[scores]\r\n\r\nOut[4]= {\"Mike\", \"Chris\", \"Johnathan\"}\r\n\r\nIn[5]:= Values[scores]\r\n\r\nOut[5]= {50.2, 100., 62.3}\r\n\r\nIn[6]:= (*Show that the key \"Bob\" does not exist in scores*)\r\nKeyExistsQ[scores, \"Bob\"]\r\n\r\nOut[6]= False<\/pre>\n<p>If you ask for a key that does not exist this happens:<\/p>\n<pre>In[7]:= scores[\"Bob\"]\r\n\r\nOut[7]= Missing[\"KeyAbsent\", \"Bob\"]<\/pre>\n<p>There&#8217;s a new function called Counts that takes a list and returns an association which counts the unique elements in the list:<\/p>\n<pre>In[8]:= Counts[{q, w, e, r, t, y, u, q, w, e}]\r\n\r\nOut[8]= &lt;|q -&gt; 2, w -&gt; 2, e -&gt; 2, r -&gt; 1, t -&gt; 1, y -&gt; 1, u -&gt; 1|&gt;<\/pre>\n<p>Let&#8217;s use this to find something out something interesting, such as the most used words in the classic text, Moby Dick<\/p>\n<pre>In[1]:= (*Import Moby Dick from Project gutenberg*)\r\n\r\nMobyDick = \r\n  Import[\"http:\/\/www.gutenberg.org\/cache\/epub\/2701\/pg2701.txt\"];\r\n(*Split into words*)\r\nwords = StringSplit[MobyDick];\r\n(*Convert all words to lowercase*)\r\n\r\nwords = Map[ToLowerCase[#] &amp;, words];\r\n(*Create an association of words and corresponding word count*)\r\n\r\nwordcounts = Counts[words];\r\n(*Sort the association by key value*)\r\n\r\nwordcounts = Sort[wordcounts, Greater];\r\n(*Show the top 10*)\r\nwordcounts[[1 ;; 10]]\r\n\r\nOut[6]= &lt;|\"the\" -&gt; 14413, \"of\" -&gt; 6668, \"and\" -&gt; 6309, \"a\" -&gt; 4658, \r\n \"to\" -&gt; 4595, \"in\" -&gt; 4116, \"that\" -&gt; 2759, \"his\" -&gt; 2485, \r\n \"it\" -&gt; 1776, \"with\" -&gt; 1750|&gt;<\/pre>\n<p>All told, associations are a useful addition to the Mathematica language and I&#8217;m happy to see them included. \u00a0Many existing functions have been updated to handle Associations making them a fundamental part of the language.<\/p>\n<ul>\n<li><span style=\"line-height: 13px;\"><a href=\"http:\/\/mathematica.stackexchange.com\/questions\/52393\/how-to-make-use-of-associations\">How to make use of Associations?<\/a> &#8211; a question from Mathematica Stack Exchange<\/span><\/li>\n<\/ul>\n<p><strong>s\/Mathematica\/Wolfram Language\/g<\/strong><\/p>\n<p>I&#8217;ve been programming in Mathematica for well over a decade but the language is no longer called &#8216;Mathematica&#8217;, it&#8217;s now called &#8216;The Wolfram Language.&#8217; \u00a0I&#8217;ll not lie to you, this grates a little but I guess I&#8217;ll just have to get used to it. \u00a0Flicking through the documentation, it seems that a global search and replace has happened and almost every occurrence of &#8216;Mathematica&#8217; has been changed to &#8216;The Wolfram Language&#8217;<\/p>\n<p>This is part of a huge marketing exercise for Wolfram Research and I guess that part of the reason for doing it is to shift the emphasis away from mathematics to general purpose programming. \u00a0I wonder if this marketing push will increase the popularity of The Wolfram Language as measured by the <a href=\"http:\/\/www.tiobe.com\/index.php\/content\/paperinfo\/tpci\/index.html\">TIOBE index<\/a>?\u00a0Neither &#8216;Mathematica&#8217; or &#8216;The Wolfram Language&#8217; is listed in the top 100 and last time I saw more detailed results <a href=\"http:\/\/meta.mathematica.stackexchange.com\/questions\/1152\/looking-ahead-to-wolfram-language\">had it at number 128<\/a>.<\/p>\n<p><strong>Fractal exploration<\/strong><\/p>\n<p>One of Mathematica&#8217;s competitors, <a href=\"http:\/\/www.maplesoft.com\/products\/Maple\/\">Maple<\/a>, had a new release recently which saw the inclusion of a set of <a href=\"http:\/\/www.maplesoft.com\/products\/maple\/new_features\/maple18\/fractals.aspx\">fractal exploration functions<\/a>. Although I found this a fun and interesting addition to the product, I did think it rather an odd thing to do. \u00a0After all, if any software vendor is stuck for functionality to implement, there is a whole host of things to do that rank higher in most user&#8217;s list of priorities than a function that plots a standard fractal.<\/p>\n<p>It seems, however, that both Maplesoft and Wolfram Research have seen a market for such functionality. \u00a0Mathematica 10 comes with a set of functions for exploring the Mandelbrot and Julia sets. The Mandelbrot set alone accounts for at least 5 of Mathematica 10&#8217;s 700 new functions:- <a href=\"http:\/\/reference.wolfram.com\/language\/ref\/MandelbrotSetBoettcher.html\">MandelbrotSetBoettcher<\/a>,\u00a0<a href=\"http:\/\/reference.wolfram.com\/language\/ref\/MandelbrotSetDistance.html\">MandelbrotSetDistance<\/a>,\u00a0<a href=\"http:\/\/reference.wolfram.com\/language\/ref\/MandelbrotSetIterationCount.html\">MandelbrotSetIterationCount<\/a>, <a href=\"http:\/\/reference.wolfram.com\/language\/ref\/MandelbrotSetMemberQ.html\">MandelbrotSetMemberQ<\/a> and <a href=\"http:\/\/reference.wolfram.com\/language\/ref\/MandelbrotSetPlot.html\">MandelbrotSetPlot<\/a>.<\/p>\n<pre>MandelbrotSetPlot[]<\/pre>\n<p><a href=\"https:\/\/www.walkingrandomly.com\/wp-content\/uploads\/2014\/07\/mandel10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5499\" alt=\"mandel10\" src=\"https:\/\/www.walkingrandomly.com\/wp-content\/uploads\/2014\/07\/mandel10.png\" width=\"360\" height=\"352\" srcset=\"https:\/\/walkingrandomly.com\/wp-content\/uploads\/2014\/07\/mandel10.png 360w, https:\/\/walkingrandomly.com\/wp-content\/uploads\/2014\/07\/mandel10-300x293.png 300w\" sizes=\"auto, (max-width: 360px) 100vw, 360px\" \/><\/a><\/p>\n<p><strong>Barcodes<\/strong><\/p>\n<p>I found this more fun than is reasonable! \u00a0Mathematica can generate and recognize bar codes and QR codes in various formats. \u00a0For example<\/p>\n<pre>BarcodeImage[\"www.walkingrandomly.com\", \"QR\"]\r\n\r\n<a href=\"https:\/\/www.walkingrandomly.com\/wp-content\/uploads\/2014\/07\/wr-qr.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5518\" alt=\"wr-qr\" src=\"https:\/\/www.walkingrandomly.com\/wp-content\/uploads\/2014\/07\/wr-qr.png\" width=\"150\" height=\"150\" \/><\/a><\/pre>\n<p>Scanning the result using my mobile phone brings me right back home :)<\/p>\n<p><strong>Unit Testing<\/strong><\/p>\n<p>A decent unit testing framework is essential to anyone who&#8217;s planning to do serious software development. Python has had one for years, MATLAB got one in 2013a and now Mathematica has one. \u00a0This is good news! \u00a0I&#8217;ve not had chance to look at it in any detail, however. For now, I&#8217;ll simply nod in approval and <a href=\"http:\/\/reference.wolfram.com\/language\/tutorial\/UsingTheTestingFramework.html\">send you to the documentation<\/a>. Opinions welcomed.<\/p>\n<p><strong>Disappointments in Mathematica 10<\/strong><\/p>\n<p>There&#8217;s a lot to like in Mathematica 10 but there&#8217;s also several aspects that disappointed me<\/p>\n<p><strong>No update to RLink<\/strong><\/p>\n<p>Version 9 of Mathematica included integration with R which excited quite a few people I work with. Sadly, it seems that there has been no work on RLink at all between version 9 and 10. \u00a0Issues include:<\/p>\n<ul>\n<li><span style=\"line-height: 13px;\">The version of R bundled with RLink is stuck at 2.14.0 which is almost 3 years old. On Mac and Linux, it is not possible to use your own installation of R so we really are stuck with 2.14. On Windows, it is possible to use your own installation of R but CHECK THAT version 3 issue has been fixed\u00a0<a href=\"http:\/\/mathematica.stackexchange.com\/questions\/27064\/rlink-and-r-v3-0-1\">http:\/\/mathematica.stackexchange.com\/questions\/27064\/rlink-and-r-v3-0-1<\/a><\/span><\/li>\n<li>It is only possible to install extra R packages on Windows. Mac and Linux users are stuck with just base R.<\/li>\n<\/ul>\n<p>This lack of work on RLink really is a shame since the original release was a very nice piece of work.<\/p>\n<p>If the combination of R and notebook environment is something that interests you, I think that the current best solution is to use the <a href=\"http:\/\/nbviewer.ipython.org\/github\/ipython\/ipython\/blob\/3607712653c66d63e0d7f13f073bde8c0f209ba8\/docs\/examples\/notebooks\/rmagic_extension.ipynb\">R magics from within the IPython notebook<\/a>.<\/p>\n<p><strong>No update to CUDA\/OpenCL functions<\/strong><\/p>\n<p>Mathematica introduced <a href=\"http:\/\/www.wolfram.com\/mathematica\/new-in-8\/cuda-and-opencl-support\/\">OpenCL and CUDA functionality back in version 8 <\/a>but very little appears to have been done in this area since. In contrast, MATLAB has improved on its CUDA functionality (it has never supported OpenCL) every release since its introduction in 2010b and is now superb!<\/p>\n<p>Accelerating computations using GPUs is a big deal at the University of Manchester (my employer) which has a <a href=\"http:\/\/wiki.rac.manchester.ac.uk\/community\/GPU\/Club\">GPU-club<\/a> made up of around 250 researchers. Sadly, I&#8217;ll have nothing to report at the next meeting as far as Mathematica is concerned.<\/p>\n<p><strong>FinancialData is broken (and this worries me more than you might expect)<\/strong><\/p>\n<p>I wrote <a href=\"https:\/\/www.walkingrandomly.com\/?p=4571\">some code a while ago<\/a> that used the FinancialData function and it suddenly stopped working because of some issue with the underlying data source. In short, this happens:<\/p>\n<pre>In[12]:= FinancialData[\"^FTAS\", \"Members\"]\r\n\r\nOut[12]= Missing[\"NotAvailable\"]<\/pre>\n<p>This wouldn&#8217;t be so bad if it were not for the fact that an example given in Mathematica&#8217;s own documentation fails in exactly the same way! The documentation in both version 9 and 10 give this example:<\/p>\n<pre>In[1]:= FinancialData[\"^DJI\", \"Members\"]\r\n\r\nOut[1]= {\"AA\", \"AXP\", \"BA\", \"BAC\", \"CAT\", \"CSCO\", \"CVX\", \"DD\", \"DIS\", \\\r\n\"GE\", \"HD\", \"HPQ\", \"IBM\", \"INTC\", \"JNJ\", \"JPM\", \"KFT\", \"KO\", \"MCD\", \\\r\n\"MMM\", \"MRK\", \"MSFT\", \"PFE\", \"PG\", \"T\", \"TRV\", \"UTX\", \"VZ\", \"WMT\", \\\r\n\"XOM\"}<\/pre>\n<p>but what you actually get is<\/p>\n<pre>In[1]:= FinancialData[\"^DJI\", \"Members\"]\r\n\r\nOut[1]= Missing[\"NotAvailable\"]<\/pre>\n<p>For me, the implications of this bug are far more reaching than a few broken examples. \u00a0Wolfram Research are making a big deal of the fact that Mathematica gives you access to computable data sets, data sets that you can just use in your code and not worry about the details.<\/p>\n<p>Well, I did just as they suggest, and it broke!<\/p>\n<p><strong>Summary<\/strong><\/p>\n<p>I&#8217;ve had a lot of fun playing with Mathematica 10 but that&#8217;s all I&#8217;ve really done so far &#8211; play &#8211; something that&#8217;s probably obvious from my choice of topics in this article. Even through play, however, I can tell you that this is a very solid new release with some exciting new functionality. Old-time Mathematica users will want to upgrade for multiple-undo alone and people new to the system have an awful lot of toys to play with.<\/p>\n<p>Looking to the future of the system, I feel excited and concerned in equal measure. There is so much new functionality on offer that it&#8217;s almost overwhelming and I love the fact that its all integrated into the core system. I&#8217;ve always been grateful of the fact that Mathematica hasn&#8217;t gone down the route of hiving functionality off into add-on products like MATLAB does with its numerous toolboxes.<\/p>\n<p>My concerns center around the data and Stephen Wolfram&#8217;s comment\u00a0<em><strong>&#8216;basic versions of\u00a0Mathematica\u00a010 are just set up for small-scale data access.&#8217;<\/strong><\/em>\u00a0 What does this mean? What are the limitations and will this lead to serious users having to purchase add-ons that would effectively be data-toolboxes?<\/p>\n<p><strong>Final<\/strong><\/p>\n<p>Have you used Mathematica 10 yet? If so, what do you think of it? Any problems? What&#8217;s your favorite function?<\/p>\n<p><strong>Mathematica 10 links<\/strong><\/p>\n<ul>\n<li><span style=\"line-height: 13px;\"><a href=\"https:\/\/www.walkingrandomly.com\/?p=5220\">Playing with Mathematica on Raspberry Pi<\/a> &#8211; The Raspberry Pi was the first platform that saw Mathematica version 10&#8230;and it&#8217;s free!\u00a0<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Mathematica 10 was released yesterday amid the usual marketing storm we&#8217;ve come to expect for a new product release from Wolfram Research. Some of the highlights of this marketing information include Mathematica 10 blog post by Stephen Wolfram What&#8217;s new in 10? From Wolfram Research Alphabetical list of new functions Without a doubt, there [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,8],"tags":[],"class_list":["post-5317","post","type-post","status-publish","format-standard","hentry","category-math-software","category-mathematica"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3swhs-1nL","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/5317","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5317"}],"version-history":[{"count":23,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/5317\/revisions"}],"predecessor-version":[{"id":5522,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/5317\/revisions\/5522"}],"wp:attachment":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}