Magic number (programming) from Wikipedia(0xCCCCCCCC、0xCDCDCDCD、0xFEEEFEEE)

来源:互联网 发布:jvcs500知乎 编辑:程序博客网 时间:2024/06/05 01:10

原文地址: https://en.wikipedia.org/wiki/Magic_number_(programming)

  1. In computer programming, the term magic number has multiple meanings. It could refer to one or more of the following:

    • A constant numerical or text value used to identify a file format or protocol; for files, see List of file signatures
    • Distinctive unique values that are unlikely to be mistaken for other meanings (e.g.,Globally Unique Identifiers)
    • Unique values with unexplained meaning or multiple occurrences which could (preferably) be replaced with named constants

    Contents

    • 1Format indicator
      • 1.1Magic number origin
      • 1.2Magic numbers in files
      • 1.3Magic numbers in protocols
      • 1.4Magic numbers in other uses
    • 2Data type limits
    • 3Unnamed numerical constants
      • 3.1Accepted limited use of magic numbers
    • 4Magic GUIDs
    • 5Magic debug values
    • 6See also
    • 7References

    Format indicator

    Magic number origin

    The format indicator type of magic number was first found in early Seventh Edition source code of the Unix operating system and, although it has lost its original meaning, the termmagic number has become part of computer industry lexicon.

    When Unix was ported to one of the first DEC PDP-11/20s it did not have memory protection and, therefore, early versions of Unix used the relocatable memory reference model.[1] Pre-Sixth Edition Unix versions read an executable file into memory and jumped to the first low memory address of the program, relative address zero. With the development of paged versions of Unix, a header was created to describe the executable image components. Also, a branch instruction was inserted as the first word of the header to skip the header and start the program. In this way a program could be run in the older relocatable memory reference (regular) mode or in paged mode. As more executable formats were developed, new constants were added by incrementing the branch offset.[2]

    In the Sixth Edition source code of the Unix program loader, the exec() function read the executable (binary) image from the file system. The first 8 bytes of the file was a header containing the sizes of the program (text) and initialized (global) data areas. Also, the first 16-bit word of the header was compared to twoconstants to determine if the executable image contained relocatable memory references (normal), the newly implemented paged read-only executable image, or the separated instruction and data paged image.[3] There was no mention of the dual role of the header constant, but the high order byte of the constant was, in fact, theoperation code for the PDP-11 branch instruction (octal 000407 orhex 0107). Adding seven to the program counter showed that if this constant wasexecuted, it would branch the Unix exec() service over the executable image eight byte header and start the program.

    Since the Sixth and Seventh Editions of Unix employed paging code, the dual role of the header constant was hidden. That is, the exec() service read the executable file header (meta) data into a kernel space buffer, but read the executable image into user space, thereby not using the constant's branching feature. Magic number creation was implemented in the Unixlinker andloader and magic number branching was probably still used in the suite of stand-alone diagnostic programs that came with the Sixth and Seventh Editions. Thus, the header constant did provide an illusion and met the criteria formagic.

    In Version Seven Unix, the header constant was not tested directly, but assigned to a variable labeledux_mag[4] and subsequently referred to as themagic number. Probably because of its uniqueness, the termmagic number came to mean executable format type, then expanded to mean file system type, and expanded again to mean any type of file.

    Magic numbers in files

    Magic numbers are common in programs across many operating systems. Magic numbers implementstrongly typed data and are a form of in-band signaling to the controlling program that reads the data type(s) at program run-time. Many files have such constants that identify the contained data. Detecting such constants in files is a simple and effective way of distinguishing between manyfile formats and can yield further run-time information.

    Examples
    • CompiledJava class files (bytecode) and Mach-O binaries start with hexCAFEBABE. When compressed with Pack200 the bytes are changed to CAFED00D.
    • GIF image files have theASCII code for "GIF89a" (47 49 46 38 39 61) or "GIF87a" (47 49 46 38 37 61)
    • JPEG image files begin withFF D8 and end withFF D9. JPEG/JFIF files contain theASCII code for "JFIF" (4A 46 49 46) as a null terminated string. JPEG/Exif files contain theASCII code for "Exif" (45 78 69 66) also as a null terminated string, followed by moremetadata about the file.
    • PNG image files begin with an 8-byte signature which identifies the file as a PNG file and allows detection of common file transfer problems:\211 P N G \r \n \032 \n (89 50 4E 47 0D 0A 1A 0A). That signature contains various newline characters to permit detecting unwarranted automated newline conversions, such as transferring the file usingFTP with the ASCII transfer mode instead of the binary mode.[5]
    • Standard MIDI audio files have the ASCII code for "MThd" (MIDI Track header,4D 54 68 64) followed by more metadata.
    • Unix orLinux scripts may start with a"shebang" (#!, 23 21) followed by the path to aninterpreter, if the interpreter is likely to be different from the one from which the script was invoked.
    • ELF executables start with7F E L F
    • PostScript files and programs start with "%!" (25 21).
    • PDF files start with "%PDF" (hex25 50 44 46).
    • DOS MZ executable files and theEXE stub of the Microsoft Windows PE (Portable Executable) files start with the characters "MZ" (4D 5A), the initials of the designer of the file format,Mark Zbikowski. The definition allows the uncommon "ZM" (5A 4D) as well for dosZMXP, a non-PE EXE.[6]
    • The Berkeley Fast File System superblock format is identified as either 19 54 01 19 or01 19 54 depending on version; both represent the birthday of the author,Marshall Kirk McKusick.
    • The Master Boot Record of bootable storage devices on almost all IA-32 IBM PC compatibles has a code of 55 AA as its last two bytes.
    • Executables for the Game Boy and Game Boy Advance handheld video game systems have a 48-byte or 156-byte magic number, respectively, at a fixed spot in the header. This magic number encodes a bitmap of theNintendo logo.
    • Amiga software executableHunk files running on Amiga classic 68000 machines all started with the hexadecimal number $000003f3, nicknamed the "Magic Cookie."
    • In the Amiga, the only absolute address in the system is hex $0000 0004 (memory location 4), which contains the start location called SysBase, a pointer to exec.library, the so-calledkernel of Amiga.
    • PEF files, used by theclassic Mac OS and BeOS for PowerPC executables, contain the ASCII code for "Joy!" (4A 6F 79 21) as a prefix.
    • TIFF files begin with eitherII orMM followed by42 as a two-byte integer in little or big endian byte ordering. II is for Intel, which uses little endian byte ordering, so the magic number is 49 49 2A 00.MM is for Motorola, which usesbig endian byte ordering, so the magic number is 4D 4D 00 2A.
    • Unicode text files encoded inUTF-16 often start with theByte Order Mark to detect endianness (FE FF for big endian and FF FE for little endian). And onMicrosoft Windows,UTF-8 text files often start with the UTF-8 encoding of the same character, EF BB BF.
    • LLVM Bitcode files start withBC (0x42, 0x43)
    • WAD files start withIWAD orPWAD (forDoom),WAD2 (forQuake) andWAD3 (forHalf-Life).
    • Microsoft Compound File Binary Format (mostly known as one of the older formats of Microsoft Office documents) files start with D0 CF 11 E0, which is visually suggestive of the word "DOCFILE0".
    • Headers in ZIP files begin with "PK" (50 4B), the initials of Phil Katz, author of DOS compression utility PKZIP.
    • Headers in 7z files begin with "7z" (full magic number "7z¼¯'�": 37 7A BC AF 27 1C).
    • NXL (SkyDRM Protected) Files start with4E 58 4C 46 4D 54 40.
    Detection

    The Unix utility program file can read and interpret magic numbers from files, and the file which is used to parse the information is calledmagic. The Windows utility TrID has a similar purpose.

    Magic numbers in protocols

    Examples
    • The OSCAR protocol, used in AIM/ICQ, prefixes requests with2A.
    • In the RFB protocol used by VNC, a client starts its conversation with a server by sending "RFB" (524642, for "Remote Frame Buffer") followed by the client's protocol version number.
    • In the SMB protocol used by Microsoft Windows, each SMB request or server reply begins with 'FF534D42', or"\xFFSMB" at the start of the SMB request.
    • In the MSRPC protocol used by Microsoft Windows, each TCP-based request begins with 05 at the start of the request (representing Microsoft DCE/RPC Version 5), followed immediately by a00 or01 for the minor version. In UDP-based MSRPC requests the first byte is always04.
    • In COM and DCOM marshalled interfaces, called OBJREFs, always start with the byte sequence "MEOW" (4D 454F57). Debugging extensions (used for DCOM channel hooking) are prefaced with the byte sequence "MARB" (4D415242).
    • Unencrypted BitTorrent tracker requests begin with a single byte containing the value 19 representing the header length, followed immediately by the phrase "BitTorrent protocol" at byte position 1.
    • eDonkey2000/eMule traffic begins with a single byte representing the client version. Currently E3 represents an eDonkey client,C5 represents eMule, andD4 represents compressed eMule.
    • SSL transactions always begin with a "client hello" message. The record encapsulation scheme used to prefix all SSL packets consists of two- and three- byte header forms. Typically an SSL version 2 client hello message is prefixed with a80 and an SSLv3 server response to a client hello begins with16 (though this may vary).
    • DHCP packets use a "magic cookie" value of '0x630x820x530x63' at the start of the options section of the packet. This value is included in all DHCP packet types.
    • HTTP/2 connections are opened with the preface '0x505249202a20485454502f322e300d0a0d0a534d0d0a0d0a', or "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n". The preface is designed to avoid the processing of frames by servers and intermediaries which support earlier versions of HTTP but not 2.0.

    Magic numbers in other uses

    Examples
    • The default MAC address on Texas Instruments SOCs is DE:AD:BE:EF:00:00.[7]

    Data type limits

    This is a list of limits of data storage types:[8]

    NumberHexDescription184467440737095516150xFFFFFFFFFFFFFFFFThe maximum unsigned 64 bit value.42949672950xFFFFFFFFThe maximum unsigned 32 bit value (2^32 - 1).655350xFFFFThe maximum unsigned 16 bit value (2^16 - 1).2550xFFThe maximum unsigned 8 bit value (2^8 - 1)92233720368547758070x7FFFFFFFFFFFFFFFThe maximum signed 64 bit value.21474836470x7FFFFFFFThe maximum signed 32 bit value327670x7FFFThe maximum signed 16 bit value.1270x7FThe maximum signed 8 bit value.-128 Minimum signed 8 bit value.-32768 Minimum signed 16 bit value.-2147483648 Minimum signed 32 bit value.-9223372036854775808 Minimum signed 64 bit value.

    Unnamed numerical constants

    The term magic number or magic constant also refers to the programming practice of using numbers directly in source code. This has been referred to as breaking one of the oldest rules of programming, dating back to theCOBOL,FORTRAN and PL/1 manuals of the 1960s.[9] The use of unnamed magic numbers in code obscures the developers' intent in choosing that number,[10] increases opportunities for subtle errors (e.g. is every digit correct in 3.14159265358979323846 and is this equal to 3.14159?) and makes it more difficult for the program to be adapted and extended in the future.[11] Replacing all significant magic numbers with named constants makes programs easier to read, understand and maintain.[12]

    Names chosen to be meaningful in the context of the program can result in code that is more easily understood by a maintainer who is not the original author. An example of a non-intuitively named constant isint SIXTEEN = 16, whileint NUMBER_OF_BITS = 16 is more descriptive.

    The problems associated with magic 'numbers' described above are not limited to numerical types and the term is also applied to other data types where declaring a named constant would be more flexible and communicative.[9] Thus, declaring const string testUserName = "John" is better than several occurrences of the 'magic number'"John" in atest suite.

    For example, if it is required to randomly shuffle the values in an array representing a standard pack ofplaying cards, thispseudocode does the job using the Fisher–Yates shuffle algorithm:

       for i from 1 to 52       j := i + randomInt(53 - i) - 1       a.swapEntries(i, j)

    where a is an array object, the function randomInt(x) chooses a random integer between 1 andx, inclusive, andswapEntries(i, j) swaps theith andjth entries in the array. In the preceding example,52 is a magic number. It is considered better programming style to write the following:

       constant int deckSize := 52   for i from 1 to deckSize       j := i + randomInt(deckSize + 1 - i) - 1       a.swapEntries(i, j)

    This is preferable for several reasons:

    • It is easier to read and understand. A programmer reading the first example might wonder,What does the number 52 mean here? Why 52? The programmer might infer the meaning after reading the code carefully, but it is not obvious. Magic numbers become particularly confusing when the same number is used for different purposes in one section of code.
    • It is easier to alter the value of the number, as it is not duplicated. Changing the value of a magic number is error-prone, because the same value is often used several times in different places within a program. Also, when two semantically distinct variables or numbers have the same value they may be accidentally both edited together. To modify the first example to shuffle aTarot deck, which has 78 cards, a programmer might naively replace every instance of 52 in the program with 78. This would cause two problems. First, it would miss the value 53 on the second line of the example, which would cause the algorithm to fail in a subtle way. Second, it would likely replace the characters "52" everywhere, regardless of whether they refer to the deck size or to something else entirely, such as the number of weeks in a Gregorian calendar year, or more insidiously, are part of a number like "1523", all of which would introduce bugs. By contrast, changing the value of thedeckSize variable in the second example would be a simple, one-line change.
    • The declarations of "magic number" variables are placed together, usually at the top of a function or file, facilitating their review and change.
    • It facilitates parameterization. For example, to generalize the above example into a procedure that shuffles a deck of any number of cards, it would be sufficient to turndeckSize into a parameter of that procedure, whereas the first example would require several changes.
       function shuffle (int deckSize)      for i from 1 to deckSize          j := i + randomInt(deckSize + 1 - i) - 1          a.swapEntries(i, j)
    • It helps detect typos. Using a variable (instead of a literal) takes advantage of a compiler's checking. Accidentally typing "62" instead of "52" would go undetected, whereas typing "dekSize" instead of "deckSize" would result in the compiler's warning that dekSize is undeclared.
    • It can reduce typing in some IDEs. If an IDE supports code completion, it will fill in most of the variable's name from the first few letters.

    Disadvantages are:

    • When the named constant is not defined near its use it hurts the locality (and thus comprehensibility) of the code. Putting the 52 in a possibly distant place means that to understand the workings of the for loop completely (for example to estimate the run-time of the loop) one must track down the definition and verify that it is the expected number.
    • It makes the code more verbose. An increase in verbosity may be justified when there is some likelihood of confusion about the constant, or when there is a likelihood the constant may need to be changed, such asreuse of a shuffling routine for other card games.
    • It may be slower to process the expression "deckSize + 1" at run-time than the value "53", although most modern compilers and interpreters are capable of using the fact that "deckSize" has been declared as a constant and pre-calculate the value 53 in the compiled code; as an alternative, loop optimization will move the addition so that it is performed before the loop. There is therefore usually no speed penalty compared to using magic numbers in code.
    • It can increase the line length of the source code, forcing lines to be broken up when many constants are used on the same line.
    • It can make debugging more difficult on systems where the debugger doesn't display the values of constants.

    Accepted limited use of magic numbers

    This section needs additional citations forverification.Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.(March 2010)(Learn how and when to remove this template message)

    In some contexts, the use of unnamed numerical constants is generally accepted (and arguably "not magic"). While such acceptance is subjective, and often depends on individual coding habits, the following are common examples:

    • the use of 0 and 1 as initial or incremental values in a for loop, such as for (int i = 0; i < max; i += 1) (assuming ++i is not supported)
    • the use of 2 to check whether a number is even or odd, as in isEven = (x % 2 == 0), where% is themodulo operator
    • the use of simple arithmetic constants, e.g., in expressions such as circumference = 2 * Math.PI * radius,[9] or for calculating the discriminant of a quadratic equation as d = b^2 − 4*a*c
    • the use of 100 to calculate percentages

    The constants 1 and 0 are sometimes used to represent the boolean values True and False in programming languages without a boolean type such as older versions ofC. Most modern programming languages provide a boolean or bool primitive type and so the use of 0 and 1 is ill-advised.

    In C and C++, 0 is sometimes used to represent the null pointer. As with boolean values, the C standard library includes a macro definitionNULL whose use is encouraged. Other languages provide a specificnull ornil value and when this is the case no alternative should be used. The typed pointer constantnullptr has been introduced with C++11.

    Magic GUIDs

    It is possible to create or alter globally unique identifiers (GUIDs) so that they are memorable, but this is highly discouraged as it compromises their strength as near-unique identifiers.[13][14] The specifications for generating GUIDs and UUIDs are quite complex, which is what leads to them being guaranteed unique, if properly implemented. They should only be generated by a reputable software tool.[citation needed]

    Microsoft Windows product ID numbers for Microsoft Office products sometimes end with 0000-0000-0000000FF1CE ("OFFICE"), such as {90160000-008C-0000-0000-0000000FF1CE}, the product ID for the "Office 16 Click-to-Run Extensibility Component".

    Java uses several GUIDs starting with CAFEEFAC.[15]

    In the GUID Partition Table of the GPT partitioning scheme, BIOS Boot partitions use the special GUID {21686148-6449-6E6F-744E-656564454649}[16] which does not follow the GUID definition; instead, it is formed by using the ASCII codes for the string "Hah!IdontNeedEFI" partially in little endian order.

    Magic debug values

    Magic debug values are specific values written to memory during allocation or deallocation, so that it will later be possible to tell whether or not they have become corrupted, and to make it obvious when values taken from uninitialized memory are being used. Memory is usually viewed in hexadecimal, so memorable repeating or hexspeak values are common. Numerically odd values may be preferred so that processors without byte addressing will fault when attempting to use them as pointers (which must fall at even addresses). Values should be chosen that are away from likely addresses (the program code, static data, heap data, or the stack). Similarly, they may be chosen so that they are not valid codes in the instruction set for the given architecture.

    Since it is very unlikely, although possible, that a 32-bit integer would take this specific value, the appearance of such a number in adebugger ormemory dump most likely indicates an error such as a buffer overflow or an uninitialized variable.

    Famous and common examples include:

    CodeDescription..FACADE"Facade", Used by a number of RTOSes1BADB002"1 bad boot", Multiboot header magic number[17]8BADF00D"Ate bad food", Indicates that an Apple iOS application has been terminated because a watchdog timeout occurred.[18]A5A5A5A5Used in embedded development because the alternating bit pattern (1010 0101) creates an easily recognized pattern onoscilloscopes andlogic analyzers.A5Used in FreeBSD's PHK malloc(3) for debugging when /etc/malloc.conf is symlinked to "-J" to initialize all newly allocated memory as this value is not a NULL pointer or ASCII NUL character. (It may be a play on Russian "опять", pronounced "a piat'" which is A5 read aloud, meaning "again")[citation needed]ABABABABUsed by Microsoft's debug HeapAlloc() to mark "no man's land" guard bytes after allocated heap memory.[19]ABADBABE"A bad babe", Used by Apple as the "Boot Zero Block" magic numberABBABABE"ABBA babe", used byDriver Parallel Lines memory heap.ABADCAFE"A bad cafe", Used to initialize all unallocated memory (Mungwall, AmigaOS)0DEFACED"Defaced", Required by Microsoft's Hyper-V hypervisor to be used by Linux guests as their "guest signature", after changing from original 0xB16B00B5 ("Big Boobs")BAADF00D"Bad food", Used by Microsoft's debug HeapAlloc() to mark uninitialized allocated heap memory[19]BAAAAAAD"Baaaaaad", Indicates that the Apple iOS log is a stackshot of the entire system, not a crash report[18]BAD22222"Bad too repeatedly", Indicates that an Apple iOS VoIP application has been terminated because it resumed too frequently[18]BADBADBADBAD"Bad bad bad bad", Burroughs large systems "uninitialized" memory (48-bit words)BADC0FFEE0DDF00D"Bad coffee odd food", Used on IBM RS/6000 64-bit systems to indicate uninitialized CPU registersBADDCAFE"Bad cafe", On Sun Microsystems' Solaris, marks uninitialised kernel memory (KMEM_UNINITIALIZED_PATTERN)BBADBEEF"Bad beef", Used in WebKit[clarification needed]BEEFCACE"Beef cake", Used by Microsoft .NET as a magic number in resource filesC00010FF"Cool off", Indicates Apple iOS app was killed by the operating system in response to a thermal event[18]CAFEBABE"Cafe babe", Used by Java for class filesCAFED00D"Cafe dude", Used by Java for their pack200 compressionCAFEFEED"Cafe feed", Used by Sun Microsystems' Solaris debugging kernel to mark kmemfree() memoryCCCCCCCCUsed by Microsoft's C++ debugging runtime library and many DOS environments to mark uninitializedstack memory.CC resembles the opcode of the INT 3 debug breakpoint interrupt on x86 processors.CDCDCDCDUsed by Microsoft's C/C++ debug malloc() function to mark uninitialized heap memory, usually returned from HeapAlloc()[19]D15EA5E"Disease", Used as a flag to indicate regular boot on the Nintendo GameCube and Wii consolesDDDDDDDDUsed by MicroQuill's SmartHeap and Microsoft's C/C++ debug free() function to mark freed heap memory[19]DEAD10CC"Dead lock", Indicates that an Apple iOS application has been terminated because it held on to a system resource while running in the background[18]DEADBABE"Dead babe", Used at the start of Silicon Graphics' IRIX arena filesDEADBEEF"Dead beef", Famously used on IBM systems such as the RS/6000, also used in the classic Mac OS operating systems, OPENSTEP Enterprise, and the Commodore Amiga. On Sun Microsystems' Solaris, marks freed kernel memory (KMEM_FREE_PATTERN)DEADCAFE"Dead cafe", Used by Microsoft .NET as an error number in DLLsDEADC0DE"Dead code", Used as a marker in OpenWRT firmware to signify the beginning of the to-be created jffs2 file system at the end of the static firmwareDEADFA11"Dead fail", Indicates that an Apple iOS application has been force quit by the user[18]DEADF00D"Dead food", Used by Mungwall on the Commodore Amiga to mark allocated but uninitialized memory[20]DEFEC8ED"Defecated", Used for OpenSolaris core dumpsEBEBEBEBFrom MicroQuill's SmartHeapFADEDEAD"Fade dead", Comes at the end to identify every AppleScript scriptFDFDFDFDUsed by Microsoft's C/C++ debug malloc() function to mark "no man's land" guard bytes before and after allocated heap memory[19]FEE1DEAD"Feel dead", Used by Linux reboot() syscallFEEDFACE"Feed face", Seen in PowerPC Mach-O binaries on Apple Inc.'s macOS platform. On Sun Microsystems' Solaris, marks the red zone (KMEM_REDZONE_PATTERN)

    Used by VLC player and some IP cameras in RTP/RTCP protocol, VLC player sends four bytes in the order of theendianness of the system. Some IP cameras expecting that the player sends this magic number and do not start the stream if no magic number received.

    FEEEFEEE"Fee fee", Used by Microsoft's debug HeapFree() to mark freed heap memory. Some nearby internal bookkeeping values may have the high word set to FEEE as well.[19]

    Note that most of these are each 32 bits long — the word size of most 32-bit architecture computers.

    The prevalence of these values in Microsoft technology is no coincidence; they are discussed in detail inSteve Maguire's bookWriting Solid Code fromMicrosoft Press. He gives a variety of criteria for these values, such as:

    • They should not be useful; that is, most algorithms that operate on them should be expected to do something unusual. Numbers like zero don't fit this criterion.
    • They should be easily recognized by the programmer as invalid values in the debugger.
    • On machines that don't have byte alignment, they should be odd numbers, so that dereferencing them as addresses causes an exception.
    • They should cause an exception, or perhaps even a debugger break, if executed as code.

    Since they were often used to mark areas of memory that were essentially empty, some of these terms came to be used in phrases meaning "gone, aborted, flushed from memory"; e.g. "Your program is DEADBEEF".

    See also

    • iconSoftware Testing portal
    • Magic string
    • File format,Magic number section
    • List of file signatures
    • FourCC
    • Magic (programming)
    • NaN (Not a Number)
    • Enumerated type
    • Hexspeak, for another set of magic values
    • Nothing up my sleeve number about magic constants incryptographic algorithms
    • Time formatting and storage bugs, for problems that can be caused by magics
    • Sentinel value (aka flag value, trip value, rogue value, signal value, dummy data)
    • XYZZY (magic word)

    References


  2. Odd Comments and Strange Doings in Unix

  3. Personal communication with Dennis M. Ritchie

  4. "The Unix Tree".tuhs.org.

  5. "The Unix Tree".tuhs.org.

  6. "PNG Specification: Rationale".libpng.org.

  7. "What’s the difference between the COM and EXE extensions?". blogs.msdn.microsoft.com.

  8. "Does anyone know if the following configurations can be done with MCP CLI Tool? - WiLink™ WiFi + Bluetooth Forum - Wireless Connectivity - TI E2E Community".ti.com.

  9. Poley, Josh."Magic Numbers: Integers".MSDN.

  10. Martin, Robert C, (2009). "Chapter 17: Smells and Heuristics - G25 Replace Magic Numbers with Named Constants".Clean Code - A handbook of agile software craftsmanship. Boston: Prentice Hall. p. 300.ISBN 0-13-235088-2.

  11. Martin, Robert C, (2009). "Chapter 17: Smells and Heuristics - G16 Obscured Intent".Clean Code - A handbook of agile software craftsmanship. Boston: Prentice Hall. p. 295.ISBN 0-13-235088-2.

  12. Datamation.com, "Bjarne Stroustrup on Educating Software Developers"http://www.datamation.com/columns/article.php/3789981/Bjarne-Stroustrup-on-Educating-Software-Developers.htm

  13. IBM Developer, "Six ways to write more comprehensible code"http://www.ibm.com/developerworks/linux/library/l-clear-code/?ca=dgr-FClnxw01linuxcodetips

  14. 'flounder'."Guaranteeing uniqueness".Message Management. Developer Fusion. Retrieved2007-11-16.

  15. Larry Osterman (July 21, 2005)."UUIDs are only unique if you generate them...". Larry Osterman's WebLog - Confessions of an Old Fogey. MSDN. Retrieved2007-11-16.

  16. "Java SE 6 Release Notes.". Retrieved 2010-06-18.

  17. "GNU GRUB Installation, Section 3.4: BIOS installation". gnu.org. Retrieved2014-06-26.

  18. http://ftp.lyx.org/pub/mach/mach4/multiboot/multiboot-archive

  19. https://developer.apple.com/library/ios/technotes/tn2151/_index.html

  20. "Win32 Debug CRT Heap Internals".nobugs.org.

  21. http://cataclysm.cx/random/amiga/reference/AmigaMail_Vol2_guide/node0053.html
阅读全文
0 0
原创粉丝点击