# Tag Info

30

Your problem is that you've got a slight misunderstanding of the different types of items that ReadList can read. That's OK, it can be a little confusing. To begin with: String, Number, Expression, etc. are not sub-types of Record. They are all separate types with their own rules for how they are read. The RecordSeparators option is only applied to ...

30

Edit: This solution no longer works due to changes in the Entity framework. The "UnderDevelopment" EntityClass no longer exists. It's not part of EntityClassList["WolframLanguageSymbol"] or WolframLanguageData["Classes"] anymore. The symbols that are market [[EXPERIMENTAL]] in the documentation are in their own entity class of the "WolframLanguageSymbol" ...

30

Performance issues with large numeric arrays very often happen because of unpacking of PackedArrays. Numeric operations on Packed arrays are very well optimized, while unpacking and operations on huge unpacked lists are usually slow. If you turn on packing warnings (On["Packing"]) before your tests, you will see that applying Plus to packed array leads to ...

23

New functions conveniently carry the "NEW in 10.4" header in their documentation page. Since the docs are blessedly written as Mathematica notebooks, and notebook are text files, we can just use grep or a similar tool to hunt for those help files that contain that header. New in 10.4 Inspection of one such file with a text editor reveals that the raw cell ...

23

Updated to include both unary and binary operators One idea is to use the usage message of a symbol as a clue that it has a special display form, probably with no built-in meaning. For example: ?TildeTilde The following 2 functions check the usage message of a symbol to see if it contains "displays as" or "formats as", and then weeds out those symbols ...

22

