Lets share love

How ? copy url of this blog and share in your social network :) simple

Lets share love

How ? copy url of this blog and share in your social network :) simple

Monday, November 24, 2014

Scroll to Top Button

1.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http://arrow.scrolltotop.com/arrow1.js"></script>
<noscript>Not seeing a <a href="http://www.scrolltotop.com/">Scroll to Top Button</a>? Go to our FAQ page for more info.</noscript>

2.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http://arrow.scrolltotop.com/arrow3.js"></script>
<noscript>Not seeing a <a href="http://www.scrolltotop.com/">Scroll to Top Button</a>? Go to our FAQ page for more info.</noscript>

3.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http://arrow.scrolltotop.com/arrow13.js"></script>
<noscript>Not seeing a <a href="http://www.scrolltotop.com/">Scroll to Top Button</a>? Go to our FAQ page for more info.</noscript>

4.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http://arrow.scrolltotop.com/arrow23.js"></script>
<noscript>Not seeing a <a href="http://www.scrolltotop.com/">Scroll to Top Button</a>? Go to our FAQ page for more info.</noscript>

for more :

http://www.scrolltotop.com/

Thursday, November 20, 2014

Backing Up Your MySQL Database

mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]

Tuesday, November 11, 2014

His wife asked him to take another woman to date and a movie :)


#Copied 

Friday, November 7, 2014

Facebook CEO Mark Zuckerberg wears the same T-shirt every day. Find out why.


Facebook CEO Mark Zuckerberg had his first-ever public Q&A on Thursday.

He answered a lot of different questions, but the one that got a lot of interest was, "Why do you wear the same T-shirt every day?"

For those who haven't noticed yet, Zuckerberg wears the same grey T-shirt at most public events. While many expected a playful response, Zuckerberg gave a pretty serious answer for his penchant to wear the same grey shirt.

"I really want to clear my life to make it so that I have to make as few decisions as possible about anything except how to best serve this community," Zuckerberg said, after clarifying that he has "multiple same shirts."

He said even small decisions like choosing what to wear or what to eat for breakfast could be tiring and energy consuming, and he doesn't want to waste any time on that.

"I'm in this really lucky position, where I get to wake up every day and help serve more than a billion people. And I feel like I'm not doing my job if I spend any of my energy on things that are silly or frivolous about my life," he said.

Zuckerberg pointed out that a number of other influential people, like Apple founder Steve Jobs or president Barack Obama, have the same theory with regards to choosing their outfits. Jobs, in fact, told Walter Isaacson in his biography that he even wanted to have all Apple employees wear the same vest.

The Experiment




#copied 



Tuesday, October 28, 2014

People to follow in Nepal for Motivation

      1.Ramesh Kharel:
Currently the Senior Superintendent of Police in Nepal Police, this man is the rare clean cop. He cracks down on crime, loathes  criminal gang activities, puts the dons on strait-jackets and fires his corrupt subordinates.








2. Mahabir Pun:
Born in Myagdi district and educated in the USA, he has been helping the villagers of western Nepal with his genuine idea of providing computers and internet for every school and medical diagnosis in the remotest areas through tele-medicine.He has been honored with the Ramon Magsaysay Award.





3. Anuradha Koirala:
She has helped to reunite families. Her organisation patrols the border along with the security forces to recognize and apprehend the innocent girls being led into India by the cunning girl-traffickers.
Her service has been recognized throughout the world as she has been honored with awards like the CNN Hero of the Year (2010) and Courage of Conscience Award (Massachusetts, 2006)

4.Binod Chaudhary
Binod Chaudhary (Nepali: बिनोद चौधरि; born 14 April 1955) is a Nepalese businessman, industrialist and philanthropist. He is the current chairman of Chaudhary Group (CG), a conglomerate that consists of nearly 80 companies. Chaudhary is also the first Nepali billionaire as listed by Forbes.



5. Dr. Upendra Mahato
Mahato (Nepali: उपेन्द्र महतो) is a businessman of Nepalese origin living in Russia, where he is the president of the Russia-Nepal Chamber of Commerce and Industry. He is the Honorary consul General of Nepal in the Republic of Belarus. He was president of Non Resident Nepalese Association, International coordination council (NRNA, ICC)


6.Gagan Thapa
Gagan Thapa is a Nepalese politician, belonging to the Nepali Congress. He is, at present, one of the most popular and influential youth political leaders in Nepal widely followed in various social networking sites. Many youth see him as the next generation Prime minister of Nepal in 10 to 15 years time. Thapa is the central committee member of the Nepali Congress. He was also the former member of the constituent assembly (2008–12)and has been elected for Constituent Assembly (2013-)Appreciated for his speeches and interviews, people now have got enough of his talking and want him to see in a active executive post.



