Buried Alive – The True Story of Kidnapping, Captivity, and a Dramatic Rescue by Roy Hallums

Buried Alive Cover

“Buried Alive: The True Story of Kidnapping, Captivity, and a Dramatic Rescue” is the story of Roy Hallums, an American civilian (albeit ex-military) contractor who was kidnapped while working in Iraq and spent almost two years in captivity. The very material that is covered means that you will be reading about a unique experience.

This book is well written and with a consistent narrative flow. The narrative is in first person and flows quite easily. Unfortunately, the same conditions that make Roy Hallums’ experience horrific, make its retelling less interesting. It does feel at times that this conversational style of narrating events get in the way by becoming too wordy, but on the whole I felt that it makes the book better.

Overall, I felt the book was educational, but I wouldn’t be likely to recommend it as a must read.

Disclosure: I received this book free from Thomas Nelson Publishers as part of their BookSneeze book review bloggers program. I was not required to write a positive/negative review. The opinions I have expressed are my own.

Posted in Random Thoughts | Comments Off

An afternoon trip to Unawatuna

Into the Waves

A short message from Bhagi on Facebook was the start. He suggested a photography trip during the last weekend of November. First plan was a one day trip to Bundala and Yala, and as my new DSLR was sleeping in my closet for sometime, I instantly said “I’m in”. But due to some reason, it didn’t work out as planned. I called up Bhagi on Friday and we decided to go to some place along the Southern Coastline of Sri Lanka, but we didn’t finalize on a place that day and as usual I went to sleep around 3am on Saturday.

Unawatuna Beach

My got up on Saturday with the wake-up call from Bhagi around 10.30, and he asked, “Shall we go to Unawatuna or Hikkaduwa, we can take some good sunset shots there?”; “When?”; “Today, around 11.30…”. I was not sure about this instant trip plan, but thought at-least I could spend a Saturday without sleeping all day. When it was 12.30 we were on a C0lombo – Kataragama (yeah, its no more Katirkamam) bus, from Wellawatte to Unawatuna. According to Chamin, whom I talked in the mean time, it would be a 3 hour journey on road.

Unawatuna Beach

Unfortunately we had to stand for 3 hours with our backpacks, and when we reached Unawatuna little later than 3 in the evening. We had no plans whatsoever, and didn’t know where we could find lunch. So I called Chamin and he asked us to meet him near Wella Devalaya. It was a 10 minutes walk towards the beach and we waited there till 4, and clicked few shots of the beach in the meantime.

