Category Archives: General

lifelong learning -or- how i learned how to code

Here’s how I learned to leverage projects and goals to become a programmer:

I dabbled in code when I was in college working on my minor in astronomy. For my stellar astrophysics course, we had to simulate a star for the final project. Throughout the semester, we worked through assignments that required some kind of code to solve. I squeaked through class by pushing Excel and its ability to iterate formulas over rows to its limits. For the final project, I had a set of seven differential equations I needed to iterate over at least 100,000 times. I realized that learning a little bit of code might make solving the project way less frustrating. I’m not sure why, but I went with C++ (probably because I thought it had a cool name). After a week of playing with online C++ tutorials, I could throw together some math into int main() and see results (and yes, I did score an A on the project).

Flash forwards four years and I had forgotten pretty much everything I had learned about code. I was working for a web startup and felt silly that I had zero understanding of the platform on which my product was being built. So I decided to learn.

I didn’t have a goal in mind at first besides “learning,” which is a terrible motivator. I’m lucky that my addiction to learning kept me going, but I felt a distinct lack of direction. It was just an intellectual exercise. As soon as I felt satisfied that some new type of thinking had creeped into my brain (which happened shortly after finishing a few coding exercises) I lost momentum and motivation to learn. My progress slowed and stalled. That is, until I figured out how to redouble my efforts to actually become a programmer.

I had to define a problem for myself. At the time, we were comparing different online education websites. I wanted an automated way to learn about lots of websites very quickly and I wasn’t thrilled at the prospect of clicking through thousands of links to copy and paste millions of pieces of information, so I decided to build a web crawler (and, wow, I wish I had known about Udacity’s Intro to Computer Science course then[1]). All of a sudden, I had this project that was clawing at my brain, pushing me to learn at an ever accelerating rate. I started writing programs with functions. I started implementing objects. I learned how to pull in the Beautiful Soup library. I started poring through inane details of Python documentation. I started learning about HTML and the purpose of tags and classes and hierarchical relationships. I got obsessed by the problem and got some help from the engineers at work. They helped me put together my code and I got the chance to see how real engineers work and think.

And, holy cow, did it feel good when it actually worked.

Long story short: if you want to learn how to program, give yourself a project and a goal. What do you want to be able to do? Something outlandish like “make the next Call of Duty from scratch” isn’t going to work. But “I want to make a box appear on the screen and make it move” could be perfect. Or maybe you could just automate one part of your day. Try a fun, small project and it will only lead to more interesting problems.

Give yourself a problem and get started!

[1] I currently work for Udacity

Tagged , ,

Portal in Santa Clara, California

Over the past two years of Physics with Portals, I’ve gotten emails from dozens innovative teachers around the world who want to teach with Portal 2. And it’s awesome. I love helping out however I can.

Last week, I got an email from Tom Perazzo, a digital media teacher in Santa Clara, California. I got excited. Of course, I was excited that another teacher wanted to give my lesson plans a shot in class. But I was even more excited that Santa Clara is only 10 minutes from my house (and on my way to work)! So I had to ask to drop by to see what his students were doing.

This morning, I signed in as a visitor at Santa Clara HS and stopped by Tom’s classroom. Check it out!


Tom’s class 1

photo (1)

Tom’s class 2


Tom teaches digital media classes, and, as you can tell from his set up, his classroom supports his students well.

His 9th – 12th graders were working on two assignments. Some students were finishing up their Rube Goldberg machines, which they had to design, build and describe on their blogs. Other students had moved on to a physics experiment, roughly pulled from my lesson on forces using aerial faith plates. You can see Tom’s example experiment on the big screens.

In their experiments, students analyzed how high faith plates would launch cubes based on their masses and the forces of the faith plates. Tom instructed students to launch cubes of whatever masses they’d like by faith plates of whatever forces they want.

