Monday, August 12, 2019

Express



What is Express?
Express is a minimal and flexible Node.js web application framework that provides a robust set of features to develop web and mobile applications. It facilitates the rapid development of Node based Web applications.

Features of Express framework
  • Allows to set up middlewares to respond to HTTP Requests.
  • Defines a routing table which is used to perform different actions based on HTTP Method and URL.
  • Allows to dynamically render HTML Pages based on passing arguments to templates.
Installing Express >   npm install express --save

You should install the following important modules along with express
  • body-parser − This is a node.js middleware for handling JSON, Raw, Text and URL encoded form data.
  • cookie-parser − Parse Cookie header and populate req.cookies with an object keyed by the cookie names.
  • multer − This is a node.js middleware for handling multipart/form-data.
npm install body-parser –save
npm install cookie-parser –save
npm install multer --save


Heroku


What is Heroku?
Heroku is a container-based cloud Platform as a Service (PaaS). Developers use Heroku to deploy, manage, and scale modern apps. Our platform is elegant, flexible, and easy to use, offering developers the simplest path to getting their apps to market.

Heroku is fully managed, giving developers the freedom to focus on their core product without the distraction of maintaining servers, hardware, or infrastructure. The Heroku experience provides services, tools, workflows, and polyglot support—all designed to enhance developer productivity.

Install Heroku

  • sudo add-apt-repository "deb https://cli-assets.heroku.com/branches/stable/apt ./"
  • curl -L https://cli-assets.heroku.com/apt/release.key | sudo apt-key add -
  • sudo apt-get update
  • sudo apt-get install heroku
Check installation success by typing -> heroku --version

Deploy your application to Heroku
  • git init
  • git add .
  • git commit -m "first commit"
  • git status
  • heroku login
  • heroku create Name
  • git push heroku master
  • heroku open

Sunday, August 4, 2019

AJAX

AJAX Introduction

  • Update a web page without reloading the page
  • Request data from a server - after the page has loaded
  • Receive data from a server - after the page has loaded
  • Send data to a server - in the background

What Is AJAX?

AJAX = Asynchronous JavaScript And XML.
AJAX is not a programming language.
AJAX just uses a combination of:
  • A browser built-in XMLHttpRequest object (to request data from a web server)
  • JavaScript and HTML DOM (to display or use the data)
AJAX is a misleading name. AJAX applications might use XML to transport data, but it is equally common to transport data as plain text or JSON text.

How AJAX Works




Simple Future Tense

Simple Future Tense is used to express an action that will occur or happen in the future. It is used to describe an action which will happen in near or far future after being said about it by the speaker.

Structure of Sentence
Main verb: Base or 1st form of the verb 
Auxiliary verbs: "will"

Positive of Sentences:
  • Subject + Auxiliary verb + Main verb + Object
  • Subject + Will + Base or 1st form of verb + Object
Examples:
  1. He will come here tomorrow.
  2. She will buy a laptop at the end of this month.
  3. I will meet him in his office tomorrow.
  4. They will send us a mail.
  5. I will give him a nice gift.
Negative Sentences:
  • Subject + Auxiliary verb + NOT + Main verb + Object
  • Subject + Will + NOT + Base or 1st form of verb + Object
Examples:
  1. He will not buy a car.
  2. She will not come to college.
  3. They will not play Cricket.
  4. I will not go to university tomorrow.
  5. You will not need any help.
Interrogative Sentences:
  • Auxiliary verb + Subject + Main verb + Object
  • Will + Subject + Base form of verb + Object
Examples:
  1. Will they send him an invitation card?
  2. Will she marry him?
  3. Will they buy a new chair?
  4. Will you help me?
  5. Will you come here?


Past Perfect Tense

Past Perfect Tense is used to express two types of action which occurred or completed in the past. It is usually used to express an action which occurred a long time ago in past. It gives a sense of completion of an activity in past.

E.g: She had sent me her picture a year ago.

It may also be used to state an action that occurred in the recent past, but if it is intended to convey a sense of completion of the action with reference to other activities taken place after the same action.

E.g: The patient had died before the doctor came.

Structure of the Sentence :

 Main verb: Past Participle (3rd form of the verb) E.g:  gone, written
Auxiliary verbs: Had

Positive Sentences:

  • Subject + Auxiliary verb + Main verb + Object
  • Subject + Had + Past Participle (3rd form of the verb) + Object