7. Dr. Baburam Bhattarai
Dr. Baburam Bhattarai (Nepali:डाक्टर बाबुराम भट्टराई) is one of the powerful politician of Nepal who was the 35th Prime Minister of Nepal from August 2011 to March 2013. As a way out of the political deadlock since the dissolution of the first Nepalese Constituent Assembly in May 2012, he was then replaced by Chief Justice Khil Raj Regmi to head an interim government that should holdelections by 21 June 2013. He is a senior Standing Committee Member and vice chairperson of Unified Communist Party of Nepal (Maoist).

Wednesday, October 22, 2014

दिपावली किन मनाउने ?

तिहार तथा दिपावली हाम्रो एउटा धेरै नै महत्वपूर्ण चाड पर्व हो। त्यसो भए हामी किन दिपावली मनौचौ त ? यहाँ छन् की बुदा हरु।


-> आज को दिन देवी लक्ष्मी को जन्मदिन हो। 

->विष्णु ले आज को दिन लक्ष्मी लाई छुटेका हुन्। 

-> कृष्ण ले नरकसुर लै मारेका हुन। 

->पाण्डव हरु १२ वर्ष को गुप्त बास  बाट फर्केका हुन्। 

->आज कै दिन राम , सीता र लक्ष्मन रावण लाई       मारेर घर फर्केका हुन्। 

-> आज को दिन जैन , सिख तथा आर्य समाज को लागि महत्वपूर्ण मानिन्छ। 

सबै लै दिपावली को सुभकामना :) 


Monday, October 20, 2014

How to put array in string like [1,2,3,4] to 1,2,3,4

here is a simple trick :)

String listOfPhase =""

        for (int i = 0; i < phaseIds.size(); i++) {
            if (i == 0)
                listOfPhase += phaseIds[i].toString()
            else
                listOfPhase += "," + phaseIds[i].toString()
        }


NOTE : phaseIds is your array 

Sunday, October 19, 2014

How to remove div content using html() in JQuery

How to remove div content using html() in JQuery


$("#RemovingContent").children().remove();
$("#RemovingContent").html("");


RemovingContent is the div that you want to remove content of :) 


here is the complete example

<html>
<head>
    <title></title>

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

    <script type="text/javascript">
        $(document).ready(function() {
        $('#btnChangetext').click(function() {
            //remove the div content
                $("#RemovingContent").children().remove();
                $("#RemovingContent").html("");
            //adding content to div
                $("#RemovingContent").html("<a href=www.aspnettutorialonline.blogspot.com>www.aspnettutorialonline.blogspot.com/</a>");
                //you can also add one more div to #RemovingContent
                $("<div>hello</div>").appendTo($("#RemovingContent"));
                
            });
        });
    </script>

</head>
<body>
    <div id="RemovingContent">
        it will be removed </div>
    <input type="button" value="Change div text" id="btnChangetext" />
</body>
</html>


How to keep same tab active in Twitter Bootstrap after page reload using localStorage

What is HTML Local Storage?

With local storage, web applications can store data locally within the user's browser.
Before HTML5, application data had to be stored in cookies, included in every server request. Local storage is more secure, and large amounts of data can be stored locally, without affecting website performance.
Unlike cookies, the storage limit is far larger (at least 5MB) and information is never transferred to the server.
Local storage is per domain. All pages, from one domain, can store and access the same data data.

HTML local storage provides two objects for storing data on the client:
  • window.localStorage - stores data with no expiration date
  • code.sessionStorage - stores data for one session (data is lost when the tab is closed)


// for loading same tab after page reload using localstorage
    $(function() {
        //for bootstrap 3 use 'shown.bs.tab' instead of 'shown' in the next line
        $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
            //save the latest tab; use cookies if you like 'em better:
            localStorage.setItem('lastTab', $(e.target).attr('id'));
        });

        //go to the latest tab, if it exists:
        var lastTab = localStorage.getItem('lastTab');
        if (lastTab) {
            $('#'+lastTab).tab('show');
        }
    });

Thursday, October 16, 2014

Do you know ? what to do with your life ?

i copied this article from this web page http://www.entrepreneur.com/article/238522 :)

Writer: Eric M. Ruiz

