<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel rdf:about="https://community.wolfram.com">
    <title>Community RSS Feed</title>
    <link>https://community.wolfram.com</link>
    <description>RSS Feed for Wolfram Community showing any discussions tagged with Tuning and Debugging sorted by most replies.</description>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2330900" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2492644" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1763688" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/293403" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2594664" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2571515" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/148526" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/849935" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3127782" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2567421" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1855244" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/438659" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/316036" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/209069" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/227021" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1549861" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1047708" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/912524" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/286203" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/290818" />
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2330900">
    <title>[WSG21] Daily Study Group: programming tutorials</title>
    <link>https://community.wolfram.com/groups/-/m/t/2330900</link>
    <description>Daily Study Groups are back, now providing expertise on practical programming! After a short break, we&amp;#039;re starting up with a series that picks up where Wolfram Language Basics sessions ended. This 3-week series will take you from basic programming concepts to package development. &#xD;
&#xD;
Need tips on improving your code’s speed or functionality? Programming Tutorials offer a great opportunity to level-up your skills while interacting with software development professionals. See hands-on examples and get questions answered by Wolfram Language experts. Plus: participants who pass weekly quizzes are awarded a program completion certificate. Level 1 certification is available for those who pass manually graded exercises. &#xD;
&#xD;
Join us any time between August 2 and August 20! Check out our [registration page][1] for more details.&#xD;
&#xD;
&#xD;
&#xD;
 [1]: https://wolfr.am/Study_Group15</description>
    <dc:creator>Wolfram U</dc:creator>
    <dc:date>2021-07-30T15:24:02Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2492644">
    <title>The grey &amp;#039;x&amp;#039;  and Debugging WL code</title>
    <link>https://community.wolfram.com/groups/-/m/t/2492644</link>
    <description>I am still unexperienced in WL, but I have come to a point that I can create some programs that are getting a tiny bit more complex (still quite modest though) :-)&#xD;
&#xD;
But I often run into very basic things I just can&amp;#039;t figure out. So I hope someone can direct me a bit :&#xD;
&#xD;
1. Inside a Dynamic, I get the grey small &amp;#039;x&amp;#039;  if I do not &amp;#039;close a line with the semicolon (;).&#xD;
    That is annoying, because the script stops working as planned (as it interpretes the &amp;#039;x&amp;#039; as a multiply sign) in an unintended way.&#xD;
&#xD;
2. In a Dynamic[   xxxxxx   ], why does the last line have to be WITHOUT semicolon (;)   ?&#xD;
&#xD;
3. How can I best view the values of the variables I use inside Dynamic? I did that by leaving out the semi-colon, as to output the result, but as I mentioned, that does not work inside a Dynamic script.&#xD;
Sometimes though this works and the annoying grey &amp;#039;x&amp;#039; does not appear.&#xD;
can I switch off the automatic behavior of &amp;#039;filling in a x&amp;#039; for me when the are spaces? I can myself put &amp;#039;*&amp;#039; if I want a multiplication to occur.&#xD;
&#xD;
4. I am used to a debugger, where I can set Breakpoints and a Variable Watcher. How is serious debugging being done in WL?</description>
    <dc:creator>B. Cornas</dc:creator>
    <dc:date>2022-03-18T18:09:39Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1763688">
    <title>[LiVE] Request for suggestions for a livestreamed &amp;#034;Bugs Review&amp;#034; event</title>
    <link>https://community.wolfram.com/groups/-/m/t/1763688</link>
    <description>**Update: This event is scheduled for 9/6/2019 at 3:30pm US Central timezone.**&#xD;
&#xD;
We are planning to have our live-streamed &amp;#034;Bugs Review&amp;#034; event soon, where Stephen Wolfram will discuss issues (bugs: incorrect behaviors, crashes, hangs, performance issues, etc.) that you care the most about. If you plan to attend and to help prepare for this event, please reply to this post with issues in the Wolfram Language (including the Notebook Interface) you think are the most important to discuss.&#xD;
&#xD;
Thanks!</description>
    <dc:creator>Arnoud Buzing</dc:creator>
    <dc:date>2019-08-14T17:04:55Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/293403">
    <title>Issues with AstronomicalData and SunPosition</title>
    <link>https://community.wolfram.com/groups/-/m/t/293403</link>
    <description>TL;DR
---
I have three issues with getting sun positions in Mathematica V10:

 - It is extremely slow compared to V9
 - It doesn&amp;#039;t *seem* to yield correct results
 - a) It needs an Internet connection, which b) is not assured to always return results and c) if not used optimally can easily consume your monthly allowance of W|A calls

Long story
===
With the advent of V10 `AstronomicalData` has been deprecated, as shown on its documentation page:
![enter image description here][1].

