The Basics of CookiesWe'll start by discussing what cookies are and how they operate. When you understand how cookies operate, it will be much easier for you to comprehend the test cases for testing cookies. How can cookies end up on your computer's hard drive? Also, how can we change our Cookie preferences?What Exactly Is a Cookie?A cookie is a little piece of data that a web server stores in a text file on the user are hard disc. The web browser then uses this information to obtain information from that machine.The cookie, in general, includes customized user data or information ... Read More
Backend TestingBacked testing is a method or technique that examines the server of database side of web applications or software. The primary motive of performing this test is to test the application layer or database layer to make the software defect-free, and prevent deadlock, data corruption, or data loss. For seamless and efficient working of a software, its GUI and database must interact with each other. Usually, databases are validated for: ACID functions, CRUD operations, Schema, Migration, business rule conformance, security purposes and performance.This testing is also referred to as "database testing". The data entered through the frontend is stored ... Read More
To create a 3D animation using matplotlib, we can take the following steps −Import the required packages. For 3D animation, you need to import Axes3D from mpl_toolkits.mplot3d and matplotlib.animation.Set the figure size and adjust the padding between and around the subplots.Create t, x, y and data points using numpy.Create a new figure or activate an existing figure.Get the instance of 3D axes.Turn off the axes.Plot the lines with data.Create an animation by repeatedly calling a function *animate*.To display the figure, use show() method.Exampleimport numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from mpl_toolkits.mplot3d import Axes3D plt.rcParams["figure.figsize"] ... Read More
To create broken horizontal bar graphs in matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create a figure and a set of subplots.Plot a horizontal sequence of rectangles.Scale X and Y axes limit.Configure the grid lines.Annotate the broken bars.To display the figure, use show() method.Exampleimport matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True fig, ax = plt.subplots() # Horizontal sequence of rectangles ax.broken_barh([(110, 30), (150, 10)], (10, 9), facecolors='tab:blue') ax.broken_barh([(10, 50), (100, 20), (130, 10)], (20, 9), facecolors=('tab:orange', 'tab:green', 'tab:red')) # Scale ... Read More
To modify a 2d scatterplot to display color based on a third array in a CSV file, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Read the CSV file with three headers.Create a new figure or activate an existing figure.Add an 'ax' to the figure as part of a subplot arrangement.Make a scatter plot with CSV file data points.To display the figure, use show() method.Exampleimport pandas as pd from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True columns = ["data1", "data2", "data3"] df = ... Read More
To make a multiline plot from .CSV file in matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create a list of columns to fetch the data from a .CSV file. Make sure the names match with the column names used in the .CSV file.Read the data from the .CSV file.Plot the lines using df.plot() method.To display the figure, use show() method.Exampleimport pandas as pd from matplotlib import pyplot as plt # Set the figure size plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True # Make a list of ... Read More
To plot two different arrays of different lengths in matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create y1, x1, y2 and x2 data points using numpy with different array lengths.Plot x1, y1 and x2, y2 data points using plot() method.To display the figure, use show() method.Exampleimport numpy as np import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True y1 = (np.random.random(100) - 0.5).cumsum() y2 = y1.reshape(-1, 10).mean(axis=1) x1 = np.linspace(0, 1, 100) x2 = np.linspace(0, 1, 10) plt.plot(x1, y1) plt.plot(x2, y2) ... Read More
To shift a graph along the X-axis in matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create x and y data points using numpy.Plot the x and y data points for the original curve.Plot the shifted graph, in the range of (1, 1+len(y)) with y data points.Place a legend on the figure.To display the figure, use show() method.Exampleimport numpy as np import matplotlib.pyplot as plt # Set the figure size plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True # x and y data points x = np.linspace(-5, 5, ... Read More
To set xticks and yticks with imshow() plot, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Get the current axis.Create a random dataset.Display the data as an image, i.e., on a 2D regular raster.Set x and y ticks using set_xticks() and set_yticks() method.To display the figure, use show() method.Exampleimport numpy as np import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True ax = plt.gca() data = np.random.rand(6, 6) ax.imshow(data) # Set xticks and yticks ax.set_xticks([1, 2, 3, 4, 5]) ax.set_yticks([1, 2, 3, 4, 5]) ... Read More
To remove white border when using subplot and imshow(), we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create random data points using numpy.Get the size of the data.Set the figure sizes in inches.Get the axes instance that contains most of the figure element.Turn off the axes.Add axes to the figure.Display the data as an image, i.e., on a 2D regular raster.To display the figure, use show() method.Exampleimport numpy as np import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True data = np.random.randint(0, 50, (50, 50)) sizes ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP