Skip to main content
40 votes
Accepted

Why doesn't Mathematica abort evaluation when I tell it to?

There are two processes running. The first process is the FrontEnd. The FrontEnd receives your keypresses and renders text and plots. The second process is the Kernel. The Kernel receives commands ...
Eric Towers's user avatar
  • 3,050
34 votes
Accepted

Is the renaming mechanism of `With` flawed?

Short answer The local variables of the form varname$... are used by the system, and it is unwise to use symbols with such names as local variables. ...
Leonid Shifrin's user avatar
20 votes

Restarting Mathematica automatically

You could launch a different kernel and use that to run the computation. You will be controlling this "slave kernel" from another Mathematica session. This will allow you to script even quitting and ...
Szabolcs's user avatar
  • 235k
16 votes
Accepted

Detecting kernel initialization

Apparently, Throw is deactivated during kernel initialization. The following function can determine if Throw is inoperative: <...
WReach's user avatar
  • 69k
16 votes
Accepted

High Fibonacci numbers

The kernel crashes due to stack overflow. It is not safe to recurse too deeply. Increasing $RecursionLimit to values that are too great (and actually recursing ...
Szabolcs's user avatar
  • 235k
14 votes

Saving data inside a notebook so that I don't have to run it again?

In Mathematica 11.3 or later, use Iconize. It creates a short display form of a large expression that can be copied to elsewhere within the notebook, can be saved ...
Szabolcs's user avatar
  • 235k
14 votes

Detecting kernel initialization

After some spelunking, I found a file which contains a lot of initialization code, including reading the kernel init.m file, loading ...
Szabolcs's user avatar
  • 235k
14 votes
Accepted

VideoPlay crashes the Kernel with Mathematica 12.1

This bug has been fixed by a paclet update. This would be applied automatically whenever the functionality is used in a new kernel (as long as the paclet manager has updated its local site index, ...
ilian's user avatar
  • 25.5k
13 votes
Accepted

Handling Kernel start. What is a full initialization stack and what place the Autoload has there?

Update Leaving my original answer below for historical purposes, however it only applies up until version 11.1.1. As of version 11.2.0, the kernel startup initialization has been overhauled and this ...
ilian's user avatar
  • 25.5k
13 votes
Accepted

Why does args symbol exist in a fresh kernel?

It's a type of otherwise harmless bug that tends to come and go with versions. I would suggest to report it to Wolfram, but also not to worry about it. Notice that the symbols have no associated ...
Szabolcs's user avatar
  • 235k
13 votes
Accepted

Using Terminal` (ASCII plots) in Wolfram 12

Here's an approach to fix the code behind Terminal` - Execute the following code to restore the functionality of the package: ...
Lukas Lang's user avatar
  • 34.1k
12 votes

Saving data inside a notebook so that I don't have to run it again?

Update: I maintain the latest version of this function on my blog. SaveToCell is a convenience-minded implementation of Vitaliy's idea. The code is at the end. ...
Szabolcs's user avatar
  • 235k
11 votes

The most simple Manipulate freezes the notebook on v10.1

I had this problem and the solution was to turn off the Suggestions Bar in the preferences.
DamienWontContributeToAITheft's user avatar
11 votes
Accepted

What is the cheapest method to get cloud computing, remote kernels, HPC access, connection to clusters or GPUs?

The remote batch job submission functionality in version 12.2 of Mathematica makes it easy to run batch jobs on cloud services like AWS Batch. See this example illustrating a trivial job using multi-...
Jesse Friedman's user avatar
10 votes
Accepted

Any ergonomic tools for the command line kernel?

As I said in my comments, it is hard to implement this correctly if you aim for some advanced Dynamic features that work in the command line. However, you can ...
halirutan's user avatar
  • 113k
10 votes

Complete list of documented symbols that require a front-end?

I cannot give you an exhaustive list of symbols, and I think it is even debatable what it means that "a symbol requires the FE". But I think I can try to help with this: I think it is important to ...
Szabolcs's user avatar
  • 235k
10 votes

Using Terminal` (ASCII plots) in Wolfram 12

Note After looking through the referenced python code, it stands to reason that all of the tools are available from within Mathematica. I have yet to fully debug this sub-answer. You can take ...
bobthechemist's user avatar
9 votes

Global context seems to be shared between kernels when using Clear?

If you look at the definition of NotebookEvaluate, by means of Needs["GeneralUtilities`"]; GeneralUtilities`PrintDefinitions[NotebookEvaluate] you see that the ...
Rolf Mertig's user avatar
  • 17.2k
9 votes

Restarting Mathematica automatically

On Windows you can run your cycles in a batch file like this: ...
Chris Degnen's user avatar
9 votes

Clean package update for API/FormFunctions on Wolfram Cloud

Edit: For more on this Context trick see this: Importing an mx file into a context And just as full disclosure here's a note on it circumventing ...
b3m2a1's user avatar
  • 46.9k
9 votes

Choose the number of kernels used by ParallelTable

Another way from the menu (if accessible): Edit $ \rightarrow $ Preferences $ \rightarrow $ Parallel $ \rightarrow $ Local Kernels $ \rightarrow $ (Number of local kernels to use) Manual setting
Αλέξανδρος Ζεγγ's user avatar
9 votes
Accepted

How to clear up RAM without exiting kernel?

(This is a follow-up to the excellent answer by Nate.) You can tell Mathematica do not keep the output history: $HistoryLength = 0; This works for the current ...
Alexey Popkov's user avatar
8 votes

Why doesn't Mathematica abort evaluation when I tell it to?

The situation has already been explained by Eric Towers in more detail and clarity than I would have been capable of, but as far as a solution goes I think I have a slightly better one: How do I ...
Mr.Wizard's user avatar
  • 272k
8 votes
Accepted

Choose the number of kernels used by ParallelTable

You can launch as many or as few kernels as you like, see LaunchKernels and CloseKernels. Parallel functions will use as many as ...
Szabolcs's user avatar
  • 235k
7 votes

Handling Kernel quit

If you are willing to rely on undocumented behavior you can move $Epilog out of the System context, and give it a definition that evaluates both an internal (...
Mr.Wizard's user avatar
  • 272k
7 votes

How to clean up temporary files when the kernel exits?

I have found $Epilog utterly unreliable for this. Not all ways of quitting Mathematica evaluates $Epilog. And of course, there ...
Malte Lenz's user avatar
  • 2,521
7 votes

Saving data inside a notebook so that I don't have to run it again?

In Mathematica 11.2 or later can use PersistentValue to persist a value stored. It is very convenient to use, and it can be directly assigned. The data exists in the form of Hold, not in compressed ...
Aster's user avatar
  • 3,846
7 votes
Accepted

Determine how Mathematica was started

This question is more complicated that you might expect. Things you can check: Given how you want to use this, the simplest thing may be to just check if ...
Szabolcs's user avatar
  • 235k
7 votes

Why doesn't Mathematica abort evaluation when I tell it to?

If you ever develop a library for LibraryLink, be sure to include calls to AbortQ to support aborting lengthy computations. Code that runs for a long time should ...
masterxilo's user avatar
  • 5,739
7 votes

Import JPEG Fails

The bug is in reading Exif metadata. A workaround is to use IncludeMetaInformation -> None option: ...
Piotr Wendykier's user avatar

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