Using database in PEAR and Smarty
For using database, you need to install a package of PEAR called ‘MDB2’ along with the installation of PEAR and Smarty.
MDB2 provides a common API for all support RDBMS.
Connecting to database
To connect to a database through PEAR::MDB2, you have to create a valid DSN – data source name. This DSN consists in the following parts:
phptype: Database backend used in PHP (i.e. mysql , pgsql etc.)
dbsyntax: Database used with regards to SQL syntax etc.
protocol: Communication protocol to use ( i.e. tcp, unix etc.)
Develop Your Own Google with Apache Lucene (Java Nutch Solr)
Apache Lucene is Open Source API that allows a Java developer (.Net libraries available) to write indexing and full-text search capable applications. I have been writing applications based on Lucene for the last 3 years and some of the applications have been deployed at large corporations. I know there are other libraries available to developers who wish to write indexing engine but this blog will solely focus on Apache Lucene. I will not compare it to other API.
Lucene is a very mature API and can be found in NetBeans IDE, Liferay, JackRabbit among others. IBM has written a very good document about the Lucene architecture, therefore I will not delve into it here.
ShareThis API Examples
Define Your Sharable Objects:
Using the ShareThis API, it is easy to define the sharable objects. As an example, a website that sells products is able to define such detail as title, description, product image. When an item is shared, the recipient will be able to see all the details defined.
Here is an example of code that could be used:
<script language="javascript" type="text/javascript">
SHARETHIS.addEntry({
title:'Best Digital Camera',
summary:'This digital camera has all the features one would ever need!',
url:'http://mystore.com/digitalcamera',
icon: 'http://path.to/icon'
}, {button:true} );
</script>
Drupal Modules
There are plenty of Drupal Modules that you can install for your site as add-ons. What we liked best about Drupal modules is that it already comes pre-shipped with several modules. So a standard distribution contains several useful modules that you can simple point, click and enable.
Some examples of such pre-shipped modules are: archive that displays a calendar
to navigate old content, book which allows users to collaboratively author a book,
forums for threaded discussions about general topics, paths that enable renaming
URLs for search engines, polls to capture votes on different topics in the form of
multiple choice questions, and much more.
You can also download many user contributed modules from the Drupal site that are
not pre-shipped in the standard distribution. You can see the full list of modules at:
http://drupal.org/project/Modules. Here are some modules that we found
interesting:
Continue reading »



