Skip to main content
31 votes

Why is Plus so much slower than Total?

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 ...
Ray Shadow's user avatar
  • 7,886
27 votes

List of symbols without built-in meaning

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: <...
Carl Woll's user avatar
  • 132k
24 votes
Accepted

What's purpose of the new function BinarySerialize?

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 ...
Ray Shadow's user avatar
  • 7,886
22 votes

Why is Plus so much slower than Total?

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 ...
Szabolcs's user avatar
  • 236k
17 votes
Accepted

Who or what is named character Andy?

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 ...
flip's user avatar
  • 1,800
17 votes
Accepted

Head[x] vs x[[0]]

Preamble The biggest problem with Head seems to be that it plays two distinct, although related, roles in the language: The 0 - th element of an expression The ...
Leonid Shifrin's user avatar
16 votes

Why is Plus so much slower than Total?

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 ...
Michael E2's user avatar
  • 245k
16 votes
Accepted

Is it safe to Unprotect everything? What are the implications?

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 ...
Henrik Schumacher's user avatar
15 votes

Is it safe to Unprotect everything? What are the implications?

There is a typesetting step after formatting, and MakeBoxes definitions do not require unprotecting Hold, you will just add more ...
Kuba's user avatar
  • 138k
15 votes
Accepted

Finding year that MMA functions were introduced via programmatic calls in the Wolfram Language

find the year that MMA functions were introduced via programmatic calls You can use, as an example ...
Nasser's user avatar
  • 150k
15 votes
Accepted

very simple but unexpected aspect of Function[ ]

The issue is that to SetDelayed1 (:=), Function is just a normal head. For your third ...
Lukas Lang's user avatar
  • 34.4k
15 votes

How can I create a shortcut to convert "normal Symbol" to Formal Symbol?

Here's an attempt: ...
Lukas Lang's user avatar
  • 34.4k
13 votes

List of symbols marked [[EXPERIMENTAL]] in the documentation

List available as EntityList[EntityClass["WolframLanguageSymbol", "Experimental"]]
devro417's user avatar
  • 131
12 votes
Accepted

Is there a built-in function to get the centroid of a table?

wd = WeightedData[Tuples @ Range @ Dimensions @ table, Join @@ table] Mean @ wd {22.3232, 33.9072} Also ...
kglr's user avatar
  • 401k
12 votes
Accepted

Looping through all functions defined in Mathematica

Single-argument functions: ...
kglr's user avatar
  • 401k
12 votes

Which function names have been re-purposed in Mathematica after being deprecated?

The oldest example I can think of is Medium. Version 1.x: It got deprecated after version 2, and was then re-introduced in version 6; that usage persists to this ...
J. M.'s missing motivation's user avatar
12 votes
Accepted

Using < or <= make different results when sort

The pair {{d, 4}, {c, 4}} does violate the order #1[[2]] < #2[[2]]: 4 < 4 (* False *) ...
Shin Kim's user avatar
  • 1,291
11 votes
Accepted

Why isn't Orderless an Attribute of And?

As you mentioned, And is not Orderless just for efficiency; its arguments are evaluated one by one to prevent unnecessary ...
JungHwan Min's user avatar
  • 4,694
11 votes
Accepted

What's the purpose of the GeneralUtilities`UnpackOptions?

(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. ...
WReach's user avatar
  • 69.3k
11 votes

List of symbols without built-in meaning

Here is an approach based on reading the Front End resource UnicodeCharacters.tr. This method finds some operators that do not presently appear in Carl Woll's list ...
Mr.Wizard's user avatar
  • 273k
11 votes
Accepted

1 is not the SameQ as Null, but why might 1 be Equal to Null?

=== (SameQ) tests structural equality and is meant mainly for programming uses. Like nearly all functions named as ...
Szabolcs's user avatar
  • 236k
11 votes

Table of precedence values for all System` symbols

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 ...
Carl Woll's user avatar
  • 132k
11 votes

Construct a pure function containing built-in 'Sequence'

##& is functionally equivalent to Sequence in most cases, and does the job here. ...
att's user avatar
  • 441
11 votes
Accepted

What is MergeDifferences?

MergeDifferences is an option to SequenceAlignment. Autocompletion is not context-sensitive in this sense (although syntax ...
kirma's user avatar
  • 19.1k
10 votes
Accepted

How to find all function which cannot be ToExpression?

Reflection in Mathematica is a tricky business. This makes the definition of a "normal result" tricky as well. This response will point out some of those difficulties and provide some tools to deal ...
WReach's user avatar
  • 69.3k
10 votes

Geometry computations add-on for Mathematica?

The following is a built-in way of finding circumcenters: gr = Graphics[{ Circumsphere[{{0, 0}, {1, 0}, {0, 1}}], Triangle[{{0, 0}, {1, 0}, {0, 1}}] }]; ...
C. E.'s user avatar
  • 71.2k
10 votes
Accepted

What is the inverse of the Position function?

I don't know that you can do it in a single command. But it's easy enough to do in two. Say your list is list={2,1,4}; ...
bill s's user avatar
  • 69.7k
10 votes
Accepted

How to obtain list of Installed Packages loadable by Get (<<)

There's nothing truly built in, but this is easy to roll if you know how to work with paclets. PacletInformation will return a ...
b3m2a1's user avatar
  • 47.1k
10 votes
Accepted

Largest k such that p^k divides n

IntegerExponent IntegerExponent[120, #] & /@ {2, 3, 5, 7} (* {3, 1, 1, 0} *)
Greg Hurst's user avatar
  • 36.8k
9 votes

Is there a built-in function to get the centroid of a table?

...
Szabolcs's user avatar
  • 236k

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