Thursday 13 April 2017

The Periodic Table Of SEO Success Factors


Visual studio shortcuts to improve your productivity

There are some useful shortcuts to improve your productivity while writing a code.

1) Format scattered and unaligned code

     CTRL + K + D


2) Comment code

     CTRL + K + C


3) Uncomment code

     CTRL + K + U

Tuesday 11 April 2017

Standard Naming Convention for ASP.NET and C#

For any programming language standard naming system is very import. It makes a complex system easy for others.Use these in your own projects and/or adjust these to your own needs.

There are different types of naming casing style. First let’s understand different types of casing styles.

Camel Case (camelCase): First letter of the word is lower case and then each first letter of the part of the word is upper case. Example: numberOfDays

Pascal Case (PascalCase): First letter of the word is upper case and then each first letter of the part of the word is upper case. Example: DataTable

Underscode Prefix (_underscore): The word begins with underscore singe and for the rest of the word use camelCase rule. Example: _strFirstName

Hungarian Notation: First letter of the word is about its data type and rest of the word is camelCase. Example: iStudentNumber (i=integer)


Uppercase: All letters of the word are uppercase. Example: ID, PI

How to write log file in c#?

Below is the function to create text log file in C#

public static void WriteLog(string strLog)
    {
        StreamWriter log;
        FileStream fileStream = null;
        DirectoryInfo logDirInfo = null;
        FileInfo logFileInfo;

        string logFilePath = "C:\\Logs\\";
        logFilePath = logFilePath + "Log-" + System.DateTime.Today.ToString("MM-dd-yyyy") + "." + "txt";          
        logFileInfo = new FileInfo(logFilePath);
        logDirInfo = new DirectoryInfo(logFileInfo.DirectoryName);
        if (!logDirInfo.Exists) logDirInfo.Create();
        if (!logFileInfo.Exists)
        {
            fileStream = logFileInfo.Create();
        }
        else
        {
            fileStream = new FileStream(logFilePath, FileMode.Append);
        }
        log = new StreamWriter(fileStream);
        log.WriteLine(strLog);
        log.Close();
    }  

Wednesday 5 April 2017

What is load balancing??

Load Balancing Structure


Load Balancing


Load balancing refers to efficiently distributing incoming network traffic across a group of back-end servers, also known as a server farm or server pool.

Saturday 1 April 2017

Cookie Helper Class in C#


In this article I will show you Cookie Helper Class in C#.


public static class CookieHelper
    {
        //Set new cookie...
        public static bool Set(string CkName, string CkValue, int CkExpirationMins, 
            string ckDomain, bool ckIsSecure)
        {
            bool flag = false;
            try
            {
                HttpCookie newCookie = new HttpCookie(CkName);
                newCookie.HttpOnly = true;
                newCookie.Value = CkValue;
                newCookie.Expires = DateTime.Now.AddMinutes(CkExpirationMins);
                if (!string.IsNullOrEmpty(ckDomain)) newCookie.Domain = ckDomain;
                if (ckIsSecure) newCookie.Secure = ckIsSecure;
 
                HttpContext.Current.Response.Cookies.Add(newCookie);
                flag = true;
            }
            catch (Exception)
            {
                flag = false;
            }
            return flag;
        }
 
        //Read cookie value...
        public static string Get(string CkName)
        {
            string strReturn = "";
            if (!string.IsNullOrEmpty(CkName))
            {
                try
                {
                    HttpCookie currentCookie = (HttpCookie)HttpContext.Current.Request.Cookies[CkName];
                    if (currentCookie != null) strReturn = currentCookie.Value;
                }
                catch (Exception) { }
            }
            return strReturn;
        }
 
    }

Sunday 26 March 2017

How Search Engines Work Using a 3 Step Process


All Search engines work using a 3 phase approach to managing , ranking and returning search results.

Crawling

Imagine the World Wide Web as a network of stops in a big city subway system.
Each stop is a unique document (usually a web page, but sometimes a PDF, JPG, or other file). The search engines need a way to “crawl” the entire city and find all the stops along the way, so they use the best path available—links.

Friday 24 March 2017

How to Validate Email Id Using Javascript

In this article we see how to validate email id using regex in javascript.

HTML Code:-

form name="frmSample" method="post" action="#" onSubmit="return ValidateForm()">
<p>Enter an Email Address :
 <input type="text" name="txtEmail">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>

Tuesday 7 March 2017

Interview Questions on Inheritance

What is inheritance?

The method of constructing one class from another is called Inheritance.The derived class inherits all the properties and methods from the base class and it can add its own methods also.

Friday 3 March 2017

Object Oriented Programming Concept


Object Oriented programming is a programming style that is associated with the concept of Class, Objects and various other concepts revovling around these two, like Inheritance, Polymorphism, Abstraction, Encapsulation etc.

Thursday 2 March 2017

SEO Interview Questions


1) What is SEO and introduce its types?
Search Engine Optimization or SEO is a process of keep changing the position of web page or website in a search engine results by using keywords or phrases.

Friday 24 February 2017

Most useful books on CSS


Some useful learing books on CSS

CSS crop string in the middle


This article helps you to crop long string in middle using css ellipsis.

Most useful excel functions and examples

Excel functions can greatly enhance your ability to perform tasks in day to day activities in Excel.
There are many ways to use Excel formulas to decrease the amount of time you spend in Excel and increase the accuracy of your data and your reports. Whether you are an office worker, or a small business owner using Excel to keep track of your finances or just the casual user, this functions will help you to enhance your ability.

Excel Shortcut Keys

This article describes what Key Tips are and how you can use them to access the ribbon. It also lists Ctrl combination shortcut keys, function keys, and some other common shortcut keys for Microsoft Excel 2013.

Keyboard access to the ribbon

If you’re new to the ribbon, the information in this section can help you understand the ribbon’s keyboard shortcut model. The ribbon comes with new shortcuts, called Key Tips. To make the Key Tips appear, press Alt.
To display a tab on the ribbon, press the key for the tab—for example, press the letter N for the Insert tab or M for the Formulas tab. This makes all the Key Tip badges for that tab’s buttons appear. Then, press the key for the button you want.

Sunday 19 February 2017

Oracle NULL functions

Oracle have 5 NULL-related functions:

   1. NVL
   2. NVL2
   3. COALESCE
   4. NULLIF
   5. LNNVL

Folder locker using .bat file

Lock your personal data in password protected folder.


Here I am sharing you trick to lock folder without using any software.

Thursday 16 February 2017

SQL interview questions and answers


JavaScript: Displaying number in indian format

Here is the solution for displaying number in comma seprated format in your page using javascript.

JavaScript: Regular expression to validate URL


Please find below JavaScript code to validate URL using regex expression.

function ValidURL(url) {
 var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;        return regexp.test(url);
}

C# : String Helper Class


Please find StringHelper class for working on string related functionalities

Javascript:Set cookie and get cookie


This post helps you to create , read and delete cookie in javacript.

Wednesday 15 February 2017

Javascript: Function to get current fiscal year


Function to get current financial year from current date in javascript.

Play video with HTML5


Adding video to your page is easy as adding image. No extra plugins required, you can do it with single element