Examples: 
  1. She had undergone heart surgery in her childhood.
  2. I had lost my camera.
  3. They had shifted to a new home.
  4. You had gone before I reached.
  5. The patient had died before the doctor came.
Negative Sentences:

  • Subject + Auxiliary verb + NOT + Main verb + Object
  • Subject + Had + Not + Past Participle (3rd form of the verb) + Object
Examples:
  1. He had not informed me about his illness.
  2. She had not applied for some job.
  3. I had not visited him.
  4. You had not helped him when he needed your help.
  5. We had not finished our work when he came here. 
Interrogative Sentences:

  • Auxiliary verb + Subject + Main verb + Object
  • Had + Subject + Past Participle + Object
Examples:
  1. Had you completed your task?
  2. Had he prepared himself for the exam?
  3. Had she prepared some food for the kids?
  4. Had I thought about my future?
  5. Has he appeared in the exam?

Saturday, August 3, 2019

Past Perfect Continous Tense

Past Perfect Progressive tense is used to describe an ongoing action that started in past and continued for some time in past. It expresses the continued nature of an action that started and stopped at some point in the past. The sentence includes a 'time-reference' to show that when the action started in past or for how long the action was continued in past.

For time-reference of the action, two specific words 'since' and 'for' are used in the sentence. The word 'since' is used if the exact starting time of the action is known or intended to be shown in the sentence. The word 'for' is used to express the amount of time for which the action was continued.

Structure of the Sentence:
Main verb: Present Participle (base form verb+ing)
Auxiliary verbs: Had Been

Positive Sentences:

  • Subject + Auxiliary verb + Main verb + Object + Time-reference
  • Subject + Had been + Present Participle (base form of verb + ing) + Object + Time_reference
Examples:
  1. She had been watching the movie for two hours.
  2. They were playing football since 10 O'clock.
  3. He had been working for a Newspaper for five years.
  4. I had been applying for jobs since December 2-12.
  5. She had been waiting for you since Wednesday.
Negative Sentences:
  • Subject + Auxiliary verb + Main verb + Object + Time-reference
  • Subject + Had not been + Present Participle + Object + Time_reference


    Examples:
    1. They had not been doing their work since 2003.
    2. He had not been drinking milk for five months.
    3. She had not been trying to get a job since 2002.
    4. I had not been listening to music since Thursday.
    5. He had not been playing chess since 3 O'clock?
    Interrogative Sentences:
    • Had + Subject + Been + Present Participle + Object + Time-reference
    Examples:
    1. Had the kid been watching cartoon for eight days?
    2. Had the baby been crying for one hour?
    3. Had she been singing songs since 8 O'clock?
    4. Had he been working in a hospital since 2001?
    5. Had they been playing football for five hours?

    Simple Past Tense

    Simple Past Tense expresses an action that occurred in past. It expresses the following type past-actions:
    • An action occurred just a little while ago
    Examples : 
    1. I ate an apple.
    2. He caught a bird in the bushes.
    3. I met a friend in the market.
    • An action which occurred on a regular basis in past
    Examples :
    1. She worked in a factory.
    2. The people paid less taxes in past.
    3. The Ancients believed in superstitions.
    Structure of the Sentence:
    Main Verb: Past simple Form (2nd form of the verb)
    Note. 2nd form of the verb is only used in a positive sentence. In negative and question sentence, 1st form of the verb is used as the main verb.
    Auxiliary verb: Did

    Positive sentence:
    • Subject + Main verb + Object
    • Subject + Past simple form (or 2nd form of verb) + object
    Examples:
    1. I bought a laptop.
    2. He applied for a job.
    3. I ate my meal.
    4. They played the game properly.
    5. You qualified for the exam.
    Negative Sentences:
    • Subject + Auxiliary verb + NOT + Main verb + Object
    • Subject + Did + Not + Base form (1st form of verb) + Object
    Examples:
    1. She did not qualify her exam.
    2. He did not find any job.
    3. They did not buy a car.
    4. You did not eat the food.
    5. Kids did not like the movie.
    Interrogative Sentences:
    • Auxiliary verb + Subject + Main verb + Object
    • Did + Subject + Base form (1st form of a verb) + Object
    Examples:
    1. Did you watch that movie?
    2. Did she laugh?
    3. Did I call you?
    4. Did they shift to their new home?
    5. Did he bring his document?

    Express

    What is Express? Express is a minimal and flexible Node.js web application framework that provides a robust set of features to develo...