My Life and the world

World changes day by day!

Saturday, June 16, 2012

How to Create Password Generator with JavaScript

No comments
Tutorial : Javascript
Level : Beginners
Time : 15 minutes

We will create a function that will generate password and alert the password.
function PasswordGenerator()

Declare two variable  password and symbols. We will store the password which going to be generated in the  'password' and in 'symbols' we have different symbols that will strengthen the password which we get generated. You can add more symbols into it.

var password=''";
var symbols="!@#$%&*?";

Now we have the password get generated like below :-

for(i=0;i<3;i++) 
{
password += String.fromCharCode("A".charCodeAt(0) + myRandom(26));
// characters from big caps letters
password += String.fromCharCode("a".charCodeAt(0) + myRandom(26));
// characters from small caps letters
password += String.fromCharCode("0".charCodeAt(0) + myRandom(10));
// characters from numerals
password += symbols.charAt(myRandom(symbols.length));
// characters from symbols
}
//12 characters password

We concatenate the passwords with '+', String is used to get the strings. Next,  we use the fromCharCode()  method, which converts Unicode values into characters. The charAt() method returns the character at the specified index in a string. The function 'myRandom' randomises, here we used 26 for the alphabets, 10 the 0-9 numerals, for  symbols, we use the length property to get the numbers of symbols use while initialization.

 Since the password we have is simple, might not be good so we will shuffle it, all the characters so we have strengthen the password. To give more and more strength we shuffles it 3-5 time.

password = shuffleString(password);
password = shuffleString(password);
password = shuffleString(password); //shuffled the password 3 time to provide strength
alert(password); //alert the password


Time to write the code for 'shuffleString' function used above. 

function shuffleString(mystr)
{
var arr=mystr.split('');

for(i=0;i< mystr.length;i++)
{
var r1= i;
var r2= myRandom (mystr.length);

var tmp = arr[r1];
arr[r1] = arr[r2];
arr[r2] = tmp;
}

return arrPwd.join("");
}


The split() method is used to split a string into an array of substrings. Here we have used the  empty string ("") which act as the separator, the string is split between each characters. All the characters that got splitted stored in the array called 'arr'. We follow the simple logic to shuffles, first we store the iteration value in variable r1 and the random number of the string length in variable r2, then swap the arrays of those index.

function  myRandom (val) 
{
return (Math.floor(Math.random() * val));
}

Above 'myRandom' function is quite easily understood, we have used the math 'random' object method , which return number between 0 and 1, which got multiplied by the 'val', passes as argument. To get perfect integers, used math object method 'floor', that rounded downwards to the nearest integer.

That all, we finished the things, now put all of them together and have your password generator.
Download Code
Thanks for reading this JavaScript tutorial, Put your comment to let me know how you worked out on it.

Monday, June 11, 2012

Some Best Cricket Jokes

2 comments


Ashish Nehra And Tharki Nirmal Baba


Ashish Nehra: Baba meri IPL meinbahut Dhulai hoti hai.
Nirmal baba: Match fix karte ho?
Nehra: karta hu baba.
Baba: batsman ko Daat dikhate ho.
Nehra: Ji baba 32 ke 32 dikhata hu.
(Baba tensd, & thnking)
Baba: Gali dete ho?
Nehra: ji baba, Kohli se achi achi gali sikh li.
(baba getng angry)
Baba: Helmet pehen te ho?
Nehra: Nahi baba..........
.
.
.
Baba: BASS. yahi pe kripa rukh rahi hai, Bike ka helmet pehen ke bowling karo Kripa aani shuru hojayegi......



INDIAN Player in Opponents's Party after loss



After winning the match England player were enjoying the party.

Suddenly Bell saw one from team INDIA. He calls "Hey who are you?"
Dhoni removed his cover say "forgot i bring you ha... i also have contribution"
Bell "ok come on yaar enjoy"
Dhoni opening door "oye! pantar log aajao tumne bhi to inki jeet me yogdan diya hai"
.......
............
...............
All INDIAN players came and enjoyed the party and English were amazed



Why Harbhajan Slapped Sreesanth?


Our Harbhanjan Singh was enjoying Match.
Yuvraj Singh came and asked him, "Are you relaxing?"
Bhajji answered, "No I am Harbhajan Singh."


VRV Singh Came and asked the same Question.
He answered, "No! No!, Me Harbhajan Singh."
Third one came and asked the same question, Bhajji was totally annoyed and decided to shift his place.
While walking he saw Sreesanth enjoying the Match. He went and asked him "Are you Relaxing?"
The Sreesanth answered "Yes I am relaxing."
Bhajji slapped him on his face and said "Are sab tere Ko wahan dhoond rahe hai aur tu Yahaan Aaram Kar raha hai."


Dhoni VS Luck



Cricketers mindset: "DO Vs DIE" ..
Ganguly: Do or die.
Sehwag: Do before you die.
Dravid: DO until they die.
Tendulkar: do that will never die...
Laxman: Do when everyone else die.
Yuvraj: Do, die, reborn, do, die, reborn (repeat)....
Dhoni: Do everything before luck die.


Friday, June 8, 2012

Check if your LinkedIn password compromised

No comments
Russian hacker have hacked around 6.5 millions of password from Professional Social site, LinkedIn. The password were posted online without username. LinkedIn confirmed that some password have been hacked, they told they will inform user to change their password.

