Saturday, February 27, 2010

Not so colicky after all

My son cried a lot during his first six months. Wikipedia says about baby colic that

Having ruled out other causes of crying, a common rule of thumb is to consider a baby "colicky" if he or she cries intensely more than three days a week, for more than three hours, for more than three weeks in a month.

How intense is intensely? It sure sounded intense to us, his parents, and we could only lessen it by carrying him around and trying to soothe him. One singular time he was inconsolably out of reach of our helping hands, so we called immediate medical assistance (and at that point he quietened down). We were getting exhausted, and my wife even got complications with one knee out of it.

Eventually, the worst of the crying died out after he started getting regular naps. He was some six to seven months old at that time. Some helpers along the way for us were:

The main theme of both books is that sleep is an essential prerequisite for the well-being of small children.

The first was originally published in 1987, but has been revised later. My copy has a different cover than the one on Amazon, and was first published in the US 2003. The main take-away for me from this book is simply this: The cry-it-out method, aka. Ferber's method, works. This may not seem much, but it made us want to try the method out once more, after having botched it for our first kid. (The book is over 500 pages, so let it be noted that it contains a whole lot more useful information. I still pick it up from time to time.)

The second was published in 2008 and simply states that babies are naturally equipped with a basic rest and activity cycle (BRAC, discovered in the 50s). The same thing is true for adults, but the news here is that it is more pronounced for babies: Ninety minutes after waking, the baby is ready for some quiet time. If you latch on to this, the child will develop healthy sleeping habits.

The 90-minutes cycle Moore tells about turned out so precise that I am convinced they reflect a biological truth. 90 minutes after the little prince wakes, he is often tired and needs some adult contact if it is too early to sleep. 15 minutes later he is again in high spirits. If he is not put in bed before 180 minutes have passed, he misses his nap, and chances are that he'll become overtired, cranky, fussy and not in a good mood at all. This is most important: Postponing the nap 15 minutes or half an hour because the adult finds it convenient (let me just get this done, I'll be super fast) ruins the sleep of the little one. (Addendum: Applying Ferber's method, hoping that the kid will just fall asleep exhausted from screaming soon is not as simple as it seems.)

Six and a half months old, the little prince quickly established a pattern of three daily naps. The first 90 minutes after he stood up, the second 90 or 180 minutes after the first, the third 90 or 180 minutes after that.

He'll be 10 months in less than a week, and is down to two naps a day. The first three hours or four and a half after he gets up. The second three or four and a half hours after the first. He is so happy and well attuned that he makes it easy for a father to be proud he is a father.

How many occurrences since November the 1st last year?

AWK is just great! It's just amazing how powerful one-liners you can craft.

But since I never really need it - as in "I couldn't have done this/my job without it", I seldom use it, and tend to forget the most useful invocations I find.

So... here's a useful one-liner I'm sure I'll need to look up again sometime.

myhost $ awk '{op[$6]++} END {for (o in op) print o, op[o] }' access.log

  • access.log here is a server-side file logging each invocation of some web service methods. (not that you should care :) The file has a rigid structure: One line per invocation containing method name, caller, timestamp.
  • op[$6]++ Constructs a hash table named op with method names as keys and numbers of invocations as values. (Default field separator is whitespace.)
  • When the file has been processed, the results are printed out
Throwing in a date is easy, and can be useful:

myhost $ awk '{$1 > "2009-10-31" && op[$6]++} END {for (o in op) print o, op[o] }' access.log

Monday, February 15, 2010

So how's your day?

I'm fine, thank you. In fact we're fine :)

Only ... when the baby prince crawled around without diapers, he did something unmentionable that left his clothes and the floor all yucky.

And the princess had a bad cough so she stayed home from preschool. She was in a good enough form to run around and drop and crush a glass bowl with corn, though.

Well, the floor surely needed a washing anyways.

Ok, it's noon now, so things can only get better from here, right? ;)

Wednesday, February 10, 2010

Let's get this on the road

According to surveys - and no, no references here backing this up; I am too lazy tonight - the popularity of blogging seems to dwindle, especially amongst younger people.

Well, here's some evidence I am nearing my 40s!