Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now
79

LongestCommonSequencePositions and LongestCommonSubsequencePositions Their use is analogous to LongestCommon(Sub)sequence but they return the position of the first match instead. Update: These are documented since 10.2. ClipboardNotebook[] can be used to access the clipboard. NotebookGet@ClipboardNotebook[] will give a Notebook expression with the current ...


59

One thing you can do is look for options which appear in a function's Options but do not have a ::usage message. Of course, some of the results actually are documented in the help, they just don't have a usage message. Here's a function to do it: undoc[x_Symbol]:=Select[Options[x],!StringQ@MessageName[Evaluate@First@#,"usage"]&]; undoc[_] = {}; (* e.g. ...


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 *) ...


53

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@...


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

One undocumented function I find useful is Precedence: For example: {#, Precedence@#} & /@ {Plus, Minus, Times, Power, Apply, Map, Factor, Prefix, Postfix, Infix} // TableForm giving: Plus 310. Minus 480. Times 400. Power 590. Apply 620. Map 620. Factor 670. Prefix 640. Postfix 70. Infix 630. Precedence is described in the ...


51

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 ...


49

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


45

Thinking about a recent answer made me wonder exactly which functions in Mathematica use Assumptions. You can find the list of System` functions that use that Option by running Reap[Do[Quiet[If[Options[Symbol[i], Assumptions]=!={}, Sow[i], Options::optnf]], {i, DeleteCases[Names["System`*"], _?(StringMatchQ[#, "$"~~__] &)]}]][[2, 1]] which (can be ...


44

Update Since version 11.2, this function is now buried in a deeper context: NumericalMath`NSequenceLimit[]. I quite like SequenceLimit[] myself; it is a function that numerically estimates the limit of a sequence by applying the Shanks transformation (as embodied in Wynn's $\varepsilon$ algorithm). The method is a particularly nice generalization of the ...


42

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}, ...


41

The first element in the triples seems to indicate the type of curve used for the segment where 0 indicates a Line, 1 a BezierCurve, and 3 a BSplineCurve. I haven't figured out yet what 2 does. Edit: When the first element of the triple is 2, the segment will be a BezierCurve similar to option 1 except that with option 2, an extra control point is added to ...


40

I am somewhat reluctant to offer this as an answer since it is inherently difficult to comprehensively address questions on undocumented functionality. Nonetheless, the following observations do constitute partial answers to points raised in the question and are likely to be of value to anyone trying to write practical compiled code using Bags. However, ...


40

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

1. Discovery may be aided by Trace and related tools. I recommend WReach's traceView functions. 2. Simple observation and experimentation. Simple does not imply easy. As an example, to find the answer to "Can the frame border on a BarChart Legend be removed?", I used: BarChart[{{1, 2, 3}}, ChartLegends -> {"A", "B", "C"}] // Trace // InputForm ...


35

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,...


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

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 Internal`...


32

Other answers have already suggested ways of querying options. There's no way of systematically generating a list of all string values, but it's not too difficult to put together a list of all of the values which are used by Wolfram Research in Mathematica itself. If you look in the various files in these locations: $InstallationDirectory/SystemFiles/...


32

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 ...


31

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 ...


31

One of the excellent places to look is the Wolfram Demonstration Project. There are many cases with custom controls there. You can test out controls immediately and download the source code. Because I know that site pretty well I will keep the list here. Relief-Shaded Elevation Map 3D Waves Potter's Wheel Motion Blur Contours of Algebraic Surfaces ...


31

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 ...


30

The two main arguments against using undocumented functions are: Your code might not work as expected in future versions; Your code might not work as you intended in the current version, because you only have a partial understanding of a function or option that is undocumented. In the case of Mathematica, though, there is no guarantee that even documented ...


27

There is a public, but undocumented, function called GeometricFunctions`DecodeFilledCurve which helps to decode this type of undocumented FilledCurve: GeometricFunctions`DecodeFilledCurve[ FilledCurve[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{12.887695983062486, 5.160000000000004}, {1.8237311169604027, 5.160000000000004}, {...


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

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 ...


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