One important fact I noticed is that Unawatuna is a pretty expensive place for locals, specially with food. We couldn’t find a good place around for lunch, so we went to a small restaurant in Magalle with Chamin. And when we came back to the beach around 5, we almost missed the sunset… :(

Wella Devalaya

We spent another 2 hours there, until its too dark, and took some photos around the beach. Bhaghi managed to take few good shots of the sunset, and I experiments with manual modes. We had to comeback that night as there was a assignment for Bhagi.

Though it was an unplanned trip, and we didn’t do much there, it was a good chance to learn few things. One, even unplanned trips, plan to some extent. Two, I know too less about my camera. Three, learn and practice night photography. May be I should plan for another trip down south soon…!

Unawatuna Beach

Bhagi’s Photos from Unawatuna // My Photos from Unawatuna

Posted in Travel | Tagged , , | 2 Comments

Parse RSS feeds with PHP

RSS feeds are very common today, and at times we want to write a simple script to grab some information from a feed.

PHP has got and extensive set of functions that can be used to manipulate XML (RSS feeds or even HTML) files. PHP DOM library is one of the handy libraries that can be used to parse RSS feeds in PHP. DOM (Document Object Model) is a standard way for accessing and manipulating XML documents. XML documents can be represented in tree-structure (a node tree), with the elements, attributes, and text defined as nodes.

Below you can find the script for parsing a standard RSS feeds:

// Create a new DOMDocument object
$doc = new DOMDocument();
 
// Load the RSS file into the object
$doc->load('http://feeds.feedburner.com/talkouttrojans');
 
// Initialize empty array
$arrFeeds = array();
 
// Get a list of all the elements with the name 'item'
foreach ($doc->getElementsByTagName('item') as $node) {
	$itemRSS = array (
		'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
		'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
		'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
		'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue
	);
	array_push($arrFeeds, $itemRSS);
}
 
// Output
print_r($arrFeeds);

The getElementsByTagName method is used, within the loop of the item nodes, to get the nodeValue for the title, description, link and date tags. The nodeValue is the text within the node. An array is used to store each set of values and each array represents an entry in the big array that holds our structured RSS data. At the end of the script all the data will be hold by the $arrFeeds array, which is well structured and can be used to display or further manipulation.

One drawback of using the DOM library is that it reads the entire XML document into memory, and then we use the functions for manipulating the data. Thus this method is that is not recommended for large XML documents, which would take too much memory to build the model of the document.

Anyway, usually the feeds we are dealing with are of normal size, and this won’t be an issue at most occasions.

Posted in Tech Notes | Tagged , , , | 2 Comments

Now Powered by WordPress

Welcome to WordPress. This is your first post.

- Not exactly, add another 127 and this would be my 128th.

I have moved, migrated this blog from Blogger to a hosted WordPress. Those who are following me through feeds might not have noticed this yet, so just click on your feed and check out whats new. I have been blogging since 2006, and completed 3 years this July. I enjoyed blogging over at Blogger, yet I always wanted to move to WordPress someday with my own domain. I’ve been actively blogging on my project blog last year, which was on WordPress. After buying this domain couple of months back, I decided I would move my blog here.

Lets see a ‘list’ related to this migration:

  • Domain – nimal.info, bought couple of months back, couldn’t wait more for .com or .net
  • Hosting – DreamHost, hosting with them for almost 2 years and happy with what I’ve been getting
  • WordPress – :)
  • Theme – Illacrimo Theme by Design Disease
  • Migration – Migration from Blogger to WordPress is pain, many thanks to Amit Agarwal at Digital Inspiration for this wonderful guide

I also made a decision to change the name of this blog from “The TalkOut Trojans!” to “Nimal’s Weblog”, which I think would be a more suitable name. Its most likely, I’d stick to the “TalkOut” avatar name on all other places, except to this domain.

The migration is so far smooth, and I’ll be tweaking around the theme and plug-ins for sometime. Let me know if you find any glitches on any pages, so I can fix them. I’ll also be WRITING more often than before (that’s the plan for now)…. :)

Quoting from my first post,

Now I’ve landed in blogger. We’ll see what happens in the future.

So, Now I’ve landed in WordPress, and the future, it’s yet to be seen…!

Posted in Random Thoughts | Tagged | 3 Comments

Text to Image in PHP with GD

This is simple script to demonstrate the capabilities of PHP with the GD library, which provides a lot of image functions that can be useful in many applications. GD provides a rich set of functions. For a complete list of these functions, check the PHP manual.

header('Content-Type: image/png');
// Text to be converted to image
$text = 'Hello World';
// Font to use, give accessible path from script
$font = './arial.ttf';
 
// Convert HTML entities into ISO-8859-1
$text = html_entity_decode($text,ENT_NOQUOTES, "ISO-8859-1");
 
// Create the image
$im = imagecreatetruecolor(160, 160);
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
 
// Create some colors
imagefilledrectangle($im, 0, 0, 160, 80, $white);
 
// Add the text
imagettftext($im, 12, 0, 20, 20, $black, $font, $out);
 
imagepng($im);
imagedestroy($im);
exit;

GD can also be used to create and manipulate image files in a variety of different image formats, including GIF, PNG, JPEG, WBMP, and XPM.

Limitations:

  • Though GD supports Unicode text inputs, it doesn’t support complex text rendering
  • Complex Text Rendering is required for properly displaying many language texts, such as the Arabic alphabet and scripts of the Brahmic family, which includes Tamil and many other Indic scripts.

There is a alternative for this using Pango and Cairo in PHP. I’ll post a detailed update on that in my next post.

Posted in Tech Notes | Tagged , | 2 Comments