Sunday, August 31, 2014

Adding Facebok Login / Like / Logout button to Blogger / Website.

All the steps are same for adding facebook plugins like Like button / Login-Logout button , Comment Box etc. Only there is one step difference

Below are the steps with screenshot to embed the buttons on Blogger. 

Step 1 & Step 2:  Open your blog and log-in into it. Then you will see "Templates" menu in the left, Click on it and the step 2 is click on "Edit HTML" as shown in below screenshot:




Step 3:  Clicking on Edit HTML, We need to add namespace "xmlns:fb='http://ogp.me/ns/fb#'" as highlighted in below image. Once you add the namespace, Click on "Save Template" as highlighted.



Step 4: Once you save the template, click on "Layout" menu(3rd last) in the left menu list.
             This will open up a page as shown in below screenshot.
Click on "Add a Gadget" button wherever you wish to add facebook plugins. 


Clicking on "Add a Gadget" will open up a popup with multiple option of Gadgets as shown below:

from this popup, we have to select "HTML/Javascript" which is at 3rd last position in above screenshot.
This will further open up a popup as shown below, where we need to add below code snippet:

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=694894273921188&version=v2.0";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>


<div class="fb-like"   data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>



The above code is for "Like" button only, if you want to add Login/Logout or comment plugin, you only need to change the highlighted div from above step only.

<div class="fb-like"   data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>

You can get other plugins code from https://developers.facebook.com/docs/plugins
Step 5:
After saving this, popup will be closed. Then click on "Save Agreement" as shown in below figure.



Step 6: Yipeee!!! you are done, this will show you Facebook like button.



Friday, August 29, 2014

Create facebook app for your website in 10 simple steps!

Hi,

Facebook has changed the way we create apps for our website so i am writing this for those people who are having issues, problems in created new app and publish them on their website.

Step1- Login : You must be having a facebook account, so that you can log in into https://developers.facebook.com/ if you are not having facebook account you can sign up on their website.


Step 2: From the header of Facebook developer home page, Click on "Apps", you will see below screenshot. Out of which, you need to select "Create a New App" if you are creating new app for four website.

If you want to add test application, the select the appropriate application from the list of applications.


Step 3: Once you click on "Create a New App", you will see below popup where you have to enter three     things :
   a) Display Name : Your application or website name. 
b) Namespace: To maintain the uniqueness around the world and this should be in lower letters and no special character or number.
c) Select "NO" in third option because we are creating a new application
d) Choose the category where our website related to like Education, Entertainment and Sports etc as shown in the next image.






Step 4: Once you click "Create App" from popup then you will get Capcha confirmation which will verify if you are human :P



Step 5: Clicking on Submit will create an app for you and show you the Dashboard, This dashboard will show the App ID and App Secret which will be useful when you embed facebook plugin to your website.

In this step, there is an important thing to remember that you first need to create platform, then only you can enter App Domains and save all the information. So first click on the "+ Add new platform" and show you the next image screenshot.


Step 6: Click on "+Add new platform" will open popup like this. As we are creating website app, so i am going to select website from the below popup

Step 7
Here you can enter your website URLs, and remember one thing here is URL should be like :
http://gouravkhanna.blogspot.in not like "http://www.gouravkhanna.blogspot.in"

And remember to add Contact Email Address.


 Step 8: Till the last step, This app was not live or public. So to make it live or public so that we can use this in our application, we should on the highlighted area. Once you click on it, It goes LIVE.




Step 9: It will show LIVE as green signal as shown in below screenshot.





Step 10 : Yipee !!!

Finally you are done with creating your first facebook app. you can use app ID to embed the plugins on your website.

If any question, Do comment in the below box.


Thursday, August 28, 2014

Write a program to print pyramid using star(*) using c#

Hi Coders,

When i was in my college days, i have faced this situation multiple time that we have to write a program to print * half pyramid. So i am explaining code here.

Hope this will help you out:

Output:













The code snippet for this output is :

































The Source code is : You need to open new project -> Console application -> Name it.

In that project there will be a program.cs file where you can replace the code and see the output

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int i, j, rows;
            Console.Write("Enter the number of rows: ");
            rows = Convert.ToInt32(Console.ReadLine());
            for (i = 1; i <= rows; ++i)
            {
                for (j = 1; j <= i; ++j)
                {
                    Console.Write("* ");
                }
                Console.Write("\n");
            }
            Console.ReadLine();
        }
    }
}

Happy Coding :)

Wednesday, August 27, 2014

Software Engiineer - Interview Process at HCL Technologies

Hi Job Seekers,

HCL Technologies is a great company to work and for those who are looking for Onsite Jobs.

