Monday, December 7, 2009

Nailed Browser Performance Issue

I may have finally nailed a performance issue that I have been having with FireFox for a while now. I keep updating and hoping that it will go way. While I am using the browser, it stops responding for a second or two periodically. When the system is really loaded, it gets even worse. I spent some time lurking around the web looking for solutions. I have tried disabling some things. I have tried lots of stuff. Today, I was getting even more frustrated and tried searching again. In the past, I was running into trouble with the Google toolbar's start screen. It turns out that there is, or at least was, a bug where the SQLite DB would grow and grow. The system would keep updating it. As the DB grew, your profile would get huge and each update would take longer and longer. My TimeMachine backups were huge. I would have 250MB of changes in seconds. If I ran a backup and then immediately ran another backup, whammo 250MB. I decided to find out what was being backed up during that period of time. I found and tried Grand Central. Grand Central provides a view of the file system based on disk usage. Files are graphically displayed sized in proportion to their size on disk. Once the system spent a little while churning on the disks, I could see what file was taking up most of the 250MB. There were many many large blocks that included places.sqlite I believe. Googling for this resulted in a description of the FireFox slowdown I was having, along with an easy fix (download the SQLLite manager and truncate the right table). I have also turned off the Google start page which avoids the problem all together.

Today, I was getting more and more annoyed with my current slowdown. It is not as bad as the other one (30 seconds of beach ball of death, 5 seconds of work, rinse and repeat). I have noticed that the system writes and reads from the disk quite a lot but I have not been sure what it is doing. LSOF is a difficult way to catch something that transient. The new slowdown is a fraction of a second complete pause in FF. Depending on system load and CPU it might be more or less often or slightly longer. I actually thought it was Flash missbehaving at first. Anyways, in today's search for FF pauses, I found a website for an ISV: http://forums.whirlpool.net.au/forum-replies-archive.cfm/836951.html They talk about pauses and mention monitoring the file system with fs_usage several pages down. I tried this and was flooded with file system messages.
sudo fs_usage -f filesys

Lots and lots of messages. FF was one of the major contributors. I piped the output to a file and tried using tail in another shell to monitor the disk activity.
sudo fs_usage -w -f filesys > biglog.txt

tail -f biglog.txt

Unfortunately, tail was causing a flood of messages of its own. Way more than the actual traffic. Without tail, it was hard to figure out what was happening. The biglog file was 150MB and many of the commands and filenames were chopped. I tweaked the parameters to fix that '-w' and hone in on FF.
sudo fs_usage -w -f filesys firefox-bin > biglog2.txt

Now I have a list of just FF is doing. I started using the program, waited for the hiccup, and immediately hit ctrl-c in the shell window. The log contained lots and lots of line items. Lots of seeks, truncates, ... There was only one file name mentioned however:
es/Firefox/Profiles/23oitqok.default/Google Gears for Firefox/permissions.db-journal

I quickly disabled the add-on and restarted FF. Once restarted FF no longer exhibits the issue that I was seeing before. While writing this article, I looked on my disk for the file. I wanted to see how big the file is/was. I could not located it. I also could not locate it on the backup. After finding the documentation for the Gears API, I was able to locate the files. Thanks to Google for documenting all of the file locations for every OS and browser combination. All of the files are small. I am not sure why the journal would be big, but it is gone now. I don't know how big it was and I cannot find the file in TimeMachine.

On a positive note, my system has not had a single hiccup since I disabled the add-on. I can live with a slight mystery without the odd pauses. Also, during my search for the file I could not locate, I was performing find commands over large portions of my HDD, specifically:
find . -name "permissions.db-journal"

This reasonable amount of disk activity did not cause the browser to hiccup at all. I am impressed, I thought the system was very susceptible to HDD activity based delays. It might have been only HDD activity was slowing down the blocking HDD activity the browser was trying to get done.

Monday, September 21, 2009

I have to question their diligence

Product labeling is often quite excessive. Here is an example that surprised me. I am used to keep away from children, not a toy, ...


Although, to be honest, I hope they did not test this with children of all ages.

If you have ever had a really frustrating day at the Monterrey Bay Aquarium with inconsolable kids, you might appreciate this trash can.


That being said, I definitely support hospitals and fire stations as a much better option.

In the news, Michael Jackson was called a pervert by a congressmen:


Who later on, on the same page, was found to be somebody else, and have unfortunately, died. Talk about swift retribution:


I was rather impressed with the effort that Costco went through to post multiple kinds of trash, recycling, and compost bins throughout the local stores. Go Costco!!! I was rather surprised to see the plastic lid from a cup to be included in the trash picture.



A quick check verified that you can see the recycling symbol in the picture and they use recyclable cup lids. Not sure why it is called "Non-recyclable plastic".



One of the latest "Free" offers from Fry's. You have to love the up-front nature. Free phone service, just pay us...


- spell checkers should definitely work on titles.
Jacob

Monday, September 14, 2009

Stand Up For What You Believe In

A long long time ago, in a galaxy far away, I had a group of friends that I used to hang out with. We spent a lot of time together and did tons of stuff. One of the guys was really big, moved a little slow, had asthma, had epilepsy, and used to threaten me all the time. That was kind of his shtick. He never hurt me in any way. He just used to threaten me. I never thought that he would hurt me, but it was still a bit unnerving. In fact, it frequently kept me on edge.

One day, we were driving off to go somewhere. I am not sure what we were talking about but the phrase "kick your a**" came out of his mouth. I yelled to my friend to stop the car, said I was sick of it, and got out. After realizing that I was serious, and done, many apologies quickly ensued. True to his word, he never threatened me again. Not only did he not threaten me again, we actually started talking. We had some very interesting conversations while the others were occupied with other things. I am not saying that they were terribly deep. We did not cure cancer, but we were way past the weather. Have you ever had that feeling that you have really connected with someone. It actually does not take too much, IMHO. You just have to start a dialog on something real, not something trivial or banal. This does not happen as often as one tends to think. When was the last time that you actually sat down and talked with your spouse? What have you either not been honest about or not been upfront about? (more on this topic later). What would happen if you made the time to actually talk.

Through the months and years that followed, we actually looked forward to our time together as a chance to talk. We never spoke about the talking directly, we just hopped into things anytime we were near each other. I had not realized how much he also enjoyed our conversations. You are probably asking, "What is this, some kind of feel good blog entry?" I am glad you asked. We were boys. We were teenage boys. We were in fact, several teenage boys. What do you think happens when we get together? What do you think happens when subsets get together? Well, naturally there is some teasing. As you can imaging, the large asthmatic epileptic person was teased a bit too. I even initiated some of it. He was proud of his heritage and would frequently say that he was "half Mexican." One day, when we sat down, I told him that they knew he was coming. "Why?" he asked. Because they put half and half on the table. I tended to restrict myself to things that people were comfortable about so that they would not get hurt by the teasing. I assume that joke did no lasting damage. The others tended to tease a little bit more than that. Jokes about his intelligence and seizures (which I never witnessed) were rampant. I am ashamed to say, that I went along with the flow. I even pretended to be entertained. The jokes were pitiful and tired. But I did not stand up for our friend and worse, by pretending to be entertained I was reinforcing them. I would pay for these mistakes later.

One day, I heard from one of our mutual "friend" a little story. It turns out that B mentioned that he missed our conversations together and that he looked forward to them. Given that those conversations were only between he and I, I think a little jealousy might have come to the fore. Our mutual friend, whose friendship spanned a few decades, decided to say that I made fun of B. That I laughed at his illness and his thinking that he was intelligent and at our conversations.

This would be the last conversation that I would have with our mutual "friend." He took something so beautiful which was found in such an unlikely place. A space for calm, reflection, peace, and comfort. Never mind the fact that B was a teenage boy that had some things stacked against him to begin with, and rip B apart in such a way was one of the most offensive things I have ever heard of. He laughed when he told me. This time, I did not pretend to be amused but I feel the damage was already done.

B.R. I am sorry. I miss our conversations. They were some of the best ones of my middle school and high school years. I hope you can forgive me for going along and not sticking up for you. I hope you have come to realize that I really cared about you and value our conversations for what they truly were.

Stand up for what you believe in today. You may not be there tomorrow. They may not be there tomorrow. Windows close all of the time. If you have the chance, let them know that you care. Tell them the truth. Don't be afraid to have beliefs, feelings, likes, and dislikes. Everybody does, they just don't stand up and talk about it.

Jacob

Tuesday, September 1, 2009

Blurry Kindle in the Sun

Many of you know that I love my Kindle. It is like a small lapdog. I am carrying it everywhere and it occasionally draws attention to itself. I have run into some issues where the Kindle has rendered poorly though. It reminds me most of when an ink jet printer is running out of ink or has clogged heads and the text is really faint and grainy. Now, for an ink jet printer, I can understand this. For eInk, I am a little confused.

When the symptoms would happen, I would flip pages backwards and forwards for a while trying to clear out whatever it was that was making the image blurry. It usually cleared up in a few flips of the page and I would go back to reading. Sometimes, I would read it while it was still blurry because it was being particularly resistant to clearing up.

