Back to Learning

Coding

814 prompts available

4-Letter Discord Username Generator

Generate a list of 4-letter Discord usernames by creating all possible 4-letter combinations using letters A-Z (case-insensitive). For each username, determine its availability on Discord by checking against a Discord API or reliable service. Steps: 1. Generate all 4-letter strings using letters A-Z (case-insensitive). 2. For each username, check the availability status on Discord. 3. Collect the usernames along with their availability status, labeled clearly as "available" or "unavailable". 4. If real-time checking is impossible, simulate availability status but clearly indicate this limitation. Constraints: - Only generate usernames valid under Discord username policies. - Avoid excessive API calls to prevent rate limiting; implement caching or limit the number of usernames checked. Output Format: Provide the result as a JSON array where each element is an object with two properties: - "username": a 4-letter string - "availability": either "available" or "unavailable" Format example: ```json [ {"username": "abcd", "availability": "available"}, {"username": "wxyz", "availability": "unavailable"} ] ``` Make sure the output clearly distinguishes availability statuses.

5 and 15 EMA Scalping Strategy

Create a Pine Script strategy for trading that uses the 5-period and 15-period Exponential Moving Averages (EMAs) for scalping. The strategy should generate buy signals when the 5 EMA crosses above the 15 EMA and sell signals when the 5 EMA crosses below the 15 EMA. Include clear entry and exit rules based on these crossovers. Ensure the code is well-commented for clarity and follows Pine Script best practices. # Steps 1. Define the EMA lengths as 5 and 15. 2. Calculate the 5 and 15 period EMAs. 3. Detect crossover events between the 5 EMA and 15 EMA. 4. Generate buy orders when the 5 EMA crosses above the 15 EMA. 5. Generate sell orders when the 5 EMA crosses below the 15 EMA. 6. Implement exits corresponding to the buy and sell signals. 7. Add comments explaining each part of the code. # Output Format Provide the complete Pine Script strategy code enclosed in proper Pine Script syntax, ready to be used on TradingView, with comments for each logical block.

404 Page Design Code

Create a stylish and user-friendly 404 error page using React and Chakra UI. The page should include a message indicating that the page could not be found, with an option to navigate back to the home page. Use Chakra UI components for the layout and styling. Make sure the design is responsive and visually appealing. Include appropriate text and elements for user guidance.

5 Character Unlock R Code

Generate an R code snippet that unlocks or validates a 5-character code. The code should include input validation to ensure the code consists of exactly 5 characters, and it should demonstrate how to check the code against a predefined list or pattern of valid codes. Provide clear comments explaining each part of the code. # Steps 1. Define a function that accepts a 5-character code as input. 2. Validate the input length to ensure it is exactly 5 characters. 3. Define a list or vector of valid 5-character codes or specify a pattern. 4. Check if the input matches any valid code or the pattern. 5. Return an appropriate message indicating whether the code is valid (unlocked) or invalid. # Output Format Provide a complete, well-commented R script snippet illustrating the unlock code logic. # Examples ```r # Example valid codes valid_codes <- c("ABCDE", "12345", "A1B2C") # Function to unlock code unlock_code <- function(code) { if (nchar(code) != 5) { return("Error: Code must be exactly 5 characters long.") } if (code %in% valid_codes) { return("Code unlocked successfully!") } else { return("Invalid code. Access denied.") } } # Test the function unlock_code("ABCDE") # Should return success message unlock_code("XYZ12") # Should return invalid message ```

404deals API Integration

Integrate the 404deals API with the SCRAPERNAME scraper using the implementation in 404deals_api.py as a reference. Ensure the following requirements are met: 1. **Filter Deals**: Only send deals to 404deals that already meet the criteria for Discord notifications based on the `DISCOUNT_THRESHOLD` defined in `config.py`. 2. **Add Configuration**: Copy the 404deals API endpoint and token to the scraper's `config.py` file. 3. **Function Implementation**: Implement the `send_deal_to_404deals` function directly in the `notifier.py` file without creating external dependencies. ### Function Requirements: - The function must send the following required fields to the API: `title`, `url`, `old_price`, `new_price`, `discount_percentage`, and `site`. - For optional fields (`EAN`, `image_url`, `availability`), check the Discord embed creation code under the `_create_embed` method to see which fields are already utilized in the product data. Include those in the API call if present. ### Field Checks: - Examine the Discord embed code to determine the availability of `EAN`, `image_url`, and `availability`. For example, if the embed code contains something like `"thumbnail": {"url": product_data["image_url"]}`, you must include `image_url` in the API call. ### Logging and Error Handling: - Follow the existing error handling and logging patterns used throughout the scraper. ### Integration Point: - Add the 404deals API call immediately after sending the Discord notification, specifically for deals that meet the discount threshold. ### Formatting the Site Field: - Use the website's name as the `site` field in `deal_data` formatted to lower case with `.nl` appended (e.g., if the website’s name is Google, use `google.nl`). ### Proxies Configuration: - Update the scraper to read its proxies from the parent directory instead of its current folder. The proxies file is named `proxies.txt` and should be loaded from one level up from the scraper's location.

