Drupal - Difference between date, datetime and datestamp fields

The difference resides in the way each field is stored in the database.
The date field is an ISO 8601 standard date. It is useful if you want to store incomplete dates, like year and month only. It is stored in the database as varchar field.
It is use for complete dates. It is stored in regular datetime field of the database.
datestamp is the unix timestamp. It is discouraged to use this in favor of datetime.


Drupal - Hide CCK field from input form

The simplest way to do this is to enable Content Permissions module and then don't allow the intended user group to view or edit that particular field.

Drupal - Create an empty module

The following shows you step-by-step how to create an empty module.

  1. Create a directory for your module(e.g. my_empty_module/). The module directory name should be in lowercase and should not contain spaces. To avoid headaches, please restrict yourself to letters, numbers and underscores.

Firefox Extension - Write text in file in your extension's folder

Below is a code sample showing how to write text in file(data.txt) in your extension's folder.


Firefox Extension - Invoke Java code from Javascript

Standard Java Classes To use the standard Java classes from Javascript, there are only 2 steps:

  1. Insert Packages in front of the fully qualified name of the Java class that you would like to use.
  2. Assign that fully qualified class name to a local variable.

Here is simple example illustrating the 2 steps:

var myJsVariable = new Packages.java.util.ArrayList();    

Another more complex example:  

Firefox Extension

Firefox Extension tutorial

Firefox Extension - Ant build file to package Firefox's extension

Below is an example of Ant build file to package Firefox's extension.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="build" name="yourFirefoxExtName">
  <target name="build">
    <!-- JAR the content of your chrome/ folder -->
    <jar destfile="${ant.project.name}.jar">
      <fileset dir="chrome">
        <exclude name="${ant.project.name}.jar"/>
    <!-- Create XPI file. -->
    <move file="${ant.project.name}.jar" todir="chrome" overwrite="yes" />


Apache Ant is a Java-based build tool.

Define a variable

TestNG - First TestNG test

Write TestNG test

Writing tests using TestNG is easy. There are only 2 steps:


Subscribe to OpenWritings.net RSS