This issue nagged and nagged at me. I don't like to leave problems without finding a reasonable cause for why they happen. In the software world, I have found that if something breaks once, it will break again. Typically, it will break in the same way at multiple locations around the world almost simultaneously. Ignore software problems at your own peril. Since I could not reliably reproduce the problem or make it go away, I figured there was some issue that was affecting its performance. I considered several factors: ambient temperature, duration of use, speed of flipping pages, ... I started to pay far more attention to the problem when it occurred and looked for patterns.

I noticed a few patterns right away. The problem was not consistent throughout the screen. Any part of the screen could be affected. Usually a large portion of the screen or the whole screen was affected at one time. I was frequently on the move (either walking, in my car, waiting in line, ...). While this made me even more suspicious about ambient temperature, I noticed that cold or hot days did not make a difference. One day, I was holding the device in a way that covered part of the screen, flipped the page, and figured out the pattern.

The portion of the screen that I was covering was bright and vibrant and the rest was affected by this issue. I quickly determined that it was UV rays that were affecting the image. My Kindle is sun sensitive. Now, I am sun sensitive and this would explain why the Kindle would only act up when I was on the move. Most of the time, I was either out of the sun or behind UV protected glass. For this blog entry, I took a few moments with my car parked out in the sun and took some candid shots of my Kindle. (I hope it has a nice modeling career ahead of it).

I started out with rendering a page on my Kindle inside my car (UV protection in the glass). You will notice that the Kindle image is very sharp and quite easy to see even in the direct sunlight on a bright California afternoon.



I then, without moving the Kindle, advanced to the next page. The difference is pretty striking:



You can see how blurry the kindle is. How much of the text is completely missing and you cannot read much of the page. After that, I thought about a few ways that I might convince and/or show people that this was indeed the issue. One bad render could easily be caused by a temperature difference. A temperature difference could be caused by say, pulling the Kindle out of a car and putting it on the hood on a nice bright California afternoon. While the Kindle surface is a little bit small for this exercise, I tried a few attempts at making patterns on the screen by shading it with my hand. In order to have sharper lines on the display, I placed my hand directly on the device while I flipped pages. Here are two different patterns with before and after shots. Look near where the edge of my hand was and see how big the difference is between the shaded portion and the non-shaded portion.




As a final experiment, and more detailed pattern, I decided to stack some coins on the corner of the Kindle. My Prius hood is a little too steep for them to sit in the middle, so I stacked them up in the corner of the screen. Unfortunately, 2 pennies would not have been a very good example image, or I would have shown you my $0.02.



You can see the influence of the coins, but the pattern is a little blurry. Some of the coin edges are visible but they are not too crisp.

Going back to Amazon.com just before posting this entry:

Read in Sunlight with No Glare

Kindle's screen reflects light like ordinary paper and uses no backlighting, eliminating the glare associated with other electronic displays. As a result, Kindle can be read as easily in bright sunlight as in your living room.

I have to say, the Kindle does not quite live up to the advertising in this case. It does have glare, it is not bad, but it is there. Also, while you can read amazingly well in bright sunlight, you cannot read after turning the page. I turn lots of pages.

I have tried this on at least two kindles (one original, one Kindle 2) and have seen a consistent issue. I have to say, for a device that is dedicated to reading, not being able to read in the sun is a little disconcerting. I think an inexpensive UV filter over the screen would both protect it and prevent this from being an issue.

[No Kindles were harmed in any way in the making of this blog post.]

Happy Reading!
Jacob

Monday, August 31, 2009

The Passionate Programmer

I just finished reading "The Passionate Programmer" by Chad Fowler (no, not related). I really enjoyed the book. It had a short topic driven style which presented ideas in bite sized chunks. I enjoy this style of book because it is easy to pick up for a few minutes at a time if that is all the time you have. It also keeps you reading with engaging topics and the promise of the conclusion of an idea just a few pages away.

While this book is targeted at people early in their careers and people considering careers in computer science, it also has some nice tidbits for those of us already well ahead in our careers.

One of my favorite passages rewrote the common "teach a man to fish" parable:
For us software developer, Lao Tzu's intent might be equally well served with "Ask for a fish; eat for a day. Ask someone to teach you to fish; eat for a lifetime." Better yet, don't ask to be taught--go learn for yourself.
Well said. Always go learn for yourself. This makes sense in public school and later in life. It is not about what you are taught. It is about what you learn. What you take away is far more important than what was presented. Somehow, I feel that in this age of entitlement, we have lost sight of that.

There is also a section on mindfulness. It resonates with sometime that I have found in my own life. It does not matter how mundane the task, it matters how you perform the task. If you are frustrated at having to enhance the code coverage of the unit tests, you are going to move slowly and dread the process and memory. If you are challenged to increase the coverage of the unit tests in the most efficient way possible, you might actually look forward to the challenge. Try to look forward to the challenge as much as possible, it is a small change, but it makes the process the adventure rather than something to be endured. We all deserve a little more adventure.

