I am a Software Development Engineer in Test working for the Windows Sound team. You can contact me via email: mateer at microsoft dot com
Friend key: 28904932216450_59cd9d55374be03d8167d37c8ff4196b
Disclaimer: I don't work on the Office team.
Word has a smart quotes feature where it will automagically transform
straight "double quotes," 'single quotes,' and greengrocer's apostrophes
into
curly “double quotes,” ‘single quotes,’ and greengrocer’s apostrophes
as you type. You send a Unicode Character 'APOSTROPHE' (U+0027) to Word, and Word turns it into a Unicode Character 'LEFT SINGLE QUOTATION MARK' (U+2018) or a Unicode Character 'RIGHT SINGLE QUOTATION MARK' (U+2019) as appropriate. If you type it at the beginning of a word, it's an opening-single-quote; if you type it in the middle of a word, it's an apostrophe; if you type it at the end, it's either an apostrophe or a closing-single-quote, but both are the same character, so it doesn't matter.
Right?
Usually.
The apostrophe is occasionally used at the beginning of a word, to mark elided letters. Word has trouble with this.
‘Twas brillig, and the slithy toves did gyre and gimbol in the wabe.
-- Jabberwocky
I want to give the Word folks credit here. A common use of an apostrophe at the beginning of a word is to abbreviate a year. Word gets this right (I'm using Word 2010 with default settings:)
Check it out: a ’57 Chevy!
But Word also gets it wrong when you want to single-quote a clause that begins with a number:
“They were singing ’99 bottles of beer on the wall’.”
Also, if you pluralize the date, Word gets suckered:
’10 models on sale! Check out the new ‘11s!
Little nifties, from the ‘50s, innocent and sweet;Sexy ladies from the ‘80s, who are indiscreet -- 42nd Street
For those times when Word gets it wrong, here's how to fix it.
If you want to type a word that starts with an apostrophe:
If you want to use an opening single quote with a sentence that starts with a number:
That "Undo" tip is actually a fairly powerful curative against all sorts of Word voodoo.
Warning: trigonometry ahead.
Last time we looked at how to downmix a stereo signal to mono (M = L/2 + R/2). The resulting M signal can only be as powerful as the L and R signals if they are perfectly correlated (L = R); if the L and R signals are uncorrelated (no relationship between L and R), the resulting M signal is only half as powerful; and if the L and R signals are anticorrelated (L = -R), the resulting M signal vanishes.
This time I want to look more closely at what happens to M as {L, R} varies from correlated via uncorrelated to anticorrelated. In particular I'll take L and R to be full-scale sine waves of equal frequency and offset by a constant phase: {L, R} = {sin θ, sin(θ - φ)}. We'll see what happens to IM / IL as a function of φ.
Recall from before that the intensity of a signal s(t) over a time interval (a, b) is defined as
where the dc value is
Our downmixed signal is defined as
So our dc is zero (note that I am taking (a, b) to be a single period:)
A refresher on the angle-sum identities, which I will use without proof:
We know from before that IL = IR = sqrt(1/2) = 0.707.... Let's calculate IM as a function of φ:
Nice and simple.
Are we done? No.
When you see a fact, try to see it as intuitively as possible -- Pólya
OK, let's graph this.
That looks suspiciously like a cosine in absolute value. In particular, after messing around with a graphing calculator, it looks like:
Is this in fact a trigonometric identity? Let's see...
Much nicer and simpler. So why didn't our original derivation land us here?
Let's go back to our original graph and shift our frame of reference forward by φ/2. Instead of {L, R} = {sin θ, sin(θ - φ)} we get {L, R} = {sin(θ + φ/2), sin(θ - φ/2)}. Solving for IM now gives:
This result is much easier to digest. The sqrt(1/2) is the intensity of the pre-mixed signal; the loss of intensity due to the downmixing, then, is |cos(φ/2)|.
I've written a perl script (attached) which will parse MPEG audio headers and display them in a human-readable format.
For example, if you run it on ding.mpeg (also attached) you get this output:
Here's the source for the perl script:
Note this script assumes that the very first bytes of the file are the MPEG audio header, and makes no effort to dig into the file to find the audio header.
Today's XKCD strip purports to show a complete map of tic-tac-toe including optimal moves.
I'm guessing the optimality of the move takes into account both the game-theoretic value of the move, assuming a perfect opponent:
And the practical value of the move, which allows for the possibility of error either on the player's part or the opponent's part.
In particular, I'm guessing that at each level Randall eliminated all the "bad" (and "very bad") moves, then broke the "well, all these moves are 'good'" tie by looking at some aggregation of the values of all following positions. The idea is, you want to pick the "good move" which:
If there are still ties, I am guessing that Randall invoked a randomizer. For example, X's first move (in the top left corner) is tied in every possible respect with the other three corners.
I object to this approach because humans don't always pick moves randomly. They learn. They make rules for themselves, some of which are fallible, and can be exploited. For example, "move in the center if you can" is a typical rule, followed by "if you can't move in the center, move in a corner." Also, I think information is lost by hiding the other "good" moves.
So, here's my version. I don't go into nearly as much depth, but here is the game-theoretic value of all of X's first moves (W = win; D = draw; L = loss:)
Not very exciting... a nine-way tie.
And for each first move for X, here is the game-theoretic value of all of O's first moves (I only show three, the others can be inferred by symmetry:)
For an example of a "very bad" move, consider the position after X moves in the top left corner (a good move) and O moves in the lower left corner (a bad move, after which X has a won position:)
Suppose you have a stereo stream that you want to downmix to mono. Why would you do this? Maybe you're playing stereo music to a Bluetooth headset that is in a call, and thus in "headset / handsfree" mode. Maybe you're capturing from a stereo mic and you want to show a visualization based on a mono reduction of the signal.
The basic formula to use is M = L / 2 + R / 2 but there are a couple of things to be aware of.
Consider the simplest case first where the left and right channels are identical. Naturally, the resulting mono signal is identical to both of the channels:
In particular, downmixing a stereo signal of identical full scale sine waves (power = -3 dB FS) results in a -3 dB FS mono sine wave. Well and good.
This, however, is a simple coincidence few could ever have counted upon. (A similar effect is the lack of spectral leakage if your signal period exactly matches up to your FFT window period.) As a rule, downmixing results in a loss of power. To get a basic idea of why this is, let's take two different sine waves and downmix to a two-tone:
Note that downmixing these two totally uncorrelated signals results in a loss of power of 3 dB FS; the power of the two-tone is -6 dB FS, 3 dB FS lower than each of the individual -3 dB FS signals that went into it.
It is tempting to conclude that mixing two signals of power P gives a resultant signal of power between P - 3 dB and P, depending on the degree of correlation. However, this conclusion is incorrect: signals can be correlated; uncorrelated; or anticorrelated.
Once in a while you get a stereo microphone which captures heavily correlated L and R channels, but (due to one reason and another) inverts one of the channels. Instead of being heavily correlated, the L and R signals are now heavily anticorrelated. This is bad enough when you try to listen to it: but when you downmix to mono, the signal disappears!
The effect with a "real" stereo signal is somewhat less dramatic because it's receiving only very highly correlated signals (not perfectly correlated.) So the downmix to mono only almost totally destroys the signal.