Creating Responsive CSS Sites with Video

I was recently working on a project creating a WordPress site using the Virtue theme. Since this is a responsive theme, all elements were working great on mobile web as well as various desktop sizes. Then, I wanted to embed a Vimeo video right onto the home page. When you copy Vimeo embed  code (or Youtube for that matter), you get something like this with the height/width explicitly defined:

<iframe src="//player.vimeo.com/video/106486492" width="1140" height="641" frameborder="0">
</iframe>

This looks great on my 1440×900 monitor:

image_ok

But wasn’t at all responsive to smaller screens. It looked like this on an Android phone:

Android

The search bar wrapped nicely and the menu condensed down to a mobile friendly bar but the video stayed as is and broke the whole experience.

I found an awesomely complete post describing this issue and ways to fix it. There were several solutions posted – the one I used worked quite well. The idea is that you declare a css class that auto-sizes to the parent element and also sets a ratio (16:9) for width/height that will be maintained regardless of the size of the parent element.

The CSS classes look like this:

.videoWrapper {
	position: relative;
	padding-bottom: 56.25%; /* 16:9 */
	padding-top: 25px;
	height: 0;
}
.videoWrapper iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

And the declaration is something like this:

<div class="videoWrapper">
<iframe src="//player.vimeo.com/video/106486492" frameborder="0">
</iframe>
</div>

The results are something like this:

after

 

Great to see that it worked out well. I do wonder though if there’s a way to allow these videos to be responsive without any additional effort – especially for all the non-technical folks out there embedding videos into blogs and such.

Don’t Read Anything; Solve Problems

I have been taking (and thoroughly enjoying) the free Artificial Intelligence class being taught by two luminaries in the field – Peter Norvig and Sebastian Thrun. They do weekly virtual office hours to answer questions from students. Students have been asking some great questions and it’s been nice to see the great chemistry these guys have in answering them.

Citing the staggering bibliography in his seminal A.I. textbook, a question was posed to Peter about any methods he might suggest to students attempting to learn a lot of complex material. Peter starts to answer it and Sebastian supplements it further. The advice is just pure gold. While aimed at students interested in A.I., needless to say, it is widely applicable to all. Focus on actively solving problems that are challenging yet attainable in your field of interest. The rest will follow. Of course, more passive activities such as reading is easier but not as rewarding in attaining goals. Take a look at the video above starting at about 6:25 – particularly Sebastian’s response – which I’ve tried to transcribe here:

“I can let you in on a little secret in my professional academic life. When students join Stanford and ask me “what should I read?” I tend to tell them “Don’t read anything”. And that sounds a little bit bizarre but I deeply believe the best way to learn is to solve problems. So pick a problem that’s interesting and don’t worry about whether it’s been solved before or not. Just make sure that it’s challenging enough for you, that you can actually do something about it, that it’s not so challenging that you can’t do anything about it, and then start solving it.

And as you solve the first version of it, then start reading papers. And the reason is, first of all, if you just read papers, your thinking will be so engraved in the way people thought before you, it’s really hard for you to find something new and something interesting. And obviously the problem isn’t solved, otherwise you wouldn’t have to read any papers.

Secondly, your ability to understand papers goes up greatly with your ability to solve problems. If you really try to understand a subject really deeply (and maybe you fail and maybe have certain successes) then these other papers will make much more sense.

I’ve obviously driven my own life by trying to solve problems that I have no clue how to solve and I just get into it. It’s always worked well and it’s worked well for my students. The students that come to me with huge, huge lists of literature – maybe they’re successful with some other professors – but with me I tend to discourage them and just tell them to do something interesting.

Now doing something interesting is hard. It’s easy to come up with an idea that’s so fundamental like building the human brain – it’d be great if you’d solve it, but you can’t. My favorite is inventing a gravity shield – it’s impossible to even know what the first step is. So the trick is to find problems that are reasonable…where you think if you sit down you can do it in a short amount of time.

