YouTube for Schools Opens Resources Up to the Classroom

You're sitting at home, planning a lesson when suddenly you come across the most incredible video to supplement what you are trying to convey. Unfortunately, YouTube is blocked in your school and this is not option. I have encountered this situation numerous times or when I am in the classroom working with students and a question comes up that would be perfectly illustrated with a video.

It's a shame that so much great content is blocked. The justification makes sense, students might get distracted and some of the content online might be inappropriate. Thankfully YouTube has developed a way that we can have the best of both worlds. With YouTube for Schools, it is now possible for schools to unblock and access the large amount of content on YouTubeEdu safely as potentially offensive related videos and comments are disabled.


I am so honored to have worked with the YouTube team on this project. I knew it would make a huge difference in student's opportunities to learn from all of the excellent quality out there.

One great feature of YouTube for Schools are the hundreds of teacher curated videos aleady aligned with the Common Core Standards for English Language Arts and Mathematics. For Science the National Science Education Standards were used and for History/Social Studies the videos were aligned to the California State Standards. Now you can easily find videos to supplement whatever you are working on.

With all of the great content available on YouTube, you would think all of the best videos have already been uploaded right? Think again. Every one of you has a great video, lesson, experiment, project, story to share and now you can.

Here is my favorite part: schools can add their own videos to their personal unblocked playlists. If you would like to suggest your own playlist to add to YouTube for Schools, submit it to YouTube.com/Teachers where you can see all the playlists without a login.

With this new tool to support student learning, some examples of how you could use videos in the classroom are:
1) Show a visual representation of a concept after a lesson.
2) Record an important lecture or activity so students can review it later (especially if they were absent).
3) Create a video for when you are absent to help the students and substitute know what to do.
4) Flip your classroom.

The last one, is really exciting. Upload a video and ask students to watch it at home. Then when they come to class, your time is free to go deeper into the subject, do an experiment or project, and all of the other things you wished you could do if you had more time.

Don't stop there, use the tools on the web to support your students and have them support each other.
  • With Google+ Hangouts, your students could form a study group and watch the video together to discuss.
  • Have students add comments to a Google Spreadsheet that can be reviewed the next day (example), its really easy to make a column filled with times.
    • Type 0:00:00 into Cell A2 and 0:00:01 in Cell A3 (or 0:00:05 to skip by 5 seconds, etc).
    • Highlight both cells then grab-and-drag the blue box in the corner.
However you do it, now students have a way to give specific feedback at their leisure (not constrained to class schedule or intimidated by peer pressure). You can refine the video if it was confusing to a lot of students and explain it better the next day in class. This kind of feedback might be difficult to obtain in class but now you have a way to assess student's learning and understanding as often as you would like.

YouTube for Schools opens your classroom up to the resources of the world. Teachers are empowered to supplement their lessons as well as share the amazing things they do with everyone.

Original Link from YouTube Blog - Opening Up a World of Educational Content with YouTube for Schools.

Subscribe to the BrokenAirplane blog to keep up to date with all things awesome in education!

Keeping Plates Spinning is The Best Part of The Job

A couple of years ago, someone asked me if Robotics could be done in a hybrid learning environment. Could we do a hands-on project with a combination of virtual meetings as well as physical meetings. At the time, I didn't have a great answer because I had no reason to explore the possibility. I was running my robotics team and focusing on doing everything possible to help the team do well.

That changed this year when I decided to take a year to go work for Google. My student robotics president looked at me with horror as I told her the news that I would not be there next year. Then after a minute of thought she said, "Oh wait, never mind we'll be fine." It was a fulfillment of something I tell my leadership team all of the time, "I will have done my job when you no longer need me."

This was the ultimate test, could they succeed without their teacher being there with them everyday? Let me start by defining success for my team. I know many mentors who's goal in life is for their robotics team to win, win, win! I want the best robot our team can possibly make but that is not my only focus as their mentor. My goal is to help them fulfill their goals and make their dreams possible.

That looks different for each student and it is my job to help them find it and then work with intense fervor to make it possible for them. Mentoring each student individually is what I call it keeping plates spinning because it is exciting, requires one to see the big picture, and also focus on each individual. Some of my students want to go into a STEM related job, but others want to be businesspeople, graphic designers, teachers, and the list goes on. If you visit my team there are many different projects going on at once. That is because if I find someone who I think I can mentor I find a niche for them on the team because it is not just about building robots, it is about building people.

I am so grateful that Lisa Davis is able to serve as the physical mentor watching out for the well being of the team while also helping them explore and grow in marketing, entrepreneurship, and service learning. If she was not willing to take on the additional responsibilities this year, there would be no team. It would have been impossible for me to virtually mentor the team a few years ago but with daily emails and weekly Google+ Hangouts I can talk to my team and support the individuals.


All year long I am looking at students to see where they have areas to grow. My decisions on who should lead our team are not necessarily based on who is a "leader" on the team but who could become a leader. Each of my presidents have been shocked when I asked them to step up but each time they have exceeded all expectations.

Presidents are chosen in their Sophomore year. I let the current president know who I have chosen and they usually disagree with me. That's ok, I have expected and planned for this. I don't select for talent but potential.

The reason the student is chosen in the Sophomore year is so they can serve as President in their Junior year while being mentored by the previous President who's now in their Senior year. When others teams chose their seniors to be leaders, the skills and lessons are lost each year. With this process, the previous President can spend the whole year reflecting on the experience helping the new President through their struggles.

This has resulted in an ever increasing improvement in our team and what it is able to achieve. I also select Presidents based upon what they are able to learn from the outgoing President and vice versa. Sometimes it is humility, or organization skills, maybe public speaking skills. I have the luxury of focusing on helping people grow.

Could we not do this with mainstream education? Teachers are repeating themselves multiple times a day, and again each year for 40+ years. This is horribly inefficient, let students teach students and have the teacher support the process. The inexperienced students will learn more easily from their peers and the teacher can look for ways to challenge the tutors and grow in their own understanding. Imagine advanced classes happening concurrently with regular classes within the same classroom!

Subscribe to the BrokenAirplane blog to keep up to date with all things awesome in education!

TED Videos with Computational Thinking

Cross posted on the Exploring Computational Thinking Forum:

A colleague of mine wanted to understand more about one of the projects I am working on at Google. He is an Artist and felt that Computational Thinking was something he used everyday but still a little unsure. I decided to send him a bunch of TED videos showing how much we use and rely upon Computational Thinking everyday.

When I began to look through the TED Videos, I was amazed at how many of them relate to computational thinking in some way or another and that is why these videos amaze us. TED videos showcase people doing extraordinary things and seeing the possibilities when we look at the big picture.

