Programming FlashCards

Explore our curated collection of programming flashcards. Each card contains practical examples and code snippets to help you master programming concepts quickly.

Filter by Technology

StandardScaler programming concept visualization
Sklearn

StandardScaler

Demonstrates feature scaling using StandardScaler from scikit-learn. It scales numerical features to have zero mean and unit variance, which can improve the performance of many machine learning algorithms.

Train Test Split programming concept visualization
Sklearn

Train Test Split

Splitting data into training and testing sets using `train_test_split`. Training a Logistic Regression model and evaluating its performance using accuracy score.

Create Namespace programming concept visualization
Kubernetes

Create Namespace

This YAML file creates a Kubernetes Namespace named 'my-namespace'. Namespaces provide a way to divide cluster resources between multiple users or teams.

Create Deployment programming concept visualization
Kubernetes

Create Deployment

This command creates a Kubernetes deployment named 'my-nginx' using the 'nginx' image. It specifies that three replicas (pods) should be running.

Default Argument programming concept visualization
Python

Default Argument

Demonstrates a Python function definition with a default argument. The `greet` function takes a name and an optional greeting. If no greeting is provided, it defaults to "Hello".

Create Table programming concept visualization
MySQL

Create Table

Creates a table named 'employees' with columns for id (primary key, auto-incrementing), first name, last name, email (unique), hire date, and salary. Defines data types and constraints.

Table Creation programming concept visualization
MySQL

Table Creation

Creates a table named 'employees' with columns for id (primary key, auto-incrementing), first_name, last_name, email (unique), hire_date, and salary. Specifies data types and constraints like NOT NULL and UNIQUE.

Unset Check programming concept visualization
Shell

Unset Check

Checks if a variable is unset or empty using the '-z' operator. 'unset' removes a variable, making it unavailable. This is useful for conditional logic based on variable existence.

Variable Expansion programming concept visualization
Shell

Variable Expansion

Demonstrates accessing the value of a shell variable. Both $VAR and ${VAR} are valid ways to expand a variable. The curly braces are useful for disambiguation when the variable name is immediately followed by other characters.

Custom Markers programming concept visualization
Matplotlib

Custom Markers

Creates a scatter plot with custom 'x' markers, red color, and larger size. Demonstrates customization of marker style, color, and size using `marker`, `color`, and `s` parameters in `plt.scatter()`. Includes labels, title, and grid.

Scatter Plot programming concept visualization
Matplotlib

Scatter Plot

Creating a scatter plot with random data, varying sizes, and colors using Matplotlib. Demonstrates customization of scatter plot elements.

Custom Exceptions programming concept visualization
Python

Custom Exceptions

This code demonstrates how to define and raise custom exceptions in Python. It defines a base exception class and two specific exception classes for values that are too small or too large.

Try Except Finally programming concept visualization
Python

Try Except Finally

This code demonstrates exception handling in Python. It attempts a division, catches a potential ZeroDivisionError, and uses a finally block to ensure code execution regardless of exceptions.

Force Kill PID programming concept visualization
Linux

Force Kill PID

Forcefully terminates all processes matching 'process_name'. Useful when a process becomes unresponsive and needs immediate termination. Use with caution as it doesn't allow the process to clean up.

Inheritance programming concept visualization
JavaScript

Inheritance

This example demonstrates inheritance in JavaScript. The `Dog` class inherits from the `Animal` class, extending its functionality and overriding the `speak` method. The `super()` keyword is used to call the constructor of the parent class.

JavaScript Class programming concept visualization
JavaScript

JavaScript Class

Demonstrates a basic class in JavaScript. It defines a `Dog` class with a constructor and a `bark` method. An instance of the class is then created and its properties and methods are accessed.

:visited programming concept visualization
CSS

:visited

The :visited pseudo-class styles links that the user has already visited. This allows users to easily distinguish between visited and unvisited links.

::first-letter programming concept visualization
CSS

::first-letter