The complete interview process can take a day, couple of days or a month also, that all depends on the project requirement.

Total number of rounds depends on the years of experience and type of interview, IF

Walk-in : 4 Rounds,
Scheduled : 3 Rounds

Here are the rounds and sample question for software engineer applying for .net position.

1) Written Test
2) Technical Discussion
3) Managerial Discussion
4) HR Round

Sample question related to all rounds :

1) Written Test : This will include objective questions and are related to c/c++/.net/MVC/XML/Javascript
   a) What is .net framework?
   b) Difference between string and stringbuilder
   c) Difference between abstract and interface
   d) XML stands for
   e) Difference between JavaScript and j query
   f) What is constuctor and couple of question was on constuctor
   g) How to kill user session explicitly?
   h) Range validator control handles which datatypes?
   i) What is MVC stands for?
   j) What is $ in jquey?

2) Technical Discussion : Once you cleared with first round, There will be a technical discussion with one experience technical person. Question are mainly depends on the project requirement like if they are using MVC or .net or sql server, then according to that question will come to you. I am just sharing with you my personal experience.

This is the link which you must know before entering the door of interview : http://stackoverflow.com/questions/365489/questions-every-good-net-developer-should-be-able-to-answer?answertab=active#tab-top

I am giving you one more reference for .net interview related ebooks. You can download and study and can clear any .net interview.

http://gouravkhanna.blogspot.in/2012/03/important-for-net-developers.html

3) Managerial Discussion : Once you cleared the technical discussion, there will be one Managerial round, that will be taken by project manager and he/she is the guy who will be handling the complete project.

4) HR Round: Finally you are done with all technical stuff. Its the time for negotiation and salary hikes. you can ask them maximum of 50% salary hikes as they are not good pay masters but they are good at employment around the world and on stability..

Yippee!!! you are done..


All the best!!!



Tuesday, August 26, 2014

Software Engineer/Sr. Software Engineer Interview Process at Cvent:

Software Engineer/ Sr. Software Engineer Interview Process at Cvent:

The complete process will take 1 week time in interviewing a candidate and Cvent is having a good interview process for selecting a candidate.

Ratio of selecting a candidate is 18:1. Means out of 18 candidate,1 will be selected so think if you got selected, you are best candidate for that position.

And if you are not selected, Don't be Sad. There are lots of other good companies for you.

The rounds in interview will be:

1) Machine Test : This test will be around 45 min and contains two programming question and out of which you need to implement only one using any language c,c++,c# and Java in 45 mins.
Questions : a) Implementation of stack
   b) Implementation of Queue
           c) Implementation of And/Or Operator using two numbers


2) Technical Rounds : If you will clear first round then that will be followed by multiple technical round, because they are having 360 degree recruitment process so 3-4 technical rounds with different different technical persons will happen after machine test.
Question are mainly related to technologies on what you are applying for like if you are interviewing for .net position then question will be related to .net/JavaScript and jQuery only + every round will contain some coding questions like :
a) First largest number from given array
b) 2nd biggest number from array
c) array operation logic like sorting
d) print * in multiple rows.

3) Onsite Technical Round: After these 5 round, There will be one onsite technical managerial round. That round will also contain aptitude question and some logical puzzles.


4) HR Round : After you clear all Technical round, HR round will happen. Cvent is good paymaster as per the industry standards. So here you will get good hike and Environment is also cool here and as per my view this is a good company to work with.

All the Best :)

Monday, August 25, 2014

Set the value of one Textbox, Whenever the other textbox value changes using Jquery

Hi Everyone,

I am writing this article to help those who are very new to jquery,

Requirement is : Need to update one input box on changing the text in other text box.

Solution:  I am assuming that you know the basic of html and javascript.


Here is the text version of the code. you just have to copy the code and paste this text in notepad file and save that file as html.
------------------------Beginning of Code------------------------------------------------
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#FirstInput").on('keyup', function () {
                $("#SecondInput").val($(this).val())
            });
        });
    </script>
    <title></title>
</head>
<body>

    <div>
    First InputBox <input type="text" id="FirstInput" value="" /> <br />
    Second InputBox <input type="text" id="SecondInput" value="" /> <br />
    </div>

</body>
</html>
------------------------------End Of Code-----------------------------------------------

After running this code, the output will be :







As you can see if i enter "G" in First InputBox the value will automatically be reflect in 2nd InputBox.
The Jquery Code which is doing all this is :

 $("#FirstInput").on('keyup', function () {
                $("#SecondInput").val($(this).val())
            });

$ is inbuild keyword to access elements using jquery and every function that need to be registered on element are to be enclosed in ready method of jquey as provided in code.

Happy Coding :)