See if you can find the 4 aspects of Computational Thinking in each video:

  1. Decomposition - Breaking down the data
  2. Finding the patterns in the data
  3. Generalizing your findings and discovering the big idea
  4. Turning them into a set of instructions that others can reproduce

Whether you are an artist, scientist, Engineer at Google, or student, Computational Thinking is present and makes possible the world we see. I hope these videos are equally useful to you in explaining to others what Computational Thinking is:

How Algorithms Shape Our World - If you thought Algorithms were only used by computer scientists, think again.

The Best Stats You've Ever Seen - Hans Rosling shows how big data and patterns can tell humanity's story. Al Gore did something similar with big data to show humanity's impact upon the planet.

Making a Car for the Blind - You may have heard of Google's Autonomous Car but what about a car that allows the blind to drive?

Synthetic Life - Craig Venter started the human genome project and they used that information to make the ultimate algorithm, a synthetic cell

What We Learned from 5 Million Books - Hilarious as well as inspiring as we see what happens when we start looking for patterns in our books. This is the power behind Google Translate.

Nature in Architecture - Many of our most useful innovations have come from emulating nature.

Teaching Kids Real Math with Computers - In this viral video, Conrad Wolfram says that math > calculation and with Computational Thinking we can teach students far more than we ever thought.

Computing a Theory of Everything - Stephen Wolfram, shows how knowledge is related and can be used to better understand the universe.

The End of Theory - Not a video, but a revealing article about why students need to learn how to work with data and statistical analysis.


Connect with BrokenAirplane to stay up to date with all of the latest in Education and Technology

Stop Saying I Don't Know to Student's Questions

Make everything as simple as possible, but not simpler - Albert Einstein

The above quote is the challenge of every science teacher. My professor once told me that Einstein would walk up to people on the street to tell them about his theories and if he was unable to explain it to them or answer their questions sufficiently, then he felt he did not understand it well enough himself.

I am a big fan of the Mythbusters as well as books like There Are No Electrons which show us when our conceptual models are too limiting to our understanding. So when David Rudel, editor of the excellent ExploreLearning site (home of the awesome science Gizmos) asked me to review his book Science Myths Unmasked, I couldn't wait to check it out. I have to say I was not disappointed, in fact I would have written this review sooner but I was enjoying the book too much to stop.

Science Myths Unmasked takes the most common experiments and models that every middle and high school student encounters.  In Vol 1: Earth and Life Science, Rudel challenges some of the big questions that teachers encounter every day from students.

If you have ever had students question the genetics and evolution curriculum they are right to do so. Textbooks ask students to go from Mendel's pea pods and variation within the species to evolution into new species which leaves them wondering how Dominant and Recessive genes can accomplish this. With clarity and research to back it up, the book explains how evolution can occur as well as the modern viewpoints on the mechanism for evolution.

There are many other topics covered in the book like:
  • How do clouds form?
  • Why do my veins appear to be blue?
  • What is the "greenhouse effect"
These topics are those that keep coming up in classrooms and from our own children, unfortunately the canonical explanations are often half true or completely false (the blood in your veins is not blue). These books read like a mystery novel rather than a textbook and you will find it hard to put it down.

I especially enjoyed Vol 2: Physical Science, having spent time as a 8th grade physical science teacher. Students are wonderfully skeptical and with encouragement will have no problem speaking out about it. When something doesn't match their view of reality they must ask WHY?

Unfortunately, our textbooks in an attempt to make things simpler often omit or erroneously explain natural phenomena. I have reviewed most of the textbooks out there and there is always one or two places where I reread a paragraph over and over because it just doesn't seem right.

I must admit there were a couple of times in Rudel's book where I thought, "Oh that's why, that never made sense before!" I too have misconceptions that I have explained away and it has been a great week to reaffirm and test my own understanding of Physics.

Some of the explanations include:
  • Why does the water in an overturned jar rise when the candle inside burns out?
  • Does electricity only flow in a "closed circuit"?
  • What do we mean when we say a wave of light and why do we draw a sine wave to describe it?
The best part about these books is how accessible they are. They contain no additional math and the descriptions are clear enough to be read by anyone with an inquisitive mind. Rudel takes all of the questions teachers and textbooks sweep under the rug and finally bring them to light.

If you go to the book's website, you can download sample chapters. At the price these books are being offered, they make a great gift for the science teacher in your life.


Connect with BrokenAirplane on Google+, Twitter, and Facebook.

Sage Removes Barriers for Technology in Math Classrooms

If you are not yet using programming with your math and science students, you might have a couple of excuses why.

1) I don't have the time to learn (give me 30 minutes)
2) My school won't let me install the software.

Technology in schools is difficult especially if you are working with older hardware or infrastructure. Many schools will only install new software at the beginning of the year, but if you are going to start programming you'll want to get started now.

Sage makes programming more convenient than ever while adding in some powerful math packages. You might see your graphing calculator's packaging saying it can carry you through college, Sage will take you from elementary math to your PhD and beyond. Created by William Stein with the intention of being a powerful free and open source alternative to technology like Mathematica.

You might wonder how Sage changes anything. Well Sage contains multiple programming languages so you are not constrained to one, but more importantly the Sage Notebook provides the ability to program in the cloud. While there are other options out there, Sage makes it really easy and puts it all together in a dead simple interface.


Let's explore the Sage Notebook (the cloud based version).

There are so many options for logging in, you can create a Sage Notebook account, use your Google/Yahoo/OpenID credentials or you can browse the worksheets without logging in.

Much like Geogebra, you can browse the public worksheets of other people in the community of users.


Click New Worksheet. Once in the worksheet, you can click on the drop down menu that says Sage and see how many options you have for languages. This covers the many programming languages one would need. If you are just starting out, you may want to use Sage, Python, or R (statistics).

If you read this blog, you know I love Python for its simple syntax and ease of use. With Sage you don't have to give that up, the syntax is essentially the same.

To see what really makes Sage a great fit for math try entering a fraction and hitting Shift+Enter. In Sage, fractions are treated like an actual object. You can multiply it, add two fractions, and all of the other manipulations you would do on paper.


A feature very popular in Wolfram|Alpha is the equation solver. Try this out in Sage:


It couldn't be easier to graph:




Once you have a worksheet you can share it with people so they can interact with it or publish it for viewing. In fact most of the examples in this post can be seen here. Just click on the buttons in the upper right of the workbook.
This is just meant to whet your appetite, there are so many different ways this can be used, especially when you consider all of the different functionality and the ability to work online and save/share your work. The documentation is very helpful and there are numerous tutorials created by the community to help you learn. Take a look at Sage's tour for more examples of what is possible.