I was in San Luis Obispo, Calif., last weekend for a wedding. I took advantage of my time on the left coast to travel to Modesto to see my family. My brother and sister happened to be in town as well, so for the first time since May, all five members of the Ruiz family were gathered.
I had the chance to spend some quality time with my sister Mary, who's the youngest in the family, and she filled me in on what she’s been up to since her graduation in May.
The more we spoke, the more I could feel the anxiety in her voice as she reiterated time and time again that she had no idea what to do.
“You love business and technology and Miguel loves medicine," she said, referring to my younger brother. "What do I have?”
I understood her frustration. I had the exact same feeling of inadequacy and anxiety when I graduated. But what I wanted to make clear to my beloved sister last weekend -- and now to others out there grappling with their careers -- is that most people have no idea what they want to do.
I envy the likes of Kobe Bryant, Leo Messi and LeBron James -- not because of their celebrity status but because at an early age they figured out exactly what they wanted to do. And they started doing it.

For most people, it takes years or decades to find a calling, a passion or a field. There is no real timeline for when someone will figure things out or will finally arrive at an endeavor she will love. But the only way to get there is by trying many things. A passion or calling just doesn't manifest itself.
A person cannot simply think his way to clarity. He has to try things.
Contrary to my sister’s initial belief, I wasn’t born knowing that I wanted to work in an entrepreneurial environment or that I wanted to be a writer. And my brother Miguel did not know that he wanted to pursue medicine. But we each had inklings about our interest in these fields.
Many people have an inkling, a bit of curiosity that pushes them, say, to explore something or look it up on the Internet. 
“The possession of a particular talent is instinctively sensed by its owner, so if any of you are blessed you will be the first to know it," the Stoic philosopher Epictetus wrote centuries ago in Discourses and Selected Writings
"It is true however, that no bull reaches maturity in an instant, nor do men become heroes over night," Epictetus continued. "We must endure a winter’s training, and can’t be dashing into situations for which we aren’t yet prepared.”
So pursue that curiosity. Only then will it be possible to a passion or a field of possible career interest.
During the months after I graduated college, I read about or tried my hand at the following pursuits: online marketing, English as a second language teaching, graduate school, banking, starting a business and soccer coaching. (I’m sure I’m forgetting a few things.) I didn’t like some of them, I hated others and I failed at many.
But what spoke to me (even after a failure) was entrepreneurship and the startup world. I just had to get involved. And my devouring of book after book, podcast after podcast and setting off for meeting after meeting seemed to confirm something at a deep level inside: I really liked this field.
This was both an empowering and a humbling feeling. The more I learned, the more excited I became. But the more I learned, the more I realized that I didn't know anything.
It's that dichotomy that pushed me forward to ask questions, meet people and explore this business side of me. It’s an ongoing process, one that takes time, patience and discipline.
Only by asking questions and trying new things can people really get to where they want to be. It’s not going to be just handed to them. Be brave and get after it.
So, Mary and fellow graduates, try things. Try many things. Maybe it’s too late to be an NBA star but it's possible to discover, or rediscover, a desire, a passion, a calling, an invitation. 

Sunday, September 14, 2014

You have a birthday cake and have exactly 3 cuts to cut it into 8 equal pieces. How do you do it?

The answer: stack the pieces

The “correct” answer is to cut the cake in quarters (4 pieces) using 2 of the cuts – one horizontally down the center of the cake and the other vertically down the center of the cake. This will leave you with 4 pieces (or slices) of cake. Then, you can take all 4 pieces and arrange them in a stack that is 4 pieces high. Finally, you can just cut that stack of 4 pieces in half – using your third and final cut – and then you will end up with 8 pieces of cake!
You might think of this as sort of a trick question, since moving the pieces is something “out of the box” – but somebody asking this question is probably looking for that kind of out of the box thinking.

## copied :) 

Thursday, September 11, 2014

how to zip a folder


have you ever wondered how to zip a folder . many just wonder :p try this :) 


Tuesday, September 9, 2014

Spring security logout

put this anywhere :)

<form name="submitForm" method="POST" action="${createLink(controller: 'logout')}">
<input type="hidden" name="" value="">
<a HREF="javascript:document.submitForm.submit()">Logout</a>
</form>

The webpage has redirect loop . Grails Spring Security Core RC4 error

Here while installing and implementing new Spring Security Core RC4 i faced following problems:


and in console 

In console you will see that it will not find SecRoleSecUser table and webpage will get looped :

 If you are using requestmap to handle your access level you have to place following
