Silly little programs

August 8, 2014

Yup, binary to decimal was easy.  Play with the algorithm, do a little pseudocode, poke at the code a little to figure out the Python syntax (reference manual!), debug a little and poof, it works.

  1. binary = input(“Enter a binary number.”)
  2. lenBinary = len(binary)
  3. dec = 0
  4. for i in range(lenBinary):                               #Go through the length of the binary number.
  5.     if binary[lenBinary-(i+1)] == “1”:           #Go from right to left checking if the value is a “1”.
  6.         dec = dec + 2**i                                         #If a “1” convert to base 10 and add it up.
  7. print(“The decimal equivalent of “, binary,” base 2 is “, dec, ” base 10.”)

Undoubtedly the Python whizzes out there can snipe the heck out of it with syntax short cuts but this is what the kids will build initially.  I do very few short cuts because they are often language specific. Of course now that I look at my code I think I can redo that range parameter to do some of what that if statement is doing…

There are some things in Python that really throw me off.  I guess the biggest is the range object in the for statement.  I keep forgetting the range is one less than the value.  Of course I take a few minutes to remember that little detail.  Like I said too many languages.

A comment to my last post by Bri Morrison suggested looking at Roman numeral conversions.  I hate it when people make project suggestions like that.  Especially good suggestions like that.  Now I am going to sit and stare at the ceiling and have to figure out how to do it.  As though I did not have enough things to stare at the ceiling about.  So now, Roman numerals have no place value and a smaller value to the left of a bigger value means subtract…hmmm.  What a strange way to have fun.  Thank God I like to mountain bike and snowboard because otherwise I would live in front of this stupid computer.

Always a new idea for a project

August 7, 2014

The Good Idea Fairy strikes again.  For my Java based advanced course this coming year I want to do a lot of non-coding topics.  One topic is understanding bases.  The binary and hex bases are kind of handy to understand in the field of computer science.  I introduced binary and hex last semester so in my infinite wisdom I thought I will have the kids write a program to do the conversions.  I like projects like this.  I could do the usual conversion worksheet but did that and they were bored with that.  For someone familiar with bases and base conversions it is a bit trivial.  The emphasis of this project is on algorithm development and not on typing code.  After a few minutes of doodling (that PLC training was a bit boring) I think it looks like the binary to decimal program is going to be simple to develop.  I think the kids can work that one up with very little coaxing.  Decimal to binary does not look so sweet.  It is going to take a bit more staring at the ceiling.  These are the projects I love to teach with; lots of thinking about the problem, understanding the algorithm, devolving the algorithm into some form of pseudo-code and then a little coding.  These projects play to my strength in CS, thinking and staring at the ceiling.  They also do not bring a lot of pressure on my CS weakness, coding.

I suck at coding.  For some reason I cannot remember syntax to save my life.  I think I have too many languages in my little brain.  If I do not have the language reference manual next to me while coding something I am doomed.  (One reason I love Small Basic.  Intellisense, I love you!)  This does not bother me too much.  When I worked for a software company many years ago the wiz bang programmer dude in the next cubical had a really thick VB reference book right by his hand.  He knew what he was doing and he still had to use it.  So thinking projects it is and a handy reference book.

When I teach a language the first thing I give the kids is the location of a readable language reference manual.  I expect them to use it.  I expect them to use it a lot.  I teach them how to read it.  I do not teach them a lot of syntax, at least not through lecture using my broad knowledge of syntax.  To facilitate this reading of manuals I have the kids hook up a second monitor to their laptops.  This is almost a necessity when using on-line references.  All my programming kids have a laptop, either their own or a school owned loaner so the second monitor is not a big issue.

For this bases conversion program I will initially have them do it in Python.  I foresee the program needing some string manipulating.  Reference book!  I know what I want is in there somewhere because I remember reading it but I cannot do it by memory if my life depended on it.  I even did the book exercises and I cannot remember what I used to do what I did.  I will then have them try it in Java.  Having done the project in Python they will have the algorithm figured out so all they will have to struggle with is the language.

I am not a great coder and I am not a great snowboarder but I have a blast doing both.  When I teach someone how to snowboard they can get down the mountain with a little style but they are definitely not ready for a freestyle contest.  The same with programming.  I am not training kids to be professional programmers, I am teaching kids to think and learn.  I think my plan is working.

I had better get to work on these conversion programs.  Sometime the Good Idea Fairy is not nice and bites me in the rear.


Are we doomed to be a 3rd world country tech-wise?

August 6, 2014

