Saturday, November 29, 2014

Parenting Month 49: An introvert in an extrovert's world

Earlier this month, one of T's teachers decided to give him his assessment a bit early, since he was going to a new class and new teacher soon (moving from the 3s room to Pre-K (everyone from 4 years until moving into kindergarden).  He pretty much maxed out the academics, meaning he covered everything that was expected from the 3s room and everything that the Pre-K had been doing (from the description, we figure she ran out of available assessment material, and probably was also beginning to reach the extent of T's patience). This is not the usual outcome of an assessment for T, the normal outcome is that he is quiet and does not give answers to things that we are all quite certain he knows so he assesses as generally age appropriate, maybe a bit ahead.  The difference is that it was done in the course of daily activity and the teacher was one he knows well as opposed to a new teacher (he takes 2-3 months to warm up to new staff).

The underlying issue is that he is an introvert, and pre-elementary assessments are designed based on an outgoing child who will actually present the knowledge he/she has to the assessor.  But, while the majority of preschoolers in any grouping (say, a daycare or preschool) are wild and rambunctious, T had always been the quiet one who stayed in one place.  As a 2 and 3 year old his play at day care or in group settings was marked by him staying in one place as the other kids would swarm from play area to play area around him. And the kids realized this too. His most common playmates were also the quiet ones who did not swarm as fast as the others (e.g. girlfriend from the 2year old room was also a shy one, and there are three boys that the staff have marked as hanging around together instead of participating in the usually rowdyness of preschool boys.)

The question is what do we do as someday he will be assessed, and there will be an outcome of the assessment. And that, especially in the pre-elementary and elementary stages, the assessment will be done in a way that greatly favors the extrovert (est 75% of the U.S. population).  Some things that we have been trying include playing piano (he plays happily at home, but in any other location, he maintains excitement until he gets close to the piano in question, then he freezes.), activities in busy areas (the regular museum visits offer many opportunities to interact, in fact it is hard to avoid the other kids, but he clams up as he gets close to interacting with anyone, even after watching us do so many times in many contexts.), play dates (we have not had that many, most of the neighborhood is older, there is one neighbor only 2 years older who really likes playing with T, but she is very much the extrovert and it does not help whne movin to a new setting.  There is one sense that it does not matter, that T will learn enough how to function in an extroverted world in time for it to matter, but another thought is that time may not be that far into the future.

In other developments, A has become quite the talker. In addition, she has developed a sense of will where there are times where she can decide to want something, and make deliberate and sustained efforts to get it.  And as part of that, the first stage of mobility, she can roll both clockwise and counterclockwise at will.

T's main development was moving up to Pre-K from the 3s room. This actually was an issue as the Pre-K in our daycare had maxed out the capacity of the room. We were part of a minor rebellion threatening to leave enmasse until they created a new class of Pre-K. There is an issue as the additional class starts out the day using a room that is also used by an afterschool program, so they need to move back into the regular Pre-K/3s room before the public school kids (kindergarden is halfday in W Pa.) return. So it is a lot of moving around, but at least T spends time with older kids again.


USS REQUIN at the Carnegie Science Center - Pittsburgh
Turning the wheel of the USS Requin (SS-481)

USS REQUIN at the Carnegie Science Center - Pittsburgh
These beds are small
.

Tuesday, November 25, 2014

Using blogs and news articles as class mini-cases - How discrete-event simulation can help project prison populations

How discrete-event simulation can help project prison populations (SAS Subconscious Musings)

My experiment this semester is more intensive use of news articles as subjects for in-class discussion of examples of applications of what we are learning.  While I have done this in the past, this semester I made it a deliberate plan to discuss one article a week in each class.  So far this semester in my simulation and decision models classes, I have covered reactions to the W. Africa Ebola outbreak, Game 7 of the 2014 World Series, Gamergate, flu vaccinations, commercial manned space transport, pulling a goalie in hockey, cargo shipping, business expansion, business divestiture, automation of manufacturing, health care system operations, among other things.

I identify articles through the use of RSS feed aggregators. My news feed includes a number of feeds from a range of business school professors focusing on supply chain and operations management issues.  I follow the CDC MMWR as well as the journal Health Affairs to get health care related articles.  And the New York Times front page and Google News are good for a lot of different stories.  The key is finding an article where the reporter was good enough to discuss the various options that were available and enough details that you can figure out the values of various actors involved.

The key a good class case article is that there are potentially reasonable alternatives to discuss.  In the decision models course, the discussion revolves around identifying the courses of action available, the sequence in which decisions need to be made and information becomes available, assessing the attributes (values) of the people involved, then assessing how they may assess probabilities of various events.

For the simulation course, the focus on case discussions is on understanding how a decision maker in the article may use the simulation, then we do a whiteboard exercise where we draw out an event graph diagram to model that system, focusing on what needs to be included (states, events) based on the decision maker needs. The goal is to discuss modeling in a specific context, so we can talk about what needs to be included, and what does NOT need to be included in the model to fit the particular purpose.  The contrast is to the textbook homework problems, which generally provide a very specific context and set of details which have be included in the model to answer the homework problems.  Textbook problems generally do not include thinking about modeling in such a way to determine what is the right question and how to simplify the model to address the question.

Last week we looked at the decisions made by the North Carolina Sentencing commission.  Unlike most cases, in this case we happen to know for a fact that a simulation was used in the decision making process.

Our discussion began with purpose: why would the North Carolina Sentencing Commission be interested in a simulation of prison population. We came up with the need to plan prison space, make arrangements with neighboring states to house NC prisoners, and to allocate resources to monitor parolees.

Next, a discussion of what would the simulation need to track to fulfill the purpose of the NCSC. This would include the number of prisoners and the number of parolees. And the time remaining for each prisoners sentences. Then, we have the state of the system being the prisoners and parolees, and the terms of sentencing. (we decided not to discuss the size of the prison, since that is something that was being determined).

The last part of the discussion was where the typical homework or exam problem started, diagramming the events tracked by the system, how each events changes the system state, and then how to generate delays in the simulation.

The purpose of the exercise was to discuss modeling. Not in terms of how you build a model from a system description, but to think through how to model and make modeling trade-offs given the decision that needs to be made about a specific system.  The cost of this discussion is time, doing this results in us not completing a semester syllabus of a class that is quite analytical. But, as textbooks usually begin modeling examples with a system description and a purpose, I think it adds to the course and I think the compromise is worth it.

Thanks to Natalia, Jeff, and Leo from SAS for our conversations about this particular SAS case at the INFORMS conference. It enriched the class discussion to know what was happening behind the scenes of the Subconscious musings blog article.

Sunday, November 16, 2014

Testing in pairs: The Global Day of Coderetreat

Global day of Coderetreat: a day to celebrate passion and software craftsmanship

A Coderetreat is like a master class for computer programmers. It is a chance to view programming as a craft that can be practiced and honed.  And like other crafts, the way you develop skill and creativity is to create limits, then use your creativity to accomplish the goal while working around the limits.

As an engineer, I am not primarily a programmer, although I have some level of skill, so this is not the typical view of programming, which is viewed more as a tool and a necessary evil. The effect is that improved competency is not valued, which leads to  inability to deal with dirty data, models that cannot be implemented, and results that cannot be reproduced.

Code retreat is build around the four principles of simple design, due to Kent Beck



  1. Runs all the tests
  2. Expresses every idea that we need to express
  3. Says everything once and only once
  4. Has no superfluous parts
The structure of the Coderetreat is six sessions where we work with Conway's Game of Life. For each session, we pair with a different partner. In addition, in each session we are to begin from scratch, and there is a twist to the rules.  The goal was never to actually implement the Game of Life (although in two cases we actually had all of the parts working and tested), but to spend time working with someone else on code.

Observations

1.  Pair programming.  This was my favorite aspect of the Coderetreat, pairing with six different people.  I figure there were two where I was generally more skilled, two where I was generally less skilled, and two where we were pretty much even. In every case our end solutions had very different designs as it was a combination of our different ways of looking at things and our experiences of having tried different designs in previous sessions, and the skill levels of the people involved.  When I worked with students, we would occasionally have a session where we worked together to solve a problem, and some of my students have commented that they found those sessions to be invaluable because they had a chance to watch how I worked and saw how I dealt with different types of problems.  But this time I did pair programming on people on a much more even footing and I get to experience it as well.  It showed in how we used different tools (although I was experimenting with a new IDE), how we solved problems in code and how we solved logic problems. 

2.  Test driven development (TDD). I've heard of the concept before, and I have even contributed to a unit test framework, but I've never really done it.  What TDD did was to encourage more modular code. It also forced us to put more thought into our design, as we had to consider what information was required an in what format to do what we needed.  In one session, one member of the pair would write tests and the other would write the code, and the two were not allowed to communicate. As the one writing the tests, since we could not otherwise communicate, I realized that in writing the tests I was forcing a set of data structures and a design in my tests.

3.  Throwing away dsigns.  We started each session with a clean code base. What it meant was that we did each session using the lessons from what went before.  The first two sessions we did not get much progress, but the third was the one where we made the most progress, as we basically learned from the combined mistakes made over the first two sessions and designed the tests with the past problems faced in mind, and the solution was fairly easy after that.  That was good because the next three sessions were the ones with the wierder twists.

4.  New languages.  Python is by far my strongest language, but I did one session in Clojure and one session with Java.  In both cases I learned a lot about how people set up their tools and the idioms they used, which were different than what you see in standard texts.

5.  Dealing with constraints. There were three weird twists. One was mute pairs, one was limitations on the size of methods, one was no use of conditional statements.  Mute pairs forced the design to be simple and clear (especially difficult because we did it in Clojure, which I barely can say I know without the aid of a book in front of me), the size of methods led us to generate very ugly method/class hierarchy to deal with the extreme restrictions, no conditionals lead to a range of creative hacks.  This has an effect similar to a lot of exercises done in the creative arts, adding constraints is one way of encouraging more creativity.

This was a valuable experience. Most of the people there had computer science backgrounds, and pairing with them taught me a lot.  And I was somewhat glad to know I could add to people's knowledge base as well.


Thanks to Code & Supply (@codeandsupply) and Think Through Math (@ThinkThroughMath) for making this event possible and for helping to keep it free, and to IBM for hosting.


Pittsburgh Code & Supply Logo

Think Through Math logo

Saturday, November 01, 2014

Parenting month 48: Now that we are four

Before T was born, we thought that the first few years did not really matter, that we would not really start trying to teach T anything before he was four. Because we did not think we had any strong opinions on what needed to be done before that.


(I'll pause and wait for everyone to stop laughing. But the real reason for this was that we promised not to stress over any differences in parenting style between us and both pairs of grandparents by deciding ahead of time that it really did not matter, and I think we did pull that off.)


And now, surprise, he is four. So time to take stock of where we are.


1.  Our engaged with parents but not with others has turned into a talker. He plays with many of the other kids now (and he does like being one of the older ones in his room). While he would not be considered an extrovert by preschooler standards, he is a long way from the one who took three months before he would get comfortable with daycare/preschool staff.


I am playing the drums
Drums at the Mattress Factory



2.  He likes being competent. Today's trick was building a LEGO set for his birthday reading the instructions himself (I only helped when the issue was finger strength). Granted, it was a set that was designed so young children could make it, (aimed at 4-7 years), but he was happy to say he did it. We've been consciously trying to get him to feel good about being competent and accomplishing things, whether it is building something, playing music, working with the garden, building things with tools, or anything else that preschoolers can do.
These are parsley roots from my garden
These are parsley roots from my garden



3.  He can read simple books. For a while we thought he was  just memorizing books, but we have caught him figuring out new words through phonics.


The American Academy of Pediatrics says you should read to newborns.
Reading for my little sister
4.  He has always had empathy in the sense of responding to our feelings, but now it expresses itself in a new way as he is the big brother who cares for his little sister.


But now that he is four, and we obviously did not let things ride for the first few years of life, what does it mean to be thinking deliberately about his growth?  We are watching the progression to kindergarden, as the cutoff point for school has been moving earlier over the years (parents have been holding their children back for fear that they were not developmentally ready), and now T is on the other side of it, so we are worried that based on the public school cutoff points, he will have to wait and double up a year in preschool at some point before he is eligible for kindergarden/first grade, and that will be boring.  So we are thinking of ways for him to get into the school system despite the cutoff date.

Some favorites from the year:

Song: Let it go from Frozen, like the majority of preschoolers around the world. And he gets it in both english and mandarin.

Books: The Scholastic, DK, and Random House Readers series.

Museum: Carnegie Museum of Natural History

Playground: The yellow and gold playground by the swimming pool in North Park

Toy:  LEGO  (actually, I think parents are the true favorite toy)

Movie:  The LEGO Movie

On the other end, A is a full on babbler. She can play with things put into her crib, and she likes putting things in her mouth (T always tested things before putting them in). Latest trick is turning over. She can kick and swing enough to go from back to front. Of course she does not know what to do after that so the sense of accomplishment quickly gets replaced by frustration.

Friday, October 10, 2014

Flask Web Development by Grinberg: Book Review

Flask Web Development: Developing Web Applications with PythonFlask Web Development: Developing Web Applications with Python by Miguel Grinberg
My rating: 4 of 5 stars

I'm not a web developer, but Flask has always had an appeal of potentially being a potential front end to a database based application. But I've never gotten very far as tutorials generally look at only the main application, and I'm pretty sure I need some extensions but I have not been able to assess the quality of the many plugins available. Flask Web Development is that tutorial that shows Flask and selects quality extensions to introduce.

Flask Web Development is written as a tutorial, not a reference. As such Grinberg can decide on what is important. It starts like many other Flask tutorials in looking at the basic application structure, templates and web forms. But then it looks at databases along with a set of extensions for database management built around SQLAlchemy: Flask-SQLAlchemy, Flask-migrate. (and email, which I don't do)

He brings it all together with walking you through a blogging application. What gives the tutorial an over-the-shoulder feel to it is an innovative use of the github repository that goes with the book. Instead of having source files in the repository, the repository uses tags to incrementally build source files, so it is really like working alongside someone who knows what they are doing as they build the application. One tag will have a basic working version of functionality, and checking out subsequent tags builds out more features.

Flask Web Development covers many aspects of web programming, well beyond what most Flask tutorials will cover. I appreciate the deep dives into database management with SQLAlchemy, and the sections on testing and profiling which have applications beyond web development.

Disclaimer: I received a free electronic copy of Flask Web Development as part of the Oreilly Blogger programming.



View all my reviews

Sunday, September 28, 2014

Parenting Month 47: What class should I take?

Over the past month, as we have been preparing for T's fourth birthday, we've been finding out that a number of his peers have started attending various enrichment classes. This being American upper-middle class suburbia, this includes various sports, dance, art, music, and other subjects.


Drawing on the chalkboard
Drawing on a chalkboard at the Carnegie Museum of Natural History
We are aware of some options. At various points over the past few years we have thought about things like swimming, kung fu, or ballet, but in the end we have not done anything about it.  Our tiger mom/dad credentials are in jeopardy! So we started to think about it.

Realistically, we are looking at the weekends, as noone is silly enough to try to do anything with pre-schoolers at night. So that means Saturday/Sunday morning/afternoon.

Next, look at what we do now. Saturday mornings Grandparents get A, S teaches, L takes T and does one of two schedules  (1) go to a museum followed by lunch (museum often includes running around a nearby park or the sports zone (if the science center) or (2) Home Depot/Lowes project plus park/playground/Barnes and Noble.  Saturday afternoon is a nap, then play in the afternoon (which often includes things like drawing or piano)  Sunday morning/afternoon has church then grandparents take T for nap and play. A is with us in the afternoon and goes with L when S teaches.

So we have really three time slots to use. Sat morning is when L currently takes T out. Sat afternoons are naptime and when S gets to play with T. Sun afternoon is a naptime.  

Now, someday, Sun afternoons will be taken by chinese school, but right now that is not going to work since T is too tired. Next question is what would the current schedule be replaced with.

There is a piano hanging in the sky. What a strange place to put it.
There is a piano hanging in the sky. I can't play it because there is no bench to sit at.
A class for a preschooler is generally 1/2 hour.  Figure 45 min~hour to get to whereever it is (including any packing/prep to go), and the same amount on the way back.  So a class occupies a 2+ hour time slot.  Currently a Sat morning museum trip is 45 min each way, 1 1/2 hours there, 1/2 hour for lunch.

Realistically, a class would be replacing the Sat morning trip, or Sat afternoon. (Sun afternoon is being reserved for a future chinese school, as all the chinese families in the Pittsburgh metro area have seemed to have decided to coordinate their schedules that way) i.e. it either replaces the core of daddy school or eats into mommy school. So what would that tradeoff look like?

Currently, daddy school bounces between the Natural History Museum, Art Museum, Science Center for science and culture, Home Depot and Lowes for hands on woodworking projects, and leavened with playground or walking in the woods time (with a bookstore being the backup). Mommy school currently consists of piano and working through a workbook.  Grandma/grandpa school focuses on drawing and going to the park/playground/swimming.

But while a class would focus on learning skills and doing things with others, we are probably getting more than just learning skills. We get a chance to learn and push T in the things we do with him. In museum trips we get to be a safe harbor for helping him interact with the museum staff and others. In the various stations we get to push him to do the things that are just a little harder than what he can do (and does at preschool), and we get to celebrate when he gets it done. At Home Depot and Lowes we can push him to do things harder, and he can see some of the other parents doing almost the entire project so he can tell that this is different. And we can link what he does without outside the house to inside the house, where he enjoys putting things together.

In the end though, we are going to do what we are doing for now, and the real reason is practicality, we think that signing up for a class and committing our schedules (we take advantage of the flexibility to change from week to week) is too much hassle over what we do now.  And we somewhat think that the time we spend with them is something we both enjoy, and we may actually know something about what we hope T is learning.


Look at all of the birds in the lights
Let's count how many birds are up in the lights.

In other news, the "I can't do it" period for T seems to be subsiding. We've been fighting the recent introduction of that phrase by encouraging and celebrating competency, in anything and everything. And he gets a kick out of doing things like playing piano (he has two songs down), drawing (every now and then it looks like something), LEGO (he is starting to be able to figure out the instructions himself), and tools (we (well I) have started letting him use a knife and scissors in the garden and to prepare food. And he is astonished at it, when he is done it is almost like he is thinking "did I just do that?!"

We are starting to think that T is actually reading. We have always figured that when he was reading, he actually just memorized the book in question or is making up a story to go with the pictures. But these past two months we have observed him figuring out words to books that were new to him, and at the museum reading out animal names that are compound and figuring them out (e.g. ground hog).  Also using phonics (i.e. sounding out the letters in a word, then realizing that this is close to a word he knows).

T has become a lot more talkative in the past month, both at home and at school. One reason is that he is now one of the older kids in his class, and he has been more comfortably talking around the younger kids (he likes to play teacher and explain things to them). Another is that he is just a lot more social, probably just a part of growing up. And there is a girl a few doors down that he plays with, and she has been a non-stop talker upon getting home since she has started kindergarden.

A is also a babbler. She likes to babble when she is happy, and she also has the big eyes that like to look around like T did when he was a baby. But we also see the benefit of not having colic. A got to the looking around at the world and babbling around earlier than T did. Generally, no colic leads to a very happy and easy to care for baby (grandpa is very happy, at this time, he was pretty sure T did not like him).  We also think A is being sneaky. She clearly is figuring out different people are better for different things. It is most obvious with grandma and grandpa.  Grandpa is better for carrying. Grandma is better for playing and sleeping.  And A is not shy about making preferences known.

Next stages.  Mommy and daddy school is starting to get more directed. Mommy has several workbooks and curricula.  Daddy is going to introduce drawing across all the museums that we go to.

Sunday, August 31, 2014

Parenting month 46: Pop culture, preschoolers, and competencies

There was a time we were thinking of keeping pop culture mostly out of our kids lives.  And since we are not real big TV or movie people, we thought it would not be too hard.  But then reality tended to get in the way.  The first thing was that children's clothes (especially bargains) tended to be branded.  My wife once came home with Star Wars Clone Trooper shoes for T without realizing the origin. Of course, T's pre-school classmates could recognize it for what it was. Ninjago also entered the household through bargain clothes. At daycare, it is completely evident who was the kid who introduced everyone to superheros. And it would seem that noone in the world who has regular contact with pre-school to pre-teen kids could avoid Dsiney's Frozen last year.  The various learn-to-read books are also saturated (as most vendors of such books have learned that tagging along on pop culture gets their books purchased and read).


LEGO Research Institute
LEGO Research Institute set
So the next question, what do we think about it? And what do we want our children to learn? Answer that, and we can think about what we let in.  First, the classic raising a child answer about allowing fantasy (which is what the problematic pop culture all represents) is that it allows conversations about right and wrong in a safe context (there is no standard correct answer the child has to try to remember and no danger from the point of the view of the child of getting blamed or punished for something when you are talking about people and situations clearly divorced from the real world which is usually the case when they get involved in those kinds of conversations)

Another goal is most strongly made from the superhero genre. Fantasy play provides those who usually have no power (children) an experience where they have agency, the ability for their choices and actions to have an impact on their world. And as there are clear boundaries that authority figures have put into the lives of pre-schoolers, being able to identify with an actor in a fantasy world allows them to think and play where their boundaries and capabilities are much greater than reality. (Disney's Frozen really is blatant about this in the song "Let it go")

So there are two things that I want when my son interacts with pop culture fantasy. First, that it is a vehicle for talking about what is right or wrong and promoting empathy, second that it teaches agency and competence.

For the first, we can follow the standard good guy-bad guy play of boys. And as he plays, we can interject with questions about why a character in his play did what they did. What is good and bad, nice and not-nice.  And we can steer his play through our questions.  So one day, when a bad LEGO character was part of the play and we thought about how everyone reacts, he had all of the good LEGO minifigs got together to push the bad guy away (he knows about super heroes, but I don't think he has gotten the idea that super heroes are anything special, so he needs to use numbers to be on the good guys side).  Playing with Star Wars space ships turned into them being fire-fighting space ships.

LEGO Star Wars Brickmaster Ice Speeder, assembled by T

For agency, there are two aspects. First, we encourage the characters in his play to do things. Firefighters fight fire. Medics get people who are injured, Doctors heal sick people. Police chase and catch crooks. People hike, cook, kayak, run, etc.  The second part of agency is that he has to create. At this time the major entries of pop culture in our house are as toys is in the form of LEGO and in woodworking projects from Home Depot and Lowe's, so he was part of making all of it, either through assembling or through use of hammer, nails, and glue. Right now, it is a big deal for him that we have a LEGO Star Wars vehicle where he is the one who made it by reading and following the instructions. Because it is the most complex thing he has made without any adult helping him. And we want him to be proud of being competent at things, whether it is making toys, or reading, playing music, helping around the house, or physical play.

Major development news for T.  He has started learning piano. So far, he is learning the standard Mary had a little lamb, but added to that is Old Macdonald had a farm.  There are a couple of other songs in the queue that all have the characteristic that they can be played on white keys without moving the fingers.  That means that playing the piano is reduced to hitting the right note and keeping time (which are conveniently whole increments) Which is within the realm of a pre-schooler.


Studying butterfly wings at the Carnegie Museum of Natural History, Pittsburgh.
Studying butterfly wings under a microscope a the Carnegie Museum

Mommy and daddy school is moving up another notch. We have started working through a Kumon workbook, and there is one that is supposed to done over the course of the year and comes complete with stars for completing lessons, and certificates for completing week-long sequences. The certificates are finding their way onto our walls as he progresses.

Socialization has improved greatly. He is now quite talkative at day care, chatting and playing with other kids. We have even observed him instigating play with other kids when we come in to pick him up in the afternoon. Maybe our socially withdrawn kid is breaking out into the world. Of course, this means the other kids have influence on him. So he is now starting to think about birthday parties, as in when does he have one.

At a slightly different point along the way, AY is a full on babbler. She is getting much practice making sounds, and even alternating with whoever is the current conversation partner. It is amusing as she is still expanding the range of sounds she can make. And she is very amused when a new sound comes out of her mouth (you also see her thinking "did I just do that?")  She is also a good smiler, both in terms of the big grin, and the fully body-shaking-smile that happy babies can do.  She is also learning to explore. She is in the beginning stages of being able to manipulate things with fingers, and we can see that, unlike T, she likes putting things in her mouth (T better keep track of the LEGO)
Mommy, someone behind you is taking a picture
Hi there!

Next, school has started for both parents. T is going to 5-day a week daycare while A stays with grandparents. This will be a challenge to T for further growth the socialization department.