I&amp;#039;m not an astronomer, so my main use of this function has been restricted to its capability to get the sun position using functions calls like this:

    {
      AstronomicalData[&amp;#034;Sun&amp;#034;, {&amp;#034;Azimuth&amp;#034;, {2013, 3, 1, #, 0, 0}, {52.37`, 4.89`}}, TimeZone -&amp;gt; 1], 
      AstronomicalData[&amp;#034;Sun&amp;#034;, {&amp;#034;Altitude&amp;#034;, {2013, 3, 1, #, 0, 0}, {52.37`, 4.89`}},  TimeZone -&amp;gt; 1]
    } &amp;amp; /@ Range[0, 23]

&amp;gt; {{341.47732, -43.93930}, {2.33417, -45.21747}, {22.94232, -43.19133},
&amp;gt; {41.52167, -38.28400}, {57.55208, -31.30276}, {71.47253, -23.03159},
&amp;gt; {84.02194, -14.08294}, {95.91940, -4.92723}, {107.80166, 4.03418}, {120.23770, 12.40167}, {133.72303, 19.72563}, {148.59433, 
&amp;gt;   25.48377}, {164.84179, 29.12209}, {181.93103, 30.19428}, {198.91284,
&amp;gt;    28.55117}, {214.89602, 24.41962}, {229.46400, 
&amp;gt;   18.28613}, {242.70064, 10.70703}, {254.98998, 
&amp;gt;   2.19073}, {266.84760, -6.82566}, {278.85594, -15.94505},  {291.66723, -24.75464}, {306.00911, -32.75641}, {322.57956, 
&amp;gt; -39.29877}}

So, this gets me the sun positions in steps of an hour during a particular day in Amsterdam (TZ 1).

The same call still works in V10, though it now returns numbers with units; degrees in this case. On its first call, it reads some paclet information from a Wolfram server, but on any successive call no Internet connection is needed. I will be going into detail about timing further on, but I&amp;#039;ll say here that the V10 function takes about three times longer than its V9 namesake. I blame the addition of units for that.

With `AstronomicalData` apparently deprecated we are supposed to use its successors. In this case I need `SunPosition`. A direct translation of the above would be:

    SunPosition[GeoPosition[{52.37`, 4.89`}], DateObject[{2013, 3, 1, #, 0, 0}, TimeZone -&amp;gt; 1]] &amp;amp; /@ Range[0, 23]

&amp;gt; {{95.7, -5.1}, {107.6, 3.9}, {120.0, 12.3}, {133.5, 19.6}, {148.3, 25.4}, {164.5, 29.1}, {181.6, 30.2}, {198.6, 28.6}, {214.6, 24.5}, {229.2, 18.4}, {242.5, 10.9}, {254.8, 2.4}, {266.6, -6.7}, {278.6, -15.8}, {291.4, -24.6}, {305.7, 
-32.6}, {322.2, -39.2}, {341.3, -43.5}, {2.0, -44.8}, {22.5, -42.9}, 
{41.1, -38.0}, {57.1, -31.1}, {71.0, -22.9}, {83.6, -13.9}}

As with the new `AstronomicalData` the output is actually in degrees which I have removed in the above output for the sake of clarity. There are a few things to note:

 - `SunPosition` uses position and date objects, the latter being new in V10
 - `SunPosition` does not have a `TimeZone` option, but you can set it in `DateObject`
 - `SunPosition` can use the old lat/long list position indication. It also can use a date list to enter the date instead of a `DateObject`. In the latter case you are out of options with respect to time zones and you have to add the appropriate amount of time offset
 - It is extremely slow, and it may even time-out: 

![enter image description here][2]

 - Last but not least: the results seem to be plain wrong. It suggests that sunrise is somewhat before 1 am, which is -of course- incorrect. I assume that this has something to do with a `$GeoLocation` setting for the observer of the sun positions, but I haven&amp;#039;t managed to sort out what I am supposed to enter to get the correct sun positions for the location provided in the same call.

As to timing: I noticed very inconsistent timings for `SunPosition` compared to `AstronomicalData`, so I used the following code to collect a somewhat more statistical  sound sample:

    SetAttributes[timingTest, HoldFirst];
    timingTest[code_, repeats_Integer] :=
       Table[
          ClearSystemCache[];
          code // AbsoluteTiming // First,
          {repeats}
        ]

Using this, I collected timing of 20 calls to the following code snippets:

 - `AstronomicalData` V9 and V10: As above
 - `SunPosition`: As above
 - `SunPosition` without `GeoPosition`, just the lat/long list.
 - `SunPosition`  without `GeoPosition`, and also without the `DateObject` date, just a classical date list (with the hour set to +1 to accommodate TZ 1)
 - `SunPosition` V10 without `GeoPosition` and with the `Map` (`/@`) gone and replaced by a `DateRange` inside the call.

In the last case, the returned value is a `TimeSeries` object from which I extract the positions using the `&amp;#034;Paths&amp;#034;` method:

     SunPosition[{52.37`, 4.89`}, DateRange[{2013, 3, 1, 1, 0, 0}, {2013, 3, 1, 24, 0, 0}, &amp;#034;Hour&amp;#034;]][&amp;#034;Paths&amp;#034;][[1, All, 2]]

The results were as follows:

![enter image description here][3]

Clearly, the `SunPosition` results are very disappointing. Getting the sun positions with `SunPosition` is almost 40 times slower than using the old V9 method (which, I should add, wasn&amp;#039;t particularly quick either. I have an implementation in Mathematica code which is faster). The V10 implementation of `AstronomicalData` is also more than three times slower than the V9 version. The `DateRange` version of the call saves a lot of communication overhead. Still, it is almost *five times slower* than in V9.

The cause of all this slowness is that `SunPosition` simply does a call to Wolfram|Alpha. Sniffing the communication one sees the following string passed to the server:

    &amp;#034;1:eJxTTMoPSuNgYGAoZgESPpnFJcHcQEZwaV5AfnFmSWZ+XhoTsmxR/6GvGjH9wg4Qhr6XQxobsnzmXXYGhkxmIC+TEUSIgwggZihigIJgoAIGj/yizKr8PJigA5yBZtubwB1yrdxeDkXVIuvcH1aJOBRzAqUcS0vycxNLMpMBSAArww==&amp;#034;

which can be turned into readable form using `Uncompress`:

    {&amp;#034;SunPosition&amp;#034;, {4.89, 52.37}, {2013, 3, 1, 23, 0, 0.}, &amp;#034;Horizon&amp;#034;, 2., 2., {52.09, 5.12}, Automatic}

Here, we can recognize the lat/long of the position I used (but with lat/long reversed - Is this somehow significant?). At the end is my own `$GeoLocation`, but I don&amp;#039;t believe it is used at all (and it shouldn&amp;#039;t: I&amp;#039;m asking for the sun position over Amsterdam, not where I live). Changing it with `Block` I get the same results:

    Block[{$GeoLocation = GeoPosition[{52.37`, 40.89`}]}, SunPosition[{52.37`, 4.89`}, {2013, 3, 1, 1, 0, 0}]]

Apart from the slowness, there&amp;#039;s the issue of the necessary Internet connectivity (Want to give a demonstration and you don&amp;#039;t have Internet? Sorry, you&amp;#039;re out of luck). 

And what of the use of W|A calls? Each of the `SunPosition` tests (except the last one) took me 20 * 24 = 480 calls. So this part of my testing only already took 1440 calls, and one should be reminded that a typical Home Use license allows for only 3,000 calls per month. Things like this can go pretty fast. In fact, I once wrote an application that calculates the impact of building changes on shadows around your house throughout the year. It does in the order of 17,000 `AstronomicalData` calls. I couldn&amp;#039;t implement that naively using `SunPosition` and have it actually work. Clearly, one should now use the `DateRange` version of the call as much as possible.

----------

To wrap up: I have one real question, i.e., how to get `SunPosition` to return the same values as `AstronomicalData`, and a request to the WRI team: please put `SunPosition` in the kernel and don&amp;#039;t use W|A calls, because the situation as it is now is rather annoying and IMHO a real step backwards.

  [1]: /c/portal/getImageAttachment?filename=AstronomicalData.png&amp;amp;userId=43903
  [2]: /c/portal/getImageAttachment?filename=timeout.png&amp;amp;userId=43903
  [3]: /c/portal/getImageAttachment?filename=results.png&amp;amp;userId=43903</description>
    <dc:creator>Sjoerd de Vries</dc:creator>
    <dc:date>2014-07-13T16:39:48Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2594664">
    <title>A DL framework for financial time series using WT SAE and LSTM</title>
    <link>https://community.wolfram.com/groups/-/m/t/2594664</link>
    <description>Ahead of denoising OHLC data using a Haar DWT I am getting an error with AdjustedOHLCV despite using what appears to be the correct function and syntax. The first step is to apply a Haar wavelet to the OHLCV data before feeding this to technical indicators. Thank you in advance for any input here to replicate this paper&amp;#039;s results in Wolfram if that&amp;#039;s possible.&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/08c695e6-6232-4fef-939a-9cb0a845b986</description>
    <dc:creator>Warren Tou</dc:creator>
    <dc:date>2022-08-10T12:56:05Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2571515">
    <title>Solve doesn&amp;#039;t like roots</title>
    <link>https://community.wolfram.com/groups/-/m/t/2571515</link>
    <description>In[6]:= Solve[x^(1/3) == -1, x]&#xD;
    &#xD;
    Out[6]= {}&#xD;
    &#xD;
    In[7]:= -1^((1/3))&#xD;
    &#xD;
    Out[7]= -1</description>
    <dc:creator>Frank Kampas</dc:creator>
    <dc:date>2022-07-15T16:03:29Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/148526">
    <title>Chromatic polynomials for custom graphs</title>
    <link>https://community.wolfram.com/groups/-/m/t/148526</link>
    <description>1 ) How to use the math functions over graphs  that are not in the data graph of Mathematica?
2 ) How to compute Chromatic Poynomials for a graph introduced by myself ?</description>
    <dc:creator>Reinaldo Giudici</dc:creator>
    <dc:date>2013-11-04T13:57:36Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/849935">
    <title>VoronoiMesh: user error, tetgen error, else?</title>
    <link>https://community.wolfram.com/groups/-/m/t/849935</link>
    <description>I found some unusual error in VoronoiMesh. I have the points *pts*, and first I compute the VoronoiMesh for that, Note the red circle: these are two close datapoints, and it correctly draws a line between them.&#xD;
&#xD;
&#xD;
    dom=1.25\[Pi] (* domain size *)&#xD;
    domspec=Transpose[{{0,0},{dom,dom}}] &#xD;
    pts={{1.880951464600067`,1.473752017061138`},{1.8913812543459405`,2.319493673670671`},{1.7674367495794008`,3.5325088938533917`},{1.9320143413972677`,3.611151717969884`},{1.8107126970778207`,3.6790935311559876`},{1.804725058474518`,3.8520729911980185`},{1.805368854133445`,3.852728507949241`},{1.563939776616803`,3.9192958794919646`}};&#xD;
    VoronoiMesh[pts,domspec,Epilog-&amp;gt;{Point[pts],Red,Circle[pts[[6]],0.1]},PlotRange-&amp;gt;domspec,ImageSize-&amp;gt;500,PlotRangePadding-&amp;gt;Scaled[.05]]&#xD;
   &#xD;
![enter image description here][1]&#xD;
&#xD;
&#xD;
Now, I add points around it (to make the Voronoi periodic), leaving the old ones, and only adding more points *around* it. Then the voronoi is not correctly computed:&#xD;
&#xD;
    allpts=Join@@Join@@Table[p+dom {i,j},{i,-1,1},{j,-1,1},{p,pts}];  (* add groups of points around it, making it periodic *)&#xD;
    VoronoiMesh[allpts,Epilog-&amp;gt;{Point[pts],Red,Circle[pts[[6]],0.1]},PlotRange-&amp;gt;domspec,ImageSize-&amp;gt;500,PlotRangePadding-&amp;gt;Scaled[.05]]&#xD;
&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
I have millions and millions of points and it took me several hours to &amp;#039;minimize&amp;#039; the error and go to the core of it. &#xD;
&#xD;
Any help is welcome! Is there some option that controls when two points are considered the same? It looks like some points are deleted because they are too close?&#xD;
&#xD;
The distance between point 6 and 7 is:&#xD;
&#xD;
    Log10[Norm[pts[[6]] - pts[[7]]]]&#xD;
&#xD;
-3.03678&#xD;
&#xD;
So it should not be some machine-precision issue I presume!  If someone can confirm it on different versions that would be appreciated.&#xD;
&#xD;
This is done in 10.4.1 and 10.3.1 on Mac, both show the error.&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2016-05-03at16.23.33.png&amp;amp;userId=73716&#xD;
  [2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2016-05-03at16.24.30.png&amp;amp;userId=73716</description>
    <dc:creator>Sander Huisman</dc:creator>
    <dc:date>2016-05-03T14:33:03Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3127782">
    <title>Why does the memory used keep going up and no output is given?</title>
    <link>https://community.wolfram.com/groups/-/m/t/3127782</link>
    <description>This actually eventually crashed my hard drive, after memory exceeded several Gigabytes. I wonder if it can be improved?&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/7e88b0dc-72e4-4410-b923-eb5cd54f3edf</description>
    <dc:creator>Iuval Clejan</dc:creator>
    <dc:date>2024-02-21T22:30:03Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2567421">
    <title>Reducing the iteration time involving If?</title>
    <link>https://community.wolfram.com/groups/-/m/t/2567421</link>
    <description>I want to know why the speed its not doubled, if in this computation the procces seems parallel to me.&#xD;
&#xD;
Given a matrix 6M rows and 2 columns I want to know how many rows have the same value, say ones for this example&#xD;
&#xD;
    mat = Array[RandomInteger[5] &amp;amp;, {6000000, 2}]; &#xD;
if a loop over the 6 million rows and compare if the column 1 and coloumn 2 have the number say 1 for this example, I get this result&#xD;
&#xD;
    num1=0;&#xD;
    AbsoluteTiming[For[i=1, i&amp;lt;=6000000,i++,&#xD;
    If[mat[[i,1]]==1 &amp;amp;&amp;amp; mat[[i,2]]==1 ,num1=num1+1];&#xD;
    ]]Print[num1]&#xD;
 the result is 7.46366 seconds.&#xD;
&#xD;
Now if I loop to 3 million but in two parts one from row i to 3M, second from i+3M&#xD;
&#xD;
    num1=0; num2=0;&#xD;
    AbsoluteTiming[For[i=1, i&amp;lt;= 3000000,i++,&#xD;
    If[mat[[i,1]]==1 &amp;amp;&amp;amp; mat[[i,2]]==1 ,num1=num1+1];&#xD;
    If[mat[[i+3000000,1]]==1 &amp;amp;&amp;amp; mat[[i+3000000,2]]==1 ,num2=num2+1];&#xD;
    ]]Print[num1+num2]&#xD;
&#xD;
the result is  6.75842 seconds; I was expecting max 4 seconds. Why the time is not half if the range of the loop is half?</description>
    <dc:creator>Legibus Motus</dc:creator>
    <dc:date>2022-07-10T01:27:51Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1855244">
    <title>The Most Convenient Keyboard Shortcuts Ever</title>
    <link>https://community.wolfram.com/groups/-/m/t/1855244</link>
    <description>Here are two simple but extremely convenient keyboard shortcuts that I&amp;#039;ve used for years. &#xD;
&#xD;
 - This post is a favor to all my friends who type slowly (like me)&#xD;
 - These shortcuts simply create a pair of brackets containing a template placeholder as the current new selection&#xD;
 - Essentially, it&amp;#039;s just a stripped-down version of the bulky (Command + Shift + K + Up/Down Arrow + Enter) completion&#xD;
&#xD;
**Favorite Shortcut #1:** &#xD;
Autocomplete single brackets by pressing `CommandKey + [`&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
**Favorite Shortcut #2:** Autocomplete part brackets by pressing `CommandKey + ]`&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
## How to set them up ##&#xD;
&#xD;
On MacOS, first make a backup of the following file, in case you break it:&#xD;
&#xD;
    FileNameJoin[{$InstallationDirectory, &amp;#034;SystemFiles/FrontEnd/TextResources/Macintosh/KeyEventTranslations.tr&amp;#034;}];&#xD;
&#xD;
On my machine this path resolves to: *&amp;#034;/Applications/Mathematica.app/Contents/SystemFiles/FrontEnd/TextResources/Macintosh/KeyEventTranslations.tr&amp;#034;*&#xD;
&#xD;
Then, preferably in a non-Mathematica editor (e.g. Sublime), open the above file and copy-and-paste these following code into the list inside `EventTranslations`. For the first shortcut:&#xD;
&#xD;
    Item[KeyEvent[&amp;#034;[&amp;#034;,Modifiers-&amp;gt;{Command}],FrontEndExecute[{FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],&amp;#034;[\[SelectionPlaceholder]]&amp;#034;],FrontEndToken[&amp;#034;MovePreviousPlaceHolder&amp;#034;]}]]&#xD;
    &#xD;
And for the second (of course making sure they are separated by a comma):&#xD;
&#xD;
    Item[KeyEvent[&amp;#034;]&amp;#034;,Modifiers-&amp;gt;{Command}],FrontEndExecute[{FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],&amp;#034;\[LeftDoubleBracket]\[SelectionPlaceholder]\[RightDoubleBracket]&amp;#034;],FrontEndToken[&amp;#034;MovePreviousPlaceHolder&amp;#034;],FrontEndToken[&amp;#034;MovePreviousPlaceHolder&amp;#034;]}]]&#xD;
    &#xD;
Finally, restart Mathematica, and presto, they should both be working. And to remove the shortcuts, simply remove those items or replace the .tr file with the backup.&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=own.gif&amp;amp;userId=900170&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=part.gif&amp;amp;userId=900170</description>
    <dc:creator>Michael Sollami</dc:creator>
    <dc:date>2020-01-08T20:42:08Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/438659">
    <title>Cos[ Cos[\[Theta]]] Cosh[ Sin[\[Theta]]] slow in Integrate[]</title>
    <link>https://community.wolfram.com/groups/-/m/t/438659</link>
    <description>Why does the function in the title take over 2 minutes to Integrate?&#xD;
&#xD;
AbsoluteTiming[&#xD;
 Integrate[&#xD;
  Cos[ Cos[\[Theta]]] Cosh[ Sin[\[Theta]]], {\[Theta], 0, 2 Pi}]]&#xD;
&#xD;
Mathematica 10, iMac w. OS 10.9.3</description>
    <dc:creator>Gary Palmer</dc:creator>
    <dc:date>2015-02-09T22:10:57Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/316036">
    <title>Problem with printing many solutions V10</title>
    <link>https://community.wolfram.com/groups/-/m/t/316036</link>
    <description>Hi everyone&#xD;
&#xD;
Since I moved up to V10 I am finding the amount of work I can do is diminishing due to the way V10 seems to work, this is the major problem that seems to cause the most headache.  If as a result of a computation there are many solutions and I wish to print them on screen, (many as in more than a thousand) Mathematica doesn&amp;#039;t start printing until all solutions have been found, then it prints them out, you can see it is printing as the scroll bar on the right of the window starts to move but the screen remains empty until it has finished.  To me this is not acceptable as many times I set something going not knowing there are going to be many solutions, the screen then goes blank, I don&amp;#039;t know where it is in the computation so I can fine tune it because its not printing anything.  using abort etc is useless as it has already sent many solutions to the print cue and until that has finished you might as well forget it.  It is now time to re-boot as the only way to stop it. &#xD;
&#xD;
So is anyone else finding the same?&#xD;
&#xD;
Here is a small example where because there are over 5000 solutions the screen remains blank until all have been found.&#xD;
&#xD;
    a = Range[2000]; b = Subsets[a, {2}]^3; list = &#xD;
     Reap[Do[Sow[{b[[q]], Total[b[[q]]]}], {q, 1, Length[b]}]]; list = &#xD;
     list[[2]]; list = Partition[Flatten[list], 3]; list = &#xD;
     SortBy[list, #[[3]] &amp;amp;]; &#xD;
    Do[If[list[[q, 3]] == list[[q + 1, 3]], &#xD;
       Print[TextCell[&#xD;
         Row[{ExpressionCell[Power[list[[q, 1]], (3)^-1]]^3, &amp;#034;+&amp;#034;, &#xD;
           ExpressionCell[Power[list[[q, 2]], (3)^-1]]^3, &amp;#034; = &amp;#034;, &#xD;
           ExpressionCell[Power[list[[q + 1, 1]], (3)^-1]]^3, &amp;#034;+&amp;#034;, &#xD;
           ExpressionCell[Power[list[[q + 1, 2]], (3)^-1]]^3, &amp;#034; = &amp;#034;, &#xD;
           ExpressionCell[list[[q, 3]]]}]]]], {q, 1, &#xD;
       Length[list] - 1}] // Timing&#xD;
&#xD;
Paul.</description>
    <dc:creator>Paul Cleary</dc:creator>
    <dc:date>2014-08-11T11:16:09Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/209069">
    <title>Optimize Function Module using NMinimize</title>
    <link>https://community.wolfram.com/groups/-/m/t/209069</link>
    <description>I defined a simulation as a module with simulation parameters as the variables. I want to find optimal simulation parameters using NMinimize method. I noticed that my simulation module will run successfully for any sample parameters, but when used in NMinimize will not execute. Please see below a very simplified version of the code:
[mcode]demand[n_, k_] := Min[k Vf, n capacity];
supply[n_, k_] := Min[(n Kj - k) w, n capacity];
flo[n_, Ku_, Kd_] := Min[demand[n, Ku], supply[n, Kd]];
dx = Vf*dt; capacity =w*Vf*Kj/(Vf + w); Kj = 150.; w = 20.; Vf = 100.;
n = Round[Flen/dx]; m = Round[SimTime/dt]; p = Round[Rlen/dx]; RMLocation = Round[(2/3) p];
\[Alpha][a1_] := 1800.; \[Beta][a2_] := 0.1; L = 1.; Flen = 4.; Rlen = 3.; delta = 1.; SimTime = 15./60.; dt = 6./3600.;
f[a_] := Module[{k0 = ConstantArray[0, n],kr = Table[Table[0, {i1, 1, p}], {i2, 1, n}], \[Gamma] = ConstantArray[1, n], \[Phi]},
  Clear[j]; j = 0;
  RM[x_, t_] := 100 a; k = k0;
  For[i = 2, i &amp;lt; n, i++, kr[[i, 1]] = \[Alpha][i dx] delta/Vf];
  NtwrkTT = TT = Plus @@ (Plus @@ kr);
  While[TT &amp;gt; 0,
   For[i = 2, i &amp;lt; n, i++,
    FQin = If[i == 2, Min[demand[L, k0[[i - 1]]], supply[L, k0[[i]]]],FQout];
    dem = demand[L, k0[[i]]]; dem = If[dem == 0, 0.001, dem];
    \[Gamma][[i]] = Min[1, supply[L, k0[[i + 1]]]/dem];
    \[Phi] = \[Gamma][[i]] demand[1, kr[[i, p]]]/delta;
    Qr = (\[Phi] - \[Beta][i dx] FQin) dx;
    FQout = Min[demand[L, k0[[i]]], supply[L, k0[[i + 1]]]];
    k[[i]] = k0[[i]] + (FQin - FQout + Qr)/Vf; kr0 = kr[[i]];
    For[ir = 2, ir &amp;lt;= p, ir++,
     MR = If[ir == RMLocation + 1, RM[i dx, j dt], capacity];
     RQin = Min[MR, If[ir == 2, flo[1, kr0[[ir - 1]], kr0[[ir]]], RQout]];
     MR = If[ir == RMLocation, RM[i dx, j dt], capacity];
     RQout = Min[MR, If[ir &amp;lt; p,flo[1, kr0[[ir]], kr0[[ir + 1]]], \[Phi] delta]];
     kr[[i, ir]] = kr0[[ir]] + (RQin - RQout)/Vf];
    kr[[i, 1]] = If[j &amp;lt;= m, \[Alpha][i dx] delta/Vf, 0]];
   TT = Plus @@ (Plus @@ kr);
   TT += Plus @@ k;
   k0 = k; NtwrkTT += TT; j++];
  NtwrkTT dt]
NMinimize[{f[a], 3 &amp;lt;= a &amp;lt;= 12 &amp;amp;&amp;amp; Element[a, Integers]}, a, Method -&amp;gt; &amp;#034;SimulatedAnnealing&amp;#034;, EvaluationMonitor :&amp;gt; Print[&amp;#034;a = &amp;#034;, a]][/mcode]</description>
    <dc:creator>brama gatech</dc:creator>
    <dc:date>2014-02-27T18:57:06Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/227021">
    <title>RAM and disk space are being filled up?</title>
    <link>https://community.wolfram.com/groups/-/m/t/227021</link>
    <description>Due to my reckless use of [i]Mathematica[/i], now I have very little free space on my hard drive.&#xD;
More precisely, the memory consumption appears to have occured due to execution of some unthinkable functions and quiting.&#xD;
&#xD;
The problem persists if I relaunch [i]Mathematica[/i], and even after rebooting.&#xD;
&#xD;
I regret my behavior, and I will be very grateful if someone tells me how can I free my space back.</description>
    <dc:creator>Sandu Ursu</dc:creator>
    <dc:date>2014-03-28T21:18:11Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1549861">
    <title>Performance of recursion code with radial polynomials</title>
    <link>https://community.wolfram.com/groups/-/m/t/1549861</link>
    <description>Consider the following code:&#xD;
&#xD;
    Clear[r, re, p, pmax, delta, imagesize, delta]&#xD;
        ClearSystemCache[]&#xD;
        re[0, r_] := Sqrt[8/Pi]*((1 - r)/r)^(1/4)*1; &#xD;
        re[1, r_] := Sqrt[8/Pi]*((1 - r)/r)^(1/4)*-1*2*(1 - 2*r); &#xD;
        re[p_, r_] := re[p, r] = Sqrt[8/Pi]*((1 - r)/r)^(1/4)*(-1)^p*(re[1, r]*re[p - 1, r] - re[p - 2, r]); &#xD;
        imagesize = 32; &#xD;
        pmax = 10; &#xD;
        delta = 2/imagesize; &#xD;
        Table[r = Sqrt[x^2 + y^2]; re[pmax, r], {x, -1 + delta/2, 1 - delta/2, delta}, {y, 1 - delta/2, -1 + delta/2, -delta}]; &#xD;
&#xD;
&#xD;
when the imagesize and pmax increase, the time will become unacceptable. So, I would ask if we can use compile of other methods to speed up,like: for imagesize is 256 and pmax is 120, the time will be about 10 seconds. In my code, I also use the memoization to store the value during the evaluation which I will use in the future.</description>
    <dc:creator>look xu</dc:creator>
    <dc:date>2018-11-14T00:34:36Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1047708">
    <title>Benchmarking: unexplained switching between high and low performance</title>
    <link>https://community.wolfram.com/groups/-/m/t/1047708</link>
    <description>This is a cross-post of a question I asked today on [StackExchange][1].&#xD;
&#xD;
----&#xD;
&#xD;
_**tl;dr** I am trying to accurately benchmark some vectorized operations, and compare them between systems.  But benchmarking is hard to do well, and I am getting inconsistent results: performance is switching, apparently randomly, between &amp;#034;slow&amp;#034; and &amp;#034;fast&amp;#034;. **Why?**_&#xD;
&#xD;
Here is some code that benchmarks adding two packed arrays of size `n`, where `n` is just above a million.  The timing is measured 5 times, to ensure consistency, then `n` is increased a bit, then the summation is timed again, etc.  The whole benchmark is repeated twice. &#xD;
&#xD;
    Table[&#xD;
     n = 1000000 + k;&#xD;
     SeedRandom[120];&#xD;
     a = RandomReal[1, n];&#xD;
     b = RandomReal[1, n];&#xD;
     {k, Table[First@RepeatedTiming[a + b;], {5}]},&#xD;
     {2}, {k, 20000, 200000, 20000}&#xD;
     ]&#xD;
&#xD;
The results are below.  In each row, the first number is the array size, the rest are the 5 timings.&#xD;
&#xD;
    {{ {20000, {0.000799, 0.000801, 0.000797, 0.000804, 0.000800}}, &#xD;
       {40000, {0.00224, 0.00225, 0.00223, 0.00224, 0.00223}}, &#xD;
       {60000, {0.00226, 0.00226, 0.00227, 0.00226, 0.00226}}, &#xD;
       {80000, {0.00229, 0.00229, 0.00229, 0.00229, 0.00229}}, &#xD;
      {100000, {0.00087, 0.000868, 0.000874, 0.000873, 0.00089}}, &#xD;
      {120000, {0.00235, 0.00236, 0.00235, 0.00236, 0.00235}}, &#xD;
      {140000, {0.00240, 0.00240, 0.00240, 0.00239, 0.00240}}, &#xD;
      {160000, {0.00245, 0.00246, 0.00245, 0.00246, 0.00245}}, &#xD;
      {180000, {0.00097, 0.000964, 0.000965, 0.000961, 0.000963}}, &#xD;
      {200000, {0.00255, 0.00258, 0.00254, 0.00256, 0.00254}}}, &#xD;
    &#xD;
       {{20000, {0.00224, 0.00224, 0.00224, 0.00220, 0.00221}}, &#xD;
        {40000, {0.00224, 0.00224, 0.00223, 0.00224, 0.00223}},&#xD;
        {60000, {0.00227, 0.00227, 0.00227, 0.00226, 0.00227}},&#xD;
        {80000, {0.00234, 0.00235, 0.00233, 0.00230, 0.00230}},&#xD;
       {100000, {0.00233, 0.00232, 0.00232, 0.00233, 0.00233}}, &#xD;
       {120000, {0.00234, 0.00238, 0.00235, 0.00239, 0.00237}}, &#xD;
       {140000, {0.00238, 0.00238, 0.00238, 0.00238, 0.00238}}, &#xD;
       {160000, {0.00247, 0.00245, 0.00245, 0.00246, 0.00245}}, &#xD;
       {180000, {0.000965, 0.000961, 0.000962, 0.000967, 0.000968}}, &#xD;
       {200000, {0.00254, 0.00259, 0.00255, 0.00254, 0.00254}}}}&#xD;
&#xD;
Things to notice:&#xD;
&#xD;
 - The 5 timings for the same array are always consistent.&#xD;
 - The timings are generally proportional to the array size.&#xD;
 - However, I see some &amp;#034;fast&amp;#034; (about 0.0008 s) and some &amp;#034;slow&amp;#034; (about 0.002 s) timings.&#xD;
 - Between the two runs, it is not always the same array size that is fast. Look at 20,000, 80,000 and 180,000 in the first run and 180,000 in the second run.  These change randomly between runs.&#xD;
 - &amp;#034;Slow&amp;#034; and &amp;#034;fast&amp;#034; differ by a very significant factor of about 2.5-2.6.&#xD;
&#xD;
**Why do I see this switching between fast and slow timing?  What is causing it?**  It prevents me from getting consistent benchmark results.&#xD;
&#xD;
[![enter image description here][2]][3]&#xD;
&#xD;
----&#xD;
&#xD;
The measurements were done with Mathematica 11.1.0 on a 2014 MacBook Pro (`Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz`, 4 cores) connected to AC power.  [Turbo Boost][4] is disabled using [this tool](https://github.com/rugarciap/Turbo-Boost-Switcher).&#xD;
&#xD;
I closed other programs as much as possible (but there are always many background tasks on a modern OS).&#xD;
&#xD;
----&#xD;
&#xD;
You might think that such short timings are not relevant in real-world applications. But remember that `RepeatedTiming` repeats the operation enough times to run for at least a second.  I still get some fast timings if I increase this to as many as 15 seconds, or if I run the test many times consecutively.&#xD;
&#xD;
I compared `RepeatedTiming` with `AbsoluteTiming@Do[..., {bigNumber}]`, and there is no difference (other than the occasional fast-slow switching).&#xD;
&#xD;
I noticed that longer arrays are less likely to produce fast timings than shorter ones, but I am not sure. I also noticed that running a long one tends to cause the subsequent short one to be slow again.  Due to the fickle nature of the results, it is hard to be sure about these things.&#xD;
&#xD;
----&#xD;
&#xD;
On first sight, this may not look like a Mathematica question.  But benchmarking is hard, and many things can go wrong.  If I post it on another site, people may rightfully suspect that it is something specific to Mathematica that is causing it.&#xD;
&#xD;
I believe that vector arithmetic is parallelized in Mathematica. There is an interesting talk [here][5] by Mark Sofroniou from WTC2016, which also discusses how the stragety used to distribute parlallel threads between cores can have a significant impact on performance. &#xD;
&#xD;
&#xD;
  [1]: http://mathematica.stackexchange.com/q/141350/12&#xD;
  [2]: https://i.stack.imgur.com/WoxC0.png&#xD;
  [3]: https://i.stack.imgur.com/WoxC0.png&#xD;
  [4]: https://en.wikipedia.org/wiki/Intel_Turbo_Boost&#xD;
  [5]: https://www.youtube.com/watch?v=pzjhFF0wJiw</description>
    <dc:creator>Szabolcs Horvát</dc:creator>
    <dc:date>2017-03-30T13:24:35Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/912524">
    <title>Avoid high processor usage while running TreeForm/@NestList[#^#&amp;amp;,x,4] ?</title>
    <link>https://community.wolfram.com/groups/-/m/t/912524</link>
    <description>When I run&#xD;
&#xD;
    TreeForm/@NestList[#^#&amp;amp;,x,4]&#xD;
&#xD;
In version 11, the third output just keeps blinking. Processor usage stays high on the kernel process even after executing.&#xD;
&#xD;
Anybody experiencing this?</description>
    <dc:creator>Jackreece Ejini</dc:creator>
    <dc:date>2016-08-24T17:30:19Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/286203">
    <title>Slow Summation of values produced by recursive function</title>
    <link>https://community.wolfram.com/groups/-/m/t/286203</link>
    <description>Hi,
I have defined a recursive function using memoization

    f[t_,x_]:=f[t,x]= ......

then i need to execute some sums like this

    marg = -Sum[j*f[0, j], {j, -100, 100}];
this sum takes up to 0.85 sec in order to be executed, depending on the function (actually I have more recursive functions, and i use one sum like the previous one for each. Hence, my algorithm speed overall is too slow, resulting in 4,50 seconds about).

I tried two alternative methods to improve speed but unsuccesfully

1)  using tables, and then function total, like this


     pinakas = Table[i*f[0, i], {i, 0, 100}]
     Total[pinakas]

2) using for function instead of Sum

    s2=0
    For[

    i=0,i&amp;lt;=100,i++,

    s2=s2+f[0,?]

    ]

All methods (i guess thats logical) yield the same times more or less. I have setup my algorithm in an excel file, and while serial, my algorithm is superfast. I cannot understand why, but if I print all values needed from my function, print is instant (which means that each f[0,i] is really fast calculated) but this sum is so slow. 

I though that It would be wise to limit precision somehow in my f[0,i] values, since I only need 3-4 digits, but I do not know how to exactly perform that. I even used decimals instead of integers (1.0 instead of 1 for example) as suggested in various guides, but this resulted in a decrease of speed.

So here I am, asking for your assistance.. unfortunately I cannot provide community with actual code, but I would appreciate any tip or assistance.

Regards</description>
    <dc:creator>Tom Zinger</dc:creator>
    <dc:date>2014-07-02T15:14:19Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/290818">
    <title>Mathematica V10 execution time has grown up to 12% to 45% from V9</title>
    <link>https://community.wolfram.com/groups/-/m/t/290818</link>
    <description>A simple example: RosettaCode&amp;#039;s [Universal Turing Machine][1]
(5-state, 2-symbol probable Busy Beaver machine from Wikipedia)
In V9 time = 225 seconds, in V10 322 seconds   (Windows i5 desktop).
 
Not much to do but hope for better performance.  I think I hear more disk swapping but that&amp;#039;s not measured (yet).


  [1]:http://rosettacode.org/wiki/Universal_Turing_machine#Mathematica</description>
    <dc:creator>Douglas Kubler</dc:creator>
    <dc:date>2014-07-10T20:23:05Z</dc:date>
  </item>
</rdf:RDF>

