If I am going to be successful in lobbying for a high school education deserving of our children I will need to learn a whole new kind of politeness and patients, and expect progress and not perfection. Perhaps this was not the year to give up booze.

MacDown

Since I often write blog postings with embedded code I get frustrated with Blogger's editors. Neither the "Compose" nor the "HTML" variants work right when the code contains anything that looks like an HTML element or entity. My last posting lead to me looking for a Markdown editor and I discovered MacDown. I have used it once, to date, and it worked flawlessly!

Traversing, aka picking for scraping part 2

Extending the idea in the Picking for scraping posting is the traverse. A traverse safely traverses a (typically) hierarchical data structure where any of the intermediary traversal steps may encounter a missing node. For example, in an hypothetical application most data instances have a value at the end of the a traversal from A to B to C to D, however, this data instance is missing the B node. Traversing from A to B is safe, but traversing from B to C will result in an null pointer exception (NPE).

The common ways to avoid NPEs while traversing is to check each node for null before traversing it. And so you see code that looks like a ladder, eg

value = data
if ( value != null ) value = value.A
if ( value != null ) value = value.B
if ( value != null ) value = value.C
if ( value != null ) value = value.D

While this works it is very cumbersome and prone to copy-paste errors due to small variations found on some ladder rungs.

Some languages offer syntax support for traversing. This is called a null coalescing operator. Java, the language I mostly work in, does not have this operator and so a different solution is needed.

The solution I use allows for a safe traversing using data format specific classes. That is, XML has its own traverser, Json has its own traverser, etc. A fully general mechanism might be possible, but the technique is simple and so really does not warrant one. Here is the example of safely traversing some Json data

value = new Traverse(data).at('A').at('B').at('C').at('D').value()

Or, let's have B be an array and we want to traverse the first element

value = new Traverse(data).at('A').at('B').at(0).at('C').at('D').value()

The dictionary at() method is

public Traverse at( String key ) {
    if ( value != null ) {
        if ( value instanceof Map ) {
            value = ((Map)value).get(key);
            // data might be null indicating an unsuccessful, 
            // but safe from NPE, traversal
        }
        else {
            // an unsuccessful traversal always sets data to null
            value = null;
        }
    }
    return this;
}

While the array at() method is

public Traverse at( int index ) {
    if ( value != null ) {
        if ( value instanceof List ) {
            value = ((List)value).get(index);
            // data might be null indicating an unsuccessful, 
            // but safe from NPE, traversal
        }
        else {
            // an unsuccessful traversal always sets data to null
            value = null;
        }
    }
    return this;
}

As with the Builder pattern, the Traverse pattern always returns the traverse instance.

A common aspect is the check for type and this can be refactored out.

public Traverse at( int index ) {
    List l = cast(List.class);
    if ( l != null ) {
        data = l.get(index);
    }
    return this;
}