Students then recorded the maximum height of the cubes by employing the same alternating black and white panels strategy I use. Once they finished (probably in the next class?) students were to graph their results and, hopefully, start making predictions about how high cubes might fly.

Way to go, Mr. Perazzo’s class! Y’all are awesome!

Any other intrepid teachers out there? I’d love to hear what you’re up to!

Tagged , , , , , ,

Portal in Elementary School

You may have noticed a shout-out in my most recent video to Nathan Manderfield, an elementary school teacher in California, who teaches with some of the coolest projects I’ve ever seen. Nathan’s been trying out some crazy, innovative technology in his classroom to get his students excited about being makers. And they’re even making the world a better place 🙂

I asked him to give us a small write up about what his students are up to. Here’s what he had to say!


My name is Nathan Manderfeld and I teach 4th and 5th grade at Monroe Elementary School in Bermuda Dunes, CA. Five years ago I started a program at our school called, “Learning on the Edge.” It is a two year program that concentrates on using technology in the classroom and project based learning. My students have done some amazing projects including becoming commissioned artists, creating and running their own small business, publishing a book, launching a movement called Twenty 4 Change, and now becoming game designers. Through all of this I continue to be amazed by what students can create when we as teachers set the stage, support them, then get out of the way! In this guest post I want to concentrate on just one of these projects: game design.

Technology can be amazing. I became aware of the game Portal and Cameron by searching Youtube looking for information on game design. I came across a Google Hang-Out that was nearly a year old. It was a hang-out sponsored by Gamers Advancing Meaningful Education. In the hang-out Cameron was featured explaining how he used Portal 2 in the classroom. I quickly was inspired and bought myself the Xbox version on Amazon. To my delight it was an older game so I got it for a steal. Playing Portal 2 was awesome and I immediately began thinking of how I could incorporate it into the game design unit I was developing. I decided to set up my Xbox in class and let students have 30 minutes each of uninterrupted time to explore the game. We had already been discussing the basic principles of game design from mechanics to the “magic circle”. We had conducted a Google Hang-Out with a game designer from San Francisco and were now playing various games and analyzing them using the vocabulary of game design. My students were very excited about playing Portal 2. We had a whole Portal 2 area set up in our room.

After playing and analyzing games it was now time for my students to make their own. I decided to use the site Gamestar Mechanic. It is an awesome site that allows students to work through a quest as they learn the different components of basic game design. At the end of the quest they make their first game. They then are allowed to do challenges to gain more “sprites” to use in building more and more advanced games. We currently have published our first games in what we call the Monroe Arcade.  My goal in the long term is to teach them about iteration, the slow process of refining a product. We have already shared our games in the Monroe Arcade with our second grade buddies and some other schools in the district our playing my students’ games.

I am also trying to expand the Portal 2 portion of the unit by having students build their own levels. After seeing Cameron on the Google Hang-Out I reached out to him and he made me some custom Portal 2 levels that teach Newton’s Laws. I plan to incorporate those lessons when we get into our Engineering unit. Project based learning is something I am passionate about. I thank Cameron for sharing his expertise with me and letting me do a guest post. If anyone is interested in knowing more or collaborating on a project feel free to contact me anytime at njmander *at* gmail *dot* com.

Building the Monroe Arcade

Exploring Aperture Laboratories

Building the Monroe Arcade

Building the Monroe Arcade

Tagged , ,

girls and portal 2

I love hearing from innovative teachers who are exploring new ways of taking advantage of video games in their classrooms. I’ve recently been speaking with Megan Pusey, a science teacher with a penchant for gaming at an all girls secondary school in Australia.

Megan’s students finished a physics unit with Portal 2 last month. Girls and video games aren’t traditionally associated together, so who better to help us understand the classroom dynamic between girls and games than Megan. Check out what she has to say about girls, games and her classroom in our interview below. Even if you aren’t a teacher at an all girls school, Megan has some great insights for anyone preparing to teach with games.