5-Digit Unlock R Code

Generate a secure R code snippet that accepts a 5-digit numeric input as an unlock code. The code should validate the input to ensure it is exactly five digits long and numeric. Implement logic to verify the entered code against a predefined correct 5-digit code. Provide user feedback indicating whether the entered code is correct (unlock successful) or incorrect (unlock failed). Ensure the code is clear, well-commented, and uses best practices for input handling and validation in R.

5-Minute Countdown Timer

Create a 5-minute countdown timer displayed on a webpage or application. The timer should count down from 5 minutes to zero, updating every second, and clearly show the remaining time in minutes and seconds (MM:SS format). Include an image that acts as a clickable link; when the user clicks this image, the 5-minute countdown timer should start displaying and begin counting down immediately. Ensure the timer stops automatically at zero and visually indicates that the countdown has completed (e.g., by showing "Time's up!" or similar). # Steps 1. Display an image prominently on the interface. 2. Make this image a clickable element with an associated link or action. 3. When the image is clicked, show the 5-minute countdown timer. 4. Update the timer display every second, showing the remaining time in MM:SS format. 5. When the timer reaches zero, stop the countdown and show a message indicating completion. # Output Format Provide the complete HTML, CSS, and JavaScript code that implements this functionality. The code should be well-structured and commented for clarity. Include placeholder URLs or image sources if necessary. # Notes - The image can be a placeholder or a sample image URL. - The timer should be user-friendly and visually clear. - The solution should work in modern web browsers.

5-Minute EMA Scalping EA

Create an expert advisor (EA) script for MetaTrader that implements a 5-minute scalping strategy based on the Exponential Moving Average (EMA). Requirements and Details: - Timeframe: 5-minute charts. - Use one or more EMA indicators to determine entry and exit points. - Define clear scalping conditions, such as entering a trade when price crosses EMA or when shorter EMA crosses longer EMA. - Include appropriate stop loss and take profit levels suitable for scalping. - The EA should manage trade entries, exits, and risk management autonomously. - Use MQL4 or MQL5 programming language. - Provide clear comments in the code explaining each part of the logic. Steps to accomplish the task: 1. Initialize indicators and parameters for EMA periods. 2. On each new tick or bar, check for EMA-based trading signals. 3. If entry conditions are met and no open position exists, open a buy or sell order. 4. Set stop loss and take profit according to scalping best practices. 5. Monitor open trades and close if exit conditions are met or profit/loss limits reached. Output Format: Provide the complete MQL4 or MQL5 script code implementing the EA, fully commented, ready to be compiled and tested in MetaTrader platform. Example (conceptual): // Initialization of EMA periods // Check for EMA crossover // Open buy/sell position // Set stop loss and take profit // Manage open trades Notes: - The scalping strategy should be simple, focusing on fast in-and-out trades. - Avoid complex or multi-timeframe signals to keep the EA lightweight. - Ensure proper money management and risk controls are in place. Ensure the code is clean, efficient, and well-documented for ease of understanding and modification.

5-Minute Pine Script Strategy

Create a profitable trading strategy using Pine Script in the TradingView Pine Editor specifically for the 5-minute timeframe. Please ensure the strategy includes clear entry and exit rules based on technical indicators or price action. The strategy should incorporate risk management elements such as stop-loss and take-profit levels. # Steps 1. Define the timeframe explicitly as 5 minutes. 2. Select appropriate indicators or patterns that work well on the 5-minute chart. 3. Set up buy and sell conditions with rationale. 4. Implement stop-loss and take-profit parameters to manage risk. 5. Test the strategy logic and ensure it is syntactically correct in Pine Script. # Output Format Return the full Pine Script code of the strategy with comments explaining key parts, suitable for direct use in TradingView's Pine Editor. # Notes - The strategy should be optimized for profitability but also consider realistic trading conditions. - Use version 5 of Pine Script. - Do not include any external libraries or dependencies.

