Wednesday, May 29, 2013

On well-poisoning and letting "the team" down

(Alternate title: Your fellow ideologues are idiots and there is nothing you can do.)

Ever gotten into a political discussion and then someone who agreed with you started calling your opponents names and playing buzzword non sequitur bingo and making your side look like jerks? Yup. That's pretty much reality.

No matter what you believe or how reasonable you think your views are, there is some utter waste-of-a-first-world-life asshole out there who agrees with you.

I spent a lot of years self-identifying as not an atheist, just an agnostic, not because I believed in the supernatural to any significant degree, but because I wanted to stay the fuck away from the assholes who currently represented the atheist label. You know the type. Richard Dawkins. Wannabe nihilist teens with unlimited access to black hair dye and a painfully feigned understanding of Nietzsche. Self-important private school intellectual hipsters saying I knew there was no God the moment I found out Santa wasn't real.

Sunday, May 26, 2013

Facebook photos and high school algebra

When I get around to uploading phone camera photos to Facebook, I start off by looking at the twenty or so photos I've taken since last time, and end up actually uploading a fairly small fraction (perhaps a quarter?) of them. Somewhere in between that, I need to spend some time in Photoshop (i.e. the just-as-good open-source program, GIMP) compensating for how terrible all my phone's photos look.

Let \(N\) be the original number of photos, and \(M\) be the number of photos worth keeping.

My old Facebook photo uploading workflow:

  • Hand-pick the photos that will probably look nice after touching up. (Estimated time: \(0.1N\) minutes.)
  • For each photo I want to use, open it in GIMP (i.e. Photoshop but free). Auto-correct the colour in GIMP. Play around with contrast, saturation and cropping settings in GIMP. (Estimated time: \(2.5M\) minutes.)
  • Upload those photos to Facebook. (Estimated time: \(0.1M\) minutes.)
  • Add captions, dates, tags, etc. (Estimated time: \(0.5M\) minutes.)

Estimated total time: \(0.1N + 3.1M\) minutes.

E.g. typical upload spree (20 original photos, 6 actually uploaded): 20 minutes.

My new Facebook photo uploading workflow:

  • Upload all the photos to a private Google+ album. (Estimated time: \(0.1N\) minutes.)
  • Hand-pick the photos that look nice after Google+ applied Auto Enhance to them. Download them back to my computer. (Estimated time: \(0.3N\) minutes.)
  • Upload those photos to Facebook. (Estimated time: \(0.1M\) minutes.)
  • Add captions, dates, tags, etc. (Estimated time: \(0.5M\) minutes.)

Estimated total time: \(0.4N + 0.6M\) minutes.

E.g. typical upload spree (20 original photos, 6 actually uploaded): 12 minutes.

Discussion

Rough analysis suggests that the new method saves time when: $$ \begin{align} 0.1N + 3.1M &> 0.4N + 0.6M \\ \Leftrightarrow 2.5M &> 0.3N \\ \Leftrightarrow M &> 0.12N \end{align} $$

So if I have twenty photos and only one of them is any good, I'd be better off doing the GIMP method than wasting all my time going through Google+.

Further research

  • How much time will it save once I set up my phone to sync my photos with Google+?
  • If/when Facebook rolls out photo enhancement technology, how much time will I save directly uploading to them?
  • Is \(M\) independent of the method I use? E.g. am I subconsciously happier to select more photos using the "new method" because I know it'll take less time-per-photo-used?

#science

Thursday, May 23, 2013

In the court music of ancient China...

Aided by a concert hall's reverberations, a large orchestra puts out just about as much sound as we can comfortably and safely hear. Roughly ten times as many instruments would be required to double the subjective loudness of the most earsplitting fortissimo.

In the court music of ancient China, orchestras of over a thousand players were assembled to produce a sound loud enough to be heard in heaven. Today we do something similar at rock concerts, perhaps more in the spirit of communing with hell.

Music, the Brain and Ecstasy, by Robert Jourdain

SIGGRAPH 2013 Preview (or: ZOMG)

The annual SIGGRAPH conference is one of the most notable technical gatherings for industries like motion pictures and video gaming.

And this preview video for this year's July conference was too cool not to share:

Here's a couple of things that look exciting:

  • A Material Point Method for Snow Simulation — Because when was the last time you saw snow that realistic in a video game? (No, cutscenes don't count.)
  • Make it Stand: Balancing Shapes for 3D Fabrication — If you own a 3D printer or have ever used Shapeways et al., I think this speaks for itself. Look at the tiny surface areas those things are resting on! Look at them! o_O
  • Scalable Real-time Volumetric Surface Reconstruction — Okay so mostly I'm impressed by the technical challenge the researchers must have overcome here. If I understand the abstract correctly, that's realistic 3D modelling from a single 2D video feed.

Which ones do you want to get your hands on?

Tuesday, May 21, 2013

[Reblog] "All Hail the Queen?"

Illustration by Irana Douer for Bitch Media

Shout out to Tamara Winfrey Harris (writing for Bitch Magazine) for an excellent essay on feminism, race and dangerously high standards: All Hail the Queen? — What do our perceptions of Beyonce's feminism say about us?.

Being a feminist in the public eye should not require remaining aloof about relationships... We don’t require this of men... President Barack Obama made a very similar claim about his spouse post-2008 election: I would not be standing here tonight without the unyielding support of my best friend for the last 16 years...Michelle Obama.

Tamara Winfrey Harris, All Hail the Queen?. Bitch Magazine, Issue 59.

Monday, May 20, 2013

On hyperconsent

I first heard the term "hyperconsent" on a couch while my fingers ran along a new friend's collarbones. It wasn't her place — her city, even — but she seemed perfectly at home on the couch cushions the same way that the weary are lying down at a long day's end. The air was thick with the intermingling scents of incense and goon, and the taste of the latter still weighed heavy on my tongue (we'd had just enough to stain our lips slightly red).

