57

Internal`InheritedBlock (IIB) is similar to Block, except that it preserves the original definition of the function being passed to it. The function can then be modified as we wish inside the IIB without affecting the external definition. Let's see how Block works first: f[x_] := x Block[{f}, Print@DownValues[f]; f[x_, y_] := x y; Print@...


56

From inspection, some investigation and ruebenko's help, what I've found so far is that InterpolatingFunction has the following underlying structure: InterpolatingFunction[ domain, (* or min/max of grid for each dimension *) List[ version, (* 3 in Mathematica 7, 4 from 8 onwards *) ...


56

Introduction This post is long overdue as I have been repeatedly asked to explain code of mine containing these things. As I see increased use of this construct by others perhaps it is past due also. SparseArray objects can behave as functions accepting certain arguments to return internal data or efficiently return data in certain forms. These are known ...


53

The short answer is, yes! There is a whole undocumented package TemporalData` containing some useful functions. The results below are from my own spelunking. Feel free to add/amend as appropriate. Let's set up some simple TemporalData objects to explore them: fakedata = Transpose@{DatePlus[{2001, 1}, {#, "Month"}] & /@ Range[0, 99], ...


51

The following simulates Mathematica's behaviour after using it for more than 24 hrs. MathLink`CallFrontEnd[FrontEnd`UndocumentedCrashFrontEndPacket[]] Works as advertised! :D


44

Sequential With From Daniel Lichtblau's comment there is a new undocumented syntax for With introduced sometime after version 10.1 that allows: With[{a = 0}, {a = a + 1}, {a = a + 1}, a] 2 Delayed With, Block, and Module These scoping constructs support the use of := in definitions which allows one to handle unevaluated expressions. With[{x := 2 + 2}, ...


39

Funny you should ask :), it turns out there is an undocumented use of Integrate that one can leverage to integrate over regions. Unfortunately this does not seem to work for NIntegrate. This usage is better leveraged in conjunction with some other undocumented functions (see here and here). I will show a few examples of how to use this feature. First, let's ...


36

Internal`PartitionRagged This one has a usage statement! Internal`PartitionRagged[Range[14], {3, 5, 2, 4}] {{1, 2, 3}, {4, 5, 6, 7, 8}, {9, 10}, {11, 12, 13, 14}} Note that Length[list] must equal n1 + ... + nk. (* changed the last 4 to 3 *) Internal`PartitionRagged[Range[14], {3, 5, 2, 3}] Internal`PartitionRagged[Range[14], {3, 5, 2, 3}] Internal`S1,...


36

Internal`InheritedBlock What does Internal`InheritedBlock do? Daniel's MathGroup post Strange behaviour of Internal`InheritedBlock How safe is the use of Block and Internal`InheritedBlock Internal`Localizedblock What is the purpose of Internal`LocalizedBlock? Internal`Bag Internal`Bag inside Compile Daniel Lichtblau's answer On the use of of ...


35

System` The default value for the overhang parameter k (3rd argument) in ListCorrelate is None. Internal` Predicates Internal`LinearQ[expr, var] yields True if expr is a polynonial of exactly order one in var, and yields False otherwise. Internal`RationalFunctionQ[expr,var] returns True if expr is a rational function of the symbol var, and returns False ...


35

Internal`LocalizedBlock behaves the same as Block, but it can localize non-Symbols (e.g. f[1], Subscript[x, 0], etc.). For example, Internal`LocalizedBlock[{Subscript[x, 0]}, Subscript[x, 0] = 1] (* 1 *) Compare this to Block[{Subscript[x, 0]}, Subscript[x, 0] = 1] (* During evaluation of In[79]:= Block::lvsym: Local variable specification {Subscript[x, ...


34

nb2 = NotebookOpen @ FileNameJoin[ {$InstallationDirectory, "SystemFiles", "FrontEnd", "StyleSheets", "Core.nb"}]; Note that some of the named styles in the core stylesheet styles are empty, i.e. the style name is defined but no styles set: Cell[StyleData["style"]] For example (with V8): Union[Cases[NotebookGet[nb2],StyleData[x_, ___] :> x, \[...


34

There is the undocumented option Beveled in the FractionBox FractionBox[a, b, Beveled -> True] // DisplayForm


33

To create Experimental`NumericalFunction, one needs to evaluate Experimental`CreateNumericalFunction[vars, expr, dims] where vars is a list of arguments, expr - the expression from which the numerical function will be created, dims - the dimensions of the output matrix produced by this expression. If the output is scalar, then dims should be set to {}. It ...


33

This is a community wiki answer. Feel free to improve it. Introduction RawArray is an atomic array type that can hold data in any of the following formats: "Integer8", "UnsignedInteger8", "Integer16", "UnsignedInteger16", "Integer32", "UnsignedInteger32", "Integer64", "UnsignedInteger64", "Real32", "Real64", "Complex64", "Complex128" (Some aliases can ...


29

Such functions set up a one-time iterator, i.e. a GeneralUtilities`Iterator. Its functionality may be inspected with ? GeneralUtilities`Iterator and so forth. Except for a ConstantIterator which always returns the same value (forever), they go sequentially through values until they return GeneralUtilities`IteratorExhausted. The main (if internal) utility ...


