Top "Magic-numbers" questions

Magic numbers are unexplained values that often should be replaced with a named constant.

What is a magic number, and why is it bad?

What is a magic number? Why should it be avoided? Are there cases where it's appropriate?

language-agnostic terminology magic-numbers
The cause of "bad magic number" error when loading a workspace and how to avoid it?

I tried to load my R workspace and received this error: Error: bad restore file magic number (file may be …

r workspace magic-numbers
Is 23,148,855,308,184,500 a magic number, or sheer chance?

News reports such as this one indicate that the above number may have arisen as a programming bug. A man …

magic-numbers
HowTo extract MimeType from a byte[]

I've a web page that that can be used to upload files. Now I need to check if the file …

java file mime-types magic-numbers
How to get magic number of a binary file

There is a magic number associated with each binary file , does anyone know how to retrieve this information from the …

unix file-type magic-numbers
Magic number in boost::hash_combine

The boost::hash_combine template function takes a reference to a hash (called seed) and an object v. According to …

c++ algorithm boost hash magic-numbers
What does the constant 0.0039215689 represent?

I keep seeing this constant pop up in various graphics header files 0.0039215689 It seems to have something to do with …

c floating-point constants magic-numbers
Express.JS: how can I set response status by name rather than number?

OK, everyone knows 200 is OK and 404 is not found. But I for things like permanent vs temporary redirect, or payment …

node.js http express http-status-codes magic-numbers
Solution for Magic Number issue......?

Consider the following code segment... public static UserStatus getEnum(int code) { switch (code) { case 0: return PENDING; case 1: return ACTIVE; case 2: …

java switch-statement sonarqube magic-numbers
How to search a image/varbinary field for records that start with a binary pattern

I am trying to find all images that do not start with the magic number ff d8 ff e0 (the …

sql image sql-server-2005 search magic-numbers