Wednesday, January 23, 2019

node.js







Node.js is open source, completely free, and used by thousands of developers around the world. It is used to develop I/O intensive web applications like video streaming sites, single-page applications, and other web applications.
Node.js is a very powerful JavaScript-based framework/platform built on Google Chrome's JavaScript V8 Engine. It is used to develop I/O intensive web applications like video streaming sites, single-page applications, and other web applications. Node.js is open source, completely free, and used by thousands of developers around the world.Node.js is an open source, cross-platform runtime environment for developing server-side and networking applications. Node.js applications are written in JavaScript, and can be run within the Node.js runtime on OS X, Microsoft Windows, and Linux.
Node.js also provides a rich library of various JavaScript modules which simplifies the development of web applications using Node.js to a great extent.

Features of Node.js

 ➤Asynchronous and Event Driven
 ➤Very Fast
 ➤Single Threaded but Highly Scalable
 ➤No Buffering 
 
Where to Use Node.js?

Following are the areas where Node.js is proving itself as a perfect technology partner.

    ➤I/O bound Applications
    ➤Data Streaming Applications
    ➤Data Intensive Real-time Applications (DIRT)
    ➤JSON APIs based Applications
    ➤Single Page Applications



Node JS code have the following three important keyword..


➤Import required modules − We use the require directive to load Node.js modules.

➤Creating server − A server which will listen to client's requests

➤Read request and return response − The server created in an earlier step will read the HTTP request made by the client which can be a browser or a console and return the response.



Node Package Manager

➤Node Package Manager (NPM) provides two main functionalities −

  • 1.Online repositories for node.js packages/modules which are searchable on search.nodejs.org
  • 2.Command line utility to install Node.js packages, do version management and dependency management of Node.js packages.

REPL

                                 REPL Environment



REPL stands for Read Eval Print Loop and it represents a computer environment like a Windows console or Unix/Linux shell where a command is entered and the system responds with an output in an interactive mode. Node.js or Node comes bundled with a REPL environment. It performs the following tasks −
  • Read − Reads user's input, parses the input into JavaScript data-structure, and stores in memory.
  • Eval − Takes and evaluates the data structure.
  • Print − Prints the result.
  • Loop − Loops the above command until the user presses ctrl-c twice.
The REPL feature of Node is very useful in experimenting with Node.js codes and to debug JavaScript codes.

Sunday, January 20, 2019

mongo DB


Sudo mongod
sudo mongo
use ………--create data base
show --dbs display all data base
db --what the current database
db.drop.Database() --delete database
db.createCollection(“collectionname”) --create collection
db.student.drop() --delete collection
db.student.insert({“name”:”RM”})
db.student.find() --show data collection


Wednesday, January 9, 2019

sass

Sass

SASS (Syntactically Awesome Stylesheet) is a CSS pre-processor, which helps to reduce repetition with CSS. It is more stable and powerful CSS extension language that describes the style of document structurally.

Features of Sass

  • It is more stable, powerful, and compatible with versions of CSS.
  • It is a super set of CSS and is based on JavaScript.
  • It is known as syntactic sugar for CSS, which means it makes easier way for user to read or express the things more clearly.
  • It uses its own syntax and compiles to readable CSS.
  • You can easily write CSS in less code within less time.
  • It is an open source pre-processor, which is interpreted into CSS.

Advantages of Sass

  • It allows writing clean CSS in a programming construct.
  • It helps in writing CSS quickly.
  • It is a superset of CSS, which helps designers and developers work more efficiently and quickly.
  • As Sass is compatible with all versions of CSS, we can use any available CSS libraries.
  • It is possible to use nested syntax and useful functions such as color manipulation, mathematics and other values.

Converting Syntax:

# Convert Sass to SCSS
$ sass-convert style.sass style.scss

# Convert SCSS to Sass
$ sass-convert style.scss style.sass

Store data in Sass

One feature of Sass that's different than CSS is it uses variables. They are declared and set to store data, similar to JavaScript.
In JavaScript, variables are defined using the letand constkeywords. In Sass, variables start with a $followed by the variable name.
Example:
$main-fonts: Arial, sans-serif; $headings-color: green; //To use variables: h1 {   font-family: $main-fonts;   color: $headings-color; }

Nest CSS with Sass

Sass allows nesting of CSS rules, which is a useful way of organizing a style sheet.
nav {
  background-color: red; } nav ul {   list-style: none; } nav ul li {   display: inline-block; }

Responsive Design


Responsive Design  
Responsive web design makes your web page look good on all divices, it means it adjust the webpages for the sizes. Mobile phone has different size, destop has different size like that.It only uses HTML and CSS.


Viewport

The viewport is the user's visible area of a web page.
<meta name="viewport" content="width=device-width, initial-scale=1.0">

We use rm and rem instead of pixels. rm means relative measurement, in the name also we konw that it adjust the size. While we rm measurement it auto adjust the size of webpage.

We have some key words like min-width, min-height,max-height,max-width and somemore. When we use min-width or min-height, we give a minimun size to the webside and other than this it cannot to be resize.

Em
Incorporating relative sizing starts by using units other than pixels. One unit of measurement you can use in CSS to create relatively-sized content is the em, written as em in CSS.

.h1 { font-size: 50em; }


Rem
Rem stands for root em. It acts similar to em, but instead of checking parent elements to size font, it checks the root element. The root element is the <html> tag. 
 

h1 { font-size: 2rem; } 

Media Queries


CSS uses media queries to adapt a website's content to different screen sizes. With media queries, CSS can detect the size of the current screen and apply different CSS styles depending on the width of the screen.

1. @media
2. only screen
3.and (max-width : 480px and min-height: 200px) 

Tuesday, January 8, 2019

JSON


➤JSON: JavaScript Object Notation.
➤It is a syntax for storing and exchanging data.
➤JSON is text, written with JavaScript object notation al with in inverted commas.
➤JSON is "self-describing" and easy to understand. It is language independent.It format is text only.
➤Easily be sent to and from a server.Used as a data format by any programming language.
➤There  are two ways to represent data
         ➣Stringyfy: It converts the Javascript data into string form.
                       var myObj = { "name:" "John", "age:" 31, "city:" "New York" };
      
         ➣Phase: It converts stringy form to normal javascript format.
                      'var myObj = { "name:" "John", "age:" 31, "city:" "New York" };'

If you receive data in JSON format, you can convert it into a JavaScript object:
var myJSON = '{"name":"John", "age":31, "city":"New York"}';
var myObj = JSON.parse(myJSON);

document.getElementById("demo").innerHTML = myObj.name;


When storing data, the data has to be a certain format, and regardless of where you choose to store it, text is always one of the legal formats. JSON makes it possible to store JavaScript objects as text. var myObj, myJSON, text, obj; 
// Storing data: myObj = { name: "John", age: …

Tuesday, January 1, 2019

jQuery




➤jQuery is a JavaScript Library.
➤jQuery greatly simplifies JavaScript programming.
➤It is saved as .js
➤$ symbol is its identifier.
➤The following codes explain some jQuery effects like

  • Hide
  • show
  • slideup
  • fadein
  • fadeout
  • toggle
➤The jQuery library is a single JavaScript file, and you reference it with the html tag. The script should br inside the <head> section.


<script>
<head>
<script src="jquery-3.2.1.min.js"></script>
</head>

➤Some examples for the jQuery functions:
$(this).hide() - hide the current element.
"$("p").hide() - hide the all <p> elements.
➤The jQuery function started with :
$(document).ready(function){
});

React React  is a JavaScript library for building user interfaces created by Facebook. It is maintained by Facebook and a community of...