27

Update Leaving my old answer below for historical reference, however as of version 11.2.0 (currently available on Wolfram Cloud and soon to be released as a desktop product) the low-level linear algebra functions have been documented, see http://reference.wolfram.com/language/LowLevelLinearAlgebra/guide/BLASGuide.html The comments by both Michael E2 and J....


27

It seems the model file in MXNet (checkpoint) is defined by two files: a ".json" file and a ".params" file. The json file contains the definition of the network, and the params file contains the actual weight and bias of each neuron. The params file is in the binary format of MXNet's NDArray representation. Thus, to export a network in Mathematica to MXNet, ...


26

Properties for SparseArray and InterpolatingFunction objects SparseArray objects can accept a range of Properties (or Methods) that allow the efficient extraction of certain information, most commonly "AdjacencyLists" or "NonzeroPositions" as a frequently faster alternative to Position. I started this answer to detail them but as it grew I came to believe ...


26

SatisfiableQ has three methods: "BDD": converts the expression to a BDD (binary decision diagram), "SAT": uses the Minisat library, "TREE": a branch-and-bound method based on the expression tree. SatisfiabilityCount counts instances by converting the expression to a BDD, so its timing should be close to SatisfiableQ with the "BDD" method (counting ...


25

Compile`InnerDo This is the one that initially struck me as interesting since I use compiled functions quite a lot. From the documentation of Do: Unless an explicit Return is used, the value returned by Do is Null. But that doesn't seem to be the case for Compile`InnerDo! f1 = Compile[{{x}}, Module[{a}, a = x; Compile`InnerDo[a++, {i, 10^8}]] ...


25

We can get old-style messages using Internal`$MessageMenu = False Needless to say, this is unsupported and undocumented functionality.


24

Version 10 introduced some undocumented functionality that makes it easier to explore the style hierarchy. As usual, "undocumented" === "buyer beware". We start by evaluating: StyleManager`OpenStyleManager This does nothing other than trigger the auto-loading of certain symbols. We'll come back to a more interesting use of this symbol later. Now, we ...


24

The details of the styles associated with various themes can be accessed using the function ResolvePlotThemes in the Charting context. For example: Grid[{#, Column@(Charting`ResolvePlotTheme[#, ListPlot] /. HoldPattern[PlotMarkers -> _] :> Sequence[])} & /@ {"Monochrome", "Frame", "Vibrant"}, Dividers -> All] (* removed the part ...


24

So I have a little bit more info, but mostly a learning technique we can test: Init I wanted to see when each of these was called so I made each possible handler (without a previous assignment) just call Print. Then I found that for "Wolfram.System.Print" this is a terrible idea as it is called anytime the system prints. So I removed that. Here's what I'm ...


23

Yes, this form exists, and was first shown to me by Leonid. It is: Function[Null, (* body with ## *), (* attributes *)] As always the Null may be implicit, so in your application: Function[, Length[Unevaluated@#1]{##2}, HoldFirst][1+2,2+3,3+1] {10, 8}


23

We can use one of several ways. First, let us create some test data: arr = Range[10]; (* this is an Integer packed array *) unpacked = {1, 2, 3} (* this is an Integer array that is NOT packed *) Since Mathematica 10.4, Internal`PackedArrayType directly returns the type: Internal`PackedArrayType[arr] (* Integer *) Internal`PackedArrayType[unpacked] (* $...


22

Once again thanks to John Fultz we know a command that returns the complete list of these packets: MathLink`CallFrontEnd[FrontEnd`NeedCurrentFrontEndSymbolsPacket[]][[1, 1, 4]] Results from Mathematica 7: "" "Null" "CompoundExpression" "List" "Execute" "FrontEndExecute" "KernelExecute" "OpenParallelLinksPacket" "KernelStartupCompleted" "...


22

One can use Style and FractionBoxOptions to set Beveled: Plot[Sin[x], {x, -2 Pi, 2 Pi}, Ticks -> {Pi Range[-2, 2, 1/2], Automatic}, BaseStyle -> {FractionBoxOptions -> {Beveled -> True}}] It doesn't look too good here, though: This looks ok, Style[3 Pi/2, FractionBoxOptions -> {Beveled -> True}] but not in the "Label" style, Style[...


21

In addition to the error messages quoted in the question the line returns: GeneralUtilities`Benchmarking`PackagePrivate`plot[ IndexBy[{{{16, 9.37132*10^-6}, . . . IndexBy was removed from 10.1.0: Note that IndexBy will be removed in a future version of Mathematica. It was something that was considered for 10.0.0 but didn't make the cut. – Stefan R Feb ...


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