tags:

views:

463

answers:

13

I am looking for a memorable 32-bit value to be used as a constant. If possible, it should be somewhat funny too.

So far, I have come up with these two:

0xcafebabe

0xdeaddad

Can you please suggest some other too?

Thank you.

+1  A: 

0xDEADBEEF 0xDEADBABE

...

Hexspeak

schnaader
+2  A: 

The classic is 0xdeadbeef.

Richard Pennington
I wouldn't use it, since it's so common as a memory boundary.
C. Ross
I don't get it: how is 0xDEADBEEF a memory boundary?
Ned Batchelder
It means that stock memory allocators often use it to mark unallocated blocks already, so its use to mark something else would conflict with that usage.
Pavel Minaev
+15  A: 

A comprehensive list of magic constants is here:

Hexspeak

Magic Number

And see the links therein.

Jason
+1  A: 

Take a look at these magic numbers.

Andy West
+1  A: 

Here's another: 0xDEADCAFE :)

tommieb75
This one is for dads programming in C! 0xFEEDBABE :)
tommieb75
+2  A: 

Here are a bunch of hex words that you can use to make a constant.

Ned Batchelder
+9  A: 

I wonder, that as a programmer you need to ask. After all it takes a word-list and a one-liner of C++ to find suitable words.

#include <iterator>
#include <string>
#include <algorithm>
#include <iostream>
#include <boost/lambda/lambda.hpp>
#include <boost/lambda/bind.hpp>

int main()
{
    using namespace boost::lambda;
    std::remove_copy_if(
        std::istream_iterator<std::string>(std::cin),
        std::istream_iterator<std::string>(),
        std::ostream_iterator<std::string>(std::cout, " "),
        bind(&std::string::size, _1) != 8u
            ||
        bind(
            static_cast<std::string::size_type (std::string::*)(const char*, std::string::size_type) const>(
                &std::string::find_first_not_of
            ),
            _1,
            "abcdefgiost",
            0u
        ) != std::string::npos
    );
}
UncleBens
+1 for "one-liner of C++" :)
Jimmy
+1  A: 

0xBADDD00D, 0xBADDFACE, 0xCAFEF00D, 0xBAADCAAB, 0xBADCAB1E etc etc

Sinan Ünür
+2  A: 

sed '/[^a-f]/d' < /usr/share/dict/words | awk '{print length, $0}' | sort -n | cut -f2- -d' '

pixelbeat
+1  A: 

0x00abacab

(Which happened WAY after Peter Gabriel left.)

Nosredna
+1  A: 

I like 600df00d

kenny
+1  A: 

0x0BE5EBEE 0xADEAD60D

jbcreix
+1  A: 

I'm a fan of 0xBAADF00D.

Taylor Price