What is a Web Framework, Why do we use Web Frameworks?

What is a Web Framework?

A Web Framework (WF) or Web Application Framework (WAF) which helps to build Web Applications.
Web frameworks provide tools and libraries to simplify common web development operations. This can include web services, APIs, and other resources.
Web frameworks help with a variety of tasks, from templating and database access to session management and code reuse.
More than 80% of all web app frameworks rely on the Model View Controller architecture.

Why do we use Web Frameworks?

  • Collection of tools
  • No need to start from scratch
  • Save Time
  • Improve Productivity
  • Clean Code
  • Reusable Code
  • Testing
  • Debugging

Some Web Framework

  • Laravel
  • Codeigniter
  • Zend
  • Django
  • Spring
Tagged : / / /

Tutorials for PHP Data type

What is Data Types?

Their sizes, as well as the names of the variables, might change. In most programming languages (such as C++ and Java), you may use a number of data types for variables. However, because PHP does not specify type explicitly, the variable type must be determined by the form or type of data to which it is applied.

What are the Data Types used in PHP?

PHP Data Types - Tutorial And Example

There are many data types for various purposes, such as null, binary, integer, float, text, object, property, and an array. We employ eight different types of data in PHP to create our variables. Below is a brief explanation of the various categories.

Basic of PHP

Integers − There are whole numbers, including 4195, without a decimal point.

Doubles − Floating points are numbers such as 3.14159 or 49.1

Booleans − Have either true or false only two possible values.

NULL − It has only one value: NULL, is a special kind.

Strings − There are character strings, such as ‘PHP supports string operations.’

Arrays − Collections of other values are called and indexed.

Objects − There are instances of programming classes that can package other class-specific values and functions.

Resources − Special variables provide access to external PHP tools (such as database connections).

Tagged : / / / / / / / / /

What is the difference between terraform and Ansible?

In today’s growing world of DevOps, big player are started implementing business processes on IaC (Infrastructure as Code). IaC work as to simplify the process of large-scale management. Modern IaC tools simplify the configuration to resolve server problems in a quick time.

Terraform and Ansible are two popular frontline line DevOps tools that provision and configure servers. Ansible is the more mature between the two, originating in early 2012 and Terraform is a Hashicorp product and was first introduce in 2014.  As the DevOps industry is gaining momentum, so also Ansible and Terraform gaining their popularity with this trend. Both the tools used in deploying the code and infrastructure, in simple Ansible acts as a configuration management solution, Terraform is a service orchestration tool.

In this blog, we point our focus on Terraform vs Ansible, a discussion that is highly dominating the current DevOps market. Let’s first known about these tools:

What is Ansible?

Ansible is an open-source automation tool, or you can also called platform, used for IT tasks such as configuration management, application deployment, intraservice orchestration, and provisioning. Automation is crucial these days, with IT environments that are too complex and often need to scale too quickly for system administrators and developers to keep up if they had to do everything manually.

In simple words, it frees up time and increases efficiency. And also it is rapidly rising to the top in the world of automation tools.

Benefits of Ansible

  • Free: Ansible is an open-source tool.
  • Very simple to set up and use: No special coding skills are necessary to use Ansible’s playbooks.
  • Powerful: Ansible lets you model even highly complex IT workflows.
  • Flexible: Orchestrate the entire application environment no matter where it’s deployed. You can also customize it based on your needs.
  • Agentless: No need to install any other software or firewall ports on the client systems you want to automate. You also don’t have to set up a separate management structure.
  • Efficient: You don’t need to install any extra software, there’s more room for application resources on your server.

What is Terraform?

Terraform is an open source, CLI-based infrastructure as code tool created by Hashicorp.

Terraform is an infrastructure as code tool that helps you to build, change, and infrastructure safely and efficiently. This process includes low-level components such as compute instances, storage, and networking, as well as high-level components such as DNS entries, SaaS features, etc. Terraform can manage both existing service providers and custom in-house solutions.

Benefits of Using Terraform

So now you know what Terraform is and how it works, let’s take a look on the top reasons why you should start using Terraform today:

  • Improve multi-cloud infrastructure deployment
  • Automated infrastructure management
  • Infrastructure as code
  • Reduced development costs
  • Reduced time to provision

What is the difference between terraform and Ansible?

In this section, let’s check the difference between the two. Meanwhile both are designed for similar purposes, both have definitely laid a foundation for lifecycle management frameworks. Now, both our players in their battle has placed their cards on the table. Let us find out their differences on some of major factors:

Conclusion

The possibility of a perfect answer on “Why Terraform” or “Why not Ansible” depends mainly on your requirements. Both the tools have so many similarities and also some fair differences as well. So, which one is the best? From a practical perspective, it is advisable to use Ansible for configuration management and Terraform for orchestration. The primary purpose of Terraform is orchestration, and it is considerably intuitive.

Also from career aspect, opportunities for these skilled professionals are increasing significantly with huge scope for career growth.

According to Indeed.com, the average salary of a professional of these skills is $177,530 per annum.

Both Ansible and Terraform are the leading data analytics tool which is adopted by many MNCs worldwide. With this, the demand for the professionals is gradually.

Below you can watch and learn Ansible and Terraform Tutorials

Ansible Advance Tutorial – Intro, Adhoc Command, Inventory, Playbook

Terraform Basic Tutorial with Demo

Hope you find this answer helpful.

Tagged : / / / / /

Tutorials for PHP Variables

What is Variable?

In any programming language, a variable is a computer memory name that represents knowledge. One of the numerous computer program components is the variables. For declare a variable in php, the $ sign with its signature, like $myVariable, can be used.

How to declare PHP variable?

  • All variables in PHP start with a $(doller) sign followed by the name of the variable.
  • A valid Variable name starts with a letter (A-Z, a-z) or underscore(_), followed by any number of letters, numbers, or underscores.
  • If a variable name is more than one word, it can be separated with underscore(for example $employee_code instead of $employeecode).
  • ‘$’ is a special variable that can not be assigned.

What are the Types of Variable?

Local Variables:- A local variable is one that only exists inside a certain scope. They only exist in the function in which they were created. They’re frequently referred to as automatic variables since they’re produced automatically when the function starts running and disappear immediately when it’s completed. The term auto can be used to create these variables explicitly, but it isn’t required because auto is the default.

Global Variables:- A global variable is one that is defined outside of all functions and is accessible to all of them. These variables are unaffected by scopes and are always accessible, implying that a global variable persists until the program is terminated. It’s possible to make a global variable in one file and use it in another. The variable must be defined in both files to do this, but the term extern must come before the “second” declaration.

Static Variables:- A global or local variable can be a static variable. Both are generated by using the term static before the variable definition. A local static variable is one that can keep its value from one function call to the next and will persist until the program is finished. When creating a local static variable, it should be given an initial value. If it isn’t, the value will be set to 0 by default. A global static variable may only be accessed within the file in which it was created. File scope is a term used to describe a variable’s scope.

Variable Initialization?

PHP can store all type of data in variables. Before using a variable in PHP, assign a value to it so PHP will create that variable and store data in it. That means we have to assign data to a variable before attempting to read a variable’s value.

Example:-

$roll = 256;
$price = 25.50;
$name = “Geeky Shows”;
Note - If a variable is created without a value, it is automatically assigned a value of NULL.
Tagged : / / / / / / / / /

Variables in Javascript with Rules

Variables

A variable is an identifier or a name which is used to refer a value. A variable is written with a combination of letters, numbers and special characters _ (underscore) and $ (dollar) with the first letter being an alphabet.

Ex-

c, fact, b33, total_amount etc.

Rules

• Variable can contain combination of letters, digits, underscores ( _ ), and
dollar signs ( $ ).
• Must begin with a letter A-Z or a-z or underscore or dollar sign
• A variable name cannot start with a number
• Must not contain any space characters
• JavaScript is case-sensitive
• Can‟t use reserved keywords

Tagged : / / / /

Introduction to CSS(Cascading Style Sheets) Part-1:-

CSS is the language we use to style the web pages. CSS stands for Cascading Styles Sheets. It describes how HTML elements are displayed on the screen. It can control the layout of multiple web pages all at once.

CSS Syntax:-

CSS selector

The selector points the HTML elemet you want to style.

The declaration block contains one or more declarations seprated bs semicolons.

Each declaration includes a css property name and value, seprated by a colons.

Multiple CSS declarations are seprated with semicolons, and declarations block are surrounded by curly braces.

Advantages of CSS:-

  1. Time saving:-We can write css once and then reuse same sheet in multiple HTML pages. It saves lots of time.
  2. Faster load pages:- If we use CSS, we do not need to write HTML tag attributes everytime. Just write one CSS rule of a tag and apply it to all the occurrences of that tag. So less code means faster download times.
  3. Easy maintenence:- To make a global change, simply change the style, and all elements in all the web pages will be updated automatically.
  4. Multiple device compatiblity:- Style sheets allow content to be optimized for more than one type of device.
  5. Global web standards:- Now HTML attributes are being deprecated and it is bieng recommended to use CSS.

Ways of inserting CSS:-

  1. External style sheets
  2. Internal style sheets/Embedded Style sheets
  3. Inline css

External Style Sheets:-

An external style sheet is a separate document that contains only CSS rules. An external style sheet helps to change the look of an entire website by changing just one css file. It should not contain any HTML Tags. It has .css extension.

Example:-

p { color: red; font-size: 24px;}

h1{ color: blue; font-size: 24em;}

1. Open notepad++ or any other Editor or IDE

2. Write CSS Code

3. Save with .css extension for example geekyshows.css

How to link Web Page to an External Style Sheet:-

The href attribute with <link> element inside the <head> tag is used to link web page to an external style sheet.

<html>

  <head>

    <title>Welcome to Geekyshows</title>

    <link rel=“stylesheet” href=“geekyshows.css”>

  </head>

  <body>

  <h1>I am Heading</h1>

  <p>I am first Paragraph.</p>

  <p>I am second Paragraph</p>

  </body>

</html>

Internal Style Sheets:-

Internal Style sheet is a set of style that is created as a part of HTML document. An internal style sheet may be used if one single page has a unique style.

Internal Style sheets are created using <style> element, which is added inside the <head> element of the HTML document.

Example:-

<html>

  <head>

    <title>Hello CSS</title>

    <style type=“text/css”>

    p { color: red; font-size: 24px;}

  h1{ color: blue; font-size: 24em;}

    </style>

  </head>

  <body>

  <h1>I am Heading</h1>

  <p>I am first Paragraph.</p>

  <p>I am second Paragraph</p>

  </body>

</html>

Inline Styles:-

Inline style is useful when we need to define specific style for individual elements present on a web page. The style attribute in a specific Tag or element, is used to create inline style. The style attribute can contain any CSS property between double quotes.

Ex:-

For paragraph:-

<p style=“color: red; font-size: 22px;”> I am first paragraph</p>

<p> I am second paragraph</p>

For Heading: –

<h1 style=“color: red; font-size: 22px;”> I am Heading</h1>

Tagged : / /

Identifiers and Reserved Words – JavaScript

An identifier is a name having a few letters, numbers and special characters _ (underscore). It is used to identify a variable, function, symbolic constant and so on.

Ex-

  • X2
  • PI
  • Sigma
  • matadd

Tagged : / / /

How many ways to Display (Print) data in JavaScript?

Display

• document.write( )
• window.alert( )
• console.log( )
• innerHTML

document.write( )

This function is used to write arbitrary HTML and content into the page. If we use this function after an HTML document is fully loaded, will delete all existing HTML. It is used only for testing purposes.

Ex-

document.write(“Hello World”);
document.write(variable);
document.write(4+2);
document.write(“Hello World.”);
document.write(“Hello World. ” + variable + “ ”);

window.alert( )

This function is used to display data in alert dialog box. alert really should be used only when you truly want to stop everything and let the user know something.

Ex-

window.alert(“Hello World”);
window.alert(variable);
window.alert(4+2);
window.alert(“Hello World” + variable);

console.log( )

This function is used to display data in the console. This is used for debugging purpose. We can identify our code‟s error.

Ex-

console.log(“Hello World”);
console.log(variable);
console.log(4+2);
console.log(“Hello World” + variable);

Tagged : / / / / /

Top 11 Text/Code Editor Software in 2021

  • Atom
  • vim
  • Notepad++
  • Visual Studio Code
  • Brackets
  • NetBeans
  • Bluefish
  • TextMate
  • Code::blocks
  • Geany
  • Komodo Edit

What are code editors called?

Code editors or source code editors are the software that is designed specifically to help developers in coding.

These are actually the text editors with some additional functionalities to manage and edit code. It can be standalone or it can be a part of an IDE.

Using the best code editor can improve the speed of coding.

The code editors don’t compile the code. It just allows you to write and edit the source code.

Which editor you will use for coding?

Visual Studio Code-

  • It is an open-source text editor.
  • It can be easily run anywhere whether it be Windows, Linux, and Mac.
  • It is a very light-weighted tool.
  • It provides Syntax Highlighting.
  • It also provides debugging with call stacks, breakpoints.
  • customizable and extensible text editor.

What is the most used code editor?

Visual Studio Code, also known as VS Code, is an open-source code editor by Microsoft. It is a cross-platform text editor that can run on any device, either on Linux, Windows, or Mac. His text editor is focused on increasing the developer’s performance. Features like auto-completion, system debugging help to improve the developer’s daily tasks.

What can you do with a code editor?

A code editor is nothing but a text editor that is specialized for writing software. It may be a stand-alone program or part of an integrated development environment (IDE). They make writing and reading the source code easier by differentiating the elements, so the programmers can view their code.

Tagged : / / / / / / / / /

Title Tag

The contents of the <title> element are either shown in the top of the browser, above where you usually type in the URL of the page you want to visit, or on the tab for that page (if your browser uses tabs to allow you to view multiple pages at the same time). <title> is opening title tag and </title> closing title tag.]

<html>
	<head>
		<title> Hello </title>
	</head>
</html>
Tagged : / /