Posts Tagged ‘mishil patel’


Snake Burgers

A restaurant in Indonesia’s capital city Djakarta is serving snake burgers made from local snakes.

The kitchen area resembles a factory floor, with snakes everywhere – in various states of preparation. The snakes are first beheaded, then peeled to remove their scaly skin. Next, the carcasses move to the cleaning and fileting area, and finally the meat is minced, ground, and blended with seasonings.

The snake patties are then fried, topped with the usual condiments and sandwiched between sesame seed buns. According to China Radio International Online (CRI), the burgers “taste like chicken”.

This slideshow requires JavaScript.

[via Inventor Spot]


Bruce Munro’s Light Installation at Holburne Museum

Bruce Munro is a British lighting designer and installation artist best known for large scale lighting installations such as Field of Light, which was first exhibited at the V&A Museum in 2004. Right now he is working on another Field of Light installation at the Holburne Museum, in Bath, England.

At the Holburne, Munro’s piece will consist of over 5000 acrylic stems topped by frosted spheres, threaded with fibre optic cable and lit by 5x metal halide projectors on colour wheels. Munro’s new Field of Light will open to the public on Saturday November 26th and remain in place until 8th January 2012. During late December, Munro will unveil another, newly designed installation called Star Turn, for a one-day charity event at the Holburne Museum.

The Holburne Museum re-opened earlier this year after ambitious renovations, boasting a glorious new extension by Eric Parry. It has fast gained a reputation, along with the Hepworth in Wakefield and the Turner Contemporary in Margate, as one of a number of outstanding regional museums in the UK.

This slideshow requires JavaScript.

Photos: Matt Cardy/Getty Images

Sources: 12


Faster PHP Websites using Cache

In this part, I will show you how to ‘retrofit’ caching in to your scripts using the above script as an example. The objective is to speed things up by not having to regenerate the information every time somebody requests a file. Generating the content every request is a waste, on static information such as our CSS.
To add caching they must add things to our script. First, they must collect the information input to the script & generate a filename distinctive to that set of inputs. Secondly, they must look for a cache file & see if it is sufficiently recent. Finally, they must either use the cached copy or generate new content & cache it for next time.

Breaking the Flow

This part of the process really depends on the individual script, however I will show where I am going to break the flow of this script for the caching.

  1. <?php
  2. $fileDirectory = ”;
  3. $file = $_GET[‘q’];
  4. $nameExplode = explode(‘.’, $file);
  5. $ext = $nameExplode[1];
  6. $fileName = $fileDirectory . $file;
  7. //– WE HAVE ENOUGH DATA TO GENERATE A CACHE FILE NAME HERE —
  8. if ($ext != ‘css’ AND $ext != ‘htm’ AND $ext != ‘html’) {
  9.     //Check for evil people…
  10.     die(‘Hackers…!’);
  11. } else {
  12.     //– WE CAN INTERCEPT AND CHECH FOR THE CACHED VERSION HERE —
  13.     //Lets get down to business
  14.     $handle = fopen($fileName, ‘r’);
  15.     $fileData = fread($handle, filesize($fileName));
  16.     //Now for some regex wizardry!
  17.     $newData = preg_replace(‘/\s+/’, ‘ ‘, $fileData);
  18.     fclose($handle);
  19.     //Time to output the data.
  20.     //– NOW WE CAN STORE THE NEW DATA IF REQUIRED AND OUTPUT THE DATA —
  21.     if ($ext == ‘css’) {
  22.         header(“Content-type: text/css”);
  23.     }
  24.     echo $newData;
  25. }

?>

Putting it into Action

