Thursday, February 26, 2015

Lessons in Time

The other day I was microwaving some food to heat it up. Ten seconds seemed like forever. I was actually able to do several other things while I waited. The microwave has changed my perception of time in some ways. nanoseconds As I thought about that I remembered the first time I heard Grace Hopper speak.

One of her favorite stories was about explaining to an admiral why there was a delay in satellite transmission. She used a wire “nanosecond” to demonstrate. Light travels about 11 3/4 inches in a nanosecond. She would show the wire and explain that there were a lot of nanoseconds between the ground and the satellite.

Later in her career Admiral Hopper used to show off packets of picoseconds. She got the little packets in the cafeteria where they were already labeled with the letter P.

I am I am sure many others use the nanosecond story to help explain to our students why smaller computers are faster computers.  I’m thinking about adding the microwave story to my toolkit as well. Some times that we think are very fast in the abstract are actually very slow in reality. Once you realize that 10 seconds is not instantaneous and that you can actually accomplish other things during that time you realize that parallel operations can make better use of the time available. Ten seconds to you and I can be a long time. A nanosecond is a long time to a computer. Even, these days, a picosecond is a long time for a computer. We’ll see how that goes over.

Tuesday, February 24, 2015

Simulations Are More Fun

One of my favorite computer science teachers, Judy Hromcik from Texas, posted a link to a video called “The last banana: A thought experiment in probability.” The video outlines a particular statistical problem.

“Imagine a game played with two players and two dice: if the biggest number rolled is one, two, three, or four, player 1 wins. If the biggest number rolled is five or six, player 2 wins. Who has the best probability of winning the game?”

The video outlines several ways to determine who has the best chance of winning. There are several ways including logic diagrams which are interesting and perhaps even fun. For me, programming geek that I am, creating a Monte Carlo simulations seems like the most fun way. Judy is thinking about using this with her students and I’m thinking about using it with mine as well.

I’m looking forward to discussions with students about the results. image The first couple of times I ran the simulation I did so with small iterations (36 simulated rolls) and the results were not always what I expected. Player One won more than Player Two in several cases. This is well within the realm of possibility of course. Probability is not certainty. Larger numbers of iterations came a lot closer to the theoretical ratio of winners. This is also expected. I think the next improvement to the program is to show the percentages for each player as well as the raw numbers BTW. Theoretically Player Two should win 56% of the time.

I think simulations are fun but I also wonder if they might help students picture the results better than looking at a strictly mathematical look at the probabilities.

Back in college I took a number of courses in statistics (I was originally a sociology major) and I got tired of doing the arithmetic. The math was fun but doing the calculations was tedious. So I did the only logical thing – I wrote programs to do the arithmetic. Do this really helped me focus on the math, the algorithms, and save time doing the arithmetic. So some people the math is enough. Some of us like to see things in a different way.

Anyone out there teach statistics? Do you have students run (or better yet program) simulations as part of the course? Does it work for your students?

Monday, February 23, 2015

Interesting Links 23 February 2015

It's February break for my school. I’m trying to take it easy this week. And catching up with grading of course. I suspect a lot of teachers use so-called vacation time to catch up on school work like grading and planning. I also hope to play with some tools I haven't had time for. With any luck at all I’ll get my new 3-d printer working. And maybe a Kinect project I want to start. We’ll see!  IF you’re looking for interesting things I have a few good links below.

I love the suggestions that come fromCS Teaching Tips @CSTeachingTips For example “Give students a caesar cipher to teach how characters can be treated as numbers and to reinforce string manipulation. http://ow.ly/IiLhJ  “ I love Caesar cipher projects! Also this one “Give students a large data file to sort when teaching sorting algorithms. http://ow.ly/IiJZ7 “ Sorting small data sets is boring, feels to easy and doesn’t give one a real chance to see performance differences.

Computer Science Teacher: 2015 CSTA annual conference – Registration is Open. Will I see you there?

Fun images to help visualize how computers have changed. Your students may find these interesting.

Algorithms – Teaching coding structures to 6th grade.

New collaboration features in TouchDevelop   This opens some interesting possibilities. I’m wondering about how several students modifying the same program at the same time will work out in class.

Friday, February 20, 2015

Today’s BASIC Is Not Your Father’s BASIC

A post at Doug Peterson’s blog (A Different Time) sent me to a site that has a collection of old BASIC programs. And by old I mean the 1970s. I remember many of these programs as I was starting my programming career back then. One could take these programs and type them into their computer and run them. It was fun and we learned a lot. But I’ll tell you the language has changed a lot since then.

image

For example back then a comment was a REM statement. Short for REMARK of course. Today most version of Basic use a single quote to flag a comment. Today variable names can be of any length while back then one was limited to a single letter followed by a number or numbers. Variables were declared using a Dim statement as they are today but the type was specific by a $ for string, a % for integers and floating point numbers had neither of those special symbols. One can’t use them in variable names today of course.

Originally BASIC did not have subroutines as we know them today. We had the GOSUB statement which branched code to a line number (we don’t use line numbers at all any more) and a return statement brought the flow of execution back to the line after the GOSUB. There was no parameter passing and variables were basically global. There were functions of a sort. Those were defined in a single line like this:

180 DEF FNM(X)=X-8*INT((X-1)/8)

The functions were all named FN followed by some letter. Return values were loosely typed. It sure was easy to use though.

I’m looking though these old projects for ideas for updated versions to use with my current students. Some I will use with Visual Basic and some with C#. And just maybe some with TouchDevelep. Some things never get old.

Today’s versions of BASIC are both much more powerful and much more complicated than those early versions were. Stronger types, more powerful functions and subroutines,  lots more flexibility in identifier names and real error handling.  Small Basic is an attempt, and a good one, at returning in part to those simpler days.  It still has more power and complexity but many things are much easier. Visual Basic is a very powerful professional level language and development environment. It too makes some things much easier than they were “back in the day” but in other ways the complexity can be intimidating and even frustrating for beginner.  It seems to work well with my high school freshmen though as long as I stick to the basics.

I wonder how many people judge the idea of BASIC based on thirty (or forty) year old versions of the language? Today’s versions, especially Visual Basic are every bit as powerful and modern as Java or many other popular languages. And still easier to learn. I still like them.

Thursday, February 19, 2015

2015 CSTA annual conference – Registration is Open

unnamed

Registration is now open for the CSTA annual conference. CSTA 2015 is a professional development opportunity for computer science and information technology teachers who need practical, classroom-focused information to help them prepare their students for the future. Conference content is peer reviewed and peer or industry led, making it relevant to today's classroom needs. This year we are staying true to being "bigger and better than ever" so we have expanded our conference to span three days, with two days worth of workshops, more exhibitors, along with multiple networking opportunities.

Highlights:

  • Explore issues and trends relating directly to your classroom
  • Learn, network and interact
  • Choose from various workshops and breakout sessions
  • Amazing value (complimentary conference Wi-Fi, breakfast, lunch and snacks - CHECK!) at approximately $100/day!

Some of this year's session topics include:

  • Advanced Placement Computer Science
  • Computational Thinking
  • Increasing Enrollment in Computer Science
  • Programming
  • Robotics

Keynotes:

  • Megan Smith, Chief Technology Officer of the United States - Invited
  • Randy Pitchford, Aaron Thibault and Jimmy Sieben with Gearbox

Pre-registration is required and will be accepted for the first 500 teachers. The registration deadline is June 26, 2015. Also, please note that you must complete the payment portion of the online form in order to be fully registered for the conference!

As always, we thank our sponsors for their generous donations. Your registration fee will include networking opportunities, lunch and resource materials. The 2015 CSTA Annual Conference is made possible by the generous support of Google, Lockheed Martin, Oracle Academy and the University of Texas at Dallas.

Costs:

Conference registration (which includes a community session on Sunday (July 12) afternoon, Monday night's event with the University of Texas at Dallas, and all general and plenary sessions on Tuesday(July 14) is $100 if you register by April 15. From April 16-June 26 the price is $150, and after that the price increases to $225.

Workshops are a separate price, and this year we have expanded our offerings to include options on Sunday, as well as Monday. The price for workshops is $100 for the first one, and $50 for each additional workshop (maximum number of three).

Please note that all workshops are "bring your own laptop" and that workshop registration is limited to 30-40 participants; so be sure to register early to get your workshop choice. As an additional reminder, we DO NOT accept workshop registrations onsite, and there is NO switching of options.

Register at: www.cstaconference.org

For more information contact Tiffany Nash, CSTA Events and Communications Manager at t.nash@csta-hq.org

P.S. A big thank you to the 2015 Conference Planning Committee:

  • Doug Peterson, Program Chair
  • J. Philip East, Workshop Chair
  • Duncan Buell, Review Chair
  • Mindy Hart, Volunteer Coordinator
  • Stephanie Hoeppner
  • Tammy Pirmann
  • Dave Reed, CSTA Professional Development Committee Chair
  • Hal Speed, Central Texas Chapter Conference Liaison
  • Sheena Vaidyanathan
  • Henry Vo, Dallas Fort Worth Chapter Conference Liaison
  • Lizan Ward, Greater Houston Chapter Conference Liaison
  • Lissa Clayborn, Acting Executive Director, CSTA

We look forward to seeing you in Grapevine!

The CSTA 2015 Annual Conference is generously sponsored by:

Tuesday, February 17, 2015

One Thing Leads To Another

One of the great things about teacher blogging is the sharing of ideas. Often these ideas can be easily adapted and adopted in new ways. Earlier today Doug Peterson had an interesting post about wind chill calculations. He had an interest, shared by lots of us “enjoying” a particularly cold winter, and did some research. This resulted in a Small Basic project. And all the information I needed to write my own project.

Now Small Basic is a wonderful little language for projects like a wind chill calculator.  I can easily understand why it was a go to language for Doug. On the other hand I have been doing a lot of work with TouchDevelop lately so writing the program in that came to my mind. My wind chill program (which you can run from any web browser) looks like the following.

image

TouchDevelop has three levels of ability for coding these days BTW. That is the “beginner” format which I chose in part because I like the color coding.

Any way, I can see some room for expansion. There are obvious UI improvements but as is often the case there is more to wind chill can meets the eye. For example these calculations are apparently only useful for temperatures below 50 degrees Fahrenheit. That’s an obvious check that should be made. It has the added advantage of being able to add if statements to a simple assignment statement project.

We should probably also check for negative wind speed. As always one thing leads to another in programming. And now thanks to Doug for sharing what he did I have another project I can use with my students. One that conveniently works in any programming language I might use.

Monday, February 16, 2015

Interesting Links 16 February 2015

President’s Day today which means my school is closed. I can use the rest after cleaning up from the latest snow storm. I’ve lost count of the number of feet (yes FEET) of snow we have had in the last month. Probably over 6 feet (2 meters) and it looks like more to come. Great weather to stay inside and write code. And look though some interesting links.

Rob Miles has put the materials for his  C# Course and a Shiny New Kindle C# Yellow Book on line. I recommend his materials. He does good work.

Garth Flint writes about taking his students on A CS Field Trip. Do you take students on field trips? Where to?

Simon Johnson has created Flapping Birds v.2.0.1 in 68 lines of touchdevelop! I may use this as a starter for some additional projects.

Speaking of TouchDevelop. TouchDevelop is now an open source project on GitHub. The current team will keep working on it, but can use some help.

Have you been following the CSTA blog? Maybe it is time to catch up on the latest posts.

Care about CS Education? You can work for http://Code.org ! They are hiring. Lots. http://code.org/about/jobs Some great people already working there.

Thursday, February 12, 2015

Creating Code Hunt Puzzles

As I mentioned the other day (see Learning From the Code Hunt Dashboard) I have been creating my own Code Hunt puzzles for use with my students. Earlier this week I spent some time at Microsoft Research in a workshop about Code Hunt. Among the things I learned was a few more things about creating puzzles. Specifically I learned more about how test cases are generated and how I can tune what test cases are created for my students to see. This can make puzzles harder or easier for students which is a good thing. Sometimes I want the test cases to point a little more clearly to a solution. I don’t want students too frustrated but at the same time I want some challenge to the puzzle. I learned a lot from the Code Hunt designer documentation which is available online here but I wanted to highlight a few things that others may find useful.

Let’s start with something simple. I created a puzzle where the correct solution is to convert a number from Celsius to Fahrenheit. Initially I created something that looked like this:

   1: #level Cold
   2: #code C#
   3: using System;
   4: public class Program {
   5:     public static double Puzzle(double x) {
   6:         return 0.0;
   7:     }
   8: }
   9:  
  10: #secret C#
  11: using System;
  12: using Microsoft.Pex.Framework;
  13: public class Program {
  14:     public static double Puzzle(double x) {
  15:          return (9.0/5.0) * x + 32.0;
  16:     }
  17: }

the problem for me is that the test data looks something like this: image




While the 0 to 32 is helpful I wanted a bit more of a hit. So I added a simple if with no action that forces 100 to 212 to run as test data. This makes the secret code more like this:



   1: #secret C#
   2: using System;
   3: using Microsoft.Pex.Framework;
   4: public class Program {
   5:     public static double Puzzle(double x) {
   6:         if (x == 100);
   7:          return (9.0/5.0) * x + 32.0;
   8:     }

The other issues I have had are with string based puzzles. While for some puzzles I want students to deal with the null case for some the early puzzles I want to remove that complexity. And in fact I may want to have a minimum number of characters in the string. For that there are some PexAssume methods we can use. I particularly like IsNotNullOrEmpty for avoiding having the null or empty string case. Though I could also use PexAssume.IsNotNull(s); to leave in the empty string case while removing the null string case. I can also use PexAssume.IsTrue to require that strings be at least a specific length.



   1: PexAssume.IsNotNullOrEmpty(s);
   2: PexAssume.IsTrue(s.Length >= 3);


To the computer a string is a string is a string and it doesn’t really care what characters is in it. So you can see strings like “/0/0/0” which can be a bit confusing and intimidating to beginners.


image


IT turns out that you can do some work in your secret code before you feed a value to a PexAssume.IsTrue method. That means that code like the following will make sure that the test data includes only the characters “a” though “z” are included in the test data.



   1: Boolean b = true;
   2: for (int i = 0; i < s.Length;i++)
   3:     if (char.Parse(s.Substring(i, 1)) < 'a' || char.Parse(s.Substring(i, 1)) > 'z') b = false;
   4: PexAssume.IsTrue(b);


I see a lot more potential in that sort of thing for the future.


I’ve been using PexAssume.IsNotNullOrEmpty for arrays as test data as well. I’ve got a zone that I have been using this semester but I am gradually adding puzzles as I learn more about Code Hunt. I’m willing to share my puzzles with others. Anyone else creating custom puzzle for their students?

Wednesday, February 11, 2015

Coding lessons for 8-10 yr olds

Are you a tweeting teacher who teaches K-8 computer science? If so I am hoping you can join the CSTA K-8 task group for the next #CSK8 Twitter chat on Wed Feb 11 8pm EST. Please forward the invitation to other teacher/specialists/parents and others interested in teaching this age group. 

Topic: Coding lessons for 8-10 yr olds. What do you need to know about teaching this age group?

Learn and share your favorite lessons, activities and resources for this age group. Talk about integration of CS in the curriculum by non CS teachers and the role of after school coding clubs.

Tuesday, February 10, 2015

Learning From the Code Hunt Dashboard

This week I am in Redmond WA at a two day workshop around Code Hunt being run by Microsoft Research and the developers behind Code Hunt. After day one I can say I have learned a lot.  I’ve been using Code Hunt with my honors programming students. I started using it with last semester’s class but have been using it right from the beginning this semester. While I have used the default question set and also included puzzles in Office Mix recordings I really got into developing my own Zone for my students. As you can see I have four basic sectors each with 3 to 6 puzzles. I’m going to expand that over time. BTW the Code Hunt designer documentation is available online here. I’m planning on blogging some about that soon.

image

One of the things I learned more about today was the ability of a zone developer to get information about how users are doing with the puzzles from a dashboard. How do I get to the dashboard? Pretty simple so I wonder how I didn’t fall into this earlier. From user settings I can open a dashboard and see some status of how my students are doing.

image

Here is a look at the dashboard for my class (student names removed)

image

We just started on decision structures which is why most of the class hasn’t finished those puzzles. The outlier in the middle is me by the way. Most of the top students have had some previous programming experience. But not all. Some people are just picking things up quickly. Some of the people at the bottom have missed an above average number of school days. I’ll know to spend some time with them one on one to help them catch up.

I’m using the data, especially the number of failed tries, to understand what puzzles are giving students issues. I feel that probably indicates something I could/should teach differently or better. On the other hand, that some of the students have worked their way beyond what we have done is class is encouraging.

Something else I have done this week was to ask the students to all describe one of the puzzles that is giving them problems. I am hoping to learn more about how they think about solving puzzles, what concepts they need to learn or learn better to move forward and what is coming easy. Code Hunt, which students seem to really like using, is helping me get a better understanding about what and how my students are learning. This is pretty exciting to me.

Monday, February 09, 2015

Interesting Links 9 February 2015

I’m back in Redmond WA today. First time in over three years I have been here. I expect it to feel different as a visitor after being hear many times as an employee in the past. My time here this time is with the CodeHunt team for a two day workshop with some university educators. I’ll talk about my use of Code Hunt with my high school students tomorrow. I’m also hoping to learn quite a bit while I’m here. Speaking of learning, here are this week’s interesting links.

The Science Fiction Books That Every Computer Scientist Should Check Out I haven’t read any of those books. I wonder if I should. Anyone have an opinion?

Mentors can be a powerful aid to people getting started in any area. To Get Women Into Computer Science, Sheryl Sandberg Launches Lean In Mentorship Network.

Decision trees and football? Does it get any better? Why the Pass at the End of Super Bowl XLIX was the Right Call  via Communications of the ACM

Microsoft announced that they are increasing their interest in the Internet of Things  (IoT) by delivering Windows 10 support for Raspberry Pi 2. That could open the door for some interesting projects.

School Leaders Mostly Mystified by Computer Science Education An interesting article about the results of some research the CSTA published recently.,

Speaking of CSTA, the winners of the recent CSTA equity competition made the news in their local paper. Mass. Academy students ace international video contest

The Call for Participation for the Grace Hopper Celebration of Women in Computing has opened!

Sunday, February 08, 2015

Recursion – Love it or hate it?

The following was posted to the AP CS Facebook page yesterday with the question "What would the answer be?" Things went along just fine for 3 replies of people giving the answer (0123456) until some troublemaker (who would be me) piped in with "Yet an other example of how AP exams are loaded with poor coding practices". And then it got interesting. Recursion seems to stir up a lot of discussion in CS Education circles.

I would argue that this is a poor example of code practice. It is a good, for some definitions of good, example of both recursion and asking students to trace good. That doesn’t make it a good way to get 0123456 output to the command line. At least not in my opinion. Someone raised on functional programming where recursion is a pretty standard way of doing looping might disagree of course.  I tend to think that:
for (int i = 0; i <= n; i++) System.out.print(i);
is a lot easier to understand however.
There is a saying that when all you have is a hammer all your problems look like nails. This seems, in a way, to be the case with recursion and loops. If your first tool of choice (or what you have learned first) for iteration is loops you tend not to think of recursion as a solution. Similarly if you start with recursion (as is common with functional programming) you are a lot more likely to look at recursion as a tool for iteration. Personally I struggled with recursion in the beginning. I just couldn’t wrap my head around it for a while. Now I find it really interesting and in some cases very useful. But I prefer not to use it for simple iteration. There is extra overhead involved with all that stack use and I’m still thinking in terms of minimizing memory from my early days when memory was expensive.
But getting back to the discussion I started on Facebook. We are often forced to use code examples that are not ideal coding practice. WE do that to make things clear and to demonstrate specific concepts in a sort of isolation that we might not normally use. We seem to do that a lot with recursion because the example that require recursion tend to be fairly complex. For example traversing trees is an application that recursion is particularly good at but trying to teach both trees and recursion at the same time can be complex. An other frequent example if the Towers of Hanoi which has a complexity of its own. The Fibonacci sequence? Probably better than some but you can still solve it without recursion.
We move on to the question of when should recursion be taught. With functional programming it has to be early. We procedural programming it doesn’t have to be taught early but people disagree on if it should be. I don’t teach it in my first course. Part of that is time – its a single semester course and I can’t fit everything in. Also I tend to think that recursion should be taught in conjunction with other CS concepts like stacks and context switching and memory usage. That is a big pill for a first semester course in high school.
Some might argue that this is all an argument for teaching a first course with a Functional language. I’m trying to make my mind up about that. I’m also wondering if the most important thing a first course does is cover all the key concepts beginners need for some definition of all the concepts beginners need OR is the most important thing for them to learn enough to want to learn more?

Tuesday, February 03, 2015

Girls Who Code Is Hiring Paid Teaching Staff

Looks like these opportunities are in New York, Detroit and San Francisco.


Girls Who Code is a national non-profit organization working to close the gender gap in technology. Through our Summer Immersion Program and Girls Who Code Clubs, we're leading the movement to inspire, educate, and equip young women with the computing skills to pursue 21st century opportunities.

Girls Who Code has grown from a single pilot program in 2012 to reaching more than 3,000 girls with high quality computer science by the end of 2014. Backed by the nation's leading technology companies, we are scaling rapidly, hiring across the country, and preparing to enter new markets in 2015.

We are a small, dynamic group of individuals passionate about changing the world. We thrive on working in a collaborative, fast-­paced environment. We represent a diversity of backgrounds, a wealth of experience, and a ton of fun.

Gearing up for a drastically expanded 2015 Summer Immersion Program, national non-profit Girls Who Code is looking to triple its teaching staff across the country! The organization encourages empathetic and enthusiastic women and men with technical backgrounds to APPLY NOW for hundreds of available paid Teacher and Teaching Assistant positions:girlswhocode.com/get-involved

Teaching at Girls Who Code offers individuals the unique opportunity to empower teenage girls with computing skills to change the world while sharpening their own tech skills and making lasting industry connections. Teaching staff will get the opportunity to work at one of the following companies:

Accenture, Adobe, AIG, Akamai, AOL Charitable Foundation, AppNexus, AT&T, BSA | The Software Alliance, eBay, Electronic Arts, Expedia, Facebook, GE, Goldman Sachs, Google, Groupon, IAC, IBM, Intel, Intuit, Lockheed Martin, MassMutual, Microsoft, Moody's, Pixar Animation Studios, Square, The Honest Company, Twitter, Viacom, and Verizon.

Monday, February 02, 2015

Interesting Links 2 February 2015

Happy Groundhog Day! We’re having a snow day with schools closed because of a snow storm. I’m betting on six more weeks of winter. It may take that long for all the snow we’ve had in the last 10 days or so to melt. I’m not complaining though. I like snow. And today I’ll have some time to work on some personal coding projects I’ve been wanting to get to.

Interdisciplinary Computing Blog: Who thinks Computer Science is less relevant than physics? A good question in my somewhat biased opinion.

I saw some interesting discussion on this week’s Twitter chat for K8 computer science sponsored by the K8 Task Force of the CSTA. There will be another chat but here are a couple of interesting links from this week. An archive of tonight's chat on Coding Lessons with 5-7 year olds has been posted at https://plus.google.com/114810523265094113657/posts/LF7ZTnm24Lo

Beginner languages – the usual infinite loop and interesting take on the subject by Garth Flint

ANYBODY CAN LEARN — With education moving online, do we even need teachers anymore?… YES!   from @codeorg Some interesting data that reinforces the value of a real in person teacher.

I found a pair of interesting examples of code solutions for common technical interview questions. Maybe there are some projects here for students?