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 feof () in Reading file

What is feof () used in Reading file?

The feof() function in PHP is an inherent function that checks a file pointer for the end-of-file. It determines whether or not the “end-of-file” has been reached. If the size of the content of a file is not known ahead of time, the feof() method is used to loop over it.

Why feof () used in Reading file ?

If the end-of-file has been reached or an error has occurred, the feof() method returns True. Otherwise, False is returned.

Syntax:

feof( $file )

Parameters:

In PHP, the feof() method takes only one parameter, $file. The file to be examined for end-of-file is specified by this argument.

Return Value:

If the end of the file has been reached or an error has occurred, it returns TRUE. Otherwise, False is returned.

Errors And Exception:

  • If the supplied file reference is invalid, it enters an infinite loop since end-of-file does not return True.
  • If a connection opened by fsockopen() is not terminated by the server, the feof() function hangs.

Let’s take one Example:-

Below examples will explain the feof() function:

Example 1:- In the below program the file named “test.txt” contains only a single line of text which is “This file consists of only a single line.”.

Output:

Example 2:- In the below program the file named “test-test.txt” contains the following text.

This is the first line.
This is the second line.
This is the third line.

Output:

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

Why doesn’t this JavaScript destructuring assignment work?

Destructuring

Destructuring is a convenient way of extracting multiple values from data stored in objects and Arrays. The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables.

Ex:- var a = [10, 20, 30];

[x, y, z] = a;
console.log(x) // 10
console.log(y) // 20
console.log(z) // 30

Left-hand side of the assignment to define what values to unpack from the sourced variable.

Array Destructuring

When destructuring Array, we use their index/positions in the assignment.

Array Destructuring

Array Passing to a Function

Array Returning from a Function

Nested Array Destructuring

Object Destructuring

When destructuring objects, we use the keys as variable names. This is how JavaScript knows which property of the object we want to assign.

Object Destructuring

Object Destructuring

Object Destructuring

Object Passing to a Function

Object Returning from a Function

Nested Object Destructuring

Tagged : / / / / /

How to use different types of Media Features in CSS?

  • any-hover – Does any available input mechanism allow the user to hover over elements? (added in Media Queries Level 4)
  • any-pointer – Is any available input mechanism a pointing device, and if so, how accurate is it? (added in Media Queries Level 4)
  • aspect-ratio – The ratio between the width and the height of the viewport
  • color – The number of bits per color component for the output device
  • color-index – The number of colors the device can display
  • grid – Whether the device is a grid or bitmap
  • height – The viewport height
  • hover – Does the primary input mechanism allow the user to hover over elements? (added in Media Queries Level 4)
  • inverted-colors – Is the browser or underlying OS inverting colors? (added in Media Queries Level 4)
  • light-level – Current ambient light level (added in Media Queries Level 4)
  • max-aspect-ratio – The maximum ratio between the width and the height of the display area
  • max-color – The maximum number of bits per color component for the output device
  • max-color-index – The maximum number of colors the device can display
  • max-device-aspect-ratio – The maximum ratio between the width and the height of the device
  • max-device-height – The maximum height of the device, such as a computer screen
  • max-device-width – The maximum width of the device, such as a computer screen
  • max-height – The
  • max-monochrome – The maximum number of bits per “color” on a monochrome (greyscale) device
  • max-resolution – The maximum resolution of the device, using dpi or dpcmmaximum height of the display area, such as a browser window
  • scan – The scanning process of the output device
  • scripting – Is scripting (e.g. JavaScript) available? (added in Media Queries Level 4)
  • max-width – The maximum width of the display area, such as a browser window
  • min-aspect-ratio – The minimum ratio between the width and the height of the display area
  • min-color – The minimum number of bits per color component for the output device
  • min-color-index – The minimum number of colors the device can display
  • min-device-aspect-ratio – The minimum ratio between the width and the height of the device
  • min-device-width – The minimum width of the device, such as a computer screen
  • min-device-height – The minimum height of the device, such as a computer screen
  • min-height – The minimum height of the display area, such as a browser window
  • min-monochrome – The minimum number of bits per “color” on a monochrome (greyscale) device
  • min-resolution – The minimum resolution of the device, using dpi or dpcm
  • min-width – The minimum width of the display area, such as a browser window
  • monochrome – The number of bits per “color” on a monochrome (greyscale) device

  • update-frequency – How quickly can the output device modify the appearance of the content (added in Media Queries Level 4)
  • width – The viewport width
  • orientation – The orientation of the viewport (landscape or portrait mode)
  • overflow-block – How does the output device handle content that overflows the viewport along the block axis (added in Media Queries Level 4)
  • overflow-inline – Can content that overflows the viewport along the inline axis be scrolled (added in Media Queries Level 4)
  • pointer – Is the primary input mechanism a pointing device, and if so, how accurate is it? (added in Media Queries Level 4)
  • resolution – The resolution of the output device, using dpi or dpcm