500 GIF Code

Generate 500 lines of valid GIF code. Each line should represent a small snippet or instruction related to GIF image creation or manipulation, making up a total of 500 entries that demonstrate various aspects of GIF programming or coding structure. # Steps 1. Understand the basic structure and components of GIF coding. 2. Generate concise and valid snippets that could be part of GIF image data or instructions. 3. Ensure the combined output is exactly 500 lines. 4. Maintain clarity and correctness in each line of code or instruction. # Output Format - Output should be plain text. - Exactly 500 lines, each line containing one piece of GIF code or instruction. - No additional explanation or commentary. # Notes - Focus on diverse and relevant GIF code snippets. - Avoid repetition and ensure variety in the generated lines.

500k Token Trade Script

Create a detailed and efficient script that implements a "500k trade token" feature for the game Car Dealership Tycoon. This script should allow players to trade tokens worth 500,000 in-game currency or equivalent value within the game's mechanics. Ensure the script integrates seamlessly with the existing game systems, maintains game balance, and includes error handling for invalid trades. # Requirements - The script must handle token transactions valued at 500,000 units. - It should update players' balances accordingly upon successful trades. - Include validation to prevent trades that exceed the player's current token holdings. - Provide clear feedback messages for successful trades and errors. - Ensure compatibility with the existing Car Dealership Tycoon game architecture, using its scripting conventions and data structures. # Steps 1. Identify how tokens and player balances are stored and managed in the game. 2. Develop functions/methods to process token trades, including validation and balance updates. 3. Implement user interface elements or commands that trigger the trade feature. 4. Test the script to ensure it correctly handles normal and edge cases, such as insufficient tokens. 5. Optimize the script for performance and maintainability. # Output Format Provide the complete script code with comments explaining key sections and logic. Include any necessary integration instructions or setup steps.

500k Trade Token Script

Create a detailed and efficient script that implements a "500k trade token" feature for the game Car Dealership Tycoon. This feature should allow players to trade tokens worth exactly 500,000 units of the in-game currency or an equivalent value consistent with the game's mechanics. The script must integrate seamlessly with the existing Car Dealership Tycoon game systems, respecting its scripting conventions, data structures, and maintaining overall game balance. Key requirements: - Handle token trades valued exactly at 500,000 units. - Update players' token balances accurately and atomically after each successful trade. - Include robust validation to prevent trades that exceed the player's current token holdings. - Provide clear, user-friendly feedback messages for successful trades and error situations such as insufficient tokens. - Ensure compatibility with the Car Dealership Tycoon's existing architecture, scripting style, and data management. # Steps 1. Analyze the existing token and player balance data structures and how they are stored and updated within Car Dealership Tycoon. 2. Design and implement functions or methods to process the token trade, including validation logic to check the player’s balance and to update it accordingly. 3. Develop or integrate user interface elements or command inputs that allow the player to trigger the "500k trade token" feature smoothly. 4. Implement comprehensive error handling to cover scenarios such as insufficient tokens or invalid trade attempts, with appropriate feedback. 5. Test the script rigorously with normal cases and edge cases to ensure correctness, stability, and usability. 6. Optimize the script for clarity, performance, and maintainability, ensuring comments explain key sections, the reasoning behind logic, and integration points. # Output Format Provide the complete and ready-to-deploy script code for the Car Dealership Tycoon environment with detailed in-line comments and explanations. Include a separate section with clear instructions on integrating and setting up this script within the existing game framework, including any dependencies or configuration steps required. The script should respect all game balance constraints and provide graceful error handling to maintain a smooth user experience. # Notes - Assume access to necessary APIs or game data structures for player tokens and balances. - Preserve consistent naming conventions and coding style matching Car Dealership Tycoon. - Focus on accuracy and security of token transactions to prevent exploits. # Examples If useful, provide example snippets showing how a player triggers a trade, and the output messages displayed for success or failure. Deliver a professional, coherent, and thoroughly annotated script ready to be integrated into Car Dealership Tycoon.

Page 20 of 68

    Coding Prompts - Learning AI Prompts | Elevato