We will now actually write the code for caching into this script. I will first show the script completed and then go through each piece.

  1. <?php
  2. $fileDirectory = ”;
  3. $file = $_GET[‘q’];
  4. $nameExplode = explode(‘.’, $file);
  5. $ext = $nameExplode[1];
  6. $fileName = $fileDirectory . $file;
  7. $cacheName = ‘./cache/’ . $nameExplode[0] . $nameExplode[1] . ‘.tmp’;
  8. if ($ext != ‘css’ AND $ext != ‘htm’ AND $ext != ‘html’) {
  9.     //Check for evil people…
  10.     print_r($ext);
  11.     die(‘Hackers…!’);
  12. } else {
  13.     if (file_exists($cacheName) AND filemtime($cacheName) > (time() – 86400)) {
  14.         $cacheHandle = fopen($cacheName, ‘r’);
  15.         $newData = fread($cacheHandle, filesize($cacheName));
  16.         fclose($cacheHandle);
  17.         $isCached = TRUE;
  18.     } else {
  19.         //Lets get down to business
  20.         $handle = fopen($fileName, ‘r’);
  21.         $fileData = fread($handle, filesize($fileName));
  22.         //Now for some regex wizardry!
  23.         $newData = preg_replace(‘/\s+/’, ‘ ‘, $fileData);
  24.         fclose($handle);
  25.         //Lets cache!
  26.         $cacheHandle = fopen($cacheName, ‘w+’);
  27.         fwrite($cacheHandle, $newData);
  28.         fclose($cacheHandle);
  29.         $isCached = FALSE;
  30.     }
  31.     //Time to output the data.
  32.     if ($ext == ‘css’) {
  33.         header(“Content-type: text/css”);
  34.         if ($isCached) {
  35.             echo “// Retrieved from cache file. \n”;
  36.         }
  37.     } else {
  38.         if ($isCached) {
  39.             echo ‘<!– Retrieved from cache file. –>’;
  40.         }
  41.     }
  42.     echo $newData;
  43. }

?>

The Explanation

This one’s a bit trickier and a little more likely to leave you scratching you head. But don’t worry, not much has changed and we will go through each section. An extra feature we have included is the refreshing of the cache every 24 hours. This is handy so if you change anything, you can either wait 24 hours or simply empty the cache directory. If you want a different refresh interval just calculate it in seconds.

$cacheName = ‘./cache/’ . $nameExplode[0] . $nameExplode[1] . ‘.tmp’;