code in bootstrap.groovy

 new Requestmap(url: '/home', configAttribute: 'ROLE_ADMIN').save()
        new Requestmap(url: '/*', configAttribute: 'IS_AUTHENTICATED_ANONYMOUSLY').save();
        new Requestmap(url: '/logout/**', configAttribute: 'IS_AUTHENTICATED_REMEMBERED,IS_AUTHENTICATED_FULLY').save();
        new Requestmap(url: '/login/**', configAttribute: 'IS_AUTHENTICATED_ANONYMOUSLY').save()
        new Requestmap(url: '/index/**', configAttribute: 'IS_AUTHENTICATED_ANONYMOUSLY').save();


how to change default home page in grails

class UrlMappings {

static mappings = {
        "/$controller/$action?/$id?(.$format)?"{
            constraints {
                // apply constraints here
            }
        }
        "/login/$action?"(controller: "login")
        "/logout/$action?"(controller: "logout")

        "/"
                {
                    controller = "Home"
                }
        "500"(view:'/error')
}
}


the main difference is the orange shadowed line :) 

Monday, September 8, 2014

how to change port to run grails app

put this line in buildconfig.groovy

grails.server.port.http = 8888

8888 is the port that u want grails app to run on

note:

0 to 9999

There are total 65535 ports in a computer, in which 1024 ports are well known ports.

Wednesday, September 3, 2014

Heap size and Perm size

The GC document on Sun's site showed the Perm generation to be part of the Heap size. It seems that the Perm size is

different from the Heap size.The total memory used by the JVM process will be = Memory used by the JVM for internal management + memory allocated in native code + memory allocated for the permanent space.
This is the memory that U see in Task-Manager in Windows or 'top' on Solaris.

A quick definition of the "permanent generation":

"The permanent generation is used to hold reflective data of the VM itself such as class objects and method objects. These

reflective objects are allocated directly into the permanent generation, and it is sized independently from the other

generations."

In other words, this is where class definitions go (and this explains why you may get the message OutOfMemoryError:

PermGen space if an application loads a large number of classes and/or on redeployment).



Java's  Heap Size

Java has a couple of settings that help control how much memory it uses:

-Xmx sets the maximum memory heap size
-Xms sets the minimum memory heap size.

Keep -Xms Small

For a server with a 'small' amount of memory, then we recommend that -Xms is kept as small as possible.  e.g. -Xms 16m.

Some  set this higher, but that can lead to issues.  e.g. the command that restarts tomcat runs a java process.

That Java process picks up the same -Xms setting as the actual Tomcat process.  So you will effectively be using two times

-Xms when doing a restart.  If you set -Xms too high, then you may run out of memory.

Don't Let -Xmx Be Too Low

When setting the -Xmx setting you should consider a few things...  -Xmx has to be enough for you to run your app.  If it is set too low then you may get Java OutOfMemory exceptions (even when there is sufficient spare memory on the server).

If your application is throwing an OutOfMemoryError then it could be because the PermSize is full, rather than the heap size. HERE IS ANOTHER POST TO SOLVE THIS PROBLEM


How do I properly set the permgen size?

Two ways to solve perm gen (out of memory ) problem.

1.

 You have to change the values in the CATALINA_OPTS option defined in the Tomcat Catalina start file. To increase the

PermGen memory change the value of the MaxPermSize variable, otherwise change the value of the Xmx variable.

Linux :
Open Catalina.sh file placed in the "bin" directory. You have to apply the changes to this line

CATALINA_OPTS="$CATALINA_OPTS -server -Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m"

Windows:

Open the "Catalina.bat" file placed in the "bin" directory

set CATALINA_OPTS=-server -Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m


2.
You can use any text editor to create the file. Make sure that it is syntactically a valid Window batch script. Most of

the time, you would just set environment variables in this file.

For example:

set JAVA_HOME=C:\path\to\java\home
set CATALINA_OPTS=-Xmx2G -Xss256k

As a note, you only want to use the setenv.bat file if you are running Tomcat from the console (something that is done rarely). In most cases, you'll be running as a Windows Service. If you are running as a Windows Service then you don't want to use setenv.bat. Instead, you'll want to use the Tomcat GUI application to make configuration changes.

NOTE:
but it must be said that if you have a fundamental memory leak in your app, it probably doesn't matter how large you set the heap - you'll still run out off memory

Tuesday, September 2, 2014

Khudi ko kar buland itna ke har taqder se pehle Khuda bande se ye poche bata teri raza kia hai


Khudi ko kar buland itna ke har taqder se pehle
Khuda bande se ye poche bata teri raza kia hai

Monday, September 1, 2014

How to change password of mysql in xampp

You will need this many times :)

1. First of all open the control panel of xampp and click on config of Apache . You will find config.inc.php file of phpmyadmin.  this will open you a txt file. Then search for password. 

this will open you a txt file. Then search for password. 


2.now open command prompt and write as following :



