Friday, November 12, 2010

Importing Large db file in easiest way

hi..
I found one easy solution to upload large db files through phpmyadmin..

1. Go to C:\xampp\phpMyAdmin
2. create one folder there. name it as upload.
3. now open the file C:\xampp\phpMyAdmin\config.inc.php
4. add this line in that file $cfg['UploadDir'] = 'upload';
$cfg['ExecTimeLimit'] = 0;
5. now add your db sql file to upload folder.

and you are done now.
now go to phpmyadmin.. you will find web server upload directory drop down there.
select that file then Go.......and you are done

Monday, November 1, 2010

Javascript trim function

Many of us aware of trim function in php.
but there is no direct trim function in js if we want to use it.
following is the code for trim function in JS.


function trim10 (str) {
var whitespace = ' \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000';
for (var i = 0; i < str.length; i++) {
if (whitespace.indexOf(str.charAt(i)) === -1) {
str = str.substring(i);
break;
}
}
for (i = str.length - 1; i >= 0; i--) {
if (whitespace.indexOf(str.charAt(i)) === -1) {
str = str.substring(0, i + 1);
break;
}
}
return whitespace.indexOf(str.charAt(0)) === -1 ? str : '';
}

You can call it as
msg=trim10(" Bhupendra ");

and you will get o/p as msg="Bhupendra"
very easy...isn't it?

Sunday, October 10, 2010

jooma hack: how to give permission to editors (can be more than one) to edit all articles including other editors also

Hi all,
It seems in joomla that one editor can not edit other editors article.
We have found a solution on this.

Go to components\com_content\views\article\view.html.php
here you will find line as
if($this->getLayout() == 'form'){
just replace this line by
if(($this->getLayout() == 'form')||($this->getLayout() == 'blog')) {

Now Go to libraries\joomla\application\component\view.php

just insert following code
if($this->_template=='')
{
$this->_template=getcwd().'\components\com_content\views\article\tmpl\form.php';
}

before if ($this->_template != false)
in function loadTemplate( $tpl = null)

and you are done.
hope you will enjoy this.. :)

joomla hack : how to avoid articles to be checked-out in joomla

Problem: In joomla there are diffrent users like registered, authors, editors, administrators, super administrators.

editors are able to edit the articles. Sometime what happen, editor click on edit
and without saving that article, clicks on back button or get logged out. because of this that particular article get locked.
no one except that editor and super administrator can checked in that article.
Editor can do it by saving that article and super administrator can do that by logging at admin site and clicking tools ->Global Check in

I found one easy solution. just write following code in your index.php and you will never come across the problem of checked out.

here is he solution

$db =& JFactory::getDBO();

$query_content = "UPDATE jos_content SET checked_out = '0'";
$db->setQuery($query_content);
$result = $db->query();

?>

I hope this will work with you too. Just be careful. Global Checked in feature
is imp in joomla. It has its own significance.

Sunday, August 22, 2010

Create your own google logo

Lets create our own google logo..

visit http://www.goglogo.com
type whatever there. maybe your name :)
enter and see what happens

OR

just paste this link in your browser http://www.goglogo.com/s.asp?lo=BHUPENDRA

remove BHUPENDRA and write your name :)

and you are done

See star wars on windows

1) start -> run
2) type telnet there
3) you will see command promt there. type o, enter.
4) after that type towel.blinkenlights.nl

and wait and see starwars in your pc...haha

Make the folder invisible in another way

Hey ...hi everybody

Do you know another way to make the folder hidden instead of right click-> properties-> hidden
Its very easy.
Make one new folder-> rename it.
and listen how would you rename it. just press alt and type 0160 and look what you get. You will see a folder without having name.
after that right click on that particular folder -> properties-> customize->change icon ...there you can find an invisible icon...i think its 13th column ...2nd or 3rd icon..click on that ...and you are done with invisible folder..haha

Sunday, August 15, 2010

About High Blood pressure

High Blood pressure causes many problems in our day to day life.Its really difficult to overcome it.
There are various elements that cause high blood pressure. The suggested number one cause of hypertension is obesity. Being overweight puts more pressure on your heart and arteries; also minimizing blood flow. Other factors that contribute to elevated blood pressure include stress, high sodium intake and lack of physical activity.
Exercise is necessary to overcome it.
we should eat food containing Vitamin A, C.
Lemon, orange contains vitamin C.
chicken, fish,carrot, spinach contains vitamin A.
Vitamin A and C helps to thin blood.
We should eat 1-2 garlic cloves (Lasun).
You have to remain calm, passionate about work, no over excitement, should not feel pressure.
Should drink lots of water... at least when u feel thirsty.
You think much over a subject, which is really unnecessary, cause high BP.

useful link http://www.minusbloodpressure.com/