This bit of code just gets the file’s name and extension, glues them together and adds the cache directory and the appropriate ‘.tmp’ extension.

  1. if (file_exists($cacheName) AND filemtime($cacheName) > (time() – 86400)) {
  2.     $cacheHandle = fopen($cacheName, ‘r’);
  3.     $newData = fread($cacheHandle, filesize($cacheName));
  4.     fclose($cacheHandle);
  5.     $isCached = TRUE;
  6. } else {

 

Here we’re checking if we have a cache file saved and if the cache file was created within 24 hours. If both these conditions are met then we open the file and extract its contents to substitute for the scripts output. We also set $isCached to true so we can output some messages at the end.

  1. //Lets cache!
  2. $cacheHandle = fopen($cacheName, ‘w+’);
  3. fwrite($cacheHandle, $newData);
  4. fclose($cacheHandle);
  5. $isCache = FALSE;

Now we are caching the output of the script for us to use in later requests. We simply open a file in write mode, dump our data into it and then close it. Strictly you don’t have to close files in PHP but it’s considered a good practise so I have done it here.

  1. //Time to output the data.
  2. if ($ext == ‘css’) {
  3.     header(“Content-type: text/css”);
  4.     if ($isCached) {
  5.         echo “// Retrieved from cache file. \n”;
  6.     }
  7. } else {
  8.     if ($isCached) {
  9.         echo ‘<!– Retrieved from cache file. –>’;
  10.     }
  11. }

This is another part of the script that was modified a little so that we can offer some feedback through the browser. If the file was retrieved from the cache we can add a message to the script’s output. Notice that the message for CSS scripts has ‘\n’ at the end. This is because the characters ‘//’ comment our entire line and ‘\n’ pushes everything else onto another line. If you want to disable the messages all you have to do is comment out the line ‘$isCached = TRUE;’.

Giving it a Whirl

If we use our script again, we will notice no change until we refresh a second time when we will see a message saying that the file was retrieved from cache. Sweet success! This caching setup can also be applied to the first script with little modification, however, that is left as an exercise for the reader.

Concluding

Being able to quickly add simple but effective caching to any script that you are working on is an extremely useful skill. It just adds that extra bit to the script, reducing the load on your server and speeding up the site for users. Now that’s win-win!


Maharajas’ Express The Most Expensive Train in India

Operating since January 2010, Maharajas’ Express is the newest luxury train of Indian Railways and easily one of the most expensive one in Asia. For 8 days this pan Indian train takes guests on a ride across the best and the most prominent destinations of the country – Taj Mahal, the Khajuraho temples, wildlife environs of Ranthambore, Fatehpur Sikri and the holy bathing Ghats of Varanasi. The cheapest rate per person per day is a whopping US$ 800 for a Deluxe cabin. The next two slabs are US$ 900 and US$ 1,400. And the Presidential Suite comes for US$ 2,500.

This train is a joint venture between Indian Railway Catering and Tourism Corporation (IRCTC) and Cox and Kings India Ltd. The tour is being promoted as ‘Luxury travel like no other’ and not without reason. The Maharajas’ Express will have 88 passengers (a normal III AC coach packs in 72) living in suites fit for a prince. All food and drinks are complimentary.

The train comprises 24 carriages which include accommodation, dining, bar, lounge, generator and store cars. Each guest carriage has been designed to recreate the opulence of Maharaja Style living. Elegantly decorated, the interiors of the cabin exude the finesse of exquisite workmanship. Sylvan parquets, intricate carvings and palette of soft hues characterize the interiors of the train. All cabins have individual temperature control, LCD television sets, DVD players, direct dial telephones, internet, even live television and electronic safe-deposit box.

Carriages are fitted with panoramic windows to offer the vista of rolling landscape as train travels through some of the most fascinating landscapes and countryside of India. The train also has an observation lounge called the Rajah Club with a private bar. Besides these cars the train also has two elegantly appointed dining cars that offer an array of sumptuous cuisine to the guests. The Bar of the train serves an eclectic mix of wines from across the world in a serene and relaxing ambience. A high-end boutique in the train houses some perfect and intimate memorabilia to cherish this royal sojourn for a life time.

This slideshow requires JavaScript.

Sources: 123


26th Amphibious Car Meet in Switzerland

This week, owners of more than 50 amphibious vehicles brought their World War 2-era military transporters, jeeps and vintage-style cars to Switzerland‚ St Blaise for their annual European gathering. Fitted with colourful sun umbrellas and decorated with flags, what looked like a motley crew of vehicles carrying families including babies and dogs drove off the port and glided smoothly into the water, before moving across Lake Neuchatel.

For those who are not aware, an amphibious vehicle is one that can be driven on both as well as in water, just like an amphibian.

Briton Paul Foley was driving an Amphicar, a 1960s German-built cabriolet which was also the only civilian amphibious vehicle to be mass produced, although only 3878 were made. Patrick Amerijckx drove his favorite vehicle the military Dukw truck – 21,147 of which were produced for the US army during the Second World War – and of which an astonishing number are still in use.

Since 1987, the group has met in various locations in Sweden, Italy, Germany and Switzerland and, in 2012, they will head to Norway. This year it is Switzerland’s Lifeguards Club of the Low-Lake which is hosting the group as part of St Blaise village’s 1000th anniversary celebrations.

This slideshow requires JavaScript.

Photos: Fabrice Coffrini / AFP

[via Independent Online]


Amazing Street Art at Sarasota Chalk Festival

The Sarasota Chalk Festival brings in artists from around the world to display their art on the streets of Sarasota, Florida. The festival, which took place between November 1 to 7, 2011, is the only international event celebrating 16th century Italian street painting.

The festival attracted 200,000 visitors to see more than a hundred artists from all over the world transform Burns Square in downtown Sarasota into an outdoor museum gallery in motion using chalk as their medium and the pavement as their canvas. This year’s lineup includes innovator of 3D pavement art Kurt Wenner from Washington, Melanie Stimmell Van Latam from California, Michael Kirby from Maryland, Leon Keer from Netherlands, Eduardo Relero from Spain, Vera Bugatti from Italy and Tomoteru Saito from Japan.

Here are some amazing creations from the festival.

This slideshow requires JavaScript.

More pictures on Flickr and here


Cano Cristales: The River of Five Colors

The Cano Cristales is a river of Colombia located in the Sierra de la Macarena. For most of the year, Cano Cristales is indistinguishable from any other river: a bed of rocks covered in dull green mosses are visible below a cool, clear current. However, for a brief period of time every year the most amazing transformation occurs – the river blossoms in a vibrant explosion of colors.

During the short span between the wet and dry seasons, the water level drops enough for the sun to warm the moss and algae on the river’s bottom, and this warmth leads to an explosive growth of blooms. A unique species of plant that lines the river floor called Macarenia clavigera turns a brilliant red. It is offset by splotches of yellow and green sand, blue water, and a thousand shades in between. This only happens for a brief period in between seasons for a few weeks from September through November.

Cano Cristales has been called the river of five colors or even the most beautiful river in the world.

Cano Cristales is located in a remote, isolated area not easily accessible by road. The site was closed to tourists for several years because of terrorist activity in the region along with concerns about the environmental impact of tourism. It was reopened to visitors in 2009, and today there are several Colombian Tourist Agencies that will fly travelers to La Macarena. From there it is a short trip into “Serrania de la Macarena,” the national park in which Cano Cristales is located.

This slideshow requires JavaScript.

Picture creditPicture creditPicture creditPicture creditPicture creditPicture creditPicture creditPicture creditPicture creditPicture creditPicture creditPicture creditPicture credit