APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

2003/09/22 magic number, automagically, magic cookie, pfm

© September 2003 Tony Lawrence

A magic number and a magic cookie are closely related. The "magic" part is a sequence of bytes that is otherwise meaningless but has some signifigance to a particular program or programs. I use a magic cookie to separate these definitions in the raw data file I keep them in. It's just a string of letters and numbers that I'd never type, so it can separate entries.

Magic numbers are also used in the the first few bytes of executables to help loaders determine what needs to be done, and often in data files to help apps figure out how to handle them.

A magic cookie is similar, but it's something passed between programs, perhaps for authentication or session tracking purposes. It's exactly the same purpose as a web cookie that helps the site know your preferences when you return for another visit.

When something is done automagically, it means that you either don't know the mechanics behind it or it's too obviously trivial to bother describing. It can also be used in a sarcastic sense to describe something that can't actually happen, or is bloody unlikely. You can also use it when you desparately need to fill in some gap in the chain of hoped for events you are building, but at the moment have no idea how to do that. In this sense it's almost interchangeable with "and then a miracle happens".

Related to that thought is "pfm", which is the polite abbreviation of "pure effing magic", which can be an expression of how some unlikely task will be accomplished or could be an honest expression of admiration. It's also sometimes used as a replacement for "that part is none of your business".

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> 2003_09_22.html magic number, automagically, magic cookie,pfm

Inexpensive and informative Apple related e-books:

El Capitan: A Take Control Crash Course

Take Control of Apple Mail, Third Edition

Take Control of Preview

Take Control of Parallels Desktop 12

Take Control of iCloud

More Articles by © Tony Lawrence

"A magic cookie is similar, but it's something passed between programs, perhaps for authentication or session tracking purposes."

Magic cookie has also been used to refer to the behavior of some ancient dumb terminals when encountering an escape sequence meant to change a character attribute. The attribute change consumed a physical screen position -- the cursor actually moved, the visual result being the "magic cookie." It was a real hassle to produce a reasonably attractive display with such a terminal. Therefore, I had a much less polite way to describe this effect.

"Related to that thought is 'pfm', which is the polite abbreviation of 'pure effing magic'..."

I first heard that expression in the mid-1960's, while in the U.S. Navy. At my alma mater (the Great Lakes Training Center north of Chicago), there was a humongous vacuum tube computer that could perform ballistics calculations. The machine was quite cranky and didn't always do as it was told (one time it said to depress the guns a couple of degrees below the horizon in order to hit a target 15 miles out -- definitely a good way to kill some whales). When that sort of nonsense occurred, it was "fm," no 'p' being used. Non-technical types who heard us say "fm" thought we were referring to radio broadcasting.


---January 3, 2005

Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

C++ is just an abomination. Everything is wrong with it in every way. So I really tried to avoid using that as much as I could and do everything in C at Netscape. (Jamie Zawinski)

Linux posts

Troubleshooting posts

This post tagged:




Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode