Friday, November 15, 2013

The joys of having a haircut

One of the great things about getting a haircut besides the feeling of freshness, is the enjoyable conversations that I have with my barber. The conversations usually span multiple topics, and are mostly random, but sometimes we chat about technology, and it is always great to get the perspective of someone not embedded in the field.

Last time we talked about how the younger generations are using technology to communicate. My barber made astute observations about the topic, gleaned from his observations on how his kids, nephews and their friends communicate. It was interesting to learn that despite having cell phones, the younger generation has forgone all types of voice communication on the mobile device, and instead has opted for text messages and instant messaging. My barber was complaining that his kids rake in thousands of text messages a month, and if he did not select the right cell phone plan he would have gone broke by now.

Despite not using voice communication on the mobile device, they did the opposite on the computer, using Skype to communicate exclusively through videos. When I asked him about where do they play games, I was surprised that he mentioned they were not interested in using gaming consoles for entertainment, but rather using the computer and the mouse, just like how we did some time ago. And of course they play games on their mobile devices, which does not bode well for console manufacturers, and specialized handheld devices.

Thursday, November 14, 2013

It is not just about the hardware

About a year ago I switched from the iPhone to the Samsung S3, and was initially pleased with the switch. What's not to like about a bigger screen, better technical specs, and easy expandability and connectivity.

As I gained more experience with the phone, I started getting annoyed by the quality of the software, the inconsistencies between applications, and all the wonderful carrier add ons that I could not remove from the phone, unless I rooted it. And not to mention the dropped calls and the garbage collections that rendered the phone unusable at times.

The poorly written software and the carrier add ons drained my stock battery so quickly even with minimal use, that I had to replace the stock battery with one that has 4x the capacity to get a usable phone. The replacement came with its own inconveniences that a bulky phone brings.

It made me think about how a superior hardware spec and a bigger screen do not necessarily make a good phone, and that the unified experience of good software and a decent hardware does. Sadly it is time to switch back to an iPhone.

Thursday, November 7, 2013

Amazon knows when I finish reading books

Recommendation systems are in wide use today, and Amazon's website is a prime example of that use.  In addition to the recommendations on the site, whenever I buy a new Kindle book, I receive emails with recommendations for other items I would be interested in. The recommendations are usually spot-on, and I end up buying more Kindle books, and the cycle continues.

Recently I noticed that whenever I finish a Kindle book, Amazon sends me an email with related books that I might be interested in, which is pretty cool if you ignore the fact that an algorithm is watching when you finish a book, and triggers a recommendation email to entice you to read more.

The feature might have been in place for some time, and I might not have noticed it, were it not for a very long book that I was reading on and off over the last year. After I was done, I received an email recommendation for other books by the same author, equally as long. Even though the recommendations are good, I am sure I am not going to buy these books any time soon.

Wednesday, November 6, 2013

F.lux and custom color temperatures for Mac OS X

There is something to be said about using computers before going to sleep, and the effects they have on how well we sleep at night.  The authors of the free software F.lux believe that one of the reasons for the sleep disruption after using a computer is the color temperature of the screen.

They postulate that computer screens are designed to feel like sunlight during the hours of the day, which is great, but they don't change how they look at night, which is not so great. They designed and implemented the F.lux software to warm up the screen as the sun goes down. And to make things easier, the software can automatically read the location of the computer, and adjust the warming schedule accordingly.

The software is free, and works on Windows, Mac, and the jailbroken iPads/iPhones. I have only tried it on the Mac, and while I cannot attest to any changes in my sleep patterns, I admit that the screen looks a lot more pleasing at night: warm and soft, unlike how it looked before. 

Tuesday, November 5, 2013

Samsung S3 and the poor battery life

I have had my Samsung S3 phone for a bit over a year, and the most annoying thing for me is its poor battery life. I mainly use my phone for work email, with the occasional phone call or text message, and the minimum Internet browsing, and despite that light usage, I can barely survive a day on a single battery charge.

I used every trick possible, from power savings mode, to manually syncing emails and accounts, and finally through installing Juice Defender, an Android application that turns off most of the unnecessary radio antennas when the phone is not in use to maximize battery life. The most I got was almost 10 hours of usage without charging. Better than nothing but not ideal.

I attribute the poor battery life to the poor software that runs on the device, including Samsung's and AT&T's add-ons, that I cannot uninstall after their latest update. Most of that background software eats up the battery in no time. Barring a software fix, a hardware answer would do.

An Amazon search opened up the wonderful world of extended batteries. The official S3 battery is roughly 2100mAh, but there are a lot of higher capacity ones online. The downside of the higher capacity batteries is that they need a new case for the phone, because they are thicker than what the original plastic back can accommodate.

I liked the Hyperion 7000mAh battery, and I figured with such a high capacity I should get at least 2 days on a single charge without worrying about losing power. When the battery arrived I was surprised at how thick it is, and after installing it with the new honeycomb back, my phone looked like a brick phone from the early 90s, and weighed probably as much. The battery came nearly uncharged, and the instructions recommended charging it overnight for 8 hours for 4-5 battery cycles till the battery is conditioned. After that break-in period, a normal charging cycle is good enough.

I am still at the early days with this high capacity battery, but so far all signs look positive, despite the thick form factor. I only wish device makers and network providers wrote better software.

Friday, October 25, 2013

Software Requirements 3, by Karl E Wiegers, Joy Beatty, Microsoft Press

One of the areas often overlooked when writing software systems is thoroughly understanding what needs to be developed. Specifically who are the users that are going to interact with the system, what are they trying to accomplish with the software, and how is the system expected to behave under normal and error conditions. In short, developing software requirements and specifications before the software is written.

"Software Requirements 3" addresses these questions, with clear answers and advice in a rather longish format of roughly 673 pages.

The book starts with a story about the importance of software requirements: a case of an employee who changed her last name without getting married, and the accounting software's inability to handle the change, with the repercussions that the employee will not get paid until the the "bug" is fixed. The book mentions that this is not an atypical situation, and that 
... errors introduced during requirements activities account for 40 to 50 percent of all defects found in a software product
The book proceeds to explain how to prevent problems like these from happening in the future, through explaining the mechanics of requirements gathering starting with defining who the customer is, and who the decision makers are, followed by a tour of the requirement gathering process, including requirements elicitations, and appropriate documentation.  The book advocates readable, concise, and precise requirements documentation, and ample use of imagery to explain difficult concepts.

The book offers advice on how to reduce development risk, through frequent customer checkpoints as things are developed, to minimize the mismatch between customer expectations, and what developers build. The book also advocates building prototypes to illustrate concepts, and drive conversations to minimize the gap between what's being build, and what customers expect.

The book addresses the often ignored fact that requirements frequently change during the development process, and offers a full chapter on handling these changes, and tools for managing the changes.

The book is geared toward the business analyst, but software engineers would benefit greatly from reading it. And despite the book's length, the authors' writing style is approachable, and it was a pleasure to read.

Sunday, October 6, 2013

Sign language

One of the frustrating things for new parents is that their baby's communication is usually 1-bit: the baby is either crying (on), or not crying (off). When the baby is crying it is for different reasons. They could be:

  • Hungry
  • Sleepy
  • In need of change
  • Hot
  • Cold
  • Over-stimulated
  • Bored
It is hard to decode these competing and sometimes conflicting needs, although some people claim they can from the tone of the cry, and its duration. Lucky them.

Most parents look forward to their babies' talking so that they can communicate their needs. What they don't realize is that when the talking stage arrives, so does the arguing stage. I am looking forward to that.

It turns out we don't have to wait that long. We can teach babies sign language early on, and it will help them communicate their needs through signing as early as 6 months, which sounds like a blessing. There are a ton of videos on youtube that teach baby sign language but nothing beats attending a class, especially one that gives you the history behind the sign, and why it was chosen to mean what it represents.

The class was short and sweet, an hour and a half, and covered about 60 signs that you can teach your baby that are relevant to their needs as they grow. The most important ones to remember are of course milk, hunger, thirst, sleep, hot, change, cold, bored, over-stimulated, toilet and poo, but there were others such as walk, run, jump, stop, go, and colors. The signs are relatively simple to perform especially before the baby's finer motor skills develop. I can't wait to use these.

More water please

At work I always enjoy chatting with our lead designer, who is also a strongman, and competes in strongman competitions. In addition to talking about design, I love to pick his brain about how to become more healthy and fit, and he is very generous with his advice and the lessons learned during his training. One day I noticed that he is filling a huge one gallon bottle of water, and I could not resist to ask why.

He explained that he needs to drink more than a gallon of water everyday, and that without measuring how much water he consumed, at the end of the day he's not sure if he hit his goal or not. I was intrigued, and decided to see how much water I drank everyday, even though I had no intention of matching his consumption.

I bought a 1 liter bottle of water, and set to drink 3 liters of water a day, as the Mayo Clinic recommends. To my surprise I discovered that I am no where near the recommended quantity, even after factoring in the incidental drinks I consume everyday--coffee and soda.

It was an eye opener for me, and as the management adage says: "you can't manage what you don't measure", you can't improve what you don't measure. Armed with a simple and easy tool to see the amount of water I drink everyday, it became a game to improve on it, and you could not beat the simple feedback.

There is something to be said about simple tools.

Sunday, August 25, 2013

Hungry for Change -- the documentary

Documentaries about food and health are almost always controversial, especially if they include a view on dieting and weight loss. They end up espousing a myopic view of how to lose weight and be healthy, and lose the viewer who is a long time skeptic after seeing a lot of fad diets come and go.

The documentary "Hungry for Change" was a pleasant change. It focused on giving out balanced information on how the US as a nation has a high percentage of obese individuals, despite all the health awareness, and diets in circulations. The premise of the documentary is that we have strayed from eating the foods our bodies evolved with through million of years to consuming highly processed foods, and if we change that by eating less processed foods, we'd have a better health.

The documentary starts with some eye-opening highlights:
  • Supermarket foods are engineered to have a long shelf life, to be appealing and addictive, and be not fulfilling so that we buy more
  • The protocol for making mice fat to study the effects of obesity on health is to feed mice MSG, which is present in about 80% of the supermarket foods
  • Airplane pilots refrain from drinking diet sodas, as it interferes with their focus
  • Phosphoric acid in sodas can cause loss of bone density
  • Total blueberry pomegranate cereal does not contain blueberry nor pomegranate. It contains propylene glycol which adds the blue bits. Interestingly propylene glycol is used to winterize cars, and to clean up the colon before a colonoscopy
  • 68% of the population is fat
  • Most of that is due to high fructose corn syrup consumption.  In the 1970s,  Japanese scientists developed a process to separate fructose from corn at a low cost, and its use skyrocketed afterwards
  • In 1900, the average person consumed 15g of fructose a day. Today that number jumped to 70-80g with some people consuming as high as 120-150g a day, a 10x increase
  • On average, people consume about 150 lbs of sugar every year
  • Sugar is the main culprit in making us fat
  • Consuming sugars produces beta endorphins, which should be considered a drug
The documentary then proposes consuming less processed foods to get rid of all the toxins the body accumulated over the years. It argues against initial exercise, since the fat cells in the body balance the toxins which are fat soluble in general. When we burn the fat without letting the body get rid of the toxins, they become unbalanced, and make us sick.

The documentary lists some of the good detox foods: anything with chlorophyll such as greens, and gelatinous foods such as aloe vera, chia seeds. Although they don't sound very appealing, the theory is that as the gelatinous foods move through the intestines they suck and  clean up the toxins. The show also recommends parsley and cilantro, as the later binds with heavy metals and removes them from the body. Who would have thought?

The show finally recommends getting more sleep to decrease weight gain because of stress. Sounds like small changes for a bigger benefit, and who knows, maybe we can all enjoy more chia seeds.

Thursday, August 15, 2013

Enterprise Data Workflows with Cascading, by Paco Nathan, O'Reilly Media

For people interested in developing Hadoop analytic applications there is a plethora of options. The options range from writing low-level, hand-tuned Java map-reduce code, to using a higher level language to manipulate the data such as Pig and Hive. There are pros and cons for each option. For the first, the code becomes complex for anything other than the canonical word-count example, and for the latter, to do anything meaningful, you almost always end up augmenting the higher level language with user-defined functions written in a different language to regain power and flexibility, causing maintenance nightmares. A happy medium in between is to use one of the data-flow libraries for Hadoop, of which Cascading is one.

Since Cascading has been around for some time, the online documentation is relatively mature, and includes a gentle introduction to the library, with example source code, and a well written user's guide. However this does not obviate the need for a book that describes the library and walks the reader gently through its usage and subtleties. "Enterprise Data Workflows with Cascading" is such a book.

The book starts with a simple example of copying a file on Hadoop, and introduces the concepts of taps for data sources, and data sinks, as well as data pipes that connect them. It then graduates to the canonical word count example, using it as a vehicle to explain flows, and the operations that can be performed on them through the use of functions and aggregation functions.

Next comes more complex tasks that require joins. The book starts with HashJoins, and then progresses to LeftJoins and distributed joins. The book then uses a meaty example of a text analytics pipeline to calculate term frequencies/inverse document frequency for a text corpus (TF-IDF), and uses that as a vehicle to walk through splits, merges, and more complex joins.

By then, the reader has become familiar and comfortable with Cascading, and the author walks him through the benefits of developing applications in a data-flow language instead of the other options available for Hadoop developers. Some of these benefits are the ability to test the code before deployment, and the author walks through an example of a TDD pipeline.  Others include using a consistent pattern language to describe the workflows, and having a single deployable JAR that can be used in dev/test/production environments.

Toward the end the author lists other language bindings for Cascading, such as Scalding (Scala), and Cascalog (Clojure). The later chapters contain good references for further reading on TDD/Scala/Clojure. The book closes with an open-data use-case.

Throughout the book, the author provides ample links to the source code, and code gists on github, as well as alternate implementations in different languages.

I liked the style of the book: it is a gentle introduction to Cascading, interspersed with some good advice on doing TDD for enterprise applications, the use of a pattern language for describing data-flows, and an introduction to other language bindings for Cascading.

Friday, June 28, 2013

Compiling the Firefox codebase

Out of curiosity, I decided to take a look at the Firefox codebase, and compile it on my Mac. Mozilla's developer pages are great, with elaborate instructions on how to get the source code from the mercurial repository, to compiling and running the codebase on various platforms. You can find the details at: the Mozilla developer guide, and on Mac OS X they are as simple as:

  1. Get the source code from mercurial repository
  2. hg clone
  3. Install a specific version of autoconf (2.13)
  4. brew tap homebrew/versions
    brew install autoconf213
  5. Build Firefox
  6. cd mozilla-central
    ./mach build
    The build took roughly 2 hours to finish on my MacBook Air.
  7. Run
  8. ./mach run
The resulting build is similar to Firefox nightly, and includes all the bleeding edge features and instabilities, but is great for tinkering.

Thursday, June 27, 2013

Back to Firefox

I have been using Chrome as my primary browser ever since it first came out, and have been pretty pleased with it. At the time I switched from Firefox because Chrome was the faster browser, and arguably had fewer memory leaks, and with its growing ecosystem of extensions and applications, I never felt the need to use any other browser.

However, lately I started having problems accessing some legacy sites that I needed for work, that employ Java for some of the content, and starting or joining WebEx meetings. Both problems are due to the fact that Chrome is a 32-bit browser, and the available Java and WebEx plugins are 64-bit for the Mac. Since Safari is a 64-bit browser, I used it for a bit as my backup browser to launch WebEx meetings, and access the legacy websites, but it was a minor inconvenience to use two browsers.

A friend sold me back on Firefox, with the cross-device sync feature--one that I heavily love on Chrome, the tab groups feature, and the recent memory leak fixes. I decided to give it a try again as my backup browser, and as time passed by, my Firefox usage increased to the point where it became my main browser.

Kudos to the Mozilla team for making Firefox a much better browser over the years.

Sunday, May 5, 2013

The Shallows

I finally finished The Shallows--a book by Nicholas Carr--about how the Internet is changing our thinking, and how the social network distractions are making us stupid. The book argues that with advances in technology, we have lost our ability to immerse deeply in reading, and consequently the ability for deep thinking. The book traces how knowledge transfer has evolved through the ages: from the early days of oration, where people had to focus hard to comprehend the message that is being conveyed, to writing on the scrolls without the use of punctuation, to the modern printed form, and finally to the digital display of information using devices with continuous scroll.

Even though the book is an interesting read, it took me a long time to finish, probably for the same reasons listed in the book. I read the shallows on and off using my Kindle App on my laptop, and during these short spouts of reading, I was distracted by e-mail, social media, and researching topics on the web. What would have taken me a weekend to finish, took more than a couple of months. Ironically I think I benefited more from reading the book this way, as it drove the point home better than a focused reading of the material. I am now more aware of the distractions, and am taking measures to decrease them to reclaim my deep focus time.