MP: I’m a science teacher at an all-girls school in Australia and last year I tried using Portal 2 in one of my physics classes to see what would happen. I am also a gamer at heart and was inspired to combine my two loves of gaming and teaching by blogs such as Physics with Portals (and the fact that Steam for Schools was offering copies of Portal 2 for free). During 2013 I taught three classes of 25 students and ran about 6-7 sessions using Portal 2 embedded into the regular physics program. This is the last compulsory science course for these students (15-16 years old).

CP: Do they love it? Hate it? Feel hesitant but come around? Avoid it at all costs? Are there any interesting stories that came out of your Portal unit?

The girls had mixed reactions to playing video games in class. Some students were very excited about it and only one or two students had played Portal before.  A majority of students did not see themselves as ‘gamers’ and were resistant to the idea and reluctant to try. They saw video games as ‘not their thing’, they were scared they ‘wouldn’t be good at it’ and it was ‘something their brother plays’, not them.

I remember having a conversation with one student who said in disbelief “You’re forcing us to play video games in class?” to which I replied “Yes! Give the first level a go and if you don’t like it you can stop playing.” The student didn’t stop playing.  Many of the reluctant students really came around to the idea after they gave Portal 2 a go and realised it was not what they thought video games were like. It challenged the girls and required them to use their brain. Some students even bought a copy of Portal for their own personal use after enjoying it in class. A few students didn’t enjoy Portal 2, they were very resistant to trying it. Most of the students in this category have chosen not to continue studying Science this year.

Were you surprised by any of their reactions?

I was surprised by how much conversation Portal 2 created amongst the students. Many would work together in teams to solve the puzzle rooms. If anyone was stumped by a puzzle they would ask other students who had already completed the puzzle for help. Many students were frustrated when they kept failing but there was a sense of accomplishment when they finally conquered the puzzle.

Did the girls learn more with Portal than they would have otherwise?

I’m not sure if the students learnt more using Portal 2 than they would have otherwise. Learning is extremely difficult to measure. My goal for using Portal 2 was to show students that Physics can be applied in unexpected places (such as video games) and to keep the topic interesting and engaging. I used the Portal 2 lessons as more of a lab/practical lesson where students would take measurements within the game and apply their knowledge of concepts they had learnt in class. Portal 2 also allows students to simulate actions they can’t do that in real life (e.g. jumping from a height to measure acceleration due to gravity).

How did your co-workers react?

Many of my co-workers were intrigued by what I was doing. They had not used commercial video games in the classroom before. Some of my colleagues are still unsure of video games and have no inclination to use them in class. Most of my other colleagues have an open attitude would be willing to explore the use of video games in class. However, they all said they would need some training first to learn more about video games in order to use them effectively in class.

Did your thinking towards video games in the classroom change based on your experience?

Last year was my first time using video games for the purpose of teaching and my thinking towards it has definitely changed. I was experimenting a lot to see what worked and what didn’t and one big discovery was that to get the learning goals across I had to supplement the game with other activities. These activities stimulated the students’ thinking about the physics concepts, otherwise they just saw it as ‘playing games’.

Any advice to teachers who are considering using games in class?

Be familiar with the game your self

Spend some time playing the game you want to use. That way you can help students if they ask questions or get stuck. You will also quickly discover if the game is suitable for your purposes.

Give students time to become familiar with the game

I had students who had never played a first person shooter before, so using the keyboard and mouse at the same time to move around was very alien to them. They needed time to get used to the game and how it works before learning could take place.

Direct the learning

You can’t expect students to achieve your intended learning goals by just playing a video game without any teacher support. Students aren’t going to notice things like the conservation of energy unless you help them see it.


Tagged , , ,

Projectile Motion in Portal 2 – part 3

And finally, let’s take a look at air resistance. Do falling objects in Portal 2 slow down due to air resistance?

Short answer: Yes! The Source engine accurately handles air resistance and terminal velocity!

