Tag Info

Hot answers tagged

44

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


41

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


37

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


30

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


30

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


29

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


26

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


26

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


24

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


24

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


23

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


22

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


21

I find SetSystemOptions["PackedArrayOptions" -> {"UnpackMessage" -> True}] to be useful: it emits a message when a packed array is unpacked. This may happen automatically, sometimes slowing down things greatly. This is useful in situations like this or this. One way one would find out that such an option exists is "PackedArrayOptions" /. ...


21

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


21

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


17

John Fultz posted an answer which had an undocumented option. CellPrint[{ Cell["Click to open the section", "Section", System`WholeCellGroupOpener -> True], TextCell["Some text"]}] This produces a section cell that if you click anywhere on it will open and close the whole section.


17

Problems with undocumented functions I think that this is one of the things that everyone has to decide on their own. The biggest problem for using undocumented functions is that nobody is responsible for maintaining them, and therefore, it becomes explicitly your responsibility to maintain their use in the piece of software you are building with it. And ...


16

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


15

I haven't looked deeper into this but have you tried all the events which you can find in the documentation of GUIKit? Especially here: GUIKit/ref/GUIInformation The list at the bottom contains at least all events you have mentioned: {"Action", "ActionPerformed", "Ancestor", "AncestorAdded", "AncestorMoved", "AncestorRemoved", "AncestorResized", ...


15

Some you can find in the Documentation Center, like the angular slider in Dynamic's documentation (under Applications), or the ValueThumbSlider in the Advanced Manipulate Functionality section (under Custom Control Appearances). Some you can find in developer packages like the angular slider in the "Experimental`" package: Needs@"Experimental`"; ...


15

This is not related to evaluation. Internal`Bag, like many other special types, is an atomic object. You can verify this using AtomQ[x]. This is despite its InputForm suggesting a structure. This is no different from how Graph, Rational, Complex or SparseArray behave. (Though for SparseArray, most list manipulation functions are implemented, so it's ...


15

nb2 = NotebookOpen[$InstallationDirectory <> $PathnameSeparator <> "SystemFiles" <> $PathnameSeparator <> "FrontEnd" <> $PathnameSeparator <> "StyleSheets" <> $PathnameSeparator <> "Core.nb"]; Note that some of the named styles in the core stylesheet styles are empty, i.e. the style name is ...


15

It should be a comparison function. One can simulate the standard behavior by Signature[{1, 2, 3}, If[#1 < #2, True, 0] &] Signature[{2, 1, 3}, If[#1 < #2, True, 0] &] Signature[{1, 1, 3}, If[#1 < #2, True, 0] &] (* 1 *) (* -1 *) (* 0 *) If the first argument is less than the second we return True (or False, it doesn't matter!), ...


14

Using FullForm, you can see that ImageSize -> 1 -> 1 is the same as ImageSize -> (1 -> 1) i.e., the option value itself is a rule. This appears to be an undocumented shorthand for scaling a graphics to the correct image size or to scale up/down by a factor. Observe the following, using a modified version of the example: img = ...


13

There is an undocumented "Hand" named cursor that should work on all platforms. MouseAppearance[Plot[Sin[x], {x, 0, 6}], "Hand"] Unfortunately, there isn't anything that resembles a grabbed hand. Here are some other undocumented ones. Nothing here is secret, but most of it is comparatively boring and, being undocumented, is potentially subject to change ...


13

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


13

This is quite a find. I've only had time to play with it a little, but are some interesting results: Region`ConvexRegionQ[Disk[{1., 0.}]] True Region`RegionCentroid[Disk[{1., 0.}]] {1., 0.} Region`RegionMeasure[Disk[{1., 0.}]] π Region`RegionIntersection[Disk[{0, 0}], Disk[{1, 0}]] seems to do nothing, but Region`RegionMeasure @ ...


13

I'll show some examples of using the undocumemnted function Prism. Tetrahedron and Hexahedron are very similar. First some points: g = {{4, 2, 4}, {2, 2, 2}, {6, 2, 2}, {4, 6, 4}, {2, 6, 2}, {6, 6, 2}} p = Prism[g]; We can use p directly in Graphics3D e.g. Graphics3D[p] Or more fancy stuff: Graphics3D[{EdgeForm[{Thick, Darker@Green}], ...


13

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


12

About your question regarding the definition of the type of local variables in Compile, Compile has an optional third argument that allows you do this in the same manner you specify arguments. It helps the compiler solve some type ambiguity issues sometimes as by default a local variable is considered a Real number. This can be the case if a local variable ...



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