Monday, May 18, 2020

Add columns to all tables in a database


Add columns to all tables in a database 


SELECT 'ALTER TABLE ' + QUOTENAME(ss.name) + '.' + QUOTENAME(st.name) + ' ADD [DateTime_Table] DATETIME NULL;'
FROM sys.tables st
INNER JOIN sys.schemas ss on st.[schema_id] = ss.[schema_id]
WHERE st.is_ms_shipped = 0
AND NOT EXISTS (
    SELECT 1
    FROM sys.columns sc
    WHERE sc.[object_id] = st.[object_id]
    AND sc.name = 'DateTime_Table'
);

Tuesday, April 28, 2020

Ques

Write a Program Swap two number using 3rd Variable.
                                                     &
 Write a Program Swap two number  with out using 3rd Variable 
                                                     &
 Write a Program Swap two number  with out using 3rd Variable & + ,-
   &
 Write a Program Swap two number  with out using 3rd Variable & + ,-,*,/



Comment & mail
Prakashmishra.niit@gmail.com
                                                   




AngularJS Class 2

AngularJS Extends HTML

AngularJS extends HTML with ng-directives.
The ng-app directive defines an AngularJS application.
The ng-model directive binds the value of HTML controls (input, select, textarea) to application data.
The ng-bind directive binds application data to the HTML view.

There are many integrated development environments you can use for AngularJS development, some of the popular ones are mentioned below. In our example, we are using Webstorm as our IDE.
  1. Webstorm
  2. Sublime Text
  3. AngularJS Eclipse
  4. Visual Studio

AngularJS First Example

1.First  Create a Html page 

<html>  
<head>  
.  
.  
</head>  
<body>  
.  
.  
</body>  
</html>  

2. Second, you need to include the AngularJS JavaScript file in the HTML page so we can use AngularJS:

<html>  
<head>  

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js">
</script>
</head>  
<body>  
.  
.  
</body>  
</html>  


3. Third Create Controller 
<html lang="en">  
<head>  
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script>  
</head>  
<body>
  
<script>  
angular.module("myapp", [])  
    .controller("HelloController", function($scope) {  
        $scope.helloTo = {};  
        $scope.helloTo.title = "World, AngularJS";  
    } );  
</script>  
</body>  

4. then Create View 

<html lang="en">  
<head>  
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script>  
</head>  
<body ng-app="myapp">  
<div ng-controller="HelloController" >  
<h2>Hello {{helloTo.title}} !</h2>  
</div>  
  
<script>  
angular.module("myapp", [])  
    .controller("HelloController", function($scope) {  
        $scope.helloTo = {};  
        $scope.helloTo.title = "World, AngularJS";  
    } );  
</script>  
</body>  


Controller Part


<script>  
angular.module("myapp", [])  
    .controller("HelloController", function($scope) {  
        $scope.helloTo = {};  
        $scope.helloTo.title = "World, AngularJS";  
    });  
</script>  
</html>  


View Part

<div ng-controller="HelloController" >  
<h2>Hello {{helloTo.title}} !</h2>  
</div>


AngularJS Class 1

What is AngularJS

Angular JS is an open source JavaScript framework that is used to build web applications. It can be freely used, changed and shared by anyone.
Angular Js is developed by Google.
It is an excellent framework for building single phase applications and line of business applications.
This framework is used for developing mostly Single Page applications.
It can be added to an HTML page with a <script> tag.

AngularJS Features

  1. Dependency Injection
  2. Data Model Binding
  3. Model View Controller
  4. Writing less code
  5. Testing
Note:- Unit Testing ready – The designers at Google not only developed Angular but also developed a testing framework called "Karma" which helps in designing unit tests for AngularJS applications.


AngularJS Architecture

MVC stands for Model View Controller. It is a software design pattern for developing web applications. It is very popular because it isolates the application logic from the user interface layer and supports separation of concerns.


  • The Controller represents the layer that has the business logic. User events trigger the functions which are stored inside your controller. The user events are part of the controller.
  • Views are used to represent the presentation layer which is provided to the end users
  • Models are used to represent your data. The data in your model can be as simple as just having primitive declarations. For example, if you are maintaining a student application, your data model could just have a student id and a name. Or it can also be complex by having a structured data model. If you are maintaining a car ownership application, you can have structures to define the vehicle itself in terms of its engine capacity, seating capacity, etc.
  • Routing – Angular can take care of routing which means moving from one view to another. This is the key fundamental of single page applications; wherein you can move to different functionalities in your web application based on user interaction but still stay on the same page.
  • Two-way binding – Angular.js keeps the data and presentation layer in sync. Now you don't need to write additional JavaScript code to keep the data in your HTML code and your data later in sync. Angular.js will automatically do this for you. You just need to specify which control is bound to which part of your model.
