StackExchange folks, KeyMinor already exists

Why is there a StackExchange proposal in the works for a “Musical Practice and Performance site” when KeyMinor already exists on the SE platform?

The proposed site is “for people who play musical instruments. On-topic questions will be about technique, practice, theory, composition, and repertoire.” KeyMinor already serves this purpose, it’s just not known about.

I’d add a comment to the proposal but I see no way to; I probably don’t have sufficient reputation points.

Why the Pernice Brothers Don’t Tour

From “Will he/they tour?“:

JP: We make any money if we tour for two weeks?

JL: You mean ten days, if rehearsals are included.

JP: Yes.

JL: No.

JP: Well then why would we do it?

RM: Because Menck wants to rock.

JL: Theoretically, the tour is just one piece of the things you do if you want to sell records.

JP: We don’t sell enough records at shows to justify that. Especially if YOU work the merch table, because people are scared of you.

JL: Theoretically, it’s not just the stuff you sell at the show, it’s the review that you get in the local paper, the placement you get in the local record store, none of which happens if you don’t play a show in that city.

JP: So you think we should tour?

JL: The extent of the fuck I do not give about whether you tour can’t really be measured.

RM: Doesn’t anyone care that Menck just wants to rock?

PHP UTF-8 string class

A couple years ago I put together a class for UTF-8 strings, kind of a smart wrapper around Harry Fuecks’s phputf8 string functions. All Utf8String objects—if I’m not missing bugs!—are guaranteed to house valid UTF-8 strings. The factory, make(), enforces UTF-8 validity, stripping non-UTF-8 bytes (default) or replacing them with Utf8String::$replacement (? by default).

$str = Utf8String::make('āll īs & ōk');

All the major string functions are methods with similar signatures (dropping the input string argument). Since native string assignment is always a copy, I felt all Utf8String objects should be immutable to avoid accidental referencing. After the following line, $str actually points to a fresh Utf8String object:

$str = $str->ucwords(); // Āll Īs & Ōk

Of course this means they’re chainable:

$str = $str->strtolower()->toAscii(); // all is & ok

Casting to string does what you’d think:

echo $str; // out come UTF-8 bytes.

Checking for UTF-8/ASCII-ness can be slow, so methods that create new objects propagate this info into the constructor so the new objects don’t have to check again. The constructor is private to avoid misuse of those arguments. I also threw in some convenience methods:

// input() returns false if $_POST['msg'] isn't present
if ($msg = Utf8String::input($_POST, 'msg')) {
    echo $msg->_; // escape with htmlspecialchars
}

In theory a framework could use a class like this to force safer string handling throughout:

function handleStrings(Utf8String $input) { /**/ }

It’s a proof-of-concept anyway (it’s missing preg_* methods and a lot of other stuff), but if the API could be ironed out, someone could make it into a proper C extension.

Research Chain E-mails in 30 Seconds

A friend or family member has just forwarded you a wonderful piece of propaganda: It’s filled with inflammatory bare assertions, stirring anecdotes, and a dare to pass it on to everyone you know! And no sources.

1. Find a phrase in the message that’s a) unlikely to appear in anything else on the web, and b) contains minimal or no punctuation.

Bad: “Really important!!! Will take thirty seconds to read+-+-+Aren’t you mad!?!?”

Good: “Many citizens had no idea that members of Congress could retire with the same pay after only one term”

2. Search for the phrase without surrounding quotes.

3. Look for results on sites with names like: Snopes, Urban Legends, Politifact, Truth or Fiction, Hoax Busters, etc.

4. If you can’t find any page debunking your forward, search again with quotes around it, try another phrase, or add “hoax” or “myth” to the search. E.g. the next phrase in the e-mail with “myth” added returns the same top three results, all to myth-busting sites.

If you still can’t find anything, you have scientifically proven the forward to be 100% true! If the message confirms your preexisting beliefs, it must be true.

Chords: The Flaming Lips “All We Have is Now”

[Song on YouTube] All the tabs I could find were crap, so I wrote up a guitar arrangement. The inverted voicings in the choruses made it tough to figure out, but capoing the 2nd fret gets it pretty close.

Capo 2nd fret. / = 1/4 note

V1)
  A    3-5-5-4-3-x  (2 bars) As logic stands you couldn't meet a man who's from the
  G#m  2-4-4-2-2-x  (2 bars) future.
  A    3-5-5-4-3-x  (2 bars) But logic broke as he appeared he spoke about the
  G#m  2-4-4-2-2-x  (2 bars) future.
  B    5-7-7-6-5-x  (1 bar)  "We're not gonna
  A    3-5-5-4-3-x  (1 bar)  make it."
  B    5-7-7-6-5-x  (1 bar)  He explained how the
  A    3-5-5-4-3-x  (1 bar)  end will come.
  A    3-5-5-4-3-x  (2 bars) You and me were never meant to be part of the
  G#m  2-4-4-2-2-x  (1 bar)  future.
  B          x-0-7-6-5-x  / /
  Bsus4add9  x-0-x-4-3-x  /
  Bmaj7      x-0-6-6-5-x  /

C)
  Amaj7      3-2-0-0-0-2  (1 bar)     All we
  Dmaj7/F#   0-3-2-0-0-0  (1 bar)  have     is
  C#m7/G#    2-2-4-2-3-2  (1 bar)  now.
  F#7sus4    0-x-2-2-3-x  / /
  F#         0-x-2-1-0-0  / /

  All we've ever had is now.
  All we have is now.

  Amaj7      3-2-0-0-0-2  (1 bar)    All we've
  Dmaj7/F#   0-3-2-0-0-0  (1 bar)  ever had     i-
  G#m7       2-4-2-2-2-2  (2 bars) is now.