Connected to those on-line courses I am taking is a conversational network as part of the course.  One of the assignments was to talk briefly about ourselves and our reason for signing up for the course.  There were several teachers that wrote something similar to this.

“Our grade school and middle school has little to no computing. We have had difficulty getting keyboarding taught below high school level. This is a great concern to me since our students will need to take tests on the computer or a tablet starting next year. The younger students need to have the ability to type on a keyboard so that they can show what they really know.

 Our Kindergarten through third graders usually use the computer to reinforce math and reading using programs and games. Our third through eighth graders are supposed to have some keyboarding instruction each year. However, I teach all freshmen a required course of one semester of Keyboarding and one semester of Computer Concepts. Most of these students come into my class with little or no instruction in keyboarding. Unfortunately, that means I need to break bad keyboarding habits. This is very difficult to do. The Computer Concepts class includes basics of Word, Excel, PowerPoint, Publisher, and PhotoStory.  I am very glad to have the opportunity to teach all freshmen this required course. I know many schools do not have this as a required course.  It’s vitally important to give our students an opportunity to learn Microsoft programs that they will use throughout high school.

 I would like to offer computer programming as enrichment to my high school students. It is difficult to find the time to do this, though, with all the other requirements for each class. “

The scary part is I bet many public schools in the US are like this.  Do schools like this actually believe they are preparing their students for the future?  Why is it teachers like this have to fight uphill for change by building enrichment courses on their own time?  The administration should recognize their curriculum is 40 years out of date and be demanding teachers instigate computer education into the curriculum, K-12.

In this same direction one of the senior tech at one of the smaller local schools quit last week and found a new job immediately with a larger school.  He quit because the school board he worked for was convinced pencil and paper was as efficient as a computer.  Board members also would not bother to learn to use Drop Box for board business.  The board told the principal that he was “too enthusiastic about technology and no longer fit in with the goals of the school”.

Could these instances be exceptions?  From what I read and see around me I do not think it is.  It is stories like this that make me fear that the US is going to fall behind nations that have accepted technology and CS education.

Summer is winding down

August 4, 2014

The summer is drawing to a close.  In three weeks school starts up.  As usual I did not get all I needed done done.  I am used to it so no panic.  The IT stuff is done, the classrooms are ready for students and teachers, everything is working the way it should, laptops are ready to check-out to students if they need them and the network is up.  My new Java course is not doing so well.  My fault for prioritizing the IT stuff but more relies on that than the Java course.  I have a syllabus, a text and a plan, just not much practice with the IDE or the language.  I have a year to do a semester course so I am not bothered.  I want to do a lot more than programming in the course so I will have the time to get ahead of the kids.

I am back to teaching Stats this coming year.  The school did a little curriculum changing so the Stats course is now an honors course.  Previously it was designed for all seniors not interested in going the calculus direction.  We will now offer three courses for seniors, one standard track and two upper level courses that offer college credit.  The Stats course previously offered college credit but had such a mix of abilities that it had to be very tempered.  The new course will allow me to increase depth and breadth.

I signed up for three on-line courses this summer.  One presented by the U of Alabama was on the new APCS Principles course; the other two are a Java course and a hardware course by the U of West Virginia.  I took these for my own benefit and out of curiosity to see what a MOOC like.  I now know and will not do that again.  The APCSP course started interesting then did exactly what most CS courses turn into, a programming course.  Here is the language (Snap!) and basically how it works, now write a program in it.  Absolutely nothing on how to actually build a program (as opposed to typing code).  The course was supposed to be for all comers, teachers with little coding experience all the way to long time programming teachers.  I cannot see how a beginner would get the idea that designing the program is more important than typing code.  Sort of my pet peeve.   Snap! also had some issues.  Not a good thing for beginners.  The two by UWV were just confusing.  Not the material but the internet implementation.  This is not a good mode for education.  Better than nothing?  Yes, but barely.  I guess I am just an old time traditionalist.  I like to ask my instructors questions when the question comes to me.

Next week I am attending a two day Professional Learning Community at Work Institute.  The in-service starts at 6:30 in the morning.  Eek.  Done by 2 is the plus.  This PLC seems to be the latest catchy thing to add to a teacher’s load.  I have talked to a number of teachers that have been through the training, among them my wife, and they are not too impressed.  I have to keep a positive attitude or this could be a bad two days.  I do not do well at these “good idea” seminars as it is.  I have been doing a little internet research to find out what PLC is all about.  It looks like something the Chinese and Japanese have been doing for about 40 years or more.  Of course the Chinese and Japanese fund and support their education system a bit differently than we do in the US.

As usual I am looking forward to school starting.  It is the best job I have ever had.  I like kids, I like working with educated people, I like learning, and nobody is shooting at me or trying to blow me up.  All a plus.

Summer fun

July 13, 2014

It is July.  I am not supposed to work in July.  So far I have not been in school for 3 days in July.  (The wife and I took a short road trip in the convertible.)  New laptops to setup, servers to upgrade, strange network cables to track down and label, software to upgrade and so on.  Some of these cannot be done while school is in session or while the building is busy.  So I work in July.  That is actually OK with me.  If I took the month off I would blow money like nobody’s business.  Of course I do not work hard; after all I am not supposed to work in July.

Next week I have to move the school’s QuickBooks to a new server.  I know nothing about QB and if I make a booboo it would be bad.  Hopefully QB has English speaking support.  Should be fun.

It is interesting the breadth of knowledge a school IT guy should know for the job.  Networking, software of all types, server installation and maintenance, computer repair, wireless issues, domain controller and group policy stuff, purchasing of all the above, and so on.  Too bad I do not have that breadth of knowledge.  That is what I love about this job.  There is always something new to learn and figure out.

This job has changed my teaching style.  My students always complain that I do not show them how to do things; I make them learn it themselves, they have to read the book (OMG!), dig around on the internet and perhaps do some trial and error fiddling around.  In CS it seems it is more important to be able to learn quickly than it is to have a huge knowledge base.  The field is too big and changes too fast to not be able to learn quickly.  Teaching kids how to learn is a lot more work than lecture and regurgitate.   The average kid is not too crazy about it either; they will always take the easy way.

Block Code Languages Work

June 26, 2014

To block code, or to not block code, that is the question.  Whether ‘tis nobler of the mind to suffer the slings and arrows of outrageous block coding or to take arms against a sea of block coding languages and by opposing end them?

It kind of breaks down after that thank goodness.

In this on-line APCS-Principles class I am taking they are using Snap!, a version of Scratch.  This has stimulated some conversation in regards to the viability of block (or drag-and-drop) languages (Scratch, Alice, Snap!, Kodu, App Inventor, Mindstorms NXT-G, etc) as teaching languages.  Alfred Thompson has also written in his blog lately about the subject.  I have taught using block code languages pretty much for as long as they have been around.  They have a purpose and are great for that purpose.  Many purists poo-poo these languages because they have no real world uses; they are not what the commercial world uses.  This is education, not the commercial or real world.  There are a lot of things used for education that have no real world applications.  They are just stepping stones.

We as teachers do have to be very careful when using block languages.  They are a teaching tool.  If all we taught was a block code language and ended it there I believe this would be comparable to having drivers ed kids do nothing but the simulator and assume they therefore know how to drive.  There are block code languages that are for real world applications.  I understand some of the commercial robotics languages are block code so non-coders can program industrial robots.  We need to at least show kids a typical line code language before they escape high school.  In my Frosh/Soph Programming I we spend most of the semester in Scratch and Small Basic but the last few weeks we dabble in VB.  Build a form and make a button on the form do something.  Just enough to see what a grown-up IDE and language is all about.  (Part of this lesson is actually installing VB on the computer.  Installing software is one of those topics that seems to be overlooked in most school syllabi due to restrictions on student access to school computers.  That is what a temporary admin account is all about.)

For beginners block coding is fun and having fun is what teachers want in an introductory elective.  (No fun, no students.  No students, no elective.)  They do not have to remember some strange syntax, everything they can use is listed right there on the screen.  Dig around a little bit through the options on the left and maybe read (OMG!) a tiny bit of a help file and they are off building the next great computer game.  We are not building coders here, we are introducing a thinking style and some fundamental concepts – sequence, conditional and iteration.  Throw in some Boolean operations (and the word “Boolean”) for good measure and we have the start of a real programming class.

Block code languages are like an introductory drug, it may be enough to get some kids interested in hanging around for the “hard” stuff.  So what if that is all they want to learn?  It is the concepts behind programming that are the learning target here.  Most kids are only going to take that one semester of CS/programming and for most that is all they are going to need.  Teaching a block language gives time to teach a lot of non-programing CS content that a “professional” language course would not have time to cover.

Some block code languages I like (Scratch, Kodu), some not so much (Alice, NXT-G).  For the right teacher in the right class they all do the right job.

Beer and cheesecake win every time

June 23, 2014

