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.

Friday, August 29, 2014

Clojure for Machine Learning by Wali: Book review

Clojure for Machine LearningClojure for Machine Learning by Akhil Wali
My rating: 3 of 5 stars

For a book that is about [programming language] for [computational task], there are two approaches. One is to assume basic competence in the language and teach the task, the other is to assume that the reader has basic competence in the task and teach how to do it in a language. This book assumes knowledge of Clojure and tries to teach machine learning. But I find that it does just enough to be dangerous. It has a series of methods but does not provide discussion on why you would choose once class of method over another, and it completely skips model evaluation. What this creates is someone who has a good idea of the mathematics and implementation of methods, but not when to use it or if it actually did what was intended.

This makes me slightly different than the ideal audience of this book. I am learning Clojure and have only started using it for data analysis in real life. However, I have used Python and R for data analysis for several years now, and I have use both of them (and trained students to help me using both) for different machine learning projects (and I use R for teaching a course in data science).

Each chapter in Clojure for Machine Learning takes a look of a class of machine learning algorithms and takes several looks at it. Generally, Wali looks at the mathematics and theory of the algorithm, then a simple implementation in Clojure, then some examples of using existing library implementations on a problem. The mathematical treatment seems nice, but it would not compare to an actual text on machine learning/data mining. And while seeing an implementation in Clojure has some value, I would have liked to have seen more humility in doing so (i.e. some recognition that there are limitations of an implementation that can actually fit into a book of this size with everything else that needs to be done).

Two things that bother me about this after I finished was realizing that for each class of algorithms, the book only covers one or two methods. Which is fine, but it does not even acknowledge that there is a greater world. And as there is no discussion on how to perform model evaluation, an enthusiastic reader may reach the conclusion that they know what they are doing when implementing them against a data set and problem. Essentially, the enthusiastic reader knows enough to be dangerous and does not know what he does not know. If I were to suggest this book to someone, it would have to go with a severe caveat that what you know after this is how to set up a machine learning problem. More research has to be done to determine what actually needs to be done (the libraries used are much broader than what is covered) and then, learn from somewhere else how to evaluate or tune the methods used.

In the end, I would treat this as a book of examples or cases of Clojure being used in machine learning. There is room in the world for a book on Clojure for machine learning, but this is not it.


View all my reviews

Tuesday, August 19, 2014

Clojure Data Analysis Cookbook by Eric Rochester

Clojure Data Analysis CookbookClojure Data Analysis Cookbook by Eric Rochester
My rating: 5 of 5 stars

This book is a good tutorial on data science using Clojure. It starts with working with data (access and cleaning up), then the various chapters cover a range of tasks from focusing on numeric computing (performance, parallel processing), statistics (Incanter and other numerical libraries), working with other numerical software (Mathematica and R), graphics, and the web. The topics are actually a fairly complete look at data science, so it feels more like a tutorial than a cookbook.

I found this to be a great text on working with data in Clojure. My background is in technical computing, mostly R and Python although I also use C, Java, and Fortran as needed. I've been dabbling in Clojure, but I had not made the jump from doing tutorials and exercises in Clojure to doing something for real. Working through this book has improved my skills in setting Clojure up and using it for real tasks. The book code also provides a nice example of good programming style (I think) that I can see myself trying to emulate.

A book on data science is necessarily about the practical details of implementation, not about mathematical and statistical methods. Presumably, the reader has another source about the details of various statistical and machine learning methods that they can use to figure out what to do, then the Clojure and Incanter API documents tell you how to do it, and this book is about how to do the 80% of data science that is not about implementing the algorithm, but about how to manage the data, then work to communicate the results of the algorithm in understandable ways. This book is probably what brings me from dabbling in Clojure to being able to use Clojure for real tasks. Well done.

View all my reviews

Saturday, August 09, 2014

Functional Thinking by Neal Ford: Book review

Functional ThinkingFunctional Thinking by Neal Ford
My rating: 4 of 5 stars

Functional programming can often sound like magic, in its promises of greatly improved productivity and near guarantees of accuracy and expressiveness. But one problem is that the examples usually given are those in an unfamiliar form, using languages very different than the procedural and object oriented languages most of us are used to. And the advantages are not apparent when presented. What Ford does in Functional thinking is to present the advantages of functional programming within the context of an object oriented language that can support this, then move to more appropriate languages to show how the advantages can be more clear when the language supports it more directly. It does not stand alone, you will not learn functional programming from this book, but it does offer a more clear argument for why functional programming can useful and better in some circumstances.

The setting that I have seen functional programming explained and taught has always been in the context of demonstrating a functional programming language, such as a Lisp (Lisp, Scheme, Clojure). Or sometimes, a language that has some functional features (R, Python). But I always had to take the commentators word at why this was good. Ford using Java 8 (as it adds some functional features), Groovy, Scala, and Clojure provides a progression from functional features in an object-oriented language (Java), to functional features in multi-paradigm language (Groovy and Scala), to it look in a language that is clearly functional (Clojure). This provides a good look at its qualities by showing how these features improves upon an object-oriented solution, then how it is more expressive and closer to the problem when presented in the cleaner form (i.e. in Groovy, then Clojure). I probably would not have caught the lessons of this if this was my first exposure, and I stopped after the first chapter to watch one of Ford's talks on YouTube so I could get an overview of the book before I finished. But the reward is that it gives context for my learning of Clojure (and functional programming in general).

Not for learning a programming language, but for learning how to think about problems in new ways, enabled by functional programming.

Note: I received a free electronic copy of this for review as part of the O'Reilly Press Blogger program.

View all my reviews I review for the O'Reilly Reader Review Program

Sunday, July 27, 2014

Parenting Month 45: Visitors and limits

Cousins working together on a Blue construct
Cousins playing at the Carnegie Science Center Blue exhibit

This month was marked by my family visiting.  My parents came for a month, and my sisters and nephew came for a week.

The highlight, of course, was grandparents spending time with a new grandchild.  The other highlight was the cousins recurring time with each other. As T and J get older, their interaction becomes richer as both grow in their abilities to deal with other people.

Grandma and grandson at the Carnegie Museum of Natural History

AY has been notable in her responsiveness. As she is the second, we cannot help making comparisons to the only baseline we know. At this time, T was in the midst of colic. In comparison, AY is very responsive, trying out a range of facial expressions when we are talking to her, and vocalizing in call and response fashion. We are also entertained by her kicking and reaching out to things.

Baby looking out from lamb blanket
Hi!
T is still the very good big brother. He likes to tell everyone that AY talks, sleeps, poops, and cries. He also still read and talk to his little sister, and helps with bath and diaper changing time.  However, the novelty is wearing off, and he is not always as excited to help out as he was.

We have noticed that while T is more outgoing and social (talks and plays at pre-school, tells short stories at home), he is regressing in other areas. We have noted that he used to have a relatively long attention span, focusing on one activity longer than others his age before switching. But it has gotten shorter. This is observable when reading books or when making things (Lego or woodworking).  Another not so good trend is that he is becoming more self-conscious of his limitations. Things that he used to try (and do fairly well) are now approached with a statement of "I can't do it".  While he is still a very well behaved and happy child, we do see some of the not so welcome traits that are probably quite prevalent in preschoolers, some that we are hoping that he skips the worst of. Part of this may come with paying attention more to others his age, and taking on their habits, playing, and capabilities. Some of these are fairly innocuous, like growing a liking for superheroes (and yes, there is one kid in his class that bears most of the responsibility for teaching everyone about superheroes) and the fact that he picks up pop culture (everyone knows Frozen, but Star Wars, TMNT, and others are common. I consider it part of my duty to try to get a step ahead of what he learns from his classmates :-) )  But he has also picked up increased instances of the use of the word 'no' and occasionally trying out tantrums to try to get his way. At this point, we are still pretty successful at working our way around 'no' through humor, and we're trying to teach him that tantrums don't work nearly as well as other things (like reminding him of some of the things we can do with him because we are not worried about tantrums at all)


Hi, I love mei-mei
Siblings!

One more month of summer, then both academic parents go back into a full work schedule, but for now, we are thankful that a relatively relaxed summer lets us have this level of interaction with our kids.

Monday, July 21, 2014

Java Cookbook by Ian Darwin: Book review

Java CookbookJava Cookbook by Ian F. Darwin
My rating: 4 of 5 stars

What you want from a programming language cookbook is instruction on the basic tasks that are needed to form the scaffolding that you build around your application. Language teaching and references can teach you syntax and good practices. Topical books can demonstrate how to tasks in the large. But the cookbook is for the small but necessary tasks. And for me, who does not spend much time in the JavaVM ecosystem, the Java Cookbook is a very welcome addition to my bookshelf.

I spend most of my time doing scientific programming in Python and R, but I am starting to return to the JVM because of the need to deploy what I develop. But while other languages like Jython, Groovy, Scala, and Clojure exist on the JVM, to use them well means you need grounding in Java, certainly most of the instructional material assumes more than passing understanding of the JVM and the Java standard library.

I've been building a prototype application using Java as my means of re-learning Java. Where this cookbook has helped me already is in understanding better how to configure projects, more effective use of the Java data structures and I/O, and some utilities. While I know what I need to do through my experiences in other languages, and Java tutorials and references can identify the libraries and functions that I need, the Java Cookbook provides well written examples that I can use to guide me through the JVM.

There are some warts. This book (like most JVM books) seems to be written with the understanding that the readers are web programmers and I think that the discussion of the options available are filtered with that in mind. But this is a very good reference for those times when you know what you need to do, and it is not the type of thing that gets put into a tutorial.

Disclaimer: I received a free electronic copy of this book through the OReilly Blogger program

View all my Goodreads reviews

I review for the O'Reilly Reader Review Program

Thursday, July 10, 2014

Me and My Big Mouse by Ethan Long: Book Review

Me and My Big MouseMe and My Big Mouse by Ethan Long
My rating: 3 of 5 stars

This is a fun book about a boy who has a pet mouse who he has to take everywhere, but the pet mouse is often very annoying. It is notable in that it has a message, that even something we find endearing can be very annoying. My three-year old son has caught onto the idea that something you like can also do something bad (make messes, break things) and be annoying. He does not quite catch on to the idea that this can be an analogy to a younger sibling (has a newborn sister), so he may be a bit young for this.

The discrepancy between word and picture may be hard to understand at this point, as irony is not yet part of his mental makeup. The pictures are cute, and get the point across of so this book is one that he occasionally asks for. And maybe as he gets older, we can reference it when he does reach the point he regards his little sister as annoying. :-)

View all my reviews

High Performance Python By Micha Gorelick, Ian Ozsvald: Book review


For someone like me who is a technical programmer but did not study CS, I've seen hints on how to speed up Python numerical code, but I only had a vague understanding of the principles and application.  This Early Release version of High Performance Python has examples that demonstrate why certain data structures are faster than others in particular situations, and how to use the various data structures provided.

But what may be unique is the chapter on the ways of speeding up Python through compiled code. There are many ways of using compiled code through Python, C and FORTRAN extensions, Cython and PyPy, and more recently Numba. But this book explains the strengths and limitations for each, along with a number of other ways of using compiled code along with Python that I had not heard of before. There are many references for each of these, but no general overview of this group of resources.

This is still an Early Release stage, so there are some warts. Many of the code examples are raw, and you have to know what you are doing to fill them in and get them to work. A website or Git repository with the source code examples would be very helpful.

Disclaimer: I received a free electronic copy of the Early Release edition of this book as part of the O'Reilly Press Blogger Program.

I review for the O'Reilly Reader Review Program

Sunday, June 29, 2014

Parenting month 44: 2 adults and 2 kids

Two parents and two carriers
There are four of us

This month was notable for a slightly uncoordinated grandparent shift change, so there was a two week period where no grandparents were around, and we became the classic two parents, two kids nuclear family.  And we were in the midst of a traditional one-month confinement, so we had to figure out how to do things and keep the three year old from tearing up the house (as active three year olds who stay indoors will do naturally).  One week of full time day care helped, and T joined daddy on a few father-son outings.  One of those outings was participating in a Red Cross shelter operations training exercise, where he got lots of praise for being a very well behaved three year old; including following daddy from station to station, listening to instructions, role playing a three year old shelter resident, generally entertaining himself during most of the practicums, and taking an active role in the shelter setup station.

T is generally a well behaved three year old. Preschool reports he follows instructions, and now he plays and talks with the other kids and the staff.  His name also is showing up as part of the estimation game (the teachers show the kids in the jar, and some of the kids call out their guesses as to how many things there are which the teachers record, I think between 1/3~1/2 of the kids make guesses).  And of course, he likes going on outings with parents, but he tends to freeze when interacting with others in public. We think that it is a feeling of security issue, if he is secure with us, he will interact, but in different or more exposed environments he gets scared and closes up/freezes.

AY is in her second month. Given that we only have one other child to compare her to, we think that she is quite active.  Her eyes seem to track, arms and legs are being experimented with, and arms seem to go in the same general direction as the eyes. And she has a range of facial expressions. T likes to announce when AY smiles at him.  She has also figured out that when she is in a rocker/bounce seat, kicking makes the whole thing rock. She has the same expression on her face when taking a bath, if she kicks hard enough, the water splashes out of the tub (and usually onto whoever is giving her the bath). Her first experiences of being able to manipulate her environment :-)


Recent research says you should read to newborns.
Recently published research says we should read to newborns.
The other thing with reaching a second month is that there is now a difference between the normal discomfort of being out in the world and specific discomfort.  So AY now has a proper infant cry when she is hungry (which is different than a dirty diaper or sleepy), and she has a very good pair of lungs, just like her brother (proper as a progeny of parents who have run marathons).  And like her older brother, we have noticed the coming of rashes. But this time we know it is diet so the next phase is to see if we can do better than the first one in limiting the suffering (all around).

Next months big thing, the whole family is here!

Saturday, June 21, 2014

First try at gardening: seedlings

Planting parsley and oregano
Adding soil for seeds

This was my first time trying to garden.  The real motivation for doing this was to give my son something to watch grow over the summer. Which means we start in winter/spring. Since I did not care too much about how successful this was, we started from seeds.

First sprout of a marigold
First seedlings
Lesson 1: Using egg shells really does not gives seeds much room to start.

I started seeds in egg shells.  First mistake was not filling them to the top with soil.  In hindsight, the soil in the egg shells gives the seeds room for roots and also protects the seeds from shock.  About 2-3 weeks into it, just as the first seeds started germinating, they got moved outside to be shocked in preparation for transplant, which pretty much killed my entire first batch of seeds :-(

When I finally got some ready for transplant, the problem was that the roots did not have much room to grow in the shell, so I was essentially transplanting a bare plant and roots.  So I probably lost a pretty large portion of these.  One thing that worked better was transplant into a small container that had a few inches of depth, then plant them.  One other thing I would do next time is to put 2-3 seeds per shell, under the understanding that 1 will survive the transplant process.  More than that gets crowded.

Lesson 2: if using egg cartons (or anything else that gets transplanted into the new container, punch holes in the bottom and sides to give water and roots room to a way to get out of the container.

When things got transplanted to small containers (mason jars or something else) they started to grow fast. In particular, the mason jars that I transplanted into (usually 3 egg shells each) quickly got overcrowded, and I ended up pulling out about half of them to transplant outside.

The main destination for these various herbs (basil, parsley, oregano, rosemary and marigolds for variety) was to go in a container garden in the backyard. My containers were built around a tomato, some pepper, and a strawberry plant. Each got an assortment of seedlings that were grown from eggshells.  So at this point, they are all established.  The ones with the tomato are suffering because the tomato is growing very well (and sucking up water and light).  I probably have the pepper container a little crowded (I've been pulling oregano out to make more room.)  And there are a few things that I've been planting in our unused front, just to see how they survive.  And there are a few herbs that we are growing inside, just so they are easier to look at (and we are starting to harvest from these)



Tomato and peppers in containers.  Peppers are newly staked using bamboo.
Tomato and pepper containers

Tuesday, June 03, 2014

Parenting month 43: And now there are two

Are you my brother?
Are you my brother? Are you my sister?
The big new development of the month was the arrival of a sibling. As the ge-ge (big brother), T has been a very good helper. Enthusiastically getting diaper and breastfeeding supplies and disposing of the results as needed. Reading books to mei-mei (little sister), taking pictures, even playing the violin.

Of course there are other developments over the past month. T has gotten much more verbal and social at pre-school and at home. Part of this is normal development (it was going to happen eventually as he got more comfortable), and part of this is having to compete for attention at home. You can hear and feel it when T is in the house. Being more verbal has lead to a marked improvement in his assessment at preschool. It may not be as much as he is more capable (well, he is somewhat), but he know can let the staff know that he knows things like his numbers, letters, and can express them. In addition, he interacts more with the other preschoolers. When I go pick him up he is playing dolls or dress up or building things with the others. And, of course, there are still things to build and measure around the house.

Measuring the finished folding workbench
Measuring the work table

AY is settling into her new home.  She is doing the traditional newborn responsibilities of eat, poop, sleep, and cry ably.  She also has her time of quiet wakefulness, noted by continuous motion of arms and legs when she is awake and content.  Other than the standard newborn issues of thrush and reflux, all is well.

Grandma meets granddaughter
Grandma meets granddaughter

Next thing up is a grandparent shift change.  Mom is taking the traditional one month of confinement, but lau-lau and yeh-yeh have returned to China for a brief period.  Khun Bu and Khun Yaa are on their way, but it will be a couple of weeks without them, so we will be the two parent - two child household for a while.  Good thing that both academics are on a lighter schedule for the summer.

Monday, May 26, 2014

Kids Are Icebound by ‘Frozen’ Fervor - New York Times

Kids Are Icebound by ‘Frozen’ Fervor Disney’s Animated Film ‘Frozen’ Has Some Children Obsessed By JOANNA COHENMAY 16, 2014


Like a very large portion of the population with children of preschool age, we were caught up in the Frozen craze.  The movie came and went without much notice, but by the time that the singalong version came out in the theater, T's entire daycare was singing it.  He had even started to learn the words to 'Let it Go', and we felt compelled to find the video so he could at least learn it properly. We saw multiple videos of it, T somehow finds everything about Frozen, even a video series of styling hair according to  the main characters.  And we put it in our Netflix queue so that when it came out we got it and watched it a few times.  But with all that saturation, I still think it is a very good movie.

1.  The Let It Go video is a great level up sequence. In addition to the song being an anthem to independence, the music video is a great sequence of a character growing in capability. The character of Elsa is shown creating ice and snow figures in increasing complexity as the song progresses, which is how people learn skills in real life.

2.  The characterization is meant for good role playing. I found myself thinking of the characters as Fate core, Fate Acceleated, or Risus characters, with strengths, weaknesses, troubles, character traits that get compelled and applied in many ways.  And the way the characters act is basically a superhero team-up story line, with the main characters learning how to work together as they go.

3. The characters have strengths, weaknesses, and character traits that help and hinder them (a plainer way of stating 2).  The things that makes each character strong and compelling are also the things that gets them into trouble. No Mary Sue or damsel in distress characters. Even the bad guys have strong characterizations (which is why it is hard to recognize the bad guy)

4. Even the ditzy one has strength of character, to include strength in the physical world, not just amorphous inner strength.

5. A female lead has as part of her characterization "likes math" (specifically geometry).  Math, physics and chemistry matter in this world.

6.  Relationships are not just about romance. The tendency of people to think that relationships are only about romanced is addressed by the problems it causes and the fact that the key plot point is that the characters make this assumption and forget that the prophecy could be referring to other types of love.

Now, we still think that other sources of songs such as Sound of Music and Les Misarables are more welcome than Frozen, but for a film that is a source of influence, Frozen is not all that bad.  And, to answer the question in The Motherlode (NYTimes) article on the subject (Parents respond to the 'Frozen' frenzy), we are of the opinion that the Idina Menzel version of 'Let It Go' over the Demi Lovato version.

Monday, May 19, 2014

A week of siblings: Parenting

Holding little sister

As a mid-month update, our big parenting news is that instead of having an experiment of one, we have an experiment of a pair. We have of course been using books to get T used to the idea that mei-mei (little sister) was coming, and reading books with him about being a big brother, and letting him feel mei-mei in mommy's belly, and helping in the preparations for mei-mei's arrival.
I have to set up the sleeper I made for mei-mei

But with all of this we have always wondered if he really understood it (other than those times where he clearly figured out that having a little sister would mean that there is less for him). Well, now she is here. At this point it is a lot of excitement to have something new and small in the house. One of the most vivid memory he has of mei-mei first night back was of her pooping (for the first couple days, newborn poop is black meconium, and she was pooping during a diaper change so he got to see it.)
 Reading a bedtime story for baby sister

There is definitely an element of excitement. And there are things he can do, like read books for mei-mei. And he likes to take pictures of mei-mei.

Photo shoot in progress

And pictures with his new little sister.
We're having a photo shoot of my baby sister

A recital for baby sister

He has figured out that he now has competition for that scarce resource called mother's time. So we notice that the house is a little louder now with him talking very loudly, making sure he has people's attention. We have him sleeping with daddy every night now (he has never been a good sleeper) and there were a couple nights where he wanted to go with mommy, but that has ended (with the realization that it is very easy to bargain daddy up to five books at bed time instead of only two or three) But, at the one week point, big brother views little sister as a little doll that sometimes makes a bit of noise, and he remains very happy, if very talkative and loud. But mei-mei does not seem to mind either. So far so good.

I love my baby sister

Sunday, May 18, 2014

The Human: War of the Seasons Book #1 by Janine Spendlove

The Human (War of the Seasons, #1)The Human by Janine K. Spendlove
My rating: 4 of 5 stars

The Human is about a 17 year old named Story, who has lost her family and has been spending some time driving away her friends. While spelunking with her remaining friend she goes through a portal and comes out into a world where the once immortal race of elves is slowly dying away and as a human she holds the key to ending their curse.

The story aside, the book is about a lonely and somewhat socio-phobic young adult thrust into a fantastic setting. And while physically competent as a young adult (she is a spelunker, and good with a knife and bow), the people she meets in this new world are wise to the ways of the world, cunning and remorseless. And her wits are not helpful and her people skills are not much better in this setting. So The Human is her learning how to deal with others instead of being the outcast teenager she was. She learns (mostly by mistakes) about reading people, of considering the motivations of others, of having trust betrayed, and trust rewarded. She has relationships that are purely manipulative, some that are genuine care, some that are sacrificial, and even one that is without any agenda. And as she goes from an isolated teenager into a young adult with a range of relationships, her view of the world and her place in it grows.

There is a romance in the book with the female protagonist. But I appreciate the fact that she had a chance to become competent as a person (both in skills and how she related towards others) and other aspects of her growth were more important than the relationship for most of the book. And that this growth is what made her attractive to the other person in the end.

This was an engrossing story. I liked following the main character's growth as a person, and how it fits in with the overall story. I'm looking forward to the other books in this series.

View all my reviews

Friday, May 16, 2014

Notes from teaching data science for the first time

Drew Conway Data Science Venn Diagam
I spent this past semester teaching a course in data science. While there has been a data mining course taught in the department, it is offered irregularly and had a different focus.  The premise for the course I taught was that data science was the intersection of data hacking, mathematical and statistical methods, and domain knowledge (with props to Drew Conway). The students I had generally had little to no programming experience (or meaningless background). All have had a first course in statistics.

I used two texts. First was Stanton Introduction to Data Science, which is used in the Syracuse Data Science certificate program.  Second was Introduction to Data Mining with R by Luis Turgo.  All of the students were also told to go through Introduction to R prior to the beginning of the course (or as early as possible).

The class started off going through Introduction to Data Science, which included a few introductory chapters to data analysis, and introduction to R and the R Studio IDE.  Then were chapters on some basic methods at the basic level such as text processing, review of regression.  Then additional methods such as association rules and support vector machines.  We then switched to Data Mining with R which were a series of case studies.  Each case study had some form of data munging (manipulation) required, with the first one having an involved demonstration of how to handle missing values, either determining the correct value or removing as appropriate.  Each case also had a lengthy discussion of the methodologies used, with what each is being used for and a basic understanding of how it worked and its implementation using libraries in use with R (there is a book package, but it has mostly data sets and some functions to assist in data manipulation and visualization.

The assignments were built around individual projects. Their were three presentations, exploratory data analysis, preliminary data analysis, then final. The first two they could work together, but the final one had to be solo as they needed to have individual topics (even if they used the same data sets). The intent was that these assignments would build towards a final goal (but they had flexibility to bail if they wanted to mid-semester.

Probably 1/4 of the students found projects off of Kaggle, which is useful because it has a nice complex data set and comes with a legitimate question.  Another 1/4 of the students used public health as a motivating area (University of Pittsburgh is home to Project Tycho, which is a rich dataset of infectious disease in the U.S., also, there is a joint program with the Department of Industrial Engineering and the School of Public Health).

Some problems that came up. First, I discovered that many of the students had an operating assumption that all data was normally distributed, and they constantly made claims that their data was normal. Even when the data was noticeably skewed.  This was embarrassing when they would make statistical tests, and the test graphic would include the corresponding normal approximation which was nowhere near the data. I eventually figured out that for many of them, when they took statistics they were constantly fitting normal distributions in their homework data sets, so I explained that their textbook problems were written so that their would be a normal distribution to find.

Another problem was the lack of a hypothesis.  Many students started to pick problems that could be solved through linear regression and declared that because it met a p-value criteria they were done. (and in some cases, I recognized the data set as being a teaching data set). But even though they could fit a regression, there was no theory on why the data related in a given way. Essentially, they were pushing data through an algorithm without any subject understanding.  Most (not all) of them got the ideas by the end of the second presentation.

A third difficulty was skipping the model evaluation.  Most of the methods covered have some parameter that was the analysts choice, so they should have explained how they chose the value of that parameter.  Generally, this should have been a discussion of making the tradeoff between closely approximating the observed data and overfitting.  Some students skipped this completely (essentially, this is what would happen if you fed data to an algorithm then reported the result using all default values)

One big observation I had by the first presentation was being able to identify the level of programming ability by the choice of projects.  I strongly suspect that a number of students were minimizing the programming required.  But that became reflected in the level of ambition of the projects.  Non-programmers tended to choose simplistic data sets with little variety.  I think the difference is the workload.  People who could program were able to slice the data available on a multitude of dimensions without regard to scale, since the computer would do all the repetitious work, while those who could not program generally were reluctant to have large sample populations or multiple data sets on the same population.

Things for next time.  First, impress on them the need to learn to program.  Essentially, the projects from those who could program were so much richer than those who could not (even at a low level of programming skill) that I was embarrassed for those who could not program.  Second, I should push harder on the need to have a hypothesis that was driven by domain understanding of the problem. This should be pushed harder from the very beginning to discourage people from merely pushing data through statistical methods and reporting results.

For teaching data mining, I think that the organization of the course needs more methods focus. The principle text was case driven, but that meant that methods were being introduced in a fairly arbitrary sequence.  I ended up doing a methodology focused review over the last few weeks. What I should do next times is after the introductory section (Stanton Introduction to Data Science), have the next several lectures be a tour of the classes of data mining methods (regression, classification, clustering, feature selection), then do the case studies.  One resource I found useful in this are articles from the Journal of Statistical Software, many of which are focused on R packages that implement classes of methods.

This was a very good course. I wished that the students did more participation (by the final presentation, there were some points that were given based on shear quantity of comments, which several students took advantage of). Some of the projects were much more ambitious than any other done in the MS program. And I have a lot stronger argument about the need for the graduate students to know scientific programming as a skill set.

Sunday, May 11, 2014

Data Mining with R by Luis Togo: Book review

Data Mining With R: Learning By Case StudiesData Mining With R: Learning By Case Studies by Luís Torgo
My rating: 3 of 5 stars

Data Mining With R (DMwR) promotes itself as a book hat introduces readers to R as a tool for data mining. It teaches this through a set of five case studies, where each starts with data munging/manipulation, then introduces several data mining methods to apply to the problem, and a section on model evaluation and selection. It fills a place in the literature since it devotes a lot of space for data manipulation before applying the various methods and model evaluation afterwards. But it is hard for people learning data mining since it spreads the types of model throughout the book.

I used this as one of two texts to teach data science to people whose programming and data analysis skills were generally at a very low level. The big advantage of using a programming environment such as R for data mining is the fact that you can do data manipulation in the language, then apply the methods. Many of my students have taken machine learning elsewhere, but they always used prepared data sets, so this emphasis on data manipulation with several very disparate data sets is a unique feature.

The second big advantage of this book is the focus on model selection. For each chapter, the book goes through the exercise of determining which model should be used, and how to diagnose the model to determine which one is appropriate and best for the problem. I especially appreciate the fact that in some cases, the conclusion of the book after model evaluation is that the method did not work for the problem and question at hand. Because most textbooks focus on demonstrating that you did find something, in some cases my students get confused when in real problems they did not find an effect.

Where the book is lacking is the fact that the methods are scattered across the case studies with minimal organization. While this is a result of the realities of the cases, the book would have benefited from a roadmap chapter or introduction that gave methodological context (i.e. what methodologies are used in the book and where they are). This lack made it very difficult to use as a textbook, and by the time I was done using it I was essentially building the roadmap to use the book. This makes it not useful as a standalone textbook for such a course, but very good if there is another text that gives the overview of the methodologies.

View all my reviews

Thursday, May 08, 2014

Making a folding worktable

First project of the summer was a folding worktable. The workbench I made last year is nice, but it is currently in use as a table sitting in the landing. In principle, it can be moved to the garage or the back patio as needed. In practice, it is hard to see that happening without a major cleanup effort. So I wanted a larger worktable that was still portable. The Black & Decker Workmate is too light for the task, and the sawbench I have is too small and low (but it is good for variety, and I still will need somewhere to sit)

I am using the worktable design that is described in a series of YouTube videos by "LJ Magnum" (video is at bottom of the post). The structure is made up of 2x4's, so it is rugged and stable. The top is a pair 1x10 boards, so the top is fairly tough as well. The folding part is provided by 1" dowels, so it is stronger than it would be if I used hinges.

First the wood. Richard Arendt posted plans based on these videos at http://hiswordinwood.com/plans_and_tutorials. I needed two 8' 2x4's, one 8' 1x10, one 36"x1" dowel, Cut list is at the posted plans.

Next was cutting the legs and supports. 22.5 and 45 degree angles were needed so that the table will be stable when opened. I cut these using a jigsaw. A jigsaw going through 2x4s is pretty rough, so I went back over them with a oscillating multi-tool and a file and sandpaper afterwords. What I really need to do this is a circular saw.

Lumber and boards for a folding workbench
Lumber cut by Home Depot


To drill in holes in the legs and tabletop supports I used a cordless drill and a drill guide. 1" holes through 2x4s was a pretty heavy burden on an 18V cordless drill. I had to use both batteries. If I have to do this again, a corded drill may be useful. It was the first time I used a drill guide, which worked pretty well. One thing I learned is that when drilling a hole, it always makes a mess at the end. So I learned to detect when the tip of the drill bit broke through, then flipped it around and finished it from the other side. I used a chisel to cut away the mess (which was now in the middle instead of the service of the 2x4) and I used a round file to smooth out the hole (and made sure my 1" dowel would go through).

The Wolfcraft Drill Guide
Wolfcraft drill guide and cordless drill

I used the plans to assemble the legs and top supports. A long dowel when across the top with the inner support and the inner pair of legs. On each side, the two legs and the outer leg and outer support were each connected with a short piece of dowel. For each dowel on each side, one piece was screwed in, the other piece was free to rotate around the dowel.

Legs and supports for a folding workbench
Structural components of worktable

Finally, I put the top on. First, for each of the two 1x10 boards, I picked a side to be on top (the one with fewer pits around knots). Then I picked the sides that best fit each other, using a surefile to make the fit a bit better. Then I drove screws to attach them to the supports (and messed up which support went with which top along the way, so I had to redo one side)

Folding workbench folded up
Folded worktable top and front braces

The result is a folding worktable. It is pretty stable due to the mass of the 2x4s that make up the legs and top supports and the use of the 1" dowels as joints, more than a commercial folding worktable with metal legs and bolts for joints would be. And it is fairly large. The fact that it is about standard table height also means that it can be used as a table for other things, like a folding table for eating that is much more stable than the norm.

The finished folding workbench
Completed worktable

Folded up folding workbench
Folded up worktable standing

I'm pretty happy with this one. Folds up nicely so I can put it out of the way, and stronger than most comparable folding tables. And I learned a few things while making it. A successful project.

Monday, May 05, 2014

Agile Data Science by Russell Jurney: Book review

Agile Data Science: Building Data Analytics Applications with HadoopAgile Data Science: Building Data Analytics Applications with Hadoop by Russell Jurney
My rating: 4 of 5 stars

One of the problems with data science is that any description of what is encountered takes on the appearance of a mythical unicorn, noone person could possibly have all of the skills required. And it gets worse when you add to the standard set of statistics, domain knowledge, and programming the ability to deploy the application into a high speed environment. This book is not going to make a data scientist an expert in running a data center, but it is useful to give someone who has the rest of the skills an understanding of the environment their work will be deployed into.

One of the conflicts between the data scientist/analyst and information technology groups is that while the data scientist gives the data owned by the organization its value, IT is charged with storing the data and providing the access. And in a high velocity, high volume environment of big data, not understanding how the architecture works can lead to the data scientist creating valid solutions that cannot be applied in the actual day to day working environment. That is where this book comes in. The book has associated virtual machines in software repository so that the data scientist who does not know anything about infrastructure and the software stack that the data and the analysis rides on can see how everything fits together.

The book title is misleading. This is not a book about data analytics. This is a book for data analysts so they know how their analytical application is deployed and applied to day-to-day use in enterprise environments. For that reason it is useful.

View all my reviews
Disclaimer: I received a free electronic copy of Agile Data Science as part of the Oreilly Press Blogger program.
I review for the O'Reilly Reader Review Program

Friday, May 02, 2014

Parenting Month 42: Gender roles for preschoolers

I need to turn this to get the eye in the project
Making a birdbath at Home Depot
Earlier this month, a girl at church around the same age as T told him that he could not sing songs from Frozen because he is a boy.  Fortunately, his friends at daycare don't care so much about who is singing what.

When T was born, we did not care if T was going to be a boy or girl. When we were given clothes we did not care, figuring a baby can wear lots of pink stuff and not care (we do draw the line at wearing dresses though).  We always figured that kids develop gender roles on their own time, so we did not feel the need to hurry it along. And in the meantime, let him develop a range of interests.

Planting parsley and oregano
But the reason for being deliberate about this is not because of the pre-school years, where things like dresses are merely cute. The issue comes when this is a pattern, when this becomes statements on what someone can and cannot do.  I was talking with an undergraduate whose senior research project I was mentoring about the need to not lose talent because of preconceived notions of what people could do.  Previously I've had those conversations with students about why diversity is important, to increase the pool of talent that can be drawn from (of course, if someone is doing something where there is no problem to find a mindless, unskilled workforce, I can see why diversity is not an issue).

What is the alternative?  When it can become acceptable to viewing entire categories of people as without value and as things unworthy of being considered of worth. When I was in grad school a friend commented that it was of no use to make friends with christian females because they would just get married and end any friendships.  Another friend viewed it as a profound act of disloyalty for believing that his girlfriends life was of value and responding to her calls for help in the backcountry. A pastor declared that a girl I was seeing as well as any other friend of mine were social freaks, while trying to convince me that I was romantically interested in a girl whom I never made it to the point where I could recognizing her name.

The alternative to rejecting gender roles, as presented in this middle-to-upper class American society is to claim that they have nothing to contribute to the wider world.  That there is no need to recognize that a person has views, ideas, thoughts because of her gender.  That there is no value in recognizing a person other than visually, because there is nothing there to learn.

Are there people who want it that way? Certainly. It was certainly promoted by some of my fellow graduate students.  I have heard it in churches, both Chicago and Pittsburgh.  And if there are people who want to be known only as a possession or as something to look at, it is their right.

But that is not the world that I live in. My world is one where the rarity of talent drives its economy. My professional world is one where I've been taught to think about developing talent over years, and things like childrearing are only a small part of that. And it certainly is not useful to think of entire classes of people as freaks or merely eye-candy without individual evaluation.

We had made a choice not to push gender roles before they are needed on our children. It means that they have choices on their interests, hobbies, and careers. And we hope that it means that they will surround themselves with people who they evaluate based on competence and depth of character and insight, not the surface actions of people who do not wish to be anything more than a figure to be viewed from a distance.