Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Tutorial for “For each” loop

What is For each Loops?

Use the for each loops to cycle through arrays. At each pass, the value of the current array element is set to $value. In the next pass, the array pointer is moved one by one. The for each loop is only used to loop around each key/values pair in an array. Only arrays are supported.

Syntax:-

foreach ($array as $value) {
  code to be executed;
}

Here are some of the Foreach Loops:-

  • “foreach(…){…}” is the foreach php loop block code
  • “$array_data” is the array variable to be looped through
  • “$array_value “ is the temporary variable that holds the current array item values.
  • block of code…” is the piece of code that operates on the array values
PHP Loop and  Control Structures

Example1:-

Output:-

Example2:-

Output:-

Tagged : / / / / / / / / / /

How to Define Float and Clear in CSS?

float-

This property is used to specify that an element should be placed along the left or right side of its container, where text and inline elements will wrap around it. We can set this property to left, right, none (default).

Ex: –

img { float: left;}

clear-

This property is used to specify whether an element can be next to floating elements that precede it or must be moved down (cleared) below them. We can set this property to left, right, both, none (default).

Ex:-

p { clear: left;}

Tagged : / / /

Tutorial for “For” loop

What is For Loops?

The For loop is a control structure that repeatedly executes a block of code until a condition is met. It’s commonly used to make a code block repeat itself a set number of times. It should be used if the number of iterations is given; otherwise, a while loop should be used. You use for loop when you already know how many times you want to run a block of code. It permits users to centralize all comments concerning the loop.

Syntax:-

for (init counter; test counter; increment counter) {
  code to be executed for each iteration;
}

The for loop in PHP is similar to the for loop in Java/C/C++. The following are the definitions of the (for loop) parameters:

  • initialization –It is used to set the counter variables and checked before the body of the loop is executed once unconditionally.
  • condition – At the beginning of each repetition, the state is assessed. The loop remains if it is true and the nesting statements are performed. If it is wrong, the loop is finished.
  • increment – The loop counter adds a new value. It is assessed at the end of every iteration.
php for loop flowchart

Example1:-

Output:-

Example2:-

Output:-

Tagged : / / / / / / /

Define Function expression in JavaScript

Function Expression

When we create a function and assign it to a variable, known as a function expression.

Note: –

  • You can‟t call function expression before the function definition.
  • Function expressions in JavaScript are not hoisted, unlike function declarations.

Anonymous Functions

Anonymous functions allow the creation of functions that have no specified name.

  • Can be stored in a Variable
  • Can be Returned in a Function
  • Can be pass in a Function

Store Anonymous Function in Variable

Passing Anonymous Function as Argument

Returning Anonymous Function

Tagged : / / /

How does JavaScript scope work?

Variable Scope

JavaScript has two scopes: –

  • Global
  • Local

Global Scope

A variable that is declared outside a function definition is a global variable, and its value is accessible and modifiable throughout your program. In a web browser, global variables are deleted when you close the browser window (or tab) but remain available to new pages loaded into the same window.

Local Scope

A variable that is declared inside a function definition is local. It is created and destroyed every time the function is executed, and it cannot be accessed by any code outside the function. Inside a function, if a variable has not been declared with var it is created as a global variable.

Local Scope

If there is a function inside a function the inner function can access outer function‟s variables but the outer function can not access inner function‟s variables. Function arguments (parameters) work as local variables inside functions.

Block Scope

Variables declared with var do not have block scope.

Block Scope

Identifiers declared with let and const do have block scope.

Variable Hoisting

Hoisting is JavaScript’s default behavior of moving declaration to the top of the function, if defined in a function, or the top of the global context, if outside a function.

Variable Hoisting

A variable can be used before it has been declared. Only variable declarations are hoisted to the top, not variable initialization.

Closure

A closure is a function having access to the parent scope. It preserves the data from the outside.

A closure is an inner function that has access to the outer (enclosing) function‟s variables.

For every closure we have three scopes:-

  • Local Scope ( Own scope)
  • Outer Functions Scope
  • Global Scope
Tagged : / / /

Top 5 Git Version Control Software in Cloud

Version control is a way to keep track of changes to code so that if something goes wrong, we can compare across different code versions and go back to any previous versions we want. This is very essential where many developers are constantly working on/changing the source code.

