Going through the php document I came across magic constant __LINE__.
-What this contants does?
returns the current Line No. of the file.
-How we can use this constant in development?
I started using this function for most of the debugging purposes. I simply append it with my echo messages. So when I need to go to code, I can directly go the same line.
I more magical constant I used along with __LINE__ of __FILE__. __FILE__ gives the name of the current script file name.
These two functions reduced 20% of my debugging time.
Example :
// Returns the line number of file
echo __LINE__;
Output : 21
// Returns the line number and full file name.....
echo __LINE__.of.__FILE__;
Otuput :
23 of /opt/lampp/htdocs/demos/demo.php
Blog contains various PHP, Javascript Code that would be helpful for website development. PHP is a open source scripting language useful to develop dynamic website.
Tuesday, 2 August 2011
Sunday, 31 July 2011
Top 10 worst male health habits
From workouts to healthy diets, many of us make an effort to look after ourselves. However, we could be compromising our health on a daily basis without even knowing it. From bottling things up to eating fast food, here are the top 10 male habits you should try to break.
Avoiding the doctor
Research by the charity Men’s Health Forum has revealed that men are 20% less likely than women to visit their doctor, despite the fact that they have shorter life spans than women and are more likely to die from cancer. While visiting the doctor is rarely a pleasant experience, diagnosing most illnesses early increases rates of survival, so stop ignoring those symptoms and give your doctor a call.
Not doing self-checks
Just like with visiting the doctor, many men avoid doing necessary health self-checks due to fear, denial of the risks, or confusion over what to do. However, it is vital that men check themselves regularly for signs of testicular cancer as incidence of the disease is on the rise, particularly in young and middle-aged men. If you are not sure how to go about checking yourself, visit a reputable website or ask your doctor for tips on performing these necessary checks.
Binge drinking
Although women are rapidly catching up with men in the drinking stakes, binge drinking is still more common among men than women, and there are consistently higher rates of alcohol-related deaths and hospitalisations in men.
Binge drinking not only affects long term health, but it puts your immediate safety at risk and can also lead to rapid weight gain. To safeguard your health, it’s important to stick to recommended limits and drink in moderation.
Bottling things up
On the whole, men are less likely than women to talk about their feelings, express emotion or ask for help and support. Perhaps as a consequence of this, men are half as likely as women to be diagnosed with depression, yet are 77 per cent more likely to commit suicide.
Depressed men are also twice as likely as depressed women to resort to alcohol and drug abuse. Bottling up anger is just as detrimental to men’s health, with research suggesting that men who don’t express their anger increase their risk of a heart attack.
Stressing over work
While men and women are equally exposed to workplace stress, according to a survey of 3,000 workers by Medicash, men are four times more likely than women to take a sick day due to work related stress and are twice as likely to turn to alcohol to help deal with it.
As workplace stress can be an important factor in the development of depression, heart disease and stroke, it is vital to seek a way to resolve your feelings and ease your stress; whether it is by talking to your boss, changing your job or seeking professional help.
Taking hot baths
Many men enjoying soaking in the tub, but for all those trying to conceive it may be time to swap those long baths for showers. Researchers from the University of California, San Francisco, found through their three-year study that having hot baths can significantly reduce male fertility.
As sperm develop best in cool surroundings, men should avoid any activity that leads to overheating this area, including sitting in hot tubs or Jacuzzis and regular, prolonged use of laptops.
Not applying sun cream
Although skin cancer is the most common form of cancer in the UK, multiple research studies have shown that few of us regularly wear sunscreen, and that men are the worst offenders.
According to research by Mintel on sun cream use in France, Germany, Spain and the UK, an average of 52 per cent of women use sunscreen, compared to only 37 per cent of men. However, with many men spending significant time outdoor for sports, work or leisure, it is vital to cover up with appropriate clothing and sun cream before heading outside.
Poor bathroom hygiene
Do you wash your hands after you’ve visited the bathroom? According to a study by the American Society for Microbiology and the Soap and Detergent Association, one in three men don’t! Furthermore, a study by the London School of Hygiene & Tropical Medicine carried out at UK service stations found that only a third of men washed their hands with soap. Not washing your hands is the quickest way to spread germs and infection, so protect your health and those around you by making sure you lather up before leaving the bathroom.
Not brushing their teeth
According to a study by the American Dental Association, only 66 per cent of men brush their teeth twice or more a day, compared to 86 per cent of women. Furthermore, research findings published in the Journal of Periodontology showed that women are almost twice as likely to have regular dental checkups than men. Failing to look after your pearly whites is not only bad news for your teeth and gums; research has shown that gum disease can increase risk of heart disease, erectile dysfunction and dementia.
Eating fast food and takeaways
In today’s fast food culture, many of us are guilty of hampering our weight loss by indulging in too much junk food, and this is particularly true for men. A survey by Pew Research Center revealed that 47 per cent of men eat in a fast food restaurant at least weekly, compared to 35 per cent of women. With an average takeaway containing over half your recommended daily calories and copious amounts of salt, do your health a favour by cutting back on takeaways and replacing with home-cooked meals.
Tuesday, 26 July 2011
People get scared , Funny Video
Superb Video
[youtube http://www.youtube.com/watch?v=U_AXcKUEk4w&w=425&h=349]
Wednesday, 20 July 2011
Move (Copy) Div From One Place To Another Using jQuery
Hello Friends if you want to copy or move the data from one div to onther div you can do it easily with jquery.I can do it by creating new HTML and append it to Active records list. But i came to know about Clone functionality of jQuery, Which is best thing to move or copy any html element.
here are two possibility in Clone function of jQuery. If you want to keep the Div at their place and create the same Div at some other place than you can go for Clone. If you want to Move the Div from one place to another than use appendTo. Look at below syntax.
$("div#source_div_id").appendTo("div#destination_div_id");
here are two possibility in Clone function of jQuery. If you want to keep the Div at their place and create the same Div at some other place than you can go for Clone. If you want to Move the Div from one place to another than use appendTo. Look at below syntax.
$("div#source_div_id").appendTo("div#destination_div_id");
Find Number of Child Elements (Length) Using jQuery
Hi Friends, Some days ago I was working on one task in which I was trying to find number of child elements by id or class of parent element by jQuery. I searched about it and found solution for it, So I thought it is worth to share on my wesbite for users, So it can be helpful for anyone and save time for someone.
So below I am going to show to show you can find number of child elements using jQuery.
$(“div#parent_div”).children().length
So by above code you can find number of child elements by id of parent element. In above code id of parent element is “parent_div” , So if you will use this code you will get number of child elements inside this parent.
So by above code you can find number of child elements by id of parent element. In above code id of parent element is “parent_div” , So if you will use this code you will get number of child elements inside this parent
So below I am going to show to show you can find number of child elements using jQuery.
$(“div#parent_div”).children().length
So by above code you can find number of child elements by id of parent element. In above code id of parent element is “parent_div” , So if you will use this code you will get number of child elements inside this parent.
So by above code you can find number of child elements by id of parent element. In above code id of parent element is “parent_div” , So if you will use this code you will get number of child elements inside this parent
Subscribe to:
Posts (Atom)