Skip to main content
40 votes
Accepted

Interrogating a running evaluation

For simplistic purposes there is Evaluate in Subsession which is in the Evaluation menu, and has the shortcut key F7 under Windows & Linux (and alt+shift+enter under macOS). Simply make a new ...
Mr.Wizard's user avatar
  • 272k
34 votes

Interrogating a running evaluation

Update The other answers provide a good way to add dynamic monitoring using a single kernel when access to the front end is available. The method I proposed using multiple kernels will work even when ...
Carl Woll's user avatar
  • 131k
29 votes
Accepted

How do I disable the stack tracing feature in Mathematica 11?

Is there a possibility to disable stack tracing, but keep messages? Internal`$MessageMenu = False reverts back to the old messages. Seems to do the trick and ...
ktm's user avatar
  • 4,242
28 votes

Debugging with Breakpoints

I believe I've figured out the correct way to use breakpoints :D The Chinese edition of this answer can be found here. In short, Breakpoints can only be set on a non-atomic incomplete expression, ...
xzczd's user avatar
  • 66.9k
26 votes

How do I disable the stack tracing feature in Mathematica 11?

Analysis current as of Mathematica version 11.0.1 and 11.1.0. We can disable the Show Stack Trace item in the new message menu as follows: ...
WReach's user avatar
  • 69k
21 votes

Debugging with Breakpoints

There is a fundamental problem with breakpoints and Mathematica: Mathematica code is not typically attached to a source code file. It simply exists in-memory as a set of transformation rules on ...
Szabolcs's user avatar
  • 235k
21 votes

Interrogating a running evaluation

Here is a quick solution in case you do not want / can not play with additional Kernels. Steps Assuming, the calculation already started: create e.g. an input cell, just by typing below Show cell ...
Kuba's user avatar
  • 137k
20 votes
Accepted

How can I interrupt a calculation without aborting it?

The menu item is gone, but the functionality is still there in version 11.0. It can be accessed by a keyboard shortcut: Command-Option-. on OS X Alt-...
Szabolcs's user avatar
  • 235k
18 votes
Accepted

Why does Unevaluated applied (@@) to a held expression not work?

The action of the symbol Unevaluated is due to a special rule within the evaluator that occurs at a very specific time during the evaluation process. ...
WReach's user avatar
  • 69k
16 votes
Accepted

How to debug the C code for LibraryLink?

Update: The very likely reason for the garbled error messages is that you have a Chinese version of Visual Studio printing errors in Chinese, and there is a mismatch in the character encoding of ...
Szabolcs's user avatar
  • 235k
16 votes
Accepted

Easy printing of executable code

You could define a function similar to Echo with the difference that it won't evaluate its argument before printing. ...
Szabolcs's user avatar
  • 235k
15 votes
Accepted

A more appropriate way to use RuntimeTools`Profile

Update Here's a new version that doesn't require a stylesheet: ...
Carl Woll's user avatar
  • 131k
13 votes

How to find the name of the current function?

If a current evaluation rule contains/uses OptionsPattern[] then you can abuse the fact that OptionName[a] is replaced by ...
Kuba's user avatar
  • 137k
12 votes
Accepted

How to globally disable and re-enable Echo?

Echo has an autoload, so you need to make sure the symbol is autoloaded before you modify its values: ...
Carl Woll's user avatar
  • 131k
10 votes

How to make a custom Echo

Here is how I would approach this: ...
Alexey Popkov's user avatar
10 votes

Profiling a package

This is not an ideal answer, but it is possible with Workbench, this is how (thanks to Szabolcs): Install Workbench as an Eclipse plugin following this http://support.wolfram.com/kb/27221 (choose the ...
Jansen's user avatar
  • 1,223
8 votes

Automatically add debug contents to a program

In your example, a message is issued at the problem. You want to find out where the message comes from. The debugger is pretty good at this. Just enable the debugger, then enable Break at Messages, ...
Szabolcs's user avatar
  • 235k
8 votes

How do I identify the source of a "Tag times protected" error?

After reading this and this answer, I noticed that the debugger is also useful for identifying the error source in this case. You just need to: Go to Evaluation and check on Debugger. Check on Break ...
xzczd's user avatar
  • 66.9k
8 votes

How to get frame around every function without any evaluation?

Update A slightly cleaner version of my first answer: ...
Carl Woll's user avatar
  • 131k
8 votes

Trace works differently with different right-hand-side rules—bug?

CW because it's too long a comment. A small difference that is not even part of the traced evaluation causes the same behavior as in the OP: ...
7 votes

How to debug the C code for LibraryLink?

For me (Windows 10) I get a readable error message like So I add mint saved;. Compiling again I get which leads me to change your ...
Rolf Mertig's user avatar
  • 17.2k
7 votes

Wolfram Workbench - Mathematica Development Alternatives

New plugin for Geany editor https://github.com/Ludwiggle/wolfram-geany . It has autocompletion, documentation pop-ups, basic syntax highlighter, it runs wolfram scipts by pressing F5 without ...
Fortsaint's user avatar
  • 2,060
7 votes

How to find the name of the current function?

Well, you can exploit OptionValue for this purpose, but of course this is not the answer you are looking for: ...
István Zachar's user avatar
7 votes

How to get frame around every function without any evaluation?

But each function needs the use of separate Framed[] function Will solve it by using RuleDelayed and Replace with levelspec. ...
Johu's user avatar
  • 4,948
7 votes
Accepted

An example of symmetric, real entry matrix with non-real eigenvalues, according to Mathematica. Is this a bug?

I would say it's not a bug. Be aware that $MaxMachineNumber is around 10^308. In your situation, when Mathematica is fed with ...
luyuwuli's user avatar
  • 2,814
7 votes

Is there a builtin function to turn selective Echos off?

You can use GeneralUtilities`DisableEcho: ...
kglr's user avatar
  • 397k
6 votes

How do I identify the source of a "Tag times protected" error?

A couple other ideas. One is to print the stack when a message occurs: ...
Carl Woll's user avatar
  • 131k
6 votes

Is it possible to Print expressions in reverse order?

It turns out that the ordering of the output of Print cells is determined by whether the cells printed have the options ...
Carl Woll's user avatar
  • 131k
6 votes
Accepted

WhenEvent does not detect event

Cassinis solution is one possibility to solve your problem and he is right in assuming that it has to do with evaluation order. The following is a summary of techniques which I found helpful when ...
Albert Retey's user avatar
  • 23.6k
6 votes

How to make a custom Echo

Another way to do this: ...
M.R.'s user avatar
  • 31.6k

Only top scored, non community-wiki answers of a minimum length are eligible