Benefits of Version Control Software:

The main advantages of using version control software include streamlining the development process, managing the code for multiple projects, and keeping a history of all changes within a code.

A version control software saves all the changes in a repository. So, if developers make a mistake, they can undo it. Also, they can compare the new code with the previous version to resolve their grievance. It can reduce human errors and unintended consequences to a great extent. Very suitable for any web development company around the world.

In addition, it facilitates the management of the project’s centralized repository, file storage, documents, and other information related to the project.

Here is the list of Top 4 git version control software in cloud:

1. GitHUb

GitHub helps software teams collaborate and maintain a full history of code changes. You can track changes in the code, turn back the clock to undo errors, and share your efforts with other team members.

It is a repository for host Git projects. For those wondering what is Git? It is an open-source version control system with local branching, multiple workflows, and convenient staging areas. Git version control is an easy-to-learn alternative and provides faster operation speeds.

Features:

  • Drag and Drop Gist Code.
  • Creating a folder via the Web Interface.
  • Using Github Command Line Interface.
  • Linking Lines.

2. GitLab

GitLab comes with a number of useful features such as an integrated project, a project website, etc. By using GitLab’s continuous integration (CI) capabilities, you can test and distribute code automatically.

You can access all aspects of a project, view the code, receive requests and add conflict resolution.

This version control software is designed for the DevOps lifecycle. Meaning, your projects are quite complex and involve cloud engineering and the like. Gitlab provides basic features such as view code, pull requests, and merge resolution.

  • Development.
  • Security.
  • Ops teams collaborate
  • Build software
  • Reduce development costs

4. Beanstalk

Beanstalk is a perfect choice for those who need to work from remote locations. This software is based on browser and cloud, which allows users to code, commit, review and deploy using the browser.

It allows users to code, commit, review, and deploy code using the browser. For its ease of use, you can integrate it with any messaging or email platform for efficient collaboration.

It can be integrated with messaging and email platforms for efficient collaboration regarding code and updates. It supports both Git and SVN and also comes with built-in analytics features. For security, it takes advantage of encryption, two-factor authentication, and password protection functions.

Features:

  • Variety of Application Deployment Options.
  • Wide Selection of Application Platforms.
  • Management and Updates.
  • Customization
  • Scaling
  • Compliance

4. HelixCore

Helix is one of the best version control systems. It provides an integrated platform for collaborative development and protection of intellectual property of any kind. It benefits from several new capabilities, support for both distributed and centralized development workflows. Helix also provides a complete Git ecosystem. And it comes in both on-premises and cloud versions.

Helixcore provides seamless team collaboration and support for both centralized and distributed development workflows. It is available for both cloud and on-premises deployments, which makes it scalable.

Features:

  • Work order management
  • Applications Management
  • Document Management
  • Access Controls
  • Procurement Management

5. Apache Subversion

Apache Subversion is another open-source version control system, founded a few decades ago by CollabNet. Both open-source arenas and enterprises consider it a reliable option for valuable data.

SVN is easy to implement with any programming language. Also, it provides persistent storage for handling text and binary files.

Features:

  • Inventory management
  • Security management
  • History tracking
  • User access controls
  • Data recovery
  • Workflow management

These are the best version control systems that a web development company should definitely consider using, according to the requirements.

Tagged : / / / / / /

HTML: Meta tag

<meta> tag is used to add a description of HTML page. The description that we add about the web page using the <meta> is used by search engines for indexing and ranking the web page. <meta> tags always go inside the <head> element.

Character encoding for the HTML document
<meta charset=”UTF-8″>

Tagged : / / /

How to speed up & make faster windows operating system in 2021

Almost nothing is more annoying than a slow Windows 10 computer. Starting up the operating system suddenly takes 5 minutes, starting a game takes a long time, and opening a simple document even takes a lot of time. Do you want to make your Windows 10 PC faster? Then follow the tips in this article. Within a few minutes to an hour, your Windows 10 computer has become a lot faster. In most cases, the changes are completely free.

Disable startup programs:

The first tip to make Windows 10 faster is an important one: disable applications that start automatically when you boot the computer. This is because, by default, countless unnecessary programs startup that uses a lot of memory or processor capacity. This leaves less space for applications that you really want to use. Disabling unnecessary applications is therefore a good start to make Windows 10 faster. Do not be afraid, this is easily achieved within a few clicks.

  1. First press Ctrl-Alt-Del
  2. Click Task Manager
  3. Click on the “Startup” tab
  4. A list of programs that start up by default appears
  5. Pay attention to the “Influence on start-up” row. Is “A lot” here? Then the program logically requires a lot of power from your computer. Do you no longer want this application to start as standard, because you never use the application?
  6. Click on the application with the right mouse button
  7. Select switch off

Pay attention! Do not simply switch off unknown programs. Certain programs can be important for the correct functioning of your computer. Not sure whether the application is an important (driver) program? Then do not switch it off.

Power management settings:

Another tip to make Windows 10 faster is to adjust Power Management. Some Windows 10 devices are standard on energy-saving mode. The laptop or computer uses less power in this mode. This is not entirely surprising at the expense of the speed of your Windows 10 system. Do you want to see if you can make Windows 10 faster by turning this setting off?

  1. Go to the Control Panel
  2. Select System and security
  3. Select ‘Power Management’
  4. Select ‘High performance’

By choosing ‘high performance, the computer will use a little more energy, but it will become a lot faster. Pay attention when using a laptop. If you select “high performance”, your laptop’s battery will maybe not last that long.

Switch off visual effects:

The visual effects of Windows 10 can make your laptop or computer a lot slower. Especially computers with an outdated (or no) graphic card can be slowed down by the visual effects that are switched on as standard. Fortunately, they are easy to turn off by you as a user.

  1. Search for sysdm.cpl via the search function in the Launch Bar to display the System Properties.
  2. Select the “Advanced” tab
  3. Under “Performance”, click Settings 
  4. Select ‘Custom’
  5. Then uncheck the options that you do not want to use.

Do you prefer not to test yourself which visual effects yield the most performance? Then it is also possible to check ‘Best performance’. Of course, selecting this option will make Windows 10 graphically less attractive. However, the performance of Windows 10 will increase considerably.

 Remove unnecessary software:

Both new and old computers with Windows 10 suffer from this problem: unnecessary software that is on the computer. Initially, Microsoft installs software such as test versions of virus scanners and system performance apps. It may seem very useful, but in most cases, this software only reduces the performance of Windows 10. But also all kinds of games or programs that you have deliberately installed come with so-called “bloatware”: software that adds nothing to your user experience.

It’s a shame to keep such software on your computer since Windows 10 only makes it slower. The next tip to make Windows 10 faster is to remove unnecessary programs from your computer.

  1. Search in the Start bar search for “Install and remove programs”.
  2. View the list of applications critically.
  3. Click on programs or games that you will never use again.
  4. Select ‘Delete’.
  5. Verify that you want to delete the app.

By removing these applications, you free up more space on your hard disk and system resources for programs you actually use.

Install an SSD with Windows 10:

Not all of our tips to improve the speed of Windows 10 are software-related. The last tip relates to the hardware of your laptop or computer. Installing an SSD (Solid State Disk) is one of the most effective adjustments you can make. An SSD loads data much faster than an HDD. This means, among other things, that your Windows 10 PC will start up faster and that (heavy) applications will load much faster. Installing an SSD and transferring Windows 10 may sound very difficult, but this can be achieved within an hour. After everything has been transferred correctly, you will soon understand why we recommend anyone who wants to make Windows 10 faster buy an SSD.

Check for malware regularly:

Among the more familiar forms of automated monitoring technologies, malware detection comprises mechanisms to identify and protect against harm from viruses, worms, spyware. Malware detection and prevention technologies are widely available for, server user workstations, and mobile devices, with some tools offering the capability to monitor malware detection software installed on multiple systems or computers.

  1. –>Setting
  2. –>Update&Security
  3. –>Windows Security
  4. –>Virus & threat protection

Defrag Your Hard Disk :

With the built-in disk defragmentation utility in Windows, you can rearrange the files on a disk to occupy contiguous storage space, which will speed up file access.

  1. Hit the Windows Key, type defragment and click “Defragment and Optimize Drives” when you see the option.
  2. Select your system drive (generally C drive) and click Optimize.
Tagged : / / / / / / / / /