November 15th, 2008 — PHP
Microsoft Word converts certain characters into "smart characters". Double quotes, dashes (em dash / en dash), bullets and so on.
These characters break PHP's XML handling. (or at least they broke it for me - using simplexml_load_string!).
How do you clean them?
There is an old post that suggests using ereg_replace on a set of characters - essentially converts them to html entities.
Unfortunately, that did not work with me. Since the text is UTF8, the replace logic replaced alphabets too.
I tried a lot to get a solution, but could not find something that would work. Finally, just stripped out all non printing characters except line breaks and tabs.
PHP:
-
private function cleanWordSpecialCharacters($body)
-
{
-
$body =
preg_replace( '/[^[:print:]|\n|\r|\t]/',
'',
$body );
-
return $body;
-
}
This too breaks with non English characters. Any suggestions?
November 10th, 2008 — Technology
I was surprised when I discovered this feature! It helped me focus on relevant emails in Thunderbird. All I had to do, was click on two arrows! Ok, let me get to the point!
Thunderbird shows All Folders by default. But there are two arrows next to "All Folders" that allow you to navigate between All, Recent, Favorite and Unread folders. Keeping my view to show only Recent folders reduces a lot of eyeball movement and helps me stay focused! Here's the "before and after" view of my folders!

BTW, another tip! Use Vertical View Layout for message display. The three pane view with folders on left, message list in center and message content on right. This works super especially in wide screens.
November 9th, 2008 — Apple, Book Shelf, Recommended Reading, Technology
I love books, I read some of what I collect! I may go from one book to another without finishing it. I love coming back to books I read earlier. Two weeks ago, I bought 26 books in one shot. The largest purchase of books I ever made. I was fulfilled!
My library case is already filled up and I needed a way to organize the books I have. I had tried with a spreadsheet earlier, but I wanted something better this time. I did not even want to type in all titles and details myself. That would be too much of work! I would rather read a book in that time!
Enter Books! A MacOS X application that can read barcodes using the inbuilt camera on my MacBook and fill up book details! Just what I needed! (It's Open Source too)

Books - Add a new book screen
I used it and I can describe the experience in one word - Delightful! I was so happy with the ease, I have already shown the app to my family. That's unique - does not happen for a lot of apps!
- It correctly detected ISBN for most of my books.
- I did not have much luck with 13 digit ISBN - though detection worked, I was not able to find book information from Amazon/others.
- Especially so with Indian publishers. For many, I had to enter the title and pull info manually.
- I wish Gujarati books had ISBN too! Would have made it so easy! (I inherit a huge collection of Gujarati books from my dad
- In just two hours, I could add about 90 books to the system! That was cool!

Books - Main Screen
October 30th, 2008 — Updates
I've been very busy and that's affected my blogging frequency! From August 2005 till today, I have written 610 posts. There are 1775 comments - most of which are contributed from readers like you.
What next?
What do you think?
October 20th, 2008 — Recommended Reading

Find out which country is spending on what!
NYTimes had a great piece recently on what do people spend on. Their data visualization method is superb, and you quickly learn that Americans spend a lot (if you did not already know that)! India is way behind!
How people spend their discretionary income – the cash that goes to clothing, electronics, recreation, household goods, alcohol – depends a lot on where they live. People in Greece spend almost 13 times more money on clothing as they do on electronics. People living in Japan spend more on recreation than they do on clothing, electronics and household goods combined. Americans spend a lot of money on everything.
Check out the visualization here, full article here.