Computer Science Teacher
Computer Science Teacher - Thoughts and Information from Alfred Thompson

December, 2007

  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Could not find any resources appropriate for the specified culture or the neutral culture


    There is a problem, a technical problem, that I hear about from teachers from time to time. I've passed along a couple of solutions to it by email but it occurred to me that posting the issue and the possible solutions here might make it easier for people to find it. I'd also like to hear from others who are having this problem to find out if these solutions do or do not work for them.

    The problem happens most commonly when an InputBox is used in a Visual basic program that is saved on a network drive. The error message says:

    System.Resources.MissingManifestResourceException was unhandled
      Message="Could not find any resources appropriate for the specified culture or the neutral culture. 

    Make sure "Microsoft.VisualBasic.CompilerServices.VBInputBox.resources" was correctly embedded or linked into assembly "Microsoft.VisualBasic" at compile time, or that all the satellite assemblies required are loadable and fully signed."

    One way this problem happens is if the network share where the work is saved is not a "trusted share." This is a safety feature that is designed to protect a computer from malicious software on a remote disk drive. There are steps you can take to indicate that a network share is trusted and can be relied upon. Complete instructions on how to set that up may be found here. I go though the steps with pictures for several versions of Visual Studio there.

    In other cases there are some project privileges issues which can be corrected by following these steps:

    1. Open the "Project" menu and select the "project properties" option. Select the  "Compile" tab and turn off option explicit and check  the "disable all warnings" box.
    2. Under the "Security" tab, select include for "ReflectionPermission" in the permission requirement table. Then close the application.
    3. Lastly open the the directory where the project is stored and in the bin/debug subdirectory find and delete the *.vshost file.

    You can read about and discuss this problem solution at Microsoft's online support forum here.

    I'm really not sure why this later solution works or why it is sometimes necessary and other times not. But for the time being it seems to be solving the problem for a lot of people and that makes it seem worth sharing.

    Other resources are this article on MSDN - which is about .NET Framework Configuration Tool (Mscorcfg.msc)

    And this one that lists some not really supported things that I do not recommend -

  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Robotics and .NET Fundamentals Series


    Sometimes it really pays to have smart friends and let them figure things out for you even if you don't really plan it that way. Early this week a received a brand new robot in the mail. I've been waiting for it for a while. The problem of course is that it came at a bad time. My schedule this week was full. I had some travel and a bunch of meetings that took me out of the office just about every day and filled the time in the office with other things. So the robot stayed in the box. A very sad thing.

    Fortunately for me one of my friends and co-workers also received an identical robot this week. Now I don't know if he had more time or if his wife had a shorter list of things to do after work then mine did or if he just goes without sleeping. But long story short Dan had time to setup and experiment with his robot.

    But it gets better and this is what is going to make my life easier. Dan Waters has created a series of videos of his initial setup and experience that I think are very well done. I've been watching them to prepare before  I setup and experiment with my own robot. The index for the series (they're all in nice short manageable chunks of time) may be found here. Hopefully I'll have some things to report about my own stuff shortly.

    BTW If you haven't already you may want to check out and install Microsoft Robotics Studio and Visual C# Express (both free downloads) for use with Dan's projects.

  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    A Simple Check Digit Project


    [Note: is this is interesting to you then this page at CS Unplugged is a must read for extra ideas and resources.] 

    I've been thinking for a while that I hadn't played with any small projects lately. I like to play with what I would call toy projects that let me play with numbers. The other day I was entering passport data in a form and while looking at my passport I noticed that there was an extra digit in the machine readable portion of the  document. Specifically while I recognized the passport number there was a tenth digit.

    This was pretty obviously a check digit of some sort. Ah, I wondered, what is the formula for calculating it? Enter the Internet and a search turned up some information on how it is calculated. For me the next logical step was to create a program to make sure the formula worked with my passport number. Oh sure I could do it by hand but where is the fun in that.

    And besides a program lets me think about basic principles. A formula of course. Data parsing naturally. Probably an array might be involved. It is in my solution it is but it might not be in other solutions. So what is the formula involved?

    Each individual digit is multiplied by a weight. The first digit is multiplied by 7; the second by 3; the third by 1 and then the cycle repeats. These products are added together with the result divided by 10. The remainder is the check digit.

    So if  the number is 123456789 (Passport numbers are all 9 digits long) you have:

    1*7 + 2*3 + 3*1 + 4*7 + 5*3 + 6*1 + 7*7 + 8*3 + 9*1 = 147

    Dividing by 10 leaves a remainder of 7 which is the check digit. Easy enough.

    Now things get complicated if the passport "number" uses letters but US passports don't. If you want to include that in the problem the letters (upper case only) convert to numbers with "A" converting to 10 incrementing up to "Z" at 35. The rest of  the formula stays the same. But adding that complication makes the whole project more "interesting."

    One of the things I would think about with this project with students is data validation. Things like:

    • Are there the right number of digits? Note that the same formula is used for other numbers on the passport, like date of birth, that are not nine digits long.
    • Are the characters in the data valid? Digits or uppercase letters between A and Z.
    • What are good error messages? Is it enough to say wrong length or should you say how many are required? Of should you say too long or too short?

    Of course to me the whole concept of check digits as tools for validation of data is well worth some discussion in class on its own merit. It might be useful for students to look up other numbers that use check digits and discuss why there are there.

    I threw my solution together in about 11 lines of code (in VB .NET) and about half of those lines are data declarations. I'll leave doing it in other languages or in fewer lines of code as an exercise for the student though.

Page 1 of 8 (23 items) 12345»