Pretty URLs In Drupal

A fresh Drupal installation would be having URL (Uniform Resource Locators) of the following fashion:

http://www.wisetome.com/?q=node/1

Since Drupal is a CMS that stores all the page and other content data in the database, it has to pass details to the main index.php of what page needs to be fetched. In effect, Drupal will be showing only one page, with dynamic data depending on the parameters passed. If a parameter has to be passed, it is done so by attaching a /?q=

to the domain name. So how do we go about making the URLs from something that is above, to a much more user friendly format given below?

http://www.wisetome.com/about-wisetome

We can use some configuration changes, a core module and a contributed module to achieve this.

Configuration changes

  • After logging in to the Drupal site with your adminstrator login, go to Home > Administer > Site configuration > Clean URLs.
  • Select enable.
  • Save configuration.

Note - you may need to provide write permissions for the .htaccess file in your root folder of your webhost account.

This will change it to something that will eliminate the ?q= by using some URL rewrite rules.

http://www.wisetome.com/node/1

ULR aliases - Path module

You can use the core module, Path, to rename the path to whatever you want.
Read the rest of this entry »

Battery And Enviornment

Technology has always be ‘witch-hunted’ for causing damage to our environment. There are many cases where technology helps in protecting the environment. But on the other hand, it can be argued that technology is the source for the damage to begin with. The cause though, is human need. As humans needs and wants increase, technology happens to be the tool that serves the purpose, and as a side effect, it causes environmental damage.

Batteries are one such product of technology and they serve several of our needs. And since we use the batteries, the responsibility falls on our shoulder to ensure that we protect the environment.

As we have seen earlier, batteries can be grouped as primary and secondary batteries. The use of secondary or rechargeable batteries would decrease the number of units we use, and arguably must reduce the effect it has on environment. But if they are not properly put to recycling process, they contain more toxic chemicals and heavy metals than primary batteries.

Batteries can be recycled - be it primary or rechargeable batteries. The Nickle in the NiCd battery can be reclaimed and reused. The problem though comes when we use the ‘use and throw’ kind of gadgets that have the battery sealed in them. This makes it difficult for recycling.

So how can you do your due in protecting the environment with regards to batteries?

  • Reduce use of battery - When you need a new battery, double check that the battery is indeed fully discharged. Ensure that you do not have batteries with you before buying new ones. If possible, use converters and avoid use of batteries.
  • Rechargeable batteries -Whenever possible, use rechargeable batteries. If you are going to see that they are recycled, this will go a long way in reducing the toxic material fall out into environment.
  • Recycle - See that when you throw your waste, you put the used batteries in the recycling bin. Put effort at finding out if there are battery recycling collection outlets in your area, and dispose your batteries there.

Use of rechargeable battery is not the start and end of environment protection. But it does go a long way if the right path is chosen. Research in developing better rechargeable battery would mean that they can be economically used along with environmental friendly power generation options.

To illustrate the point, consider solar power generation. The problem with the option is that no power is generated during the night. But if augmented with an efficient rechargeable battery system, it could be used practically. The same would be the case with any other radical power generation systems.

Use the batteries wisely, and look out for the environment. We owe that to our future generations.

Types of Batteries

Earlier, we saw how batteries work. And then, I had mentioned about different types of batteries.

Basically, there are two types of batteries. Primary batteries and rechargeable or secondary batteries.

Primary cell, by nature of its construction and compositions is able to generate electricity by converting its chemical energy. They are not rechargeable. Once all the energy is spent on providing electric energy, it cannot be used. It needs to be disposed and it needs to be replaced by another new one. But as a trade off they are very cost effective in manufacturing.

Secondary batteries on the other hand do not produce electricity by themselves. They need to be charged - that is - supplied by electricity which it storeos up with in itself and then discharges when in use. Once the full charge is drained, it can again be recharged. Such a discharge-recharge cycle can be performed several times before it can be disposed. For this reason, when other type of electricity is available cheap, you can use rechargeable batteries for quite some time before it can be replace. It is costlier to manufacture a secondary battery - but its ability to recharge pays for itself after several use when compared with primary battery.

The technology in secondary battery is improving. The scope of improvement in these battery is the cost of manufacture, the number of recharge cycles and the amount of time it takes to charge the battery. Research is done in order to improve on these factors.

Battery - How Do They Work?

Battery
As I mentioned earlier, batteries are used in various gadgets in our daily lives.

We will look at how they work internally. I will not be going into details of chemical reactions (like chemical formulas along with the emf values) - but this will be a general look at how they work.

A battery usually consists of one or more cells. If there are more than one cells, then they are usually connected in series.

The cells are usually galvanic cells. There are other types of cells like voltaic, electrolytic, fuel or flow cells. But for our understanding of the internal workings, we will consider them to be just cells.

The cells consist of two half cells. Each of these half cells consist of a electrode and an electrolyte. The half cells are connected to each other through a salt bridge or some kind of porous boundary - so that the electrolytes can interact with each other.

For the battery to function, the half cells would be of different types. The reason is that, if they are same, then they will be having the same emf (electromotive force) potential. The voltage of a battery (that actually powers other devices) is nothing but the difference between the emf of the two half cells. The electrode of the half cell having lower emf of the two, is called anode. It is usually denoted by the (-) sign. The other half cell having a higher potential is called cathode and is denoted by the (+) sign.
Read the rest of this entry »

Battery

They are present in your cell phones, walkmans, PMPs, wall clocks, toys and what not. They power all these portable devices - they are a product of evolution in electrical technology that dates back to ancient times.

The batteries have a history that might just date back to 250 BC in case of Baghdad Battery though the purpose is shrouded in mystery. The modern phase in the life of battery technology, still has an alchemical nature, with Luigi Galvani experimenting with frogs and metals in 1780s. Serious work on the battery was done by Alessandro Volta in 1790s - he created the first ’stacked’ battery, by literally stacking voltaic cells. The technology has now brought batteries quite far ahead from those days, but we still seem to use some of the older varieties like the lead acid battery.

In this coming weeks, I will try to collect and compile some information on how these batteries work, what types of batteries are there, and other issues related to battery.

More On Drupal

This post is just a heads up on things I will be posting about Drupal in following weeks. I have been using this content management system (CMS) for quite some time (and also Wordpress).

This site - the root - runs on Drupal. (This blog though, runs on Wordpress).

My personal site, runs on Drupal. And so does, my friend, Sushil’s site, that I helped him setup. Drupal is a great choice for personal websites, when you need to do more than blogging. It lets you handle an assortment of types of content, and yet be able to manage it based on taxonomy system - in simple words - a way of categorization.

Drupal, can be used not just for personal sites, but also community sites. I used Drupal to setup FunKaam.com - a community site in the making.

In a series of post, I will try and cover:

  • Hosting and installation of Drupal sites - I have got quite a few requests on giving an explanation
  • Setting up Drupal powered site - regarding the core and supplied modules
  • On extending Drupal - choices on community/third-party modules

Please comment below if you would like to know anything else on Drupal.