Monday, June 8, 2020

Introduction to HTML

HTML stands for Hypertext Markup Language, and it is the most widely used language to write Web Pages.

  • Hypertext refers to the way in which Web pages (HTML documents) are linked together. Thus, the link available on a webpage is called Hypertext.
  • As its name suggests, HTML is a Markup Language which means you use HTML to simply "mark-up" a text document with tags that tell a Web browser how to structure it to display.

Originally, HTML was developed with the intent of defining the structure of documents like headings, paragraphs, lists, and so forth to facilitate the sharing of scientific information between researchers.

Now, HTML is being widely used to format web pages with the help of different tags available in HTML language.

  • HTML is the language for publishing web pages on the WWW (World-Wide Web).
  • HTML is a Document Description Language (aka Document Markup Language). HTML is NOT a programming language like C/C++/C#/Java, which is used to implement programming algorithm.
  • You need a web browser to view the HTML pages. The web browsers do not display the HTML tags, but uses the tags to interpret the content of the web pages.
  • An HTML document is a text document, and it is human-readable.

HTML was originally developed by Tim Berners-Lee in 1990. He is also known as the father of the web. In 1996, the World Wide Web Consortium (W3C) became the authority to maintain the HTML specifications. HTML also became an international standard (ISO) in 2000. HTML5 is the latest version of HTML. HTML5 provides a faster and more robust approach to web development.

There have been many versions since the early days of the web as you can see.

HTML  (Launched in 1991)
HTML 2.0 (Launched in 1995)
HTML 3.2 (Launched in 1997)
HTML 4.01 (Launched in 1999)
XHTML (Launched in 2000)
HTML5 (Launched in 2014)
HTML 5.2 (Launched in 2017)

HTML 5.3 (Launched in 2020)

Applications of HTML

There are lot more things you can do with HTML.

  • You can publish documents online with text, images, lists, tables, etc.
  • You can access web resources such as images, videos or other HTML document via hyperlinks.
  • You can create forms to collect user inputs like name, e-mail address, comments, etc.
  • You can include images, videos, sound clips, flash movies, applications and other HTML documents directly inside an HTML document.
  • You can create offline version of your website that work without internet.
  • You can store data in the user's web browser and access later on.
  • You can find the current location of your website's visitor.

Advantages of HTML:

  • It is easy to learn and easy to use.
  • It is platform independent.
  • Images, video and audio can be added to a web page.
  • It is supported by all browsers.
  • It can be integrated with other languages like CSS, JavaScript etc.

Disadvantages:

  • HTML can create only static webpages so for dynamic web page other languages have to be used.
  • Large amount of code has to be written to create a simple web page.
  • Security feature is not good.

What is HTML5?

HTML5 is the fifth version of the HTML scripting language. It supports a lot of new things that older versions of HTML does not. For Example: In HTML5 there is something new called the Semantic Elements. Semantic elements have meaningful names which tell about the type of content. For example header, footer, table, … etc. HTML5 introduces many semantic elements which make the code easier to write and understand for the developer as well as instructs the browser on how to treat them.

Difference between HTML and HTML5 

HTML Editors

There are so many software packages available to develop HTML. The software packages can be grouped into two main categories:

  • Text-based (or code-based) Editors
  • WYSIWYG (what you see is what you get) Editors
  • Sandbox Environment 

Text-based (or code-based) Editors: To start creating web pages, you do not need an expensive software package but you do need some knowledge of HTML. You can create web pages with a basic text editor like Windows Notepad. However, as you master scripting HTML, you will learn that using Notepad or some other basic text editor is not sufficient. In Windows, Notepad can be started from the Start Menu:

Select: Programs | Accessories | Notepad

 

WYSIWYG Editors: Because WYSIWYG (pronounced wuzzywig or wizzywig) HTML editors do not require much HTML knowledge, they tend to be expensive or freeware. These editors allows you to directly work in the "design" or "preview" view instead of the code view. The main advantage of working with the design view is that you can design the layout of your page by dragging-and-dropping pieces of your page layout. Thus a web page can be developed more quickly than by hard-coding it by hand using a text-based editor.

There are several popular WYSIWYG editors available:

  • Adobe Dreamwever
  • Froala
  • Notepad++
  • Visual Studio Code
  • Brackets
  • Sublime Text 3
  • Atom

Downloads the HTML Editors Below:

Sandbox: It is an Online HTML Coding Environment. We will be writing our HTML code in a sandbox environment called CodePen. CodePen is a great learning tool (as well as a great place to tinker with small chunks of code on the job). We write HTML directly in the HTML section of CodePen and the elements that we create will render in real-time onscreen. This is much faster than having to save our file and reload it in the browser every time we make a change.

CodePen also allows us to leave out a couple of critical elements: the html, head, and body elements. These are important to understand when we start writing HTML code in our text editors, but for now, we can ignore them, because CodePen handles them automatically.




Web Development

Web programming, also known as web development, is the creation of dynamic web applications. Examples of web applications are social networking sites like Facebook or e-commerce sites like Amazon.


Web development is a specific field of software engineering that focuses on building web pages. Web pages, or web apps, are codebases that are downloaded and run in our web browser (e.g., Google Chrome) each time a user navigates to the website address. This differs from other software which is usually downloaded once and run as a standalone application on your computer or phone. Web development makes for an exciting career, as a web development cycle is usually much shorter and you get to iterate over your software at a much faster rate.