Long answer:

Air Resistance and Terminal Velocity Background

Terminal velocity follows naturally from comparing forces acting on an object. As Newton’s first law explains, objects change the way they move only when acted upon by an outside force. For instance, a hockey puck is perfectly content sitting still on the ice so long as no forces are acting on it (as if we could speculate about the mindset of an inanimate object!). As soon as a force acts on it, perhaps in the form of a slap shot, it starts to move. The puck will maintain the same velocity until another force, let’s say the goalie’s glove, changes its velocity. To be even more precise, unbalanced forces cause changes in velocity. That is, multiple forces can act on an object without causing an acceleration so long as the forces balance each other out. In tug-of-war, for example, two teams may be enacting tremendous forces on a rope, but so long as both teams create the same force in opposite directions the rope doesn’t budge. As soon as one team pulls harder than the other, the forces become unbalanced and the rope’s velocity starts to change.

In the hockey example above, we assume the ice and air around the puck produce negligible friction on the puck, a tactic often employed by physics problems. In reality, the situation is more complicated. Any object moving through a fluid, such as air, or in contact with a surface, such as ice, feels friction. Friction is a unique force in that it always opposes motion. Without motion, friction does not exist. Unlike other forces, friction can never cause motion. As an object’s velocity increases, so does the force of friction.

In an situation analogous to tug-of-war, a falling object feels opposing forces. Gravity accelerates the object downward while air resistance accelerates the object upward in the form of friction. As the falling object gets faster, friction from air resistance increases. Eventually, the frictional force matches the gravitational force and the object no longer accelerates. At this point, the falling object has reached its maximum velocity, which we call terminal velocity.

The velocity of an object in freefall will generally follow the relationship below:
[equation 1, credit to Wikipedia]

where m is the mass of the object, g is acceleration from gravity, ρ is the density of the fluid (typically air), A is the cross-sectional area of the falling object (or the surface area of the side of the object facing the direction of motion), and CD is a dimensionless constant called the drag coefficient. Notice in this equation that mass is a factor, and a more massive falling object should fall faster than a lighter counterpart.

Terminal Velocity in Portal 2

Once again, we want to collect data from Tracker and fit a curve to it with Gnuplot. This time we’ll be looking at velocity as a function of time and trying to fit it to equation 1. We’ll use Gnuplot to fit the data to a function of the form of

[equation 2]      v(t) = -B*tanh(C*t),

where B and C represent the constants before the hyperbolic tangent (tanh) and inside the hyperbolic tangent of equation 1 respectively.

terminal velocity

Holy cow. The velocity of a freefalling 55kg contraption cube almost perfectly follows what you would expect from equation 1 (note: this graph lacks uncertainty).  We can confidently say that the Source engine mimics air resistance!

We’re left with an interesting situation, though. On the one hand, we have data that clearly show that whatever algorithms are controlling motion in Source accurately represent air resistance. But now we have to wonder about the constants within equation 1. We know Source scales terminal velocity to mass. But is Source using a realistic value for air density in the game? Is it really taking the cross-sectional area and drag coefficient of the cube into account?

For now, we can check if Source is at least internally consistent, regardless of whether or not it uses accurate values for the constants in equation 1. Let’s assume that Source uses some constant to account for drag coefficient and air density. We already know mass and gravity. So let’s solve for the cross-sectional area. Gnuplot solved equation 2 with B = 318.6 and C = 0.4768. If we equate B to the constant before the hyperbolic tangent in equation 1 and solve for the cross-sectional area, we get a value of 0.121 u2. Plugging in our value for cross-sectional area to the constant inside the hyperbolic tangent, C, and using all of the same values for ρ, CD, m, and g, we get C = 0.477, which is exactly what Gnuplot produced. So, at least Source is in some way internally consistent.

To be continued with a wrap up of projectile motion…

Tagged , , , ,
%d bloggers like this: