TechyCage Technology Releated Articles

Sunday, 7 August 2016

video

Pokémon Go is Nintendo's first foray into augmented reality apps for Apple and Android devices, and it has already proved to be incredibly popular, with Pokémon players around the world downloading the app and hunting for pocket monsters.

Although most of the world can't wait to catch Pokémon on their smartphones, Pokémon Go is now officially out for those in the US, UK, Canada, Germany, Australia and New Zealand and Japan, although some other countries around the world are still having to wait. Thankfully new regions are officially getting Pokémon Go at a consistent rate.
Niantic, Inc, the company that developed Pokémon Go, have released a number of updates for the game, though a recent update, 0.31.0, has been controversial due to removing the footsteps tracker and other handy elements of the game. Some users also report that their progress has been reset.
If you're encountering any problems while playing, head over to our how to fix Pokemon Go problems guide, which should help you get Pokémon Go up and running.
Once you've downloaded Pokémon Go, make sure you check out our guide to the best Pokémon Go tips and tricks to help you catch all the best Pokémon! This guide to downloading Pokémon Go includes a new link to the latest version of the game - so you can safely download it without worrying.
Pokémon Go is proving to be hugely popular, so if you're unable to connect to the server, check out the Pokémon Go Server Status page to make sure the server is online. If it's not, that may be why you cannot connect to Pokémon Go.

Wednesday, 2 March 2016

DROP USER STATEMENT

This SQL Server tutorial explains how to use the SQL Server DROP USER statement with syntax and examples.

DESCRIPTION

The DROP USER statement is used to remove a user from the SQL Server database.

SYNTAX

The syntax for the DROP USER statement in SQL Server (Transact-SQL) is:
DROP USER user_name;

Parameters or Arguments

user_name
The name of the user to remove from the SQL Server database.

NOTE

  • Before you can drop a user, you must delete objects owned by the user or transfer ownership of those objects..

EXAMPLE

Let's look at how to drop a user using the DROP USER statement in SQL Server.

COMMENTS WITHIN SQL

This SQL Server tutorial explains how to use comments within your SQL statements in SQL Server (Transact-SQL) with syntax and examples.

DESCRIPTION

Did you know that you can place comments within your SQL statements in SQL Server (Transact-SQL)? These comments can appear on a single line or span across multiple lines. Let's look at how to do this.

SYNTAX

There are two syntaxes that you can use to create a comment within your SQL statement in SQL Server (Transact-SQL).

Syntax Using -- symbol

The syntax for creating a SQL comment using the -- symbol in SQL Server (Transact-SQL) is:
-- comment goes here
In SQL Server, a comment started with -- symbol must be at the end of a line in your SQL statement with a line break after it. This method of commenting can only span a single line within your SQL and must be at the end of the line.

Syntax Using /* and */ symbols

The syntax for creating a SQL comment using /* and */ symbols in SQL Server (Transact-SQL) is:
/* comment goes here */
In SQL Server, a comment that starts with /* symbol and ends with */ and can be anywhere in your SQL statement. This method of commenting can span several lines within your SQL.

EXAMPLE - COMMENT ON A SINGLE LINE

You can create a SQL comment on a single line in your SQL statement in SQL Server (Transact-SQL).
Let's look at a SQL comment example that shows a SQL comment on its own line:
SELECT employee_id, last_name
/* Author: TechOnTheNet.com */
FROM employees;
Here is a SQL comment that appears in the middle of the line:
SELECT  /* Author: TechOnTheNet.com */  employee_id, last_name
FROM employees;
Here is a SQL comment that appears at the end of the line:
SELECT employee_id, last_name  /* Author: TechOnTheNet.com */
FROM employees;
or
SELECT employee_id, last_name  -- Author: TechOnTheNet.com
FROM employees;

EXAMPLE - COMMENT ON MULTIPLE LINES

In SQL Server (Transact-SQL), you can create a SQL comment that spans multiple lines in your SQL statement. For example:
SELECT employee_id, last_name
/*
 * Author: TechOnTheNet.com
 * Purpose: To show a comment that spans multiple lines in your SQL statement.
 */
FROM employees;
This SQL comment spans across multiple lines in SQL Server - in this example, it spans across 4 lines.
In SQL Server, you can also create a SQL comment that spans multiple lines using this syntax:
SELECT employee_id, last_name /* Author: TechOnTheNet.com
Purpose: To show a comment that spans multiple lines in your SQL statement. */
FROM employees;

Tuesday, 23 February 2016

Magic Tables

 
Magic tables are nothing but the logical tables maintained by SQL server internally.
There are two types of Magic tables available in SQL server:
  • Inserted
  • Deleted
We can not see or access these tables directly, not even their data-type. The only method to have access to these tables is Triggers operation either After Trigger or Instead of trigger.
 
Inserting into Table (Inserted Table):
 
Whenever we do  insert anything in our base table in database, a table gets created automatically by the 
SQL server, named as INSERTED. In this table current updated or inserted record will be available. we can access this table of record via triggers.
 
Updating Table (Inserted & Deleted Table):
 
Whenever we do any deletion operation on our base table, in spite of one, two tables are created, one is INSERTED and another is called DELETED. Deleted table consist of the current record after the deletion operation and  Inserted table consists of the previous record. We can access it via Triggers functionality. 
 
Deleting (Deleted Table):
 
Whenever we do deletion in base table in database, a table gets created automatically by the SQL server, named as
DELETED table. This table consist of current updated record after deletion operation. Again we can have access to these records via triggers.

Saturday, 20 February 2016


C# Interview Questions

What are Abstract Classes?
The purpose of an abstract class is to define some common behavior that can be inherited by multiple subclasses, without implementing the entire class. In C#, the abstract keyword designates both an abstract class and a pure virtual method.
The purpose of an abstract class is to provide a common definition of a base class that multiple derived classes can share. For example, a class library may define an abstract class that is used as a parameter to many of its functions, and require programmers using that library to provide their own implementation of the class by creating a derived class.
Properties
  • An abstract class cannot be instantiated.


  • It can be inherited.
  • It can have method implementations, class members.
  • Only abstract classes can have abstract methods.

  • Syntax
    1
    2
    3
    4
    publicabstractclass
    publicabstractvoid DoWork(int i); 
    }
    What are Abstract methods?Give an example?
    Abstract Methods
    Abstract methods have no implementation, so the method definition is followed by a semicolon instead of a normal method block. (See above example for syntax)
    Derived classes of the abstract class must implement all abstract methods.
    When an abstract class inherits a virtual method from a base class, the abstract class can override the virtual method with an abstract method.
    Example
    1
    2
    3
    4
    5
    6
    7
    8
    // compile with: /target:library  
    publicclass
    {
    publicvirtualvoid DoWork(int i) 
      { 
    // Original implementation.
      }
     } 
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    publicabstractclass E : D 
    publicabstractoverridevoid DoWork(int i);
      
    publicclass F : E 
    publicoverridevoid DoWork(int i) 
     {
    // New implementation. 
      
     }
    }
    What are Interface? Explain with an example?
    An interface is useful when you want to be able to use some common functionality of otherwise unrelated classes- they share no implementation details, only the function signatures. In C#, function declarations within an interface are implicitly pure virtual.
    An interface contains only the signatures of methods, properties, events or indexers. A class or struct that implements the interface must implement the members of the interface that are specified in the interface definition. 
    Properties
    An interface can be a member of a namespace or a class and can contain signatures of methods, properties,events, indexers.
    An interface can inherit from one or more base interfaces.
    A class that implements an interface can explicitly implement members of that interface. An explicitly implemented member cannot be accessed through a class instance, but only through an instance of the interface.
    Example
    1
    2
    3
    4
    interface IControl 
     {
    void Paint();
      }
    1
    2
    3
    4
    interface ISurface 
     {
    void Paint(); 
      }
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    publicclass SampleClass : IControl, ISurface 
     {
    void IControl.Paint() 
     {
    System.Console.WriteLine("IControl.Paint");
      }
    void ISurface.Paint() 
     { 
    System.Console.WriteLine("ISurface.Paint"); 
      } 
       }
    Calling the methods
    1
    2
    3
    // Call the Paint methods from Main. 
    SampleClass obj = new SampleClass(); 
    //obj.Paint(); // Compiler error. 
    1
    2
    IControl c = (IControl)obj; c.Paint(); 
    // Calls IControl.Paint on SampleClass. 
    1
    2
    ISurface s = (ISurface)obj; s.Paint();
    // Calls ISurface.Paint on SampleClass.  
    Explain The Difference Between Abstract Class and Interface ?
    An Abstract class doesn’t provide full abstraction but an interface does provide full abstraction; i.e. both a declaration and a definition is given in an abstract class but not so in an interface.
    Using Abstract we cannot achieve multiple inheritance but using an Interface we can achieve multiple inheritance.
    We cannot declare a member field in an Interface.
    We cannot use any access modifier i.e. public , private , protected , internal etc. because within an interface by default everything is public.
    An Interface member cannot be defined using the keyword static, virtual, abstract or sealed.
    Explain Generic Collections & Array Lists ?
    Generics allow you to delay the specification of the data type of programming elements in a class or a method, until it is actually used in the program. In other words, generics allow you to write a class or method that can work with any data type.
    Generic Collections helps us to create flexible type-safe, strong type collections at compile time.
    Syntax
    1
    List<int> myInts = new List<int>();
    Namespace
    1
    System.Collections.Generic
    ArrayList
    They are ordered collection of objects, that can be resized automatically, that has dynamic memory allocation and which can contain different types of data.
    Arraylist stores its members as objects, so in order to retrieve it we must type cast it.
    Syntax and Example
    1
    2
    3
    ArrayList intlist = new ArrayList();
     intlist.Add(34);
     intlist.Add("sasi");
    Namespace
    1
    System.Collections;
    What are Finalize and Dispose ? Can you list down the differences between them?
    Finalizers are run by the Garbage Collection before an object that is eligible for collection is reclaimed. Dispose() is meant for cleaning up unmanaged resources, like network connections, files, handles to OS stuff, &c. It works best in conjunction with the using block where the compiler makes sure that Dispose() will be called immediately once you are done with an object – and also ensures that you cannot work with the object anymore once it’s disposed.
    Dispose() Method
    – This dispose method will be used to free unmanaged resources like files, database connection etc.
    – To clear unmanaged resources we need to write code manually to raise dispose() method.
    – This Dispose() method belongs to IDisposable interface.
    – If we need to implement this method for any custom classes we need to inherit the class from IDisposable interface.
    – It will not show any effect on performance of website and we can use this method whenever we want to free objects immediately.
    Finalize() Method
    – This method also free unmanaged resources like database connections, files etc…
    – It is automatically raised by garbage collection mechanism whenever the object goes out of scope.
    – This method belongs to object class.
    – We need to implement this method whenever we have unmanaged resources in our code and make sure these resources will be freed when
    garbage collection process done.
    – It will show effect on performance of website and it will not suitable to free objects immediately.
    What is Dependency Injection?How can we implement it?
    Simply put Dependency injection is for decoupling two components. It can be explained by a simple example.
    1
    2
    3
    4
    5
    6
    7
    public class ErrorLogger
        {
            public void WriteIntoDataBase(string message)
            {
                // Creates DataBase Entry.
            }
        }
    1
    2
    3
    4
    5
    6
    7
    8
    public class ApplicationWatcher
    {
        ErrorLogger logger = new ErrorLogger();
        public void Notify()
        {
            logger.WriteIntoDataBase("This is the message that I want to write.")
        }
    }
    Have a look at the code above.
    I have an ErrorLogger class that writes an error in to database. The method is actually called from another class ApplicationWatcher.
    In a later stage if I want to send an email instead of writing in to database, this design will not suffice. I will have create another class that has a method that sends email and create its instance in the ApplicationWatcher.
    Subscribe to RSS Feed Follow me on Twitter!