Stored procedures

javascript

Calculate Distance Between Two Points

This JavaScript code defines a function calculateDistance that computes the Euclidean distance...

json python

Python Code Snippet: Simple RESTful API with FastAPI

This Python snippet uses FastAPI to create a simple RESTful API for managing a list of books. It...

python

Sort List of Objects by Attribute in Python

This Python code defines a Person class, creates instances of Person, and then sorts the list of...

python

List Files in a Directory Using os Module

This Python script lists all files and directories in a specified path with proper error...

javascript

JavaScript Validate URL

This JavaScript code defines a function isValidURL that uses a regular expression (urlRegex) to...

javascript

JavaScript Remove Duplicates from an Array

This JavaScript code removes duplicates from an array by converting it to a Set, which...

php

Laravel Validation Rules for User Registration

This Laravel Form Request validation code defines rules for user registration. The 'name' field...