Kids have been gone two weeks now and I am already starting to fall behind.  I have an eleven month contract because I work on the school computers in the summer.  All the things kids have managed to do to the computers during the school year I now have time to fix.  It is truly amazing what they can do to a computer that I have no idea how they did it.  We do long term loans of laptops to students.  When I get those back I have to reformat them completely.  If I was clever I would find some free imaging software that is actually understandable.  No luck so far.  No big deal.  I have 10 Win7 DVDs so I just get a bunch cranking at the same time.  It just takes time.

I have been working on a University of Alabama on-line APCS-Principals course.  The course is intended for teachers that want to see what it is all about.  Very interesting.  I really like the idea behind the course, less programming, more CS.  The course is really useful for me in that there is a large number of teachers on the course’s blog.  A good chance to talk to peers and get ideas.  There is quite a cross section of attendees.  All the way from people who do not really understand the binary number system and are intimidated by Scratch to people who have whole APCS courses built and have been teaching it for many years.

I got my first motorcycle trip for the year in.  Four days in the saddle to Oregon.  We were planning on about an 1800 mile trip but only did about 1400 miles.  Two days of rain slowed us down.  We even hit snow on one of the passes in Oregon.  Snow is a bad thing on a motorcycle.  We got as far as Bend and came home.  It was still a great trip.  Lots of little back roads with lots of sharp corners.  Found some excellent micro brews and good food.  No speeding tickets.  That is one of the advantages of riding with a friend who is on a Harley-Davidson.  I have to slow down and wait a lot.  He did get pulled over with only a warning.  Chuckle.  Someday I really have to sell the high speed sport-tourer I ride and get something more suitable to my age and hand-and-eye coordination.  But there is just something about 145 mph.

I did a mountain bike race last week.  I had not raced in years so I figured it was time for self-humiliation again.  Got second in my class.  Of course there were only 3 people in my class but whatever.  Most people my age know better and have switched to golf.  The guy that got first in my class was competitive with the young guys.  I passed him on the first downhill then he just disappeared on the climb.  The race was a series of loops.  The experts did two big loops, about 12 miles per loop.  The sports (me) did the big loop and then part of the big loop, about 17 miles total.  To give an idea of how fast the experts are the overall winner lapped me twice.  He was not sweating either time.  All the other experts only lapped me once.  I almost killed myself trying to not get lapped by the second place.  It is the little successes in life that count.  I can pretty much smoke everyone on the downhills (no brains) but the uphills are where races are won and I do not go up very well.  If I cut out beer and cheesecake I could go up faster.  I like beer and cheesecake better than racing.  It was a fun day.

How expensive are good teachers?

June 3, 2014

I got in a fun discussion with some of the school techs across the State today.  A tech job opened up at one of the big school districts (5000+ K-12).  The salary is $80,000.  I commented that seems excessive considering highest teacher salary for the district was $10,000 lower.  One of the smarter techs pointed out the 9 month versus 12 month detail.  OK, so $80,000 is in the neighborhood if a senior teacher was paid for 12 months.  I can let that go.  The argument that came up that did not make sense was that a tech for this position has to be highly qualified and that to attract personnel of this caliber requires a good salary.  With very little thought that implies teachers do not need to be highly qualified or high salaries are not needed to attract good teachers?   Something wrong there.

Could this be one of the issues with US education in that it is more important to attract good administration personnel than to attract good teachers?  In my mind it is important that both be good to ensure a good school.

Computer Science in Montana Schools

May 27, 2014

This is by far my favorite topic to get excited about.  Getting things set up for the CSCI 135 Java dual-credit course for next year got me started again.  The person I am coordinating this class with is a friend from the university.  He is just starting to delve into the issue of CS in Montana high schools and asked my opinion on the topic.  Let’s poke the hornets’ nest.  I positioned myself into my usual meditative state (recline in chair and look at ceiling) and thunk a bit.

I see three major issues with CS in Montana high schools, and I think these carry to any high school in the US.

  1. Incentive for the schools to offer the course.
  2. Place in an already full curriculum.
  3. Shortage of teachers.

1. What incentive is there for a high school to offer a CS course?  Many administrations and teachers think of CS as a trade similar to auto shop or accounting.  Job training and not academics.  The argument is the high school claims they are preparing their students for a liberal arts college and not for a technical school.  To some extent this is true.  Most high school courses teach primarily programming.  Programming is a trade.

How about the argument that CS teaches problem solving skills?  So there is nothing else in the present curriculum that does this?  As a math teacher I beg to differ.

Some folk argue that an incentive would be that there are a lot of high paying jobs in CS.  Very few courses in high school prepare students for the job market, except for maybe auto shop and wood shop.  None of the math I teach prepares students for the job market.  They learned job math back in about the third grade.  It is fairly obvious looking at high school curriculums that high schools have very little interest in preparing kids for the job market.  If they were there would be less literature or history and more welding and computer tech.

My argument for CS sort of ties in with “Those who don’t know history are doomed to repeat it.”  “Those who do not know any Computer Science are doomed to be taken advantage of by those who do.”  Computers have become ubiquitous throughout the world.  They are starting to control the world.  People should know something about an element of their life with so much power over them.  Studying CS helps control the thought behind a favorite quote of mine from Arthur C. Clark, “Any sufficiently advanced technology is indistinguishable from magic.”  We cannot let American society believe in magic.

2. The list of required courses varies from school to school.  My high school requires 4 years of English, 3 Math, 3 sciences, 1 practical art (tech or business) and some odds and ends (history, art, theology).  We are considering requiring 4 years of math.  Public schools usually require 2 math and 2 science, depending on state requirements.  But how many kids interested in CS are only taking the minimums?  CS kids are usually the calculus track gang.  They are the 4 years of math, 4 science, music, etc, etc.  Squeezing another course in an already crammed schedule can be a challenge.  Kids of the caliber to take CS are usually buried course-wise and the councilor will point out to them that CS is not a requirement for any college.  Pretty much a course killer.

In Montana the majority of the schools are small, less than two hundred kids.  It is pretty hard to justify opening a new course when only 4 or 5 kids are going to take the class.  The same can be said for using valuable and scarce staff time for the course.

The only solution I can see is a shift in priority and realize that one year of CS is more important than 4 years of English or Math or Science.  With the lack of CS emphasis on University entrance requirements that is going to be fairly impossible to implement.  Heck, even as a CS proponent I am not convinced that losing one of those 4 years is a good way to go except for kids looking at CS as a college major or minor.

3. Teachers.  There are no CS teachers.  There is very little inclination by college education departments to offer a CS certification.  After all, high schools are not clamoring for CS teachers, colleges are not requiring CS from high schools for entry and there is nobody to teach the course if universities did decide to offer it.  There is also very little incentive for a prospective teacher to seek a CS certification, there are no jobs in it.

A solution is in-service training but there is the same shortage of instructors.  I do see that CS4HS ( is starting some interesting in-service like courses to get teachers that are interested in teaching CS started.  There is also a CS Principals for teachers on-line course that looks very useful.  I signed up for both since there is no in-service for CS in the state of Montana.  It seems most CS teachers learned CS on-the-fly, staying a day or two ahead of the kids (if lucky) so walking into a class with nothing but an online in-service is nothing to be scared about.  I do not think trying to teach an APCS course with this type of background is a good idea but a Scratch, Small Basic and beginning Python type course is perfectly feasible.  Give it a couple of years before diving into an APCS type course.


Getting CS into schools seems to be a very grassroots movement.  There are some political mumblings at the high government levels but it is all words, not actions.  The independent nature of the US education system pretty much guarantees any high level government decisions are lost in the system.  Grassroots movements are slow.  I really do not think the US has time for a grassroots movement.  There are too many countries with a centralized education system that have major government support for computer science education.  Unless we can get some major fertilizer on that grass the US will fall out of the competition (mowed down?) for being a CS power in the world.  That would be bad.

A true CS course for next year

May 16, 2014

Next year I would like to shift my programming course to a true computer science course.  This means finding some guidelines.  If I were doing this for a math or science course I would typically round up some textbooks and pick through them to find the stuff I like and build the course around that core.  For CS this means finding a course outline, modifying it to fit my knowledge comfort level, maybe finding a textbook to use as a guide and deciding on some objectives.  CS has a little problem; textbooks are scarce and no one can seem to agree on what ”Computer Science” consists of.   I have never really taught a CS course, it has always been a programming course.  The reason I am looking at this now is I will be offering a dual-credit Java course next year.  The university course is one semester, I will do the same course in one year.  So this gives me lots of time to do a real CS course.  The extra time is because the average university student carries a much lighter load than one of my school’s students and therefore the college course is much higher paced.  A college student may have 3 to 5 classes, one or two of which may be basket weaving and underwater basket weaving.  Our kids are carrying 8 classes with again 1 or 2 that are not time intensive.  So I have to go course hunting.  I am hoping Google will be good to me.


Get every new post delivered to your Inbox.