protected <T> T cast( Class expectedClass ) {
    if ( value != null &amp;&amp; ! expectedClass.isAssignableFrom(value.getClass()) {
        value = null;
    }
    return (T) value;
}

Expanded, working versions of XML traversal and Json traversal are at [TODO].

Oh, how do you get the traversed to value?

public <T> T value() {
    return (T) value;
}

END

My boss was a member and, later, chairman of the Lenox, MA school committee for over 10 years. I am glad for his explanations of the alien world known locally as the South Kingstown School District.

Re: 10 questions for the Superintendent and School Committee Chairwoman

I received a response to my letter with some questions about the 1:1 initiative. Note that the formatting is incorrect in some areas: I have asked for a clearer document.

I still need time to consider it. On the surface it says the right things and says them politely. (Very much Pauline Lisi's voice.) I am told that for more detail I need to meet with two other administrators. It has not been my experience that a meeting is more conducive to detail than a prepared document. The response is a step forward, but not the stride I was hoping for.

On Apple's removal of historical reenactment games

Apple's removal of historical reenactment games because they contain images of the Confederate battle flag is ahistorical, reactionary, stupid, and introduces a double standard where none existed before. I guess I can look forward to Apple resolving this problem by removing all historical games because there was always a loser. And what about the winners that were equally immoral or racist such as Mao, Pol Pot, Stalin, Winston Churchill, Woodrow Wilson, Franklin D. Roosevelt, ...

Printed capitals

There has been a little discussion on Facebook as to whether children should learn cursive handwriting or not. I think they should, but ... I count on one hand the meetings I have been in where the presenter had legible handwriting. That is, readable from 5, 10, and 15 feet away -- even in yellow, the abomination of dry-erase marker colors. What the presenter never learned is that for public presentations capitals only, printed text is many times more legible than anything else. So, if you do teach your children cursive make sure that when the boys and gals are making labels and posters have them use printed capitals. Ok, I got that off my chest.

I owe Jared Rosoff much gratitude for his example.

10 questions for the Superintendent and School Committee Chairwoman

Here is the letter I have sent to the Superintendent and School Committee Chairwoman with 10 questions about the School District's technology plan.


How a neural network learns video

A well presented example of how a neural network learns, in this case, to play a simple video game. Worth watching even if you know how neural networks work so you can better explain them to others.


Each laptop costs about $1222 over the next 3 years

As I drove home from the office tonight I was fixated on what the total cost of 1 laptop would be for the 1:1 initiative over the next 3 years -- by then all 1000 HS students will have laptops. So, I pulled up an empty spreadsheet and entered some numbers.

In short, if you assume a 20% failure rate of laptops -- not unreasonable given the hazardous environment a backpack and the ground are -- each laptop will cost $1222. At this price you could buy a new chromebook each year. If you reduce the failure rate to 10% the total cost is $1053. Still less than one new chromebook per year. No administrative costs are included as I do not know what the current staffing expectations are.

Now, you might say, but these laptops are to last 8 years, isn't that going to reduce the per student cost? Well, if the failure rate is 20% then EVERY laptop will be replaced within 4 years. If the failure rate is 10%, yes, the per student cost will go down. I am unsure what shape an 8 year old laptop will be in. But I know that I do not want to use a 2007 laptop today.

Update: I forgot to add that if you buy Chromebooks at $200 each, insurance each new laptop for 1 year, and expect 20% failure rate the cost per student is $360. Copy the spreadsheet and play with the numbers yourself.

No cost for insurance and home internet

I did receive word that the School District will not require students to purchase insurance for the laptops. And for families unable to afford home internet access the District will also cover those costs.

School Committee stands for educational equity

The South Kingstown School Committee was not aware of the requirement for students to maintain the laptops. Scott Mueller spoke directly the educational inequity of this situation and asked that the technology policy, that was to be voted on last night, be returned to the sub-committee for further work. The other SC members unanimously agreed to this.

Tonight's school committee meeting

I intend to speak during the community comments section of tonight's school committee meeting. Here are my notes; feel free to add your own comments.

Update: See School Committee stands for educational equity.

Weekend Workbench

The work this weekend was normal springtime home maintenance. I finally finished off topping off the trench holding the french drain and gutter drain (two separate pipes). We had to carry a lot of stone! Finished priming the screen doors. The possibility of rain prevented me from getting a top coat on them.

Owen and I have continued to play Firefly. Owen really wants to crew his firefly with all the Firefly cast and so this has become his game goal! I also played The Speicherstadt on Saturday at the Wakefield Board Games Meetup. I really like the game and will likely purchase it this year. I am told it will be back in print soon.

Differences between the information meeting and the one-to-one laptop FAQ

Differences between the information given at the June meeting and the one-to-one laptop FAQ

1. The devices are mandatory.

2. The student can not use their own laptop.

3. The maintenance cost (via an insurance policy) is $60.

4. The student will not be allowed to decorate their laptop so as to distinguish it.

5. The student will most likely need a home internet connection (and using Cox's $10/month option is suggested).


Update: See School Committee stands for educational equity.

And what do we do when we don't have our laptops?

Some questions for the School District not addressed in the 1:1 FAQ [1].

At the June informational meeting it was said that the laptops would need to be returned prior to PARCC testing for "certification". Would you please provide more detail? For example, where are some questions that come to mind.

1. PARCC testing this year spanned 10 days, will the laptops be held securely during this period to ensure their continued certification?

2. How many days or weeks before the testing will the laptops need to remain with the school?

3. Will the student be allowed to use their laptop during this PARCC certification and testing period in school?

[1] Note that the FAQ was distributed as a PDF document and not as a link and so this link goes to my Dropbox site.


Update: Make sure to ask ALL your questions about the one-to-one FAQ on the feedback form because you can only use it ONCE!
Update: See School Committee stands for educational equity.

Cropping multiple pages at once

I print stuff, but I don't like wasting paper or ink. Research papers in PDF tend to be formatted for use in a journal. Chapters in PDF tend to be formated to use in a book. All have extra marginal whitespace. I found out today that OS X's Preview application can crop all selected pages at once. The steps are:
  1. Choose the View menu's Thumbnails
  2. Select all the pages in the sidebar. 
  3. Choose the Tools menu's Rectangular Selection item. 
  4. Select the rectangular region you want to keep. 
  5. Choose the Tools menu's Crop
Done.

Picking for scraping

One of our developers coded what is essentially a data scraper. The implementation is very brittle. It has to become more robust. Without rewriting it, one technique is to use "pickers" to get valid values from a poor quality input. The way a picker works is that you declare where to get the data, what type it is, and what a default value is. A different picker is created for each way a value is accessed. Don't worry, there tends to be only a handful of data access patterns so not a lot of code will be created.

For example, the following code caused an NPE this morning because result didn't have a "data" child:

Element data = result.getChild("data");
int count = new Integer(Strings.noNull(data.getAttributeValue("count"), "0")).intValue();

If a picker were used then the code would have returned zero, the default value.

int count = picker(result,"data","count",0);

The key aspect of the picker is that it checks every working value before using it. For the example above, the picker would be implemented as

int picker(Element tree, String elementName, String attributeName, int defaultValue) {
    if (tree == null) {
        return defaultValue;
    }
    Element element = tree.getChild(elementName);
    if (element == null) {
        return defaultValue;
    }
    String attributeValue = element.getAttributeValue(attributeName);
    if (attributeValue == null) {
        return defaultValue;
    }
    try {
        return Integer.parseInt(attributeValue);
    }
    catch (NumberFormatException e) {
        return defaultValue;
    }
}

Extra Credits: The Myth of the Gun

This is the best explanation of our culture's adoration of the gun by examining the cultural differences between us and Japan and the first-person shooter video games each creates. Well worth your time to watch.

Poor planning continues with one-to-one laptop initiative

Update: I have since heard that the School District is backing away (or correcting) statements made in the information meeting. In short, no student would be denied a laptop to be taken home because of family need -- those with hardships would be privately accommodated. Good to know that speaking out does work. However, we have yet to hear if the District continues to expect parents to still pay $55/year per laptop.

I attended yesterday's (June 2) information meeting about the High School's and School District's initiative to have students take laptops home. This was the second time this meeting had been given; having been given a month earlier. It was a poor example of a public meeting. There was no written agenda. There was no written details of important dates, costs, etc. There was no sign-up sheet so the presenters could follow up with attendees on questions unanswered during the meeting. And lastly, there was no one tasked with guiding the overall meeting.

The meeting was well attended. It looked like a full house of 50 to 70 attendees. I expect we were all there to get a clear understanding of the program and the expectations of teachers, students, parents, and administrators. We did not get that.

The meeting was divided into three parts. 1) An introduction which included an unnecessary motivational video and a welcome example of current use in a Spanish class. 2) Information on the laptops selected and the costs to the parents. And lastly, 3) information on the rollout in August.