There are a lot of commands! One way to get a list is to use Names["*"], which will return all the symbols Mathematica knows. Since commands start with capital letters, you can gain more control over the list by asking for only a subset. For example, all = {"A*", "B*", "C*"}; Names[#] & /@ all provides a list of all commands that start with A, B, or C....

21

The brief forms /@, and @@@ are not exactly equivalent to the full forms of these operations, and also f[x] is not exactly equivalent to either of f[#]&[x] or f @@ {x}. I will mention two aspects of the problem, but there likely are more (of course, in addition to the precedence - related aspect, already extensively described in the linked past ...

21

Disclaimer: This answer is written from a user's point of view. For useful insider information on this topic see this discussion with Mathematica developers on Community Forums. Introduction Binary serialization is rewriting expressions as an array of bytes (list of integers from Range[0, 255]). Binary representation of expression takes less space than a ...

20

Perhaps the simplest way is to use the built in function Information, which is the programmatic form of ?? Information[#, LongForm -> False] & /@ functionslist gives a long list of (short) function definitions. By the way... it's easy to figure this kind of thing out -- in this case, I highlighted the symbol ?? (double question mark) and pressed ...

20

The short answer is don't do it. Really, it's just not a good idea. You can use other symbols, such as \[CapitalIota] which looks almost exactly like I and is entered with EscIEsc. If you're really determined you could substitute symbols using $PreRead and MakeBoxes but again I don't recommend it. For example: MakeBoxes[I, _] := "\[ImaginaryJ]" ... 20 In Mathematica, "everything is an expression". All data and code is represented in the same manner, as Mathematica expressions. Thus expressions must be very general. They need to be able to represent anything that appears in the language. There is usually a tradeoff between generality and performance. Mathematica expressions, which can contain ... 19 In older versions (5 and before), most option names were symbols. It's since about version 6 that string option names have proliferated. I think that the reason is to avoid cluttering the name space. Once you introduce a new name, it won't be available for package authors to use for other purposes (in particular, function names). At least not without ... 18 If my answer for the 2D case lacks detail, it's because TypesetMakeBoxes is an internal, undocumented function. That makes it hard to say anything authoritative about how it works. Essentially though, we are defining the custom primitive in such a way that the definition only applies during conversion of a graphics expression to boxes. Here's a version of ... 16 The reason is to prevent users to mess with it. Unprotecting something is not necessarily dangerous, but unprotecting everything definitely is. Performance is probably not the issue. The real danger is that you replace a very important feature of a built-in symbol by chance. Since built-in symbols often have the ReadProtected attribute, you cannot check ... 15 Remember that WolframLanguageSymbol entities always return the state of latest version of the Wolfram Language; not the version of the language you currently have installed. The Entity function calls appear to be returning the correct information when you take this into consideration. New in 10.4 EntityList[Entity["WolframLanguageSymbol", {"... 15 There is a typesetting step after formatting, and MakeBoxes definitions do not require unprotecting Hold, you will just add more DonwValues for MakeBoxes. MakeBoxes[Hold[a___], fmt_] := With[ {foo = MakeBoxes[Panel[Column[{a}]], fmt]} , InterpretationBox[ RowBox[{"Hold", "[", foo, "]"}] , Hold[a] ] ] Hold[1 + 1, 2 + 2, 4 + 4] It ... 14 Introduction @Shadowray has already put a finger on the source of the time difference in the OP's example: unpacking. But it seems to me that the question points out just a symptom of a broader question of how best to add up lists and arrays. One might want to consider the problem of addition from a design perspective and consider the roles of the tools ... 14 The original MMa fonts were designed by Andre Kuzniarek and Andrew Hunt. From Andre: Indeed, those are old easter eggs, and there used to be glyphs for each of us. They were "abandonded" in later releases. All were involved in dealing with font design, encoding and integration going back to the initial Unicode release (V3). Myself, Andy Hunt, Robby ... 13 You can executive the code in mma 10 or above version EntityClass["WolframLanguageSymbol", "Atomic"]//EntityList But is not all atomic function,as I know. 12 Get the full list of Mathematica functions here: myFunctionList = Import["http://reference.wolfram.com/language/guide/\ AlphabeticalListing.html"]; Strip the list of header and footer material, and select a random element: RandomChoice[StringSplit[StringTake[myFunctionList, {3245, -1225}]]] Or, based on the approach of bill s: RandomChoice@Flatten[Names[... 12 Ok, here is the why: patterns do evaluate, just like other expressions. Therefore: Times[___, b, c, ___] gives (* b c ___^2 *) even before the pattern-matching is attempted. In this form, the pattern of course does not match. Use HoldPattern to prevent that: a b c d+x y z/.HoldPattern[Times[___,b,c,___]]->0 (* x y z *) 12 As Mr.Wizard already noted, it's not clear whether "operator form" occurs in the documentation of every command that has an operator form (or conversely, e.g., NDSolve*, which references the operator form of Inactive). docdir = FileNameJoin[{$InstallationDirectory, "Documentation", "English", "System", "ReferencePages", "Symbols"}]; docs = FileNames["*"...

12

ToExpression["\\[" <> # <> "]"] & /@ {"Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"} Gives (also corrected the code thanks to Kuba)

11

List available as EntityList[EntityClass["WolframLanguageSymbol", "Experimental"]]

11

They are: C D E I K N O It's easy to know. Just open a notebook and type the capital alphabet. Those changing color to black are protected.

11

To convert my comment into an answer: one can naively run Select[Names["System*"], StringLength[#] == 1 &] to pick out built-in symbols that are only one character long. This will work in older versions of Mathematica, but ever since the introduction of formal symbols (which are, to be fair, in the System​ context and are one-character expressions as ...

11

As you mentioned, And is not Orderless just for efficiency; its arguments are evaluated one by one to prevent unnecessary computation. Orderless attribute would require sorting, which require more computation... In a && b && c: a is evaluated. If it is False, the evaluation ends, and the output is False. If not, the evaluation proceeds. b ...

11

(analysis current as of Mathematica V11.0.1) UnpackOptions is a macro that provides a convenient notation for accessing option values within a function definition. At definition time, it transforms a source macro expression of the form: UnpackOptions[option1, option2] into an expanded expression of the form: {option1, option2} = OptionValue @ {"Option1",...

11

You can use Precedence to get the precedence for a symbol. The following code produces an association with precedences as keys, and symbol names corresponding to that precedence as values: precedenceAssociation = KeySort @ GroupBy[ Names["System*"], ToExpression[#,StandardForm, Function[Null, Precedence[Unevaluated[#]],HoldAll]]& ]; Normal @ ...

11

wd = WeightedData[Tuples @ Range @ Dimensions @ table, Join @@ table] Mean @ wd {22.3232, 33.9072} Also Total[MapIndexed[#2 # &, table / Total[table, 2], {2}], 2] (* and *) Dot[Join @@ table , Tuples[Range @ Dimensions @ table]] / Total[table, 2] {22.3232, 33.9072}

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