Why Detecting Child Pornography and Copyright infringement are not the same: A non-technical explanation

I’ve been following the circus surrounding SOPA, and it’s pretty disheartening to see the extent to which our political leaders fail to understand technology. Currently, it seems fashionable to assume that if you can detect child pornography, detecting copyright infringement should be a piece of cake. Technology is not magic. Hopefully this explanation makes this clear.

Let’s pretend you’re a computer. Not even a really dumb one like the one on your desk. You’re you, except a computer. An actual AI, so you’re smarter than all of the other computers around. Now, if I give you a pornographic photo, you could probably guess if the actors/actresses are under-aged right? You wouldn’t be right all the time, but your margin of error would be reasonably small.

Now, let’s pretend I give you a photograph of a Gucci purse from a website selling Gucci purses at ridiculously low prices. Tell me if it’s a forgery. Wait, you can’t do it? What if the photo is a picture of a legitimate purse, but the product sold is a fake? At this point, our political leaders would be telling you that you’re super-smart, so doing impossible things should be easy. What? Don’t believe me? That’s exactly what they told Google.

Okay, so a purse is one thing, but software is another. Sort of. Let’s say you buy Photoshop from a sketchy looking web site. Most software providers don’t actually sell software, they sell licenses, which look something like “XXXX-XXXX-XXXX-XXXX.” How are you supposed to tell if that’s fake? Photoshop can’t even tell it’s fake (this is why cracks work.)

You could make the argument that we should just shut down sites that traffic in pirated software, like “The Pirate Bay.” But, we already do. Just ask ICE.

Why you absolutely must write.

Writing well is hard, putting our thoughts down on paper can sometimes be daunting. Many of us have even been conditioned to believe we could never be decent writers. I suppose I may have even been one of them. While I never did badly in an English class growing up, I had no reason to believe I’d ever write for pleasure or because I’d be good at it (I still don’t think I am.)

Growing up, many of us never get to appreciate how much fun writing can be. We spend our academic careers writing the same hackneyed essay. We collect the perspective of various authors on a topic we care nothing about, survey their opinions, and regurgitate a foregone conclusion. While the topics change, the format never really does. So, is it any miracle that most of us shy away from writing in our spare time?

 

Specifically, most of us dread writing essays. This mostly stems from a misunderstanding of what an essay is. The word itself comes from the French esais, meaning simply “to try.” In it’s purest, most beautiful form, an essay is exactly that; a try at something, anything. It doesn’t even have to be polished. You only have to try. E.L. Doctorow said “Writing is an exploration. You start from nothing and learn as you go.”

 

That’s why writing is essential. Because the territory you explore is your thoughts. Writing becomes a mirror into your soul, letting you scrutinize yourself at a remove. This is why Montaigne, the father of the essay wrote. And even though he was the first, He’s still popular today. Montaigne writes about anything and everything, from bowel movements, to musings about his cat. He uses his writing as a medium for exploring himself, and the person he discovers lives within all of us.

 

So, even if you don’t like to write, put down your prejudices for a moment. Go on an adventure, in the land of the self.

Learn Stuff

I'm told I'm a fairly accomplished autodidact. I play the piano well; I've won several competitions. I'm a decent chess player and I also program fairly well. Warning: Study is Hard Work. It's also the title of an excellent book...

Learn to read

I can't understate the importance of this point. I don't simply mean literacy, either, when I say "learn to read." Learn to break books down into their constituent parts, summarize paragraphs, pick out concepts, and reconstruct the author's argument. Better yet, learn to do this as you read. To learn how to do this, there is no better resource than Mortimer Adler's "How to Read a Book." Buy it immediately if you haven't read it.

Learn to read fast

I'm going to come out and say that a lot of "speed reading" courses are peddling snake oil. That being said, I think it's reasonable to read at a rate of up to 3000 words per minute, depending on the material and how thoroughly it's being read. While I wouldn't recommend the entire course to anyone, if you read slowly, pick up Evelyn Wood's "reading dynamics" for some ideas on how to speed up your reading.

Learn not to read

An important part of reading is not reading. Learn how to tell when an author is about to diverge on an irrelevant tangent. This requires some familiarity with the author. It's also worth knowing how to spot "useless" information at a glance. Caveat emptor, you will miss irritating gotchas by not reading material thoroughly. That being said, when you're trying to get a "big picture" view of a new idea, "not reading" is very helpful.

Also, learn when to put the book down and just go figure stuff out the old fashioned way.

Learn to write

While it might not seem to help your ability to learn, to write clearly, you must think clearly. Clear thinking is essential to learning thoroughly.