The bombshell that was dropped on the parents was that the district is not taking responsibility for the costs of maintaining the laptops. The parents are expected to buy insurance at $55 per year. It was also stated that the parents would have to pay for the full four years of insurance up front, i.e. $220. Multiply that by the number of students you have in High School for final costs. As the meeting broke up one of the presenters said that you might be able to make yearly payments. That these decisions were not known at the start of the meeting is just another example of poor meeting planning.

When the presenters were asked about why a student within public education was expected to pay for insurance there was no answer. Instead, we were told that having the laptop was not mandatory. That students could "checkout" one for the day when needed. There was no information on how this would be accomplished within the constraints of, for example, staffing or adjustments to busing needed to give the students time to checkout and return the laptops. It seemed clear that there that little thought had been given to even the most rudimentary logistics.

A second question that arrises is how is a teacher going to prepare a curriculum and its supporting educational materials for a classroom where he or she can not expect a uniformity of laptops and internet connections? For example, one of the High School's innovate math teachers has implemented the "upside-down classroom" where the student watches videoed lectures at home and does "homework" in the classroom where their questions can be addressed immediately and with appropriate, individual instruction. How does the student without the laptop at home or in a home without an wireless internet connection participate? Why is the teacher expected to create more than one teaching plan?

One presenter answered that students could use the computers at the public library as though that was a reasonable option. Given that the public library is funded by the Municipality and not the School District, let's only consider this solution when the School District steps up to funding the additional hours and computers needed to support this. Again, another example of a lack of planning.

I could continue to critique the planning around the one-to-one laptop initiative. When this initiative first started I asked to be involved. I was invited to participate in the planning meetings. After attending the first few meetings it was clear that the initiative was actually being driven by PARCC testing requirements for computers and the need to hide the costs of this under the guise of instructional advancement. Perhaps this characterization is too harsh, but I have yet to see anything from the District that shows me different.
Update: See School Committee stands for educational equity.