This web application uses the OpenLayers library to display a polygon on a map. The polygon coordinates are fetched from the "polygon.json" file, and the map is rendered accordingly.
Assume the polygon.json file contains valid geo-coordinates in the required format.
-
Clone the Repository:
- Clone this repository to your local machine.
-
Navigate to the Project Folder:
- Open a terminal and navigate to the project folder using the
cd
command.
- Open a terminal and navigate to the project folder using the
-
Start a Local Server:
- Start a simple Python web server by running the command:
python -m http.server
- Start a simple Python web server by running the command:
-
Open the Application:
- Open a web browser and visit http://localhost:8000/index.html.
- If any issues arise, ensure that the "polygon.json" file is present and contains valid geo-coordinates.
- Adjustments to the zoom level are automatically made to fit the entire polygon on the map.
- For more information, refer to the comments in the
app.js
file.
Try it here Github Page
This Python API provides an endpoint for detecting unauthorized sales transactions from provided datasets of product listings and actual sales records. The API compares product listings against sales transactions to identify any unauthorized sales and returns the results in a specified format.
-
Input Format: Assume that the input JSON data provided in the POST request follows the specified format, with "productListings" and "salesTransactions" as the key names.
-
Data Integrity: Assume that the provided data is valid and that each product and seller ID exists and is correctly formatted.
-
Unique Product IDs: Assume that each product has a unique product ID within the given data.
-
Seller Authorization: Assume that each product listing includes a valid and authorized seller ID.
-
Clone the Repository:
- Clone this repository to your local machine.
-
Navigate to the Project Folder:
- Open a terminal and navigate to the project folder using the
cd
command.
- Open a terminal and navigate to the project folder using the
-
Run the API:
-
Execute the following command to run the API:
python Unauthorized_Sales_Detection.py
-
-
Make POST Requests:
-
Use a tool like
curl
or a programming language library (e.g., Pythonrequests
) to make POST requests to the API endpoint:curl -X POST -H "Content-Type: application/json" -d '{"productListings": [...], "salesTransactions": [...]}' http://localhost:5000/detect_unauthorized_sales
-
The API responds with a JSON object containing unauthorized sales information.
{
"unauthorizedSales": [
{"productID": "123", "unauthorizedSellerID": ["B2"]}
]
}
If an error occurs during processing, the API returns a JSON object with an error message and an appropriate HTTP status code.
{
"error": "Description of the error."
}
- If any issues arise, ensure that the input JSON data follows the specified format.
- The API follows RESTful principles and responds with appropriate HTTP status codes (e.g., 200 OK for successful requests, 400 Bad Request for invalid input).
- Try it by sending a POST request to: https://thecyberflash.pythonanywhere.com/detect_unauthorized_sales
{
"productListings": [{"productID": "123", "authorizedSellerID": "A1"}],
"salesTransactions": [{"productID": "123", "sellerID": "B2"}]
}
This Python API provides an endpoint for calculating the maximum number of non-overlapping job interviews a person can attend. The API processes POST requests containing start times and end times of job interviews, and it returns the calculated maximum number of interviews.
-
Input Format: Assume that the input JSON data provided in the POST request follows the specified format, with "start_times" and "end_times" as the key names.
-
Data Integrity: Assume that the provided data is valid and that each start and end time is correctly formatted.
-
Non-Negative Times: Assume that all start times are less than or equal to their corresponding end times.
-
Time Unit: Assume that the time units used for start and end times are consistent.
-
Clone the Repository:
- Clone this repository to your local machine.
-
Navigate to the Project Folder:
- Open a terminal and navigate to the project folder using the
cd
command.
- Open a terminal and navigate to the project folder using the
-
Run the API:
-
Execute the following command to run the API:
python Optimal_Job_Interview_Scheduling.py
-
-
Make POST Requests:
-
Use a tool like
curl
or a programming language library (e.g., Pythonrequests
) to make POST requests to the API endpoint:curl -X POST -H "Content-Type: application/json" -d '{"start_times": [...], "end_times": [...]}' http://localhost:5000/interview_schedule
-
The API responds with a JSON object containing the calculated maximum number of non-overlapping interviews.
{
"max_interviews": 3
}
If an error occurs during processing, the API returns a JSON object with an error message and an appropriate HTTP status code.
{
"error": "Description of the error."
}
- If any issues arise, ensure that the input JSON data follows the specified format.
- The API follows RESTful principles and responds with appropriate HTTP status codes (e.g., 200 OK for successful requests, 400 Bad Request for invalid input).
- Try it by sending a POST request to: https://thecyberflash.pythonanywhere.com/interview_schedule
{
"start_times": [10, 20, 30, 40, 50, 55, 65, 75],
"end_times": [15, 25, 35, 45, 55, 65, 70, 80]
}