The major building blocks of the web are HTML, CSS, and JavaScript. We will be talking about all three languages. We can also think of web development as being split into two main categories: front end and back end. We will discuss what each entails. 

The Term Front-End

Everything you have ever seen on the web is considered ‘front end’. Front end is what we see when we open a web page or app. Code is downloaded from a server and is rendered to the screen by a web browser. What happens when we interact with the code is also considered front end. This is often referred to as the ‘Presentation Layer’ or ‘Client’ in software development terms.

The front end is built out of three languages: HTML, CSS, and JavaScript. HTML allows us to put content on our page: text, headers, images, buttons, links, and etc. CSS is used to style our page. It allows the contents to have different text colors, background colors, as well as dealing with the positioning of the content on the page. JavaScript makes our page dynamic. It allows for the content to change on a mouse hover or click and also lets us submit data and have data rendered on our page (such as submitting a new blog post or having your feed populated when you open Facebook). 

The Term Back-End

This term usually refers to what happens ‘behind the scenes’: servers, databases, etc. The back end is the place we don’t see as users. This consists of data storage (databases) and servers running to provide data for the front end. Back end can be a little harder to imagine, especially for someone without much experience with it. Back end is commonly referred to as the ‘data access layer’ or ‘server’ within software development terms. The back end computes the data and content sent to the front end to be used and displayed by your browser.

Back end server code can be written using JavaScript. However, it can be also written using many other languages, such as Ruby, Java, or Python. The database logic required in back end development often utilize a database language, such as SQL or MongoDB. 

The Term FullStack

It refers to the development of both front end (client side) and back end (server side) portions of web application. Full stack web developers have the ability to design complete web application and websites. They work on the frontend, backend, database and debugging of web application or websites. Full stack can apply to a web stack, mobile stack, or a native application stack (i.e. software programs for specific devices).

What skills require to become a full stack developer?

You’ll typically see a mix of front and back end skills listed on full stack web developer job listings, including:

  • HTML, CSS, JavaScript
  • Ideally, one or more third-party library like ReactJS or Angular
  • Programming languages and libraries like Ruby, PHP, Python
  • Experience with databases
  • Version control
  • Knowledge of security concerns and best practices
  • Ideally, some knowledge of web or visual design, plus user experience best practices

The Term Framework

Real world web development relies heavily on the use of frameworks. Frameworks aren’t exactly new languages, but are more like add-ons to existing languages. These frameworks slightly change the rules and syntax of a language, but save us a lot of time and effort in writing web development code.

For example, a CSS framework like Bootstrap will require us to write our CSS using slightly different rules than regular (vanilla) CSS. It will also limit the level of customization we can do using CSS. But the drawbacks are often worth it, because Bootstrap makes styling our sites far easier and allows us to create mobile-friendly pages with minimal effort.

 

Wednesday, May 13, 2020

Data Backup and Restoration

Data backup is one of the vital and highly required process for any database management system. The primary reason being is that it is difficult to anticipate how and when the data can be lost. So it is an ideal and best practice that whenever a database is setup, we need to ensure that it has a provision for the data backup in case of any loss events happens.

A backup is nothing but the copy of data from the database which helps in reusing the database in case of any catastrophic event happens to the data.

MongoDB: Taking Data Backup

In order to perform a data backup process in mongodb, the command mongodump should be used. This command will simply dump all the data stored into a dump directory of the mongodb. It also helps to backup the data from the remote servers as well.

In order to properly perform the data backup, follow the below mentioned instructions:

  1. Start the mongodb server with the command mongod
  2. Start the mongodb client with the command mongo in a new command prompt.
  3. Switch to the required collection and run the command mongodump. Since the mongodump is not actually command from mongodb shell, you need to execute the command as shown below.

  1. From the above screenshot observer that all the data of the mongodb database will get backup.

Mongodump basically reads the data from the database and creates a BSON file in which the data is dumped. Mongodump writes only documents from the database. The resultant backup of the data will be of the space efficient. The backup of the data will be stored under the mongodb's bin\dump folder.

Also, there is one disadvantage of using mongodump which will have some performance impact when the data of a collection is huge than the available system memory.

MongoDB: Restoring Data from Backup

Now let us learn how to restore the backup data in mongodb. Data backup is basically used to reconstruct the data in case of a loss event. MongoDB helps to restore the backup data through its one of the utility tools called mongorestore which in turn is a command as well.

The below screenshot shows how the backup data is restored using the command mongorestore in MongoDB.

The above screenshot shows that the dumped collection data has been restored successfully.

Backup and restore Selected Database

To dump and restore selected database, use following commands:

C:\mongodb\bin>mongodump --db studentdb

This will backup only the selected database studentdb instead of backup the entire MongoDB databases.

C:\mongodb\bin>mongorestore --db studentdb dump/studentdb

This will restore only the selected database studentdb instead of restoring the entire MongoDB databases.

Backup and restore Selected Collection of a Database

To backup and restore selected database’s Collection, use following commands:

C:\mongodb\bin>mongodump --db studentdb --collection address

This will backup only the selected collection of a database address instead of backup the entire studentdb database.

C:\mongodb\bin>mongorestore --db studentdb --collection address 

dump/studentdb/address.bson

This will restore only the selected collection of a database address instead of restore the entire studentdb database.