Check it out.

Jacob

Friday, August 7, 2009

He Said Hello...

I have been living in the same neighborhood for almost 10 years now. One of my neighbors has a son that is Autistic. When we first moved in he had a very difficult time with social interaction. Recently he has moved to a facility where they have experts at dealing with his condition and helping them be more successful. He has started to interact a little more naturally.

I have been a little unsure of how to act around him. He has many of the common signs of someone that is very autistic and I am not sure what he likes and what scares him. He is about 6 foot 5 and very strong. One of the things he enjoys doing is helping with the gardening. He likes to weed. After he gets going though, small trees occasionally fall into the category of things that need to be uprooted and moved.

I have always tried to reach out to him when he is around and engage him a little bit in a non-threatening way. I don't try to push into his territory or force him into a situation where he has to respond. About a week or two ago, I was out in front of my house and they were getting back from walking the dogs. I said hello to his mother and said hello to him by name. He actually met my gaze and said hello back. I was completely stunned. This is the first time that I think he has responded to me in such a casual way. He was not prompted with specific verbal instructions to say hello. I have read a little bit since then and I think part of it might have been the fact that I was respectful, want to engage him, and did not put much weight on getting a response. I was saying hello because I valued him and he was comfortable to return the gesture or not without being judged.

He still has some very noticeable physical characteristics and mannerisms. I think many people would judge him for those. He is another example where "Body does not equal mind". He is huge (very tall and thin), imposing, and has darker features. The net out is that he looks kind of brooding and almost furious to me. I don't think he can control this easily. On the inside he is actually really sweet, gentle, and considerate. In 10 years, I have never seen him do anything that was riskier to people than something where he might not have realized that someone outside of his vision might be in the direction he was pulling something. This is a very common occurrence.

It has given me great pleasure to see him slowly improving his ability to communicate with the world and interact. We are gaining a wonderful person in our community.

M. Thank you for saying hello!
Jacob

Tuesday, August 4, 2009

Silence in the Cave

I was reading a book about compartmentalizing and organizing information. They mentioned that a Buddhist mantra was much harder to organize than something far more concrete and mundane. They specifically mentioned "Om". Yes, I know, not that big of a deal, but it brought back some memories. Now that I am raising kids, I find myself looking back through the years to see how I perceived things when I was younger. Some of my fondest memories are adventures with my brother and father and Nina. In one particular adventure, we were hunting down cave sites. Have you ever been way deep inside of a cave? Have you ever turned off the lights and just took a moment to breathe? It is a truly amazing experience. I did not quite appreciate it then, being only a few years old. Now, with the constant din of electronics, the background demands of work, clients, and raising children it is hard to get that quiet. Sometimes I find myself going back.

On another adventure, we went scuba diving in Hawaii. This was some of the most amazing water and fish in the world. At one point we were able to swim in the deep blue sea with a pod of whales. Try and put yourself into my shoes. Here I am, a teenager. I am swimming in the ocean miles off shore. The water is pristine and blue. There is no bottom. There is no land. I take a mask and snorkel and hop into the water. I dive down about 30 feet. Looking up, there is just enough substance to the water to get that beautiful shimmery effect like when the sun is just shooting rays down through the clouds. The surface of the water is disappointing, it looks to be only about 5 feet away. A bull whale comes over to decide if I am a threat to the pod. The pod consists of tens of pilot whales from the bull down to pups tucked into their mother's side for help swimming. I cannot tell how many whales there are. The further I look in the distance and the more my eyes adjust, the more whales I am able to see.

The bull approaches. He gets to about 20 feet from me and cruises up putting his eye on level with mine. Let me tell you, you notice when something the size of a small moving truck sidles on up to you to check to see if you are a threat to his kids. Thankfully, I was not. He then surfaced and continued to surface for a while. My impression was that he was confused about why I was only able to hold my breath for a minute or so at a time. After he surfaced, I decided to surface again. That 30 or so feet, that looked like 5, took a while to cover.

I am in the deep blue sea, floating at a near perfect temperature, with little sound, and a huge family of beautiful whales serenely gliding by. When I put myself back into that memory I can feel it all over again.

Where is your cave? Where are your whales? How often do you put yourself back there and remember them? How often do you relive the joy and wonder?

All too frequently, we spend time rehashing things that did not go right, or that we think could have gone better. We need to remember to be human and enjoy that times that make us feel good as well. Those times recharge us and inspire us to greatness.

Jacob