Hii , Prakash Mishra here
Please like & Follow



https://www.youtube.com/channel/UC92k5U7ALw7cSmIB9pglGKA

Saturday, October 12, 2019

Career Planning Tips

Building a Career

Today, and more than ever, most people are responsible for building their own careers.
Whether you are just starting, or you have several years of experience, these paragraphs might help you advance your career.
The 9 most important career planning tips is listed below:

1. Never Stop Learning

Life-long learning is your keyword.
The world is constantly changing, and everybody is looking for new ways of doing business.
If you have decided that your current skills are good enough, you have also decided that your current job is good enough.
But if you want a career in the future, you should add regular updates to your skills and knowledge.

2. Ask, Listen And Learn

A good listener can learn a lot.
Listen to your co-workers, your boss, and your superiors. You can learn a lot from their experience.
Ask about issues that interest you, and listen to what they say. Let them tell you about how things work, and what you could have done better.
Most people will love to be your free tutor.

3. Fulfill Your Current Job

Your current job might be best place to start your career.
It is often very little that separates successful people from the average. But nothing comes free.
If you do your job well and fulfill your responsibilities, this is often the best way to start a new career.
Talk to your supervisor about things you can do. Suggest improvements. Offer your help when help is needed. In return ask for help to build a better career. It is often possible - right inside your own organization - especially if you have proved to be a valued employee.

4. Build Your Network

Your next career step might arise from your contact network.
Did you know that more than 50% of all jobs are obtained from contact networks?
If you have a good contact network, it is also a good place to discover future careers, explore new trends, and to learn about new opportunities.
Spend some time building new contacts, and don't forget to maintain the ones you already have.
One of the best ways to get serious information from your network is to regularly ask your contacts how they are, what they do, and what is new about their careers.

5. Identify Your Current Job

Your current job should be identified, not assumed.
Make sure you don't work with tasks you assume are important. This is waste of time and talent.
When you start in a new job, talk to your superior about your priorities. If you're not sure about what is most important, then ask him. And ask him again. Often you will be surprised about the differences between what you assume, and what is really important.

6. Identify Your Next Job

Your dream job must be identified.
Before you start planning your future career, be sure you have identified your dream job.
In your dream job, you will be doing all the things you enjoy, and none of the things you don't enjoy. What kind of job would that be?
Do you like or dislike having responsibility for other employees. Do you like to work with technology or with people? Do you want to run your own business? Do you want to be an artist, a designer or a skilled engineer? A manager?
Before building your future career your goal must be identified.

7. Prepare Yourself

Your dream might show up tomorrow. Be prepared.
Don't wait a second. Update your CV now, and continue to update it regularly.
Tomorrow your dream job may show up right before your nose. Prepare for it with a professional CV and be ready to describe yourself as a valuable object to anyone that will try to recruit you.
If you don't know how to write a CV, or how to describe yourself, start learning it now.

8. Pick The Right Tools

Pick the tools you can handle.
You can build your future career using a lot of different tools. Studying at W3Schools is easy. Taking a full master degree is more complicated.
You can add a lot to your career by studying books and tutorials (like the one you find at W3Schools). Doing short time courses with certification tests might add valuable weight to your CV. And don't forget: Your current job is often the most valuable source of building new skills.
Don't pick a tool that is too heavy for you to handle!  

9. Realize Your Dreams

Put your dreams into action.
Don't let a busy job kill your dreams. If you have higher goals, put them into action now.
If you have plans about taking more education, getting a better job, starting your own company or something else, you should not use your daily job as a "waiting station". Your daily job will get more and more busy, you will be caught up in the rat race, and you will burn up your energy.
If you have this energy, you should use it now, to realize your dreams.

Monday, September 30, 2019

Body Scroll Bar  
var scrollToBottom = function() {
  window.scrollTo(0, document.body.scrollHeight);
}
var delay = 2000;
var intervalID = setInterval(scroll, delay);
To stop scrolling, use the following code:
window.clearInterval(intervalID);

Thursday, July 4, 2019

AngularJs

What is Controller in AngularJs?

A Controllers in AngularJs takes the data from the View, processes the data, and then sends that data across to the view which is displayed to the end user. The Controller will have your core business logic.
The controller will use the data model, carry out the required processing and then pass the output to the view which in turn is displayed to the end user.

    What Controller does from Angular's perspective

    Following is a simple definition of working of Angular JS Controller.
    AngularJS Controller: Learn in 10 Minutes!
    • The controller's primary responsibility is to control the data which gets passed to the view. The scope and the view have two-way communication.
    • The properties of the view can call "functions" on the scope. Moreover events on the view can call "methods" on the scope. The below code snippet gives a simple example of a function.
      • The function($scope) which is defined when defining the controller and an internal function which is used to return the concatenation of the $scope.firstName and $scope.lastName.
      • In AngularJS when you define a function as a variable, it is known as a Method.
    AngularJS Controller: Learn in 10 Minutes!
    • Data in this way pass from the controller to the scope, and then the data passes back and forth from the scope to the view.
    • The scope is used to expose the model to the view. The model can be modified via methods defined in the scope which could be triggered via events from the view. We can define two way model binding from the scope to the model.
    • Controllers should not ideally be used for manipulating the DOM. This should be done by the directives which we will see later on.
    • Best practice is to have controller's based on functionality. For example, if you have a form for input and you need a controller for that, create a controller called "form controller".

    How to build a basic Controller

    Before we start with the creation of a controller, we need to first have our basic HTML page setup in place.
    The below code snippet is a simple HTML page which has a title of "Event Registration" and has references to important libraries such as Bootstrap, jquery and Angular.
    AngularJS Controller: Learn in 10 Minutes!
    1. We are adding references to the bootstrap CSS stylesheets, which will be used in conjunction with the bootstrap libraries.
    2. We are adding references to the angularjs libraries. So now whatever we do with angular.js going forward will be referenced from this library.
    3. We are adding references to the bootstrap library to make our web page more responsive for certain controls.
    4. We have added references to jquery libraries which will be used for DOM manipulation. This is required by Angular because some of the functionality in Angular is dependent on this library.
    By default the above code snippet will be present in all of our examples, so that we can show just the specific angularJS code in the subsequent sections.
    Secondly let's look at our files and file structure which we are going to start with for the duration of our course.
    AngularJS Controller: Learn in 10 Minutes!
    1. First we segregate our files into 2 folders as is done with any conventional web application. We have the "CSS" folder. It will contain all our cascading style sheet files, and then we will have our "lib" folder which will have all our JavaScript files.
    2. The bootstrap.css file is placed in the CSS folder and it used for adding a good look and feel for our website.
    3. The angular.js is our main file which was downloaded from the angularJS site and kept in our lib folder.
    4. The app.js file will contain our code for the controllers.
    5. The bootstrap.js file is used to supplement the bootstrap.cs file to add bootstrap functionality to our web application.
    6. The jquery file will be used to add DOM manipulation functionality to our site.
    Let see an example on how to use angular.js,
    What we want to do here is just to display the words "AngularJS" in both text format and in a text box when the page is viewed in the browser.
    AngularJS Controller: Learn in 10 Minutes!
    <!DOCTYPE html>
    <html>
    <head>
     <meta chrset="UTF 8">
     <link rel="stylesheet" href="css/bootstrap.css"/>
    </head>
    <body>
    <h1> </h1>
    <script src="https://code.angularjs.org/1.6.9/angular.js"></script>
    <script src="lib/angular.js"></script>
    <script src="lib/bootstrap.js"></script>
    <script src="lib/jquery-1.11.3.min.js"></script>
    
    <div ng-app="DemoApp" ng-controller="DemoController">
    
     Tutorial Name : <input type="text" ng-model="tutorialName"><br>
    
     This tutorial is {{tutorialName}}
    </div>
    <script>
     var app = angular.module('DemoApp',[]);
    
     app.controller('DemoController', function($scope){
     $scope.tutorialName = "Angular JS";
     });
    </script>
    
    </body>
    </html>
    Code Explanation:
    1. The ng-app keyword is used to denote that this application should be considered as an angular application. Anything that starts with the prefix 'ng' is known as a directive. "DemoApp" is the name given to our Angular.JS application.
    2. We have created a div tag and in this tag we have added an ng-controller directive along with the name of our Controller "DemoController". This basically makes our div tag the ability to access the contents of the Demo Controller. You need to mention the name of the controller under the directive to ensure that you are able to access the functionality defined within the controller.
    3. We are creating a model binding using the ng-model directive. What this does is that it binds the text box for Tutorial Name to be bound to the member variable "tutorialName".
    4. We are creating a member variable called "tutorialName" which will be used to display the information which the user types in the text box for Tutorial Name.
    5. We are creating a module which will attach to our DemoApp application. So this module now becomes part of our application.
    6. In the module, we define a function which assigns a default value of "AngularJS" to our tutorialName variable.

    How to define Methods in Controller

    Normally, one would want to define multiple methods in the controller to separate the business logic.
    For example, suppose if you wanted to have your controller do 2 basic things,
    1. Perform the addition of 2 numbers
    2. Perform the subtraction of 2 numbers
    You would then ideally create 2 methods inside of your controller, one to perform the addition and the other to perform the subtraction.
    One can define custom methods within an Angular.JS controller.
    The example below shows how this can be done.
    AngularJS Controller: Learn in 10 Minutes!
    <!DOCTYPE html>
    <html>
    <head>
     <meta chrset="UTF 8">
     <title>Event Registration</title>
     <link rel="stylesheet" href="css/bootstrap.css"/>
    </head>
    <body ng-app="DemoApp">
    <h1> Guru99 Global Event</h1>
    <script src="https://code.angularjs.org/1.6.9/angular.js"></script>
    <script src="lib/angular.js"></script>
    <script src="lib/bootstrap.js"></script>
    <script src="lib/jquery-1.11.3.min.js"></script>
    
    <div ng-app="DemoApp" ng-controller="DemoController">
     Tutorial Name :<input type="text" ng-model="tutorialName"><br>
     <br>
     This tutorial is {{tutorialName}} 
    </div>
    
    <script>
    var app = angular.module('DemoApp', []);
    app.controller('DemoController', function($scope) {
        $scope.tutorialName = "Angular JS";
     $scope.tName = function() {
            return $scope.tName;
        };
    });
    </script> 
    </body>
    </html>
    Code Explanation:
    1. Here, we are just defining a function which returns a string of "AngularJS". The function is attached to the scope object via a member variable called tutorialName.

jQuery Question Answer

1. What is jQuery?
jQuery is not a programming language but a well written JavaScript code. It is a JavaScript code, which do document traversing, event handling, Ajax interactions and Animations.
2. Why jQuery is needed?
jQuery is needed for the following list:
  • Used to develop browser compatible web applications
  • Improve the performance of an application
  • Very fast and extensible
  • UI related functions are written in minimal lines of codes
3. Whether jQuery HTML work for both HTML and XML documents?
No, jQuery HTML only works for HTML documents not for XML Documents.
4. What are the methods used to provide effects?
Some of the effects methods are:
  • Show()
  • Hide()
  • Toggle()
  • FadeIn() and
  • FadeOut()
5. What is the advantage of using minimized version of jQuery?
Efficiency of web page increases when minimized version of jQuery is used.min.js file will be more than 50% less than the normal js file. Reduction in the file size makes the web page faster.

Saturday, December 15, 2018

AngularJS Part2

The best way to see the power of an AngularJS Application is to create your first basic program "Hello World" app in Angular.JS.
There are many integrated development environments you can use for AngularJS development, some of the popular ones are mentioned below. In our example, we are using Webstorm as our IDE.
  1. Webstorm
  2. Sublime Text
  3. AngularJS Eclipse
  4. Visual Studio

Hello world, AngularJS

The example below shows the easiest way to create your first "Hello world" application in AngularJS.
AngularJS Hello World: Your First Program
<!DOCTYPE html>  
<html lang="en">  
<head>  
    <meta charset="utf 8">
    <title>Guru99</title>     
</head>  
<body ng-app="app">
<h1 ng-controller="HelloWorldCtrl">{{message}}</h1>
<script src="https://code.angularjs.org/1.6.9/angular.js"></script>
<script>  
    angular.module("app", []).controller("HelloWorldCtrl", function($scope) {  
    $scope.message="Hello World" 
    } )
</script> 

</body>  
</html>


Code Explanation:
  1. The "ng-app" keyword is used to denote that this application should be considered as an angular js application. Any name can be given to this application.
  2. The controller is what is used to hold the business logic. In the h1 tag, we want to access the controller, which will have the logic to display "HelloWorld", so we can say, in this tag we want to access the controller named "HelloWorldCtrl".
  3. We are using a member variable called "message" which is nothing but a placeholder to display the "Hello World" message.
  4. The "script tag" is used to reference the angular.js script which has all the necessary functionality for angular js. Without this reference, if we try to use any AngularJS functions, they will not work.
  5. "Controller" is the place where we are actually creating our business logic, which is our controller. The specifics of each keyword will be explained in the subsequent chapters. What is important to note that we are defining a controller method called 'HelloWorldCtrl' which is being referenced in Step2.
  6. We are creating a "function" which will be called when our code calls this controller. The $scope object is a special object in AngularJS which is a global object used within Angular.js. The $scope object is used to manage the data between the controller and the view.
  7. We are creating a member variable called "message", assigning it the value of "HelloWorld" and attaching the member variable to the scope object.
NOTE: The ng-controller directive is a keyword defined in AngularJS (step#2) and is used to define controllers in your application. Here in our application, we have used the ng-controller keyword to define a controller named 'HelloWorldCtrl'. The actual logic for the controller will be created in (step#5).
If the command is executed successfully, the following Output will be shown when you run your code in the browser.
Output:
The message 'Hello World' will be displayed.
AngularJS Hello World: Your First Program

AngularJS Part 1

What is AngularJS?

AngularJS is an open source Model-View-Controller framework which is similar to theJavaScript framework.
Angular JS is probably one of the most popular modern day web frameworks available today. This framework is used for developing mostly Single Page applications. This framework has been developed by a group of developers from Google itself.
Because of the sheer support of Google and ideas from a wide community forum, the framework is always kept up to date. Also, it always incorporates the latest development trends in the market.

AngularJS Features

Angular has the following key features which makes it one of the powerful frameworks in the market.
  1. MVC – The framework is built on the famous concept of MVC (Model-View-Controller). This is a design pattern used in all modern day web applications. This pattern is based on splitting the business logic layer, the data layer, and presentation layer into separate sections. The division into different sections is done so that each one could be managed more easily.
  2. Data Model Binding – You don't need to write special code to bind data to the HTML controls. This can be done by Angular by just adding a few snippets of code.
  3. Writing less code – When carrying out DOM manipulation a lot of JavaScript was required to be written to design any application. But with Angular, you will be amazed with the lesser amount of code you need to write for DOM manipulation.
4.    Unit Testing ready – The designers at Google not only developed Angular but also developed a testing framework called "Karma" which helps in designing unit tests for AngularJS applications.


AngularJS Architecture

Angular.js follows the MVC architecture, the diagram of the MVC framework as shown below.
AngularJS: Introduction, Architecture, Advantages
Angularjs Architecture Diagram
  • The Controller represents the layer that has the business logic. User events trigger the functions which are stored inside your controller. The user events are part of the controller.
  • Views are used to represent the presentation layer which is provided to the end users
  • Models are used to represent your data. The data in your model can be as simple as just having primitive declarations. For example, if you are maintaining a student application, your data model could just have a student id and a name. Or it can also be complex by having a structured data model. If you are maintaining a car ownership application, you can have structures to define the vehicle itself in terms of its engine capacity, seating capacity, etc.

AngularJS Advantages

  • Since it's an open source framework, you can expect the number of errors or issues to be minimal.
    • Two-way binding – Angular.js keeps the data and presentation layer in sync. Now you don't need to write additional JavaScript code to keep the data in your HTML code and your data later in sync. Angular.js will automatically do this for you. You just need to specify which control is bound to which part of your model.
    AngularJS: Introduction, Architecture, Advantages
    • Routing – Angular can take care of routing which means moving from one view to another. This is the key fundamental of single page applications; wherein you can move to different functionalities in your web application based on user interaction but still stay on the same page.
    • Angular supports testing, both Unit Testing, and Integration Testing.
    • It extends HTML by providing its own elements called directives. At a high level, directives are markers on a DOM element (such as an attribute, element name, and comment or CSS class) that tell AngularJS's HTML compiler to attach a specified behavior to that DOM element. These directives help in extending the functionality of existing HTML elements to give more power to your web application.