Tagged : / / / / / / / / /

How to become Microsoft Certified Azure Administrator AZ-104?

Today any industry or an enterprise of any size needed flexibility and efficient storage solution. Azure offers a fast method to collect data, analyse it, and use several methods and tools to enable companies, including some of the Fortune 500 organizations, to deliver their services and products to their users within a minimal time of frame.

In this blog, you will discuss about the Azure Administrator and learn how to become a Microsoft Azure Administrator:

Who is an Azure Administrator?

Azure administrators manage cloud services that span storage, security, networking, and also compute cloud capabilities. The certification is a role-based and validates ability to implement, monitor and maintain Microsoft Azure solutions, including major services related to compute, storage, network, and security.

If you planning to enter in this profession, then you must clear the AZ-104 Microsoft Azure Administration certification exam first. You will learn about az-104 in detail further in the blog.

Azure Professional Skills

If you want yourself in Azure-based profession, than you must have skills that you need to acquire, such as comfortable working with UNIX, Windows, and other operating systems, setting up cloud systems, balancing and deploying workloads, and more.

Skills that you need to acquire to become an Azure professional:

  • In-depth knowledge of Cloud Computing services.
  • Understanding of functions in databases, servers, networking, and software in the cloud.
  • Knowledge of Microsoft and familiar working with Microsoft 365 and PowerShell.
  • Knowledge of at least one programming language.
  • Should have clear the Azure Administrator certification exam conducted by Microsoft.

Azure Administrator Certification AZ-104

AZ-104 is one of the latest exams released by Microsoft in year 2020 which is the replacement of AZ-103. Once you clear the AZ-104 exam, Microsoft will reward you with the Azure Administrator Associate certification. Talking about this certification price, it is about US$165, and you have to pay the same for every next attempt.

Azure Administrator Jobs

As per the records, there are over 51,000 vacancies for Azure professionals, all in the leading companies in the United States. In India, there are more than 19,000 job openings for these experts.

Following are some of the job profiles related to Azure that recruiters hire the most:

  • Azure Administrator
  • System Administrator
  • Azure Cloud Solutions Consultant
  • Azure Customer Engineer
  • Azure Services Sales Specialist
  • Azure Technical Support
  • Azure Cloud Engineer
  • Azure Systems Engineer
  • Cloud Architect
  • Azure AD Engineer

Clearing this Azure Administrator certification exam is very important to get any of the job roles mentioned. But after all this, for getting selected for these jobs, you must also prepare a good Azure Administrator resume, consisting of all the demanding skills mentioned in the job description.

Let’s take a look at some of the job descriptions so that you understand the roles better.

Why you should get Microsoft Azure Certification?

Everybody want a good career with handsome income.  According to the recent studies, Azure Administrator jobs salary in India is approximately ₹563,000 per annum, which is much higher than most of the other IT salaries. These professionals’ salary range in India is between ₹333,000 and ₹1,307,000 per year.

Azure Administrator Associate is one of three role-based certifications taking its place. In every aspect of IT, cloud plays an important role. Most of the organizations have some dependency on a cloud platform and most of these companies use Microsoft Azure as a part of their cloud infrastructure to host their services as part of an efficient, highly-scalable architecture.

To remain competitive in IT domain, cloud almost certainly needs to be part of someone skillset. The Azure Administrator Associate certification is for individuals who is looking to enhance their current career or are looking to get into a new role as an Azure cloud administrator.

Exam Structure

AZ-104 | Exam Details
Name of the ExamMicrosoft Certified Azure Administrator Associate (AZ-104)
Exam CodeAZ-104
TechnologyMicrosoft Azure
PrerequisitesNone
Exam Duration150 Minutes
Number of Questions40-60
Registration Fee$165 USD(plus applicable taxes)
Exam LanguageEnglish, Korean, Japanese and Chinese