Favor rigor

Avoid fluff books. If you can, purchase the most punishing, and most rigorous treatment of the material at hand. You can read the other books for funsies. This may sound like self-flagellation. It's not. Reading fluffy material and thinking you "know" anything is how you really shoot yourself in the foot.

Don't underestimate pure technique

While concepts are ultimately what the journey of learning arrives at, pure technique is valuable in and of itself. If you're a pianist, learn scales, and then learn Liszt exercises -- also, Dohnanyi, Bartok, Brahms (Hanon is intentionally excluded.) Chess players should drill tactics. Programmers should do code katas, play code golf, refactor old code, or whatever does the trick. Programming is by far the most nebulous skill I've encountered in terms of defining pure technique. Personally, I work through "Structure and Interpretation of Computer Programs" on a yearly basis. Find what works for you.

Maxims are maximally awesome

Maxims are easily quoted bits of wisdom. I like them because they're easy to remember. Tangentially, my favorite book of maxims is Balthasar Gracian's "The Art of Worldly Wisdom." Easily quoted is easily remembered!

If you can't use your brain, use your hands

This is a bit of advice I give to my students all the time. Make your life easier (this doesn't mean cut corners.) For instance, when learning Emacs, I had cheatsheets pasted to my walls. I instruct each of my piano students to write notes in the score if they can't read them fast enough, or to circle frequently missed notes in red.

Repetition repetition repetition!

This bears repeating (pun intended.) Repetition is the key to mastering any complex skill. To make repetition more efficient, I use spaced repetition software. Anki is my preference, but SuperMemo also works well. I don't just use these programs for facts, I mix in math problems and chess tactics to keep my skills sharp.

What occurs in the real world is an epiphenomenon created by what occurs in the mind

Obviously, this is only meant in the context of skills. I'm not promoting mysticism. This is especially important with physical skills. Learning to cultivate a perfect mental image--that manifests all of the senses--of what is to be done, is a huge step on the road to mastery. To a lesser degree, this applies to symbolic skills. In programming, it's important to learn to reason independently of the syntax of a particular programming language.

Something is better than nothing

This ought to be obvious, but when faced with the decision to do something or nothing always do something. I work a full time job, so I can't always commit to honing each of my skills for hours a day. If I know my day is going to be busy, I make a small committment on the order of 15 minutes or so. Usually I end up being pleasantly surprised by how much time I actually have. 

 

I hope this is helpful to someone out there. This is the short version of most of what I know about how to learn stuff.

Happiness

In advance, sorry about the mopey ramble.

I haven't been happy lately. The radio pumps out drivel to and from work -- my CD player's busted (rogue bowling ball.) I'm behind on side projects. I've been slacking at the keyboard -- I'm a pianist. My stack of books "to read" has reached Atlassian proportions. Worst of all, I've started to see myself the way others must see me: self-indulgent, un-disciplined, self-absorbed, selfish, pompous, pedantic and a little confused. Judgmental bastards.

To an outsider, my life must read like a chronicle of squandered opportunities. My life begins full of promise, sunshine, rainbows, and a dash of unicorns. Summer-camps for too smart children, standardized test scores in the 99th percentile of the 99th percentile, high IQ, upper middle-class parents. In short, the whole she-bang. In case that wasn't enough, growing up, I had the universe practically handed to me. Opportunites jumped out at me like rabbits out of hats.

Where am I now? I'm a college dropout. I didn't drop out because it was too hard, or even because I was too lazy. I dropped out to chase love. Or tail. I'm still deciding.

Suddenly, life is hard. Clients are fussy, my checkbook won't balance, bills are late, credit card debt accumulates, savings diminish, the paint on my car is peeling. The sole bright spot in my recently gray emotional outlook has been that I'm a quick study. Ironically, practical life skills continue to elude me. I should change my name to Sophos Moros, learned idiot at your service.

Still, my emotional problems seem farcical. I worry most about staving off ennui (a perverse, and priviliged boredom.)

Maybe though, none of that matters. I've realized, and not for the first time, I still have a lot to be grateful for. I'm not an emaciated Ethiopian child and I don't live in a country recently ravaged by everything short of Godzilla. I wish it was easier to remember what I have, and harder to think about what I don't. Maybe happiness is as simple as being grateful. I'd like to think so.

A follow up to 'How to Seem Good at Everything: Don't do stupid shit'

A few days ago, I wrote a post entitled "How to Seem Good at Everything: Don't do Stupid Shit." It generated a fair amount of traffic, and quite a bit of discussion, both here on my blog and on Hacker News, which is a wonderfully insightful community. My earlier post was admittedly vague. I dashed it off quickly, without really digging much deeper into what I really meant. I'm taking the time now to rectify that error and to dig deeper into "How to avoid doing stupid shit."

Fundamentally, avoiding idiocy is about acting on solid principles. Principles are key to success in any complicated skill.

Before going any further, I'd like to clear up the difference between rules and principles. Rules are specific use cases of principles. Principles on the other hand are more general. They allow us to act effectively without being compulsive rule followers. Without principles, any skill you or I have attained is merely the sum of a bag of tricks we've accumulated over time. This kind of skill is shallow and ultimately ineffective. I hope that this dispels the notion that "Not doing stupid shit" is creatively stifling. On the contrary, strong principles allow us to break the rules with great effect.

So then, how do we go about acquiring strong principles? In any field, to the practiced eye, it seems af if the truly greats are beholden to higher laws. How do I get from here to there? The easiest way is a good teacher. It's impossible to underestimate how powerful an influence a really strong instructor can be. In my past, I've trained with a few great teachers, and the work I did with them easily eclipses the work I did with all of the others combined. It never ceases to surprise me how deep a well of knowledge and wisdom some people can be.

Practically, great teachers aren't available to all of us for all things. So how do we go about acquiring strong principles without instruction?

We're fortunate enough to live in an age where communicating information is second-nature. Books are easy to come by, and we can literally take lessons with the "greats" in front of our computers. Still, how are we to determine what information is worth consuming and what isn't?

Here's the method I use:

Immerse Myself in the Community
Identifiy people with prodigious skill
Study these people
Emulate these people

By way of a practical example, this method is what lead me to where I am now in software development. Before I really seriously started programming, I invested a significant amount of time into studying the community. Eventually, certain names started coming up, and when I started studying those names, other common threads started to appear. Lisp of course, was one such thread. By the way, it's impossible to read about Lisp without hearing about SICP. That path eventually lead me to teaching myself how to program out of the great Wizard Book.

SICP was, without a doubt, exactly what I was looking for. It didn't teach rules, it taught principles. I walked away from the book with a solid understanding of the rudiments of Computer Science and the means to apply those rudiments. The latter half of that sentence cannot be underestimated. Principles are how we generate real skill, how we generalize facts into useful information, and how we leave the realm of blind technical manipulation and enter the transcendant world of artistry.

Learning principles of course, is extremely hard work. This is because, unlike facts, acquiring new principles require us to change the way we think. Nothing changes slower. I've learned over the years, that the joy of enlightenment is almost always preceded by a good mind-bending. This always seems to be a positive indicator that you're on the road to acquiring new and hopefully stronger principles.

Over the long run, learning principles instead of rules will save you a lot of pain. Rules are too specific. It's simply impossible to know how to deal with every kind of situation in advance. Principles however, allow to tackle large classes of problems. For example, let's postulate the following situation. Suppose I'm mildly in debt, say $5000 or so. At the same time, I have goals I'd like to reach in the next year or so, being out of debt being one of them. Of the two following ways to accomodate these constraints, which do I pick? I can either temporarily put my work on other goals on hold, pick up some extra work and rapidly pay down my debt, or maintain my current workload and gradually work towards all of my goals including being out of debt.

At one point, I would've chosen the latter option in a heart beat. I've since learned that's the wrong choice. How would I have known this then? If I'd been aware of the following principle, the choice would have been easy.

"Get rid of things that cause negative energy"

Why do you need to eliminate negative energy? At the end of the day, there's a difference from being tired because you've worked hard towards your goals and being drained because you have things hanging over your head. Things like debt, whether financial, technical or emotional don't just generate material problems. They actively hold us back from accomplishing the really important things in life. This principle is obviously very widely applicable. Give it a try sometime.

In conclusion? Rules are for suckers. Live and die by principles.

How to seem good at everything: Stop doing stupid shit

Back in college, one of my best friends was a prodigious chess player. He'd won a few regional championships and was pretty highly rated. Before I met him, I'd considered myself a competent player. Back in school I'd placed in a few high school tournaments, and in general played a better game than most of my friends. I'm a competitive guy, so I'd challenge him constantly only to get trounced. It was a lot like repeatedly banging my head into a wall.

At some point, I caved and made the mistake of asking him what the quickest way for me to improve my chess skills was. What followed was some of the most insulting and profound advice I've ever received in my life. He pulled me aside and bluntly said "Josh, stop doing stupid shit."

After that, I gave up chess for some time, as I was busy working on a piano performance degree while maintaining a healthy competition and performance schedule. Later, after renewing my interest in the game, I took his advice to heart. The impact it had was profound.

What constitutes "not doing stupid shit" at the chessboard? At the most basic level, it means not hanging pieces or falling for basic tactics. I spent about a month addressing these issues. I bought a couple of chess books and spent a couple hours a day drilling tactics that involved spotting pieces that could be captured "en prise" (about to be hanged) and basic tactics such as forks, pins and skewers. I should mention that at the end of the month I read up on a couple of openings.

After a month had passed, I decided to start playing again. I was shocked by the drastic improvement in my playing. I was regularly wiping the floor with people rated between 1400-1550. In case you're wondering, that's about the rating of an average adult tournament player, most of whom have been playing for years.

The experience of improving so quickly and so much by "eliminating stupid shit" was profound. After some reflection, I found that it applied to so many other areas of my life.

Playing the piano has always been a big part of my life. Growing up, I was always better than the average piano student. In high school and college, I won several competitions and even gave a few concerts in fairly large venues. Looking back though, the biggest moment in my musical career was the moment I "stopped doing stupid shit." At that point, I had been playing for about 8 years and had just switched to a new piano teacher. She spent about a month beating numerous idiotic habits out of me. After that, followed the most productive two years of my musical career. My skills grew explosively during this time.

Even without the explosive growth in skill that eliminating stupidity usually comes with, it's surprising how far just not making dumb mistakes will get people. Looking back on some piano competitions, it seems like the vast majority of the time, winners were chosen simply because they didn't do anything that was stupid enough to be easily criticised.

This seems to apply to software too. Not doing anything dumb will place you firmly above the average in terms of developer quality.

Since I've received that bit of advice, it's been my firm goal to approach new skills with the mindset of "learning how to not do anything stupid." It's amazing how much this has revolutionised the way I learn.

Learning how to reflexively avoid stupidity is a key ingredient to attaining great heights with any skill. It's amazing how many hours you can piss away trying add new and interesting techniques to your repertoire before you've really mopped up the basics.

As a parting shot, I'd like to make a reference to the Pareto Principle. It's been my experience that "Not doing stupid shit" will get you past the bottom 80% really fast.

Stop Telling Students Recursion is Hard

“To iterate is human, to recurse divine.” -Peter Deutsch

Recursion is a natural idea. When humans perform repetitive tasks, we don't assign state variables, and we generally don't keep counters. We just keep doing the same thing over and over until we arrive at some kind of terminating condition. This “pattern” forms the basis of recursive programming.

In “The Little Schemer” Friedman and Felleisen lay out the following basic pattern for writing recursive functions.

  • Establish a terminating condition.
  • Accumulate the results of the recursion.
  • Change some argument in the recursive call to move closer to the terminating condition.

This is a very natural, very basic way of going about writing recursive functions. Take for example a function that performs exponentiation. Here are the questions we might ask ourselves if we were to perform the computation.

Is the exponent 1? Then obviously the answer is the number itself.

Otherwise, the answer is the number times the number to the original power minus one.

In code, we have

 (define (expt n p)
 (if (equals? p 1)
 n
 (* n (expt n (- p 1))) 

Obviously this is a basic example, but the concept isn't difficult to grasp. Why then do students have such a hard time?

In my experience, effective recursive thinking requires two important mental processes come naturally. The first is understanding the process that recursive procedures generate. Continuing the example above, we need to be able to quickly understand that that procedure will generate a process that looks like:

(* n (expt n (p-1))

(* n (* n (expt n (p-1))) etc...

while an iterative process generates:

((*n n) (p-1))

at every step in its computation. This can be hard for students to understand as comparatively, an iterative process is much easier to understand at every “step” in a given computation. Recursive procedures in some sense need to be understood as a gestalt, thinking about them as a series of computations can be somewhat frustrating. This brings us to the next important shift in mental processes.

Thinking recursively requires a shift from thinking imperatively to thinking declaratively (albeit not a very big one.) We become concerned with the structure of the problem. Recursion forces this on us by forcing us to define the problem in terms of itself. This can be somewhat “shocking” at first, but becomes routine with practice.

Now that we've looked at why recursion might be difficult, we're going to look at why none of these reasons is a reason to call recursion “hard.” IMHO, recursion is much more natural than iteration and ought to be taught first. While practicing programmers may not use recursion very often, understanding recursion is critical to understanding the nature of computation.

The main barrier to understanding recursion is understanding that most recursive functions follow a basic pattern (mentioned above.) I think that the lack of understanding in the student body concerning recursion is a pedagogical issue rather than a conceptual one.