Thursday, December 31, 2009
Happy New Year - 2010
We are heartly welcome to New Year that brings us sparks in our life.
Wish you a happy new year .
http://www.anil2u.info/newyear.php
Wednesday, December 30, 2009
Search for existing domain names using domainr API
Hello friends,
Domainr API is used to get the information of existing domain names. it is working for all domains ( most probably might not be work for subdomains).
See the following php script :
? >function getInfo($domain) {
$domain = urlencode($domain); // encode url here…$request = “http://domai.nr/api/json/search?”;
$request .= “q=”.$domain.”&”;return $response = file_get_contents($request);
}
Pass the domain name to that function like : ( without http )
$data=getInfo(‘www.anil2u.info’);
? >
Get the results in the json format and convert into string:
$obj = json_decode($data);
echo “This domain is “.$obj->{‘results’}[0]->{‘availability’} ;
? >
Tuesday, December 22, 2009
World class resume for ever of one indian
- 1950: Stood first in BA (Hons), Economics, Punjab University, Chandigarh ,
- 1952; Stood first in MA (Economics), Punjab University , Chandigarh ,
- 1954; Wright's Prize for distinguished performance at St John's College, Cambridge,
- 1955 and 1957; Wrenbury scholar, University of Cambridge ,
- 1957; DPhil ( Oxford ), DLitt (Honoris Causa); PhD thesis on India 's
export competitiveness
OCCUPATION /Teaching Experience :
- Professor (Senior lecturer, Economics, 1957-59;
- Reader, Economics, 1959-63;
- Professor, Economics, Punjab University , Chandigarh , 1963-65;
- Professor,Internati onal Trade, Delhi School of Economics,Universit y
of Delhi,1969-71 ; - Honorary professor, Jawaharlal Nehru University ,New Delhi,1976 and
Delhi School of Economics, University of Delhi ,1996 and Civil Servant
Working Experience/ POSITIONS :
- 1971-72: Economic advisor, ministry of foreign trade
- 1972-76: Chief economic advisor, ministry of finance
- 1976-80: Director, Reserve Bank of India ;
- Director, Industrial Development Bank of India;
- Alternate governor for India, Board of governors, Asian Development Bank;
- Alternate governor for India, Board of governors, IBRD
- November 1976 - April 1980: Secretary, ministry of finance (Department
of economic affairs); - Member, finance, Atomic Energy Commission; Member,finance, Space Commission
- April 1980 - September 15, 1982 : Member-secretary, Planning Commission
- 1980-83: Chairman , India Committee of the Indo-Japan joint study committee
- September 16, 1982 - January 14, 1985 :Governor, Reserve Bank of India ..
- 1982-85: Alternate Governor for India , Board of governors,
International Monetary Fund - 1983-84: Member, economic advisory council to the Prime Minister
- 1985: President, Indian Economic Association
- January 15, 1985 - July 31, 1987 : Deputy Chairman, Planning Commission
- August 1, 1987 - November 10, 19! 90: Secretary-general and commissioner,
south commission, Geneva - December 10, 1990 - March 14, 1991 : Advisor to the Prime Minister on
economic affairs - March 15, 1991 - June 20, 1991 : Chairman, UGC
- June 21, 1991 - May 15, 1996 : Union finance minister
- October 1991: Elected to Rajya Sabha from Assam on Congress ticket
- June 1995: Re-elected to Rajya Sabha
- 1996 onwards: Member, Consultative Committee for the ministry of finance
- August 1, 1996 - December 4, 1997: Chairman, Parliamentary standing
committee on commerce - March 21, 1998 onwards: Leader of the Opposition, Rajya Sabha
- June 5, 1998 onwards: Member, committee on finance
- August 13, 1998 onwards: Member, committee on rules
- Aug 1998-2001: Member, committee of privileges 2000 onwards: Member,executive committee, Indian parliamentary group
- June 2001: Re-elected to Rajya Sabha
- Aug 2001 onwards: Member, general purposes committee
BOOKS:
- India 's Export Trends and Prospects for Self-Sustained Growth -
Clarendon Press, Oxford University , 1964; also published a large
number of articles in various economic journals.
OTHER ACCOMPLISHMENTS:
- Adam Smith Prize, University of Cambridge , 1956
- Padma Vibhushan, 1987
- Euro money Award, Finance Minister of the Year, 1993;
- Asia money Award, Finance Minister of the Year for Asia, 1993 and 1994
INTERNATIONAL ASSIGNMENTS:
- 1966: Economic Affairs Officer
- 1966-69: Chief, financing for trade section, UNCTAD
- 1972-74: Deputy for India in IMF Committee of Twenty on
International Monetary Reform - 1977-79: Indian delegation to Aid-India Consortium Meetings
- 1980-82: Indo-Soviet joint planning group meeting
- 1982: Indo-Soviet monitoring group meeting
- 1993: Commonwealth Heads of Government Meeting Cyprus 1993: Human
Rights World Conference, Vienna
RECREATION :
- Gymkhana Club, New Delhi; Life Member, India International Centre,
New Delhi
PERSONAL DETAIL:
- Name: Dr Manmohan Singh
- DOB: September 26, 1932
- Place of Birth: Gah ( West Punjab )
- Father: S. Gurmukh Singh
- Mother: Mrs Amrit Kaur
- Married on: September 14, 1958
- Wife: Mrs Gursharan Kaur
- Children: Three daughters
Thursday, November 26, 2009
How to integrate fckeditor to smarty application?
Integration of fckeditor in smarty application
1 . in libs\plugins write the foolowing file called function.fckeditor.php<?php
/**
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
* Smarty function plugin
static $base_arguments = array();
* Requires PHP >= 4.3.0
* ————————————————————-
* Type: function
* Name: fckeditor
* Version: 1.0
* Purpose: Creates a FCKeditor, a very powerful textarea replacement.
* ————————————————————-
* @param InstanceName Editor instance name (form field name)
* @param BasePath optional Path to the FCKeditor directory. Need only be set once on page. Default: /FCKeditor/
* @param Value optional data that control will start with, default is taken from the javascript file
* @param Width optional width (css units)
* @param Height optional height (css units)
* @param ToolbarSet optional what toolbar to use from configuration
* @param CheckBrowser optional check the browser compatibility when rendering the editor
* @param DisplayErrors optional show error messages on errors while rendering the editor
* Default values for optional parameters (except BasePath) are taken from fckeditor.js.
* All other parameters used in the function will be put into the configuration section,
* CustomConfigurationsPath is useful for example.
* See http://wiki.fckeditor.net/Developer%27s_Guide/Configuration/Configurations_File for more configuration info.
*/
function smarty_function_fckeditor($params, &$smarty)
{
if(!isset($params['InstanceName']) || empty($params['InstanceName']))
{
$smarty->trigger_error(‘fckeditor: required parameter “InstanceName” missing’);
}
static $config_arguments = array();
// Test if editor has been loaded before
if(!count($base_arguments)) $init = TRUE;
// BasePath must be specified once.
else $init = FALSE;
if(isset($params['BasePath']))
$base_arguments['InstanceName'] = $params['InstanceName'];
{
$base_arguments['BasePath'] = $params['BasePath'];
}
else if(empty($base_arguments['BasePath']))
{
$base_arguments['BasePath'] = ‘/FCKeditor/’;
}
if(isset($params['Value']))
if(isset($params['Width'])) $base_arguments['Width'] = $params['Width'];
$base_arguments['Value'] = $params['Value'];
else
$base_arguments['Value'] = ”;
if(isset($params['Height'])) $base_arguments['Height'] = $params['Height'];
// Use all other parameters for the config array (replace if needed)
if(isset($params['ToolbarSet'])) $base_arguments['ToolbarSet'] = $params['ToolbarSet'];
if(isset($params['CheckBrowser'])) $base_arguments['CheckBrowser'] = $params['CheckBrowser'];
if(isset($params['DisplayErrors'])) $base_arguments['DisplayErrors'] = $params['DisplayErrors'];
$other_arguments = array_diff_assoc($params, $base_arguments);
$out = ”;
$config_arguments = array_merge($config_arguments, $other_arguments);
if($init)
{
$out .= “\n<script type=\”text/javascript\”>\n”;
$out .= ‘<script type=”text/javascript” src=”‘ . $base_arguments['BasePath'] . ‘fckeditor.js”></script>’;
}
$out .= “var oFCKeditor = new FCKeditor(‘” . $base_arguments['InstanceName'] . “‘);\n”;
foreach($base_arguments as $key => $value)
{
foreach($config_arguments as $key => $value)
if(!is_bool($value))
{
// Fix newlines, javascript cannot handle multiple line strings very well.
$value = ‘”‘ . preg_replace(“/[\r\n]+/”, ‘” + $0″‘, addslashes($value)) . ‘”‘;
}
$out .= “oFCKeditor.$key = $value; “;
}
{
$out .= “\noFCKeditor.Create();\n”;
if(!is_bool($value))
{
$value = ‘”‘ . preg_replace(“/[\r\n]+/”, ‘” + $0″‘, addslashes($value)) . ‘”‘;
}
$out .= “oFCKeditor.Config[\"$key\"] = $value; “;
}
$out .= “</script>\n”;
return $out;
}
/* vim: set expandtab: */
?>
2 download the fckeditor from the http://www.fckeditor.net/ and save it in the smarty folder
3 in the php file we include the fckeditor.php file4 in the tpl file we write the following code
{fckeditor BasePath=”../includes/fckeditor/” InstanceName=”news_desc” Width=”650px” Height=”300px” Value=”$news_desc”}
Complete information @ http://anil2u.wordpress.com
Tuesday, November 24, 2009
Installation of drupal in localhost
Drupal Installation procedure:
1) Download the zip file from http://www.drupal.org that is drupal 5.20 version.2) Unzip that file and place that folder at www follder
3) Run that file at browser :http://localhost/drupal/
4) The Drupal installer requires write permissions toduring the installation process. So we need to change the file permission of settings.php file../sites/default/settings.php
5) Creare database in phpmyadmin and give the details at the second screen of installation procedure.
6) After that we need to chnage the file permisstion ofremove the write permisstion../sites/default/settings.php ,
7) Now we can sucessfully run the drupal site like :
http://localhost/drupal/
Hope that it will be useful. Complete information @ http://anil2u.wordpress.com
Wednesday, November 18, 2009
Select the age from birthday date field in mysql ?
Hi,
following is user table:CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`fname` varchar(255) NOT NULL,
`mname` varchar(255) NOT NULL,
`lname` varchar(255) NOT NULL,
`createdat` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`birthday` date NOT NULL,
PRIMARY KEY (`id`)
);
insert one row into table:
(1, ‘Anil’, ‘Kumar’, ‘Panigrahi’, ‘2009-11-19 11:04:27′, ‘1983-02-14′),
To retrieve age from the table:
SELECT YEAR( NOW( ) ) - YEAR( birthday ) - IF( MONTH( NOW( ) ) < MONTH( birthday ) , 1, 0 ) - IF( MONTH( NOW( ) ) = MONTH( birthday )AND DAYOFMONTH( NOW( ) ) < DAYOFMONTH( birthday ) , 1, 0 ) AS age, birthday, now( ) From user;
Complete information @ http://anil2u.wordpress.com