then you have to execute following query 

 

Friday, August 29, 2014

tools

1. Streamus™ (Beta!) is a chrome extension which turns YouTube into a music player. You can create your own playlists and it saves them to your google account. Don't have to open a new tab every time to listen to a new song:



2. Like an article, but want to save it for later? Use Pocket. Available on all platforms ( chrome, firefox, android, iOS). Just a tap and the article will be saved on all of your devices

3. StayFocusd is a chrome extension which limits your activity on a particular website (for ex. you cannot spend more than say 15 mins per day on Facebook). Once the daily quota is finished, you can no longer open the website unless you complete a challenge posted by the app. You can also control how lenient the challenge should be:



4. You probably know this. Dictionary.com's chrome extension helps to know the meaning of any word by just a double click on the word.

5. Vocabulary.com helps you to build your vocabulary by keeping track of your progress. 

6. Swipe Gesture is a chrome extension which adds OSX-style two-finger multitouch gestures. Ever wondered to just flick away from a page rather than to press the backspace button or back button on the toolbar. Try this.

7. Settle Up and expense manager(or dollar bird) are pretty good apps to keep track of your expenditure and accounts.

8. SimplyNoise - Listen to brown noise while working.

9. Smooth Key Scroll  is a chrome extension which enables smooth and responsive scrolling with the keyboard, on every page you go.

10. A list of educational websites, which can aid you in being more productive

Why procrastinate will be helpful

Take 10 minutes to Learn why you procrastinate will be helpful

I was a very bad Procrastinator for a very long time, until i really understood the basics of why i procrastinate. 

In order to understand why you procrastinate, first you should have a strong desire to eliminate procrastination in your life and following the methods mentioned below will be helpful.

I. Track down your everyday activity

     When i first started writing down the list of activities that i do everyday, it felt like a waste of time. But later while analyzing the one month data i clearly understood why i don't have enough time to do the necessary activities and it narrowed down to the bad habits that i had created over time.


I was spending most of my time in Facebook and was affected by the "Chain-clicking curse" where watching a video from Facebook will lead to YouTube in-turn to Twitter to see the trend and it goes on and on into loads of unnecessary browsing wasting your precious time

II.Understanding why we procrastinate

We procrastinate because of the habits that we create over time. When we work some random thought strikes our mind, it might be as simple as,
 
where to go for the next vacation?

and I go to online to check details of it.
it doesn't stop there, then to Facebook to see where my friends went?
and something else catches up my eyes and the clicks goes endlessly 

III. How we create Habits

I have been following this routine every day which let me do overtime to complete my work and had no time for the essential things in life. All of these made sense to me when i read the Power of habit by Charles Duhigg.

understanding the basic of habit was big help to me. I starts with acue/Signal in my case it was the random thought and my routine was tosearch about it and reward that i get is leaving a stressful work for that moment/satisfaction by answering my random thought which sucks my time endlessly leaving only a very short period of time to do the necessary.

Now the trick it to replace the bad routine with a good routine which will lead to greater productivity in life, which could be understood by looking at how runners reward themselves

Here the cue is the Running shoe and it lets you to the routine of running which was created over time, running leads to the reward which is sense of accomplishment on completing a run also satisfying the Endorphin craving that you get by looking at the running shoe

IV. How I cured myself by changing my routine

1. Keeping myself distraction free

a. Turn off internet: Most of my work doesn't need internet so turned 
     off my WiFi whenever i work.

b. Note pad: Whenever some random thoughts strike rather than 
    searching it online i started recording them down in a small notepad and 
    researched about them later

c. Setting Time limits: Started setting a duration to complete my work      
    which helped me to focus more on my work, Even had set time on 
    socializing with my colleagues spending not more than 5 minutes on 
    unnecessary talks.

2. Sustaining the habits

a. Tracking your activities: Its quite tough for me to write every activity       
    now and then, so i spent half an hour every day before sleeping to write 
    down the activities of the whole day splitting into hourly activities and 
    do a quick analysis on where to improve next day. It looks something     
    like this,

    9:00 - 10:00 : Forecast Meeting
    10:00 - 11:00 : Project#1 - Prepared the procedure
 
b. Prioritizing activities for tomorrow: This summary helps me in 
    prioritizing the activities that i should be concentrating more tomorrow 
    and I write down top 3 things that should be completed tomorrow

c. Monthly and Quarterly Review: then i started analyzing my monthly 
    and quarterly data's to continuously improve my productivity

The methods mentioned above worked perfectly for me and I started finding more time to do the necessary things in life. Hope it will be useful for you as well, Let me know if it was helpful :)