B1)
  F#m7       0-2-2-0-3-x  (1 bar)
  B7         x-0-2-0-2-0  (1 bar)

V2)
  I noticed that he had a watch and hat that looked familiar.
  He was me from a dimension torn free of the future.
  "We're not gonna make it." He explained how the end will come.
  You and me were never meant to be part of the future.

C)

B2)
  F#m7       0-7-5-7-x-x  (2 bars)
  Emaj9      x-5-4-6-5-x  (2 bars)
  D9-5       8-x-8-7-7-x  (2 bars)
  A          3-x-0-0-0-3  (2 bars)
  Bm6/F#     0-0-2-2-1-2  (1 bar)
  E7/G#      2-0-0-2-1-2  (1 bar)

Outro)
  Amaj7      3-2-0-0-0-2  (1 bar)     All we
  Dmaj7/F#   0-3-2-0-0-0  (1 bar)  have     is
  C#m7/G#    2-2-0-2-0-x  (end)    now.
  ...
  C#m9       x-2-0-2-2-x  (organ adds D#)
  ...
  C#m11      x-2-0-2-2-0  (synth adds F#)

Reasons to Extend Unemployment Benefits

From the left, Ezra Klein: the Bush tax cuts certainly majorly increased the deficit [CBO], and it’s unfair for the GOP to demand that the unemployment extension be deficit-neutral.

Further, if tax cuts don’t need to be paid for because they generate so much taxable economic activity that they pay for themselves, then neither do unemployment checks. After all, the two work very similarly: A tax cut puts more money in your pocket. Unemployment insurance puts more money in an unemployed person’s pocket. The difference is that the unemployed person is likelier to spend that money, which will generate more taxable economic activity than if that money is saved. That’s why Mark Zandi, an adviser to John McCain’s presidential campaign, estimated (pdf) that a dollar spent extending the Bush tax cuts would generate .32 cents of taxable economic activity, while a dollar spent on unemployment benefits would generate $1.61 of taxable economic activity.

In other words, using the theory under which tax cuts pay for themselves, unemployment benefits are a lot likelier to pay for themselves. …

More reasons to extend them:

  • Ending benefits doesn’t magically create jobs
  • Among those who can’t find work, spending will drop to nothing, depressing local economies
  • Walked away from mortgages and desperately-liquidated assets will destroy tremendous amounts of long term value for short-term needs.

From the right, Megan McArdle:

…in recessions, the length of time for which people need “temporary” assistance stretches out. That means that the government has to respond with temporary benefit extensions. These aren’t just good for the people who are unemployed; it’s also good for us. Unemployment assistance is one of the “automatic fiscal stabilizers” that all but the most hard-nosed conservative economists agree help smooth the business cycle in modern industrial countries. Indeed, it’s one of the most effective forms of stimulus we have.

… [Not extending benefits would be] terrible economic policy–suddenly cutting off the taps would have nasty knock-on effects on the economy. And while it’s a lot of money, it’s one of the few government programs that pretty much unequivocally improve the net welfare of the American people. If Bunning wants to hold up something, how about finding some useless defense appropriations to complain about?

MVC: M != the Database

Great article on the misunderstood scope of the “Model” in the Model-View-Controller architecture. The takehome: Models are commonly thought of as wrappers for database access/stored objects, but application state and business logic need to go in them, too. Otherwise you get bloated controller and/or views that clumsily try to take care of these concerns.

Earlier today I was building a multi-step wizard app—no DB storage—and found my controllers getting messy with session and state handling code. The solution was a Wizard class that encapsulated the steps through the forms and the maintenance/validation of the collected data, but until this article I might not have thought of it as a model.

Zend Framework kinda, sorta has a hack for making a wizard using “subforms” and what makes this an awkward construction is that a view helper is not the best place to maintain the state info that a wizard requires. A “Zend_Wizard” class would need to encapsulate several forms; requirements and behaviors for moving forward and backward through the forms; and methods to inc/dec the step state, fetching the active form injected with session data. Only a single controller would be needed with 2 next/back methods, rather than methods for each step.

In the Elgg plugin ecosystem, there’s very little guidance/emphasis on creating models, so writers rarely encapsulate business logic at all. Instead it becomes spread out amongst controllers and—worse—views. Since views can easily be overridden depending on the order of plugins in a list, business logic can easily be mangled by logic from another plugin. That said, the view system does allow mods to mix behaviors in ways that would be difficult were views to be tied more closely to individual plugin models; a few exemplary mods—that store state and validation in a model rather than the controller/views—might help positively influence the culture.

Bass for Stereolab’s “Miss Modular”

“Miss Modular” has an amazing bass line. It’s probably looped on record, but they play it live…and usually faster than the recording. I’m fairly sure it’s capoed at the 7th fret—that’s how I’ve typed it up here.

Stereolab "Miss Modular"
Capo bass @ 7th fret.
spaces/numbers/hyphens = 1/16th notes.
/ = 1/4 notes.

Intro)

  /       /       /       /       /
D                       2---
A         4---              4-
E                             4---
B 0-------    0---2-----          0-------------------------------

Verse)

  /       /       /       /       /       /       /       /
D                       2---
A         4---              4-            4---    4---  2-
E                             4---                          5-2---
B 0-------    0h1h2-----          0-------    0---

  /       /       /       /       /       /       /       /
D                                                 2---
A                 4---  4-- 2-            4---          4-- 2-
E         5---2---            4---                            4---
B 0------/                        2-------    2---

Notes:

  • Mute all the strings, but mostly the bottom 3.
  • At the beginning of the 3rd measure, by fretting the A on the 2nd string, you can slide the end of the low B up to meet it.
  • Chords are just Bm7 and C#m7 (the brass makes A and C#m9 chords)