She and I spoke in hushed tones, trying not to disturb the flat's usual inhabitants, who'd excused themselves to bed not much earlier.

Thursday, May 16, 2013

What happens to your tax dollars?

The ABC brings us an excellent interactive infographic showing exactly how your Australian tax dollars will be spent* in the 2013-14 financial year.

Hovering over one of the coloured segments shows you what portion of the budget the government has allocated to that sector. For example, 6.42% of your money goes to medical services and benefits, and 5.53% goes to defence. (A better state of things than I'd thought!)

Click here to see more.

* It's possible you don't pay any tax in Australia! Maybe you don't work in Australia, or maybe you're Paul Hogan. In that case... You get to see how other people's money is spent...?

Wednesday, May 15, 2013

Why both "Chocolate Factory" film adaptations are worse than each other

"Worse than each other?" you say, furrowing your brow at the title of this post. "Isn't that logically impossible? Either they're just as bad, or one of them is the worst..."

No. I'm sorry. Your common sense and your actual understanding of primary school maths have no sway over me today, friend.

I never read Roald Dahl's Charlie and the Chocolate Factory -- blasphemy, perhaps? -- though I have great fondness for his work. (Matilda and The BFG spring to mind, as do many of his short stories for an adult audience -- I had a fondness for Mr. Botibol.) If you asked me, which you didn't, I'd say that I enjoyed both Mel Stuart's 1971 adaptation (f. Gene Wilder) and Tim Burton's 2005 adaptation (f. Johnny Depp) of the book. The latter lacked the former's indefatigably catchy Oompa Loompa song, but whether that's a plus or a minus is anyone's guess.

The original film wasn't well received by everyone, especially not by Roald Dahl himself. His former publisher, Liz Attenborough, was quoted saying:

[Dahl] thought [the original movie] placed too much emphasis on Willy Wonka and not enough on Charlie.

So, assuming the badness of a Charlie and the Chocolate Factory film is measured by how much extra attention the movie plays to its bigwig film star Wonka instead of Charlie the, uh, protagonist, then we can safely say the following:

One respect in which the Gene Wilder movie was undeniably worse than the Willy Wonka one:

Tuesday, May 14, 2013

Microphones with ears

If recorded music is to sound spatially authentic to our ears, what's needed are microphones with pinnae [ears]. It sounds like a preposterous idea, but in fact it's been done for years. You just sculpt a life-size head... and embed ordinary microphones at the ends of the ear canals. The head blocks high frequencies and creates the appropriate delays between the ears, and the pinnae make the usual reflections. Position the head at the best seat in a concert hall and perform an opera. Then listen to the recording through in-ear headphones...

The effect is magical. A whisper behind the ear is heard just there behind the ear.

Chapter 1, Music, the Brain and Ecstasy, by Robert Jourdain

Friday, May 10, 2013

Sequences without identical neighbours

Last April, in the middle of an Australian Informatics Olympiad camp, I and a number of colleagues ran an intense team event for the high school students at the camp, where we threw lots of mathematical and general knowledge puzzles at them rapid-fire. The students were grouped in teams of three, and each time was given two computers, an internet connection, and barely even ten person-minutes per problem.

I believe Luke Harrison and I came up with this particular problem. We realised about two hours before the competition was due to start that it was even more interesting than we'd previously thought.

"How many sequences of positive integers are there such that (1) no two consecutive integers are the same (i.e. the sequence is "valid"), and (2) they sum to \(N\)?"

This can be calculated in \(O(N^2)\) time using straightforward dynamic programming:

int nVS[N+1];
// nVS[x]      := number of valid sequences summing to x
int nWays[N+1][N+1];
// nWays[x][y] := number of valid sequences summing to x
//   and ending on y
nWays[0][0] = 1;
nVS[0] = 1;
for (int x = 1; x <= N; x++) {
  for (int y = 1; y <= x; y++) {
    nWays[x][y] = nVS[x-y] - nWays[x-y][y];
    nVS[x] += nWays[x][y];
  }
}
return nVS[N];

These sequences are called Carlitz Compositions [Kn98], and the number of sequences summing to \(N\) (OEIS A003242) can be computed an alternate way:

Sunday, May 5, 2013

[Poetry review] "I don't mean to oogle"

I recently received the following cold-call message on LinkedIn:

Roses are red, and violets are blue
I don't mean to oogle
at your experience from [company]*.

I know this may be a reach
but let me be brief
My proposal to you is unique
for your experience as a code loving geek