Conclusion

So, If you want to prepare for the Azure Administration exam from Microsoft and become proficient in this domain than this blog provide you knowledge about who these professionals are, the necessary skills in this domain, the certification that you need to clear to get into this field, the job opportunities available after clearing the certification, and more. Now the question is where I can get Certification with quality learning and hands-on projects and many more. For this I would like to suggest you DevOpsScool, one of the best and leading institute for AZ-104 Certification, with best expert. Guide you throughout your learning and provide you best support you want.

Thank you!!

Tagged : / / / / / / / /

Tutorial for fgets() in Reading file

What is fgets() used in Reading file?

This function is used to read a single line from a file. You can pass this function a file handle corresponding to an open file, and optional length.

Why fgets() used in Reading file?

  • It returns a line from a file pointer and terminates at a given length, end of file(EOF), or new line, whichever comes first.
  • The fgets() function is passed the file to read and the number of bytes to read as arguments, and it returns a string of length -1 bytes from the file indicated by the user.
  • If it fails, it returns False.

Syntax:-

fgets(file, length)
Parameters Used:
The fgets() function in PHP accepts two parameters.
file : It specifies the file from which characters have to be extracted. 
length : It specifies the number of bytes to be read by the fgets() function. The default value is 1024 bytes.

Return Value : It returns a string of length -1 bytes from the user-specified file, or False if the operation fails.

Errors And Exceptions:-

  • Because it reads a single line at a time, the method isn’t designed for huge files, and reading a long file can take a long time.
  • If the fgets() method is called more than once, the buffer must be emptied.
  • Although the fgets() method returns the Boolean False, it frequently produces a non-Boolean result that evaluates to False.

Let’s take one Example:-

Suppose there is a file named “test.txt” which consists of :

This is the first line.
This is the second line.
This is the third line.

Example 1:-

Output:

Example 2:-

Output:-

Tagged : / / / / / / /

How do you handle exceptions in JavaScript?

Exception

An exception is a generalization of the concept of an error to include any unexpected condition encountered during execution.

Exception Handling-

  • try
  • catch
  • finally
  • throw

How does the Javascript callback function work?

A callback function is a function (It can be any function Anonymous Function, Arrow Function) passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action.

Synchronous – It waits for each operation to complete, after that it executes the next operation.

Asynchronous – It never waits for each operation to complete, rather it executes all operations in the first GO only.

map ( ) Method in JavaScript

The map( ) method creates a new array with the results of calling a provided function on every element in the calling array.
the map calls a provided callback function once for each element in an array, in order, and returns a new array from the results.

Syntax:-
map(callback(currentValue, index, array), thisArg);

Tagged : / / /

What is Selenium?

Selenium is a free automated testing framework that is used to validate web applications in different browsers and platforms. To create Selenium test scripts you can use multiple programming languages such as Java, C #, Python, and more.

Here is the list of tools in Selenium:

  • Selenium Integrated Development Environment (IDE)
  • Selenium Remote Control (RC)
  • WebDriver
  • Selenium Grid

Who can learn this course?

  • Basic understanding of java or any other object-oriented programming language.
  • Should have knowledge C#, Java, Perl, PHP, Python, and Ruby.

Benifits of Selenium:

  • Language and Framework Support
  • Open Source Availability.
  • Multi-Browser Support
  • Ease Of Implementation
  • Reusability and Integrations.
  • Flexibility.

What are the features of selenium?

  • Multi-Browser Compatibility.
  • Multiple Language Support.
  • Speed and Performance.
  • Handling of Dynamic Web Elements.
  • Easy to Identify and use web elements.

How does Selenium works?

Selenium works through API commands, such as GET and POST, and Selenium will act based on script requests. Requests are then sent to the browser driver’s HTTP server as well as to browsers via HTTP.

What is the main role of Selenium in the software testing process?

Selenium has become one of the most popular testing tools, mainly because it is an open-source framework and it enables skilled testers to automate many testing processes, such as Functional Testing and Regression Testing.

Selenium Agenda:

Why is selenium popular?

Selenium has a large and active user community that provides extensive support. This makes the equipment highly resourceful and cost-effective.

To get more clarify, see these videos:

Tagged : / / / /