Monday 17 October 2016

Disable mouse right click on web page

<html>
   <head>
   </head>
   <body oncontextmenu="return false" >
   </body>
</html>

http://www.w3schools.com/jsref/event_oncontextmenu.asp





rowString = rowString.Replace('"', ' ').Trim();


http://stackoverflow.com/questions/12740486/want-to-remove-the-double-quotes-from-the-strings



Sunday 16 October 2016

Interesting English

1. Which is the longest word in English?

Pneumonoultramicroscopicsilicovolcanoconiosis

The word contains forty five letters and this is one of the lung disease name caused by silica dust which is delivered from volcano.
----------
2. Food Time

Breakfast -- Breaking the fast.
Brunch -- Between breakfast and lunch (Breakfast+Lunch) Which means late morning or early afternoon
Lunch -- Afternoon food that is middle of the day
Supper -- Night food.
Dinner -- Main meal of the day. Not only refer the night food
Happy Eating!!
---------- 
3. Wishes
How do you do -- It's a normal way of greeting and the reply is same How do you do
Good Bye -- God be with you
----------
4. Welfare inquiry

British English
Q: How are you?
A1: I am fine, Thanks. How about you?
A2: Very well, Thank you. How about you?
A3: I am great and you
A4: I am OK/All right/Superb
A5: So..so -- not to bad (எதோ போகுது)

American English
Q1: How are you doing?
Q2: What's up man?
Q3: How is everything?
Q4: How is going?
A1: I am doing good and you?
A2: Can't complaint
A3: Nothing to grumble (புலம்புதலுக்கு ஒன்றுமில்லை)
Note: Positive answer and sad reply
----------
 5. Rhetorical Questions

The questions which is not expect the answers
Examples
1. Why should I help you? (நான் ஏன் உனக்கு உதவ வேண்டும்)
2. Are you crazy? ( நீ  என்ன பைத்தியக்காரனா)
3. Don't you have sense? (உனக்கு அறிவு இல்லையா)
----------
6. Informal verbs

Gonna -- Going to
Wanna -- Want to
Gotta -- Got to
----------

7. Pangram
      A sentence which have each alphabetic word at least one time.
Example:
A quick brown fox jumps over the lazy dog
Jackdaws love my big sphinx of quartz

----------



Tuesday 11 October 2016

Get a timestamp in JavaScript?

new Date().getTime();
Math.floor(Date.now() / 1000)


http://stackoverflow.com/questions/221294/how-do-you-get-a-timestamp-in-javascript

Monday 10 October 2016

Tricky IAS interview questions answer

Q1. Can you tell 3 consecutive days without Monday, Wednesday and Friday?

Ans1: Yesterday, Today and Tomorrow



Sunday 2 October 2016

How to remove the profile picture from google accounts

Go to Setting --> General --> My Picture --> Change Picture --> No Picture --> Apply Changes


How to remove the profile picture from Google+

Go to Profile--> About --> Click your Profile photo --> Select No Photo



Tuesday 6 September 2016

Obtaining canonical URL using JavaScript

<!DOCTYPE html>
<html>
    <head>
        <link href="http://www.example.com/" rel="canonical" />
        <title>Canonical</title>
        <script type="text/javascript">
            window.onload = function () {
                var canonical = "";
                var links = document.getElementsByTagName("link");
                for (var i = 0; i < links.length; i ++) {
                    if (links[i].getAttribute("rel") === "canonical") {
                        canonical = links[i].getAttribute("href")
                    }
                }
                alert(canonical);
            };
        </script>
    </head>
    <body>
        <h1>Canonical</h1>
    </body>
</html>



Monday 5 September 2016

C# Reading and writing to console

Reading from the console => Console.ReadLine
Writing to the console => Console.WriteLine
       Two ways to write a console
            1. Concatenation
            2. Place holder which is most preferred


Example with Concatenation

using System;

class Program
{
    static void Main()
    {
        Console.WriteLine("Enter First Name");
        string FirstName = Console.ReadLine();
        Console.WriteLine("Enter Last Name");        
        string LastName = Console.ReadLine();
        Console.WriteLine("Hello "+FirstName +LastName);
        Console.ReadLine();
    }

}

Output:
Enter First Name
Balamurugan
Enter Last Name
Ganesan
Hello BalamuruganGanesan



Example with Place holder

using System;

class Program
{
    static void Main()
    {
        Console.WriteLine("Enter First Name");
        string FirstName = Console.ReadLine();
        Console.WriteLine("Enter Last Name");        
        string LastName = Console.ReadLine();
        Console.WriteLine("Hello {0} {1}", FirstName, LastName);
        Console.ReadLine();
    }

}

Output







Note1:
C# is a case sensitive

Note2:
Difference between Write and WriteLine

Write() method => Output values to the screen without newline character
WriteLine() method => Output will start on a new line



Run comments

How to get the run comment?
Press windows+r

Some useful Run comments 
Microsoft Paint- mspaint
Notepad- notepad
Calculator- calc
Microsoft Word- winword



Attach Event vs add Event Listener

Attach Event is only works on Opera and Internet Explore
AddEvent Listener is works on Firefox, Google chrome and Safari (and Opera and Internet Explore from version 9)



Definitions

DOM- Document Object Model is a standard for how to get, change, add and delete the HTML elements






Abbreviations

DOM- Document Object Model
HTML- Hyper Text Markup Language
CSS- Cascading Style Sheets
JS- JavaScript
IIS- Internet Information Services
POC - Proof Of Concept
RSS - Rich Site Summary