The ::first-letter pseudo-element is used to add special styles to the first letter of the first line of a text. In this example, the first letter of every paragraph will be purple and twice the normal size, and floating to the left.

Styled Figure programming concept visualization
HTML

Styled Figure

Figures can contain more complex content and the figcaption can be styled for emphasis. Use semantic HTML to structure content logically and improve accessibility.

Figure Caption programming concept visualization
HTML

Figure Caption

The

element encapsulates an image with its caption. The
provides a description, enhancing accessibility and context.

Multi-Index Pivot programming concept visualization
Pandas

Multi-Index Pivot

Create a pivot table with multiple index columns ('Region', 'Product'), 'Year' as columns, calculate total sales, and add row/column margins for grand totals.

Pivot Table Example programming concept visualization
Pandas

Pivot Table Example

Creating a pivot table to summarize sales data by date and category, showing the sum of values for each combination. Demonstrates basic pivot table functionality.

Disable User programming concept visualization
Jenkins

Disable User

Demonstrates disabling a user in Jenkins using the Jenkins API. Disabling prevents the user from logging in without deleting their account.

Create User programming concept visualization
Jenkins

Create User

Illustrates a Python function to create a new user in Jenkins, taking username, password, and email as input. This is a simplified representation and would require actual Jenkins API interaction for full functionality.

Run Redis Alpine programming concept visualization
Docker

Run Redis Alpine

Runs a Redis server in detached mode using the lightweight Alpine Linux-based Redis image, naming the container 'my_redis' for easy management.

Run Nginx programming concept visualization
Docker

Run Nginx

Runs an Nginx web server in a detached mode (-d), maps port 80 on the host to port 80 on the container, names the container 'web', and uses the 'nginx' image.

GPR Regression programming concept visualization
Sklearn

GPR Regression

Demonstrates Gaussian Process Regression with an RBF kernel to model a sinusoidal function. The code fits a Gaussian Process Regressor to a sample of a sine wave and then predicts values with uncertainty estimates (standard deviation).

GPR Example programming concept visualization
Sklearn

GPR Example

Demonstrates Gaussian Process Regression with an RBF kernel. It initializes a GPR model, fits it to sample data, and predicts values along with their standard deviations.

HTTP Flag Search programming concept visualization
Cybersecurity

HTTP Flag Search

This Wireshark display filter searches within the HTTP data of the followed TCP stream for packets containing the string "flag=". Useful for quickly identifying potential flags or sensitive information transmitted in HTTP requests or responses.

TCP Stream Filter programming concept visualization
Cybersecurity

TCP Stream Filter

Wireshark filter to isolate and follow TCP stream number 5, useful for analyzing specific network conversations.

First/Last Child programming concept visualization
JavaScript

First/Last Child

Access the first and last element children of an element using `firstElementChild` and `lastElementChild`. These properties are useful for quickly selecting the first or last node within a parent element's children.

DOM Traversal programming concept visualization
JavaScript

DOM Traversal

DOM traversal example using parentNode, children, firstElementChild, and lastElementChild to navigate the DOM tree from a starting element.

Labeled Scatter programming concept visualization
Pandas

Labeled Scatter

Create a scatter plot and add labels to each point using annotations. This helps identify and distinguish individual data points based on a categorical variable.

Size Scatter programming concept visualization
Pandas

Size Scatter

Creates a scatter plot where the size of each point varies based on a third variable. This example uses a Pandas DataFrame to store x, y coordinates, and size data. The 's' parameter in plt.scatter controls the size of the markers.

Write Error Handling programming concept visualization
MongoDB

Write Error Handling

Illustrates error handling for write operations in MongoDB. The code attempts to update a document and specifies a write concern. If the write fails to propagate to a majority of nodes within 5 seconds, a try-catch block captures and prints the error.

Write Concern programming concept visualization
MongoDB

Write Concern

This MongoDB command inserts a document with write concern set to acknowledge writes to a majority of voting members within a timeout of 100 milliseconds. If the write concern is not met, an error is raised.

Previous Page 1 of 25 Next