Welcome to MSDN Blogs Sign in | Join | Help

Code For Decoding Codes – A Programming Project Discussion

I love to collect fun coding projects. I like short, easy to understand projects that get students to use a number of things (language constructs, programming concepts) in interesting ways that take advantage of what computers do best – simple but tedious tasks. If the task helps students to internalize some basic foundational understanding of how computing works that’s all the best. I look for projects that give we things to discuss with the students.

One of my favorite early coding projects was counting letters. I did this first in my very first programming course taken about 35 years ago. It was written in FORTRAN of course and read the data in from punch cards. It was the basic read in some data text and report back how many times each letter was used. For bonus points count words and sentences. Oh boy! Lots of fun. Well for someone who was (and still is) very excited about making computers do things it was fun. But useful? Not so much.

Recently though I found an expansion of that simple project that I think has a higher, wider level of interest. Lots of kids play with codes; usually simple substitutions or letter mapping. Offsetting a letter by some distance (a’s become c’s for example) is pretty common. Back in the old days of the Internet we used something called ROT-13 to hide spoilers and “adult language.” So how can we use that to make a project that hopefully will seem relevant and interesting to high school students? I think I found the answer.

This project description comes for the informational page for the CTCSTA Programming Contest and held at St. Mary-St. Joseph School (Willimantic, CT) later this month. As an aside, if you are in that area it looks like they have room for more teams.

Any one-to-one mapping, f, of any alphabet to itself can be used to encode text by replacing each occurrence of any letter, c, with f(c). One such mapping could be the mapping of a letter to three positions beyond the letter in the alphabet. That is, a --d, b --e, c-- f, d --g and so on. With this mapping, “The car is blue.” Will be encoded as “Wkh fdu lv eoxh.” Now suppose we do not know by how much the characters have been shifted. One possibility is to scan the text and build a frequency table (a histogram) of all the alphabetic characters. For the purposes of building the frequency table, we shall consider lower case and upper case characters to be equivalent. After building the table, we can find out the most frequently occurring character. From analysis of large numbers of English texts, it has been found that the character ‘e’ is the most frequently occurring character.

For example, suppose we find the character ‘g’ to be the most frequent character in the given encoded text. Then we conclude that the document was shifted by 2.

Write a program that decodes the content of the given input and outputs the decoded text.

There are lots of ways to identify and count letters of course. The brut force way is to have 26 (or more if you haven’t discovered how to upper case or lower case text before comparing) IF statements that do text compares. Yuck! Boring and tedious. So most people take advantage of the fact that text is stored as an ASCII value and that one can do mathematical operations on a character. This mean a programmer can make a more general purpose compare statement and use a numeric value as an index to an array. Cool – we’ve got arrays and ASCII in the project now. What next?

Ah, bounds checking! What happens when one adds to a “z” or subtracts from an “a” while doing our rotation? So now we have bounds/range checking and the introduction to a circular list. Even better. This is a step up from a basic letter counting routine. Plus for fun we are solving a puzzle (how much is the data rotated?) and we are decoding a coded message. Counting letters with a purpose!

Now if we want to get all “mathy” (as Steven Colbert might say just to add a cultural reference to my post) we can also ask students to report all sorts of statistics on the letters they count. Once they realize how easily they can do all sorts of other things inside a loop this becomes easy and they can amaze themselves with how much they can do in how little time.

We can also have some other interesting discussions though. What do we do if two or more letters are tied for the most occurrences? Do we translate several ways and let a person pick the right on? Or can we automate the process and check words against a word database to see which translation works?

And what about program design? Can we create standard routines for rotating letters that we can use and reuse for both coding and decoding message? How much of the code that we create belongs in small easy to test routines? Are their features in the language or libraries that make our life more easy? Or do we have to invent a lot of new code? If students know multiple languages is this program easier or harder in specific languages? (Think about different ways to convert from a character to a number value and breaking up strings into characters for example.)

Learning How to Create Games With Popfly

I recently rediscovered the Popfly wiki. The Popfly wiki is a strong and growing community effort to help people get the most out of the Popfly environment. (More on what I have written about Popfly here.) At the Popfly wiki one will find information on the various blocks that are available for creating mashups, tutorials and videos, and all sorts of other information about Popfly.

What brought me back to the wiki last week was a set of videos on the new Popfly Game Creator.  The Popfly Game Creator is the newest feature (joining the mashup and web page creation tools) being added to Popfly. It’s in beta but already a lot of fun. If you are interested in creating some simple games check out the videos and see how simple it can be. Oh and if you create some games let me know about it. I’d really like to see some out of the box thinking on some new games. Perhaps even something educational?

Speaking of tutorials, I see that my friend Dan Waters also posted his own how to video last night. Go here to see his demo of creating a Popfly Game from scratch.

Getting Started Tutorials for Zune Game Development

Well it hasn’t taken long for more people to jump on the XNA 3.0 Community Technical Preview that was announced last week. Sam Stokes has a blog post showing the step by step that one needs to take to get the software installed and ready to run. He’s got a lot of screen captures to really make it clear what is going on.

Dan Waters who has cranked out a number of previous helpful videos and code samples does it again with his latest work. Here Dan posts a video introduction to creating a game for the Zune. The video can be downloaded as can the sample code that he uses in the demo itself. This may be a good way to jump start your own experimentation with programming games for the Zune.

BTW if you are interested in seeing what high school students are doing in the way of creating XNA games, Brian Scarbeau has been posting video of his student’s work on his blog. It’s interesting to watch as they implement games in their own image as they test out the programming and game development knowledge that they have been learning this semester. It will be interesting to watch what they create as time goes on and their programming knowledge increases.

Lastly, don't forget that the online forums for XNA are a great resource for getting questions answered and problems solved. I see discussion on programming for Zune devices there already.

Search Commands For Office

The Internet and blogging are wonderful things. Yesterday I blogged about a set of tools for helping people find the Office 2007 location for commands based on where they were in Office 2003. And then later in the day several people who read that post sent me links to the Search Commands add-on from Microsoft Office Labs. And someone else left a comment as well. Amazing how helpful people are. I learn a lot from the people who read my blog and comment.

These tools are a little different. The first tool is basically a sort of translator. in other words someone clicks on an item on the “old” menu setup and the tool explains where to find it on the new “ribbon” interface. This, I think, is ideal for someone who wants to learn the new locations in an organized way. For a teacher or other trainer who is about to teach people from scratch (or close to it) this works great.

The Search Command tool is sort of an additional built-in help. Selecting the tab for Search Commands opens a new ribbon strip with a search box. Enter a search string (in the example below I was looking for font related options) and the tool provides a set of relevant icons.

image

These icons are “live” and can be used right there. Of course now that you know what you are looking for finding them again will probably be a lot easier. I expect to use this feature a lot for a while.

Where On the Ribbon Is That Office Feature?

I’ve talked to a number of teachers recently who teach the Office Suite as part of a computer applications courses lately. A good number of them are preparing to update their courses to Office 2007 for next school year. That means some preparation time over the summer.

The biggest change that Office 2007 brought was the ribbon interface. Now the design goal, which honestly I think was successful, was to make many features more easy to find. The problem is that for many of us who are creatures of habit change does not come so easy. We’re used to some things always being in the same place. So while the new ribbon may make things easier for beginners it makes some things feel harder for us experienced (better work than older right?) users.

For some of us, and trust me I include myself, finding features we know and love can be a bit, well, less comfortable than we’d like. Ah but there is hope. My friend Edwin found a really great resource for people like me – and perhaps you. (See Edwin’s more detailed explanation here. He’s got pictures and everything.)

The Office team has created a set of interactive guides for the various products in Office. The way they work is to bring up an Office 2003 menu that lets you select an option. A display window then explains where to find the same or equivalent feature in Office 2007. It’s as simple as that. use it to find all your favorites or just that one feature that just can’t seem to be found the way your idea of intuitive works.

These can be run online or downloaded for use locally. For classroom use the download may be a good idea. In fact if I were doing tech support at a school that was upgrading I’d make sure all my teacher systems and general use systems (library for example)  had it and that all the teachers knew about it.

XNA For Zune Game Development Now In Beta

The XNA team has announced that the Community Technical Preview of XNA GSE 3.0 is now available. The big news in this is that now it is possible to develop games for the Zune. So yes, now a handheld device that will play XNA based games. Check out the official announcement here for the details on what, where, when and how. Hey, just in time for something new for after the AP CS exam. :-)

In related news, there is a demo of developing for the Zune on Channel 9 as well. Take a look here.

Edit: More Zune XNA links at http://blogs.msdn.com/alfredth/archive/2008/05/13/getting-started-tutorials-for-zune-game-development.aspx

K-12 Computer Science Research Project

Note: I first published this back in July when most teachers were on vacation and I think didn't see this. I do believe this is a valuable research project and since they are still looking for some more responses I agreed to bring it up again. If you are a person who teaches computer science in K-12 and haven't participated yet please do. If you know other teachers who might be willing to participate then please pass this along. If you are an AP CS teacher do it to take your mind off your students who are taking the exam. :-)

Thanks, Alfred

One of the problems the whole field of computer science education faces is a lack of good data. Data on a lot of various subjects. Lack of data makes it hard to understand what is going on and how computer science is taught. And in fact there is a lack of information about why students should study computer science.

There is a survey of software development tools and programming languages that are being used it actually teach computer science in K-12 being done. This project is being run out of Drexel University and has the support of the Computer Science Teachers Association.

We would like your help with a survey on the subject of K-12 teachers or administrators who use software development tools/programming languages. We wish to gain a better understanding of activities, challenges, and needs in this area. We seek your assistance because your teaching background and experience in software development/programming will provide us with invaluable information about this topic. To access the survey, visit https://websurveyor.net/wsb.dll/32487/TeacherSurvey.htm. Participation is anonymous and voluntary and should take about 20 minutes of your time. If you have any questions about the survey, e-mail your questions to wanda.m.kunkle@drexel.edu.

If you are teaching using software development tools and programming languages in K-12 please participate in this survey.

Popfly Game Creator

It’s no secret that I am a big fan of Popfly – especially lately as I’ve been writing a lot about it. But late last week the Popfly team added something really new – Popfly Game Creator.

John Montgomery who runs the group responsible for Popfly does a much better job of explaining what this is about (complete with screen shots) on his blog. But for starters it is a simple online tool for creating games with a minimum of code. Lots of easy to use graphics and pre-defined actions. For getting the basics of creating games this looks like just the thing.

Adam Nathan who is a member of the team that created Popfly Game Creator writes about the tool on his blog. There he talks about what went into developing the tool and also links to two different videos about how to use the product. So if you want to see how a game is created or a montage of the sample games (which require very little code) then his blog is the place to start.

John Montgomery also answers the question “Why did we create a game creator?" on his blog. The short answer – turning consumers into producers. And isn’t that a real goal in education as well?

Watching Students Grow Up

I have to say that I feel very fortunate that so many of my former students still keep in touch. A lot of them have “friended” me in Facebook. Others regularly instant message or email me. Now 5 years (as of June 2nd actually) since I started working for Microsoft and left the full-time classroom a lot of my high school students have graduated college and moved into professional careers. They all seemed to have done well. Though honestly they have not all taken traditional paths.

One of them is a blacksmith now. Not exactly a high tech career but he seems happy and that is what really matters. One is teaching in Japan – not something I would have expected. A couple have not completed a college degree but have taken their talents, knowledge and skills more directly into industry. Others have gone on to graduate school or finished their undergraduate degree in more than 4 (or 5) years. I can’t say that I am any more or less proud of any of them regardless of their paths. As long as they are happy and have chosen the paths they followed its all good.

I heard from one of my students today. He is traveling to Redmond WA where he will start an internship at Microsoft this week. That’s pretty cool. He’s a smart guy and I have little doubt that he will do well. From what I have heard from him over that last several years he has learned quite a bit in college. I expect he’ll learn a lot this summer as well though.

The personal growth is the most exciting thing to watch. Seeing these bright young people grow into successful independent adults is pretty darn cool. That is why I really appreciate the students who keep in touch.

Posted by Alfred Thompson | 0 Comments
Filed under: ,

Top Posts For April

To be honest I am writing this a little early because I am on vacation today. So it is possible that one of the posts from this week should be in this list but isn’t.  But I think it is safe to say that some of the early posts in April were the big conversation pieces of the month.

The post with the most comments was the one about the College Board deciding to discontinue one of the two Advanced Placement Computer Science exams. This is a huge issue in the high school (AP CS) world and it is still being talked about by teachers.

The post where I asked if there was a future for high school computer science also had a lot of comments and received a huge amount of traffic. Not surprisingly my audience believes that there should be a future but there is not a single view of what that future should be or what it should include.

Popfly was one of the themes of my month in April. I had three posts where it came up. First was my trip to Bentley College to sit in on an IT 101 class where Popfly is one of the Web 2.0 tools being used. Then there was the hands on lab I posted that steps one though creating a simple (hopefully fun) mashup. And thirdly my trip report from Summit NJ where I used the lab.

BTW I had a great Twitter experience with that hands on lab. Once I finished the first draft of the exercise I Twitter that I had it and needed someone to sanity check it for me. With in a short period of time three teachers had Twittered back, received a copy via email and replied with suggestions for improvement. Thanks to Mari Hobkirk, Kathleen Weaver, and Mark Frydenberg my directions were vastly better than then would otherwise have been and I thank them.

The last widely read post was on the need to teach security to students. That is a drum I beat pretty regularly and it always seems to get some attention.  There were a number of great comments on that post as well.

Were there any posts you found particularly useful? Or do you have suggestions for things I should write about, search for more resources about or anything else you want to suggest as ways I can make this blog more useful please either leave a comment or send me an email at AlfredTh (at) Microsoft.com. Thanks!

How is a Classroom Like a Pizza Place

I grew up in New York (Brooklyn actually) and like many New Yorkers I have a distinct bias toward New York pizzas. So a blog post by Leigh Ann Sudol that started off with “So from a link by Coby Loup over at the Fordham Foundation on their new blog Flypaper here’s an article about why NYC pizza is better than anywhere else.” got my attention. The rest of the post as pretty insightful. Not surprising as Leigh Ann is one really smart person whose mind is always running faster than most people (especially me) can keep up with.

So what does she write about? Replication. In more words, what is it that makes teachers in general and CS teachers in particular successful and how can we replicate that to help other teachers.

I get to visit a lot of great teachers in their classrooms. These are teachers whose students are doing just amazing things – things that people don’t realize high school students are even capable of doing. When I return and talk to other people the first question if get is “can we replicate that with other teachers?” And the honest answer all too often is “probably not.”

So much of the success the best teachers have is a complicated mix of things many of which are not easy to replicate. Most people think the top item is huge technical skills and knowledge. But that is not always the case. Some of the best teachers have students who go far beyond them in some number of specific areas.

I think the most important thing a successful teacher does, and Leigh Ann talks about this, is a culture for success. The best teachers are not afraid to admit lack of knowledge, of changing projects or even creating them on the spot as a reaction to events in class, and the create an environment where students feel comfortable during and after class.

Leigh Ann asksHow do we help fledgling or failing computer science programs grow?” so if you have some suggestions drop over to her blog and leave them there. Me? I think the way to do it is mentorship.

When I first started teaching I was working with another HS CS teacher. She was a great teacher and her students loved her even though she worked them very hard. She created an environment that worked. I was able to merge into it, learn it, and make it my own in many ways. Later she left and I hired a new teacher. He and I worked together for a couple of years and together we built on the existing foundation. Frankly I think in many ways he has become a better teacher than I was. But part of that was having a good culture to start with.

Of course for many schools there is one computer teacher and no one to help them learn or create a culture when they arrive. It’s hard to figure out what was there before one came or how to move things in the direction they want it to go. It’s tough. I do think that we need more opportunities for computer science teachers to share ideas and connect with each other. Conferences like NECC and TCEA help some. Education events like the CS & IT Symposium are great as well. So are summer workshops. But far too many people do not have the money or the motivation to attend these. Often they just don’t know what they are missing. Perhaps more online activities (blogs, Twitter, virtual conferences) and the Computer Science Teachers Association can help over time. But we have a way to go.

One thing that is is easy to forget about is a supportive tech support and supportive administration. Though honestly often an administration that is happy with benign neglect is often a start in the right direction. :-)

Best Practices: Designing Mobile Applications

These days mobile devices are everywhere. One of the cool things about Windows Mobile devices (Smartphones and Pocket PCs among others) is that they can be programmed fairly easily using Visual Studio. Built in simulators allow for quick debugging without the need for an actual physical device. The big difference between programming for a mobile device and a standard PC though may just be the user interface design.  The screen size is one obviously piece of that but there is also the differences in input – small keyboards, styluses, and no mice.

Recently Hilary Pike presented on the subject of mobile application design and then wrote about it on her blog. She posted her slide deck as well. I learned a lot from the blog post and associated deck.

I know a number of teachers who have their students create mobile applications after the AP CS exam (coming up on May 5th this year I think) for something different. This deck and blog post may be very useful if you are one of those. Or honestly for anyone thinking about creating their own mobile applications.

Oh and before I forget, Hilary also posted a bunch of links to sample Mobile applications here.

Pitching Your Idea - An Interview About Presentations

Perry Lowe, a marketing professor at Bentley College and Philip DesAutels, were at the recent US Imagine Cup finals giving some presentations to the competitors. They were talking to the teams about making presentations about new ideas to venture capital companies specifically but with points that are really about all kinds of presentations to convince. Clint Rutkas interviewed them and the interview is now up at Channel 8.

I think that a lot of people, especially the young and creative, like the idea of starting their own company, getting some funding, and creating the next big thing. This interview gives one a taste of what to do and why some work and many fail. Also at this link are links to the PowerPoint decks that Perry and Philip used for their presentations.

I should mention that Philip has an amazing background with both large companies (Microsoft & IBM) and a bunch of Internet startups, the W3C and even setting up Internet operations in Uzbekistan with the Peace Corps. He knows startups and he knows presentations. Though just between you and me, I think his slides, while they have a ton of great information, have too many words on them :-)

Check out the interview and look for the link to their presentation decks.

Trip Report – Summit (NJ) Schools

Last week I took a trip down to Summit High School to take part in a teacher workshop day. There were about 200 teachers from the high school and middle school there. The day was dedicated to new media with a bunch of workshops on blogging, wikis, Skype and other Web 2.0 tools. most of the workshops were given by teachers in the district based on what they are already actually doing. That alone was impressive but the level of support from the district administration was perhaps even more so.

A lot of districts seem to put up barriers to adopting new technologies that involve too much use of the Internet. Oh sure they adopt search engines easily. And they are starting to allow access to some web based applications but active encouragement? Well that seems to be a little more rare. It exists of course and we are starting to see people like Will Richardson, Dave Warlick and Vicki Davis join real pioneers like Kathy Schrock doing in service training events around the country. But to me real success is when a district can use a lot of home grown talent to do the training of other teachers.

The highlight of the day for me, besides meeting the very supportive superintendent of schools and talking to teachers, was the keynote by Jim Cramer. Yes, that Jim Cramer of Mad Money fame. His kids go to the public schools in Summit and he supports the district with his time and money. I have to respect him even more for the time than the money. It’s easy to give money when you have it but no one has enough time. The keynote was pre-recorded because getting there during the afternoon was not practical but it was clear that a lot of time and effort went in to preparing and recording the  talk. I wish it was available online so that others could hear it. Maybe that will happen.

His keynote was about the importance of media education. Creating media for sure but even more important in his mind was the training to evaluate media. What’s good information and what’s bad? How do you know which is which? It was so encouraging for someone in the media to emphasize that the media should not blindly be taken at face value. Clearly the ability to create and evaluate media are necessary skills for the future. Actually as Cramer pointed out they’re already pretty important.

FWIW I talked about Popfly as one example of a mashup tool to synergize data and make it more interesting. It seemed to go well and the teachers were very attentive, asked great questions and stayed awake. :-) I posted my handout last week BTW. They’ve all got Macs in that district and Popfly seemed to work just fine on the Mac books that a number of teachers were using to follow along with. They had to use Firefox though as support for Safari is “coming.”

Oh one more thing I have to say publicly. The tech support person at Summit was absolutely wonderful. I complain a lot about tech support (mostly echoing complaints I hear from teachers) so I need to point out the good when I see it. In this case the tech support person went out of his way to make sure that the web sites I needed were going to be available for my presentation. He specifically white listed at least one page that was wrongly categorized as well. He got me connected to the building wi-fi in seconds, double checked that my dry run went smoothly and basically did everything a guest speaker could possibly have needed. With tech support like that it is no wonder that Summit is reaching boldly into the next generation of online tools in education.

RoboChamps – Online, Virtual Robot Competition

Most robotic competitions are fairly expensive to enter. The hardware is expensive, hard to assemble and tends to break at the worst possible times. They are lots of fun for hardware geeks but not as much fun for software geeks. RoboChamps is different – RoboChamps is mostly about the software!

The idea is that there are different challenges modeled in a simulator. Participants have simulated robots to program to solve the challenge. The prizes (there have to be prizes) include actual physical robots. From the RoboChamps home page:

RoboChamps consist of a series of challenges. Each challenge comes with a 3-D simulation environment, a robot, a challenge scenario, and the rules for completing the scenario. From there, it’s up to your creativity and coding skills. Using .NET, code your robot to complete the challenge successfully, and submit an entry to the RoboChamps League. A referee service will be running to make sure the rules are being followed, determine your score and send it back to RoboChamps.com.

Max interviews one of the people behind RoboChamps on Channel 8. It sounds like a lot of fun. One of the things they demo is how one will be able to watch robot runs in the simulator and see things from different angles and locations.

The official rules limit competitors to people 18 and over so it might be something interesting for HS seniors to try as they finish up the school year. But I think it would be interesting for others to try as a place to show of their skills. The software is all free anyway!

More Posts Next page »
 
Page view tracker