Batch renaming files

Batch renaming files in Linux requires writing or using a shell script. If you don't have the time to write or find a shell script to batch rename your files, simply install and use the gprename utility. It is a graphical utility which is suitable for most batch renaming tasks.

To install on Ubuntu

$ sudo apt-get install gprename

To use, simply type gprename in the terminal or Ubuntu Dashboard.

(adsbygoogle = window.adsbygoogle || []).push({});

Sphinx search

Sphinx Search Sphinx is a free standalone full-text search engine. It is fast, efficient, and easily integrates with SQL databases and programming major programming languages. It is ideal for use with MySQL, PostgreSQL, PHP, Python, Perl and Ruby. Although Sphinx works well with Java but Lucene is better option for Java.

Following is a summary of features (copied from http://www.sphinxsearch.com)

Converting string to date in PHP

Converting strings to dates in PHP requires the use of two functions. strtotime function converts the string to an epoch timestamp. date function converts the timestamp to the desirable date format.

<?php
   $string = "Nov 11, 2011";
   $timestamp = strtotime($string);
   $date = date("Y-m-d", $timestamp);
   print $timestamp . "<br>" . $date;
?>

output

PHP Manipulating XML with SimpleXML

SimpleXML is a SAX XML parser. It represents an XML document as a hierarchical set of objects and properties where each element is an object and each attribute is an object property.

Access an XML element using SimpleXML

<?xml version='1.0'?>
<hotels>
   <hotel stars="5">
       <name>President Wilson</name>
       <city>Geneva</city>
       <country>Switzerland</country>
   </hotel>
</hotels>

Save this file as hotel.xml

Pages