You will not be disappointed as this is no toy but a powerful full mathematical suite. Student will love this for the same reason they love Geogebra. It takes abstract concepts and manipulation of symbols, variables, and functions and treats them like objects in a game. Now you can play with the math as opposed just focusing on calculating.

Being able to quickly see the effects of an equation or its graph means students can draw conclusions faster rather than being unnecessarily distracted by the arithmetic or plotting of points.  I hope you will take me up on this invitation to use this free tool. The hard work that the Sage community has put into making this available to all should not be in vain.

If you are already using Sage (and I know many of you are) be sure to share in the comments or on Google+ how you are using it.

Stay connected and check out the other tutorials on BrokenAirplane by following the links on the top and the most popular posts on the sidebar.

LearnBoost is Changing the Rules for Student Data

Unfortunately teachers have so many things to do besides working with students. Technology should minimize or eliminate these distractions and administrative tasks so we can focus on what is important.

From my time in the classroom, I have used all of the major student information systems and they go against everything I want in technology. The websites crash constantly, the interface is confusing, getting reports is tricky, entering grades is tedious and the list goes on.

It makes sense why this is the case, these companies market their services to schools at a premium and with little competition there is no motivation to improve the product. What's far worse is if you change companies, your data is locked up in some proprietary format making it difficult to make decisions and refinements on how to best serve students.

This isn't right. Education deserves a better product that is intuitive and fits the environment. This is where LearnBoost comes in. Developed by people who were dissatisfied with the current set of options, they sought to make disruptive change within this area of education.

Does LearnBoost follow my three guidelines for effective technology in education? Absolutely!


LearnBoost has followed the number one rule of technology design, ask your users. Its clear from the start that this was designed and refined with help from educators. Not too many of us arrange our classrooms in alphabetical order but this is the way most systems take attendance. LearnBoost's roster is in graphical format so you can take attendance by glancing at your classroom and seeing who's missing. Now you can focus on your students at the start of class.

Recently, another game changing feature was rolled out, the ability to share lessons with others. Now the feature itself isn't necessarily mind blowing, it's how they are doing it. Rather than requiring you to link back to their site and have viewers register an account, you can share it the way that makes sense to you: on your blog, via social network, or email. Being able to share our best lessons, will benefit our students in the way that open source code and APIs have benefitted our  educational landscape with a boon of free technologies for the classroom.

The gradebook is exactly what you would want to take the frustration out of entering grades. But, you might say, "My school uses a different software, what's the point of doing all of this work in LearnBoost only to have to repeat it elsewhere?" Your grades can be exported as a CSV file to import into your gradebook. You might ask, why can't I sync them? While the team is working on this, most SIS companies do not want you to be able to move your data freely in and out of their system. It's just not good for business. Check and see if your school's system will import the file.

Or better yet, convince your schools to use LearnBoost. The cost is far lower than other systems but with even more support and features. Best of all, if you are using Google Apps for Education, LearnBoost has integrated the two platforms so you can have one place for all of your calendar, files, lessons, grades, etc.

Oh did I mention that this software is free and it works on your Chromebook, Laptop, Mac, PC, Linux, tablets and more coming soon. You can integrate it with Google+, Twitter, Wordpress, Facebook, and Posterious so you can integrate it with the social features that flip your classroom.

I am not the only one who is impressed by this technology, many of my fellow bloggers (David and Audrey, among others) have been covering/using LearnBoost for some time now and there are  testimonials of teachers and districts who swear by it. We can't lose, between saving our districts money and ensuring that our data will always belong to us the users, we ensure that there is one less thing preventing us from keeping our focus on our students and helping them to achieve.

Connect with BrokenAirplane to keep up to date on innovations in education and technology.

Follow my microblogging on Google+

Computer-Based Math Education Summit

Conrad Wolfram's TED Talk brought world wide attention to the growing frustration towards skill based math curriculum. We have technology that can do calculation far faster and more accurately than we can and yet we are still teaching students as if the best tools we had were paper and pencil.

There are big questions out there and to solve them, we need students who are able to understand what tools they have at their disposal. For those who are shocked that much of their curriculum would be removed, Wolfram's talk reminded us that math != calculating (programming syntax for not equal to) but that math > calculating (greater than).

I once gave a professional development where I asked teachers, what would you do if all of your students magically knew how to do everything in a math textbook. Some teachers expressed silence while others fear that they would be irrelevant. Far from it! If we can restart our thinking with the premise that calculating is a tool we use to do math, then if we can teach computers to do the calculations we can focus on those attributes of math that human excel at. Teachers can give students the tools to DO math and science instead of just watching others and hearing how they will use it "one day" or in the "real world".

The Computer-Based Math Education Summit (Nov 10-11) will give this movement resources and further guidance towards the goal of transforming math education for the modern age. Humans previously had no choice but to have math dominated by calculation but this does not have to be the case any more.

During the 2 day summit in London, attendees will hear from a wide variety of speakers on how math is greater than calculation and how we can use the tools we have available right now to provide amazing learning opportunities for our students today!

Notable speakers include:
We are learning so much, so quickly that students are forced to learn much too quickly in college how to use these tools and thought processes just to understand their intended disciplines. We as K-12 educators can help by starting with our students now rather than waiting until they get to the university. Google's Computational Thinking Lessons are one way you can start using technology for more than just calculating and after this summit, I am sure we will have even more resources for reforming our math curriculum.

Paradigm shifts are always frustrating and it is completely normal to be afraid of the unknown. Use that energy to create and innovate. We don't have to let the benefits of technology be limited to smartphones and video games. Let's raise the bar for what math education looks like!

I have heard of quite a few educators who are making the trip to the summit. Be sure to share with us when you get back what you saw, heard, and discussed.

Connect with BrokenAirplane to stay up to date on the exciting things happening in math and education.

Follow my microblogging on Google+

New Google Computational Thinking Lessons

New lessons are available on Google's Exploring Computational Thinking website!


When students are taking tests on data analysis what they see is this:


But, what they will find when they actually start using data analysis in the "real world" is this:


Our schools and universities puts Calculus at the top of the heap. Don't get me wrong, Calculus is fun, amazing, and an excellent challenge in analytical thinking. While many careers require it, many more do not. When I went to school, the "lower tracked" math class was called Statistics and Data Analysis. Therefore, I did not get any in depth understanding of this topic until college and beyond. In fact, I have heard some admissions counselors say that a student who takes statistics is less competitive than a student who took calculus! A worrisome example of how tradition trumps what's best for the student. 

A gap in what kids are learning and what they need is what drove me to make these lessons.


In the Google Computational Thinking lessons and those that follow, students will learn to use math and science in a way Gailieo, Newton, and Maxwell could have only dreamed of. Up until the last 50 years, our problems have always been larger than our potential to solve them. Those that labored to solve some our world's biggest mysteries did so at great expense to their time. Think of all they could have done if they had faster methods available to solve them.

Our students today spend so much time calculating instead of analyzing that they leave the class filled with skills that they have no understanding of or use for. With Computational Thinking, students create algorithms capable of solving big problems (e.g. how to drive a car across the country, what is the optimal shape of an enzyme) and then let the computer quickly calculate it for them. This gives students time to make mistakes, refine their understanding, and most of all draw conclusions and analyze big picture questions.

Computational Thinking has 4 components (see explanation here):
1) Decomposition
2) Pattern Recognition
3) Pattern Generalization and Abstraction
4) Algorithm Design

By using these 4 practices students can do incredible things with large amounts of data, create simulations and models of their world, and begin to understand the concepts and skills through real world use.

Our hope is for these lessons to inspire you to adapt them to your own classroom and content. Some of them involve physics while others focus on biology but they can be adapted to any content even beyond science and math. Computational Thinking is not necessarily computer science. Many of these lessons require no programming experience at all, so you can get started with them right away. Of course if you want to start using programming with your students to supplement these lessons it will give them another applicable skill. 

If you have resources, questions, or want to find out more you can connect with others on the Google Computational Thinking forum, there are quite a few educators out there using Computational Thinking. During my time as Google's Curriculum Fellow I plan to have G+ Hangouts, discussions, and district training to help classrooms implement Computational Thinking. There is awesome technology out there, I hope to see it being used to help students create and innovate rather than do the same things they could have done with paper and pencil.

Connect with BrokenAirplane to stay up to date about how technology can be used effectively in your classroom. 

Follow my microblogging on Google+.

Android + Science with Physics Gizmo

Science equipment can be expensive and yet many of your students have Android phones. Why not put this incredible technology to use for learning. Physics Gizmo allows you to collect scientific data in your classroom, at home, or even in space using only the phone.

Download Physics Gizmo from Google Play

Physics Gizmo is Open Source
I've put the source to Physics Gizmo on GitHub. If you are interested in helping me develop a tool for students to collect and analyze scientific data in an affordable way I encourage you to join the project.


Physics Gizmo on GitHub
Discussion Group Forum

For inspiration, here's an experiment using Physics Gizmo - via +Roberto Catanuto (@RobertoCatanuto)


Version 2.3
This version no longer requires you to turn on Bluetooth when the app starts. The only time you need to turn it on is if you wish to use two phones as a photogate (see below).


Version 2.2
Physics Gizmo is updated to version 2.2 for phones running Gingerbread, Honeycomb, or Ice Cream Sandwich.

If you are running Ice Cream Sandwich (Android version 4.0), this update brings with it a visual refresh in alignment with the new look and feel.

For everyone else, Physics Gizmo will no longer close if you choose not to turn on Bluetooth. This is a bug I have wanted to resolve for a while, and I appreciate your patience.

Bluetooth is necessary to connect two phones as a photogate (video), but if you don't turn on Bluetooth the other sensors work just fine.



Version 2.0
Now there are more opportunities to conduct scientific experiments with your phone.

New Sensors
Using the phone's proximity sensor (usually in the upper left of the phone), Physics Gizmo has three new options for collecting data:  
  1. Photogate Pulse - Triggered each time the proximity sensor is covered. Use it to count events. 
  2. Photogate Pulse with 2 Phones (Beta, only for Android 2.0+) - Connect two phones for accurate event timing. Similar to the 1 phone photogate but one phone starts the timer and the other one stops it. If you are tired of inaccurate experiments from human error with a stopwatch this is for you. See how long it takes for an object to fall or roll down a ramp like Galileo's and more! With Bluetooth's range ~30 ft/10 m there are many possibilities for learning. Watch a video of the 2 Phone Photogate in action.
    1. Click yes to turn on Bluetooth Discovery mode.
    2. Select another phone running Physics Gizmo from the list.
    3. The timer starts when the first phone's proximity sensor is triggered.
    4. The timer will stop when the second phone's proximity sensor is triggered.
  3.  Pendulum - Notoriously difficult to time accurately, an event is recorded for each completed full swing/period (two triggers) of a pendulum passing by the proximity sensor. Watch a video of the pendulum sensor in action.
Note:
  • If you don't see the new sensors your device does not have a proximity sensor (some tablets). 
  • If you don't enable Bluetooth in the beginning, you will not see the 2 phone photogate.


Updated Accelerometer Sensing
  • Continues to sense from the accelerometer even if the screen is turned off (note: be sure to try this with your phone as results may vary). Useful when the phone is in your pocket on a roller coaster.
User Interface 
  • New layout with higher resolution.
  • When finished sensing, press the "plus" button to add more time and sense again.
  • Pressing the question mark button in the upper right opens contextual help for you to successfully use Physics Gizmo and upload your data.

Using Physics Gizmo
  1. Turn on Bluetooth to access all sensors.
  2. Select your sensor
  3. Give your data a name or leave it with the time and date.
  4. Set the timer.
  5. Click start to collect data.
  6. Upload your data to analyze later using Google Docs, Fusion Tables, Geogebra etc. It is also saved in the ScienceData folder on the SD card as a csv.
Think of all of the experiments you can do, considering how much more likely you are to have enough phones in the classroom to do the experiment

I am really excited to see it used by students. I was originally inspired to create the app for my colleague who takes his students to Magic Mountain for Physics Day. Now they can collect accelerometer data on all of the rides and analyze the data back at class! That data will help them build their own roller coasters. The photogate sensors were inspired by my other colleague who creates pinewood derby cars but was always looking to improve the accuracy of the racing data.

The point is, now students can learn science with a phone they already use everyday. Please share in the comments how you used the app!


How Did I Get Here 
A while ago I created an app using Python and Android so everyone could collect data for science experiments. That post became one of my top all time read posts. But, I worried that all you did was read it. You see, I made a couple of mistakes that I wouldn't let students get away with:
  1. I made it relatively difficult to access. The instructions are there, and it would probably take about 20 minutes to get the app on your phones, but 20 minutes is a huge chunk of time in the Internet world and we have so much to do. I have seen people pass up learning Geogebra because they thought it would take too much time to learn!
  2. My second mistake was I didn't push myself to learn. Instead of learning Android programming, I asked all of you to do the work of getting it working so I could play it safe with Python. 
I decided to fix that right away. Now I love Python for its syntax, therefore Android (which is built upon Java) seemed more complex than I would have liked. But, if I wouldn't allow a student to get away with that, then I certainly couldn't.

So I did what I always do when trying to learn something new: I read, and read, and read until I stored up all of the confusing syntax and methods in my head. Keep in mind that this didn't make any sense to me whatsoever. 

Then I came across this excellent tutorial by Chris Blunt. It takes you through the setup, installation, and programming of an android timer app. The clear instructions, pictures, and hints made it really simple to see how an Android app comes together. Eureka! Everything clicked together and suddenly, I was writing all kinds of additions to the app. 

Now, that makes it sound pretty simple huh? Well there were still plenty of bumps in the road, but I did learn than programming for Android is a lot easier than I thought and it makes sense once you get the hang of it. Not to mention I had two powerful tools that kept me going. 
  1. Eclipse - It's free, it's open source and it's incredible! It will generate templates, spell check, find errors, suggest fixes. I can't imagine how I would have come this far without it. 
  2. The Web - Yes, I know it sounds obvious, but books take too long to root through and sometimes your question doesn't fit the examples in the book. I must give special appreciation to Stack Overflow which always seemed to have the right answer. Although, when it had a similar answer, but not the exact one I needed, it pushed me to understand the concepts even more.
The Apress are my favorite Android books so far. I used, Android Apps for Absolute Beginners, Beginning Android 3, and I just ordered Learn Java for Android Development so I can gain an even deeper understanding of how this works. I intend to fully immerse myself in Android programming this year so I can make some apps that can support learning.

Connect with BrokenAirplane and stay up to date with the best resources in education.

Follow my microblogging on Google+

Steve Jobs Dies: The World is a Little Less Awesome

Even if you never owned an Apple product. The technology you use every day was driven by Steve Job's vision. In a world of boxes, Jobs always demanded that his products be works of art and a pleasure to use.

Not everyone knows how their story with technology began, but I do. Sitting with my dad trying to code out programs on his Apple IIc and staring in awe at the graphics. I would not be who I was without that experience and I want to express my gratitude to the man who allowed it to be possible. My dad has never known anything else. He followed Apple wherever it went because of he respected the man's passion for beauty.

That vision went beyond computers, it allowed another group of visionaries to bring us movies like Toy Story and Nemo. It birthed the smartphone market and spurred innovation in handheld technology.

I cannot imagine the loss his family and colleague are going through, my deepest sympathies. His life touched everyone around the world and I want to say to Mr. Jobs, wherever you are, thank you for all the joy and creative freedom you gave to the world. 

Of all the videos and speeches I have seen, this one still makes me cry whenever I see it. Watch it with anyone you want to inspire to do innovate, create, and do incredible things.


Connect with BrokenAirplane and stay up to date with the best resources in education.

Follow my microblogging on Google+

Computational Thinking Presentation with The Global Physics Department

I had the opportunity to speak with the Global Physics Department yesterday regarding my work with Computational Thinking at Google. It was a wonderful opportunity to speak with Physics teachers I have known and respected for years and some who I am just now connecting with.

If you would like to see the conversation or learn a bit about what Computational Thinking is, you can watch the recording, and follow along with the Computational Thinking Presentation.

The gathering of innovative educators is so exciting and refreshing. If you are looking to connect, continue your learning, and deepen your pedagogy then you owe it to yourself to meet with these educators at the meetings or connect with them through Twitter and Google+.

If you have any questions about the presentation, please feel free to contact me directly through the contact information found in the presentation. I would also encourage you to connect through the Computational Thinking Forum, a place where this growing community can meet and discuss ways of implementing Computational Thinking into their curriculum and to share ways that they already are. If you or your colleagues would be interested in hearing more about Computational Thinking, please feel free to connect with me and we can set something up.

I am grateful to the community of educators that creates and innovates, I learn so much from you everyday and I am so glad I am able to call you my colleagues and friends.

Connect with BrokenAirplane and stay up to date with the best resources in education.

Follow my microblogging on Google+

Paradigm Shifts Make My Brain Hurt


Paradigm Shifts Make My Brain Hurt


 But this is a good thing.

My students know that I equate math and learning in general to working out at the gym. Like lifting weights you will never get the results you want if you don’t challenge yourself and do it often. For reasons I am sure have a strong evolutionary advantage, our brains form these strong bonds to ideas family, worldview, foods you will never try even though you have no idea what they taste like, etc. Well every so often, if you are lucky, your paradigm is challenged. This serves to either strengthen it or force you into what the philosophers call a “crisis”. Either way a lot of thinking and reflection occurs. This is a story about both math and paradigms.

 One day I was working at my desk when a visitor sat down next to me at the adjacent desk. As we started talking I realized that this was someone I knew from online! What a small world. It turned out to be Emmanuel from the Bootstrap project which teaches algebra and game design through programming. He was there to train engineers to become mentors of middle and high school students.

Bootstrap is unique in a couple of ways. The materials are extremely detailed completed with step by step scripts of what to say and do in the classroom. This is useful to mentors who have never taught before but I was equally surprised to see how succinctly Emmanuel was able to capture good pedagogy and convey that in short training sessions and through the materials.

 The other way in which Bootstrap is unique (and why my head hurts) is its use of functional programming instead of imperative programming. You might be saying to yourself, “I thought there was only one type of programming and just different languages.” Like human languages, programming languages can be broken down into families which share certain qualities and approaches to problem solving.

Imperative languages (C, Python, Ruby, Java, etc.) allow the user to write instructions for how the computer should be manipulated. Imperative languages run by changing the state of values (saving variables, updating variables, iteration). If you have programmed it was likely in a imperative language.

Functional languages trace their roots all the way back to the Lambda Calculus, a formal system developed to explore various mathematical principles. Functional languages allow you to abstract concepts as you would in math. Some like my mentor become filled with joy when programming in a functional paradigm, I am still getting used to it but I definitely see its merits. You may find this approach freeing or frustrating, depending on your own background!

 For example in an imperative style you might calculate factorial like this:
1
2
3
4
5
6
 def factorial(n): 
    f = 1 
    while (n > 0): 
        f = f * n 
        n = n - 1 
   return f 

Here we’re keeping track of two values as the program runs:
  • n is our counter, which starts at n and shrinks to zero
  • f is our accumulator, which is multiplied by n at each trip through the loop 
In this code in order to get it to work, we need  for loops and temporary variables, which track the machine’s behavior as it works through the process of calculating the answer. This is analogous to the way a student would calculate the answer on paper, keeping track of f and n on scrap paper as they go. In our imperative solution, each line of code is telling the machine to store answers and change values, such that the value returned is the answer we want.

In a functional language, you might right something like this:
1
2
3
4
5
def factorial(n): 
    if n == 0: 
        return 1 
    else: 
        return factorial(n-1) * n

