DAVID MALAN: --start to implement this notion of something
either being one or a zero.
Indeed, we could just do it over here.
You know this next demo is actually the result of a progression of demos.
It was a few years ago where I had always kind of talked in the abstract
about turning light bulbs on as representing one and zero, the presence
or lack of electricity, and then just on a whim I think,
before one year's first lecture, drove down the road to a Target, big store
like Walmart, and grabbed a few inexpensive desk
lamps, the kinds of things that you would like clip
onto your shelf in college and--
DOUG LLOYD: Those are flexible, yeah.
DAVID MALAN: --and you've got a few light bulbs.
Yeah, these little goose-neck things, and then I just
attach them to the lectern on stage.
And then it was actually a great demonstration
I thought, in retrospect, being able to then literally turn the switches on
and off, all our transistors on stage, and have something very visible,
let alone in a big space like this.
DOUG LLOYD: Right, but the CS50 is constantly reinventing itself every
DAVID MALAN: I know, creating work for myself.
So these are-- yes, are binary bulbs.
So you might recall, Ansel Duff, a former advisee of mine,
and an undergraduate here majoring in engineering sciences,
actually built these for us.
And the vision was, he machine this long tube that held eight light bulb
sockets, and then we were really on a kick with Hue light bulbs
that semester, which are these Internet of Things devices where
you can actually control via an API or application programming interface.
And you'll see, we also went on Amazon and got these little grade school
refrigerator magnets for the one's place, two's place, all the way up
to the 128th's place.
And so you'll see eventually that I can take out
an iPad where Ansel wrote some software that talks via Wi-Fi to the light bulbs
so that our student volunteers can turn the lights on and off in a pattern.
DOUG LLOYD: And the other cool thing about having this magnetic tube
or magnetic paint on there is that a little bit
later on when you see a second demo of this, where we can sort of magically
wipe the place values away--
DAVID MALAN: Dramatically wipe the place values away.
DOUG LLOYD: And suddenly we have the hacker edition
version of the binary bulbs problem.
DAVID MALAN: Indeed, which gets some good like, oh, from the audience there.
Though admittedly, I think we actually over
engineered the solution so to speak, whereby this past year
we actually reverted to not using Hue's, but just using old school light
bulbs and little toggle switches, which were just so much easier to set up.
These things are great when they work, but honestly setting up the Wi-Fi,
making sure we had our own private network that all eight light bulbs were
on, and the iPad was working, it was just so many variables
and it would be just awful if that doesn't work in the first few minutes
a class when you're trying to send a message that, hey look how simple this
is, but you can't even get it to work.
DOUG LLOYD: What was great about a demo like this,
is you don't even need a rig as awesome as the one that Ansel helped put
together because a lot of schools that might be--
there's the dramatic wipe away--
A lot of schools might want to do something like this,
but it's really easy to do with just cell phones now,
just turning on your flashlight or your an app--
DAVID MALAN: Indeed.
DOUG LLOYD: --or an app like that.
DAVID MALAN: And that's what I've started doing when traveling and giving
little demonstrations like this.
It's just much easier than packing like three big light bulbs in your suitcase,
you just ask for volunteers.
DOUG LLOYD: I can imagine getting three of those lamps through the TSA
would be very easy.
DAVID MALAN: No.
These days, no.
So any form of lights work, or barring that, a piece of chalk
and a one and a 0.