Sunday 4 September 2016

Windows 8 tricks

Increase the font size in windows 8         Fn (+) +
Decrease the font size in windows 8        Fn (+) -
Open Run command widow                    Windows (+) R



How to change the background in Windows 8

Method1

Go to Start
Search Change desktop background
Select Background desktop
Browse your picture location from your local disk
If you select more than 1 pictures than, give time for change the picture
Choose your picture position
Click Save Changes


Method II

Go to Control Panel
Select Appearance and Personalization
Select Personalization
Select Background desktop
Browse your picture location from your local disk
If you select more than 1 pictures than, give time for change the pictue
Choose your picture position
Click Save Changes





Saturday 3 September 2016

Techmix

Troubleshoot Google Publisher Tags

Now most of the websites are using DFP (Doubleclick for Publisher) ad. When we open the website the DFP ad will has been render.

How to check the DFP ad render properly or not
Open your website
Add the below tag at end of your website name:
?google_force_console (or) ?google_force_console=1

Keyboard shortcut: CTRL+F10

For Example: http://csharp-sql-tutorials.in?google_force_console
                       http://csharp-sql-tutorials.in?google_force_console=1





How to reset and start IIS with iis command

Internet Information Services (IIS) is a web server.

Why?
When the connection of db server is going high, then our application that is website not responding properly. For immediate action we are go for iis reset which is the server is off and the existing connections are closed. After getting the value '0', then restart the server, the new connection will be accepted.

Procedure:
Go to Start
Type Command Prompt
Right click and select Run as administration


iisreset/stop
iis attempt to stop all services








iisreset/start
iis start all services










iisreset/restart
iis stop all services and automatically start all services.




Monday 29 August 2016

Part1 C# Introduction

How to create a project?
Open Visual studio => File => New => Project


Select visual C# in Installed Template
Select Console application
Give your project name in Name TextBox
Browse Location  for where it store this project


Sample Program

using System;   //Namespace declaration

class Program
{
    static void Main()  //Main method, The entry point of the project
    {
        //Write in console
        Console.WriteLine("Welcome to my C# blog");
        Console.ReadLine();
    }
}
Output: Welcome to my C# blog


What is Namespace?
     Namespace is collection of classes, interfaces, enums, structs and delegates.
     Namespace is used to organize your code.
For Example,
using System is tells that use of code present inside.

Note:
If we not using System then just type System.Console, but more times we are using System so we declare namespace at top


What is Main method?
     Main method is a entry point into your application

Sample Program

using System;

class Program
{
    static void MainTwo()
    {
        Console.WriteLine("Welcome to my .net blog");
    }

    static void Main()
    {
        Console.WriteLine("Welcome to my C# blog");
        MainTwo();
        Console.ReadLine();
    }
}

Output: 
Welcome to my C# blog
Welcome to my .net blog



Google added two popular games

Google is the one of the best search engine and recently it had added two popular games which are
solitaire and tic-tac-toe.

How to play this game??
* Open your google browser and type on "solitaire" without quotes in search bar. Solitaire has two difficulty of games level.


* Open your google browser and type on "tic-tac-toe" without quotes in search bar. You can select the level of difficulties and even go head to head against a friend.



Enjoy!!



Sunday 28 August 2016

Google gravity

Open your browser and type "google gravity" without quotes in search bar.
Open the webpage "http://mrdoob.com/projects/chromeexperiments/google-gravity/" and just move on your mouse.




Saturday 27 August 2016

Visual Studio shortcut keys

Format document                                        CTRL+K,D
Comment                                                     CTRL+K,C
UnComment                                                CTRL+K,U
Show Intellisense                                         CTRL+Space
Toggle Full screen                                       ALT+Shift+Enter
Build project                                                Shift+F6
Build Solution                                              CTRL+Shift+B/F6
Attach the debugger to a process                 CTRL+ALT+P
Expand or collapse current element            CTRL+M,M
Collapse all                                                  CTRL+M,O
toggle all outlining                                       CTRL+M,L
Convert selected text to UPPERCASE        CTRL+Shift+U
Convert selected text to LOWERCASE      CTRL+U



Google sphere in browser

Open your browser and type "google sphere" without quotes in search bar.
Click the webpage "http://mrdoob.com/projects/chromeexperiments/google-sphere/" and move the mouse pointer, Now the browser is rotating like sphere or circle.







Wednesday 24 August 2016

Visual Studio Tricks

Visual Studio- Remove unused namespaces

Step 1: Right click anywhere in Program
Step2 : Hover the Organize Usings
              1. Remove unused Using => It's removed unused namespaces
              2. Sort Using => It's sorted namespaces by alphabetical
              3. Remove and Sort => It's removed unused namespaces and sorted by alphabetical.


Keyboard Shortcut key: SHIFT+F10+O+R

Note 1: Will performance be an issue, if there are unused Using?
                  No, there won't be any impact on the application performance.

Benefits of removing unused namespaces
* Clear code, which in turn makes in easy to read and maintain
* Intellisense runs faster
* Faster Compilation


Next Articles
Visual studio shortcut keys



Just Relax

Your name instead of Google in Google homepage

By default the google search is showed 'Google' logo and we try to change the name instead of google as below screenshot.

Balamurugan-in-my-way

How is possible?

Step 1- Type "Google in my way" in google search bar.
Step 2- The link should go to Google my way page
Step 3- Type your name(what you want) and click 'create' button.