Notice that in this code one there are no temporary variables or reassignment! In this case, the code makes no reference to the machine, or how to calculate the answer. Instead, it is declaring that factorial(0)=1 and that factorial(n) is n*factorial(n-1). The premise is that you are building math out of functions instead of manipulating variables.

Another well known example is Euclid's Algorithm for the greatest common factor (GCF) of two numbers.
1
2
3
4
5
def gcf(a,b):
    if b==0: 
        return a
    else: 
        return gcf(b,a%b)

 In my experience students often get lost in the variables and tracing out how they change. It’s too much cognitive load to ask them to keep track of (how many teachers can relate to off-by-one errors with for loops, or confusion surrounding variable scope?). But there’s something even deeper going on here, beyond “simplicity” -- suppose you wanted students to really understand factorial. As a math teacher, which approach would you choose? The list of steps and scrap paper necessary to calculate the answer, or the formula for factorial itself?


Compare the two solutions to this formula, and you’ll see that the functional approach is actually identical to the formal definition while the imperative approach has little to do with it. For students to connect the imperative solution to the math, they need to do a lot of work to see why those steps will wind up giving back the right answer. Moreover, this approach uses things like while loops and assignment, which do not even exist in algebra!

Meanwhile, the essence of factorial is declared explicitly in the functional solution (it literally reads exactly like the algebra).

This is not to say that the imperative version is incorrect. (It works just fine on my own computer here!) However, the imperative solution introduces students to assignments and while-loops: concepts that have no business in a math classroom. The imperative model for variables is completely out of place in the context of mathematics, and will only serve to make things harder for students who have to un-learn it.

As Emmanuel points out, we know that there is no such thing as the “One True Language”. Instead, you pick the language based on the job. If your job happens to be teaching math, why not use an approach that’s actually mathematical? While I am extremely new to the topic, I am working of translating my own curriculum to use the paradigm. This is not to say, one is better than the other. Each way has its strengths and weaknesses but I think I am finally ready to take up my mentor’s call to use functional programming with my students.

I would highly suggest you take a look at Bootstrap. The resources are free and as I said, extremely helpful in supporting you and the student every step of the way. This is an excellent program for students. They love creating games as they learn algebra and some best practices in programming. This in turn helps them become better at solving problems and writing code.

Connect with BrokenAirplane and stay up to date with the best resources in education.

Follow my microblogging on Google+

Dangerous Things You Should Let Your Kids Do

I can not believe that I have never written about the Dangerous Things You Should Let Your Kids Do. You may or may not have heard of Gever Tulley so I have included his TED talk at the bottom of this post.

Our world has become too safe. In our effort to keep our children alive, we have let fear get the best of us and took all of the fun out of childhood. Our anti-bacterial everything are growing super strains of infection, the playgrounds are timid and yawn-inspring, and our Chemistry sets no longer ship with radioactive material (ok maybe that is a good thing). Don't even get me started on the supposed learning toys with one button and no challenge.

I heard about Tulley and his Tinkering School a few years ago at Maker Faire and swore that when my kids were old enough we would do this stuff. I didn't want my children to feel like they lacked the basic skills to create or if needed, survive. Plus, I have said numerous times that my most formative experiences have been learning side-by-side with my parents or under a mentor.

So a week ago, my two year old son could not stop talking about how much he loves my keyless entry badge for work. From what I can tell, he enjoys pulling the badge and watching it snap back on the reel, looking at the picture of his Dad, and saying the word Google with the same playfulness that must have inspired Mr. Kasner.

I have always joked (it wasn't a joke) with my wife that when he was old enough, I would teach him soldering, programming, welding, etc. Well, now was as good a time as any. After a quick trip to Radio Shack we were ready to go. Now a two year old's attention is a funny thing, sometimes he wanted to help too much, and other times he wanted to go play with his toys and take a nap. Nonetheless, when I handed him his badge his eyes lit up with more intensity than the LED we put in it.

This was not the joy of a new toy, this was the joy that comes from being a part of the creation of something cool. My disclaimer is this is not my best work, but I hope that each year he and I can get progressively more challenging with these projects to the point where he is teaching me. With the cost of parts so low and the abundant learning resources I can't even predict what will happen over the next 10 years. Oh and don't think my soon to be born daughter is exempt, making is a family affair!

Before you say anything, don't worry I am not pushing for my children to be anything in particular, but our education system makes us masters of nothing and I want to make sure my children are equipped to follow any path they choose.

Watch the video below, and then please, please, please let your kids do something dangerous!

Subscribe and Connect to BrokenAirplane and stay up to date with the best resources in education.

Technology is Not Magic

Perhaps you read the story this week from the New York times about how technology in the classroom is not showing an improvement in test scores. It may surprise you (unless you know me) to find that I could have wrote that article years ago. Except I would have called it, "New Technology + Old Ways of Educating Lead to Lower Test Scores and Empty District Budgets."

Every day I hear about a new panacea for all that is wrong with education. Often this magic comes from a piece of software, website, or hardware. To hear the marketing departments of these companies talk, you would think you just put ________ into your classroom and everything will right itself.

If this were an infomercial we would all laugh at the hyperbole, but unfortunately thousands of districts flock to these vendors and fork over money like a gambler spending his family's food money. Early in my career, I was given a pink slip in order to shore up budgets. In that same year, millions of dollars were spent on adding interactive whiteboards, clickers, microphones, cameras, etc. I have seen or heard this too many times to feel like my situation was an anomaly.

These technologies are incredibly cool and powerful so why are we not seeing a bump in scores? My first reason that I will only mention briefly as I have spoken on it in the past is the growing disconnect between test scores and learning. There are so many issues and errors with the "system" used to assess learning that I would question every statement that begins or ends with "test scores show" or "led to an increase/decrease in test scores".

The oft cited Tony Wagner refers to the skills needed to close the global achievement gap (video).  If you don't have the time to read them, I can quickly summarize them by saying that they are not skills that can be tested by today's assessments.

Technology can be used for good and evil, it can give us superpowers or add convenience. This is one of the reasons why the Flintstones/Jetsons cartoons are so funny. In the Flintstons you see Fred in his foot pedaled car when he could far more easily walk or run. In the Jetsons, modern society remains exactly the same as it is but with technology (e.g. George walking the dog on a treadmill because for some reason they live in the sky). This is what we have done with technology, spent all of our money on shiny toys only to do things the exact same way as we did before.

Here are a few conversations I have had or overheard over the years:
  • Why should students learn to program, they already have calculators?
    • Problem solving/creative thinking
  • If you give students access to the Internet, all they will do is copy-and-paste.
    • Perhaps your assignment could be updated to require thought.
  • We have to block all social networking and chat on the school networks or students will spend all of their time talking to each other.
    •  Do teachers spend all of their time working alone without collaboration (oh wait, sadly many do).
  • You (Phil) can do all of these cool things you do because you had XYZ technology or laptops.
    • Hahahahahahahahahahhahaha. Have you ever tried to do a boring assignment on a laptop? The lesson is still boring.
  • We can't have cell phones in school. (Never really heard the justification)
    • My dream is to have school in an open field or apprenticing at a lab/workshop. Cell phones could make that possible and they cost far less than the tech we are filling our rooms with.
Here are the marketing companies: Look we took all of your old lessons and assignments and made them flashy and gave the students buttons to push. 

Here is my challenge to our community: Help the students do things that were never possible before.

If your test scores are not going up, don't look to adding some new piece of entertainment, give the students a challenge to create, apply, engineer. If that involves technology, great! If it doesn't then that is probably better.


Subscribe and Connect to BrokenAirplane and stay up to date with the best resources for your classroom.

Updated Python: How to Think Like a Computer Scientist

I hold a special place in my heart for the How to Think Like a Computer Scientist tutorial. When my former teacher and then colleague Michel Paul told me about this great language Python I went home and checked out a few tutorials.

Jeff Elkner's How to Think... was not only the easiest introduction to the syntax of the language, I still use it as one of my references as well as for my students. The tutorial started out as a series of explanations and tutorials but recently has evolved into a much more interactive experience. For many students it is difficult to get software installed on their home computers and sadly it can be difficult for teachers to have it on their school network. Brad Miller has released an updated version of How to Think Like a Computer Scientist with interpreters built into the lesson so students can learn right from the browser.


The ability to program from within the browser is making a huge impact on one's ability to learn right away. Some great examples of this beyond How to Think... are: W3 School (HTML, CSS, Javascript, etc), SAGE (Math), and CodeAcademy (lots of great potential here).

You will need a Google account (free) and an up to date browser (Chrome, Firefox, IE). In addition to the interactivity, video tutorials and an administrative back end is being tested and will be opened up at the end of the semester for use with your students. Brad Miller, continues to refine this project and is committed to making it useful and open to as many as possible. New tutorials have been added to take you from Hello World to full blown Object Oriented Programming (trust me it's awesome).

I can personally testify to the quality of these lessons. If you are motivated you could go through these in a weekend or so and be off and running to the great possibilities in using programming with your students. As I have said before, it will provide opportunities for students to try ideas they never could have before. I think of all my students and I have been able to accomplish with Python and it all started with the How to Think Like a Computer Scientist tutorial. I can only imagine what could happen if every teacher who read this blog gave it a shot and passed it on to their students.

Subscribe and Connect to BrokenAirplane and stay up to date with the best resources for your classroom.

I'm Not Texting I'm Programming!

Update: This app is available now as Physics Gizmo on Google Play.

No less than a century ago, it was possible to learn everything we knew about science. The only requirements were an ability to read, an extensive library, and perhaps the equipment to carry out your own experiments. Now we have entered a new era of science where literacy is more widespread and between the Internet and Libraries we have every resource imaginable at our fingertips.

Two big problems remain, science has diversified and grown so much that it is difficult for scientists to know everything about their own field let alone another. The other issue is how science equipment remains financially out of reach of amateurs and explorers. The major scientific research is driven by that which will have a financial return and so science for its own sake is limited. This is even more evident in schools who are cutting science to save the rest of their budgets and focus on less expensive (and more tested) subjects This must change if a steady stream of innovation is to continue.

The hacker spirit is a deeply embedded part of science. Now out of necessity and pure enjoyment, many are directing their attention away from software development but to hardware. In the August issue of Wired, the BioHacker movement features those who wish to reduce the cost of doing Genetic analysis.

Do you know where these DIY Biologists expect to see the most impact? Schools! For students to do science instead of just reading about it. Arduinos, Makerbots, Robotics, and more are forever changing the opportunities students have to create.

At my school we spent a lot of time in labs and projects. What was lacking was quality data. Unfortunately the tools and sensors available to students are expensive and limited. So I did what I always do, I sat down and wrote some code :)

I love my Android phone and each day I hear about the insane number of new activations everyday. The smart phone is getting smarter and cheaper just as technology always does. Just as we saw an explosion of Desktops and later Laptops in the 1990-2000s, we are seeing an even speedier rate of adoption of smart phones. While looking at my phone one day, I realized how many sensors/tools it has built in seamlessly to its interface (Internet, Accelerometer (motion sensor), Gyroscope, Light, Sound) which if purchased separately would be thousands of dollars and would not play well with each other.

So I wrote a program which logs motion and then uploads it to your Google Docs account. You can see some screenshots below of the results.

Jumping up and down

Dropping my phone (onto a pillow)

To do this, I used sl4a (Scripting Language for Android). With this you can code in Python, Ruby, Javascript (and more) and do almost anything with your Android phone. It has a built in editor so you can quickly type code into the phone (hence this post's name) or you can code it in your favorite editor and then transfer it to the SD card on your phone.

Why did I use sl4a instead of making a nice pretty app using Android's SDK? This application uses the Google Doc APIs (basically commands to communicate between an app and and a program like Twitter or Facebook) and Python. If you look at the code it could be done by any of our students with a free weekend. It may look a little complicated at first but there are just a lot of function calls to save code. Just like most other Python code, it reads like a story (login, get the parameters, sense, upload).

I believe sl4a could take students who may or may not have used App Inventor or Scratch to the next level and open up a world of possibilities to them. sl4a has been used to send collect data on a phone being launched into space and many other exciting projects involving Twitter, Robots, Arduino and more!


I wanted to use sl4a so everyone who knows Python could see the code and hopefully improve on it. I don't have the time right now, but I would love to see other sensors added, the ability to review and display the data/graph on the phone, interface with Arduino, and store data on the phone if it logs data longer than 1 minute, and perhaps even add a pretty GUI. I'm hoping that by open sourcing this, others will want to jump on board and help out. Cellbots have set the bar really high and have their own incredible data logging app and if they integrated Google Docs uploading I would say their app is perfection.

My hope is as more educators/students realize their ability to create, scientific tools will become available to all. People like Steve Dickie, the Arduino team, Geogebra, and many others are working really hard to ensure that the cost to do STEM is reduced dramatically.

You could walk into your class on Monday and ask your students how many of them have an Android phone, you may be surprised that there are enough for one per group. Think of all of the experiments you could do with nothing else but your phone. I can't wait for this year's Magic Mountain Physics Day and see how many students could get data from a roller coaster and directly upload it to their Google Docs (and check it while still at the park from the GDocs Android app).

Look how easy it is to make a little popup on your screen!
import android
droid=android.Android()
droid.makeToast("Hello Android")


If you want to give this a shot, go to the sl4a website and download the apk (the installer). Your other options are to click this link, or scan the barcode on the right with your Android phone. Follow the User Guide to get Python (or the other languages) installed on your phone.

Now, you are ready to start coding on/for your phone. There are some great tutorials on the sl4a website, I also recommend the book Pro Android Python with SL4A. In my code below I list a few other resources that were helpful to the doScience project.

If your code is relatively small you can share it via barcode but this app falls just above that threshold. So you can copy and paste it from below (just please respect the Creative Commons licence) into your Python Editor or download the doScience file directly. Save it to your SD card in the sl4a/scripts folder. This code must be run on a phone or a computer connected to a phone running an sl4a server (much simpler than it sounds).

Note: It will ask you to login to your Google account. As you can see from the code below, no one is able to access that information since it is kept hidden from even the developer by the dialogGetPassword method in line 41.

I hope this app inspires you to do something great. If you know how to program, build, create will you please lend your talents to this projects or the many others out there. If you don't know how to create, then learn as it is the most incredible thing to be a Maker and you will inspire others. Before you know it, the revolution will be underway (oh wait it already is, come join us)!

Subscribe and Connect to BrokenAirplane and stay up to date with the best resources for your classroom.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
'''This code is licenced under a Creative Commons
Attribution-NonCommercial-ShareAlike 3.0 Unported Licence.
Created by Phil Wagner 2011 www.brokenairplane.com. This code allows data logging and uploading to Google Spreadsheets.
It exists so students can to do Science when 
the cost of Science Equipment is too expensive. Additional features can be added
but this paragraph should always remain in the code.'''

#Future features - Additional Sensors, Review, Display Data/Graph on Phone
#interface with Arduino/ADK

#Helpful Resources:
#http://code.google.com/p/android-scripting/ (sl4a)
#http://code.google.com/ (Google APIs and resources)
#http://www.adaptcode.com/using-google-spreadsheets-as-a-database-in-the-cloud/
#http://gdata-python-client.googlecode.com/svn/trunk/pydocs/gdata.spreadsheet.text_db.html

import android
import time
import gdata.spreadsheet.service
import gdata.spreadsheet.text_db
import string

droid = android.Android()

dt=100 #Time between sensing

def countdown():
    #3 Second Countdown and Vibrate
    droid.vibrate(100)
    time.sleep(1)
    droid.vibrate(100)
    time.sleep(1)
    droid.vibrate(100)#3 second countdown
    time.sleep(1)
    droid.vibrate(300)
    return

def login(myEmail='example@gmail.com', password=''):    #Get Email and Password and login
    while password == '':
        email = droid.dialogGetInput("Email", "Enter the email account where the Data will be uploaded to:",myEmail).result
        password=droid.dialogGetPassword("Password", "Enter the account password where the Data will be uploaded to:").result
        try:
            client = gdata.spreadsheet.text_db.DatabaseClient()
            client.SetCredentials(username=email, password=password)
        except gdata.spreadsheet.text_db.BadCredentials:
            droid.dialogCreateAlert("Username or password incorrect.")
            droid.dialogSetPositiveButtonText("OK")
            droid.dialogShow()
            redo = droid.dialogGetResponse()
            password =''
            continue
        else:
            return client

def spreadSheetSetup(client, defaultTitle = 'Science Data'):
    versionNumber = client.GetDatabases(name=defaultTitle)
    if len(versionNumber) > 0:
        droid.dialogCreateAlert('Science Data %d' % len(versionNumber))
        droid.dialogSetPositiveButtonText("OK") #Yes option box
        droid.dialogShow()
        understood = droid.dialogGetResponse()
        spreadsheetTitle = defaultTitle+' '+str(len(versionNumber))
    else:
        spreadsheetTitle = defaultTitle
    return client.CreateDatabase(spreadsheetTitle)

def time2Sense(defaultTime=5000):
    maxTime =0
    #Enter time for sensing
    while maxTime == 0: ##How long to sense?
        try:
            maxTime=int(droid.dialogGetInput("Time", "How long to collect data (in milliseconds):",str(defaultTime)).result)
        except TypeError:
            droid.dialogCreateAlert("Please enter a numeric time")
            droid.dialogSetPositiveButtonText("OK")
            droid.dialogShow()
            droid.dialogGetResponse()
            continue
        if maxTime > 30000: #30 seconds max for optimal upload
            droid.dialogCreateAlert("Warning this could take a long time to upload.")
            droid.dialogSetPositiveButtonText("I accept the risks")
            droid.dialogSetNegativeButtonText('New time')
            droid.dialogShow()
            check = droid.dialogGetResponse().result
            if check['which'] == 'positive':
                return maxTime
            else:
                maxTime = 0
                continue
        return maxTime

def doScience():
    droid.dialogCreateAlert('Are you ready', 'Click yes to begin sensing, or no to cancel')
    droid.dialogSetPositiveButtonText("Let's do science!") #Yes option box
    droid.dialogSetNegativeButtonText("Nah let's cancel") #No option box
    droid.dialogShow()
    return droid.dialogGetResponse().result

def senseAccel(endTime,dt=100):    #Sense and store accel data
    timeSensed=0
    tempScience = []
    droid.startSensingTimed(2,dt) #dt = time between sensings
    while timeSensed <= endTime:
        tempScience.append(droid.sensorsReadAccelerometer().result) #add new accel data to list
        time.sleep(dt/1000.0)
        timeSensed+=dt
    #Stop Sensing
    droid.makeToast("Done")
    droid.vibrate(300)
    droid.stopSensing()
    return tempScience

def main():
    db =spreadSheetSetup(login())
    endTime = time2Sense()
    ready = doScience()
    if ready['which'] == 'positive':
        countdown()
        science = senseAccel(endTime,dt)
        table=db.CreateTable('Accelerometer',['t','x','y','z']) #Beware spreadsheet column names cannot be uppercase if you are going to add to them later http://code.google.com/p/gdata-python-client/issues/detail?id=363
        droid.dialogCreateHorizontalProgress('Progress','Uploading to Docs',len(science)*3 )
        droid.dialogShow()
        progress = 0
        time = 0
        for data in science:
            table.AddRecord({'t':str(time),'x':str(data[0]),'y':str(data[1]),'z':str(data[2])}) #AddRecord requires strings as arguements str()
            progress+=3
            time+=dt
            droid.dialogSetCurrentProgress(progress)
        droid.dialogCreateAlert('Done', 'Go check your data on Docs')
        droid.dialogSetPositiveButtonText("OK") #Yes option box
        droid.dialogShow()
        droid.dialogGetResponse()

if __name__ == "__main__":
        main()