Your Password hacked?

There may be chances that your password may be among those 6,458,020 password of LinkedIn. To check if your password got breached out, you should check it out. LastPass, a password manger had launch a tool to allow user to insure their LinkedIn password were compromised or not?

Go to the tool page of LastPass, specially for made to check LinkedIn password, put your password and got to know the truth of your password. 



As you see there is SHA-1 hash tag which is used to encrypt the password are also shown. The password saved in any database are not in their original form, they are first encrypted normally SHA algorithm is used, then they store in the hash tag formed after encryption. Different companies uses different  algorithm  to create the hash tag. Make sure you don't reveals the Hash tag to anyone, after you check it. Also change your password immediately, not on the LinkedIn only but other site if you used the same password.


How to change password on LinkedIn?

  • Go to LinkedIn, After sign-in, mouse over to your name at right corner, then click on the 'settings'.
  • On Setting, choose Account tab - select 'Change password'
  • A popup will appear, put your old password and give new password, submit to reset your password.
Update : 


You can also check the Passwords via the new site called LeakedIn, it provides similar tools like the LastPass, where you enter the password to determine if the password breached. To try this out go to here.


Thursday, June 7, 2012

Publicize WordPress Posts on Tumblr

1 comment
WordPress is great platform for the bloggers to publish beautiful contents. Earlier WordPress had  introduced Publicize, the feature that allow the connection of the blog with social media sites like of Facebook, Twitter, LinkedIn for instant share on them. Now WordPress announced  the instant sharing of the posts to Tumblr by making connection with the WordPress blog, like the other social platform.


As Tumblr has many millions of visitors with billions of posts, this will help WordPress blogger to give more exposure to their blog, reaching another larger set of audience.

Connect the blog with Tumblr account by going sharing on setting page of your blog. Click 'connect to Tumblr', they will ask to give authorization as show below-


Grant access to WordPress by clicking on the 'Allow' on Tumblr, where you got redirected for Authorization connection. After the authorization you will be back to WordPress setting, where you will ask to select the blog (i you have more than one on Tumblr) to which you want to post the automatically, you can select only one. The setting can be changes later by revoking access, with disconnect and even blog of Tumblr can be changed with 'set options'available under Tumblr connection. 

Tuesday, June 5, 2012

Download Satyamev Jayate app for Android and iOS

No comments
Aamir Khan's Satyamev Jayate is in full wave for which has postponed his upcoming movie Talash which was shudeled to release, but Mr. Perfestionist works for onen didn't let it possible. Aamir Khan slected Satyamev Jayate, his first Televison Appearance to socialized people of INDIA over some of the common issues that society is flooded with. The show is going great and people are liking it much. This attatcked Hungama Digital Media Entertainment Pvt. Ltd. They developed the App for iOS and Android.


This App will allow users to get latest videos to watch and hear the songs on stream, which can be shared to friends on Facebook and Twitter. This app will also provides the twitter updates of official Satyamev Jayate. With broadcast of new episodes the app will updates the songs and the videos. The app have different languages options for the user to choose. 

Get the App for the iOS from here from the iTune store.
Get the App for Android from here from Google Play.

Try the App and put your comments how you like it below, your though over the show as well as new suggestion you can post, give your idea. Also don't forgot to tell your experience with the app.

Buy Gifts on Occasion of Father's Day

1 comment
Father's day is one of the auspicious day to celebrate, which is didicated to all the father of the world. This is mainly celebrates in the US and western countries but slowly is dripping in Asia and other parts also. INDIA too not keeping out of this celebrating moments.
Shop Amazon - Father's Day Gifts

What you want to gift your Father this Father's Day? occasion

Well there are alot of options available for you from the Amazon's Store - one of the best on-line retailer of the world. Choose varieties of Products from them, includes the tool boxes to gift cards, wrist watches to cameras,  buy clothings, shirting, suiting for him and show how much you love him. You can buy musicals stuffs as well as some great songs from the music store to dedicate him on the special day!



You can buy stylish mobile phones and accessories from wide range of manufacturers including Apple Samsung, HTC, Motorola, Nokia, LG, Sony etc with choosing either of iPhone or Android or Window phones. Opt for the various service plans from AT&T or Verizon or T-mobiles etc.

Choose best product from the store and suggest for more additional good products to get included in it.




Monday, June 4, 2012

Sachin became Rajya Sabha MP

No comments
Sachin Tendulkar sworn in as Rajya Sabha MP, as he takes oath in in the chamber of the Rajya Sabha chairman. Sachin was nominated by the government as Rajya Sabha MP on April 27 along with the other. He was named as one of the 12 presidential nominees for Rajya Sabha membership, who were selected having some special knowledge or practical experience in the filed of literature, science, art and social service.

"Cricket comes first", Sachin said after he take oath as Rajya Sabha member to the reporters. He told that he is selected as MP because cricket- "I am here because of my cricketing career. I cannot take any focus away from my cricket. That is where it all started for me. I will focus on my cricket and as and when I stop playing cricket, I don't know, when I will start attending to other things".

Sachin had said that is main focus will be on the cricket of which was nominated as MP, he also added that he will not only promote cricket but other sports as well. Sachin was not able to oath as MP as he was busy in IPL during the budget session.