And as you do it, keep your eyes open to the next problem to solve. And if you’re smart, as you solve your first problem in the first couple of weeks, you’ll probably think of ten other interesting problems that have come up along the way that you really didn’t think about before. That to me has always been the best path of learning. Then go back, consult the literature and see what people have written. But don’t read too much in my opinion – you can quote me on that!”

…And I just did.

A Watershed Moment: Stanford’s Elite Classes for the Masses

Intro to databases

Lesson #1: a database looks like a cylinder for some reason

Every now and then, you come across something that just makes sense. With over 200,000 students signed up worldwide, Stanford’s engineering department is teaching three classes over the internet - available for free to all - that mimic the content of course material being taught on campus. They are Introduction to Artificial IntelligenceMachine Learning, and Introduction to Databases. They all run from this week through December and students can either just follow the lectures at arm’s length to quench their curiosity or can fully participate by completing all lectures and quizzes along with a midterm and a final. Folks that do the latter can get a “certificate of completion” from the instructor – protecting the $50K per year investment of actual Stanford students (well, you know, their parents). There’s been a lot of excitement and interesting articles written up about this but I wanted to put my thoughts down as I just came across this a couple weeks ago (and have signed up of course).

This is a very unique scenario – one where a marketing tag-line is more description than hyperbole: “A bold experiment in distributed education.” To my knowledge, this is the first instance where high quality classes are being distributed online by selective higher education institutions with a defined schedule, opportunities for student discussions, and with a tangible and measured goal for students. In other words, the value that people pay a crap load of money for today – for free. Fine, not exactly, but it sure does feel like it’s value is getting awful close.

Caveats: To be clear, there’s tons of great free educational content online for the motivated and curious on the internet. You can learn how to program an iphone app, how to play Justin Bieber on the ukelele, and accounting basics online through iTunesU downloads, youtube videos, and Khan Academy videos. TED has done a lot to keep the world inspired and shoot, even e-how blogs get a shout here for teaching me some last minute Halloween costume ideas. Then, there is great paid online education being pioneered by the standardized test prep folks – Princeton Review, Kaplan, Knewton etc. – and for-profit online colleges (although I have no direct experience with the latter). Lastly, selective institutions of higher education have already done a lot with online education and from what I can tell, Stanford (Stanford Engineering Everywhere) and MIT (MIT OpenCourseWare) have been leading the charge.

Disruptive Innovation

Credit: Somewhere from the Internet but really from Clayton Christensen

All that said, this is a very significant step forward in truly disrupting higher education as we know it. Disruptive innovation starts off crappy as shown in the green graph above and only early adopters will find it useful – I’ve heard that some of the first digital cameras were so expensive and of such crappy resolution that their only significant target market was as toys for the kids of rich people – not a very big target market. Meanwhile, the traditional educators at Stanford (purple graph) presumably keep getting better at educating their students. There’s one red line on this picture but in reality there are several horizontal red lines for different market segments.

The early adopter for the education market may well be professional software folks. They are looking for very specific information, are connected, can search through lots of data on the internet for their results, and aren’t looking at education as a signaling mechanism. The highest red line or “adoption laggards” are probably poor grade school kids who need lots of non-digital guidance and motivation. There have a been a couple of NYTimes articles recently about how software tools aren’t quite producing results in these environments. While the articles may be right about some disingenuity on the part of these software companies in selling their wares as magic potions - it’s just a matter of time before they get it right for grade schoolsBefore that happens though, we can expect mass adoption for job training classes, graduate school, and higher education.

The advances made in these classes are moving wide adoption of online classes decisively closer:

Live course structure: Just like a real class, there’s a structure and rhythm to these classes. Previously, the pacing was missing. Video lectures used to be posted online and folks would just do them “on their own” along with the problem sets. Now, lectures have to be watched within a week as the course goes along this fall and problem sets have to be completed by the next week for credit. Just like a strict professor in college – if you’re late with a problem set, too bad! This is a huge motivator and keeps students involved and focused.

Help!: One way online classes break is that students don’t understand something and then they get stuck. In these classes though, the professors and TAs are making some time to take questions online during live chats. Moreover, there are discussion boards where questions can be asked and answered quickly. With so many active students, chances are that a question is already posted and answered by a student. Another safeguard – questions can be voted up and the staff can ensure that the good ones shared by many get answered. Lastly, there are so many students that local meetups are being organized where folks can study together.

Quizzes and Grading: It’s all about feedback. Students learn, practice, and get acknowledged that they’re moving forward. The acknowledgement portion has been available before in the paid courses I had mentioned but not for free and not with a connection to an elite institution.

Signaling: “Look, mommy – I AM somebody!” That’s one reason people go to college. To signal to their parents, peers, and employers that they learned something and can keep learning. It is another motivator. The instructor provided certificate goes some ways toward allowing students to signal their capacity and industry. It’s not Stanford course credit but the target segment for now (self-motivated students who really want to learn this stuff and have the means to do it) will be fine with a letter from a Stanford instructor as this is not a prime motivator for them. This needs to be worked out (and surely will) in the future for more mass adoption to happen.

There’s lots that still needs to be worked out. It’s important to prevent cheating. Proving that the work was really done by the student logged in is important and can be further improved in the future (live camera during test taking using AI to match face with photo taken during signup and a driver’s license photo?). Peer effects is a huge part of education. Although not the focus of these courses, is a huge part of the value propostion of selective higher education institutions. This can be mitigated through selective cohort programs distributed worldwide with a physical component. Lastly, learning through osmosis that happens by being in a place – benefits a startup may get by being in Silicon Valley or a student gets by living on campus – is likely a part of the traditional value proposition that will be hard to capture through digital education.

DB Class Student Locations around the world

Self reported physical locations of some of the students in the database class as of 10/9/2011

Where do we go from here?

If these experiments are successful, the physical educational conolianism that came as a part of the globalization movement over the past decade will likely come to an abrupt end. For example, NYU built a campus in Abu Dhabi with the sheik’s money – I mean, what does that even mean? I guess it means that NYU is not a location but really a bunch of processes, personnel, and a brand. Well, if that is really true, instead of all the capital investment needed to extend an institution physically, like in the competition underway in NYC by the Bloomberg administration, why not extend through amazing digital courseware? Also, a strong argument could be made that these types of courses provide educational access to more nooks and crannies much more efficiently than merit or need based aid can. Lastly, all these professors at Harvard who hate students and hate teaching can rejoice! They can probably focus much more on their research and students can have better access to superstar professors who actually care about teaching.

Outside of that, there’s an opportunity for companies to recruit folks for process oriented jobs through digital coursework. The ROI for these types of job training courses can be unbelievable and can alleviate some of the structural unemployment in western countries. IBM is conducting an experiment in NYC right now – they’ve created a computer science-focused high school spanning grades 9-14 whose graduates will be first in line for jobs at the company. This is great and addresses IBM’s hiring issues very early in the pipeline. It probably makes sense for them and other companies to attempt digital courses for older folks in the near term.

There is also opportunity for startups to get in and offer technologies over which companies and universities can host and easily setup these classes. I can imagine an open source non-profit model working here as well.

It remains to be seen exactly how well it’ll work, but all signs point to the fact that these everywhere classes represent a watershed moment. The costs of the same quality of instruction are noted to be about 1-2% of what it costs to provide higher education classes today. How much of the value does it need to capture before it really tips into the main stream? To me, it’s a matter of when, not if.

I’m no expert in any of this – I just find it all to be insanely exciting. What do folks think? Are there real holes in this model which will really keep digital education on the margins for long? Similar to journalism, will there be a forced decrease in quality?

Perspective: Global Wealth Inequality

Imagine showing economic disparity

Don’t squint at this graph too much…we’ll get back to it in a second.

When most middle income Americans think of the poorer neighborhoods in big urban centers in the country, the images that come to mind are quite dire: badly maintained housing projects where folks are stacked on top of each other, people without homes, sub-par food choices in the local markets, and dirty streets. Of course, it all depends on your perspective. When I came to such neighborhoods in NYC after spending the first ten or so years of my life in Mumbai, India, my analysis, was quite distinct. The buildings in even the poorest neighborhoods were built to code and there was hardly anyone who had to sleep on the streets. The super markets were an absolute wonderland – not only were there an order of magnitude more types of things to buy and eat but each category had numerous options. The streets were incredibly clean – hardly any giant piles of trash, smelly uncovered stagnant water drainage ways, and not an unpaved road in sight!

The concept of poverty in this land of wonder just didn’t make sense to me. With time though, I added several other points of reference in addition to a pre-reformed India. After visiting homes in the Upper East Side and suburbia, I started getting it. Moreover, my definition of poverty morphed from a qualitative vision of destitude folks on the street to a more sophisticated one that took into account how much people can participate in society.

Still, a part of me finds it difficult to use the same words to describe the conditions of the most destitude of people in developing countries with the same in developed ones. It is probably due to some of the images from the poorest parts of India and other developing nations that have been burnt in to my head – visions I don’t recall seeing in any part of developed ones. Another reason is that many immigrants I have spoken to who are easily in the bottom decile of income in the USA compare their earning potential, quality of life, and optimism for the future to the old-country and share a similar perspective to the 10 year-old me. Of course, in recent years, all three of these are being eroded. Still.

Which brings me to the graph at the top of this graph which is from a book called The Haves and the Have-Nots by the World Bank economist Branko Milanovic.  I got it from Catherine Rampell’s blog on the NYTimes where she does a great job breaking it down.  Along the x-axis, the country’s population is broken into 20 per-capita income groups called “ventiles” (quintile…decile…ventile) that are adjusted for purchasing power parity.  So, it’s an attempt to fairly compare income groupings across different countries.  The y-axis shows percentile of world-income – so if a point is at the very top, it means that country’s ventile in question is among the richest people in the world.  So, the graph shows that the richest people in the USA and Brazil are amongs the richest people in the world.

Here’s some further analysis from Catherine Rampell:

“Now take a look at America. Notice how the entire line for the United States resides in the top portion of the graph? That’s because the entire country is relatively rich. In fact, America’s bottom ventile is still richer than most of the world: That is, the typical person in the bottom 5 percent of the American income distribution is still richer than 68 percent of the world’s inhabitants.

Now check out the line for India. India’s poorest ventile corresponds with the 4th poorest percentile worldwide. And its richest? The 68th percentile. Yes, that’s right: America’s poorest are, as a group, about as rich as India’s richest.

Kind of blows your mind, right?

Now you might be wondering: How can there be so many people in the world who make less than America’s poorest, many of whom make nothing each year? Remember that were looking at the entire bottom chunk of Americans, some of whom make as much as $6,700; that may be extremely poor by American standards, but that amounts to a relatively good standard of living in India, where about a quarter of the population lives on $1 a day.”

That bears repetition – the richest Indian ventile is as rich as the poorest American ventile. This would suggest in quite stark terms that poverty means drastically different things in different countries. By the way, this is a 2011 book, so the Indian numbers are the numbers with all the growth seen in the past decade and a half.

A quick couple of addendums:

1) One could conclude that if one had to play the genetic lottery, one would be indifferent between being born a poor American and a rich Indian. Qualitatively speaking though, I would have to say, that it’s a no brainer and I would rather be born rich in India. Best left for another post.

2) Looking at the graphs, one could be tempted to think that the flatter a country’s graph, the less inequality there is.  This is misleading because the y-axis is percentile based.